magarena/release/Magarena/scripts/Flameblast_Dragon.groovy

36 lines
1.5 KiB
Groovy
Raw Normal View History

2013-05-27 07:56:28 -07:00
[
new MagicWhenAttacksTrigger() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
return (permanent==creature) ?
2011-08-14 00:57:54 -07:00
new MagicEvent(
permanent,
new MagicMayChoice(
2013-02-26 21:26:21 -08:00
new MagicPayManaCostChoice(MagicManaCost.create("{X}{R}")),
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER
2013-06-23 18:29:26 -07:00
),
new MagicDamageTargetPicker(
2013-02-26 21:26:21 -08:00
permanent.getController().getMaximumX(game,MagicManaCost.create("{X}{R}"))
),
this,
2013-06-23 18:29:26 -07:00
"You may pay\$ {X}{R}\$. If you do, SN " +
2013-05-27 07:56:28 -07:00
"deals X damage to target creature or player\$."
):
2011-09-04 01:19:43 -07:00
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
2013-06-23 18:29:26 -07:00
2012-06-17 05:19:08 -07:00
@Override
2013-03-22 22:00:53 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
event.processTarget(game,new MagicTargetAction() {
public void doAction(final MagicTarget target) {
final MagicPayManaCostResult payedManaCost = event.getPaidMana();
final MagicDamage damage=new MagicDamage(event.getPermanent(),target,payedManaCost.getX());
game.doAction(new MagicDealDamageAction(damage));
}
});
}
2012-06-17 05:19:08 -07:00
}
2013-05-27 07:56:28 -07:00
}
]