2013-05-26 03:21:41 -07:00
|
|
|
[
|
|
|
|
new MagicAtUpkeepTrigger() {
|
|
|
|
@Override
|
|
|
|
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
|
2013-06-23 18:29:26 -07:00
|
|
|
return (permanent.isController(upkeepPlayer) &&
|
2013-05-26 03:21:41 -07:00
|
|
|
permanent.hasState(MagicPermanentState.MustPayEchoCost)) ?
|
|
|
|
new MagicEvent(
|
|
|
|
permanent,
|
|
|
|
new MagicMayChoice(),
|
|
|
|
this,
|
|
|
|
"PN may\$ discard a card. " +
|
|
|
|
"If he or she doesn't, sacrifice SN."
|
|
|
|
):
|
|
|
|
MagicEvent.NONE;
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
|
|
|
final MagicPermanent permanent = event.getPermanent();
|
|
|
|
if (event.isYes() && event.getPlayer().getHandSize() > 0) {
|
|
|
|
game.addEvent(new MagicDiscardEvent(
|
|
|
|
permanent,
|
2013-06-21 20:55:22 -07:00
|
|
|
event.getPlayer()
|
2013-05-26 03:21:41 -07:00
|
|
|
));
|
2013-06-21 23:40:39 -07:00
|
|
|
game.doAction(MagicChangeStateAction.Clear(
|
2013-05-26 03:21:41 -07:00
|
|
|
permanent,
|
2013-06-21 23:40:39 -07:00
|
|
|
MagicPermanentState.MustPayEchoCost
|
2013-05-26 03:21:41 -07:00
|
|
|
));
|
|
|
|
} else {
|
|
|
|
game.doAction(new MagicSacrificeAction(permanent));
|
|
|
|
}
|
2013-06-23 18:29:26 -07:00
|
|
|
}
|
2013-05-26 03:21:41 -07:00
|
|
|
}
|
|
|
|
]
|