magarena/release/Magarena/scripts/Dissipation_Field.groovy

26 lines
880 B
Groovy
Raw Normal View History

2013-04-01 06:45:15 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
2012-09-03 05:33:11 -07:00
final MagicSource dmgSource=damage.getSource();
2012-09-22 07:06:09 -07:00
return (permanent.isController(damage.getTarget()) && dmgSource.isPermanent()) ?
2011-08-13 08:52:26 -07:00
new MagicEvent(
2012-09-22 07:06:09 -07:00
permanent,
dmgSource,
2012-09-22 07:06:09 -07:00
this,
2013-04-01 06:45:15 -07:00
"Return RN to its owner's hand."
2012-09-22 07:06:09 -07:00
):
2011-09-04 01:19:43 -07:00
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
@Override
public void executeEvent(
2011-08-13 08:52:26 -07:00
final MagicGame game,
2013-03-22 22:00:53 -07:00
final MagicEvent event) {
2012-06-17 05:19:08 -07:00
game.doAction(new MagicRemoveFromPlayAction(
event.getRefPermanent(),
2012-09-22 07:06:09 -07:00
MagicLocationType.OwnersHand
));
2012-06-17 05:19:08 -07:00
}
2013-04-01 06:45:15 -07:00
}
]