mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
* Fixed CMC calculation for transformed cards (fixes #1826).
This commit is contained in:
parent
1deb4192ba
commit
2b8f73dbcc
132 changed files with 227 additions and 179 deletions
|
|
@ -101,7 +101,7 @@ class SingeMindOgreEffect extends OneShotEffect {
|
|||
Card card = targetPlayer.getHand().getRandom(game);
|
||||
revealed.add(card);
|
||||
targetPlayer.revealCards("Singe-Mind Ogre", revealed, game);
|
||||
targetPlayer.loseLife(card.getManaCost().convertedManaCost(), game);
|
||||
targetPlayer.loseLife(card.getConvertedManaCost(), game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class SpellboundDragonEffect extends OneShotEffect {
|
|||
you.choose(Outcome.Discard, target, source.getSourceId(), game);
|
||||
Card card = you.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null && you.discard(card, source, game)) {
|
||||
int cmc = card.getManaCost().convertedManaCost();
|
||||
int cmc = card.getConvertedManaCost();
|
||||
if (dragon != null) {
|
||||
game.addEffect(new BoostSourceEffect(cmc, 0, Duration.EndOfTurn), source);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class VengefulRebirthEffect extends OneShotEffect {
|
|||
if (controller != null && card != null && controller.removeFromGraveyard(card, game)) {
|
||||
controller.moveCards(card, Zone.GRAVEYARD, Zone.HAND, source, game);
|
||||
if (!card.getCardType().contains(CardType.LAND)) {
|
||||
int damage = card.getManaCost().convertedManaCost();
|
||||
int damage = card.getConvertedManaCost();
|
||||
Permanent permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.damage(damage, source.getSourceId(), game, false, true);
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class PhyrexianDevourerEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
if (card != null) {
|
||||
int amount = card.getManaCost().convertedManaCost();
|
||||
int amount = card.getConvertedManaCost();
|
||||
if (amount > 0) {
|
||||
return new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount)).apply(game, source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class TransmuteArtifactEffect extends SearchEffect {
|
|||
if (controller.chooseTarget(Outcome.Sacrifice, targetArtifact, source, game)) {
|
||||
Permanent permanent = game.getPermanent(targetArtifact.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
convertedManaCost = permanent.getManaCost().convertedManaCost();
|
||||
convertedManaCost = permanent.getConvertedManaCost();
|
||||
sacrifice = permanent.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -111,11 +111,11 @@ class TransmuteArtifactEffect extends SearchEffect {
|
|||
Card card = controller.getLibrary().getCard(cardId, game);
|
||||
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 (card.getManaCost().convertedManaCost() <= convertedManaCost) {
|
||||
if (card.getConvertedManaCost() <= convertedManaCost) {
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
} else {
|
||||
//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)) {
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class DeathEffect extends OneShotEffect {
|
|||
if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) {
|
||||
controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
controller.loseLife(creatureCard.getManaCost().convertedManaCost(), game);
|
||||
controller.loseLife(creatureCard.getConvertedManaCost(), game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class OrimsThunderEffect2 extends OneShotEffect {
|
|||
MageObject firstTarget = game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
|
||||
Permanent secondTarget = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (firstTarget != null) {
|
||||
damage = firstTarget.getManaCost().convertedManaCost();
|
||||
damage = firstTarget.getConvertedManaCost();
|
||||
}
|
||||
boolean kicked = KickedCondition.getInstance().apply(game, source);
|
||||
if (kicked && secondTarget != null) {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class MetamorphosisEffect extends OneShotEffect {
|
|||
int amount = 0;
|
||||
for (Cost cost: source.getCosts()) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ class MarchFromTheTombTarget extends TargetCardInYourGraveyard {
|
|||
for (UUID targetId : this.getTargets()) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
cmcLeft -= card.getManaCost().convertedManaCost();
|
||||
cmcLeft -= card.getConvertedManaCost();
|
||||
}
|
||||
}
|
||||
Set<UUID> possibleTargets = super.possibleTargets(sourceId, sourceControllerId, game);
|
||||
Set<UUID> leftPossibleTargets = new HashSet<>();
|
||||
for (UUID targetId : possibleTargets) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null && card.getManaCost().convertedManaCost() <= cmcLeft) {
|
||||
if (card != null && card.getConvertedManaCost() <= cmcLeft) {
|
||||
leftPossibleTargets.add(targetId);
|
||||
}
|
||||
}
|
||||
|
|
@ -110,11 +110,11 @@ class MarchFromTheTombTarget extends TargetCardInYourGraveyard {
|
|||
for (UUID targetId : this.getTargets()) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
cmcLeft -= card.getManaCost().convertedManaCost();
|
||||
cmcLeft -= card.getConvertedManaCost();
|
||||
}
|
||||
}
|
||||
Card card = game.getCard(objectId);
|
||||
return card != null && card.getManaCost().convertedManaCost() <= cmcLeft;
|
||||
return card != null && card.getConvertedManaCost() <= cmcLeft;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class VoidWinnowerCantBlockEffect extends RestrictionEffect {
|
|||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) {
|
||||
// the low bit will always be set on an odd number.
|
||||
return (permanent.getManaCost().convertedManaCost() & 1) == 0;
|
||||
return (permanent.getConvertedManaCost() & 1) == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,13 +112,13 @@ class DisruptingShoalCounterTargetEffect extends OneShotEffect {
|
|||
if (cost.isPaid() && cost instanceof ExileFromHandCost) {
|
||||
for (Card card : ((ExileFromHandCost) cost).getCards()) {
|
||||
if (card instanceof SplitCard) {
|
||||
if (((SplitCard) card).getLeftHalfCard().getManaCost().convertedManaCost() == amount) {
|
||||
if (((SplitCard) card).getLeftHalfCard().getConvertedManaCost() == amount) {
|
||||
return true;
|
||||
}
|
||||
if (((SplitCard) card).getRightHalfCard().getManaCost().convertedManaCost() == amount) {
|
||||
if (((SplitCard) card).getRightHalfCard().getConvertedManaCost() == amount) {
|
||||
return true;
|
||||
}
|
||||
} else if (card.getManaCost().convertedManaCost() == amount) {
|
||||
} else if (card.getConvertedManaCost() == amount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public class HeedTheMists extends CardImpl {
|
|||
if (controller != null) {
|
||||
Card card = controller.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
int cmc = card.getManaCost().convertedManaCost();
|
||||
int cmc = card.getConvertedManaCost();
|
||||
controller.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
controller.drawCards(cmc, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public class SlumberingTora extends CardImpl {
|
|||
int convManaCosts = 0;
|
||||
for (Cost cost: source.getCosts()) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public class TerashisGrasp extends CardImpl {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent targetPermanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
if (targetPermanent != null) {
|
||||
int cost = targetPermanent.getManaCost().convertedManaCost();
|
||||
int cost = targetPermanent.getConvertedManaCost();
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
player.gainLife(cost, game);
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class PainSeerEffect extends OneShotEffect {
|
|||
|
||||
if (card != null &&
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) {
|
||||
player.loseLife(card.getManaCost().convertedManaCost(), game);
|
||||
player.loseLife(card.getConvertedManaCost(), game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class NayaSoulbeastCastEffect extends OneShotEffect {
|
|||
if (player != null) {
|
||||
if (player.getLibrary().size() > 0) {
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
cmc += card.getManaCost().convertedManaCost();
|
||||
cmc += card.getConvertedManaCost();
|
||||
player.revealCards(sourceObject.getName() + " " + player.getName() + ")", new CardsImpl(card), game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class SydriGalvanicGeniusEffect extends ContinuousEffectImpl {
|
|||
|
||||
case PTChangingEffects_7:
|
||||
if (sublayer == SubLayer.SetPT_7b) {
|
||||
int cmc = artifact.getManaCost().convertedManaCost();
|
||||
int cmc = artifact.getConvertedManaCost();
|
||||
artifact.getPower().setValue(cmc);
|
||||
artifact.getToughness().setValue(cmc);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class MerenOfClanNelTothEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
Zone targetZone = Zone.HAND;
|
||||
String text = " put into hand of ";
|
||||
if (card.getManaCost().convertedManaCost() <= amount) {
|
||||
if (card.getConvertedManaCost() <= amount) {
|
||||
targetZone = Zone.BATTLEFIELD;
|
||||
text = " put onto battlefield for ";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class PunishmentEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
||||
if (permanent != null
|
||||
&& permanent.getManaCost().convertedManaCost() == source.getManaCostsToPay().getX()
|
||||
&& permanent.getConvertedManaCost() == source.getManaCostsToPay().getX()
|
||||
&& (permanent.getCardType().contains(CardType.ARTIFACT)
|
||||
|| permanent.getCardType().contains(CardType.CREATURE)
|
||||
|| permanent.getCardType().contains(CardType.ENCHANTMENT))) {
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class HellholeRatsEffect extends OneShotEffect {
|
|||
Cards cards = targetPlayer.discard(1, false, source, game);
|
||||
if (!cards.isEmpty()) {
|
||||
for (Card card : cards.getCards(game)) {
|
||||
damage = card.getManaCost().convertedManaCost();
|
||||
damage = card.getConvertedManaCost();
|
||||
}
|
||||
targetPlayer.damage(damage, source.getSourceId(), game, false, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class SeekEffect extends OneShotEffect {
|
|||
Card card = opponent.getLibrary().remove(targetId, game);
|
||||
if (card != null) {
|
||||
player.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY, true);
|
||||
int cmc = card.getManaCost().convertedManaCost();
|
||||
int cmc = card.getConvertedManaCost();
|
||||
if (cmc > 0) {
|
||||
player.gainLife(cmc, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class HitEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
int damage = permanent.getManaCost().convertedManaCost();
|
||||
int damage = permanent.getConvertedManaCost();
|
||||
if (damage > 0) {
|
||||
targetPlayer.damage(damage, source.getSourceId(), game, false, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class ProteanHulkEffect extends OneShotEffect {
|
|||
if (librarySearchLimit == 0) {
|
||||
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.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, manaCostLeftToFetch + 1));
|
||||
target = new TargetCardInLibrary(0, 1, filter);
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class BlastOfGeniusEffect extends OneShotEffect {
|
|||
Card card = player.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
player.discard(card, source, game);
|
||||
int damage = card.getManaCost().convertedManaCost();
|
||||
int damage = card.getConvertedManaCost();
|
||||
Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||
if (creature != null) {
|
||||
creature.damage(damage, source.getSourceId(), game, false, true);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class GazeOfGraniteEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class LivingLoreSetPowerToughnessSourceEffect extends ContinuousEffectImpl {
|
|||
break;
|
||||
}
|
||||
if (exiledCard != null) {
|
||||
int value = exiledCard.getManaCost().convertedManaCost();
|
||||
int value = exiledCard.getConvertedManaCost();
|
||||
permanent.getPower().setValue(value);
|
||||
permanent.getToughness().setValue(value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class VolcanicVisionReturnToHandTargetEffect extends OneShotEffect {
|
|||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
controller.moveCards(card, null, Zone.HAND, source, game);
|
||||
int damage = card.getManaCost().convertedManaCost();
|
||||
int damage = card.getConvertedManaCost();
|
||||
if (damage > 0) {
|
||||
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
creature.damage(damage, source.getSourceId(), game, false, true);
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class FriendlyFireEffect extends OneShotEffect {
|
|||
Card card = controllerOfTargetCreature.getHand().getRandom(game);
|
||||
cards.add(card);
|
||||
controllerOfTargetCreature.revealCards(sourceObject.getName(), cards, game);
|
||||
int damage = card.getManaCost().convertedManaCost();
|
||||
int damage = card.getConvertedManaCost();
|
||||
targetCreature.damage(damage, source.getSourceId(), game, false, true);
|
||||
controllerOfTargetCreature.damage(damage, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class EngineeredExplosivesEffect extends OneShotEffect {
|
|||
if(engineeredExplosives != null && engineeredExplosives instanceof Permanent){
|
||||
int count = ((Permanent)engineeredExplosives).getCounters().getCount(CounterType.CHARGE);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,13 +180,13 @@ class JuxtaposeEffect extends ContinuousEffectImpl {
|
|||
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(filter, playerId, game);
|
||||
int highestCMC = -1;
|
||||
for (Permanent permanent : permanents) {
|
||||
if (highestCMC < permanent.getManaCost().convertedManaCost()) {
|
||||
highestCMC = permanent.getManaCost().convertedManaCost();
|
||||
if (highestCMC < permanent.getConvertedManaCost()) {
|
||||
highestCMC = permanent.getConvertedManaCost();
|
||||
}
|
||||
}
|
||||
List<Permanent> result = new ArrayList<>();
|
||||
for (Permanent permanent : permanents) {
|
||||
if (permanent.getManaCost().convertedManaCost() == highestCMC) {
|
||||
if (permanent.getConvertedManaCost() == highestCMC) {
|
||||
result.add(permanent);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class TitaniasSongEffect extends ContinuousEffectImpl {
|
|||
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) {
|
||||
Permanent permanent = it.next().getPermanent(game);
|
||||
if (permanent != null){
|
||||
int manaCost = permanent.getManaCost().convertedManaCost();
|
||||
int manaCost = permanent.getConvertedManaCost();
|
||||
permanent.getPower().setValue(manaCost);
|
||||
permanent.getToughness().setValue(manaCost);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class JudgeUnworthyEffect extends OneShotEffect {
|
|||
controller.revealCards(sourceCard.getName(), new CardsImpl(card), game);
|
||||
Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||
if (targetCreature != null) {
|
||||
targetCreature.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
|
||||
targetCreature.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class DuskmantleSeerEffect extends OneShotEffect {
|
|||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class ImmortalServitudeEffect extends OneShotEffect {
|
|||
int count = source.getManaCostsToPay().getX();
|
||||
Set<Card> cards = you.getGraveyard().getCards(new FilterCreatureCard(), game);
|
||||
for (Card card : cards) {
|
||||
if (card.getManaCost().convertedManaCost() == count
|
||||
if (card.getConvertedManaCost() == count
|
||||
&& card != null) {
|
||||
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class HereticsPunishmentEffect extends OneShotEffect {
|
|||
int maxCost = 0;
|
||||
Set<Card> cardList = controller.getLibrary().getTopCards(game, 3);
|
||||
for (Card card : cardList) {
|
||||
int test = card.getManaCost().convertedManaCost();
|
||||
int test = card.getConvertedManaCost();
|
||||
if (test > maxCost) {
|
||||
maxCost = test;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class MindshriekerEffect extends OneShotEffect {
|
|||
Card card = targetPlayer.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
targetPlayer.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
int amount = card.getManaCost().convertedManaCost();
|
||||
int amount = card.getConvertedManaCost();
|
||||
if (amount > 0) {
|
||||
game.addEffect(new BoostSourceEffect(amount, amount, Duration.EndOfTurn), source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class PhyrexianDelverEffect extends OneShotEffect {
|
|||
if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) {
|
||||
result = controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game);;
|
||||
}
|
||||
controller.loseLife(creatureCard.getManaCost().convertedManaCost(), game);
|
||||
controller.loseLife(creatureCard.getConvertedManaCost(), game);
|
||||
return result;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class VoidEffect extends OneShotEffect {
|
|||
int number = Integer.parseInt(source.getChoices().get(0).getChoice());
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
||||
if ((permanent.getCardType().contains(CardType.ARTIFACT) || permanent.getCardType().contains(CardType.CREATURE))
|
||||
&& permanent.getManaCost().convertedManaCost() == number) {
|
||||
&& permanent.getConvertedManaCost() == number) {
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,9 +110,9 @@ class DiscipleOfDeceitEffect extends OneShotEffect {
|
|||
if (card == null) {
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class InterpretTheSignsEffect extends OneShotEffect {
|
|||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
controller.revealCards(sourceCard.getName(), new CardsImpl(card), game);
|
||||
controller.drawCards(card.getManaCost().convertedManaCost(), game);
|
||||
controller.drawCards(card.getConvertedManaCost(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,12 +98,12 @@ class RiddleOfLightningEffect extends OneShotEffect {
|
|||
controller.revealCards(sourceCard.getName(), new CardsImpl(card), game);
|
||||
Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||
if (targetCreature != null) {
|
||||
targetCreature.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
|
||||
targetCreature.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (targetPlayer != null) {
|
||||
targetPlayer.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
|
||||
targetPlayer.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class StormchaserChimeraEffect extends OneShotEffect {
|
|||
player.revealCards(sourcePermanent.getName(), cards, game);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class EnergyTapEffect extends OneShotEffect {
|
|||
if (targetCreature != null) {
|
||||
applied = targetCreature.tap(game);
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class InTheEyeOfChaosEffect extends OneShotEffect {
|
|||
if (spell != null) {
|
||||
Player player = game.getPlayer(spell.getControllerId());
|
||||
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)) {
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,8 +108,8 @@ class FavorOfTheMightyEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
int maxCMC = Integer.MIN_VALUE;
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) {
|
||||
if (permanent != null && permanent.getManaCost().convertedManaCost() > maxCMC) {
|
||||
maxCMC = permanent.getManaCost().convertedManaCost();
|
||||
if (permanent != null && permanent.getConvertedManaCost() > maxCMC) {
|
||||
maxCMC = permanent.getConvertedManaCost();
|
||||
}
|
||||
}
|
||||
FilterPermanent filterMaxCMC = new FilterCreaturePermanent();
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class GaddockTeegReplacementEffect4 extends ContinuousRuleModifyingEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
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 false;
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class SpellstutterSpriteCounterTargetEffect extends OneShotEffect {
|
|||
*/
|
||||
int numberFaeries = game.getState().getBattlefield().countAll(SpellstutterSprite.filter, source.getControllerId(), game);
|
||||
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)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class DarkTutelageEffect extends OneShotEffect {
|
|||
Card card = player.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
player.loseLife(card.getManaCost().convertedManaCost(), game);
|
||||
player.loseLife(card.getConvertedManaCost(), game);
|
||||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
player.revealCards("Dark Tutelage", cards, game);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ public class EliteArcanist extends CardImpl {
|
|||
if (sourcePermanent != null && sourcePermanent.getImprinted() != null && !sourcePermanent.getImprinted().isEmpty()) {
|
||||
Card imprintedInstant = game.getCard(sourcePermanent.getImprinted().get(0));
|
||||
if (imprintedInstant != null) {
|
||||
int cmc = imprintedInstant.getManaCost().convertedManaCost();
|
||||
int cmc = imprintedInstant.getConvertedManaCost();
|
||||
if (cmc > 0) {
|
||||
ability.getManaCostsToPay().clear();
|
||||
ability.getManaCostsToPay().add(new GenericManaCost(cmc));
|
||||
|
|
|
|||
|
|
@ -114,10 +114,10 @@ class MasterOfPredicamentsEffect extends OneShotEffect {
|
|||
boolean guessWrong;
|
||||
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");
|
||||
guessWrong = cardFromHand.getManaCost().convertedManaCost() <= 4;
|
||||
guessWrong = cardFromHand.getConvertedManaCost() <= 4;
|
||||
} else {
|
||||
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"));
|
||||
if (guessWrong) {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class DisplacementWaveEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class StarfieldOfNyxEffect extends ContinuousEffectImpl {
|
|||
|
||||
case PTChangingEffects_7:
|
||||
if (sublayer == SubLayer.SetPT_7b) {
|
||||
int manaCost = permanent.getManaCost().convertedManaCost();
|
||||
int manaCost = permanent.getConvertedManaCost();
|
||||
permanent.getPower().setValue(manaCost);
|
||||
permanent.getToughness().setValue(manaCost);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class PowderKegEffect extends OneShotEffect {
|
|||
|
||||
int count = p.getCounters().getCount(CounterType.FUSE);
|
||||
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.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class CrumbleEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
int cost = permanent.getManaCost().convertedManaCost();
|
||||
int cost = permanent.getConvertedManaCost();
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player != null) {
|
||||
player.gainLife(cost, game);
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class XenicPoltergeistEffect extends ContinuousEffectImpl {
|
|||
UUID permanentId = targetPointer.getFirst(game, source);
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(permanentId);
|
||||
if (permanent != null){
|
||||
int manaCost = permanent.getManaCost().convertedManaCost();
|
||||
int manaCost = permanent.getConvertedManaCost();
|
||||
permanent.getPower().setValue(manaCost);
|
||||
permanent.getToughness().setValue(manaCost);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class FoodChainManaEffect extends ManaEffect {
|
|||
for (Cost cost: source.getCosts()) {
|
||||
if (cost.isPaid() && cost instanceof ExileTargetCost) {
|
||||
for (Card card : ((ExileTargetCost) cost).getPermanents()) {
|
||||
manaCostExiled += card.getManaCost().convertedManaCost();
|
||||
manaCostExiled += card.getConvertedManaCost();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class ForcedMarchEffect extends OneShotEffect {
|
|||
source.getControllerId(),
|
||||
source.getSourceId(),
|
||||
game)) {
|
||||
if (permanent.getManaCost().convertedManaCost() <= source.getManaCostsToPay().getX()) {
|
||||
if (permanent.getConvertedManaCost() <= source.getManaCostsToPay().getX()) {
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class MonkeyCageEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
if(creature != null) {
|
||||
int cmc = creature.getManaCost().convertedManaCost();
|
||||
int cmc = creature.getConvertedManaCost();
|
||||
return new CreateTokenEffect(new ApeToken(), cmc).apply(game, source);
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class GoblinTinkererDamageEffect extends OneShotEffect {
|
|||
Permanent targetArtifact = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
if (controller != null && targetArtifact != null) {
|
||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
||||
int damage = targetArtifact.getManaCost().convertedManaCost();
|
||||
int damage = targetArtifact.getConvertedManaCost();
|
||||
if (sourceObject != null && damage > 0) {
|
||||
sourceObject.damage(damage, targetArtifact.getId(), game, false, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class IlluminationEffect extends OneShotEffect {
|
|||
}
|
||||
if (controller != null) {
|
||||
Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
|
||||
int cost = spell.getManaCost().convertedManaCost();
|
||||
int cost = spell.getConvertedManaCost();
|
||||
Player player = game.getPlayer(spell.getControllerId());
|
||||
if (player != null) {
|
||||
player.gainLife(cost, game);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class GlissaSunseekerEffect extends OneShotEffect {
|
|||
int manaPoolTotal = blackMana + whiteMana + blueMana + greenMana + redMana + colorlessMana;
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (controller != null && permanent != null) {
|
||||
if (permanent.getManaCost().convertedManaCost() == manaPoolTotal) {
|
||||
if (permanent.getConvertedManaCost() == manaPoolTotal) {
|
||||
return permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public class SoulFoundry extends CardImpl {
|
|||
Card imprinted = game.getCard(sourcePermanent.getImprinted().get(0));
|
||||
if (imprinted != null) {
|
||||
ability.getManaCostsToPay().clear();
|
||||
ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getManaCost().convertedManaCost()));
|
||||
ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getConvertedManaCost()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,8 +109,8 @@ class StrongholdGambitEffect extends OneShotEffect {
|
|||
Cards cardsToReveal = new CardsImpl(card);
|
||||
player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ")", cardsToReveal, game);
|
||||
if (card.getCardType().contains(CardType.CREATURE)
|
||||
&& lowestCMC > card.getManaCost().convertedManaCost()) {
|
||||
lowestCMC = card.getManaCost().convertedManaCost();
|
||||
&& lowestCMC > card.getConvertedManaCost()) {
|
||||
lowestCMC = card.getConvertedManaCost();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -123,7 +123,7 @@ class StrongholdGambitEffect extends OneShotEffect {
|
|||
Card card = game.getCard(choosenCard.get(playerId));
|
||||
if (card != null) {
|
||||
if (card.getCardType().contains(CardType.CREATURE)
|
||||
&& lowestCMC == card.getManaCost().convertedManaCost()) {
|
||||
&& lowestCMC == card.getConvertedManaCost()) {
|
||||
creaturesToBattlefield.add(card);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class BirthingPodEffect extends OneShotEffect {
|
|||
}
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
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);
|
||||
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, newConvertedCost));
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ class BludgeonBrawlGainAbilityEffect extends ContinuousEffectImpl {
|
|||
for (UUID permanentId : permanents) {
|
||||
Permanent permanent = game.getPermanent(permanentId);
|
||||
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 SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(convertedManaCost, 0)), game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ class KozilekDiscardCost extends CostImpl {
|
|||
}
|
||||
Player controller = game.getPlayer(ability.getControllerId());
|
||||
for (Card card : controller.getHand().getCards(game)) {
|
||||
if (stackCMC.contains(card.getManaCost().convertedManaCost())) {
|
||||
if (stackCMC.contains(card.getConvertedManaCost())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class ErraticMutationEffect extends OneShotEffect {
|
|||
}
|
||||
// the nonland card
|
||||
if (nonLandCard != null) {
|
||||
int boostValue = nonLandCard.getManaCost().convertedManaCost();
|
||||
int boostValue = nonLandCard.getConvertedManaCost();
|
||||
// unboost target
|
||||
ContinuousEffect effect = new BoostTargetEffect(boostValue, -boostValue, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(this.getTargetPointer().getFirst(game, source)));
|
||||
|
|
|
|||
|
|
@ -106,11 +106,11 @@ class ErraticExplosionEffect extends OneShotEffect {
|
|||
if (nonLandCard != null) {
|
||||
Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||
if (targetCreature != null) {
|
||||
targetCreature.damage(nonLandCard.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
|
||||
targetCreature.damage(nonLandCard.getConvertedManaCost(), source.getSourceId(), game, false, true);
|
||||
} else {
|
||||
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (targetPlayer != null) {
|
||||
targetPlayer.damage(nonLandCard.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
|
||||
targetPlayer.damage(nonLandCard.getConvertedManaCost(), source.getSourceId(), game, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class DralnusPetEffect extends OneShotEffect {
|
|||
int cmc = 0;
|
||||
for (Cost cost : spellAbility.getCosts()) {
|
||||
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) {
|
||||
return new AddCountersSourceEffect(CounterType.P1P1.createInstance(cmc), true).apply(game, source);
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class PlaneswalkersFavorEffect extends OneShotEffect {
|
|||
Card card = opponent.getHand().getRandom(game);
|
||||
if (card != null) {
|
||||
revealed.add(card);
|
||||
int boostValue = card.getManaCost().convertedManaCost();
|
||||
int boostValue = card.getConvertedManaCost();
|
||||
opponent.revealCards("Planeswalker's Favor", revealed, game);
|
||||
ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget()));
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class PlaneswalkersFuryEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
revealed.add(card);
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class PlaneswalkersMirthEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
revealed.add(card);
|
||||
opponent.revealCards("Planeswalker's Mirth", revealed, game);
|
||||
player.gainLife(card.getManaCost().convertedManaCost(), game);
|
||||
player.gainLife(card.getConvertedManaCost(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class PlaneswalkersScornEffect extends OneShotEffect {
|
|||
Card card = opponent.getHand().getRandom(game);
|
||||
if (card != null) {
|
||||
revealed.add(card);
|
||||
int boostValue = -1 * card.getManaCost().convertedManaCost();
|
||||
int boostValue = -1 * card.getConvertedManaCost();
|
||||
opponent.revealCards("Planeswalker's Scorn", revealed, game);
|
||||
ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget()));
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class InfernalGenesisEffect extends OneShotEffect {
|
|||
Card card = player.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
if (player.moveCards(card, Zone.GRAVEYARD, source, game)) {
|
||||
int cmc = card.getManaCost().convertedManaCost();
|
||||
int cmc = card.getConvertedManaCost();
|
||||
MinionToken token = new MinionToken();
|
||||
token.putOntoBattlefield(cmc, game, source.getSourceId(), player.getId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class RethinkEffect extends OneShotEffect {
|
|||
if (spell != null) {
|
||||
Player player = game.getPlayer(spell.getControllerId());
|
||||
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)) {
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class DarkConfidantEffect extends OneShotEffect {
|
|||
Cards cards = new CardsImpl(card);
|
||||
controller.revealCards(sourcePermanent.getIdName(), cards, game);
|
||||
controller.moveCards(card, Zone.HAND, source, game);
|
||||
controller.loseLife(card.getManaCost().convertedManaCost(), game);
|
||||
controller.loseLife(card.getConvertedManaCost(), game);
|
||||
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class InduceParanoiaEffect extends OneShotEffect {
|
|||
StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source));
|
||||
if (spell != null) {
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
int spellCMC = spell.getManaCost().convertedManaCost();
|
||||
int spellCMC = spell.getConvertedManaCost();
|
||||
Player player = game.getPlayer(spell.getControllerId());
|
||||
if (player != null) {
|
||||
player.moveCards(player.getLibrary().getTopCards(game, spellCMC), Zone.GRAVEYARD, source, game);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class SoulTitheEffect extends OneShotEffect {
|
|||
if(permanent != null) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
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)) {
|
||||
Cost cost = new GenericManaCost(cmc);
|
||||
if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) {
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public class BanefulOmen extends CardImpl {
|
|||
player.revealCards("Baneful Omen", cards, game);
|
||||
|
||||
if (card != null) {
|
||||
int loseLife = card.getManaCost().convertedManaCost();
|
||||
int loseLife = card.getConvertedManaCost();
|
||||
Set<UUID> opponents = game.getOpponents(source.getControllerId());
|
||||
for (UUID opponentUuid : opponents) {
|
||||
Player opponent = game.getPlayer(opponentUuid);
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class ExplosiveRevelationEffect extends OneShotEffect {
|
|||
player.revealCards("Explosive Revelation", cards, game);
|
||||
}
|
||||
// the nonland card
|
||||
int damage = card.getManaCost().convertedManaCost();
|
||||
int damage = card.getConvertedManaCost();
|
||||
// assign damage to target
|
||||
for (UUID targetId: targetPointer.getTargets(game, source)) {
|
||||
Permanent targetedCreature = game.getPermanent(targetId);
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ class HedronMatrixEffect extends ContinuousEffectImpl {
|
|||
if (equipment != null && equipment.getAttachedTo() != null) {
|
||||
Permanent creature = game.getPermanent(equipment.getAttachedTo());
|
||||
if (creature != null) {
|
||||
creature.addPower(creature.getManaCost().convertedManaCost());
|
||||
creature.addToughness(creature.getManaCost().convertedManaCost());
|
||||
creature.addPower(creature.getConvertedManaCost());
|
||||
creature.addToughness(creature.getConvertedManaCost());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class SarkhanTheMadRevealAndDrawEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
controller.moveCards(card, Zone.HAND, source, game);
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class InfernalKirinEffect extends OneShotEffect {
|
|||
targetPlayer.revealCards("Infernal Kirin", targetPlayer.getHand(), game);
|
||||
for (UUID uuid: targetPlayer.getHand().copy()) {
|
||||
Card card = game.getCard(uuid);
|
||||
if (card != null && card.getManaCost().convertedManaCost() == cmc) {
|
||||
if (card != null && card.getConvertedManaCost() == cmc) {
|
||||
targetPlayer.discard(card, source, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class RendingVinesEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (controller != null) {
|
||||
if (permanent.getManaCost().convertedManaCost() <= controller.getHand().size()) {
|
||||
if (permanent.getConvertedManaCost() <= controller.getHand().size()) {
|
||||
return permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class UndyingFlamesEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
you.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY, true);
|
||||
if (!card.getCardType().contains(CardType.LAND)) {
|
||||
int damage = card.getManaCost().convertedManaCost();
|
||||
int damage = card.getConvertedManaCost();
|
||||
if (damage > 0) {
|
||||
Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||
if (creature != null) {
|
||||
|
|
@ -107,7 +107,7 @@ class UndyingFlamesEffect extends OneShotEffect {
|
|||
}
|
||||
Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
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());
|
||||
applied = true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class CerebralEruptionEffect extends OneShotEffect {
|
|||
Cards cards = new CardsImpl(card);
|
||||
player.revealCards(sourceObject.getIdName(), cards, game);
|
||||
game.getState().setValue(source.getSourceId().toString(), card);
|
||||
int damage = card.getManaCost().convertedManaCost();
|
||||
int damage = card.getConvertedManaCost();
|
||||
player.damage(damage, source.getSourceId(), game, false, true);
|
||||
for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {
|
||||
perm.damage(damage, source.getSourceId(), game, false, true);
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class GethLordOfTheVaultEffect extends OneShotEffect {
|
|||
controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null);
|
||||
Player player = game.getPlayer(card.getOwnerId());
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class HoardSmelterEffect extends ContinuousEffectImpl {
|
|||
public void init(Ability source, Game game) {
|
||||
Card targeted = game.getCard(source.getFirstTarget());
|
||||
if (targeted != null) {
|
||||
costValue = targeted.getManaCost().convertedManaCost();
|
||||
costValue = targeted.getConvertedManaCost();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class PrototypePortal extends CardImpl {
|
|||
if (card.getImprinted().size() > 0) {
|
||||
Card imprinted = game.getCard(card.getImprinted().get(0));
|
||||
if (imprinted != null) {
|
||||
ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getManaCost().convertedManaCost()));
|
||||
ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getConvertedManaCost()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public class RatchetBomb extends CardImpl {
|
|||
|
||||
int count = p.getCounters().getCount(CounterType.CHARGE);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public class RazorHippogriff extends CardImpl {
|
|||
card = (Card)game.getLastKnownInformation(source.getFirstTarget(), Zone.GRAVEYARD);
|
||||
}
|
||||
if (card != null) {
|
||||
player.gainLife(card.getManaCost().convertedManaCost(), game);
|
||||
player.gainLife(card.getConvertedManaCost(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class SteelHellkiteDestroyEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
int xValue = source.getManaCostsToPay().getX();
|
||||
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());
|
||||
if (watcher != null && watcher.hasSourceDoneDamage(source.getSourceId(), game)) {
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class AncientOozePowerToughnessValue implements DynamicValue {
|
|||
int value = 0;
|
||||
for(Permanent creature : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), sourceAbility.getControllerId(), game)){
|
||||
if(creature != null && !sourceAbility.getSourceId().equals(creature.getId())){
|
||||
value += creature.getManaCost().convertedManaCost();
|
||||
value += creature.getConvertedManaCost();
|
||||
}
|
||||
}
|
||||
return value;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class AuguryAdeptEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
|
||||
int cmc = card.getManaCost().convertedManaCost();
|
||||
int cmc = card.getConvertedManaCost();
|
||||
if (cmc > 0) {
|
||||
controller.gainLife(cmc, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class BeseechTheQueenPredicate implements Predicate<Card> {
|
|||
|
||||
@Override
|
||||
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 false;
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class PucasMischiefSecondTarget extends TargetPermanent {
|
|||
Permanent target1 = game.getPermanent(source.getFirstTarget());
|
||||
Permanent opponentPermanent = game.getPermanent(id);
|
||||
if (target1 != null && opponentPermanent != null) {
|
||||
return target1.getManaCost().convertedManaCost() >= opponentPermanent.getManaCost().convertedManaCost();
|
||||
return target1.getConvertedManaCost() >= opponentPermanent.getConvertedManaCost();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
@ -148,7 +148,7 @@ class PucasMischiefSecondTarget extends TargetPermanent {
|
|||
MageObject targetSource = game.getObject(sourceId);
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, 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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,14 +114,14 @@ class SeasonsPastTarget extends TargetCardInYourGraveyard {
|
|||
for (UUID targetId : this.getTargets()) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
usedCMC.add(card.getManaCost().convertedManaCost());
|
||||
usedCMC.add(card.getConvertedManaCost());
|
||||
}
|
||||
}
|
||||
Set<UUID> possibleTargets = super.possibleTargets(sourceId, sourceControllerId, game);
|
||||
Set<UUID> leftPossibleTargets = new HashSet<>();
|
||||
for (UUID targetId : possibleTargets) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null && !usedCMC.contains(card.getManaCost().convertedManaCost())) {
|
||||
if (card != null && !usedCMC.contains(card.getConvertedManaCost())) {
|
||||
leftPossibleTargets.add(targetId);
|
||||
}
|
||||
}
|
||||
|
|
@ -135,11 +135,11 @@ class SeasonsPastTarget extends TargetCardInYourGraveyard {
|
|||
for (UUID targetId : this.getTargets()) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
usedCMC.add(card.getManaCost().convertedManaCost());
|
||||
usedCMC.add(card.getConvertedManaCost());
|
||||
}
|
||||
}
|
||||
Card card = game.getCard(objectId);
|
||||
return card != null && !usedCMC.contains(card.getManaCost().convertedManaCost());
|
||||
return card != null && !usedCMC.contains(card.getConvertedManaCost());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class SinProdderEffect extends OneShotEffect {
|
|||
Player opponent = game.getPlayer(opponentUuid);
|
||||
if (opponent != null && !putInGraveyard && opponent.chooseUse(Outcome.Damage, sb.toString(), source, game)) {
|
||||
putInGraveyard = true;
|
||||
opponent.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
|
||||
opponent.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
|
||||
}
|
||||
}
|
||||
if (putInGraveyard) {
|
||||
|
|
|
|||
|
|
@ -123,10 +123,10 @@ class SorinGrimNemesisRevealEffect extends OneShotEffect {
|
|||
if (card != null &&
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) {
|
||||
for (UUID playerId : game.getOpponents(source.getControllerId())) {
|
||||
if (card.getManaCost().convertedManaCost() > 0) {
|
||||
if (card.getConvertedManaCost() > 0) {
|
||||
Player opponent = game.getPlayer(playerId);
|
||||
if (opponent != null) {
|
||||
opponent.loseLife(card.getManaCost().convertedManaCost(), game);
|
||||
opponent.loseLife(card.getConvertedManaCost(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class WolfOfDevilsBreachDiscardCostCardConvertedMana implements DynamicValue {
|
|||
DiscardCardCost discardCost = (DiscardCardCost) cost;
|
||||
int cmc = 0;
|
||||
for (Card card : discardCost.getCards()) {
|
||||
cmc += card.getManaCost().convertedManaCost();
|
||||
cmc += card.getConvertedManaCost();
|
||||
}
|
||||
return cmc;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue