magarena/release/Magarena/scripts/Arcbound_Fiend.groovy

30 lines
1.3 KiB
Groovy
Raw Normal View History

2013-05-25 20:18:34 -07:00
[
new MagicAtUpkeepTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
return permanent.isController(upkeepPlayer) ?
new MagicEvent(
permanent,
new MagicMayChoice(MagicTargetChoice.TARGET_CREATURE_PLUSONE_COUNTER),
this,
2013-05-25 20:18:34 -07:00
"PN may\$ move a +1/+1 counter from " +
"target creature\$ onto SN."
):
2013-04-12 19:32:25 -07:00
MagicEvent.NONE;
}
@Override
2013-05-25 20:18:34 -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 creature) {
if (creature.getCounters(MagicCounterType.PlusOne) > 0) {
game.doAction(new MagicChangeCountersAction(event.getPermanent(),MagicCounterType.PlusOne,1,true));
game.doAction(new MagicChangeCountersAction(creature,MagicCounterType.PlusOne,-1,true));
}
}
});
}
}
2013-05-25 20:18:34 -07:00
}
]