magarena/incomplete/Coercion.groovy

36 lines
1.1 KiB
Groovy

def Discard = {
final MagicGame game, final MagicEvent event ->
event.processChosenCards(game, {
final MagicCard card ->
game.doAction(new MagicDiscardCardAction(event.getRefPlayer(),card));
});
};
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_OPPONENT,
this,
"Target opponent\$ reveals his or her hand. PN chooses a card from it. That player discards that card. "
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPlayer(game, {
final MagicPlayer player ->
game.addEvent(new MagicEvent(
event.getSource(),
new MagicFromCardListChoice(player.getHand(),1),
player,
Discard,
""
));
});
}
}
]