From 16294fe54a84d4708548722f626eb47dbbc9bfdd Mon Sep 17 00:00:00 2001 From: swordshine Date: Wed, 8 Jan 2014 13:55:22 +0000 Subject: [PATCH] - Combine GreatestPowerYouControl and GreatestPowerYouDontControl --- .../res/cardsfolder/t/triumph_of_cruelty.txt | 4 ++-- .../res/cardsfolder/t/triumph_of_ferocity.txt | 4 ++-- .../java/forge/game/card/CardFactoryUtil.java | 19 +++++-------------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/forge-gui/res/cardsfolder/t/triumph_of_cruelty.txt b/forge-gui/res/cardsfolder/t/triumph_of_cruelty.txt index ade867b2074..c16d73232bf 100644 --- a/forge-gui/res/cardsfolder/t/triumph_of_cruelty.txt +++ b/forge-gui/res/cardsfolder/t/triumph_of_cruelty.txt @@ -3,7 +3,7 @@ ManaCost:2 B Types:Enchantment T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigCruelDiscard | TriggerDescription$ At the beginning of your upkeep, target opponent discards a card if you control the creature with the greatest power or tied for the greatest power. SVar:TrigCruelDiscard:AB$Discard | Cost$ 0 | ValidTgts$ Opponent | NumCards$ 1 | Mode$ TgtChoose | ConditionPresent$ Creature | ConditionCompare$ GE1 | ConditionCheckSVar$ YourCruelty | ConditionSVarCompare$ GEOppsCruelty | References$ YourCruelty,OppsCruelty -SVar:YourCruelty:Count$GreatestPowerYouControl -SVar:OppsCruelty:Count$GreatestPowerYouDontControl +SVar:YourCruelty:Count$GreatestPower_Creature.YouCtrl +SVar:OppsCruelty:Count$GreatestPower_Creature.YouDontCtrl SVar:Picture:http://www.wizards.com/global/images/magic/general/triumph_of_cruelty.jpg Oracle:At the beginning of your upkeep, target opponent discards a card if you control the creature with the greatest power or tied for the greatest power. \ No newline at end of file diff --git a/forge-gui/res/cardsfolder/t/triumph_of_ferocity.txt b/forge-gui/res/cardsfolder/t/triumph_of_ferocity.txt index 58a784a273b..f0c0419d670 100644 --- a/forge-gui/res/cardsfolder/t/triumph_of_ferocity.txt +++ b/forge-gui/res/cardsfolder/t/triumph_of_ferocity.txt @@ -3,7 +3,7 @@ ManaCost:2 G Types:Enchantment T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigFerociousDraw | TriggerDescription$ At the beginning of your upkeep, draw a card if you control the creature with the greatest power or tied for the greatest power. SVar:TrigFerociousDraw:AB$ Draw | Cost$ 0 | Defined$ You | NumCards$ 1 | ConditionPresent$ Creature | ConditionCompare$ GE1 | ConditionCheckSVar$ YourFerocity | ConditionSVarCompare$ GEOppsFerocity | References$ YourFerocity,OppsFerocity -SVar:YourFerocity:Count$GreatestPowerYouControl -SVar:OppsFerocity:Count$GreatestPowerYouDontControl +SVar:YourFerocity:Count$GreatestPower_Creature.YouCtrl +SVar:OppsFerocity:Count$GreatestPower_Creature.YouDontCtrl SVar:Picture:http://www.wizards.com/global/images/magic/general/triumph_of_ferocity.jpg Oracle:At the beginning of your upkeep, draw a card if you control the creature with the greatest power or tied for the greatest power. \ No newline at end of file diff --git a/forge-gui/src/main/java/forge/game/card/CardFactoryUtil.java b/forge-gui/src/main/java/forge/game/card/CardFactoryUtil.java index 09747c534e8..63f847fda70 100644 --- a/forge-gui/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-gui/src/main/java/forge/game/card/CardFactoryUtil.java @@ -987,21 +987,12 @@ public class CardFactoryUtil { if (l[0].startsWith("ImprintedCardToughness") && !c.getImprinted().isEmpty()) return c.getImprinted().get(0).getNetDefense(); if (l[0].startsWith("ImprintedCardManaCost") && !c.getImprinted().isEmpty()) return c.getImprinted().get(0).getCMC(); - if (l[0].startsWith("GreatestPowerYouControl")) { + if (l[0].startsWith("GreatestPower_")) { + final String restriction = l[0].substring(14); + final String[] rest = restriction.split(","); + List list = CardLists.getValidCards(cc.getGame().getCardsIn(ZoneType.Battlefield), rest, cc, c); int highest = 0; - for (final Card crd : c.getController().getCreaturesInPlay()) { - if (crd.getNetAttack() > highest) { - highest = crd.getNetAttack(); - } - } - return highest; - } - - if (l[0].startsWith("GreatestPowerYouDontControl")) { - int highest = 0; - for (final Card crd : c.getController().getGame().getCardsIn(ZoneType.Battlefield)) { - if (!crd.isCreature() || crd.getController() == c.getController()) - continue; + for (final Card crd : list) { if (crd.getNetAttack() > highest) { highest = crd.getNetAttack(); }