magarena/release/Magarena/scripts/Mage_Slayer.groovy

24 lines
1022 B
Groovy
Raw Normal View History

2013-05-18 03:37:09 -07:00
[
new MagicWhenAttacksTrigger(1) {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
final MagicPermanent equippedCreature=permanent.getEquippedCreature();
final MagicPlayer player=permanent.getController();
return (equippedCreature.isValid() && equippedCreature==creature) ?
new MagicEvent(
equippedCreature,
player.getOpponent(),
this,
"SN deals damage equal to its power to PN."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanent permanent=event.getPermanent();
final MagicDamage damage=new MagicDamage(permanent,event.getPlayer(),permanent.getPower());
game.doAction(new MagicDealDamageAction(damage));
}
}
]