magarena/release/Magarena/scripts/Fanning_the_Flames.groovy

38 lines
1.5 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,
new MagicBuybackChoice(
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,
MagicManaCost.create("{3}")
),
new MagicDamageTargetPicker(amount),
amount,
this,
"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."
);
}
@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));
}
}
});
}
}
]