magarena/release/Magarena/scripts/Brion_Stoutarm.groovy

46 lines
1.7 KiB
Groovy

[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Removal),
"Damage"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
final MagicTargetChoice targetChoice=new MagicTargetChoice(
new MagicOtherPermanentTargetFilter(
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL,
source
),
MagicTargetHint.None,
"a creature other than " + source + " to sacrifice"
);
return [
new MagicPayManaCostTapEvent(source,"{R}"),
new MagicSacrificePermanentEvent(source,targetChoice)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.NEG_TARGET_PLAYER,
payedCost.getTarget(),
this,
"SN deals damage equal to the power of RN to target player\$."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPlayer(game,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
final MagicPermanent sacrificed=event.getRefPermanent();
final MagicDamage damage=new MagicDamage(event.getSource(),player,sacrificed.getPower());
game.doAction(new MagicDealDamageAction(damage));
}
});
}
}
]