From 5347bbe62528d4dcb1dc80f1203ccce0e47002b2 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Fri, 27 Jan 2012 03:20:09 +0000 Subject: [PATCH] extended RememberReveal to work with all the possible reveal conditions. Fixed Brutal/Callous/Feral Deceiver scripts. --- res/cardsfolder/b/brutal_deceiver.txt | 7 ++++--- res/cardsfolder/c/callous_deceiver.txt | 7 ++++--- res/cardsfolder/f/feral_deceiver.txt | 7 ++++--- .../abilityfactory/AbilityFactoryReveal.java | 20 ++++++++++++++----- 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/res/cardsfolder/b/brutal_deceiver.txt b/res/cardsfolder/b/brutal_deceiver.txt index 44051457d0a..2e647ee55ad 100644 --- a/res/cardsfolder/b/brutal_deceiver.txt +++ b/res/cardsfolder/b/brutal_deceiver.txt @@ -3,9 +3,10 @@ ManaCost:2 R Types:Creature Spirit Text:no text PT:2/2 -A:AB$ Dig | Cost$ 1 | DigNum$ 1 | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | SpellDescription$ Look at the top card of your library. -A:AB$ Dig | Cost$ 2 | DigNum$ 1 | ActivationLimit$ 1 | Reveal$ True | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | ChangeNum$ All | ChangeValid$ Land | SubAbility$ TrigPump | SpellDescription$ Reveal the top card of your library. If it's a land card, CARDNAME gets +1/+0 and gains first strike until end of turn. Activate this ability only once each turn. -SVar:TrigPump:DB$ Pump | Cost$ 0 | Defined$ Self | NumAtt$ 1 | KW$ First Strike +A:AB$ Dig | Cost$ 1 | DigNum$ 1 | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | NoMove$ True | SpellDescription$ Look at the top card of your library. +A:AB$ Dig | Cost$ 2 | DigNum$ 1 | ActivationLimit$ 1 | Reveal$ True | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | NoMove$ True | RememberRevealed$ True | SubAbility$ TrigPump | SpellDescription$ Reveal the top card of your library. If it's a land card, CARDNAME gets +1/+0 and gains first strike until end of turn. Activate this ability only once each turn. +SVar:TrigPump:DB$ Pump | Cost$ 0 | Defined$ Self | NumAtt$ 1 | KW$ First Strike | ConditionDefined$ Remembered | ConditionPresent$ Card.Land | ConditionCompare$ GE1 | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/brutal_deceiver.jpg SetInfo:CHK|Common|http://magiccards.info/scans/en/chk/161.jpg diff --git a/res/cardsfolder/c/callous_deceiver.txt b/res/cardsfolder/c/callous_deceiver.txt index 801f85c811b..7a254e36ee2 100644 --- a/res/cardsfolder/c/callous_deceiver.txt +++ b/res/cardsfolder/c/callous_deceiver.txt @@ -3,9 +3,10 @@ ManaCost:2 U Types:Creature Spirit Text:no text PT:1/3 -A:AB$ Dig | Cost$ 1 | DigNum$ 1 | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | SpellDescription$ Look at the top card of your library. -A:AB$ Dig | Cost$ 2 | DigNum$ 1 | ActivationLimit$ 1 | Reveal$ True | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | ChangeNum$ All | ChangeValid$ Land | SubAbility$ TrigPump | SpellDescription$ Reveal the top card of your library. If it's a land card, CARDNAME gets +1/+0 and gains flying until end of turn. Activate this ability only once each turn. -SVar:TrigPump:DB$ Pump | Cost$ 0 | Defined$ Self | NumAtt$ 1 | KW$ Flying +A:AB$ Dig | Cost$ 1 | DigNum$ 1 | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | NoMove$ True | SpellDescription$ Look at the top card of your library. +A:AB$ Dig | Cost$ 2 | DigNum$ 1 | ActivationLimit$ 1 | Reveal$ True | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | NoMove$ True | RememberRevealed$ True | SubAbility$ TrigPump | SpellDescription$ Reveal the top card of your library. If it's a land card, CARDNAME gets +1/+0 and gains flying until end of turn. Activate this ability only once each turn. +SVar:TrigPump:DB$ Pump | Cost$ 0 | Defined$ Self | NumAtt$ 1 | KW$ Flying | ConditionDefined$ Remembered | ConditionPresent$ Card.Land | ConditionCompare$ GE1 | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/callous_deceiver.jpg SetInfo:CHK|Common|http://magiccards.info/scans/en/chk/53.jpg diff --git a/res/cardsfolder/f/feral_deceiver.txt b/res/cardsfolder/f/feral_deceiver.txt index 4b199d19067..cd970c233ca 100644 --- a/res/cardsfolder/f/feral_deceiver.txt +++ b/res/cardsfolder/f/feral_deceiver.txt @@ -3,9 +3,10 @@ ManaCost:3 G Types:Creature Spirit Text:no text PT:3/2 -A:AB$ Dig | Cost$ 1 | DigNum$ 1 | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | SpellDescription$ Look at the top card of your library. -A:AB$ Dig | Cost$ 2 | DigNum$ 1 | ActivationLimit$ 1 | Reveal$ True | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | ChangeNum$ All | ChangeValid$ Land | SubAbility$ TrigPump | SpellDescription$ Reveal the top card of your library. If it's a land card, CARDNAME gets +2/+2 and gains trample until end of turn. Activate this ability only once each turn. -SVar:TrigPump:DB$ Pump | Cost$ 0 | Defined$ Self | NumAtt$ 2 | NumDef$ 2 | KW$ Trample +A:AB$ Dig | Cost$ 1 | DigNum$ 1 | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | NoMove$ True | SpellDescription$ Look at the top card of your library. +A:AB$ Dig | Cost$ 2 | DigNum$ 1 | ActivationLimit$ 1 | Reveal$ True | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | NoMove$ True | RememberRevealed$ True | SubAbility$ TrigPump | SpellDescription$ Reveal the top card of your library. If it's a land card, CARDNAME gets +2/+2 and gains trample until end of turn. Activate this ability only once each turn. +SVar:TrigPump:DB$ Pump | Cost$ 0 | Defined$ Self | NumAtt$ 2 | NumDef$ 2 | KW$ Trample | ConditionDefined$ Remembered | ConditionPresent$ Card.Land | ConditionCompare$ GE1 | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/feral_deceiver.jpg SetInfo:CHK|Common|http://magiccards.info/scans/en/chk/208.jpg diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java index 4fceac2353a..b0370e18dec 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java @@ -393,9 +393,11 @@ public final class AbilityFactoryReveal { if (top.size() > 0) { final Card dummy = new Card(); dummy.setName("[No valid cards]"); + boolean cardsRevealed = false; if (params.containsKey("Reveal")) { GuiUtils.getChoice("Revealing cards from library", top.toArray()); + cardsRevealed = true; // AllZone.getGameAction().revealToCopmuter(top.toArray()); // - for when it exists } else if (params.containsKey("RevealOptional")) { @@ -406,23 +408,31 @@ public final class AbilityFactoryReveal { if (p.isHuman() && GameActionUtil.showYesNoDialog(host, question)) { GuiUtils.getChoice("Revealing cards from library", top.toArray()); // AllZone.getGameAction().revealToCopmuter(top.toArray()); - if (params.containsKey("RememberRevealed")) { - for (final Card one : top) { - host.addRemembered(one); - } - } + cardsRevealed = true; } } else if (params.containsKey("RevealValid")) { final String revealValid = params.get("RevealValid"); final CardList toReveal = top.getValidCards(revealValid, host.getController(), host); if (!toReveal.isEmpty()) { GuiUtils.getChoice("Revealing cards from library", toReveal.toArray()); + if (params.containsKey("RememberRevealed")) { + for (final Card one : toReveal) { + host.addRemembered(one); + } + } } // AllZone.getGameAction().revealToCopmuter(top.toArray()); // - for when it exists } else if (choser.isHuman()) { // show the user the revealed cards GuiUtils.getChoice("Looking at cards from library", top.toArray()); + cardsRevealed = true; + } + + if ((params.containsKey("RememberRevealed")) && cardsRevealed) { + for (final Card one : top) { + host.addRemembered(one); + } } if (!noMove) {