41 lines
1.4 KiB
Groovy
41 lines
1.4 KiB
Groovy
[
|
|
new MagicPermanentActivation(
|
|
new MagicActivationHints(MagicTiming.Pump),
|
|
"Protection"
|
|
) {
|
|
@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 MagicSacrificePermanentEvent(
|
|
source,
|
|
targetChoice
|
|
)
|
|
];
|
|
}
|
|
@Override
|
|
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
|
|
return new MagicEvent(
|
|
source,
|
|
MagicColorChoice.ALL_INSTANCE,
|
|
this,
|
|
"SN gains protection from color\$ of your choice until end of turn."
|
|
);
|
|
}
|
|
@Override
|
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
|
game.doAction(new MagicGainAbilityAction(
|
|
event.getPermanent(),
|
|
event.getChosenColor().getProtectionAbility()
|
|
));
|
|
}
|
|
}
|
|
]
|