parse effect that put counter on self

master
melvin 2013-10-16 21:12:13 +08:00
parent 7ea2b5fad3
commit ef3e5d1306
1 changed files with 21 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import magic.model.MagicLocationType;
import magic.model.MagicPermanent; import magic.model.MagicPermanent;
import magic.model.MagicPermanentState; import magic.model.MagicPermanentState;
import magic.model.MagicDamage; import magic.model.MagicDamage;
import magic.model.MagicCounterType;
import magic.model.action.MagicCardOnStackAction; import magic.model.action.MagicCardOnStackAction;
import magic.model.action.MagicCounterItemOnStackAction; import magic.model.action.MagicCounterItemOnStackAction;
import magic.model.action.MagicDestroyAction; import magic.model.action.MagicDestroyAction;
@ -18,6 +19,7 @@ import magic.model.action.MagicChangeTurnPTAction;
import magic.model.action.MagicChangeLifeAction; import magic.model.action.MagicChangeLifeAction;
import magic.model.action.MagicTapAction; import magic.model.action.MagicTapAction;
import magic.model.action.MagicUntapAction; import magic.model.action.MagicUntapAction;
import magic.model.action.MagicChangeCountersAction;
import magic.model.stack.MagicCardOnStack; import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicTarget; import magic.model.target.MagicTarget;
import magic.model.target.MagicTargetHint; import magic.model.target.MagicTargetHint;
@ -203,6 +205,25 @@ public enum MagicRuleEventAction {
}; };
} }
}, },
GrowSelf(
"Put a +1/+1 counter on SN.",
MagicTiming.Pump,
"Pump"
) {
public MagicEventAction getAction(final String rule) {
return new MagicEventAction() {
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeCountersAction(
event.getPermanent(),
MagicCounterType.PlusOne,
1,
true
));
}
};
}
},
Weaken( Weaken(
"(?<choice>[^\\.]*) gets (?<pt>[0-9-]+/[0-9-]+) until end of turn.", "(?<choice>[^\\.]*) gets (?<pt>[0-9-]+/[0-9-]+) until end of turn.",
MagicTargetHint.Negative, MagicTargetHint.Negative,