magarena/release/Magarena/scripts/Elven_Warhounds.groovy

27 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-18 18:28:48 -07:00
[
new MagicWhenBecomesBlockedTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent attacker) {
if (permanent != attacker) {
return MagicEvent.NONE;
}
final MagicPermanentList plist = new MagicPermanentList(permanent.getBlockingCreatures());
return new MagicEvent(
permanent,
plist,
this,
plist.size() == 1 ?
"Put " + plist.get(0) + " on top of its owner's library." :
"Put blocking creatures on top of their owner's library."
);
}
@Override
2013-05-18 18:28:48 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
final MagicPermanentList plist = event.getRefPermanentList();
for (final MagicPermanent blocker : plist) {
game.doAction(new MagicRemoveFromPlayAction(blocker,MagicLocationType.TopOfOwnersLibrary));
}
}
2013-05-18 18:28:48 -07:00
}
]