31 lines
1.0 KiB
Groovy
31 lines
1.0 KiB
Groovy
|
[
|
||
|
new MagicAtUpkeepTrigger() {
|
||
|
@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,
|
||
|
"SN deals 1 damage to PN."
|
||
|
) :
|
||
|
MagicEvent.NONE;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||
|
final MagicDamage damage = new MagicDamage(
|
||
|
event.getSource(),
|
||
|
event.getPlayer(),
|
||
|
1
|
||
|
);
|
||
|
game.doAction(new MagicDealDamageAction(damage));
|
||
|
}
|
||
|
}
|
||
|
]
|