magarena/release/Magarena/scripts/Blade_of_the_Bloodchief.groovy

28 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-18 20:12:58 -07:00
[
new MagicWhenOtherDiesTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
final MagicPermanent equippedCreature = permanent.getEquippedCreature();
return (equippedCreature.isValid() && otherPermanent.isCreature()) ?
new MagicEvent(
permanent,
this,
2013-06-23 18:29:26 -07:00
"Put a +1/+1 counter on equipped creature. " +
2013-04-12 19:32:25 -07:00
"If equipped creature is a Vampire, put two +1/+1 counters on it instead."
):
MagicEvent.NONE;
}
@Override
2013-05-18 20:12:58 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
final MagicPermanent equippedCreature = event.getPermanent().getEquippedCreature();
final int amount = equippedCreature.hasSubType(MagicSubType.Vampire) ? 2 : 1;
game.doAction(new MagicChangeCountersAction(
equippedCreature,
MagicCounterType.PlusOne,
amount,
true
));
}
2013-05-18 20:12:58 -07:00
}
]