diff --git a/.gitattributes b/.gitattributes index 96c3cdb3d46..1464a52e457 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3367,6 +3367,7 @@ res/cardsfolder/salt_marsh.txt -text svneol=native#text/plain res/cardsfolder/saltblast.txt -text svneol=native#text/plain res/cardsfolder/salvage.txt -text svneol=native#text/plain res/cardsfolder/samurai_enforcers.txt -text svneol=native#text/plain +res/cardsfolder/sanctum_gargoyle.txt -text svneol=native#text/plain res/cardsfolder/sanctum_plowbeast.txt -text svneol=native#text/plain res/cardsfolder/sandbar_merfolk.txt -text svneol=native#text/plain res/cardsfolder/sandbar_serpent.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/sanctum_gargoyle.txt b/res/cardsfolder/sanctum_gargoyle.txt new file mode 100644 index 00000000000..c6945210c8d --- /dev/null +++ b/res/cardsfolder/sanctum_gargoyle.txt @@ -0,0 +1,9 @@ +Name:Sanctum Gargoyle +ManaCost:3 W +Types:Artifact Creature Gargoyle +Text:When Sanctum Gargoyle enters the battlefield, you may return target artifact card from your graveyard to your hand. +PT:2/3 +K:Flying +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/sanctum_gargoyle.jpg +End diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 2d196270243..816d0e16716 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -20307,6 +20307,56 @@ public class CardFactory_Creatures { //ability.setBeforePayMana(runtime); }//*************** END ************ END ************************** + //*************** START *********** START ************************ + if(cardName.equals("Sanctum Gargoyle")) { + final SpellAbility ability = new Ability(card, "0") { + + @Override + public void chooseTargetAI() { + CardList grave = getGraveArts(); + Card target = CardFactoryUtil.AI_getBestArtifact(grave); + setTargetCard(target); + } + + @Override + public void resolve() { + if(card.getController().equals(Constant.Player.Human)) { + Card c = AllZone.Display.getChoice("Select card", getGraveArts().toArray()); + setTargetCard(c); + } + + Card target = getTargetCard(); + + PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); + if(AllZone.GameAction.isCardInZone(target, grave) + && CardFactoryUtil.canTarget(card, target)) + AllZone.GameAction.moveToHand(target); + }//resolve() + + CardList getGraveArts() { + CardList list = AllZoneUtil.getPlayerGraveyard(card.getController()); + return list.filter(AllZoneUtil.artifacts); + } + };//SpellAbility + + final Command cip = new Command() { + private static final long serialVersionUID = -8905934905046258175L; + + CardList getGraveArts() { + CardList list = AllZoneUtil.getPlayerGraveyard(card.getController()); + return list.filter(AllZoneUtil.artifacts); + } + + public void execute() { + if(getGraveArts().size() > 0) + AllZone.Stack.add(ability); + } + }; + + ability.setStackDescription(cardName + " - return target artifact from your graveyard to your hand."); + card.addComesIntoPlayCommand(cip); + }//*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found