From cc658ee7e5994ab4c41839ea1fc05134d0b7955b Mon Sep 17 00:00:00 2001 From: Sloth Date: Thu, 16 Feb 2012 18:03:14 +0000 Subject: [PATCH] - Added Death or Glory. --- .gitattributes | 1 + res/cardsfolder/d/death_or_glory.txt | 13 +++++++++++++ res/cardsfolder/d/do_or_die.txt | 2 +- res/cardsfolder/f/fact_or_fiction.txt | 2 +- res/cardsfolder/s/sphinx_of_uthuun.txt | 2 +- .../abilityfactory/AbilityFactoryChangeZone.java | 6 ++---- .../card/abilityfactory/AbilityFactoryClash.java | 16 +++++++++++----- 7 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 res/cardsfolder/d/death_or_glory.txt diff --git a/.gitattributes b/.gitattributes index d0a4e7beea8..a8203d02425 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1992,6 +1992,7 @@ res/cardsfolder/d/death_grasp.txt svneol=native#text/plain res/cardsfolder/d/death_hood_cobra.txt svneol=native#text/plain res/cardsfolder/d/death_mutation.txt svneol=native#text/plain res/cardsfolder/d/death_of_a_thousand_stings.txt svneol=native#text/plain +res/cardsfolder/d/death_or_glory.txt -text res/cardsfolder/d/death_pit_offering.txt svneol=native#text/plain res/cardsfolder/d/death_pits_of_rath.txt svneol=native#text/plain res/cardsfolder/d/death_pulse.txt svneol=native#text/plain diff --git a/res/cardsfolder/d/death_or_glory.txt b/res/cardsfolder/d/death_or_glory.txt new file mode 100644 index 00000000000..dd3c0540278 --- /dev/null +++ b/res/cardsfolder/d/death_or_glory.txt @@ -0,0 +1,13 @@ +Name:Death or Glory +ManaCost:4 W +Types:Sorcery +Text:no text +A:SP$ TwoPiles | Cost$ 4 W | Defined$ You | Separator$ You | Chooser$ Opponent | ChosenPile$ DBReturn | UnchosenPile$ DBExile | ValidCards$ Creature | Zone$ Graveyard | SpellDescription$ Separate all creature cards in your graveyard into two piles. Exile the pile of an opponent's choice and return the other to the battlefield. +SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Battlefield +SVar:DBExile:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Exile +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/death_or_glory.jpg +SetInfo:INV|Rare|http://magiccards.info/scans/en/in/13.jpg +Oracle:Separate all creature cards in your graveyard into two piles. Exile the pile of an opponent's choice and return the other to the battlefield. +End \ No newline at end of file diff --git a/res/cardsfolder/d/do_or_die.txt b/res/cardsfolder/d/do_or_die.txt index 7f7e7d1874a..1ef0d76f890 100644 --- a/res/cardsfolder/d/do_or_die.txt +++ b/res/cardsfolder/d/do_or_die.txt @@ -2,7 +2,7 @@ Name:Do or Die ManaCost:1 B Types:Sorcery Text:no text -A:SP$ TwoPiles | Cost$ 1 B | ValidTgts$ Player | TgtPrompt$ Select target player | Separator$ You | ChosenPile$ DBDestroy | ValidCards$ Creature | SpellDescription$ Separate all creatures target player controls into two piles. Destroy all creatures in the pile of that player's choice. They can't be regenerated. +A:SP$ TwoPiles | Cost$ 1 B | ValidTgts$ Player | TgtPrompt$ Select target player | Separator$ You | ChosenPile$ DBDestroy | ValidCards$ Creature | Zone$ Battlefield | SpellDescription$ Separate all creatures target player controls into two piles. Destroy all creatures in the pile of that player's choice. They can't be regenerated. SVar:DBDestroy:DB$ Destroy | Defined$ Remembered | NoRegen$ True SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/f/fact_or_fiction.txt b/res/cardsfolder/f/fact_or_fiction.txt index 0687fc29e31..c631d3f0f53 100644 --- a/res/cardsfolder/f/fact_or_fiction.txt +++ b/res/cardsfolder/f/fact_or_fiction.txt @@ -3,7 +3,7 @@ ManaCost:3 U Types:Instant Text:no text A:SP$ Dig | Cost$ 3 U | DigNum$ 5 | Reveal$ True | RememberRevealed$ True | NoMove$ True | SubAbility$ DBTwoPiles | SpellDescription$ Reveal the top five cards of your library. An opponent separates those cards into two piles. Put one pile into your hand and the other into your graveyard. -SVar:DBTwoPiles:DB$ TwoPiles | Defined$ You | DefinedCards$ Remembered | Separator$ Opponent | ChosenPile$ DBHand | ChosenPile$ DBHand | UnchosenPile$ DBGrave +SVar:DBTwoPiles:DB$ TwoPiles | Defined$ You | DefinedCards$ Remembered | Separator$ Opponent | ChosenPile$ DBHand | UnchosenPile$ DBGrave SVar:DBHand:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Hand SVar:DBGrave:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Graveyard SVar:Rarity:Uncommon diff --git a/res/cardsfolder/s/sphinx_of_uthuun.txt b/res/cardsfolder/s/sphinx_of_uthuun.txt index de7a4d593d1..d9ae2af78d6 100644 --- a/res/cardsfolder/s/sphinx_of_uthuun.txt +++ b/res/cardsfolder/s/sphinx_of_uthuun.txt @@ -6,7 +6,7 @@ PT:5/5 K:Flying T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChangeZone | TriggerDescription$ When CARDNAME enters the battlefield, reveal the top five cards of your library. An opponent separates those cards into two piles. Put one pile into your hand and the other into your graveyard. SVar:TrigChangeZone:AB$Dig | Cost$ 0 | DigNum$ 5 | Reveal$ True | RememberRevealed$ True | NoMove$ True | SubAbility$ DBTwoPiles | SpellDescription$ Reveal the top five cards of your library. An opponent separates those cards into two piles. Put one pile into your hand and the other into your graveyard. -SVar:DBTwoPiles:DB$ TwoPiles | Defined$ You | DefinedCards$ Remembered | Separator$ Opponent | ChosenPile$ DBHand | ChosenPile$ DBHand | UnchosenPile$ DBGrave +SVar:DBTwoPiles:DB$ TwoPiles | Defined$ You | DefinedCards$ Remembered | Separator$ Opponent | ChosenPile$ DBHand | UnchosenPile$ DBGrave SVar:DBHand:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Hand SVar:DBGrave:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Graveyard | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryChangeZone.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryChangeZone.java index 338f0525490..da3422f5dc2 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryChangeZone.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryChangeZone.java @@ -1029,7 +1029,7 @@ public final class AbilityFactoryChangeZone { if (params.containsKey("AtRandom")) { c = CardUtil.getRandom(fetchList.toArray()); } else if (defined) { - c = fetchList.get(i); + c = fetchList.get(0); } else if (type.contains("Basic")) { c = AbilityFactoryChangeZone.basicManaFixing(fetchList); } else if (AbilityFactoryChangeZone.areAllBasics(type)) { @@ -1060,9 +1060,7 @@ public final class AbilityFactoryChangeZone { } fetched.add(c); - if (!defined) { - fetchList.remove(c); - } + fetchList.remove(c); } if (origin.contains(Zone.Library) && !defined) { diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java index bf33bf36253..36db8d1517e 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java @@ -620,7 +620,7 @@ public final class AbilityFactoryClash { Constant.Zone zone = null; boolean pile1WasChosen = true; - if (params.containsKey("Origin")) { + if (params.containsKey("Zone")) { zone = Constant.Zone.smartValueOf(params.get("Zone")); } @@ -666,10 +666,11 @@ public final class AbilityFactoryClash { final List l = GuiUtils.getChoicesOptional("Put into pile 1 (multi-select)", pool.toArray()); for (final Card c : l) { pile1.add(c); - pool.remove(c); } for (final Card c : pool) { - pile2.add(c); + if (!pile1.contains(c)) { + pile2.add(c); + } } } else if (size > 0) { //computer separates @@ -736,8 +737,13 @@ public final class AbilityFactoryClash { } } else { - final int cmc1 = CardFactoryUtil.evaluatePermanentList(new CardList(pile1)); - final int cmc2 = CardFactoryUtil.evaluatePermanentList(new CardList(pile2)); + int cmc1 = CardFactoryUtil.evaluatePermanentList(new CardList(pile1)); + int cmc2 = CardFactoryUtil.evaluatePermanentList(new CardList(pile2)); + if (pool.getNotType("Creature").isEmpty()) { + cmc1 = CardFactoryUtil.evaluateCreatureList(new CardList(pile1)); + cmc2 = CardFactoryUtil.evaluateCreatureList(new CardList(pile2)); + System.out.println("value:" + cmc1 + " " + cmc2); + } // for now, this assumes that the outcome will be bad // TODO: This should really have a ChooseLogic param to