magarena/release/Magarena/scripts/Narcolepsy.groovy

26 lines
1013 B
Groovy
Raw Normal View History

2013-04-01 06:52:59 -07:00
[
new MagicAtUpkeepTrigger() {
2012-06-17 05:19:08 -07:00
@Override
2012-10-07 02:12:39 -07:00
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
2012-06-17 05:19:08 -07:00
final MagicPermanent enchantedCreature=permanent.getEnchantedCreature();
2011-10-31 23:48:06 -07:00
return (enchantedCreature.isValid() && enchantedCreature.isUntapped()) ?
2011-08-13 06:37:22 -07:00
new MagicEvent(
2012-10-07 02:12:39 -07:00
permanent,
this,
"If "+enchantedCreature+" is untapped, tap it."
):
2011-09-04 01:19:43 -07:00
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
@Override
public void executeEvent(
2011-08-12 19:35:49 -07:00
final MagicGame game,
2013-03-22 22:00:53 -07:00
final MagicEvent event) {
2012-09-06 07:27:43 -07:00
final MagicPermanent permanent=event.getPermanent();
2012-06-17 05:19:08 -07:00
final MagicPermanent enchantedCreature=permanent.getEnchantedCreature();
if (enchantedCreature.isValid()) {
game.doAction(new MagicTapAction(enchantedCreature,true));
}
}
2013-04-01 06:52:59 -07:00
}
]