Remove superfluous addManaCost method (#11288)

* no need to specify mana cost, just add cost

* handle all mana costs through addcost method only

* eliminate another constructor

* more constructor cleanup
This commit is contained in:
xenohedron 2023-10-09 15:25:19 -04:00 committed by GitHub
parent 4e2a5bd5a9
commit d7afa37893
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 153 additions and 338 deletions

View file

@ -23,8 +23,7 @@ public class FetchLandActivatedAbility extends ActivatedAbilityImpl {
}
public FetchLandActivatedAbility(boolean withDamage, SubType subType1, SubType subType2) {
super(Zone.BATTLEFIELD, null);
addCost(new TapSourceCost());
super(Zone.BATTLEFIELD, null, new TapSourceCost());
if (withDamage) {
addCost(new PayLifeCost(1));
}

View file

@ -16,7 +16,7 @@ import java.util.UUID;
public class PassAbility extends ActivatedAbilityImpl {
public PassAbility() {
super(Zone.ALL, new PassEffect());
super(Zone.ALL, new PassEffect(), null);
this.usesStack = false;
}

View file

@ -3,7 +3,6 @@ package mage.abilities.common;
import mage.constants.Zone;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.effects.Effect;
/**
@ -12,16 +11,8 @@ import mage.abilities.effects.Effect;
*/
public class SimpleActivatedAbility extends ActivatedAbilityImpl {
public SimpleActivatedAbility(Effect effect, ManaCosts cost) {
super(Zone.BATTLEFIELD, effect, cost);
}
public SimpleActivatedAbility(Effect effect, Cost cost) {
super(Zone.BATTLEFIELD, effect, cost);
}
public SimpleActivatedAbility(Zone zone, Effect effect, ManaCosts cost) {
super(zone, effect, cost);
this(Zone.BATTLEFIELD, effect, cost);
}
public SimpleActivatedAbility(Zone zone, Effect effect, Cost cost) {

View file

@ -32,7 +32,7 @@ public class SpellTransformedAbility extends SpellAbility {
this.manaCost = manaCost;
this.clearManaCosts();
this.clearManaCostsToPay();
this.addManaCost(new ManaCostsImpl<>(manaCost));
this.addCost(new ManaCostsImpl<>(manaCost));
this.addSubAbility(new TransformAbility());
}

View file

@ -1,11 +1,9 @@
package mage.abilities.common;
import mage.abilities.Ability;
import mage.abilities.SpecialAction;
import mage.abilities.costs.Cost;
import mage.abilities.costs.Costs;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.constants.AbilityType;
@ -28,14 +26,7 @@ public class TurnFaceUpAbility extends SpecialAction {
public TurnFaceUpAbility(Costs<Cost> costs, boolean megamorph) {
super(Zone.BATTLEFIELD);
this.addEffect(new TurnFaceUpEffect(megamorph));
for (Cost cost : costs) {
if (cost instanceof ManaCost) {
this.addManaCost((ManaCost) cost);
} else {
this.addCost(cost);
}
}
this.addCost(costs);
this.usesStack = false;
this.abilityType = AbilityType.SPECIAL_ACTION;
this.setRuleVisible(false); // will be made visible only to controller in CardView