magarena/release/Magarena/scripts/Avenger_of_Zendikar.groovy

59 lines
2.1 KiB
Groovy
Raw Normal View History

2013-05-30 05:56:39 -07:00
[
new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
2013-06-19 07:23:35 -07:00
final MagicPayedCost payedCost) {
2013-05-30 05:56:39 -07:00
return new MagicEvent(
permanent,
this,
"PN puts a 0/1 green Plant creature token onto " +
"the battlefield for each land he or she controls."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
int amount = player.getNrOfPermanentsWithType(MagicType.Land);
game.doAction(new MagicPlayTokensAction(
player,
TokenCardDefinitions.get("Plant"),
amount
));
2013-06-23 18:29:26 -07:00
}
2013-05-30 05:56:39 -07:00
},
new MagicLandfallTrigger() {
@Override
public MagicEvent getEvent(final MagicPermanent permanent) {
return new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.ADD_CHARGE_COUNTER,
1,
MagicSimpleMayChoice.DEFAULT_YES
),
this,
2013-05-30 06:27:18 -07:00
"PN may\$ put a +1/+1 counter on each " +
2013-05-30 05:56:39 -07:00
"Plant creature he or she controls."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
final Collection<MagicPermanent> targets = game.filterPermanents(
event.getPlayer(),
MagicTargetFilter.TARGET_PLANT_YOU_CONTROL);
for (final MagicPermanent target : targets) {
game.doAction(new MagicChangeCountersAction(
target,
MagicCounterType.PlusOne,
1,
true
));
}
}
2013-06-23 18:29:26 -07:00
}
2013-05-30 05:56:39 -07:00
}
]