forked from External/mage
* 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
|
|
@ -86,7 +86,7 @@ public class ExileFromHandCost extends CostImpl {
|
|||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
cmc += card.getManaCost().convertedManaCost();
|
||||
cmc += card.getConvertedManaCost();
|
||||
this.cards.add(card);
|
||||
}
|
||||
Cards cardsToExile = new CardsImpl();
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class RevealTargetFromHandCost extends CostImpl {
|
|||
for (UUID targetId : targets.get(0).getTargets()) {
|
||||
Card card = player.getHand().get(targetId, game);
|
||||
if (card != null) {
|
||||
convertedManaCosts += card.getManaCost().convertedManaCost();
|
||||
convertedManaCosts += card.getConvertedManaCost();
|
||||
numberCardsRevealed++;
|
||||
cards.add(card);
|
||||
revealedCards.add(card);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class DiscardCostCardConvertedMana implements DynamicValue {
|
|||
DiscardCardCost discardCost = (DiscardCardCost) cost;
|
||||
int cmc = 0;
|
||||
for (Card card : discardCost.getCards()) {
|
||||
cmc += card.getManaCost().convertedManaCost();
|
||||
cmc += card.getConvertedManaCost();
|
||||
}
|
||||
return cmc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class ExileFromHandCostCardConvertedMana implements DynamicValue {
|
|||
if (cost.isPaid() && cost instanceof ExileFromHandCost) {
|
||||
int xValue = 0;
|
||||
for (Card card : ((ExileFromHandCost) cost).getCards()) {
|
||||
xValue += card.getManaCost().convertedManaCost();
|
||||
xValue += card.getConvertedManaCost();
|
||||
}
|
||||
return xValue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class SacrificeCostConvertedMana implements DynamicValue {
|
|||
SacrificeTargetCost sacrificeCost = (SacrificeTargetCost) cost;
|
||||
int totalCMC = 0;
|
||||
for(Permanent permanent : sacrificeCost.getPermanents()) {
|
||||
totalCMC += permanent.getManaCost().convertedManaCost();
|
||||
totalCMC += permanent.getConvertedManaCost();
|
||||
}
|
||||
return totalCMC;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class TargetConvertedManaCost implements DynamicValue {
|
|||
public int calculate(Game game, Ability source, Effect effect) {
|
||||
Card card = game.getCard(source.getFirstTarget());
|
||||
if (card != null) {
|
||||
return card.getManaCost().convertedManaCost();
|
||||
return card.getConvertedManaCost();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ public class ClashEffect extends OneShotEffect implements MageSingleton {
|
|||
cardController = controller.getLibrary().getFromTop(game);
|
||||
cards.add(cardController);
|
||||
controller.revealCards(sourceObject.getIdName() + ": Clash card of " + controller.getName(), cards, game);
|
||||
cmcController = cardController.getManaCost().convertedManaCost();
|
||||
cmcController = cardController.getConvertedManaCost();
|
||||
message.append(" (").append(cmcController).append(")");
|
||||
} else {
|
||||
message.append(" no card");
|
||||
|
|
@ -144,7 +144,7 @@ public class ClashEffect extends OneShotEffect implements MageSingleton {
|
|||
cardOpponent = opponent.getLibrary().getFromTop(game);
|
||||
cards.add(cardOpponent);
|
||||
opponent.revealCards(sourceObject.getIdName() + ": Clash card of " + opponent.getName(), cards, game);
|
||||
cmcOpponent = cardOpponent.getManaCost().convertedManaCost();
|
||||
cmcOpponent = cardOpponent.getConvertedManaCost();
|
||||
message.append(" (").append(cmcOpponent).append(")");
|
||||
} else {
|
||||
message.append(" no card");
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class ReturnSourceFromGraveyardToHandEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Card card = controller.getGraveyard().get(source.getSourceId(), game);
|
||||
if (card != null) {
|
||||
return controller.moveCards(card, null, Zone.HAND, source, game);
|
||||
return controller.moveCards(card, Zone.HAND, source, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,14 +112,14 @@ class CascadeEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
ExileZone exile = game.getExile().createZone(source.getSourceId(), player.getName() + " Cascade");
|
||||
int sourceCost = game.getCard(source.getSourceId()).getManaCost().convertedManaCost();
|
||||
int sourceCost = game.getCard(source.getSourceId()).getConvertedManaCost();
|
||||
do {
|
||||
card = player.getLibrary().getFromTop(game);
|
||||
if (card == null) {
|
||||
break;
|
||||
}
|
||||
player.moveCardsToExile(card, source, game, true, exile.getId(), exile.getName());
|
||||
} while (player.isInGame() && card.getCardType().contains(CardType.LAND) || card.getManaCost().convertedManaCost() >= sourceCost);
|
||||
} while (player.isInGame() && card.getCardType().contains(CardType.LAND) || card.getConvertedManaCost() >= sourceCost);
|
||||
player.getLibrary().reset();
|
||||
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -78,8 +78,8 @@ class TransmuteEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null && controller != null) {
|
||||
FilterCard filter = new FilterCard("card with converted mana cost " + sourceObject.getManaCost().convertedManaCost());
|
||||
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, sourceObject.getManaCost().convertedManaCost()));
|
||||
FilterCard filter = new FilterCard("card with converted mana cost " + sourceObject.getConvertedManaCost());
|
||||
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, sourceObject.getConvertedManaCost()));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(1, filter);
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue