Fix Adventure/Omen Permanent View

* Adventure/Omen Permanents no longer show rule text from the spell ability
* Updated CardView variable for SpellOptionCard
This commit is contained in:
jmlundeen 2025-04-14 17:02:48 -05:00
parent 3885e72aad
commit 6bf8aedce7
2 changed files with 14 additions and 7 deletions

View file

@ -439,14 +439,14 @@ public class CardView extends SimpleCardView {
leftSplitCostsStr = String.join("", mainCard.getManaCostSymbols());
leftSplitRules = mainCard.getSharedRules(game);
leftSplitTypeLine = getCardTypeLine(game, mainCard);
SpellOptionCard splitCardSpell = mainCard.getSpellCard();
rightSplitName = splitCardSpell.getName();
rightSplitCostsStr = String.join("", splitCardSpell.getManaCostSymbols());
rightSplitRules = splitCardSpell.getRules(game);
rightSplitTypeLine = getCardTypeLine(game, splitCardSpell);
fullCardName = mainCard.getName() + MockCard.CARD_WITH_SPELL_OPTION_NAME_SEPARATOR + splitCardSpell.getName();
SpellOptionCard spellOptionCard = mainCard.getSpellCard();
rightSplitName = spellOptionCard.getName();
rightSplitCostsStr = String.join("", spellOptionCard.getManaCostSymbols());
rightSplitRules = spellOptionCard.getRules(game);
rightSplitTypeLine = getCardTypeLine(game, spellOptionCard);
fullCardName = mainCard.getName() + MockCard.CARD_WITH_SPELL_OPTION_NAME_SEPARATOR + spellOptionCard.getName();
this.manaCostLeftStr = mainCard.getManaCostSymbols();
this.manaCostRightStr = splitCardSpell.getManaCostSymbols();
this.manaCostRightStr = spellOptionCard.getManaCostSymbols();
} else if (card instanceof MockCard) {
// deck editor cards
fullCardName = ((MockCard) card).getFullName(true);

View file

@ -1,6 +1,7 @@
package mage.view;
import mage.cards.Card;
import mage.cards.CardWithSpellOption;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
@ -79,6 +80,12 @@ public class PermanentView extends CardView {
this.alternateName = original.getName();
}
}
// for adventure/omen cards, remove spell card rules
if (card instanceof CardWithSpellOption) {
this.rules.removeIf(rule -> rule.startsWith("Adventure") || rule.startsWith("Omen"));
}
if (permanent.getOwnerId() != null && !permanent.getOwnerId().equals(permanent.getControllerId())) {
Player owner = game.getPlayer(permanent.getOwnerId());
if (owner != null) {