diff --git a/src/magic/model/event/MagicRuleEventAction.java b/src/magic/model/event/MagicRuleEventAction.java index 9094bfe39e..e7b4fe95b0 100644 --- a/src/magic/model/event/MagicRuleEventAction.java +++ b/src/magic/model/event/MagicRuleEventAction.java @@ -231,6 +231,55 @@ public enum MagicRuleEventAction { }; } }, + PumpChosen( + "(?[^\\.]*) gets (?[0-9+]+/[0-9+]+) until end of turn.", + MagicTargetHint.Positive, + MagicPumpTargetPicker.create(), + MagicTiming.Pump, + "Pump" + ) { + public MagicEventAction getAction(final String rule) { + final Matcher matcher = matched(rule); + final String[] pt = matcher.group("pt").replace("+","").split("/"); + final int power = Integer.parseInt(pt[0]); + final int toughness = Integer.parseInt(pt[1]); + return new MagicEventAction() { + @Override + public void executeEvent(final MagicGame game, final MagicEvent event) { + event.processTargetPermanent(game,new MagicPermanentAction() { + public void doAction(final MagicPermanent creature) { + game.doAction(new MagicChangeTurnPTAction(creature,power,toughness)); + } + }); + } + }; + } + }, + PumpGroup( + "(?[^\\.]*) get (?[0-9+]+/[0-9+]+) until end of turn.", + MagicTiming.Pump, + "Pump" + ) { + public MagicEventAction getAction(final String rule) { + final Matcher matcher = matched(rule); + final String[] pt = matcher.group("pt").replace("+","").split("/"); + final int power = Integer.parseInt(pt[0]); + final int toughness = Integer.parseInt(pt[1]); + final MagicTargetFilter filter = MagicTargetFilterFactory.build(matcher.group("group")); + return new MagicEventAction() { + @Override + public void executeEvent(final MagicGame game, final MagicEvent event) { + final Collection targets = game.filterPermanents( + event.getPlayer(), + filter + ); + for (final MagicPermanent creature : targets) { + game.doAction(new MagicChangeTurnPTAction(creature,power,toughness)); + } + } + }; + } + }, GainSelf( "sn gains (?[^\\.]*) until end of turn." ) { @@ -288,55 +337,6 @@ public enum MagicRuleEventAction { return Character.toUpperCase(ability.charAt(0)) + ability.substring(1); } }, - Pump( - "(?[^\\.]*) gets (?[0-9+]+/[0-9+]+) until end of turn.", - MagicTargetHint.Positive, - MagicPumpTargetPicker.create(), - MagicTiming.Pump, - "Pump" - ) { - public MagicEventAction getAction(final String rule) { - final Matcher matcher = matched(rule); - final String[] pt = matcher.group("pt").replace("+","").split("/"); - final int power = Integer.parseInt(pt[0]); - final int toughness = Integer.parseInt(pt[1]); - return new MagicEventAction() { - @Override - public void executeEvent(final MagicGame game, final MagicEvent event) { - event.processTargetPermanent(game,new MagicPermanentAction() { - public void doAction(final MagicPermanent creature) { - game.doAction(new MagicChangeTurnPTAction(creature,power,toughness)); - } - }); - } - }; - } - }, - PumpGroup( - "(?[^\\.]*) get (?[0-9+]+/[0-9+]+) until end of turn.", - MagicTiming.Pump, - "Pump" - ) { - public MagicEventAction getAction(final String rule) { - final Matcher matcher = matched(rule); - final String[] pt = matcher.group("pt").replace("+","").split("/"); - final int power = Integer.parseInt(pt[0]); - final int toughness = Integer.parseInt(pt[1]); - final MagicTargetFilter filter = MagicTargetFilterFactory.build(matcher.group("group")); - return new MagicEventAction() { - @Override - public void executeEvent(final MagicGame game, final MagicEvent event) { - final Collection targets = game.filterPermanents( - event.getPlayer(), - filter - ); - for (final MagicPermanent creature : targets) { - game.doAction(new MagicChangeTurnPTAction(creature,power,toughness)); - } - } - }; - } - }, GrowSelf( "put (?[a-z]+) (?[^\\.]*) counter(s)? on sn.", MagicTiming.Pump,