magarena/release/Magarena/scripts/Umezawa_s_Jitte.groovy

51 lines
1.7 KiB
Groovy

[
// equipped creature gets +2/+2 until end of turn
new MagicPermanentActivation(
[MagicCondition.HAS_EQUIPPED_CREATURE],
new MagicActivationHints(MagicTiming.Pump),
"+2/+2"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicRemoveCounterEvent(source,MagicCounterType.Charge,1)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
source.getEquippedCreature(),
this,
"RN gets +2/+2 until end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeTurnPTAction(event.getRefPermanent(),2,2));
}
},
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
return (damage.getSource() == permanent.getEquippedCreature() &&
damage.isCombat()) ?
new MagicEvent(
permanent,
this,
"Put two charge counters on SN."
) :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeCountersAction(
event.getPermanent(),
MagicCounterType.Charge,
2,
true
));
}
}
]