From 1ba01c38bee0c50385ed30c6da238aded66e855e Mon Sep 17 00:00:00 2001 From: Hans Mackowiak Date: Tue, 26 Jan 2021 17:02:39 +0100 Subject: [PATCH] May spend Mana only work on Stack --- .../res/cardsfolder/e/emissarys_ploy.txt | 2 +- forge-gui/res/cardsfolder/o/oath_of_nissa.txt | 3 +- .../cardsfolder/u/unexpected_potential.txt | 2 +- .../cardsfolder/v/vizier_of_the_menagerie.txt | 2 +- .../forge/player/HumanPlaySpellAbility.java | 31 ++++++++++--------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/forge-gui/res/cardsfolder/e/emissarys_ploy.txt b/forge-gui/res/cardsfolder/e/emissarys_ploy.txt index e58b03a965f..ed66b421bf7 100644 --- a/forge-gui/res/cardsfolder/e/emissarys_ploy.txt +++ b/forge-gui/res/cardsfolder/e/emissarys_ploy.txt @@ -2,6 +2,6 @@ Name:Emissary's Ploy Types:Conspiracy Text:(Start the game with this conspiracy face up in the command zone.) K:Before drawing your opening hand, choose 1, 2, or 3. -S:Mode$ Continuous| Affected$ Creature.YouCtrl+cmcEQX | AffectedZone$ Hand,Library,Graveyard,Exile,Command | AddHiddenKeyword$ May spend mana as though it were mana of any color to cast CARDNAME | Description$ You may spend mana as though it were mana of any color to cast creature spells with converted mana cost equal to the chosen number. +S:Mode$ Continuous | Affected$ Creature.YouCtrl+cmcEQX | AffectedZone$ Stack | AddHiddenKeyword$ May spend mana as though it were mana of any color to cast CARDNAME | Description$ You may spend mana as though it were mana of any color to cast creature spells with converted mana cost equal to the chosen number. SVar:X:Count$ChosenNumber Oracle:(Start the game with this conspiracy face up in the command zone.)\nBefore drawing your opening hand, choose 1, 2, or 3. You may spend mana as though it were mana of any color to cast creature spells with converted mana cost equal to the chosen number. \ No newline at end of file diff --git a/forge-gui/res/cardsfolder/o/oath_of_nissa.txt b/forge-gui/res/cardsfolder/o/oath_of_nissa.txt index e05b991c2f2..30d7decb05d 100644 --- a/forge-gui/res/cardsfolder/o/oath_of_nissa.txt +++ b/forge-gui/res/cardsfolder/o/oath_of_nissa.txt @@ -3,6 +3,5 @@ ManaCost:G Types:Legendary Enchantment T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigDig | TriggerDescription$ When CARDNAME enters the battlefield, look at the top three cards of your library. You may reveal a creature, land, or planeswalker card from among them and put it into your hand. Put the rest on the bottom of your library in any order. SVar:TrigDig:DB$Dig | DigNum$ 3 | ChangeNum$ 1 | Optional$ True | ChangeValid$ Creature,Land,Planeswalker -S:Mode$ Continuous| Affected$ Planeswalker.YouCtrl | AffectedZone$ Hand,Library,Graveyard,Exile,Command | AddHiddenKeyword$ May spend mana as though it were mana of any color to cast CARDNAME | Description$ You may spend mana as though it were mana of any color to cast planeswalker spells. -SVar:Picture:http://www.wizards.com/global/images/magic/general/oath_of_nissa.jpg +S:Mode$ Continuous | Affected$ Planeswalker.YouCtrl | AffectedZone$ Stack | AddHiddenKeyword$ May spend mana as though it were mana of any color to cast CARDNAME | Description$ You may spend mana as though it were mana of any color to cast planeswalker spells. Oracle:When Oath of Nissa enters the battlefield, look at the top three cards of your library. You may reveal a creature, land, or planeswalker card from among them and put it into your hand. Put the rest on the bottom of your library in any order.\nYou may spend mana as though it were mana of any color to cast planeswalker spells. diff --git a/forge-gui/res/cardsfolder/u/unexpected_potential.txt b/forge-gui/res/cardsfolder/u/unexpected_potential.txt index bd4d2b3fb3d..dbaabb19a9a 100644 --- a/forge-gui/res/cardsfolder/u/unexpected_potential.txt +++ b/forge-gui/res/cardsfolder/u/unexpected_potential.txt @@ -2,6 +2,6 @@ Name:Unexpected Potential ManaCost:no cost Types:Conspiracy K:Hidden agenda -S:Mode$ Continuous | EffectZone$ Command | Affected$ Card.NamedCard | AddHiddenKeyword$ May spend mana as though it were mana of any color to cast CARDNAME | AffectedZone$ Hand,Graveyard,Exile,Library,Command | Description$ You may spend mana as though it were mana of any color to cast spells with the chosen name. +S:Mode$ Continuous | EffectZone$ Command | Affected$ Card.NamedCard | AffectedZone$ Stack | AddHiddenKeyword$ May spend mana as though it were mana of any color to cast CARDNAME | Description$ You may spend mana as though it were mana of any color to cast spells with the chosen name. SVar:AgendaLogic:BestCreatureInComputerDeck Oracle:Hidden agenda (Start the game with this conspiracy face down in the command zone and secretly name a card. You may turn this conspiracy face up any time and reveal the chosen name.)\nYou may spend mana as though it were mana of any color to cast spells with the chosen name. diff --git a/forge-gui/res/cardsfolder/v/vizier_of_the_menagerie.txt b/forge-gui/res/cardsfolder/v/vizier_of_the_menagerie.txt index a3221306d69..db508c597fe 100644 --- a/forge-gui/res/cardsfolder/v/vizier_of_the_menagerie.txt +++ b/forge-gui/res/cardsfolder/v/vizier_of_the_menagerie.txt @@ -4,5 +4,5 @@ Types:Creature Naga Cleric PT:3/4 S:Mode$ Continuous | Affected$ Card.TopLibrary+YouCtrl | AffectedZone$ Library | MayLookAt$ You | Description$ You may look at the top card of your library any time. S:Mode$ Continuous | Affected$ Creature.TopLibrary+YouCtrl+nonLand | AffectedZone$ Library | MayPlay$ True | Description$ You may cast the top card of your library if it's a creature card. -S:Mode$ Continuous | AddHiddenKeyword$ May spend mana as though it were mana of any type to cast CARDNAME | Affected$ Card.Creature+nonLand | AffectedZone$ Library,Hand,Graveyard,Exile | Description$ You may spend mana as though it were mana of any type to cast creature spells. +S:Mode$ Continuous | Affected$ Creature.YouCtrl | AffectedZone$ Stack | AddHiddenKeyword$ May spend mana as though it were mana of any type to cast CARDNAME | Description$ You may spend mana as though it were mana of any type to cast creature spells. Oracle:You may look at the top card of your library any time.\nYou may cast the top card of your library if it's a creature card.\nYou may spend mana as though it were mana of any type to cast creature spells. diff --git a/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java b/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java index e50618cb553..0742977bca0 100644 --- a/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java +++ b/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java @@ -74,24 +74,11 @@ public class HumanPlaySpellAbility { boolean manaTypeConversion = false; boolean manaColorConversion = false; - if (ability.isSpell()) { - if (c.hasKeyword("May spend mana as though it were mana of any type to cast CARDNAME") - || (option != null && option.isIgnoreManaCostType())) { - manaTypeConversion = true; - } else if (c.hasKeyword("May spend mana as though it were mana of any color to cast CARDNAME") - || (option != null && option.isIgnoreManaCostColor())) { - manaColorConversion = true; - } - } - - final boolean playerManaConversion = human.hasManaConversion() - && human.getController().confirmAction(ability, null, "Do you want to spend mana as though it were mana of any color to pay the cost?"); - boolean keywordColor = false; // freeze Stack. No abilities should go onto the stack while I'm filling requirements. game.getStack().freezeStack(); - if (ability instanceof Spell && !c.isCopiedSpell()) { + if (ability.isSpell() && !c.isCopiedSpell()) { fromZone = game.getZoneOf(c); fromState = c.getCurrentStateName(); if (fromZone != null) { @@ -111,6 +98,20 @@ public class HumanPlaySpellAbility { ability = GameActionUtil.addExtraKeywordCost(ability); + if (ability.isSpell() && !ability.isCopied()) { // These hidden keywords should only apply on the Stack + final Card host = ability.getHostCard(); + if (host.hasKeyword("May spend mana as though it were mana of any type to cast CARDNAME") + || (option != null && option.isIgnoreManaCostType())) { + manaTypeConversion = true; + } else if (host.hasKeyword("May spend mana as though it were mana of any color to cast CARDNAME") + || (option != null && option.isIgnoreManaCostColor())) { + manaColorConversion = true; + } + } + + final boolean playerManaConversion = human.hasManaConversion() + && human.getController().confirmAction(ability, null, "Do you want to spend mana as though it were mana of any color to pay the cost?"); + Cost abCost = ability.getPayCosts(); CostPayment payment = new CostPayment(abCost, ability); @@ -125,7 +126,7 @@ public class HumanPlaySpellAbility { AbilityUtils.applyManaColorConversion(manapool, MagicColor.Constant.ANY_COLOR_CONVERSION); human.incNumManaConversion(); } - + if (ability.isAbility() && ability.isActivatedAbility()) { final Map params = Maps.newHashMap(); params.put("ManaColorConversion", "Additive");