From d20c830c02ac636cfcb5eb3ba00bfba56e9ddd21 Mon Sep 17 00:00:00 2001 From: Sloth Date: Sat, 1 Oct 2011 06:46:35 +0000 Subject: [PATCH] - Added the properties "TopGraveyardCreature" and "TopGraveyard" to hasProperty. - Added Shallow Grave. --- .gitattributes | 1 + res/cardsfolder/r/rakalite.txt | 22 ++++++++++++---------- res/cardsfolder/s/shallow_grave.txt | 12 ++++++++++++ src/main/java/forge/Card.java | 11 +++++++++++ 4 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 res/cardsfolder/s/shallow_grave.txt diff --git a/.gitattributes b/.gitattributes index 5a0ff69889c..78fc2cfdd77 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6890,6 +6890,7 @@ res/cardsfolder/s/shadowmage_infiltrator.txt svneol=native#text/plain res/cardsfolder/s/shadowstorm.txt svneol=native#text/plain res/cardsfolder/s/shaleskin_bruiser.txt svneol=native#text/plain res/cardsfolder/s/shaleskin_plower.txt svneol=native#text/plain +res/cardsfolder/s/shallow_grave.txt -text res/cardsfolder/s/shambling_remains.txt svneol=native#text/plain res/cardsfolder/s/shambling_shell.txt svneol=native#text/plain res/cardsfolder/s/shambling_strider.txt svneol=native#text/plain diff --git a/res/cardsfolder/r/rakalite.txt b/res/cardsfolder/r/rakalite.txt index c3f3d0d3e0b..8ea6235650a 100644 --- a/res/cardsfolder/r/rakalite.txt +++ b/res/cardsfolder/r/rakalite.txt @@ -1,11 +1,13 @@ -Name:Rakalite -ManaCost:6 -Types:Artifact -Text:no text -A:AB$ PreventDamage | Cost$ 2 | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | Amount$ 1 | SubAbility$ SVar=DBReturn | SpellDescription$ Prevent the next 1 damage that would be dealt to target creature or player this turn. Return CARDNAME to its owner's hand at the beginning of the next end step. -SVar:DBReturn:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigBounce | TriggerDescription$ Return CARDNAME to its owner's hand. -SVar:TrigBounce:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Hand -SVar:RemAIDeck:True -SVar:Rarity:Uncommon -SVar:Picture:http://www.wizards.com/global/images/magic/general/rakalite.jpg +Name:Rakalite +ManaCost:6 +Types:Artifact +Text:no text +A:AB$ PreventDamage | Cost$ 2 | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | Amount$ 1 | SubAbility$ SVar=DBReturn | SpellDescription$ Prevent the next 1 damage that would be dealt to target creature or player this turn. Return CARDNAME to its owner's hand at the beginning of the next end step. +SVar:DBReturn:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigBounce | TriggerDescription$ Return CARDNAME to its owner's hand. +SVar:TrigBounce:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Hand +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/rakalite.jpg +SetInfo:ATQ|Uncommon|http://magiccards.info/scans/en/aq/27.jpg +Oracle:{2}: Prevent the next 1 damage that would be dealt to target creature or player this turn. Return Rakalite to its owner's hand at the beginning of the next end step. End \ No newline at end of file diff --git a/res/cardsfolder/s/shallow_grave.txt b/res/cardsfolder/s/shallow_grave.txt new file mode 100644 index 00000000000..caf499ab20d --- /dev/null +++ b/res/cardsfolder/s/shallow_grave.txt @@ -0,0 +1,12 @@ +Name:Shallow Grave +ManaCost:1 B +Types:Instant +Text:no text +A:SP$ ChangeZone | Cost$ 1 B | Origin$ Graveyard | Destination$ Battlefield | ChangeType$ Creature.TopGraveyardCreature+YouCtrl | Hidden$ True | Mandatory$ True | RememberChanged$ True | SubAbility$ DBPump | SpellDescription$ Return the top creature card of your graveyard to the battlefield. That creature gains haste until end of turn. Exile it at the beginning of the next end step. +SVar:DBPump:DB$ Pump | Defined$ Remembered | KW$ Haste & HIDDEN At the beginning of the end step, exile CARDNAME. | SubAbility$ DBCleanup +SVar:DBCleanup:DB$Cleanup | ClearRemembered$ True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/shallow_grave.jpg +SetInfo:MIR|Rare|http://magiccards.info/scans/en/mr/39.jpg +Oracle:Return the top creature card of your graveyard to the battlefield. That creature gains haste until end of turn. Exile it at the beginning of the next end step. +End \ No newline at end of file diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 8370f44f958..827c68b98e5 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -5051,6 +5051,17 @@ public class Card extends GameEntity implements Comparable { CardList list = this.getOwner().getCardsIn(Zone.Graveyard); if (!list.getDirectlyAbove(source, this)) return false; + }else if (Property.startsWith("TopGraveyardCreature")){ + CardList list = this.getOwner().getCardsIn(Zone.Graveyard); + list = list.getType("Creature"); + list.reverse(); + if (list.isEmpty() || !this.equals(list.get(0))) + return false; + }else if (Property.startsWith("TopGraveyard")){ + CardList list = this.getOwner().getCardsIn(Zone.Graveyard); + list.reverse(); + if (list.isEmpty() || !this.equals(list.get(0))) + return false; } else if (Property.startsWith("Cloned")) { if (cloneOrigin == null || !cloneOrigin.equals(source)) return false; } else if (Property.startsWith("DamagedBy")) {