magarena/release/Magarena/scripts/Cathars__Crusade.groovy

36 lines
1.2 KiB
Groovy
Raw Normal View History

2013-05-18 22:56:38 -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,
this,
"PN puts a +1/+1 counter on " +
"each creature he or she controls."
) :
MagicEvent.NONE;
}
2013-06-23 18:29:26 -07:00
2013-04-12 19:32:25 -07:00
@Override
2013-05-18 22:56:38 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
final Collection<MagicPermanent> targets = game.filterPermanents(
2013-05-18 22:56:38 -07:00
event.getPlayer(),
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL
);
2013-04-12 19:32:25 -07:00
for (final MagicPermanent target : targets) {
game.doAction(new MagicChangeCountersAction(
target,
MagicCounterType.PlusOne,
1,
true
));
}
}
2013-05-18 22:56:38 -07:00
}
]