magarena/release/Magarena/scripts/Boggart_Shenanigans.groovy

34 lines
1.2 KiB
Groovy
Raw Normal View History

2013-05-25 19:39:18 -07:00
[
new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
2013-06-23 18:29:26 -07:00
final MagicPermanent permanent,
2013-05-25 19:39:18 -07:00
final MagicPermanent died) {
return (died != permanent &&
died.hasSubType(MagicSubType.Goblin) &&
died.isFriend(permanent)) ?
new MagicEvent(
permanent,
new MagicMayChoice(MagicTargetChoice.NEG_TARGET_PLAYER),
new MagicDamageTargetPicker(1),
this,
2013-05-25 19:43:47 -07:00
"PN may\$ have SN deal 1 damage to target player\$."
2013-06-23 18:29:26 -07:00
) :
2013-05-25 19:39:18 -07:00
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
event.processTarget(game, new MagicTargetAction() {
public void doAction(final MagicTarget target) {
final MagicDamage damage = new MagicDamage(event.getSource(), target, 1);
game.doAction( new MagicDealDamageAction(damage) );
}
});
}
}
}
]