magarena/release/Magarena/scripts/Argentum_Armor.groovy

25 lines
929 B
Groovy

[
new MagicWhenAttacksTrigger(1) {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent attacker) {
return permanent.getEquippedCreature() == attacker ?
new MagicEvent(
permanent,
MagicTargetChoice.TARGET_PERMANENT,
new MagicDestroyTargetPicker(false),
this,
"Destroy target permanent\$."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent permanent) {
game.doAction(new MagicDestroyAction(permanent));
}
});
}
}
]