magarena/release/Magarena/scripts/Sword_of_Fire_and_Ice.groovy

30 lines
1.2 KiB
Groovy

[
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
return (damage.getSource()==permanent.getEquippedCreature() &&
damage.getTarget().isPlayer() &&
damage.isCombat()) ?
new MagicEvent(
permanent,
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,
new MagicDamageTargetPicker(2),
this,
"SN deals 2 damage to target creature or player\$ and PN draws a card."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTarget(game,new MagicTargetAction() {
public void doAction(final MagicTarget target) {
final MagicDamage damage=new MagicDamage(event.getPermanent(),target,2);
game.doAction(new MagicDealDamageAction(damage));
game.doAction(new MagicDrawAction(event.getPlayer(),1));
}
});
}
}
]