2013-05-18 22:40:57 -07:00
|
|
|
[
|
|
|
|
new MagicWhenOtherComesIntoPlayTrigger() {
|
2013-04-12 19:32:25 -07:00
|
|
|
@Override
|
|
|
|
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
|
2013-06-23 18:29:26 -07:00
|
|
|
return (otherPermanent.isCreature() &&
|
2013-04-12 19:32:25 -07:00
|
|
|
otherPermanent.isFriend(permanent)) ?
|
|
|
|
new MagicEvent(
|
|
|
|
permanent,
|
|
|
|
new MagicMayChoice(
|
2013-05-18 22:40:57 -07:00
|
|
|
MagicTargetChoice.NEG_TARGET_ARTIFACT_OR_ENCHANTMENT
|
|
|
|
),
|
2013-10-27 20:30:35 -07:00
|
|
|
MagicDestroyTargetPicker.Destroy,
|
2013-04-12 19:32:25 -07:00
|
|
|
this,
|
2013-05-18 22:40:57 -07:00
|
|
|
"PN may\$ destroy target artifact or enchantment\$."
|
|
|
|
):
|
2013-04-12 19:32:25 -07:00
|
|
|
MagicEvent.NONE;
|
|
|
|
}
|
2013-06-23 18:29:26 -07:00
|
|
|
|
2013-04-12 19:32:25 -07:00
|
|
|
@Override
|
2013-05-18 22:40:57 -07:00
|
|
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
2013-04-12 19:32:25 -07:00
|
|
|
if (event.isYes()) {
|
|
|
|
event.processTargetPermanent(game,new MagicPermanentAction() {
|
|
|
|
public void doAction(final MagicPermanent permanent) {
|
|
|
|
game.doAction(new MagicDestroyAction(permanent));
|
|
|
|
}
|
|
|
|
});
|
2013-06-23 18:29:26 -07:00
|
|
|
}
|
2013-04-12 19:32:25 -07:00
|
|
|
}
|
2013-05-18 22:40:57 -07:00
|
|
|
}
|
|
|
|
]
|