From a3c82bbc7443f21e7ebbe4f783feef55b9a3dd16 Mon Sep 17 00:00:00 2001 From: Sol Date: Thu, 29 Sep 2016 15:03:57 +0000 Subject: [PATCH] - Real fix for Padeem, needed to filter by Types CMC not just any permanents CMC --- .../src/main/java/forge/game/card/Card.java | 23 +++++++------------ .../res/cardsfolder/f/favor_of_the_mighty.txt | 2 +- .../p/padeem_consul_of_innovation.txt | 2 +- forge-gui/res/cardsfolder/t/tariff.txt | 2 +- .../java/forge/player/HumanCostDecision.java | 2 +- 5 files changed, 12 insertions(+), 19 deletions(-) diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index bc316999917..63dfed90d60 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -4841,25 +4841,18 @@ public class Card extends GameEntity implements Comparable { return false; } } - } else if (property.startsWith("greatestCMC")) { + } else if (property.startsWith("greatestCMC_")) { CardCollectionView cards = game.getCardsIn(ZoneType.Battlefield); - if (property.contains("ControlledBy")) { + String prop = property.substring("greatestCMC_".length()); + if (prop.contains("ControlledBy")) { + prop = prop.split("ControlledBy")[0]; FCollectionView p = AbilityUtils.getDefinedPlayers(source, property.split("ControlledBy")[1], null); cards = CardLists.filterControlledBy(cards, p); - if (!cards.contains(this)) { - return false; - } } - for (final Card crd : cards) { - if (crd.isSplitCard()) { - if (crd.getCMC(Card.SplitCMCMode.LeftSplitCMC) > getCMC() || crd.getCMC(Card.SplitCMCMode.RightSplitCMC) > getCMC()) { - return false; - } - } else { - if (crd.getCMC() > getCMC()) { - return false; - } - } + cards = CardLists.getType(cards, prop); + cards = CardLists.getCardsWithHighestCMC(cards); + if (!cards.contains(this)) { + return false; } } else if (property.startsWith("greatestRememberedCMC")) { CardCollection cards = new CardCollection(); diff --git a/forge-gui/res/cardsfolder/f/favor_of_the_mighty.txt b/forge-gui/res/cardsfolder/f/favor_of_the_mighty.txt index b2a5debff23..9825c6211df 100644 --- a/forge-gui/res/cardsfolder/f/favor_of_the_mighty.txt +++ b/forge-gui/res/cardsfolder/f/favor_of_the_mighty.txt @@ -1,7 +1,7 @@ Name:Favor of the Mighty ManaCost:1 W Types:Tribal Enchantment Giant -S:Mode$ Continuous | Affected$ Creature.greatestCMC | AddKeyword$ Protection from all colors | Description$ Each creature with the highest converted mana cost has protection from all colors. +S:Mode$ Continuous | Affected$ Creature.greatestCMC_Creature | AddKeyword$ Protection from all colors | Description$ Each creature with the highest converted mana cost has protection from all colors. SVar:NonStackingEffect:True SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/favor_of_the_mighty.jpg diff --git a/forge-gui/res/cardsfolder/p/padeem_consul_of_innovation.txt b/forge-gui/res/cardsfolder/p/padeem_consul_of_innovation.txt index bc070eedeef..3e4e65f8d9f 100644 --- a/forge-gui/res/cardsfolder/p/padeem_consul_of_innovation.txt +++ b/forge-gui/res/cardsfolder/p/padeem_consul_of_innovation.txt @@ -5,6 +5,6 @@ PT:1/4 S:Mode$ Continuous | Affected$ Artifact.YouCtrl | AddKeyword$ Hexproof | Description$ Artifacts you control have hexproof. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | CheckSVar$ X | SVarCompare$ GE1 | Execute$ TrigDraw | TriggerDescription$ At the beginning of your upkeep, if you control the artifact with the highest converted mana cost or tied for the highest converted mana cost, draw a card. SVar:TrigDraw:AB$ Draw | Cost$ 0 | Defined$ You | NumCards$ 1 -SVar:X:Count$Valid Artifact.greatestCMC+YouCtrl +SVar:X:Count$Valid Artifact.greatestCMC_Artifact+YouCtrl SVar:Picture:http://www.wizards.com/global/images/magic/general/padeem_consul_of_innovation.jpg Oracle:Artifacts you control have hexproof.\nAt the beginning of your upkeep, if you control the artifact with the highest converted mana cost or tied for the highest converted mana cost, draw a card. diff --git a/forge-gui/res/cardsfolder/t/tariff.txt b/forge-gui/res/cardsfolder/t/tariff.txt index 89597cec92d..6c4d91d7cd7 100644 --- a/forge-gui/res/cardsfolder/t/tariff.txt +++ b/forge-gui/res/cardsfolder/t/tariff.txt @@ -2,7 +2,7 @@ Name:Tariff ManaCost:1 W Types:Sorcery A:SP$ RepeatEach | Cost$ 1 W | RepeatPlayers$ Player | RepeatSubAbility$ DBChooseCard | SpellDescription$ Each player sacrifices the creature he or she controls with the highest converted mana cost unless he or she pays that creature's mana cost. If two or more creatures a player controls are tied for highest cost, that player chooses one. -SVar:DBChooseCard:DB$ ChooseCard | Defined$ Player.IsRemembered | Choices$ Creature.greatestCMCControlledByRemembered | Mandatory$ True | SubAbility$ DBSac +SVar:DBChooseCard:DB$ ChooseCard | Defined$ Player.IsRemembered | Choices$ Creature.greatestCMC_CreatureControlledByRemembered | Mandatory$ True | SubAbility$ DBSac SVar:DBSac:DB$ Sacrifice | Defined$ Player.IsRemembered | SacValid$ Card.ChosenCard | SacMessage$ the creature with the highest converted mana cost | UnlessCost$ ChosenManaCost | UnlessPayer$ Player.IsRemembered SVar:Picture:http://www.wizards.com/global/images/magic/general/tariff.jpg SVar:RemAIDeck:True diff --git a/forge-gui/src/main/java/forge/player/HumanCostDecision.java b/forge-gui/src/main/java/forge/player/HumanCostDecision.java index a3c1ad3f882..e0cbff6ecd6 100644 --- a/forge-gui/src/main/java/forge/player/HumanCostDecision.java +++ b/forge-gui/src/main/java/forge/player/HumanCostDecision.java @@ -1151,7 +1151,7 @@ public class HumanCostDecision extends CostDecisionMakerBase { if (totalPower) { final int i = Integer.parseInt(totalP); final InputSelectCardsFromList inp = new InputSelectCardsFromList(controller, 0, typeList.size(), typeList); - inp.setMessage("Select a card to tap."); + inp.setMessage("Select a creature to tap."); inp.setCancelAllowed(true); inp.showAndWait();