forked from External/mage
Fix remaining raw unparameterized usages of ManaCostImpl
This commit is contained in:
parent
4806626ba0
commit
882afbf8b5
37 changed files with 84 additions and 76 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue