[refactor] removed BoostCounter implementations

This commit is contained in:
North 2014-05-31 18:43:05 +03:00
parent 44785267ec
commit ca1af753eb
12 changed files with 31 additions and 170 deletions

View file

@ -86,23 +86,6 @@ public class Contagion extends CardImpl<Contagion> {
}
}
class ContagionCounter extends BoostCounter {
public ContagionCounter(int count) {
super(-2, -1);
this.count = count;
}
public ContagionCounter(final ContagionCounter counter) {
super(counter);
}
@Override
public ContagionCounter copy() {
return new ContagionCounter(this);
}
}
class DistributeCountersEffect extends OneShotEffect<DistributeCountersEffect> {
@ -126,7 +109,8 @@ class DistributeCountersEffect extends OneShotEffect<DistributeCountersEffect> {
for (UUID target: multiTarget.getTargets()) {
Permanent permanent = game.getPermanent(target);
if (permanent != null) {
permanent.addCounters(new ContagionCounter(multiTarget.getTargetAmount(target)), game);
int amount = multiTarget.getTargetAmount(target);
permanent.addCounters(new BoostCounter(-2, -1, amount), game);
}
}
}

View file

@ -39,7 +39,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.common.PlusOneCounter;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -63,9 +63,9 @@ public class SavageFirecat extends CardImpl<SavageFirecat> {
// Trample
this.addAbility(TrampleAbility.getInstance());
// Savage Firecat enters the battlefield with seven +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new PlusOneCounter(7))));
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(7))));
// Whenever you tap a land for mana, remove a +1/+1 counter from Savage Firecat.
this.addAbility(new SavageFirecatTriggeredAbility(new RemoveCounterSourceEffect(new PlusOneCounter(1))));
this.addAbility(new SavageFirecatTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance())));
}

View file

@ -35,7 +35,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.counters.common.PlusOneCounter;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.AbilityPredicate;
@ -64,7 +64,7 @@ public class Soulcatcher extends CardImpl<Soulcatcher> {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever a creature with flying dies, put a +1/+1 counter on Soulcatcher.
this.addAbility(new DiesCreatureTriggeredAbility(new AddCountersSourceEffect(new PlusOneCounter()), false, filter));
this.addAbility(new DiesCreatureTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, filter));
}
public Soulcatcher(final Soulcatcher card) {

View file

@ -35,7 +35,7 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.counters.common.PlusOneCounter;
import mage.counters.CounterType;
/**
*
@ -53,7 +53,7 @@ public class IvyElemental extends CardImpl<IvyElemental> {
this.toughness = new MageInt(0);
// Ivy Elemental enters the battlefield with X +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new PlusOneCounter(), new ManacostVariableValue(), true), "with X +1/+1 counters on it"));
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(), new ManacostVariableValue(), true), "with X +1/+1 counters on it"));
}
public IvyElemental(final IvyElemental card) {

View file

@ -95,7 +95,7 @@ class WallOfRootsCost extends CostImpl<WallOfRootsCost> {
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
Permanent permanent = game.getPermanent(sourceId);
if (permanent != null) {
permanent.addCounters(new WallOfRootsCounter(), game);
permanent.addCounters(new BoostCounter(0, -1), game);
this.paid = true;
}
return paid;
@ -106,19 +106,3 @@ class WallOfRootsCost extends CostImpl<WallOfRootsCost> {
return new WallOfRootsCost(this);
}
}
class WallOfRootsCounter extends BoostCounter {
public WallOfRootsCounter() {
super(0, -1);
}
public WallOfRootsCounter(final WallOfRootsCounter counter) {
super(counter);
}
@Override
public WallOfRootsCounter copy() {
return new WallOfRootsCounter(this);
}
}

View file

@ -39,7 +39,7 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.counters.common.PlusOneCounter;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -129,10 +129,10 @@ class BladeOfTheBloodchiefEffect extends OneShotEffect<BladeOfTheBloodchiefEffec
Permanent creature = game.getPermanent(enchantment.getAttachedTo());
if (creature != null) {
if ( creature.hasSubtype("Vampire") ) {
creature.addCounters(new PlusOneCounter(2), game);
creature.addCounters(CounterType.P1P1.createInstance(2), game);
}
else {
creature.addCounters(new PlusOneCounter(1), game);
creature.addCounters(CounterType.P1P1.createInstance(), game);
}
}
}

View file

@ -38,7 +38,7 @@ import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.counters.common.PlusOneCounter;
import mage.counters.CounterType;
import mage.target.common.TargetCreaturePermanent;
/**
@ -54,7 +54,7 @@ public class MarkOfMutiny extends CardImpl<MarkOfMutiny> {
this.color.setRed(true);
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
this.getSpellAbility().addEffect(new AddCountersTargetEffect(new PlusOneCounter()));
this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance()));
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
this.getSpellAbility().addEffect(new UntapTargetEffect());
}