mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
* Doubling Season - Fixed a bug that doubling boosting counters (+1/+1) created an error.
This commit is contained in:
parent
c9d18f0410
commit
0d643848ae
1 changed files with 13 additions and 1 deletions
|
@ -38,6 +38,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.Counter;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
@ -127,7 +128,18 @@ class DoublingSeasonCounterEffect extends ReplacementEffectImpl<DoublingSeasonCo
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent p = game.getPermanent(event.getTargetId());
|
||||
if (p != null) {
|
||||
p.addCounters(CounterType.valueOf(event.getData().toUpperCase(Locale.ENGLISH)).createInstance(event.getAmount() * 2), game, event.getAppliedEffects());
|
||||
String counterName = event.getData().toUpperCase(Locale.ENGLISH);
|
||||
Counter counter;
|
||||
if (counterName.equals("+1/+1")) {
|
||||
counter = CounterType.P1P1.createInstance(event.getAmount() * 2);
|
||||
} else if (counterName.equals("-1/-1")) {
|
||||
counter = CounterType.M1M1.createInstance(event.getAmount() * 2);
|
||||
} else {
|
||||
counter = new Counter(counterName, event.getAmount() * 2);
|
||||
}
|
||||
p.addCounters(counter, game, event.getAppliedEffects());
|
||||
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue