59 lines
2.1 KiB
Groovy
59 lines
2.1 KiB
Groovy
[
|
|
new MagicWhenComesIntoPlayTrigger() {
|
|
@Override
|
|
public MagicEvent executeTrigger(
|
|
final MagicGame game,
|
|
final MagicPermanent permanent,
|
|
final MagicPlayer player) {
|
|
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
|
|
));
|
|
}
|
|
},
|
|
new MagicLandfallTrigger() {
|
|
@Override
|
|
public MagicEvent getEvent(final MagicPermanent permanent) {
|
|
return new MagicEvent(
|
|
permanent,
|
|
new MagicSimpleMayChoice(
|
|
MagicSimpleMayChoice.ADD_CHARGE_COUNTER,
|
|
1,
|
|
MagicSimpleMayChoice.DEFAULT_YES
|
|
),
|
|
this,
|
|
"PN may\$ put a +1/+1 counter on each " +
|
|
"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
|
|
));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|