magarena/release/Magarena/scripts/Falkenrath_Aristocrat.groovy

44 lines
1.4 KiB
Groovy
Raw Normal View History

2013-05-28 01:18:20 -07:00
[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Pump),
"Pump"
) {
2013-06-23 18:29:26 -07:00
2013-05-28 01:18:20 -07:00
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
2013-05-28 01:18:20 -07:00
return [
new MagicSacrificePermanentEvent(
source,
MagicTargetChoice.SACRIFICE_CREATURE
)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
final boolean isHuman = payedCost.getTarget().hasSubType(MagicSubType.Human);
2013-06-23 18:29:26 -07:00
final String message =
"SN is indestructible this turn." +
2013-05-28 01:18:20 -07:00
(isHuman ? " Put a +1/+1 counter on SN." : "");
return new MagicEvent(
source,
isHuman ? 1 : 0,
this,
message
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicGainAbilityAction(
2013-05-28 01:18:20 -07:00
event.getPermanent(),
MagicAbility.Indestructible
));
game.doAction(new MagicChangeCountersAction(
event.getPermanent(),
MagicCounterType.PlusOne,
event.getRefInt(),
true
));
}
}
]