52 lines
1.7 KiB
Groovy
52 lines
1.7 KiB
Groovy
[
|
|
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);
|
|
}
|
|
}
|
|
},
|
|
new MagicPermanentActivation(
|
|
[
|
|
MagicConditionFactory.ChargeCountersAtLeast(2),
|
|
],
|
|
new MagicActivationHints(MagicTiming.Removal),
|
|
"Weaken"
|
|
) {
|
|
|
|
@Override
|
|
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
|
|
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));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
]
|