magarena/release/Magarena/scripts/Brion_Stoutarm.groovy

47 lines
1.8 KiB
Groovy

[
new MagicPermanentActivation(
[
MagicCondition.CAN_TAP_CONDITION,
MagicConditionFactory.ManaCost("{R}"),
MagicCondition.TWO_CREATURES_CONDITION
],
new MagicActivationHints(MagicTiming.Removal),
"Damage"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
final MagicTargetFilter<MagicPermanent> targetFilter=new MagicOtherPermanentTargetFilter(
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL,source);
final MagicTargetChoice targetChoice=new MagicTargetChoice(
targetFilter,false,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));
}
});
}
}
]