magarena/release/Magarena/scripts/Wild_Defiance.groovy

41 lines
1.5 KiB
Groovy
Raw Normal View History

2013-05-26 22:25:23 -07:00
[
new MagicWhenTargetedTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicItemOnStack itemOnStack) {
if (!itemOnStack.isInstantOrSorcerySpell()) {
2013-04-12 19:32:25 -07:00
return MagicEvent.NONE;
}
2013-06-23 18:29:26 -07:00
2013-04-12 19:32:25 -07:00
final Collection<MagicPermanent> targets = game.filterPermanents(
permanent.getController(),
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL);
MagicPermanent targetedPerm = MagicPermanent.NONE;
for (final MagicPermanent perm : targets) {
if (itemOnStack.containsInChoiceResults(perm) &&
perm.isCreature() &&
perm.getController() == permanent.getController()) {
targetedPerm = perm;
break;
}
}
return (targetedPerm != MagicPermanent.NONE) ?
new MagicEvent(
permanent,
permanent.getController(),
targetedPerm,
this,
2013-05-26 22:25:23 -07:00
"RN gets +3/+3 until end of turn."
):
2013-04-12 19:32:25 -07:00
MagicEvent.NONE;
}
2013-06-23 18:29:26 -07:00
2013-04-12 19:32:25 -07:00
@Override
2013-05-26 22:25:23 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
game.doAction(new MagicChangeTurnPTAction(event.getRefPermanent(),3,3));
}
2013-05-26 22:25:23 -07:00
}
]