It is currently 25 Apr 2024, 17:22
   
Text Size

Scripting custom card

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Scripting custom card

Postby Djebb » 23 Jan 2015, 19:07

Hi there !
I'm adding a set i made myself on forge and i've got a problem with one of my creature.
That creature has an activated abilities whose cost is "Shuffle a random card from your hand into your library :" .
Is it somehow possible to do this ? And if it is, may someone help me ? :D
Thanks a lot :) !

Djebb
Djebb
 
Posts: 77
Joined: 06 Dec 2014, 19:44
Has thanked: 1 time
Been thanked: 1 time

Re: Scripting custom card

Postby friarsol » 23 Jan 2015, 19:23

I doubt that's possible, since I don't believe any card in Magic has that cost. Probably the closest we have is Hidden Retreat.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Scripting custom card

Postby Djebb » 23 Jan 2015, 21:37

Weird. I don't have Hidden Retreat on my computer O.o. Seems like forge is missing 2 cards from Stronghold including Hidden Retreat. How may this happen ? o.O
Djebb
 
Posts: 77
Joined: 06 Dec 2014, 19:44
Has thanked: 1 time
Been thanked: 1 time

Re: Scripting custom card

Postby friarsol » 23 Jan 2015, 21:54

Ah sorry, I didn't mean Forge had it. I meant the closest thing in Magic. Leashling has that same cost though, and it is supported by Forge.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Scripting custom card

Postby Djebb » 23 Jan 2015, 22:40

friarsol wrote:Ah sorry, I didn't mean Forge had it.
xD That's why.

Thanks for the Leashling card. I think it'd be better if I remove the 'random' part.
I just need to add a 'shuffle' fonction to make it work i guess.
Djebb
 
Posts: 77
Joined: 06 Dec 2014, 19:44
Has thanked: 1 time
Been thanked: 1 time

Re: Scripting custom card

Postby Djebb » 25 Jan 2015, 01:44

Yop there.
I've got a litle probleme here
I've made a pretty weird creature :
1st ability : Whenever an opponent casts a spell during your turn, if this spell is the 1st that opponent has cast this turn, the spell is countered
2nd ability (named 'Psionic') : Whenever an opponent casts a spell during your turn, if you have more cards in your hand than this opponent, the spell is countered.

The thing is, when my opp casts a spell during my turn, the game doesn't seem to care about the 1st ability (it just doens't trigger)
Plus, all the spell my opp casts during my turn is countered, even if he has more cards than me.

I just don't get where my mistakes are.

Here's my code if someone can help me :D

Code: Select all
T:Mode$ SpellCast | ValidActivatingPlayer$ Player.Opponent | TriggerZones$ Battlefield | PlayerTurn$ True | CheckSVar$ HeCastThisTurn | SVarCompare$ EQ2 | Execute$ TrigCounter | TriggerDescription$ Whenever an opponent casts a spell during your turn, if this spell is the first that opponent has cast this turn, the spell is countered
T:Mode$ SpellCast | ValidActivatingPlayer$ Player.Opponent | TriggerZones$ Battlefield | PlayerTurn$ True | ConditionCheckSVar$ Y | ConditionSVarCompare$ LE0 | References$ X,Y | Execute$ TrigCounter | TriggerDescription$ Psionic - Whenever an opponent casts a spell during your turn, if you have more cards in your hand than this opponent, the spell is countered.
SVar:X:Count$CardsInHand
SVar:Y:TriggeredSourceController$InYourHand/Minus.X
SVar:HeCastThisTurn:TriggeredSourceController$ThisTurnCast_Card.
SVar:TrigCounter:AB$ Pump | Cost$ 0 | RememberObjects$ TriggeredCard | SubAbility$ DBCounter
SVar:DBCounter:DB$ Counter | Defined$ TriggeredSpellAbility | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:RemRandomDeck:True
Djebb
 
Posts: 77
Joined: 06 Dec 2014, 19:44
Has thanked: 1 time
Been thanked: 1 time


Return to Forge

Who is online

Users browsing this forum: No registered users and 125 guests


Who is online

In total there are 125 users online :: 0 registered, 0 hidden and 125 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 125 guests

Login Form