24 lines
970 B
Groovy
24 lines
970 B
Groovy
[
|
|
new MagicWhenDamageIsDealtTrigger() {
|
|
@Override
|
|
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
|
|
return (damage.getSource() == permanent &&
|
|
damage.isCombat() &&
|
|
damage.getTarget().isPlayer()) ?
|
|
new MagicEvent(
|
|
permanent,
|
|
this,
|
|
"PN puts a token that's a copy of SN onto the battlefield."
|
|
):
|
|
MagicEvent.NONE;
|
|
}
|
|
@Override
|
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
|
final MagicPlayer player = event.getPlayer();
|
|
final MagicPermanent permanent = event.getPermanent();
|
|
final MagicCard card = MagicCard.createTokenCard(permanent.getCardDefinition(),player);
|
|
game.doAction(new MagicPlayCardAction(card,player));
|
|
}
|
|
}
|
|
]
|