magarena/release/Magarena/scripts/Infiltration_Lens.groovy

26 lines
916 B
Groovy

[
new MagicWhenBlocksTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
return (permanent.getEquippedCreature() == creature.getBlockedCreature()) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.DRAW_CARDS,
2,
MagicSimpleMayChoice.DEFAULT_NONE
),
this,
"PN may\$ draw two cards."
) :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicDrawAction(event.getPlayer(),2));
}
}
}
]