Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
The "Recover" mechanic
Moderator: CCGHQ Admins
The "Recover" mechanic
by Shatterhouse » 22 Apr 2011, 04:28
Cards with "Recover (cost)" let you return them from your graveyard to your hand when one of your creatures is put into your graveyard from the battlefield, if you pay the cost. You only get one chance. If you don't pay it, the card is exiled. It shouldn't trigger if an opponent's creature goes to the graveyard, and it shouldn't trigger if your creature wound up there from anywhere else(i.e. via discarding or counterspell)
Here's how you make a card with this ability(Icefall is the example):
Here's how you make a card with this ability(Icefall is the example):
- Code: Select all
<TRIGGERED_ABILITY tag="ICEFALL_RULE2" zone="Graveyard" layer="0" auto_skip="1">
<TRIGGER value="HIT_GRAVEYARD">
return ((TriggerObject():GetCardType():Test(CARD_TYPE_CREATURE) ~= 0) and (TriggerObject():GetErstwhileZone() == ZONE_IN_PLAY) and (TriggerObject():GetPlayer() == Object():GetPlayer() ) and (Object():GetZone() == ZONE_GRAVEYARD))
</TRIGGER>
<COST qualifier="Conditional" type="Mana" cost="{R}{R}" />
<EFFECT>
Object():PutInHand()
Object():GuidedReveal( ZONE_GRAVEYARD, ZONE_HAND )
</EFFECT>
<ELSE_EFFECT>
Object():RemoveFromGame()
</ELSE_EFFECT>
</TRIGGERED_ABILITY>
- Shatterhouse
- Posts: 72
- Joined: 20 Apr 2011, 00:07
- Has thanked: 0 time
- Been thanked: 2 times
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 21 guests