magarena/release/Magarena/scripts/Craterhoof_Behemoth.groovy

29 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-18 22:30:53 -07:00
[
new MagicWhenComesIntoPlayTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPlayer player) {
return new MagicEvent(
permanent,
this,
"Creatures PN controls gain trample " +
"and get +X/+X until end of turn, where X is " +
"the number of creatures PN controls."
);
}
@Override
2013-05-18 22:30:53 -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(
event.getPlayer(),
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL);
final int amount = targets.size();
for (final MagicPermanent creature : targets) {
game.doAction(new MagicSetAbilityAction(creature,MagicAbility.Trample));
game.doAction(new MagicChangeTurnPTAction(creature,amount,amount));
}
}
2013-05-18 22:30:53 -07:00
}
]