Fix token CMC when copying (#5898)

* Fix token CMC when copying

* Fix TDFC token copy using front CMC

---------

Co-authored-by: TRT <>
This commit is contained in:
tool4ever
2024-08-11 19:09:59 +02:00
committed by GitHub
parent 05b7265473
commit d2c42071aa

View File

@@ -7230,9 +7230,6 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
return getCMC(SplitCMCMode.CurrentSideCMC);
}
public int getCMC(SplitCMCMode mode) {
if (isToken() && getCopiedPermanent() == null) {
return 0;
}
if (lkiCMC >= 0) {
return lkiCMC; // a workaround used by getLKICopy
}
@@ -7263,8 +7260,15 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
}
} else if (currentStateName == CardStateName.Transformed) {
// Except in the cases were we clone the back-side of a DFC.
if (getCopiedPermanent() != null) {
return 0;
}
requestedCMC = getState(CardStateName.Original).getManaCost().getCMC();
} else if (currentStateName == CardStateName.Meld) {
// to follow the rules (but we shouldn't get here while cloned)
if (getCopiedPermanent() != null) {
return 0;
}
// Melded creatures have a combined CMC of each of their parts
requestedCMC = getState(CardStateName.Original).getManaCost().getCMC() + this.getMeldedWith().getManaCost().getCMC();
} else {