Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions Mage/src/main/java/mage/game/permanent/PermanentCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,22 @@ public ManaCosts<ManaCost> getManaCost() {
@Override
public int getManaValue() {
if (isTransformed()) {
// 711.4b While a double-faced permanent's back face is up, it has only the characteristics of its back face.
// However, its converted mana cost is calculated using the mana cost of its front face. This is a change from previous rules.
// If a permanent is copying the back face of a double-faced card (even if the card representing that copy
// is itself a double-faced card), the converted mana cost of that permanent is 0.
// For modal double-faced cards, both sides are equally valid choices
// Use the mana cost of the currently active side (secondSideCard if set)
if (secondSideCard != null && getCard() instanceof DoubleFacedCardHalf) {
DoubleFacedCardHalf half = (DoubleFacedCardHalf) getCard();
if (half.getParentCard() instanceof ModalDoubleFacedCard) {
return secondSideCard.getManaValue();

@JayDi85 JayDi85 Jun 30, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks wrong. On battlefield and stack it must be current side. On other zones it must be left side. You are added left side on battlefield useless MDFC lookup. It's strange. Need more review-research from other devs.

Image

P.S. Also don't forget to implement related use case in tests. It's important for such bugs. Maybe real bug in wrong targeting, not in mana value calculation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.card already contain actual card half ref (for transformed it will contain second side), so that parent card check looks useless

Image

}
}

// 712.8d While a double-faced permanent has its front face up, it has only the characteristics of its front face.
// 712.8e While a nonmodal double-faced permanent has its back face up, it has only the characteristics of its back face.
// However, its mana value is calculated using the mana cost of its front face.
// If a permanent is copying the back face of a nonmodal double-faced permanent (even f the object representing that copy is itself a double-faced permanent), the mana value of that permanent is 0. See rule 202.3b.
// 712.8f While a modal double-faced spell is on the stack or a modal double-faced permanent is on the battlefield, it has only the characteristics of the face that’s up.


return getCard().getManaValue();
}
if (faceDown) { // game not neccessary
Expand Down
Loading