54 lines
1.8 KiB
Groovy
54 lines
1.8 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),
|
|
MagicCondition.CAN_TAP_CONDITION,
|
|
MagicConditionFactory.ManaCost("{B}")
|
|
],
|
|
new MagicActivationHints(MagicTiming.Removal),
|
|
"Weaken"
|
|
) {
|
|
|
|
@Override
|
|
public 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));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
]
|