magarena/release/Magarena/scripts/Guul_Draz_Assassin.groovy

52 lines
1.7 KiB
Groovy
Raw Normal View History

2013-05-30 06:45:54 -07:00
[
new MagicStatic(MagicLayer.SetPT) {
@Override
public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
final int charges = permanent.getCounters(MagicCounterType.Charge);
if (charges >= 4) {
pt.set(4,4);
} else if (charges >= 2) {
pt.set(2,2);
}
2013-06-23 18:29:26 -07:00
}
2013-05-30 06:45:54 -07:00
},
new MagicPermanentActivation(
[
MagicConditionFactory.ChargeCountersAtLeast(2),
],
new MagicActivationHints(MagicTiming.Removal),
"Weaken"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
2013-05-30 06:45:54 -07:00
return [
new MagicPayManaCostTapEvent(source,"{B}")
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
final int amount = source.getCounters(MagicCounterType.Charge) >= 4 ? -4:-2;
return new MagicEvent(
source,
MagicTargetChoice.NEG_TARGET_CREATURE,
new MagicWeakenTargetPicker(amount,amount),
amount,
this,
"Target creature\$ gets RN/RN until end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final int amount = event.getRefInt();
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicChangeTurnPTAction(creature,amount,amount));
}
});
}
}
]