specialize GrowSelf to only handle +1/+1 counters, other counters should use ChargeSelf

master
melvin 2013-10-30 17:30:03 +08:00
parent 5430402d17
commit ddc3384ccc
1 changed files with 24 additions and 3 deletions

View File

@ -526,20 +526,19 @@ public enum MagicRuleEventAction {
}
},
GrowSelf(
"put (?<amount>[a-z]+) (?<type>[^\\.]*) counter(s)? on sn.",
"put (?<amount>[a-z]+) \\+1/\\+1 counter(s)? on sn.",
MagicTiming.Pump,
"Pump"
) {
public MagicEventAction getAction(final String rule) {
final Matcher matcher = matched(rule);
final int amount = englishToInt(matcher.group("amount"));
final MagicCounterType counterType = englishToCounter(matcher.group("type"));
return new MagicEventAction() {
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeCountersAction(
event.getPermanent(),
counterType,
MagicCounterType.PlusOne,
amount,
true
));
@ -605,6 +604,28 @@ public enum MagicRuleEventAction {
return new MagicWeakenTargetPicker(amount,amount);
}
},
ChargeSelf(
"put (?<amount>[a-z]+) (?<type>[^\\.]*) counter(s)? on sn.",
MagicTiming.Main,
"Charge"
) {
public MagicEventAction getAction(final String rule) {
final Matcher matcher = matched(rule);
final int amount = englishToInt(matcher.group("amount"));
final MagicCounterType counterType = englishToCounter(matcher.group("type"));
return new MagicEventAction() {
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeCountersAction(
event.getPermanent(),
counterType,
amount,
true
));
}
};
}
},
Weaken(
"(?<choice>target[^\\.]*) get(s)? (?<pt>[0-9-]+/[0-9-]+) until end of turn.",
MagicTargetHint.Negative,