magarena/release/Magarena/scripts/Rakish_Heir.groovy

27 lines
1.0 KiB
Groovy
Raw Normal View History

2013-05-18 19:32:09 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
final MagicPlayer player = permanent.getController();
final MagicSource dmgSource = damage.getSource();
return (damage.isCombat() &&
damage.getTarget().isPlayer() &&
dmgSource.getController() == player &&
dmgSource.isPermanent() &&
dmgSource.hasSubType(MagicSubType.Vampire)) ?
new MagicEvent(
permanent,
player,
dmgSource,
this,
"Put a +1/+1 counter on RN."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeCountersAction(event.getRefPermanent(),MagicCounterType.PlusOne,1,true));
}
}
]