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(
|
2012-09-22 01:59:21 -07:00
|
|
|
permanent,
|
|
|
|
new MagicMayChoice(
|
2013-02-26 21:26:21 -08:00
|
|
|
new MagicPayManaCostChoice(MagicManaCost.create("{X}{R}")),
|
2012-09-22 01:59:21 -07:00
|
|
|
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER
|
2013-06-23 18:29:26 -07:00
|
|
|
),
|
2012-09-22 01:59:21 -07:00
|
|
|
new MagicDamageTargetPicker(
|
2013-02-26 21:26:21 -08:00
|
|
|
permanent.getController().getMaximumX(game,MagicManaCost.create("{X}{R}"))
|
2012-09-22 01:59:21 -07:00
|
|
|
),
|
|
|
|
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\$."
|
2012-09-22 01:59:21 -07:00
|
|
|
):
|
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) {
|
2013-03-22 19:26:50 -07:00
|
|
|
if (event.isYes()) {
|
2013-03-21 06:35:09 -07:00
|
|
|
event.processTarget(game,new MagicTargetAction() {
|
2011-08-30 06:31:13 -07:00
|
|
|
public void doAction(final MagicTarget target) {
|
2013-03-22 19:50:55 -07:00
|
|
|
final MagicPayManaCostResult payedManaCost = event.getPaidMana();
|
2013-03-02 01:18:30 -08:00
|
|
|
final MagicDamage damage=new MagicDamage(event.getPermanent(),target,payedManaCost.getX());
|
2011-08-30 06:31:13 -07:00
|
|
|
game.doAction(new MagicDealDamageAction(damage));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2012-06-17 05:19:08 -07:00
|
|
|
}
|
2013-05-27 07:56:28 -07:00
|
|
|
}
|
|
|
|
]
|