magarena/release/Magarena/scripts/Enslave.groovy

31 lines
1.0 KiB
Groovy
Raw Normal View History

2013-05-18 05:53:07 -07:00
[
new MagicAtUpkeepTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPlayer upkeepPlayer) {
final MagicPlayer player = permanent.getController();
final MagicPermanent enchantedCreature = permanent.getEnchantedCreature();
return (player == upkeepPlayer && enchantedCreature.isCreature()) ?
new MagicEvent(
enchantedCreature,
enchantedCreature.getOwner(),
this,
2013-05-18 05:53:07 -07:00
"SN deals 1 damage to PN."
) :
MagicEvent.NONE;
2013-04-12 19:32:25 -07:00
}
@Override
2013-05-18 05:53:07 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
final MagicDamage damage = new MagicDamage(
event.getSource(),
event.getPlayer(),
1
);
game.doAction(new MagicDealDamageAction(damage));
}
2013-05-18 05:53:07 -07:00
}
]