replaced all instances of converted mana cost with mana value

This commit is contained in:
Evan Kranzler 2021-04-17 17:02:27 -04:00
parent cb0df438dd
commit a61d5543fa
610 changed files with 1781 additions and 1796 deletions

View file

@ -96,7 +96,7 @@ public interface MageObject extends MageItem, Serializable {
return symbols;
}
int getConvertedManaCost();
int getManaValue();
MageInt getPower();

View file

@ -233,9 +233,9 @@ public abstract class MageObjectImpl implements MageObject {
}
@Override
public int getConvertedManaCost() {
public int getManaValue() {
if (manaCost != null) {
return manaCost.convertedManaCost();
return manaCost.manaValue();
}
return 0;
}

View file

@ -34,7 +34,7 @@ public class ControlsPermanentGreatestCMCCondition implements Condition {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
for (Permanent permanent : permanents) {
int cmc = permanent.getManaCost().convertedManaCost();
int cmc = permanent.getManaCost().manaValue();
if (maxCMC == null || cmc > maxCMC) {
maxCMC = cmc;
controllers.clear();
@ -48,7 +48,7 @@ public class ControlsPermanentGreatestCMCCondition implements Condition {
@Override
public String toString() {
return "you control the " + filter.getMessage() + " with the highest converted mana cost or tied for the highest converted mana cost";
return "you control the " + filter.getMessage() + " with the highest mana value or tied for the highest mana value";
}
}

View file

@ -58,7 +58,7 @@ public class ExileFromHandCost extends CostImpl {
if (card == null) {
return false;
}
cmc += card.getConvertedManaCost();
cmc += card.getManaValue();
this.cards.add(card);
}
Cards cardsToExile = new CardsImpl();

View file

@ -21,7 +21,7 @@ import mage.target.common.TargetCardInHand;
*/
public class RevealTargetFromHandCost extends CostImpl {
public int convertedManaCosts = 0;
public int manaValues = 0;
protected int numberCardsRevealed = 0;
protected List<Card> revealedCards;
@ -33,7 +33,7 @@ public class RevealTargetFromHandCost extends CostImpl {
public RevealTargetFromHandCost(final RevealTargetFromHandCost cost) {
super(cost);
this.convertedManaCosts = cost.convertedManaCosts;
this.manaValues = cost.manaValues;
this.numberCardsRevealed = cost.numberCardsRevealed;
this.revealedCards = new ArrayList<>(cost.revealedCards);
}
@ -41,14 +41,14 @@ public class RevealTargetFromHandCost extends CostImpl {
@Override
public boolean pay(Ability ability, Game game, Ability source, UUID controllerId, boolean noMana, Cost costToPay) {
if (targets.choose(Outcome.Benefit, controllerId, source.getSourceId(), game)) {
convertedManaCosts = 0;
manaValues = 0;
numberCardsRevealed = 0;
Player player = game.getPlayer(controllerId);
Cards cards = new CardsImpl();
for (UUID targetId : targets.get(0).getTargets()) {
Card card = player.getHand().get(targetId, game);
if (card != null) {
convertedManaCosts += card.getConvertedManaCost();
manaValues += card.getManaValue();
numberCardsRevealed++;
cards.add(card);
revealedCards.add(card);
@ -68,7 +68,7 @@ public class RevealTargetFromHandCost extends CostImpl {
}
public int getConvertedCosts() {
return convertedManaCosts;
return manaValues;
}
public int getNumberRevealedCards() {

View file

@ -24,7 +24,7 @@ public class ColoredManaCost extends ManaCostImpl {
}
@Override
public int convertedManaCost() {
public int manaValue() {
return 1;
}

View file

@ -32,7 +32,7 @@ public class ColorlessManaCost extends ManaCostImpl {
}
@Override
public int convertedManaCost() {
public int manaValue() {
return mana;
}

View file

@ -30,7 +30,7 @@ public class GenericManaCost extends ManaCostImpl {
}
@Override
public int convertedManaCost() {
public int manaValue() {
return mana;
}

View file

@ -31,7 +31,7 @@ public class HybridManaCost extends ManaCostImpl {
}
@Override
public int convertedManaCost() {
public int manaValue() {
return 1;
}

View file

@ -13,7 +13,7 @@ import mage.players.ManaPool;
public interface ManaCost extends Cost {
int convertedManaCost();
int manaValue();
Mana getMana();

View file

@ -63,10 +63,10 @@ public class ManaCostsImpl<T extends ManaCost> extends ArrayList<T> implements M
}
@Override
public int convertedManaCost() {
public int manaValue() {
int total = 0;
for (ManaCost cost : this) {
total += cost.convertedManaCost();
total += cost.manaValue();
}
return total;
}

View file

@ -35,7 +35,7 @@ public class MonoHybridManaCost extends ManaCostImpl {
}
@Override
public int convertedManaCost() {
public int manaValue() {
// from wiki: A card with monocolored hybrid mana symbols in its mana cost has a converted mana cost equal to
// the highest possible cost it could be played for. Its converted mana cost never changes.
return Math.max(manaGeneric, 1);

View file

@ -28,7 +28,7 @@ public class SnowManaCost extends ManaCostImpl {
}
@Override
public int convertedManaCost() {
public int manaValue() {
return 1;
}

View file

@ -51,7 +51,7 @@ public final class VariableManaCost extends ManaCostImpl implements VariableCost
}
@Override
public int convertedManaCost() {
public int manaValue() {
return 0;
}

View file

@ -19,7 +19,7 @@ public enum DiscardCostCardConvertedMana implements DynamicValue {
for (Cost cost : sourceAbility.getCosts()) {
if (cost instanceof DiscardTargetCost) {
DiscardTargetCost discardCost = (DiscardTargetCost) cost;
return discardCost.getCards().stream().mapToInt(Card::getConvertedManaCost).sum();
return discardCost.getCards().stream().mapToInt(Card::getManaValue).sum();
}
}
return 0;
@ -37,6 +37,6 @@ public enum DiscardCostCardConvertedMana implements DynamicValue {
@Override
public String getMessage() {
return "the discarded card's converted mana cost";
return "the discarded card's mana value";
}
}

View file

@ -25,7 +25,7 @@ public enum ExileFromHandCostCardConvertedMana implements DynamicValue {
if (cost.isPaid() && cost instanceof ExileFromHandCost) {
int xValue = 0;
for (Card card : ((ExileFromHandCost) cost).getCards()) {
xValue += card.getConvertedManaCost();
xValue += card.getManaValue();
}
return xValue;
}

View file

@ -36,8 +36,8 @@ public class HighestCMCOfPermanentValue implements DynamicValue {
for (Permanent permanent : game.getBattlefield()
.getActivePermanents(filter, sourceAbility.getControllerId(), sourceAbility.getSourceId(), game)) {
if ((!onlyIfCanBeSacrificed || controller.canPaySacrificeCost(permanent, sourceAbility, sourceAbility.getControllerId(), game))
&& permanent.getConvertedManaCost() > value) {
value = permanent.getConvertedManaCost();
&& permanent.getManaValue() > value) {
value = permanent.getManaValue();
}
}

View file

@ -13,19 +13,19 @@ import mage.players.Player;
*
* @author nigelzor
*/
public class HighestConvertedManaCostValue implements DynamicValue {
public class HighestManaValueCount implements DynamicValue {
private final FilterPermanent filter;
public HighestConvertedManaCostValue() {
public HighestManaValueCount() {
this(StaticFilters.FILTER_PERMANENTS);
}
public HighestConvertedManaCostValue(FilterPermanent filter) {
public HighestManaValueCount(FilterPermanent filter) {
this.filter = filter;
}
public HighestConvertedManaCostValue(final HighestConvertedManaCostValue dynamicValue){
public HighestManaValueCount(final HighestManaValueCount dynamicValue){
super();
this.filter = dynamicValue.filter.copy();
}
@ -38,7 +38,7 @@ public class HighestConvertedManaCostValue implements DynamicValue {
}
int highCMC = 0;
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) {
int cmc = permanent.getConvertedManaCost();
int cmc = permanent.getManaValue();
highCMC = Math.max(highCMC, cmc);
}
return highCMC;
@ -46,12 +46,12 @@ public class HighestConvertedManaCostValue implements DynamicValue {
@Override
public DynamicValue copy() {
return new HighestConvertedManaCostValue(this);
return new HighestManaValueCount(this);
}
@Override
public String getMessage() {
return "the highest converted mana cost among permanents you control";
return "the highest mana value among permanents you control";
}
@Override

View file

@ -26,7 +26,7 @@ public enum ManaSpentToCastCount implements DynamicValue {
}
if (spell != null) {
// NOT the cmc of the spell on the stack
return spell.getSpellAbility().getManaCostsToPay().convertedManaCost();
return spell.getSpellAbility().getManaCostsToPay().manaValue();
}
return 0;
}

View file

@ -31,7 +31,7 @@ public class SacrificeCostConvertedMana implements DynamicValue {
SacrificeTargetCost sacrificeCost = (SacrificeTargetCost) cost;
int totalCMC = 0;
for(Permanent permanent : sacrificeCost.getPermanents()) {
totalCMC += permanent.getConvertedManaCost();
totalCMC += permanent.getManaValue();
}
return totalCMC;
}
@ -51,6 +51,6 @@ public class SacrificeCostConvertedMana implements DynamicValue {
@Override
public String getMessage() {
return "the sacrificed " + type + "'s converted mana cost";
return "the sacrificed " + type + "'s mana value";
}
}

View file

@ -10,20 +10,20 @@ import mage.game.Game;
/**
* @author North
*/
public enum TargetConvertedManaCost implements DynamicValue {
public enum TargetManaValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Card card = game.getCard(sourceAbility.getFirstTarget());
if (card != null) {
return card.getConvertedManaCost();
return card.getManaValue();
}
return 0;
}
@Override
public TargetConvertedManaCost copy() {
public TargetManaValue copy() {
return instance;
}
@ -34,6 +34,6 @@ public enum TargetConvertedManaCost implements DynamicValue {
@Override
public String getMessage() {
return "that card's converted mana cost";
return "that card's mana value";
}
}

View file

@ -154,7 +154,7 @@ public abstract class PayCostToAttackBlockEffectImpl extends ReplacementEffectIm
@Override
public boolean isCostless(GameEvent event, Ability source, Game game) {
ManaCosts currentManaCosts = getManaCostToPay(event, source, game);
if (currentManaCosts != null && currentManaCosts.convertedManaCost() > 0) {
if (currentManaCosts != null && currentManaCosts.manaValue() > 0) {
return false;
}
return getOtherCostToPay(event, source, game) == null;

View file

@ -116,7 +116,7 @@ public class ClashEffect extends OneShotEffect implements MageSingleton {
cardController = controller.getLibrary().getFromTop(game);
cards.add(cardController);
controller.revealCards(sourceObject.getIdName() + ": Clash card of " + controller.getName(), cards, game);
cmcController = cardController.getConvertedManaCost();
cmcController = cardController.getManaValue();
message.append(" (").append(cmcController).append(')');
} else {
message.append(" no card");
@ -127,7 +127,7 @@ public class ClashEffect extends OneShotEffect implements MageSingleton {
cardOpponent = opponent.getLibrary().getFromTop(game);
cards.add(cardOpponent);
opponent.revealCards(sourceObject.getIdName() + ": Clash card of " + opponent.getName(), cards, game);
cmcOpponent = cardOpponent.getConvertedManaCost();
cmcOpponent = cardOpponent.getManaValue();
message.append(" (").append(cmcOpponent).append(')');
} else {
message.append(" no card");

View file

@ -10,7 +10,7 @@ import mage.constants.ComparisonType;
import mage.constants.Outcome;
import mage.filter.FilterCard;
import mage.filter.common.FilterNonlandCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
@ -39,7 +39,7 @@ public class CastWithoutPayingManaCostEffect extends OneShotEffect {
public CastWithoutPayingManaCostEffect(DynamicValue maxCost) {
super(Outcome.PlayForFree);
this.manaCost = maxCost;
this.staticText = "you may cast a card with converted mana cost "
this.staticText = "you may cast a card with mana value "
+ maxCost + " or less from your hand without paying its mana cost";
}
@ -56,13 +56,13 @@ public class CastWithoutPayingManaCostEffect extends OneShotEffect {
return false;
}
int cmc = manaCost.calculate(game, source, this);
FilterCard filter = new FilterNonlandCard("card with converted mana cost "
FilterCard filter = new FilterNonlandCard("card with mana value "
+ cmc + " or less from your hand");
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, cmc + 1));
filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, cmc + 1));
Target target = new TargetCardInHand(filter);
if (target.canChoose(source.getSourceId(), controller.getId(), game)
&& controller.chooseUse(Outcome.PlayForFree, "Cast a card with converted mana cost " + cmc
&& controller.chooseUse(Outcome.PlayForFree, "Cast a card with mana value " + cmc
+ " or less from your hand without paying its mana cost?", source, game)) {
Card cardToCast = null;
boolean cancel = false;

View file

@ -9,7 +9,7 @@ import mage.cards.CardsImpl;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
@ -19,28 +19,28 @@ import mage.target.common.TargetCardInLibrary;
*
* @author antoni-g
*/
public class SearchLibraryGraveyardWithLessCMCPutIntoPlay extends OneShotEffect {
public class SearchLibraryGraveyardWithLessMVPutIntoPlay extends OneShotEffect {
private final FilterCard filter;
public SearchLibraryGraveyardWithLessCMCPutIntoPlay() {
public SearchLibraryGraveyardWithLessMVPutIntoPlay() {
this(new FilterCard());
}
public SearchLibraryGraveyardWithLessCMCPutIntoPlay(FilterCard filter) {
public SearchLibraryGraveyardWithLessMVPutIntoPlay(FilterCard filter) {
super(Outcome.PutCreatureInPlay);
this.filter = filter;
staticText = "Search your library or graveyard for a " + filter.getMessage() + " with converted mana cost X or less, put it onto the battlefield, then shuffle your library";
staticText = "Search your library or graveyard for a " + filter.getMessage() + " with mana value X or less, put it onto the battlefield, then shuffle your library";
}
public SearchLibraryGraveyardWithLessCMCPutIntoPlay(final SearchLibraryGraveyardWithLessCMCPutIntoPlay effect) {
public SearchLibraryGraveyardWithLessMVPutIntoPlay(final SearchLibraryGraveyardWithLessMVPutIntoPlay effect) {
super(effect);
this.filter = effect.filter;
}
@Override
public SearchLibraryGraveyardWithLessCMCPutIntoPlay copy() {
return new SearchLibraryGraveyardWithLessCMCPutIntoPlay(this);
public SearchLibraryGraveyardWithLessMVPutIntoPlay copy() {
return new SearchLibraryGraveyardWithLessMVPutIntoPlay(this);
}
@Override
@ -51,9 +51,9 @@ public class SearchLibraryGraveyardWithLessCMCPutIntoPlay extends OneShotEffect
if (controller != null && sourceObject != null) {
// create x cost filter
FilterCard advancedFilter = filter.copy(); // never change static objects so copy the object here before
advancedFilter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, source.getManaCostsToPay().getX() + 1));
advancedFilter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, source.getManaCostsToPay().getX() + 1));
if (controller.chooseUse(outcome, "Search your library for a " + filter.getMessage() + " with CMC X or less" + '?', source, game)) {
if (controller.chooseUse(outcome, "Search your library for a " + filter.getMessage() + " with mana value X or less" + '?', source, game)) {
TargetCardInLibrary target = new TargetCardInLibrary(advancedFilter);
target.clearChosen();
if (controller.searchLibrary(target, source, game)) {
@ -64,7 +64,7 @@ public class SearchLibraryGraveyardWithLessCMCPutIntoPlay extends OneShotEffect
controller.shuffleLibrary(source, game);
}
if (cardFound == null && controller.chooseUse(outcome, "Search your graveyard for a " + filter.getMessage() + " with CMC X or less" + '?', source, game)) {
if (cardFound == null && controller.chooseUse(outcome, "Search your graveyard for a " + filter.getMessage() + " with mana value X or less" + '?', source, game)) {
TargetCard target = new TargetCard(0, 1, Zone.GRAVEYARD, advancedFilter);
target.clearChosen();
if (controller.choose(outcome, controller.getGraveyard(), target, game)) {

View file

@ -8,7 +8,7 @@ import mage.cards.Card;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
@ -28,7 +28,7 @@ public class SearchLibraryWithLessCMCPutInPlayEffect extends OneShotEffect {
public SearchLibraryWithLessCMCPutInPlayEffect(FilterCard filter) {
super(Outcome.PutCreatureInPlay);
this.filter = filter;
staticText = "Search your library for a " + filter.getMessage() + " with converted mana cost X or less, put it onto the battlefield, then shuffle your library";
staticText = "Search your library for a " + filter.getMessage() + " with mana value X or less, put it onto the battlefield, then shuffle your library";
}
public SearchLibraryWithLessCMCPutInPlayEffect(final SearchLibraryWithLessCMCPutInPlayEffect effect) {
@ -41,7 +41,7 @@ public class SearchLibraryWithLessCMCPutInPlayEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
FilterCard advancedFilter = filter.copy(); // never change static objects so copy the object here before
advancedFilter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, source.getManaCostsToPay().getX() + 1));
advancedFilter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, source.getManaCostsToPay().getX() + 1));
TargetCardInLibrary target = new TargetCardInLibrary(advancedFilter);
if (controller.searchLibrary(target, source, game)) {
if (!target.getTargets().isEmpty()) {

View file

@ -79,13 +79,13 @@ public class BuybackAbility extends StaticAbility implements OptionalAdditionalS
if (cost instanceof ManaCostsImpl) {
for (Object c : (ManaCostsImpl) cost) {
if (c instanceof GenericManaCost) {
int newCostCMC = ((GenericManaCost) c).convertedManaCost() - amountToReduceBy - genericManaToReduce;
int newCostCMC = ((GenericManaCost) c).manaValue() - amountToReduceBy - genericManaToReduce;
foundCostToReduce = true;
if (newCostCMC > 0) {
amountToReduceBy += genericManaToReduce;
} else {
amountToReduce = ((GenericManaCost) c).convertedManaCost() - amountToReduceBy;
amountToReduceBy = ((GenericManaCost) c).convertedManaCost();
amountToReduce = ((GenericManaCost) c).manaValue() - amountToReduceBy;
amountToReduceBy = ((GenericManaCost) c).manaValue();
}
}
}

View file

@ -49,9 +49,9 @@ public class CascadeAbility extends TriggeredAbilityImpl {
private static final String REMINDERTEXT = " <i>(When you cast this spell, "
+ "exile cards from the top of your library until you exile a "
+ "nonland card whose converted mana cost is less than this spell's converted mana cost. "
+ "nonland card whose mana value is less than this spell's mana value. "
+ "You may cast that spell without paying its mana cost "
+ "if its converted mana cost is less than this spell's converted mana cost. "
+ "if its mana value is less than this spell's mana value. "
+ "Then put all cards exiled this way that weren't cast on the bottom of your library in a random order.)</i>";
private final boolean withReminder;
@ -120,11 +120,11 @@ class CascadeEffect extends OneShotEffect {
// exile cards from the top of your library until you exile a nonland card whose converted mana cost is less than this spell's converted mana cost
Cards cardsToExile = new CardsImpl();
int sourceCost = sourceCard.getConvertedManaCost();
int sourceCost = sourceCard.getManaValue();
Card cardToCast = null;
for (Card card : controller.getLibrary().getCards(game)) {
cardsToExile.add(card);
if (!card.isLand() && card.getConvertedManaCost() < sourceCost) {
if (!card.isLand() && card.getManaValue() < sourceCost) {
cardToCast = card;
break;
}
@ -162,7 +162,7 @@ class CascadeEffect extends OneShotEffect {
partsToCast.add(cardToCast);
}
// remove too big cmc
partsToCast.removeIf(card -> card.getConvertedManaCost() >= sourceCost);
partsToCast.removeIf(card -> card.getManaValue() >= sourceCost);
// remove non spells
partsToCast.removeIf(card -> card.getSpellAbility() == null);
}

View file

@ -53,7 +53,7 @@ public class EmergeAbility extends SpellAbility {
if (controller != null) {
for (Permanent creature : game.getBattlefield().getActivePermanents(
new FilterControlledCreaturePermanent(), this.getControllerId(), this.getSourceId(), game)) {
ManaCost costToPay = CardUtil.reduceCost(emergeCost.copy(), creature.getConvertedManaCost());
ManaCost costToPay = CardUtil.reduceCost(emergeCost.copy(), creature.getManaValue());
if (costToPay.canPay(this, this, this.getControllerId(), game)) {
return ActivationStatus.getTrue(this, game);
}
@ -67,7 +67,7 @@ public class EmergeAbility extends SpellAbility {
public ManaOptions getMinimumCostToActivate(UUID playerId, Game game) {
int maxCMC = 0;
for (Permanent creature : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), playerId, this.getSourceId(), game)) {
int cmc = creature.getConvertedManaCost();
int cmc = creature.getManaValue();
if (cmc > maxCMC) {
maxCMC = cmc;
}
@ -91,7 +91,7 @@ public class EmergeAbility extends SpellAbility {
if (controller.choose(Outcome.Sacrifice, target, this.getSourceId(), game)) {
Permanent creature = game.getPermanent(target.getFirstTarget());
if (creature != null) {
CardUtil.reduceCost(this, creature.getConvertedManaCost());
CardUtil.reduceCost(this, creature.getManaValue());
if (super.activate(game, false)) {
if (creature.sacrifice(this, game)) {
return true;
@ -117,6 +117,6 @@ public class EmergeAbility extends SpellAbility {
@Override
public String getRule() {
return "Emerge " + emergeCost.getText() + " <i>(You may cast this spell by sacrificing a creature and paying the emerge cost reduced by that creature's converted mana cost.)</i>";
return "Emerge " + emergeCost.getText() + " <i>(You may cast this spell by sacrificing a creature and paying the emerge cost reduced by that creature's mana value.)</i>";
}
}

View file

@ -9,7 +9,7 @@ import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.common.TargetCardInYourGraveyard;
@ -50,8 +50,8 @@ public class SoulshiftAbility extends DiesSourceTriggeredAbility {
public void trigger(Game game, UUID controllerId, GameEvent triggeringEvent) {
this.getTargets().clear();
int intValue = amount.calculate(game, this, null);
FilterCard filter = new FilterCard("Spirit card with converted mana cost " + intValue + " or less from your graveyard");
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, intValue + 1));
FilterCard filter = new FilterCard("Spirit card with mana value " + intValue + " or less from your graveyard");
filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, intValue + 1));
filter.add(SubType.SPIRIT.getPredicate());
this.addTarget(new TargetCardInYourGraveyard(filter));
super.trigger(game, controllerId, triggeringEvent); //To change body of generated methods, choose Tools | Templates.
@ -65,10 +65,10 @@ public class SoulshiftAbility extends DiesSourceTriggeredAbility {
@Override
public String getRule() {
if (amount instanceof StaticValue) {
return "Soulshift " + amount.toString() + " <i>(When this creature dies, you may return target Spirit card with converted mana cost " + amount.toString() + " or less from your graveyard to your hand.)</i>";
return "Soulshift " + amount.toString() + " <i>(When this creature dies, you may return target Spirit card with mana value " + amount.toString() + " or less from your graveyard to your hand.)</i>";
} else {
return "{this} has soulshift X, where X is the number of " + amount.getMessage() +
". <i>(When this creature dies, you may return target Spirit card with converted mana cost X or less from your graveyard to your hand.)</i>";
". <i>(When this creature dies, you may return target Spirit card with mana value X or less from your graveyard to your hand.)</i>";
}
}

View file

@ -13,7 +13,7 @@ import mage.constants.Outcome;
import mage.constants.TimingRule;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
@ -57,7 +57,7 @@ public class TransmuteAbility extends SimpleActivatedAbility {
public String getRule() {
return new StringBuilder("Transmute ").append(this.getManaCosts().getText())
.append(" <i>(").append(this.getManaCosts().getText())
.append(", Discard this card: Search your library for a card with the same converted mana cost as this card, reveal it, and put it into your hand. Then shuffle your library. Transmute only as a sorcery.)</i>").toString();
.append(", Discard this card: Search your library for a card with the same mana value as this card, reveal it, and put it into your hand. Then shuffle your library. Transmute only as a sorcery.)</i>").toString();
}
}
@ -77,8 +77,8 @@ class TransmuteEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (sourceObject != null && controller != null) {
FilterCard filter = new FilterCard("card with converted mana cost " + sourceObject.getConvertedManaCost());
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, sourceObject.getConvertedManaCost()));
FilterCard filter = new FilterCard("card with mana value " + sourceObject.getManaValue());
filter.add(new ManaValuePredicate(ComparisonType.EQUAL_TO, sourceObject.getManaValue()));
TargetCardInLibrary target = new TargetCardInLibrary(1, filter);
if (controller.searchLibrary(target, source, game)) {
if (!target.getTargets().isEmpty()) {

View file

@ -94,12 +94,12 @@ public abstract class MeldCard extends CardImpl {
}
@Override
public int getConvertedManaCost() {
public int getManaValue() {
if (this.isCopy()) {
return 0;
} else {
return (this.topHalfCard != null ? this.topHalfCard.getConvertedManaCost() : 0)
+ (this.bottomHalfCard != null ? this.bottomHalfCard.getConvertedManaCost() : 0);
return (this.topHalfCard != null ? this.topHalfCard.getManaValue() : 0)
+ (this.bottomHalfCard != null ? this.bottomHalfCard.getManaValue() : 0);
}
}

View file

@ -327,7 +327,7 @@ public abstract class ModalDoubleFacesCard extends CardImpl {
}
@Override
public int getConvertedManaCost() {
public int getManaValue() {
// Rules:
// The converted mana cost of a modal double-faced card is based on the characteristics of the
// face thats being considered. On the stack and battlefield, consider whichever face is up.
@ -335,7 +335,7 @@ public abstract class ModalDoubleFacesCard extends CardImpl {
// mana cost of a transforming double-faced card is determined.
// on stack or battlefield it must be half card with own cost
return leftHalfCard.getConvertedManaCost();
return leftHalfCard.getManaValue();
}
@Override

View file

@ -204,13 +204,13 @@ public abstract class SplitCard extends CardImpl {
}
@Override
public int getConvertedManaCost() {
public int getManaValue() {
// 202.3d The converted mana cost of a split card not on the stack or of a fused split spell on the
// stack is determined from the combined mana costs of its halves. Otherwise, while a split card is
// on the stack, the converted mana cost of the spell is determined by the mana cost of the half
// that was chosen to be cast. See rule 708, Split Cards.
// split card and it's halfes contains own mana costs, so no need to rewrite logic
return super.getConvertedManaCost();
return super.getManaValue();
}
}

View file

@ -63,7 +63,7 @@ public class XmageInfoDeckExporter extends DeckExporter {
out.printf("%d [%s:%s] %s%n\n", amount.get("M@" + card.getCardKey()), card.getSetCode(), card.getCardNum(), card.getCardName());
} else {
out.printf("%d [%s:%s] %s ;; %s ;; %s ;; %d %n", amount.get("M@" + card.getCardKey()), card.getSetCode(), card.getCardNum(), card.getCardName(),
cardInfo.getColor().getDescription(), cardInfo.getTypes().toString(), cardInfo.getConvertedManaCost());
cardInfo.getColor().getDescription(), cardInfo.getTypes().toString(), cardInfo.getManaValue());
}
}
@ -73,7 +73,7 @@ public class XmageInfoDeckExporter extends DeckExporter {
out.printf("SB: %d [%s:%s] %s%n\n", amount.get("S@" + card.getCardKey()), card.getSetCode(), card.getCardNum(), card.getCardName());
} else {
out.printf("SB: %d [%s:%s] %s ;; %s ;; %s ;; %d %n", amount.get("S@" + card.getCardKey()), card.getSetCode(), card.getCardNum(), card.getCardName(),
cardInfo.getColor().getDescription(), cardInfo.getTypes().toString(), cardInfo.getConvertedManaCost());
cardInfo.getColor().getDescription(), cardInfo.getTypes().toString(), cardInfo.getManaValue());
}
}

View file

@ -35,7 +35,7 @@ public class MockCard extends CardImpl {
protected List<String> manaCostStr;
protected String adventureSpellName;
protected boolean isModalDoubleFacesCard;
protected int convertedManaCost;
protected int manaValue;
public MockCard(CardInfo card) {
super(null, card.getName());
@ -54,7 +54,7 @@ public class MockCard extends CardImpl {
this.manaCostLeftStr = card.getManaCosts(CardInfo.ManaCostSide.LEFT);
this.manaCostRightStr = card.getManaCosts(CardInfo.ManaCostSide.RIGHT);
this.manaCostStr = card.getManaCosts(CardInfo.ManaCostSide.ALL);
this.convertedManaCost = card.getConvertedManaCost();
this.manaValue = card.getManaValue();
this.color = card.getColor();
@ -107,7 +107,7 @@ public class MockCard extends CardImpl {
this.manaCostStr = new ArrayList<>(card.manaCostStr);
this.adventureSpellName = card.adventureSpellName;
this.isModalDoubleFacesCard = card.isModalDoubleFacesCard;
this.convertedManaCost = card.convertedManaCost;
this.manaValue = card.manaValue;
}
@Override
@ -133,8 +133,8 @@ public class MockCard extends CardImpl {
}
@Override
public int getConvertedManaCost() {
return this.convertedManaCost;
public int getManaValue() {
return this.manaValue;
}
public List<String> getManaCostStr(CardInfo.ManaCostSide manaCostSide) {

View file

@ -34,7 +34,7 @@ public class CardCriteria {
private boolean red;
private boolean white;
private boolean colorless;
private Integer convertedManaCost;
private Integer manaValue;
private String sortBy;
private Long start;
private Long count;
@ -167,8 +167,8 @@ public class CardCriteria {
return this;
}
public CardCriteria convertedManaCost(Integer convertedManaCost) {
this.convertedManaCost = convertedManaCost;
public CardCriteria manaValue(Integer manaValue) {
this.manaValue = manaValue;
return this;
}
@ -265,8 +265,8 @@ public class CardCriteria {
clausesCount++;
}
if (convertedManaCost != null) {
where.eq("convertedManaCost", convertedManaCost);
if (manaValue != null) {
where.eq("manaValue", manaValue);
clausesCount++;
}
@ -433,8 +433,8 @@ public class CardCriteria {
return colorless;
}
public Integer getConvertedManaCost() {
return convertedManaCost;
public Integer getManaValue() {
return manaValue;
}
public String getSortBy() {

View file

@ -53,7 +53,7 @@ public class CardInfo {
@DatabaseField
protected String startingLoyalty;
@DatabaseField
protected int convertedManaCost;
protected int manaValue;
@DatabaseField(dataType = DataType.ENUM_STRING)
protected Rarity rarity;
@DatabaseField
@ -126,7 +126,7 @@ public class CardInfo {
this.className = card.getClass().getCanonicalName();
this.power = card.getPower().toString();
this.toughness = card.getToughness().toString();
this.convertedManaCost = card.getConvertedManaCost();
this.manaValue = card.getManaValue();
this.rarity = card.getRarity();
this.splitCard = card instanceof SplitCard;
this.splitCardFuse = card.getSpellAbility() != null && card.getSpellAbility().getSpellAbilityType() == SpellAbilityType.SPLIT_FUSED;
@ -335,8 +335,8 @@ public class CardInfo {
this.types = sb.toString();
}
public int getConvertedManaCost() {
return convertedManaCost;
public int getManaValue() {
return manaValue;
}
public final List<String> getManaCosts(ManaCostSide manaCostSide) {

View file

@ -196,7 +196,7 @@ public abstract class Designation implements MageObject, Copyable<Designation> {
}
@Override
public int getConvertedManaCost() {
public int getManaValue() {
return 0;
}

View file

@ -7,21 +7,21 @@ import mage.game.Game;
/**
* @author TheElk801
*/
public enum ConvertedManaCostParityPredicate implements Predicate<MageObject> {
public enum ManaValueParityPredicate implements Predicate<MageObject> {
EVEN(0),
ODD(1);
private final int parity;
ConvertedManaCostParityPredicate(int parity) {
ManaValueParityPredicate(int parity) {
this.parity = parity;
}
@Override
public boolean apply(MageObject input, Game game) {
return input.getConvertedManaCost() % 2 == parity;
return input.getManaValue() % 2 == parity;
}
@Override
public String toString() {
return "ConvertedManaCostParity" + super.toString();
return "ManaValueParity" + super.toString();
}}

View file

@ -9,19 +9,19 @@ import mage.filter.predicate.IntComparePredicate;
*
* @author North
*/
public class ConvertedManaCostPredicate extends IntComparePredicate<MageObject> {
public class ManaValuePredicate extends IntComparePredicate<MageObject> {
public ConvertedManaCostPredicate(ComparisonType type, int value) {
public ManaValuePredicate(ComparisonType type, int value) {
super(type, value);
}
@Override
protected int getInputValue(MageObject input) {
return input.getConvertedManaCost();
return input.getManaValue();
}
@Override
public String toString() {
return "ConvertedManaCost" + super.toString();
return "ManaValue" + super.toString();
}
}

View file

@ -249,8 +249,8 @@ public class Commander implements CommandObject {
}
@Override
public int getConvertedManaCost() {
return sourceObject.getConvertedManaCost();
public int getManaValue() {
return sourceObject.getManaValue();
}
@Override

View file

@ -204,7 +204,7 @@ public class Emblem implements CommandObject {
}
@Override
public int getConvertedManaCost() {
public int getManaValue() {
return 0;
}

View file

@ -213,7 +213,7 @@ public class Plane implements CommandObject {
}
@Override
public int getConvertedManaCost() {
public int getManaValue() {
return 0;
}

View file

@ -52,7 +52,7 @@ class MomirEffect extends OneShotEffect {
public MomirEffect(MomirEffect effect) {
super(effect);
staticText = "Create a token that's a copy of a creature card with converted mana cost X chosen at random";
staticText = "Create a token that's a copy of a creature card with mana value X chosen at random";
}
@Override
@ -70,10 +70,10 @@ class MomirEffect extends OneShotEffect {
return true;
}
// should this be random across card names
CardCriteria criteria = new CardCriteria().types(CardType.CREATURE).convertedManaCost(value);
CardCriteria criteria = new CardCriteria().types(CardType.CREATURE).manaValue(value);
List<CardInfo> options = CardRepository.instance.findCards(criteria);
if (options == null || options.isEmpty()) {
game.informPlayers("No random creature card with converted mana cost of " + value + " was found.");
game.informPlayers("No random creature card with mana value of " + value + " was found.");
return false;
}

View file

@ -10,7 +10,7 @@ import mage.abilities.common.ActivateIfConditionActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.MainPhaseStackEmptyCondition;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.common.TargetConvertedManaCost;
import mage.abilities.dynamicvalue.common.TargetManaValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.RollPlanarDieEffect;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
@ -37,7 +37,7 @@ import mage.watchers.common.PlanarRollWatcher;
public class FeedingGroundsPlane extends Plane {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature");
private static final String rule = "put X +1/+1 counters on target creature, where X is that creature's converted mana cost";
private static final String rule = "put X +1/+1 counters on target creature, where X is that creature's mana value";
public FeedingGroundsPlane() {
this.setPlaneType(Planes.PLANE_FEEDING_GROUNDS);
@ -48,7 +48,7 @@ public class FeedingGroundsPlane extends Plane {
this.getAbilities().add(ability);
// Active player can roll the planar die: Whenever you roll {CHAOS}, target red or green creature gets X +1/+1 counters
Effect chaosEffect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(), TargetConvertedManaCost.instance);
Effect chaosEffect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(), TargetManaValue.instance);
Target chaosTarget = new TargetCreaturePermanent(1, 1, filter, false);
List<Effect> chaosEffects = new ArrayList<>();

View file

@ -317,7 +317,7 @@ public final class RateCard {
* @return
*/
private static int getManaCostScore(Card card, List<ColoredManaSymbol> allowedColors) {
int converted = card.getConvertedManaCost();
int converted = card.getManaValue();
if (allowedColors == null) {
int colorPenalty = 0;
for (String symbol : card.getManaCostSymbols()) {

View file

@ -184,18 +184,18 @@ public class PermanentCard extends PermanentImpl {
}
@Override
public int getConvertedManaCost() {
public int getManaValue() {
if (isTransformed()) {
// 711.4b While a double-faced permanent's back face is up, it has only the characteristics of its back face.
// However, its converted mana cost is calculated using the mana cost of its front face. This is a change from previous rules.
// If a permanent is copying the back face of a double-faced card (even if the card representing that copy
// is itself a double-faced card), the converted mana cost of that permanent is 0.
return getCard().getConvertedManaCost();
return getCard().getManaValue();
}
if (faceDown) { // game not neccessary
return getManaCost().convertedManaCost();
return getManaCost().manaValue();
}
return super.getConvertedManaCost();
return super.getManaValue();
}

View file

@ -16,11 +16,11 @@ public class PermanentMeld extends PermanentCard {
}
@Override
public int getConvertedManaCost() {
public int getManaValue() {
if (this.isCopy()) {
return 0;
} else {
return this.getCard().getConvertedManaCost();
return this.getCard().getManaValue();
}
}
}

View file

@ -16,7 +16,7 @@ public final class ReflectionPureToken extends TokenImpl {
}
public ReflectionPureToken(int xValue) {
super("Reflection", "X/X white Reflection creature token, where X is the converted mana cost of that spell");
super("Reflection", "X/X white Reflection creature token, where X is the mana value of that spell");
this.setOriginalExpansionSetCode("INV");
cardType.add(CardType.CREATURE);
color.setWhite(true);

View file

@ -628,7 +628,7 @@ public class Spell extends StackObjImpl implements Card {
* @return
*/
@Override
public int getConvertedManaCost() {
public int getManaValue() {
int cmc = 0;
if (faceDown) {
return 0;
@ -636,7 +636,7 @@ public class Spell extends StackObjImpl implements Card {
for (SpellAbility spellAbility : spellAbilities) {
cmc += spellAbility.getConvertedXManaCost(getCard());
}
cmc += getCard().getManaCost().convertedManaCost();
cmc += getCard().getManaCost().manaValue();
return cmc;
}

View file

@ -274,7 +274,7 @@ public class StackAbility extends StackObjImpl implements Ability {
}
@Override
public int getConvertedManaCost() {
public int getManaValue() {
// Activated abilities have an "activation cost" but they don't have a characteristic related to that while on the stack.
// There are certain effects that interact with the cost to activate an ability (e.g., Training Grounds, Power Artifact)
// but nothing that looks for that quality of an ability once it's on the stack.

View file

@ -3,7 +3,7 @@ package mage.target.targetadjustment;
import mage.abilities.Ability;
import mage.constants.ComparisonType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.target.TargetCard;
import mage.target.common.TargetCardInGraveyard;
@ -19,7 +19,7 @@ public enum XCMCGraveyardAdjuster implements TargetAdjuster {
public void adjustTargets(Ability ability, Game game) {
int xValue = ability.getManaCostsToPay().getX();
FilterCard filterCard = ((TargetCard) ability.getTargets().get(0)).getFilter().copy();
filterCard.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
filterCard.add(new ManaValuePredicate(ComparisonType.EQUAL_TO, xValue));
filterCard.setMessage(filterCard.getMessage().replace('X', (char) xValue));
ability.getTargets().clear();
ability.getTargets().add(new TargetCardInGraveyard(filterCard));

View file

@ -3,7 +3,7 @@ package mage.target.targetadjustment;
import mage.abilities.Ability;
import mage.constants.ComparisonType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.target.TargetPermanent;
@ -21,7 +21,7 @@ public enum XCMCPermanentAdjuster implements TargetAdjuster {
int minTargets = oldTargetPermanent.getMinNumberOfTargets();
int maxTargets = oldTargetPermanent.getMaxNumberOfTargets();
FilterPermanent permanentFilter = oldTargetPermanent.getFilter().copy();
permanentFilter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
permanentFilter.add(new ManaValuePredicate(ComparisonType.EQUAL_TO, xValue));
ability.getTargets().clear();
ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, permanentFilter, false));
}