From 018ed31c328f83cb5613cfa80a6771883d0e8897 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 23:05:24 +0000 Subject: [PATCH] name change of AF Reveal -> Dig; add Ancient Stirrings (from Rise of the Eldrazi); tweak a few parameters before documenting. --- .gitattributes | 1 + res/cardsfolder/ancestral_memories.txt | 2 +- res/cardsfolder/ancient_stirrings.txt | 9 +++ res/cardsfolder/impulse.txt | 2 +- res/cardsfolder/lead_the_stampede.txt | 2 +- .../card/abilityFactory/AbilityFactory.java | 8 +-- .../abilityFactory/AbilityFactory_Reveal.java | 71 ++++++++++--------- 7 files changed, 54 insertions(+), 41 deletions(-) create mode 100644 res/cardsfolder/ancient_stirrings.txt diff --git a/.gitattributes b/.gitattributes index 0d331485b0d..3cbcf767075 100644 --- a/.gitattributes +++ b/.gitattributes @@ -280,6 +280,7 @@ res/cardsfolder/ancient_runes.txt -text svneol=native#text/plain res/cardsfolder/ancient_silverback.txt -text svneol=native#text/plain res/cardsfolder/ancient_spider.txt -text svneol=native#text/plain res/cardsfolder/ancient_spring.txt -text svneol=native#text/plain +res/cardsfolder/ancient_stirrings.txt -text svneol=native#text/plain res/cardsfolder/ancient_tomb.txt -text svneol=native#text/plain res/cardsfolder/andradite_leech.txt -text svneol=native#text/plain res/cardsfolder/angel_of_despair.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/ancestral_memories.txt b/res/cardsfolder/ancestral_memories.txt index 572d52bdbf7..273b20ed674 100644 --- a/res/cardsfolder/ancestral_memories.txt +++ b/res/cardsfolder/ancestral_memories.txt @@ -2,7 +2,7 @@ Name:Ancestral Memories ManaCost:2 U U U Types:Sorcery Text:no text -A:SP$Reveal | Cost$ 2 U U U | Reveal$ 7 | ChangeNum$ 2 | DestinationZone2$ Graveyard | SpellDescription$ Look at the top seven cards of your library. Put two of them into your hand and the rest into your graveyard. +A:SP$Dig | Cost$ 2 U U U | DigNum$ 7 | ChangeNum$ 2 | DestinationZone2$ Graveyard | SpellDescription$ Look at the top seven cards of your library. Put two of them into your hand and the rest into your graveyard. SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/ancestral_memories.jpg diff --git a/res/cardsfolder/ancient_stirrings.txt b/res/cardsfolder/ancient_stirrings.txt new file mode 100644 index 00000000000..122b30db011 --- /dev/null +++ b/res/cardsfolder/ancient_stirrings.txt @@ -0,0 +1,9 @@ +Name:Ancient Stirrings +ManaCost:G +Types:Sorcery +Text:no text +A:SP$Dig | Cost$ G | DigNum$ 5 | ChangeNum$ 1 | Optional$ True | ChangeValid$ Card.Colorless | SpellDescription$ Look at the top five cards of your library. You may reveal a colorless card from among them and put it into your hand. Then put the rest on the bottom of your library in any order. (Cards with no colored mana in their mana costs are colorless. Lands are also colorless.) +SVar:RemAIDeck:True +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/ancient_stirrings.jpg +End \ No newline at end of file diff --git a/res/cardsfolder/impulse.txt b/res/cardsfolder/impulse.txt index de2c060bb95..b29515f6bfa 100644 --- a/res/cardsfolder/impulse.txt +++ b/res/cardsfolder/impulse.txt @@ -2,7 +2,7 @@ Name:Impulse ManaCost:1 U Types:Instant Text:no text -A:SP$Reveal | Cost$ 1 U | Reveal$ 4 | ChangeNum$ 1 | SpellDescription$ Look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order. +A:SP$Dig | Cost$ 1 U | DigNum$ 4 | ChangeNum$ 1 | SpellDescription$ Look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order. SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://resources.wizards.com/magic/cards/vi/en-us/card3641.jpg diff --git a/res/cardsfolder/lead_the_stampede.txt b/res/cardsfolder/lead_the_stampede.txt index 0e5a1b0c4ec..10bdf45a215 100644 --- a/res/cardsfolder/lead_the_stampede.txt +++ b/res/cardsfolder/lead_the_stampede.txt @@ -2,7 +2,7 @@ Name:Lead the Stampede ManaCost:2 G Types:Sorcery Text:no text -A:SP$Reveal | Cost$ 2 G | Reveal$ 5 | ChangeType$ Creature | AnyNumber$ True | SpellDescription$ Look at the top five cards of your library. You may reveal any number of creature cards from among them and put the revealed cards into your hand. Put the rest on the bottom of your library in any order. +A:SP$Dig | Cost$ 2 G | DigNum$ 5 | ChangeValid$ Creature | AnyNumber$ True | SpellDescription$ Look at the top five cards of your library. You may reveal any number of creature cards from among them and put the revealed cards into your hand. Put the rest on the bottom of your library in any order. SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/lead_the_stampede.jpg diff --git a/src/forge/card/abilityFactory/AbilityFactory.java b/src/forge/card/abilityFactory/AbilityFactory.java index e12b420733e..61a8ef97afa 100644 --- a/src/forge/card/abilityFactory/AbilityFactory.java +++ b/src/forge/card/abilityFactory/AbilityFactory.java @@ -605,13 +605,13 @@ public class AbilityFactory { SA = AbilityFactory_ZoneAffecting.createDrawbackRevealHand(this); } - if (API.equals("Reveal")){ + if (API.equals("Dig")){ if (isAb) - SA = AbilityFactory_Reveal.createAbilityReveal(this); + SA = AbilityFactory_Reveal.createAbilityDig(this); else if (isSp) - SA = AbilityFactory_Reveal.createSpellReveal(this); + SA = AbilityFactory_Reveal.createSpellDig(this); else if (isDb) - SA = AbilityFactory_Reveal.createDrawbackReveal(this); + SA = AbilityFactory_Reveal.createDrawbackDig(this); } if (SA == null) diff --git a/src/forge/card/abilityFactory/AbilityFactory_Reveal.java b/src/forge/card/abilityFactory/AbilityFactory_Reveal.java index de8f242aaa4..43b135bc488 100644 --- a/src/forge/card/abilityFactory/AbilityFactory_Reveal.java +++ b/src/forge/card/abilityFactory/AbilityFactory_Reveal.java @@ -20,71 +20,71 @@ import forge.gui.GuiUtils; public class AbilityFactory_Reveal { // ************************************************************************* - // ************************* REVEAL **************************************** + // ************************* Dig ******************************************* // ************************************************************************* - public static SpellAbility createAbilityReveal(final AbilityFactory af) { + public static SpellAbility createAbilityDig(final AbilityFactory af) { - final SpellAbility abReveal = new Ability_Activated(af.getHostCard(), af.getAbCost(), af.getAbTgt()) { + final SpellAbility abDig = new Ability_Activated(af.getHostCard(), af.getAbCost(), af.getAbTgt()) { private static final long serialVersionUID = 4239474096624403497L; @Override public String getStackDescription() { - return revealStackDescription(af, this); + return digStackDescription(af, this); } public boolean canPlayAI() { - return revealCanPlayAI(af, this); + return digCanPlayAI(af, this); } @Override public void resolve() { - revealResolve(af, this); + digResolve(af, this); } @Override public boolean doTrigger(boolean mandatory) { - return revealTriggerAI(af, this, mandatory); + return digTriggerAI(af, this, mandatory); } }; - return abReveal; + return abDig; } - public static SpellAbility createSpellReveal(final AbilityFactory af) { - final SpellAbility spReveal = new Spell(af.getHostCard(), af.getAbCost(), af.getAbTgt()) { + public static SpellAbility createSpellDig(final AbilityFactory af) { + final SpellAbility spDig = new Spell(af.getHostCard(), af.getAbCost(), af.getAbTgt()) { private static final long serialVersionUID = 3389143507816474146L; @Override public String getStackDescription() { - return revealStackDescription(af, this); + return digStackDescription(af, this); } public boolean canPlayAI() { - return revealCanPlayAI(af, this); + return digCanPlayAI(af, this); } @Override public void resolve() { - revealResolve(af, this); + digResolve(af, this); } }; - return spReveal; + return spDig; } - public static SpellAbility createDrawbackReveal(final AbilityFactory af) { - final SpellAbility dbReveal = new Ability_Sub(af.getHostCard(), af.getAbTgt()) { + public static SpellAbility createDrawbackDig(final AbilityFactory af) { + final SpellAbility dbDig = new Ability_Sub(af.getHostCard(), af.getAbTgt()) { private static final long serialVersionUID = -3372788479421357024L; @Override public String getStackDescription(){ - return revealStackDescription(af, this); + return digStackDescription(af, this); } @Override public void resolve() { - revealResolve(af, this); + digResolve(af, this); } @Override @@ -94,18 +94,18 @@ public class AbilityFactory_Reveal { @Override public boolean doTrigger(boolean mandatory) { - return revealTriggerAI(af, this, mandatory); + return digTriggerAI(af, this, mandatory); } }; - return dbReveal; + return dbDig; } - private static String revealStackDescription(AbilityFactory af, SpellAbility sa) { + private static String digStackDescription(AbilityFactory af, SpellAbility sa) { HashMap params = af.getMapParams(); Card host = af.getHostCard(); StringBuilder sb = new StringBuilder(); - int numToReveal = AbilityFactory.calculateAmount(af.getHostCard(), params.get("Reveal"), sa); + int numToDig = AbilityFactory.calculateAmount(af.getHostCard(), params.get("DigNum"), sa); if (!(sa instanceof Ability_Sub)) sb.append(sa.getSourceCard()).append(" - "); @@ -124,8 +124,10 @@ public class AbilityFactory_Reveal { //TODO - need to update if human targets computer for looking - sb.append(host.getController()).append(" looks at the top ").append(numToReveal); - sb.append(" card of his or her library."); + sb.append(host.getController()).append(" looks at the top ").append(numToDig); + sb.append(" card"); + if(numToDig != 1) sb.append("s"); + sb.append(" of his or her library."); Ability_Sub abSub = sa.getSubAbility(); if (abSub != null) { @@ -135,7 +137,7 @@ public class AbilityFactory_Reveal { return sb.toString(); } - private static boolean revealCanPlayAI(final AbilityFactory af, final SpellAbility sa) { + private static boolean digCanPlayAI(final AbilityFactory af, final SpellAbility sa) { return false; /* if (!ComputerUtil.canPayCost(sa)) @@ -158,7 +160,7 @@ public class AbilityFactory_Reveal { */ } - private static boolean revealTriggerAI(final AbilityFactory af, final SpellAbility sa, boolean mandatory) { + private static boolean digTriggerAI(final AbilityFactory af, final SpellAbility sa, boolean mandatory) { if (!ComputerUtil.canPayCost(sa)) return false; @@ -178,16 +180,17 @@ public class AbilityFactory_Reveal { return true; } - private static void revealResolve(final AbilityFactory af, final SpellAbility sa) { + private static void digResolve(final AbilityFactory af, final SpellAbility sa) { HashMap params = af.getMapParams(); Card host = af.getHostCard(); - int numToReveal = AbilityFactory.calculateAmount(af.getHostCard(), params.get("Reveal"), sa); + int numToDig = AbilityFactory.calculateAmount(af.getHostCard(), params.get("DigNum"), sa); String destZone1 = params.containsKey("DestinationZone") ? params.get("DestinationZone") : "Hand"; int destZone1ChangeNum = params.containsKey("ChangeNum") ? Integer.parseInt(params.get("ChangeNum")) : 1; - String changeValid = params.containsKey("ChangeType") ? params.get("ChangeType") : ""; + String changeValid = params.containsKey("ChangeValid") ? params.get("ChangeValid") : ""; boolean anyNumber = params.containsKey("AnyNumber"); String destZone2 = params.containsKey("DestinationZone2") ? params.get("DestinationZone2") : "Library"; int libraryPosition = params.containsKey("LibraryPosition") ? Integer.parseInt(params.get("LibraryPosition")) : -1; + boolean optional = params.containsKey("Optional"); ArrayList tgtPlayers; @@ -205,14 +208,14 @@ public class AbilityFactory_Reveal { CardList rest = new CardList(); PlayerZone library = AllZone.getZone(Constant.Zone.Library, p); - numToReveal = Math.min(numToReveal, library.size()); - for(int i = 0; i < numToReveal; i++) { + numToDig = Math.min(numToDig, library.size()); + for(int i = 0; i < numToDig; i++) { top.add(library.get(i)); } if(top.size() > 0) { //show the user the revealed cards - GuiUtils.getChoice("Revealed cards from library", top.toArray()); + GuiUtils.getChoice("Looking at cards from library", top.toArray()); if(!changeValid.equals("")) { valid = top.getValidCards(changeValid.split(","), host.getController(), host); @@ -225,10 +228,10 @@ public class AbilityFactory_Reveal { } int j = 0; - while(j < destZone1ChangeNum || (anyNumber && j < numToReveal)) { + while(j < destZone1ChangeNum || (anyNumber && j < numToDig)) { //let user get choice Card chosen = null; - if(anyNumber) { + if(anyNumber || optional) { chosen = GuiUtils.getChoiceOptional("Choose a card to put into "+destZone1, valid.toArray()); } else {