diff --git a/res/cardsfolder/quest_for_the_nihil_stone.txt b/res/cardsfolder/quest_for_the_nihil_stone.txt index a773f00d267..56fac98f920 100644 --- a/res/cardsfolder/quest_for_the_nihil_stone.txt +++ b/res/cardsfolder/quest_for_the_nihil_stone.txt @@ -3,9 +3,9 @@ ManaCost:B Types:Enchantment Text:no text T:Mode$ Discarded | ValidCard$ Card.YouDontCtrl | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ TrigPutCounter | TriggerDescription$ Whenever an opponent discards a card, you may put a quest counter on CARDNAME. -T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Opponent | IsPresent$ Card.Self+countersGE2QUEST | Execute$ TrigLoseLife | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ At the beginning of each opponent's upkeep, if that player has no cards in hand and CARDNAME has two or more quest counters on it, you may have that player lose 5 life. +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Opponent | IsPresent$ Card | PresentZone$ Hand | PresentPlayer$ Opponent | PresentCompare$ EQ0 | IsPresent2$ Card.Self+countersGE2QUEST | Execute$ TrigLoseLife | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ At the beginning of each opponent's upkeep, if that player has no cards in hand and CARDNAME has two or more quest counters on it, you may have that player lose 5 life. SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ QUEST | CounterNum$ 1 -SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ Opponent | LifeAmount$ 5 | PresentZone$ Hand | PresentPlayer$ Opponent | PresentCompare$ EQ0 +SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ Opponent | LifeAmount$ 5 SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/quest_for_the_nihil_stone.jpg SetInfo:WWK|Rare|http://magiccards.info/scans/en/wwk/64.jpg diff --git a/src/forge/card/trigger/Trigger.java b/src/forge/card/trigger/Trigger.java index fe8b904a0a1..7573cf33f56 100644 --- a/src/forge/card/trigger/Trigger.java +++ b/src/forge/card/trigger/Trigger.java @@ -273,9 +273,56 @@ public abstract class Trigger { } + if (mapParams.containsKey("IsPresent2")){ + String sIsPresent = mapParams.get("IsPresent2"); + String presentCompare = "GE1"; + String presentZone = "Battlefield"; + String presentPlayer = "Any"; + if(mapParams.containsKey("PresentCompare2")) + { + presentCompare = mapParams.get("PresentCompare2"); + } + if(mapParams.containsKey("PresentZone2")) + { + presentZone = mapParams.get("PresentZone2"); + } + if(mapParams.containsKey("PresentPlayer2")) + { + presentPlayer = mapParams.get("PresentPlayer2"); + } + CardList list = new CardList(); + if(presentPlayer.equals("You") || presentPlayer.equals("Any")) + { + list.add(AllZoneUtil.getCardsInZone(presentZone,hostCard.getController())); + } + if(presentPlayer.equals("Opponent") || presentPlayer.equals("Any")) + { + list.add(AllZoneUtil.getCardsInZone(presentZone,hostCard.getController().getOpponent())); + } + + list = list.getValidCards(sIsPresent.split(","), hostCard.getController(), hostCard); + + int right = 1; + String rightString = presentCompare.substring(2); + if(rightString.equals("X")) { + right = CardFactoryUtil.xCount(hostCard, hostCard.getSVar("X")); + } + else { + right = Integer.parseInt(presentCompare.substring(2)); + } + int left = list.size(); + + if (!Card.compare(left, presentCompare, right)) + { + return false; + } + + } + return true; } + public boolean matchesValid(Object o,String[] valids,Card srcCard) { if(o instanceof Card)