magarena/release/Magarena/scripts/Mask_of_Memory.groovy

39 lines
1.3 KiB
Groovy
Raw Normal View History

2013-05-25 19:38:39 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicDamage damage) {
return (permanent.getEquippedCreature() == damage.getSource() &&
damage.getTarget().isPlayer() &&
damage.isCombat()) ?
2012-10-03 02:49:43 -07:00
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.DRAW_CARDS,
2,
MagicSimpleMayChoice.DEFAULT_NONE
),
this,
2013-05-25 19:43:47 -07:00
"You may\$ draw two cards. If you do, discard a card."
2012-10-03 02:49:43 -07:00
) :
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
2012-06-17 05:19:08 -07:00
@Override
2013-05-25 19:38:39 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
2012-09-01 19:39:48 -07:00
final MagicPlayer player = event.getPlayer();
2012-06-17 05:19:08 -07:00
game.doAction(new MagicDrawAction(player, 2));
game.addEvent(new MagicDiscardEvent(
2013-05-25 19:38:39 -07:00
event.getSource(),
player,
1,
false
));
2012-06-17 05:19:08 -07:00
}
}
2013-05-25 19:38:39 -07:00
}
]