magarena/release/Magarena/scripts/Crescendo_of_War.groovy

34 lines
1.2 KiB
Groovy

[
new MagicStatic(
MagicLayer.ModPT,
MagicTargetFilter.TARGET_CREATURE
) {
@Override
public void modPowerToughness(
final MagicPermanent source,
final MagicPermanent permanent,
final MagicPowerToughness pt) {
final int amount = source.getCounters(MagicCounterType.Charge);
pt.add(amount,0);
}
@Override
public boolean condition(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
return target.isAttacking() || (target.isBlocking() && source.isFriend(target));
}
},
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
return new MagicEvent(
permanent,
this,
"PN puts a strife counter on SN."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeCountersAction(event.getPermanent(),MagicCounterType.Charge,1,true));
}
}
]