magarena/release/Magarena/scripts/Farrel_s_Zealot.groovy

40 lines
1.6 KiB
Groovy
Raw Normal View History

2013-05-27 02:40:46 -07:00
[
new MagicWhenAttacksUnblockedTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
return (creature == permanent) ?
new MagicEvent(
permanent,
new MagicMayChoice(MagicTargetChoice.NEG_TARGET_CREATURE),
new MagicDamageTargetPicker(3),
this,
2013-05-27 02:40:46 -07:00
"PN may\$ have SN deal 3 damage to target creature\$. " +
"If you do, SN assigns no combat damage this turn."
2013-04-12 19:32:25 -07:00
) :
MagicEvent.NONE;
}
@Override
2013-05-27 02:40:46 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
if (event.isYes()) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
final MagicPermanent permanent = event.getPermanent();
final MagicDamage damage = new MagicDamage(
permanent,
creature,
3
);
game.doAction(new MagicDealDamageAction(damage));
game.doAction(new MagicChangeStateAction(
2013-05-27 02:40:46 -07:00
permanent,
MagicPermanentState.NoCombatDamage,
true
));
2013-04-12 19:32:25 -07:00
}
});
}
}
2013-05-27 02:40:46 -07:00
}
]