* Fixed CMC calculation for transformed cards (fixes #1826).

This commit is contained in:
LevelX2 2016-04-15 14:59:36 +02:00
parent 1deb4192ba
commit 2b8f73dbcc
132 changed files with 227 additions and 179 deletions

View file

@ -101,7 +101,7 @@ class SingeMindOgreEffect extends OneShotEffect {
Card card = targetPlayer.getHand().getRandom(game); Card card = targetPlayer.getHand().getRandom(game);
revealed.add(card); revealed.add(card);
targetPlayer.revealCards("Singe-Mind Ogre", revealed, game); targetPlayer.revealCards("Singe-Mind Ogre", revealed, game);
targetPlayer.loseLife(card.getManaCost().convertedManaCost(), game); targetPlayer.loseLife(card.getConvertedManaCost(), game);
return true; return true;
} }
return false; return false;

View file

@ -104,7 +104,7 @@ class SpellboundDragonEffect extends OneShotEffect {
you.choose(Outcome.Discard, target, source.getSourceId(), game); you.choose(Outcome.Discard, target, source.getSourceId(), game);
Card card = you.getHand().get(target.getFirstTarget(), game); Card card = you.getHand().get(target.getFirstTarget(), game);
if (card != null && you.discard(card, source, game)) { if (card != null && you.discard(card, source, game)) {
int cmc = card.getManaCost().convertedManaCost(); int cmc = card.getConvertedManaCost();
if (dragon != null) { if (dragon != null) {
game.addEffect(new BoostSourceEffect(cmc, 0, Duration.EndOfTurn), source); game.addEffect(new BoostSourceEffect(cmc, 0, Duration.EndOfTurn), source);
return true; return true;

View file

@ -96,7 +96,7 @@ class VengefulRebirthEffect extends OneShotEffect {
if (controller != null && card != null && controller.removeFromGraveyard(card, game)) { if (controller != null && card != null && controller.removeFromGraveyard(card, game)) {
controller.moveCards(card, Zone.GRAVEYARD, Zone.HAND, source, game); controller.moveCards(card, Zone.GRAVEYARD, Zone.HAND, source, game);
if (!card.getCardType().contains(CardType.LAND)) { if (!card.getCardType().contains(CardType.LAND)) {
int damage = card.getManaCost().convertedManaCost(); int damage = card.getConvertedManaCost();
Permanent permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget()); Permanent permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (permanent != null) { if (permanent != null) {
permanent.damage(damage, source.getSourceId(), game, false, true); permanent.damage(damage, source.getSourceId(), game, false, true);

View file

@ -135,7 +135,7 @@ class PhyrexianDevourerEffect extends OneShotEffect {
} }
} }
if (card != null) { if (card != null) {
int amount = card.getManaCost().convertedManaCost(); int amount = card.getConvertedManaCost();
if (amount > 0) { if (amount > 0) {
return new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount)).apply(game, source); return new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount)).apply(game, source);
} }

View file

@ -98,7 +98,7 @@ class TransmuteArtifactEffect extends SearchEffect {
if (controller.chooseTarget(Outcome.Sacrifice, targetArtifact, source, game)) { if (controller.chooseTarget(Outcome.Sacrifice, targetArtifact, source, game)) {
Permanent permanent = game.getPermanent(targetArtifact.getFirstTarget()); Permanent permanent = game.getPermanent(targetArtifact.getFirstTarget());
if (permanent != null) { if (permanent != null) {
convertedManaCost = permanent.getManaCost().convertedManaCost(); convertedManaCost = permanent.getConvertedManaCost();
sacrifice = permanent.sacrifice(source.getSourceId(), game); sacrifice = permanent.sacrifice(source.getSourceId(), game);
} }
} else { } else {
@ -111,11 +111,11 @@ class TransmuteArtifactEffect extends SearchEffect {
Card card = controller.getLibrary().getCard(cardId, game); Card card = controller.getLibrary().getCard(cardId, game);
if (card != null) { if (card != null) {
//If that card's converted mana cost is less than or equal to the sacrificed artifact's converted mana cost, put it onto the battlefield. //If that card's converted mana cost is less than or equal to the sacrificed artifact's converted mana cost, put it onto the battlefield.
if (card.getManaCost().convertedManaCost() <= convertedManaCost) { if (card.getConvertedManaCost() <= convertedManaCost) {
controller.moveCards(card, Zone.BATTLEFIELD, source, game); controller.moveCards(card, Zone.BATTLEFIELD, source, game);
} else { } else {
//If it's greater, you may pay {X}, where X is the difference. If you do, put it onto the battlefield. //If it's greater, you may pay {X}, where X is the difference. If you do, put it onto the battlefield.
GenericManaCost cost = new GenericManaCost(card.getManaCost().convertedManaCost() - convertedManaCost); GenericManaCost cost = new GenericManaCost(card.getConvertedManaCost() - convertedManaCost);
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
controller.moveCards(card, Zone.BATTLEFIELD, source, game); controller.moveCards(card, Zone.BATTLEFIELD, source, game);
} else { } else {

View file

@ -116,7 +116,7 @@ class DeathEffect extends OneShotEffect {
if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) { if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) {
controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game); controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game);
} }
controller.loseLife(creatureCard.getManaCost().convertedManaCost(), game); controller.loseLife(creatureCard.getConvertedManaCost(), game);
return true; return true;
} }
return false; return false;

View file

@ -103,7 +103,7 @@ class OrimsThunderEffect2 extends OneShotEffect {
MageObject firstTarget = game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); MageObject firstTarget = game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
Permanent secondTarget = game.getPermanent(source.getTargets().get(1).getFirstTarget()); Permanent secondTarget = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (firstTarget != null) { if (firstTarget != null) {
damage = firstTarget.getManaCost().convertedManaCost(); damage = firstTarget.getConvertedManaCost();
} }
boolean kicked = KickedCondition.getInstance().apply(game, source); boolean kicked = KickedCondition.getInstance().apply(game, source);
if (kicked && secondTarget != null) { if (kicked && secondTarget != null) {

View file

@ -88,7 +88,7 @@ class MetamorphosisEffect extends OneShotEffect {
int amount = 0; int amount = 0;
for (Cost cost: source.getCosts()) { for (Cost cost: source.getCosts()) {
if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost)cost).getPermanents().size() > 0) { if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost)cost).getPermanents().size() > 0) {
amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getManaCost().convertedManaCost()+1; amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getConvertedManaCost()+1;
break; break;
} }
} }

View file

@ -88,14 +88,14 @@ class MarchFromTheTombTarget extends TargetCardInYourGraveyard {
for (UUID targetId : this.getTargets()) { for (UUID targetId : this.getTargets()) {
Card card = game.getCard(targetId); Card card = game.getCard(targetId);
if (card != null) { if (card != null) {
cmcLeft -= card.getManaCost().convertedManaCost(); cmcLeft -= card.getConvertedManaCost();
} }
} }
Set<UUID> possibleTargets = super.possibleTargets(sourceId, sourceControllerId, game); Set<UUID> possibleTargets = super.possibleTargets(sourceId, sourceControllerId, game);
Set<UUID> leftPossibleTargets = new HashSet<>(); Set<UUID> leftPossibleTargets = new HashSet<>();
for (UUID targetId : possibleTargets) { for (UUID targetId : possibleTargets) {
Card card = game.getCard(targetId); Card card = game.getCard(targetId);
if (card != null && card.getManaCost().convertedManaCost() <= cmcLeft) { if (card != null && card.getConvertedManaCost() <= cmcLeft) {
leftPossibleTargets.add(targetId); leftPossibleTargets.add(targetId);
} }
} }
@ -110,11 +110,11 @@ class MarchFromTheTombTarget extends TargetCardInYourGraveyard {
for (UUID targetId : this.getTargets()) { for (UUID targetId : this.getTargets()) {
Card card = game.getCard(targetId); Card card = game.getCard(targetId);
if (card != null) { if (card != null) {
cmcLeft -= card.getManaCost().convertedManaCost(); cmcLeft -= card.getConvertedManaCost();
} }
} }
Card card = game.getCard(objectId); Card card = game.getCard(objectId);
return card != null && card.getManaCost().convertedManaCost() <= cmcLeft; return card != null && card.getConvertedManaCost() <= cmcLeft;
} }
return false; return false;
} }

View file

@ -145,7 +145,7 @@ class VoidWinnowerCantBlockEffect extends RestrictionEffect {
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) { if (game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) {
// the low bit will always be set on an odd number. // the low bit will always be set on an odd number.
return (permanent.getManaCost().convertedManaCost() & 1) == 0; return (permanent.getConvertedManaCost() & 1) == 0;
} }
return false; return false;
} }

View file

@ -112,13 +112,13 @@ class DisruptingShoalCounterTargetEffect extends OneShotEffect {
if (cost.isPaid() && cost instanceof ExileFromHandCost) { if (cost.isPaid() && cost instanceof ExileFromHandCost) {
for (Card card : ((ExileFromHandCost) cost).getCards()) { for (Card card : ((ExileFromHandCost) cost).getCards()) {
if (card instanceof SplitCard) { if (card instanceof SplitCard) {
if (((SplitCard) card).getLeftHalfCard().getManaCost().convertedManaCost() == amount) { if (((SplitCard) card).getLeftHalfCard().getConvertedManaCost() == amount) {
return true; return true;
} }
if (((SplitCard) card).getRightHalfCard().getManaCost().convertedManaCost() == amount) { if (((SplitCard) card).getRightHalfCard().getConvertedManaCost() == amount) {
return true; return true;
} }
} else if (card.getManaCost().convertedManaCost() == amount) { } else if (card.getConvertedManaCost() == amount) {
return true; return true;
} }
} }

View file

@ -83,7 +83,7 @@ public class HeedTheMists extends CardImpl {
if (controller != null) { if (controller != null) {
Card card = controller.getLibrary().removeFromTop(game); Card card = controller.getLibrary().removeFromTop(game);
if (card != null) { if (card != null) {
int cmc = card.getManaCost().convertedManaCost(); int cmc = card.getConvertedManaCost();
controller.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); controller.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
controller.drawCards(cmc, game); controller.drawCards(cmc, game);
} }

View file

@ -107,7 +107,7 @@ public class SlumberingTora extends CardImpl {
int convManaCosts = 0; int convManaCosts = 0;
for (Cost cost: source.getCosts()) { for (Cost cost: source.getCosts()) {
if (cost instanceof DiscardTargetCost && ((DiscardTargetCost)cost).getCards().size() > 0) { if (cost instanceof DiscardTargetCost && ((DiscardTargetCost)cost).getCards().size() > 0) {
convManaCosts = ((DiscardTargetCost)cost).getCards().get(0).getManaCost().convertedManaCost(); convManaCosts = ((DiscardTargetCost)cost).getCards().get(0).getConvertedManaCost();
break; break;
} }
} }

View file

@ -83,7 +83,7 @@ public class TerashisGrasp extends CardImpl {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent targetPermanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); Permanent targetPermanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (targetPermanent != null) { if (targetPermanent != null) {
int cost = targetPermanent.getManaCost().convertedManaCost(); int cost = targetPermanent.getConvertedManaCost();
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
player.gainLife(cost, game); player.gainLife(cost, game);

View file

@ -103,7 +103,7 @@ class PainSeerEffect extends OneShotEffect {
if (card != null && if (card != null &&
card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) { card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) {
player.loseLife(card.getManaCost().convertedManaCost(), game); player.loseLife(card.getConvertedManaCost(), game);
return true; return true;
} }
} }

View file

@ -110,7 +110,7 @@ class NayaSoulbeastCastEffect extends OneShotEffect {
if (player != null) { if (player != null) {
if (player.getLibrary().size() > 0) { if (player.getLibrary().size() > 0) {
Card card = player.getLibrary().getFromTop(game); Card card = player.getLibrary().getFromTop(game);
cmc += card.getManaCost().convertedManaCost(); cmc += card.getConvertedManaCost();
player.revealCards(sourceObject.getName() + " " + player.getName() + ")", new CardsImpl(card), game); player.revealCards(sourceObject.getName() + " " + player.getName() + ")", new CardsImpl(card), game);
} }
} }

View file

@ -135,7 +135,7 @@ class SydriGalvanicGeniusEffect extends ContinuousEffectImpl {
case PTChangingEffects_7: case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) { if (sublayer == SubLayer.SetPT_7b) {
int cmc = artifact.getManaCost().convertedManaCost(); int cmc = artifact.getConvertedManaCost();
artifact.getPower().setValue(cmc); artifact.getPower().setValue(cmc);
artifact.getToughness().setValue(cmc); artifact.getToughness().setValue(cmc);
} }

View file

@ -122,7 +122,7 @@ class MerenOfClanNelTothEffect extends OneShotEffect {
if (card != null) { if (card != null) {
Zone targetZone = Zone.HAND; Zone targetZone = Zone.HAND;
String text = " put into hand of "; String text = " put into hand of ";
if (card.getManaCost().convertedManaCost() <= amount) { if (card.getConvertedManaCost() <= amount) {
targetZone = Zone.BATTLEFIELD; targetZone = Zone.BATTLEFIELD;
text = " put onto battlefield for "; text = " put onto battlefield for ";
} }

View file

@ -98,7 +98,7 @@ class PunishmentEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
if (permanent != null if (permanent != null
&& permanent.getManaCost().convertedManaCost() == source.getManaCostsToPay().getX() && permanent.getConvertedManaCost() == source.getManaCostsToPay().getX()
&& (permanent.getCardType().contains(CardType.ARTIFACT) && (permanent.getCardType().contains(CardType.ARTIFACT)
|| permanent.getCardType().contains(CardType.CREATURE) || permanent.getCardType().contains(CardType.CREATURE)
|| permanent.getCardType().contains(CardType.ENCHANTMENT))) { || permanent.getCardType().contains(CardType.ENCHANTMENT))) {

View file

@ -100,7 +100,7 @@ class HellholeRatsEffect extends OneShotEffect {
Cards cards = targetPlayer.discard(1, false, source, game); Cards cards = targetPlayer.discard(1, false, source, game);
if (!cards.isEmpty()) { if (!cards.isEmpty()) {
for (Card card : cards.getCards(game)) { for (Card card : cards.getCards(game)) {
damage = card.getManaCost().convertedManaCost(); damage = card.getConvertedManaCost();
} }
targetPlayer.damage(damage, source.getSourceId(), game, false, true); targetPlayer.damage(damage, source.getSourceId(), game, false, true);
} }

View file

@ -115,7 +115,7 @@ class SeekEffect extends OneShotEffect {
Card card = opponent.getLibrary().remove(targetId, game); Card card = opponent.getLibrary().remove(targetId, game);
if (card != null) { if (card != null) {
player.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY, true); player.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY, true);
int cmc = card.getManaCost().convertedManaCost(); int cmc = card.getConvertedManaCost();
if (cmc > 0) { if (cmc > 0) {
player.gainLife(cmc, game); player.gainLife(cmc, game);
} }

View file

@ -110,7 +110,7 @@ class HitEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(target.getFirstTarget()); Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) { if (permanent != null) {
permanent.sacrifice(source.getSourceId(), game); permanent.sacrifice(source.getSourceId(), game);
int damage = permanent.getManaCost().convertedManaCost(); int damage = permanent.getConvertedManaCost();
if (damage > 0) { if (damage > 0) {
targetPlayer.damage(damage, source.getSourceId(), game, false, true); targetPlayer.damage(damage, source.getSourceId(), game, false, true);
} }

View file

@ -132,7 +132,7 @@ class ProteanHulkEffect extends OneShotEffect {
if (librarySearchLimit == 0) { if (librarySearchLimit == 0) {
break; break;
} }
manaCostLeftToFetch -= card.getManaCost().convertedManaCost(); manaCostLeftToFetch -= card.getConvertedManaCost();
filter = new FilterCreatureCard("number of creature cards with total converted mana cost 6 or less (" + manaCostLeftToFetch + " CMC left)"); filter = new FilterCreatureCard("number of creature cards with total converted mana cost 6 or less (" + manaCostLeftToFetch + " CMC left)");
filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, manaCostLeftToFetch + 1)); filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, manaCostLeftToFetch + 1));
target = new TargetCardInLibrary(0, 1, filter); target = new TargetCardInLibrary(0, 1, filter);

View file

@ -98,7 +98,7 @@ class BlastOfGeniusEffect extends OneShotEffect {
Card card = player.getHand().get(target.getFirstTarget(), game); Card card = player.getHand().get(target.getFirstTarget(), game);
if (card != null) { if (card != null) {
player.discard(card, source, game); player.discard(card, source, game);
int damage = card.getManaCost().convertedManaCost(); int damage = card.getConvertedManaCost();
Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (creature != null) { if (creature != null) {
creature.damage(damage, source.getSourceId(), game, false, true); creature.damage(damage, source.getSourceId(), game, false, true);

View file

@ -89,7 +89,7 @@ class GazeOfGraniteEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
if (!permanent.getCardType().contains(CardType.LAND) && permanent.getManaCost().convertedManaCost() <= source.getManaCostsToPay().getX()) { if (!permanent.getCardType().contains(CardType.LAND) && permanent.getConvertedManaCost() <= source.getManaCostsToPay().getX()) {
permanent.destroy(source.getSourceId(), game, false); permanent.destroy(source.getSourceId(), game, false);
} }
} }

View file

@ -162,7 +162,7 @@ class LivingLoreSetPowerToughnessSourceEffect extends ContinuousEffectImpl {
break; break;
} }
if (exiledCard != null) { if (exiledCard != null) {
int value = exiledCard.getManaCost().convertedManaCost(); int value = exiledCard.getConvertedManaCost();
permanent.getPower().setValue(value); permanent.getPower().setValue(value);
permanent.getToughness().setValue(value); permanent.getToughness().setValue(value);
} }

View file

@ -106,7 +106,7 @@ class VolcanicVisionReturnToHandTargetEffect extends OneShotEffect {
Card card = game.getCard(targetId); Card card = game.getCard(targetId);
if (card != null) { if (card != null) {
controller.moveCards(card, null, Zone.HAND, source, game); controller.moveCards(card, null, Zone.HAND, source, game);
int damage = card.getManaCost().convertedManaCost(); int damage = card.getConvertedManaCost();
if (damage > 0) { if (damage > 0) {
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
creature.damage(damage, source.getSourceId(), game, false, true); creature.damage(damage, source.getSourceId(), game, false, true);

View file

@ -99,7 +99,7 @@ class FriendlyFireEffect extends OneShotEffect {
Card card = controllerOfTargetCreature.getHand().getRandom(game); Card card = controllerOfTargetCreature.getHand().getRandom(game);
cards.add(card); cards.add(card);
controllerOfTargetCreature.revealCards(sourceObject.getName(), cards, game); controllerOfTargetCreature.revealCards(sourceObject.getName(), cards, game);
int damage = card.getManaCost().convertedManaCost(); int damage = card.getConvertedManaCost();
targetCreature.damage(damage, source.getSourceId(), game, false, true); targetCreature.damage(damage, source.getSourceId(), game, false, true);
controllerOfTargetCreature.damage(damage, source.getSourceId(), game, false, true); controllerOfTargetCreature.damage(damage, source.getSourceId(), game, false, true);
return true; return true;

View file

@ -101,7 +101,7 @@ class EngineeredExplosivesEffect extends OneShotEffect {
if(engineeredExplosives != null && engineeredExplosives instanceof Permanent){ if(engineeredExplosives != null && engineeredExplosives instanceof Permanent){
int count = ((Permanent)engineeredExplosives).getCounters().getCount(CounterType.CHARGE); int count = ((Permanent)engineeredExplosives).getCounters().getCount(CounterType.CHARGE);
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
if(permanent.getManaCost().convertedManaCost() == count){ if(permanent.getConvertedManaCost() == count){
permanent.destroy(source.getSourceId(), game, false); permanent.destroy(source.getSourceId(), game, false);
} }
} }

View file

@ -180,13 +180,13 @@ class JuxtaposeEffect extends ContinuousEffectImpl {
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(filter, playerId, game); List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(filter, playerId, game);
int highestCMC = -1; int highestCMC = -1;
for (Permanent permanent : permanents) { for (Permanent permanent : permanents) {
if (highestCMC < permanent.getManaCost().convertedManaCost()) { if (highestCMC < permanent.getConvertedManaCost()) {
highestCMC = permanent.getManaCost().convertedManaCost(); highestCMC = permanent.getConvertedManaCost();
} }
} }
List<Permanent> result = new ArrayList<>(); List<Permanent> result = new ArrayList<>();
for (Permanent permanent : permanents) { for (Permanent permanent : permanents) {
if (permanent.getManaCost().convertedManaCost() == highestCMC) { if (permanent.getConvertedManaCost() == highestCMC) {
result.add(permanent); result.add(permanent);
} }
} }

View file

@ -119,7 +119,7 @@ class TitaniasSongEffect extends ContinuousEffectImpl {
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) { for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) {
Permanent permanent = it.next().getPermanent(game); Permanent permanent = it.next().getPermanent(game);
if (permanent != null){ if (permanent != null){
int manaCost = permanent.getManaCost().convertedManaCost(); int manaCost = permanent.getConvertedManaCost();
permanent.getPower().setValue(manaCost); permanent.getPower().setValue(manaCost);
permanent.getToughness().setValue(manaCost); permanent.getToughness().setValue(manaCost);
} }

View file

@ -97,7 +97,7 @@ class JudgeUnworthyEffect extends OneShotEffect {
controller.revealCards(sourceCard.getName(), new CardsImpl(card), game); controller.revealCards(sourceCard.getName(), new CardsImpl(card), game);
Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (targetCreature != null) { if (targetCreature != null) {
targetCreature.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); targetCreature.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
return true; return true;
} }
} }

View file

@ -107,7 +107,7 @@ class DuskmantleSeerEffect extends OneShotEffect {
Cards cards = new CardsImpl(); Cards cards = new CardsImpl();
cards.add(card); cards.add(card);
player.revealCards(sourceCard.getName() + ": Revealed by " + player.getName(), cards, game); player.revealCards(sourceCard.getName() + ": Revealed by " + player.getName(), cards, game);
player.loseLife(card.getManaCost().convertedManaCost(), game); player.loseLife(card.getConvertedManaCost(), game);
card.moveToZone(Zone.HAND, source.getSourceId(), game, true); card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
} }
} }

View file

@ -89,7 +89,7 @@ class ImmortalServitudeEffect extends OneShotEffect {
int count = source.getManaCostsToPay().getX(); int count = source.getManaCostsToPay().getX();
Set<Card> cards = you.getGraveyard().getCards(new FilterCreatureCard(), game); Set<Card> cards = you.getGraveyard().getCards(new FilterCreatureCard(), game);
for (Card card : cards) { for (Card card : cards) {
if (card.getManaCost().convertedManaCost() == count if (card.getConvertedManaCost() == count
&& card != null) { && card != null) {
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false); card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
} }

View file

@ -88,7 +88,7 @@ class HereticsPunishmentEffect extends OneShotEffect {
int maxCost = 0; int maxCost = 0;
Set<Card> cardList = controller.getLibrary().getTopCards(game, 3); Set<Card> cardList = controller.getLibrary().getTopCards(game, 3);
for (Card card : cardList) { for (Card card : cardList) {
int test = card.getManaCost().convertedManaCost(); int test = card.getConvertedManaCost();
if (test > maxCost) { if (test > maxCost) {
maxCost = test; maxCost = test;
} }

View file

@ -98,7 +98,7 @@ class MindshriekerEffect extends OneShotEffect {
Card card = targetPlayer.getLibrary().removeFromTop(game); Card card = targetPlayer.getLibrary().removeFromTop(game);
if (card != null) { if (card != null) {
targetPlayer.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); targetPlayer.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
int amount = card.getManaCost().convertedManaCost(); int amount = card.getConvertedManaCost();
if (amount > 0) { if (amount > 0) {
game.addEffect(new BoostSourceEffect(amount, amount, Duration.EndOfTurn), source); game.addEffect(new BoostSourceEffect(amount, amount, Duration.EndOfTurn), source);
} }

View file

@ -100,7 +100,7 @@ class PhyrexianDelverEffect extends OneShotEffect {
if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) { if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) {
result = controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game);; result = controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game);;
} }
controller.loseLife(creatureCard.getManaCost().convertedManaCost(), game); controller.loseLife(creatureCard.getConvertedManaCost(), game);
return result; return result;
} }
return false; return false;

View file

@ -106,7 +106,7 @@ class VoidEffect extends OneShotEffect {
int number = Integer.parseInt(source.getChoices().get(0).getChoice()); int number = Integer.parseInt(source.getChoices().get(0).getChoice());
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
if ((permanent.getCardType().contains(CardType.ARTIFACT) || permanent.getCardType().contains(CardType.CREATURE)) if ((permanent.getCardType().contains(CardType.ARTIFACT) || permanent.getCardType().contains(CardType.CREATURE))
&& permanent.getManaCost().convertedManaCost() == number) { && permanent.getConvertedManaCost() == number) {
permanent.destroy(source.getSourceId(), game, false); permanent.destroy(source.getSourceId(), game, false);
} }
} }

View file

@ -110,9 +110,9 @@ class DiscipleOfDeceitEffect extends OneShotEffect {
if (card == null) { if (card == null) {
return false; return false;
} }
String targetName = new StringBuilder("card with converted mana cost of ").append(card.getManaCost().convertedManaCost()).toString(); String targetName = new StringBuilder("card with converted mana cost of ").append(card.getConvertedManaCost()).toString();
FilterCard filter = new FilterCard(targetName); FilterCard filter = new FilterCard(targetName);
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, card.getManaCost().convertedManaCost())); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, card.getConvertedManaCost()));
return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true).apply(game, source); return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true).apply(game, source);
} }
} }

View file

@ -91,7 +91,7 @@ class InterpretTheSignsEffect extends OneShotEffect {
Card card = controller.getLibrary().getFromTop(game); Card card = controller.getLibrary().getFromTop(game);
if (card != null) { if (card != null) {
controller.revealCards(sourceCard.getName(), new CardsImpl(card), game); controller.revealCards(sourceCard.getName(), new CardsImpl(card), game);
controller.drawCards(card.getManaCost().convertedManaCost(), game); controller.drawCards(card.getConvertedManaCost(), game);
} }
return true; return true;
} }

View file

@ -98,12 +98,12 @@ class RiddleOfLightningEffect extends OneShotEffect {
controller.revealCards(sourceCard.getName(), new CardsImpl(card), game); controller.revealCards(sourceCard.getName(), new CardsImpl(card), game);
Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (targetCreature != null) { if (targetCreature != null) {
targetCreature.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); targetCreature.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
return true; return true;
} }
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source)); Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (targetPlayer != null) { if (targetPlayer != null) {
targetPlayer.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); targetPlayer.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
return true; return true;
} }
} }

View file

@ -105,7 +105,7 @@ class StormchaserChimeraEffect extends OneShotEffect {
player.revealCards(sourcePermanent.getName(), cards, game); player.revealCards(sourcePermanent.getName(), cards, game);
if (card != null) { if (card != null) {
game.addEffect(new BoostSourceEffect(card.getManaCost().convertedManaCost(), 0, Duration.EndOfTurn), source); game.addEffect(new BoostSourceEffect(card.getConvertedManaCost(), 0, Duration.EndOfTurn), source);
return true; return true;
} }
} }

View file

@ -102,7 +102,7 @@ class EnergyTapEffect extends OneShotEffect {
if (targetCreature != null) { if (targetCreature != null) {
applied = targetCreature.tap(game); applied = targetCreature.tap(game);
if (applied) { if (applied) {
player.getManaPool().addMana(new Mana(0, 0, 0, 0, 0, 0, 0, targetCreature.getManaCost().convertedManaCost()), game, source); player.getManaPool().addMana(new Mana(0, 0, 0, 0, 0, 0, 0, targetCreature.getConvertedManaCost()), game, source);
} }
} }
return applied; return applied;

View file

@ -97,7 +97,7 @@ class InTheEyeOfChaosEffect extends OneShotEffect {
if (spell != null) { if (spell != null) {
Player player = game.getPlayer(spell.getControllerId()); Player player = game.getPlayer(spell.getControllerId());
if (player != null) { if (player != null) {
GenericManaCost cost = new GenericManaCost(spell.getManaCost().convertedManaCost()); GenericManaCost cost = new GenericManaCost(spell.getConvertedManaCost());
if (!cost.pay(source, game, source.getSourceId(), player.getId(), false)) { if (!cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
game.getStack().counter(spell.getId(), source.getSourceId(), game); game.getStack().counter(spell.getId(), source.getSourceId(), game);
} }

View file

@ -108,8 +108,8 @@ class FavorOfTheMightyEffect extends ContinuousEffectImpl {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
int maxCMC = Integer.MIN_VALUE; int maxCMC = Integer.MIN_VALUE;
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) {
if (permanent != null && permanent.getManaCost().convertedManaCost() > maxCMC) { if (permanent != null && permanent.getConvertedManaCost() > maxCMC) {
maxCMC = permanent.getManaCost().convertedManaCost(); maxCMC = permanent.getConvertedManaCost();
} }
} }
FilterPermanent filterMaxCMC = new FilterCreaturePermanent(); FilterPermanent filterMaxCMC = new FilterCreaturePermanent();

View file

@ -103,7 +103,7 @@ class GaddockTeegReplacementEffect4 extends ContinuousRuleModifyingEffectImpl {
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
Card card = game.getCard(event.getSourceId()); Card card = game.getCard(event.getSourceId());
if (card != null && !card.getCardType().contains(CardType.CREATURE) && card.getManaCost().convertedManaCost() >= 4) { if (card != null && !card.getCardType().contains(CardType.CREATURE) && card.getConvertedManaCost() >= 4) {
return true; return true;
} }
return false; return false;

View file

@ -127,7 +127,7 @@ class SpellstutterSpriteCounterTargetEffect extends OneShotEffect {
*/ */
int numberFaeries = game.getState().getBattlefield().countAll(SpellstutterSprite.filter, source.getControllerId(), game); int numberFaeries = game.getState().getBattlefield().countAll(SpellstutterSprite.filter, source.getControllerId(), game);
StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget());
if (stackObject.getManaCost().convertedManaCost() <= numberFaeries) { if (stackObject.getConvertedManaCost() <= numberFaeries) {
if (game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) { if (game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) {
return true; return true;
} }

View file

@ -85,7 +85,7 @@ class DarkTutelageEffect extends OneShotEffect {
Card card = player.getLibrary().removeFromTop(game); Card card = player.getLibrary().removeFromTop(game);
if (card != null) { if (card != null) {
card.moveToZone(Zone.HAND, source.getSourceId(), game, false); card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
player.loseLife(card.getManaCost().convertedManaCost(), game); player.loseLife(card.getConvertedManaCost(), game);
Cards cards = new CardsImpl(); Cards cards = new CardsImpl();
cards.add(card); cards.add(card);
player.revealCards("Dark Tutelage", cards, game); player.revealCards("Dark Tutelage", cards, game);

View file

@ -84,7 +84,7 @@ public class EliteArcanist extends CardImpl {
if (sourcePermanent != null && sourcePermanent.getImprinted() != null && !sourcePermanent.getImprinted().isEmpty()) { if (sourcePermanent != null && sourcePermanent.getImprinted() != null && !sourcePermanent.getImprinted().isEmpty()) {
Card imprintedInstant = game.getCard(sourcePermanent.getImprinted().get(0)); Card imprintedInstant = game.getCard(sourcePermanent.getImprinted().get(0));
if (imprintedInstant != null) { if (imprintedInstant != null) {
int cmc = imprintedInstant.getManaCost().convertedManaCost(); int cmc = imprintedInstant.getConvertedManaCost();
if (cmc > 0) { if (cmc > 0) {
ability.getManaCostsToPay().clear(); ability.getManaCostsToPay().clear();
ability.getManaCostsToPay().add(new GenericManaCost(cmc)); ability.getManaCostsToPay().add(new GenericManaCost(cmc));

View file

@ -114,10 +114,10 @@ class MasterOfPredicamentsEffect extends OneShotEffect {
boolean guessWrong; boolean guessWrong;
if (attackedPlayer.chooseUse(Outcome.Detriment, "Is the chosen card's converted mana cost greater than 4?", source, game)) { if (attackedPlayer.chooseUse(Outcome.Detriment, "Is the chosen card's converted mana cost greater than 4?", source, game)) {
game.informPlayers(attackedPlayer.getLogName() + " guessed that the chosen card's converted mana cost is greater than 4"); game.informPlayers(attackedPlayer.getLogName() + " guessed that the chosen card's converted mana cost is greater than 4");
guessWrong = cardFromHand.getManaCost().convertedManaCost() <= 4; guessWrong = cardFromHand.getConvertedManaCost() <= 4;
} else { } else {
game.informPlayers(attackedPlayer.getLogName() + " guessed that the chosen card's converted mana cost is not greater than 4"); game.informPlayers(attackedPlayer.getLogName() + " guessed that the chosen card's converted mana cost is not greater than 4");
guessWrong = cardFromHand.getManaCost().convertedManaCost() > 4; guessWrong = cardFromHand.getConvertedManaCost() > 4;
} }
game.informPlayers(attackedPlayer.getLogName() + " guessed " + (guessWrong ? "wrong" : "right")); game.informPlayers(attackedPlayer.getLogName() + " guessed " + (guessWrong ? "wrong" : "right"));
if (guessWrong) { if (guessWrong) {

View file

@ -82,7 +82,7 @@ class DisplacementWaveEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
if (!permanent.getCardType().contains(CardType.LAND) && permanent.getManaCost().convertedManaCost() <= source.getManaCostsToPay().getX()) { if (!permanent.getCardType().contains(CardType.LAND) && permanent.getConvertedManaCost() <= source.getManaCostsToPay().getX()) {
permanent.moveToZone(Zone.HAND, source.getSourceId(), game, true); permanent.moveToZone(Zone.HAND, source.getSourceId(), game, true);
} }
} }

View file

@ -145,7 +145,7 @@ class StarfieldOfNyxEffect extends ContinuousEffectImpl {
case PTChangingEffects_7: case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) { if (sublayer == SubLayer.SetPT_7b) {
int manaCost = permanent.getManaCost().convertedManaCost(); int manaCost = permanent.getConvertedManaCost();
permanent.getPower().setValue(manaCost); permanent.getPower().setValue(manaCost);
permanent.getToughness().setValue(manaCost); permanent.getToughness().setValue(manaCost);
} }

View file

@ -95,7 +95,7 @@ class PowderKegEffect extends OneShotEffect {
int count = p.getCounters().getCount(CounterType.FUSE); int count = p.getCounters().getCount(CounterType.FUSE);
for (Permanent perm: game.getBattlefield().getAllActivePermanents()) { for (Permanent perm: game.getBattlefield().getAllActivePermanents()) {
if (perm.getManaCost().convertedManaCost() == count && ((perm.getCardType().contains(CardType.ARTIFACT)) if (perm.getConvertedManaCost() == count && ((perm.getCardType().contains(CardType.ARTIFACT))
|| (perm.getCardType().contains(CardType.CREATURE)))) { || (perm.getCardType().contains(CardType.CREATURE)))) {
perm.destroy(source.getSourceId(), game, false); perm.destroy(source.getSourceId(), game, false);
} }

View file

@ -88,7 +88,7 @@ class CrumbleEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (permanent != null) { if (permanent != null) {
int cost = permanent.getManaCost().convertedManaCost(); int cost = permanent.getConvertedManaCost();
Player player = game.getPlayer(permanent.getControllerId()); Player player = game.getPlayer(permanent.getControllerId());
if (player != null) { if (player != null) {
player.gainLife(cost, game); player.gainLife(cost, game);

View file

@ -158,7 +158,7 @@ class XenicPoltergeistEffect extends ContinuousEffectImpl {
UUID permanentId = targetPointer.getFirst(game, source); UUID permanentId = targetPointer.getFirst(game, source);
Permanent permanent = game.getPermanentOrLKIBattlefield(permanentId); Permanent permanent = game.getPermanentOrLKIBattlefield(permanentId);
if (permanent != null){ if (permanent != null){
int manaCost = permanent.getManaCost().convertedManaCost(); int manaCost = permanent.getConvertedManaCost();
permanent.getPower().setValue(manaCost); permanent.getPower().setValue(manaCost);
permanent.getToughness().setValue(manaCost); permanent.getToughness().setValue(manaCost);
} }

View file

@ -108,7 +108,7 @@ class FoodChainManaEffect extends ManaEffect {
for (Cost cost: source.getCosts()) { for (Cost cost: source.getCosts()) {
if (cost.isPaid() && cost instanceof ExileTargetCost) { if (cost.isPaid() && cost instanceof ExileTargetCost) {
for (Card card : ((ExileTargetCost) cost).getPermanents()) { for (Card card : ((ExileTargetCost) cost).getPermanents()) {
manaCostExiled += card.getManaCost().convertedManaCost(); manaCostExiled += card.getConvertedManaCost();
} }
} }
} }

View file

@ -65,7 +65,7 @@ class ForcedMarchEffect extends OneShotEffect {
source.getControllerId(), source.getControllerId(),
source.getSourceId(), source.getSourceId(),
game)) { game)) {
if (permanent.getManaCost().convertedManaCost() <= source.getManaCostsToPay().getX()) { if (permanent.getConvertedManaCost() <= source.getManaCostsToPay().getX()) {
permanent.destroy(source.getSourceId(), game, false); permanent.destroy(source.getSourceId(), game, false);
} }
} }

View file

@ -91,7 +91,7 @@ class MonkeyCageEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent creature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); Permanent creature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if(creature != null) { if(creature != null) {
int cmc = creature.getManaCost().convertedManaCost(); int cmc = creature.getConvertedManaCost();
return new CreateTokenEffect(new ApeToken(), cmc).apply(game, source); return new CreateTokenEffect(new ApeToken(), cmc).apply(game, source);
} }
return false; return false;

View file

@ -100,7 +100,7 @@ class GoblinTinkererDamageEffect extends OneShotEffect {
Permanent targetArtifact = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); Permanent targetArtifact = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (controller != null && targetArtifact != null) { if (controller != null && targetArtifact != null) {
Permanent sourceObject = game.getPermanent(source.getSourceId()); Permanent sourceObject = game.getPermanent(source.getSourceId());
int damage = targetArtifact.getManaCost().convertedManaCost(); int damage = targetArtifact.getConvertedManaCost();
if (sourceObject != null && damage > 0) { if (sourceObject != null && damage > 0) {
sourceObject.damage(damage, targetArtifact.getId(), game, false, true); sourceObject.damage(damage, targetArtifact.getId(), game, false, true);
} }

View file

@ -109,7 +109,7 @@ class IlluminationEffect extends OneShotEffect {
} }
if (controller != null) { if (controller != null) {
Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
int cost = spell.getManaCost().convertedManaCost(); int cost = spell.getConvertedManaCost();
Player player = game.getPlayer(spell.getControllerId()); Player player = game.getPlayer(spell.getControllerId());
if (player != null) { if (player != null) {
player.gainLife(cost, game); player.gainLife(cost, game);

View file

@ -107,7 +107,7 @@ class GlissaSunseekerEffect extends OneShotEffect {
int manaPoolTotal = blackMana + whiteMana + blueMana + greenMana + redMana + colorlessMana; int manaPoolTotal = blackMana + whiteMana + blueMana + greenMana + redMana + colorlessMana;
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (controller != null && permanent != null) { if (controller != null && permanent != null) {
if (permanent.getManaCost().convertedManaCost() == manaPoolTotal) { if (permanent.getConvertedManaCost() == manaPoolTotal) {
return permanent.destroy(source.getSourceId(), game, false); return permanent.destroy(source.getSourceId(), game, false);
} }
} }

View file

@ -86,7 +86,7 @@ public class SoulFoundry extends CardImpl {
Card imprinted = game.getCard(sourcePermanent.getImprinted().get(0)); Card imprinted = game.getCard(sourcePermanent.getImprinted().get(0));
if (imprinted != null) { if (imprinted != null) {
ability.getManaCostsToPay().clear(); ability.getManaCostsToPay().clear();
ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getManaCost().convertedManaCost())); ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getConvertedManaCost()));
} }
} }
} }

View file

@ -109,8 +109,8 @@ class StrongholdGambitEffect extends OneShotEffect {
Cards cardsToReveal = new CardsImpl(card); Cards cardsToReveal = new CardsImpl(card);
player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ")", cardsToReveal, game); player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ")", cardsToReveal, game);
if (card.getCardType().contains(CardType.CREATURE) if (card.getCardType().contains(CardType.CREATURE)
&& lowestCMC > card.getManaCost().convertedManaCost()) { && lowestCMC > card.getConvertedManaCost()) {
lowestCMC = card.getManaCost().convertedManaCost(); lowestCMC = card.getConvertedManaCost();
} }
} }
} }
@ -123,7 +123,7 @@ class StrongholdGambitEffect extends OneShotEffect {
Card card = game.getCard(choosenCard.get(playerId)); Card card = game.getCard(choosenCard.get(playerId));
if (card != null) { if (card != null) {
if (card.getCardType().contains(CardType.CREATURE) if (card.getCardType().contains(CardType.CREATURE)
&& lowestCMC == card.getManaCost().convertedManaCost()) { && lowestCMC == card.getConvertedManaCost()) {
creaturesToBattlefield.add(card); creaturesToBattlefield.add(card);
} }
} }

View file

@ -102,7 +102,7 @@ class BirthingPodEffect extends OneShotEffect {
} }
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (sacrificedPermanent != null && controller != null) { if (sacrificedPermanent != null && controller != null) {
int newConvertedCost = sacrificedPermanent.getManaCost().convertedManaCost() + 1; int newConvertedCost = sacrificedPermanent.getConvertedManaCost() + 1;
FilterCard filter = new FilterCard("creature card with converted mana cost " + newConvertedCost); FilterCard filter = new FilterCard("creature card with converted mana cost " + newConvertedCost);
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, newConvertedCost)); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, newConvertedCost));
filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new CardTypePredicate(CardType.CREATURE));

View file

@ -155,7 +155,7 @@ class BludgeonBrawlGainAbilityEffect extends ContinuousEffectImpl {
for (UUID permanentId : permanents) { for (UUID permanentId : permanents) {
Permanent permanent = game.getPermanent(permanentId); Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) { if (permanent != null) {
int convertedManaCost = permanent.getManaCost().convertedManaCost(); int convertedManaCost = permanent.getConvertedManaCost();
permanent.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(convertedManaCost)), game); permanent.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(convertedManaCost)), game);
permanent.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(convertedManaCost, 0)), game); permanent.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(convertedManaCost, 0)), game);
} }

View file

@ -180,7 +180,7 @@ class KozilekDiscardCost extends CostImpl {
} }
Player controller = game.getPlayer(ability.getControllerId()); Player controller = game.getPlayer(ability.getControllerId());
for (Card card : controller.getHand().getCards(game)) { for (Card card : controller.getHand().getCards(game)) {
if (stackCMC.contains(card.getManaCost().convertedManaCost())) { if (stackCMC.contains(card.getConvertedManaCost())) {
return true; return true;
} }
} }

View file

@ -109,7 +109,7 @@ class ErraticMutationEffect extends OneShotEffect {
} }
// the nonland card // the nonland card
if (nonLandCard != null) { if (nonLandCard != null) {
int boostValue = nonLandCard.getManaCost().convertedManaCost(); int boostValue = nonLandCard.getConvertedManaCost();
// unboost target // unboost target
ContinuousEffect effect = new BoostTargetEffect(boostValue, -boostValue, Duration.EndOfTurn); ContinuousEffect effect = new BoostTargetEffect(boostValue, -boostValue, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(this.getTargetPointer().getFirst(game, source))); effect.setTargetPointer(new FixedTarget(this.getTargetPointer().getFirst(game, source)));

View file

@ -106,11 +106,11 @@ class ErraticExplosionEffect extends OneShotEffect {
if (nonLandCard != null) { if (nonLandCard != null) {
Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (targetCreature != null) { if (targetCreature != null) {
targetCreature.damage(nonLandCard.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); targetCreature.damage(nonLandCard.getConvertedManaCost(), source.getSourceId(), game, false, true);
} else { } else {
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source)); Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (targetPlayer != null) { if (targetPlayer != null) {
targetPlayer.damage(nonLandCard.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); targetPlayer.damage(nonLandCard.getConvertedManaCost(), source.getSourceId(), game, false, true);
} }
} }
} }

View file

@ -119,7 +119,7 @@ class DralnusPetEffect extends OneShotEffect {
int cmc = 0; int cmc = 0;
for (Cost cost : spellAbility.getCosts()) { for (Cost cost : spellAbility.getCosts()) {
if (cost instanceof DiscardCardCost && ((DiscardCardCost) cost).getCards().size() > 0) { if (cost instanceof DiscardCardCost && ((DiscardCardCost) cost).getCards().size() > 0) {
cmc = ((DiscardCardCost) cost).getCards().get(0).getManaCost().convertedManaCost(); cmc = ((DiscardCardCost) cost).getCards().get(0).getConvertedManaCost();
} }
if (cmc > 0) { if (cmc > 0) {
return new AddCountersSourceEffect(CounterType.P1P1.createInstance(cmc), true).apply(game, source); return new AddCountersSourceEffect(CounterType.P1P1.createInstance(cmc), true).apply(game, source);

View file

@ -98,7 +98,7 @@ class PlaneswalkersFavorEffect extends OneShotEffect {
Card card = opponent.getHand().getRandom(game); Card card = opponent.getHand().getRandom(game);
if (card != null) { if (card != null) {
revealed.add(card); revealed.add(card);
int boostValue = card.getManaCost().convertedManaCost(); int boostValue = card.getConvertedManaCost();
opponent.revealCards("Planeswalker's Favor", revealed, game); opponent.revealCards("Planeswalker's Favor", revealed, game);
ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn); ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget())); effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget()));

View file

@ -90,7 +90,7 @@ class PlaneswalkersFuryEffect extends OneShotEffect {
if (card != null) { if (card != null) {
revealed.add(card); revealed.add(card);
opponent.revealCards("Planeswalker's Fury", revealed, game); opponent.revealCards("Planeswalker's Fury", revealed, game);
opponent.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); opponent.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
} }
return true; return true;
} }

View file

@ -91,7 +91,7 @@ class PlaneswalkersMirthEffect extends OneShotEffect {
if (card != null) { if (card != null) {
revealed.add(card); revealed.add(card);
opponent.revealCards("Planeswalker's Mirth", revealed, game); opponent.revealCards("Planeswalker's Mirth", revealed, game);
player.gainLife(card.getManaCost().convertedManaCost(), game); player.gainLife(card.getConvertedManaCost(), game);
} }
return true; return true;
} }

View file

@ -98,7 +98,7 @@ class PlaneswalkersScornEffect extends OneShotEffect {
Card card = opponent.getHand().getRandom(game); Card card = opponent.getHand().getRandom(game);
if (card != null) { if (card != null) {
revealed.add(card); revealed.add(card);
int boostValue = -1 * card.getManaCost().convertedManaCost(); int boostValue = -1 * card.getConvertedManaCost();
opponent.revealCards("Planeswalker's Scorn", revealed, game); opponent.revealCards("Planeswalker's Scorn", revealed, game);
ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn); ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget())); effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget()));

View file

@ -82,7 +82,7 @@ class InfernalGenesisEffect extends OneShotEffect {
Card card = player.getLibrary().getFromTop(game); Card card = player.getLibrary().getFromTop(game);
if (card != null) { if (card != null) {
if (player.moveCards(card, Zone.GRAVEYARD, source, game)) { if (player.moveCards(card, Zone.GRAVEYARD, source, game)) {
int cmc = card.getManaCost().convertedManaCost(); int cmc = card.getConvertedManaCost();
MinionToken token = new MinionToken(); MinionToken token = new MinionToken();
token.putOntoBattlefield(cmc, game, source.getSourceId(), player.getId()); token.putOntoBattlefield(cmc, game, source.getSourceId(), player.getId());
} }

View file

@ -87,7 +87,7 @@ class RethinkEffect extends OneShotEffect {
if (spell != null) { if (spell != null) {
Player player = game.getPlayer(spell.getControllerId()); Player player = game.getPlayer(spell.getControllerId());
if (player != null) { if (player != null) {
GenericManaCost cost = new GenericManaCost(spell.getManaCost().convertedManaCost()); GenericManaCost cost = new GenericManaCost(spell.getConvertedManaCost());
if (!cost.pay(source, game, source.getSourceId(), player.getId(), false)) { if (!cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
game.getStack().counter(spell.getId(), source.getSourceId(), game); game.getStack().counter(spell.getId(), source.getSourceId(), game);
} }

View file

@ -96,7 +96,7 @@ class DarkConfidantEffect extends OneShotEffect {
Cards cards = new CardsImpl(card); Cards cards = new CardsImpl(card);
controller.revealCards(sourcePermanent.getIdName(), cards, game); controller.revealCards(sourcePermanent.getIdName(), cards, game);
controller.moveCards(card, Zone.HAND, source, game); controller.moveCards(card, Zone.HAND, source, game);
controller.loseLife(card.getManaCost().convertedManaCost(), game); controller.loseLife(card.getConvertedManaCost(), game);
} }
return true; return true;

View file

@ -95,7 +95,7 @@ class InduceParanoiaEffect extends OneShotEffect {
StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source)); StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source));
if (spell != null) { if (spell != null) {
game.getStack().counter(spell.getId(), source.getSourceId(), game); game.getStack().counter(spell.getId(), source.getSourceId(), game);
int spellCMC = spell.getManaCost().convertedManaCost(); int spellCMC = spell.getConvertedManaCost();
Player player = game.getPlayer(spell.getControllerId()); Player player = game.getPlayer(spell.getControllerId());
if (player != null) { if (player != null) {
player.moveCards(player.getLibrary().getTopCards(game, spellCMC), Zone.GRAVEYARD, source, game); player.moveCards(player.getLibrary().getTopCards(game, spellCMC), Zone.GRAVEYARD, source, game);

View file

@ -108,7 +108,7 @@ class SoulTitheEffect extends OneShotEffect {
if(permanent != null) { if(permanent != null) {
Player player = game.getPlayer(permanent.getControllerId()); Player player = game.getPlayer(permanent.getControllerId());
if(player != null) { if(player != null) {
int cmc = permanent.getManaCost().convertedManaCost(); int cmc = permanent.getConvertedManaCost();
if (player.chooseUse(Outcome.Benefit, "Pay {" + cmc + "} for " + permanent.getName() + "? (otherwise you sacrifice it)", source, game)) { if (player.chooseUse(Outcome.Benefit, "Pay {" + cmc + "} for " + permanent.getName() + "? (otherwise you sacrifice it)", source, game)) {
Cost cost = new GenericManaCost(cmc); Cost cost = new GenericManaCost(cmc);
if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) { if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) {

View file

@ -123,7 +123,7 @@ public class BanefulOmen extends CardImpl {
player.revealCards("Baneful Omen", cards, game); player.revealCards("Baneful Omen", cards, game);
if (card != null) { if (card != null) {
int loseLife = card.getManaCost().convertedManaCost(); int loseLife = card.getConvertedManaCost();
Set<UUID> opponents = game.getOpponents(source.getControllerId()); Set<UUID> opponents = game.getOpponents(source.getControllerId());
for (UUID opponentUuid : opponents) { for (UUID opponentUuid : opponents) {
Player opponent = game.getPlayer(opponentUuid); Player opponent = game.getPlayer(opponentUuid);

View file

@ -104,7 +104,7 @@ class ExplosiveRevelationEffect extends OneShotEffect {
player.revealCards("Explosive Revelation", cards, game); player.revealCards("Explosive Revelation", cards, game);
} }
// the nonland card // the nonland card
int damage = card.getManaCost().convertedManaCost(); int damage = card.getConvertedManaCost();
// assign damage to target // assign damage to target
for (UUID targetId: targetPointer.getTargets(game, source)) { for (UUID targetId: targetPointer.getTargets(game, source)) {
Permanent targetedCreature = game.getPermanent(targetId); Permanent targetedCreature = game.getPermanent(targetId);

View file

@ -93,8 +93,8 @@ class HedronMatrixEffect extends ContinuousEffectImpl {
if (equipment != null && equipment.getAttachedTo() != null) { if (equipment != null && equipment.getAttachedTo() != null) {
Permanent creature = game.getPermanent(equipment.getAttachedTo()); Permanent creature = game.getPermanent(equipment.getAttachedTo());
if (creature != null) { if (creature != null) {
creature.addPower(creature.getManaCost().convertedManaCost()); creature.addPower(creature.getConvertedManaCost());
creature.addToughness(creature.getManaCost().convertedManaCost()); creature.addToughness(creature.getConvertedManaCost());
} }
} }
return true; return true;

View file

@ -110,7 +110,7 @@ class SarkhanTheMadRevealAndDrawEffect extends OneShotEffect {
if (card != null) { if (card != null) {
controller.moveCards(card, Zone.HAND, source, game); controller.moveCards(card, Zone.HAND, source, game);
if (sourcePermanent != null) { if (sourcePermanent != null) {
sourcePermanent.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, false); sourcePermanent.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, false);
} }
controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
} }

View file

@ -114,7 +114,7 @@ class InfernalKirinEffect extends OneShotEffect {
targetPlayer.revealCards("Infernal Kirin", targetPlayer.getHand(), game); targetPlayer.revealCards("Infernal Kirin", targetPlayer.getHand(), game);
for (UUID uuid: targetPlayer.getHand().copy()) { for (UUID uuid: targetPlayer.getHand().copy()) {
Card card = game.getCard(uuid); Card card = game.getCard(uuid);
if (card != null && card.getManaCost().convertedManaCost() == cmc) { if (card != null && card.getConvertedManaCost() == cmc) {
targetPlayer.discard(card, source, game); targetPlayer.discard(card, source, game);
} }
} }

View file

@ -91,7 +91,7 @@ class RendingVinesEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (controller != null) { if (controller != null) {
if (permanent.getManaCost().convertedManaCost() <= controller.getHand().size()) { if (permanent.getConvertedManaCost() <= controller.getHand().size()) {
return permanent.destroy(source.getSourceId(), game, false); return permanent.destroy(source.getSourceId(), game, false);
} }
} }

View file

@ -96,7 +96,7 @@ class UndyingFlamesEffect extends OneShotEffect {
if (card != null) { if (card != null) {
you.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY, true); you.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY, true);
if (!card.getCardType().contains(CardType.LAND)) { if (!card.getCardType().contains(CardType.LAND)) {
int damage = card.getManaCost().convertedManaCost(); int damage = card.getConvertedManaCost();
if (damage > 0) { if (damage > 0) {
Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (creature != null) { if (creature != null) {
@ -107,7 +107,7 @@ class UndyingFlamesEffect extends OneShotEffect {
} }
Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (player != null) { if (player != null) {
player.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); player.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
game.informPlayers(new StringBuilder(sourceCard.getName()).append(" deals ").append(damage).append(" damage to ").append(player.getLogName()).toString()); game.informPlayers(new StringBuilder(sourceCard.getName()).append(" deals ").append(damage).append(" damage to ").append(player.getLogName()).toString());
applied = true; applied = true;
break; break;

View file

@ -93,7 +93,7 @@ class CerebralEruptionEffect extends OneShotEffect {
Cards cards = new CardsImpl(card); Cards cards = new CardsImpl(card);
player.revealCards(sourceObject.getIdName(), cards, game); player.revealCards(sourceObject.getIdName(), cards, game);
game.getState().setValue(source.getSourceId().toString(), card); game.getState().setValue(source.getSourceId().toString(), card);
int damage = card.getManaCost().convertedManaCost(); int damage = card.getConvertedManaCost();
player.damage(damage, source.getSourceId(), game, false, true); player.damage(damage, source.getSourceId(), game, false, true);
for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) { for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {
perm.damage(damage, source.getSourceId(), game, false, true); perm.damage(damage, source.getSourceId(), game, false, true);

View file

@ -124,7 +124,7 @@ class GethLordOfTheVaultEffect extends OneShotEffect {
controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null);
Player player = game.getPlayer(card.getOwnerId()); Player player = game.getPlayer(card.getOwnerId());
if (player != null) { if (player != null) {
player.moveCards(player.getLibrary().getTopCards(game, card.getManaCost().convertedManaCost()), Zone.GRAVEYARD, source, game); player.moveCards(player.getLibrary().getTopCards(game, card.getConvertedManaCost()), Zone.GRAVEYARD, source, game);
} }
} }
return true; return true;

View file

@ -108,7 +108,7 @@ class HoardSmelterEffect extends ContinuousEffectImpl {
public void init(Ability source, Game game) { public void init(Ability source, Game game) {
Card targeted = game.getCard(source.getFirstTarget()); Card targeted = game.getCard(source.getFirstTarget());
if (targeted != null) { if (targeted != null) {
costValue = targeted.getManaCost().convertedManaCost(); costValue = targeted.getConvertedManaCost();
} }
} }

View file

@ -82,7 +82,7 @@ public class PrototypePortal extends CardImpl {
if (card.getImprinted().size() > 0) { if (card.getImprinted().size() > 0) {
Card imprinted = game.getCard(card.getImprinted().get(0)); Card imprinted = game.getCard(card.getImprinted().get(0));
if (imprinted != null) { if (imprinted != null) {
ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getManaCost().convertedManaCost())); ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getConvertedManaCost()));
} }
} }
} }

View file

@ -96,7 +96,7 @@ public class RatchetBomb extends CardImpl {
int count = p.getCounters().getCount(CounterType.CHARGE); int count = p.getCounters().getCount(CounterType.CHARGE);
for (Permanent perm: game.getBattlefield().getAllActivePermanents()) { for (Permanent perm: game.getBattlefield().getAllActivePermanents()) {
if (perm.getManaCost().convertedManaCost() == count && !(perm.getCardType().contains(CardType.LAND))) { if (perm.getConvertedManaCost() == count && !(perm.getCardType().contains(CardType.LAND))) {
perm.destroy(source.getSourceId(), game, false); perm.destroy(source.getSourceId(), game, false);
} }
} }

View file

@ -106,7 +106,7 @@ public class RazorHippogriff extends CardImpl {
card = (Card)game.getLastKnownInformation(source.getFirstTarget(), Zone.GRAVEYARD); card = (Card)game.getLastKnownInformation(source.getFirstTarget(), Zone.GRAVEYARD);
} }
if (card != null) { if (card != null) {
player.gainLife(card.getManaCost().convertedManaCost(), game); player.gainLife(card.getConvertedManaCost(), game);
} }
} }
return true; return true;

View file

@ -99,7 +99,7 @@ class SteelHellkiteDestroyEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
int xValue = source.getManaCostsToPay().getX(); int xValue = source.getManaCostsToPay().getX();
for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterNonlandPermanent(), source.getControllerId(), source.getSourceId(), game)) { for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterNonlandPermanent(), source.getControllerId(), source.getSourceId(), game)) {
if (permanent.getManaCost().convertedManaCost() == xValue) { if (permanent.getConvertedManaCost() == xValue) {
PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get("PlayerDamagedBySource", permanent.getControllerId()); PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get("PlayerDamagedBySource", permanent.getControllerId());
if (watcher != null && watcher.hasSourceDoneDamage(source.getSourceId(), game)) { if (watcher != null && watcher.hasSourceDoneDamage(source.getSourceId(), game)) {
permanent.destroy(source.getSourceId(), game, false); permanent.destroy(source.getSourceId(), game, false);

View file

@ -81,7 +81,7 @@ class AncientOozePowerToughnessValue implements DynamicValue {
int value = 0; int value = 0;
for(Permanent creature : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), sourceAbility.getControllerId(), game)){ for(Permanent creature : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), sourceAbility.getControllerId(), game)){
if(creature != null && !sourceAbility.getSourceId().equals(creature.getId())){ if(creature != null && !sourceAbility.getSourceId().equals(creature.getId())){
value += creature.getManaCost().convertedManaCost(); value += creature.getConvertedManaCost();
} }
} }
return value; return value;

View file

@ -102,7 +102,7 @@ class AuguryAdeptEffect extends OneShotEffect {
if (card != null) { if (card != null) {
card.moveToZone(Zone.HAND, source.getSourceId(), game, true); card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
int cmc = card.getManaCost().convertedManaCost(); int cmc = card.getConvertedManaCost();
if (cmc > 0) { if (cmc > 0) {
controller.gainLife(cmc, game); controller.gainLife(cmc, game);
} }

View file

@ -75,7 +75,7 @@ class BeseechTheQueenPredicate implements Predicate<Card> {
@Override @Override
public final boolean apply(Card input, Game game) { public final boolean apply(Card input, Game game) {
if(input.getManaCost().convertedManaCost() <= game.getBattlefield().getAllActivePermanents(new FilterControlledLandPermanent(), input.getOwnerId(), game).size()){ if(input.getConvertedManaCost() <= game.getBattlefield().getAllActivePermanents(new FilterControlledLandPermanent(), input.getOwnerId(), game).size()){
return true; return true;
} }
return false; return false;

View file

@ -135,7 +135,7 @@ class PucasMischiefSecondTarget extends TargetPermanent {
Permanent target1 = game.getPermanent(source.getFirstTarget()); Permanent target1 = game.getPermanent(source.getFirstTarget());
Permanent opponentPermanent = game.getPermanent(id); Permanent opponentPermanent = game.getPermanent(id);
if (target1 != null && opponentPermanent != null) { if (target1 != null && opponentPermanent != null) {
return target1.getManaCost().convertedManaCost() >= opponentPermanent.getManaCost().convertedManaCost(); return target1.getConvertedManaCost() >= opponentPermanent.getConvertedManaCost();
} }
} }
return false; return false;
@ -148,7 +148,7 @@ class PucasMischiefSecondTarget extends TargetPermanent {
MageObject targetSource = game.getObject(sourceId); MageObject targetSource = game.getObject(sourceId);
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) {
if (!targets.containsKey(permanent.getId()) && permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { if (!targets.containsKey(permanent.getId()) && permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) {
if (firstTarget.getManaCost().convertedManaCost() >= permanent.getManaCost().convertedManaCost()) { if (firstTarget.getConvertedManaCost() >= permanent.getConvertedManaCost()) {
possibleTargets.add(permanent.getId()); possibleTargets.add(permanent.getId());
} }
} }

View file

@ -114,14 +114,14 @@ class SeasonsPastTarget extends TargetCardInYourGraveyard {
for (UUID targetId : this.getTargets()) { for (UUID targetId : this.getTargets()) {
Card card = game.getCard(targetId); Card card = game.getCard(targetId);
if (card != null) { if (card != null) {
usedCMC.add(card.getManaCost().convertedManaCost()); usedCMC.add(card.getConvertedManaCost());
} }
} }
Set<UUID> possibleTargets = super.possibleTargets(sourceId, sourceControllerId, game); Set<UUID> possibleTargets = super.possibleTargets(sourceId, sourceControllerId, game);
Set<UUID> leftPossibleTargets = new HashSet<>(); Set<UUID> leftPossibleTargets = new HashSet<>();
for (UUID targetId : possibleTargets) { for (UUID targetId : possibleTargets) {
Card card = game.getCard(targetId); Card card = game.getCard(targetId);
if (card != null && !usedCMC.contains(card.getManaCost().convertedManaCost())) { if (card != null && !usedCMC.contains(card.getConvertedManaCost())) {
leftPossibleTargets.add(targetId); leftPossibleTargets.add(targetId);
} }
} }
@ -135,11 +135,11 @@ class SeasonsPastTarget extends TargetCardInYourGraveyard {
for (UUID targetId : this.getTargets()) { for (UUID targetId : this.getTargets()) {
Card card = game.getCard(targetId); Card card = game.getCard(targetId);
if (card != null) { if (card != null) {
usedCMC.add(card.getManaCost().convertedManaCost()); usedCMC.add(card.getConvertedManaCost());
} }
} }
Card card = game.getCard(objectId); Card card = game.getCard(objectId);
return card != null && !usedCMC.contains(card.getManaCost().convertedManaCost()); return card != null && !usedCMC.contains(card.getConvertedManaCost());
} }
return false; return false;
} }

View file

@ -113,7 +113,7 @@ class SinProdderEffect extends OneShotEffect {
Player opponent = game.getPlayer(opponentUuid); Player opponent = game.getPlayer(opponentUuid);
if (opponent != null && !putInGraveyard && opponent.chooseUse(Outcome.Damage, sb.toString(), source, game)) { if (opponent != null && !putInGraveyard && opponent.chooseUse(Outcome.Damage, sb.toString(), source, game)) {
putInGraveyard = true; putInGraveyard = true;
opponent.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); opponent.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
} }
} }
if (putInGraveyard) { if (putInGraveyard) {

View file

@ -123,10 +123,10 @@ class SorinGrimNemesisRevealEffect extends OneShotEffect {
if (card != null && if (card != null &&
card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) { card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) {
for (UUID playerId : game.getOpponents(source.getControllerId())) { for (UUID playerId : game.getOpponents(source.getControllerId())) {
if (card.getManaCost().convertedManaCost() > 0) { if (card.getConvertedManaCost() > 0) {
Player opponent = game.getPlayer(playerId); Player opponent = game.getPlayer(playerId);
if (opponent != null) { if (opponent != null) {
opponent.loseLife(card.getManaCost().convertedManaCost(), game); opponent.loseLife(card.getConvertedManaCost(), game);
} }
} }
} }

View file

@ -98,7 +98,7 @@ class WolfOfDevilsBreachDiscardCostCardConvertedMana implements DynamicValue {
DiscardCardCost discardCost = (DiscardCardCost) cost; DiscardCardCost discardCost = (DiscardCardCost) cost;
int cmc = 0; int cmc = 0;
for (Card card : discardCost.getCards()) { for (Card card : discardCost.getCards()) {
cmc += card.getManaCost().convertedManaCost(); cmc += card.getConvertedManaCost();
} }
return cmc; return cmc;
} }

Some files were not shown because too many files have changed in this diff Show more