magarena/release/Magarena/scripts/Fanning_the_Flames.groovy

35 lines
1.3 KiB
Groovy
Raw Normal View History

2013-05-28 00:56:26 -07:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final int amount = payedCost.getX();
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,
2013-05-28 00:56:26 -07:00
new MagicDamageTargetPicker(amount),
amount,
this,
2013-06-23 18:29:26 -07:00
"SN deals RN damage to target creature or player\$. " +
"If the buyback cost was payed, return SN to its owner's hand as it resolves."
2013-05-28 00:56:26 -07:00
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTarget(game,new MagicTargetAction() {
public void doAction(final MagicTarget target) {
final MagicDamage damage = new MagicDamage(
event.getSource(),
target,
event.getRefInt()
);
game.doAction(new MagicDealDamageAction(damage));
if (event.isBuyback()) {
game.doAction(new MagicChangeCardDestinationAction(event.getCardOnStack(), MagicLocationType.OwnersHand));
2013-06-23 18:29:26 -07:00
}
2013-05-28 00:56:26 -07:00
}
});
}
}
]