magarena/release/Magarena/scripts/Indebted_Samurai.groovy

29 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-18 18:42:28 -07:00
[
new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return (otherPermanent.isCreature() &&
otherPermanent.isFriend(permanent) &&
otherPermanent.hasSubType(MagicSubType.Samurai)) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.ADD_PLUSONE_COUNTER,
1,
2013-05-18 18:42:28 -07:00
MagicSimpleMayChoice.DEFAULT_YES
),
2013-04-12 19:32:25 -07:00
this,
2013-05-18 18:42:28 -07:00
"PN may\$ put a +1/+1 counter on SN."
):
2013-04-12 19:32:25 -07:00
MagicEvent.NONE;
}
@Override
2013-05-18 18:42:28 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
if (event.isYes()) {
game.doAction(new MagicChangeCountersAction(event.getPermanent(),MagicCounterType.PlusOne,1,true));
}
}
2013-05-18 18:42:28 -07:00
}
]