magarena/release/Magarena/scripts/Demonlord_of_Ashmouth.groovy

39 lines
1.5 KiB
Groovy
Raw Normal View History

2013-05-28 01:18:42 -07:00
[
new MagicWhenComesIntoPlayTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
2013-06-19 07:23:35 -07:00
final MagicPayedCost payedCost) {
2013-04-12 19:32:25 -07:00
final MagicTargetChoice targetChoice = new MagicTargetChoice(
new MagicOtherPermanentTargetFilter(
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL,
permanent
),
2013-04-12 19:32:25 -07:00
MagicTargetHint.None,
"another creature to sacrifice"
);
return new MagicEvent(
permanent,
new MagicMayChoice(targetChoice),
MagicSacrificeTargetPicker.create(),
this,
2013-05-28 01:18:42 -07:00
"PN may\$ sacrifice another creature\$. If you don't, exile SN."
2013-04-12 19:32:25 -07:00
);
}
@Override
2013-05-28 01:18:42 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
final MagicPermanent permanent = event.getPermanent();
if (event.isYes()) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicSacrificeAction(creature));
}
});
} else {
game.doAction(new MagicRemoveFromPlayAction(permanent,MagicLocationType.Exile));
}
}
2013-05-28 01:18:42 -07:00
}
]