Fix remaining raw unparameterized usages of ManaCostImpl

This commit is contained in:
DeepCrimson 2022-06-16 14:53:44 -07:00
parent 4806626ba0
commit 882afbf8b5
No known key found for this signature in database
GPG key ID: A8083B336CCC2BF9
37 changed files with 84 additions and 76 deletions

View file

@ -1,7 +1,6 @@
package mage.abilities.effects.common.continuous;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.condition.common.SourceIsSpellCondition;
import mage.abilities.costs.AlternativeCostSourceAbility;
@ -14,13 +13,15 @@ import mage.constants.SubLayer;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author JRHerlehy
* Created on 4/4/18.
*/
public class WUBRGInsteadEffect extends ContinuousEffectImpl {
private final AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(new ManaCostsImpl("{W}{U}{B}{R}{G}"), SourceIsSpellCondition.instance);
private final AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(new ManaCostsImpl<>("{W}{U}{B}{R}{G}"), SourceIsSpellCondition.instance);
public WUBRGInsteadEffect() {
super(Duration.WhileOnBattlefield, Outcome.Detriment);

View file

@ -41,13 +41,13 @@ public class EchoEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
if (cost == null) {
cost = new ManaCostsImpl(Integer.toString(amount.calculate(game, source, this)));
cost = new ManaCostsImpl<>(Integer.toString(amount.calculate(game, source, this)));
}
Player controller = game.getPlayer(source.getControllerId());
if (controller != null
&& source.getSourceObjectIfItStillExists(game) != null) {
if (game.getContinuousEffects().asThough(source.getSourceId(), AsThoughEffectType.PAY_0_ECHO, source, source.getControllerId(), game) != null) {
Cost altCost = new ManaCostsImpl("{0}");
Cost altCost = new ManaCostsImpl<>("{0}");
if (controller.chooseUse(Outcome.Benefit, "Pay {0} instead of the echo cost?", source, game)) {
altCost.clearPaid();
if (altCost.pay(source, game, source, source.getControllerId(), false, null)) {

View file

@ -1,7 +1,6 @@
package mage.abilities.effects.keyword;
import java.util.Set;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCosts;
@ -18,6 +17,8 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.util.CardUtil;
import java.util.Set;
/**
*
* @author LevelX2
@ -54,7 +55,7 @@ public class ManifestEffect extends OneShotEffect {
if (card.isCreature(game)) {
manaCosts = card.getSpellAbility() != null ? card.getSpellAbility().getManaCosts() : null;
if (manaCosts == null) {
manaCosts = new ManaCostsImpl("{0}");
manaCosts = new ManaCostsImpl<>("{0}");
}
}
MageObjectReference objectReference = new MageObjectReference(card.getId(), card.getZoneChangeCounter(game) + 1, game);

View file

@ -1,7 +1,6 @@
package mage.abilities.effects.keyword;
import java.util.Set;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCosts;
@ -18,6 +17,8 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.util.CardUtil;
import java.util.Set;
/**
*
* @author LevelX2
@ -57,7 +58,7 @@ public class ManifestTargetPlayerEffect extends OneShotEffect {
if (card.isCreature(game)) {
manaCosts = card.getSpellAbility().getManaCosts();
if (manaCosts == null) {
manaCosts = new ManaCostsImpl("{0}");
manaCosts = new ManaCostsImpl<>("{0}");
}
}
MageObjectReference objectReference = new MageObjectReference(card.getId(), card.getZoneChangeCounter(game) + 1, game);