Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk



Making things deal damage to other things
Moderator: CCGHQ Admins
Making things deal damage to other things
by Shatterhouse » 11 Jun 2011, 02:44
Playing around with Searing Blaze led me to this.
Object():GetTargetCard():DealDamage( Object():GetTargetCard():GetCurrentPower(), Object():GetTargetCard() )
The bold part in the above damage function is the source of the damage. For normal spells like Shock, that would be itself, or Object(), because the spell itself does the damage to its target. The above code is for Kiku's Shadow. It causes a creature to do damage to itself equal to its power. It's cool, because you can use it on something like Phyrexian Obliterator, and the source of the damage is the creature itself, so the Obliterator's controller has to sacrifice permanents instead of you.
This opens the door for other spells like Soul's Fire that you might want to use on a creature that has a dealt-damage-trigger, like Abyssal Specter.
Object():GetTargetCard():DealDamage( Object():GetTargetCard():GetCurrentPower(), Object():GetTargetCard() )
The bold part in the above damage function is the source of the damage. For normal spells like Shock, that would be itself, or Object(), because the spell itself does the damage to its target. The above code is for Kiku's Shadow. It causes a creature to do damage to itself equal to its power. It's cool, because you can use it on something like Phyrexian Obliterator, and the source of the damage is the creature itself, so the Obliterator's controller has to sacrifice permanents instead of you.
This opens the door for other spells like Soul's Fire that you might want to use on a creature that has a dealt-damage-trigger, like Abyssal Specter.
- Code: Select all
<SPELL_ABILITY tag="KIKUS_SHADOW_RULE_1" layer="0">
<TARGET_DETERMINATION>
return TargetCreatureBad()
</TARGET_DETERMINATION>
<PLAYTIME>
ChooseTargetCreature()
</PLAYTIME>
<EFFECT>
Object():GetTargetCard():DealDamage( Object():GetTargetCard():GetCurrentPower(), Object():GetTargetCard() )
</EFFECT>
</SPELL_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 6 guests