magarena/release/Magarena/scripts/Rhox.groovy

38 lines
1.3 KiB
Groovy
Raw Normal View History

2013-05-25 19:30:44 -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) {
return (permanent == attacker) ?
new MagicEvent(
permanent,
new MagicMayChoice(),
this,
2013-05-25 19:43:47 -07:00
"PN may\$ have SN deal its combat damage " +
2013-05-25 19:30:44 -07:00
"to defending player as though it weren't blocked."
):
2013-04-12 19:32:25 -07:00
MagicEvent.NONE;
}
@Override
2013-05-25 19:30:44 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
if (event.isYes()) {
final MagicPermanent permanent = event.getPermanent();
final MagicDamage damage = MagicDamage.Combat(
permanent,
event.getPlayer().getOpponent(),
permanent.getPower()
);
game.doAction(new MagicDealDamageAction(damage));
game.doAction(new MagicChangeStateAction(
permanent,
MagicPermanentState.NoCombatDamage,
true
));
}
}
2013-05-25 19:30:44 -07:00
}
]