2013-05-28 05:48:21 -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) {
|
2013-06-03 22:46:22 -07:00
|
|
|
final MagicTargetFilter<MagicPermanent> targetFilter = new MagicOtherPermanentTargetFilter(
|
2013-04-12 19:32:25 -07:00
|
|
|
MagicTargetFilter.TARGET_ZOMBIE_YOU_CONTROL,permanent);
|
|
|
|
final int amount = game.filterPermanents(player,targetFilter).size() +
|
|
|
|
game.filterCards(player,MagicTargetFilter.TARGET_ZOMBIE_CARD_FROM_GRAVEYARD).size();
|
|
|
|
game.doAction(new MagicChangeCountersAction(
|
|
|
|
permanent,
|
|
|
|
MagicCounterType.PlusOne,
|
|
|
|
amount,
|
|
|
|
true
|
|
|
|
));
|
|
|
|
return MagicEvent.NONE;
|
|
|
|
}
|
2013-05-28 05:48:21 -07:00
|
|
|
},
|
|
|
|
new MagicIfDamageWouldBeDealtTrigger(4) {
|
2013-04-12 19:32:25 -07:00
|
|
|
@Override
|
|
|
|
public MagicEvent executeTrigger(
|
|
|
|
final MagicGame game,
|
|
|
|
final MagicPermanent permanent,
|
|
|
|
final MagicDamage damage) {
|
|
|
|
if (!damage.isUnpreventable() &&
|
|
|
|
damage.getAmount() > 0 &&
|
|
|
|
damage.getTarget() == permanent) {
|
|
|
|
|
|
|
|
// Prevention effect.
|
|
|
|
damage.setAmount(0);
|
|
|
|
|
|
|
|
return new MagicEvent(
|
|
|
|
permanent,
|
|
|
|
this,
|
|
|
|
"Remove a +1/+1 counter from SN."
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return MagicEvent.NONE;
|
|
|
|
}
|
|
|
|
@Override
|
2013-05-28 05:48:21 -07:00
|
|
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
2013-04-12 19:32:25 -07:00
|
|
|
game.doAction(new MagicChangeCountersAction(
|
|
|
|
event.getPermanent(),
|
|
|
|
MagicCounterType.PlusOne,
|
|
|
|
-1,
|
|
|
|
true
|
|
|
|
));
|
|
|
|
}
|
2013-05-28 05:48:21 -07:00
|
|
|
}
|
|
|
|
]
|