magarena/release/Magarena/scripts/Ferocity.groovy

39 lines
1.4 KiB
Groovy
Raw Normal View History

2013-05-30 05:22:54 -07:00
def action = {
final MagicGame game, final MagicEvent event ->
if (event.isYes()) {
game.doAction(new MagicChangeCountersAction(event.getRefPermanent(),MagicCounterType.PlusOne,1,true));
}
2013-05-30 05:38:46 -07:00
} as MagicEventAction
2013-05-30 05:22:54 -07:00
def event = {
2013-06-23 18:29:26 -07:00
final MagicPermanent permanent, final MagicPermanent target ->
2013-05-30 05:22:54 -07:00
return new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.ADD_PLUSONE_COUNTER,
1,
MagicSimpleMayChoice.DEFAULT_YES
),
target ,
action,
"PN may put a +1/+1 counter on RN."
);
}
[
new MagicWhenBecomesBlockedTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
final MagicPermanent enchantedCreature = permanent.getEnchantedCreature();
return (creature == enchantedCreature) ? event(permanent, enchantedCreature) : MagicEvent.NONE;
}
},
new MagicWhenBlocksTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
final MagicPermanent enchantedCreature = permanent.getEnchantedCreature();
return (creature == enchantedCreature) ? event(permanent, enchantedCreature) : MagicEvent.NONE;
}
}
]