diff --git a/.gitattributes b/.gitattributes index 99c505b2dd0..ce1828b5a33 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4364,6 +4364,7 @@ res/cardsfolder/shattering_pulse.txt -text svneol=native#text/plain res/cardsfolder/shatterskull_giant.txt -text svneol=native#text/plain res/cardsfolder/shatterstorm.txt -text svneol=native#text/plain res/cardsfolder/shaukus_minion.txt -text svneol=native#text/plain +res/cardsfolder/sheltered_valley.txt -text svneol=native#text/plain res/cardsfolder/shepherd_of_the_lost.txt -text svneol=native#text/plain res/cardsfolder/shield_mate.txt -text svneol=native#text/plain res/cardsfolder/shield_of_duty_and_reason.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/sheltered_valley.txt b/res/cardsfolder/sheltered_valley.txt new file mode 100644 index 00000000000..69ef118df60 --- /dev/null +++ b/res/cardsfolder/sheltered_valley.txt @@ -0,0 +1,8 @@ +Name:Sheltered Valley +ManaCost:no cost +Types:Land +Text:If CARDNAME would enter the battlefield, instead sacrifice each other permanent named CARDNAME you control, then put CARDNAME onto the battlefield.\r\nAt the beginning of your upkeep, if you control three or fewer lands, you gain 1 life. +K:tap: add 1 +SVar:Rarity:Rare +SVar:Picture:http://wizards.com/global/images/magic/general/sheltered_valley.jpg +End \ No newline at end of file diff --git a/src/forge/CardFactory_Lands.java b/src/forge/CardFactory_Lands.java index a063a11e2dc..5187362e71a 100644 --- a/src/forge/CardFactory_Lands.java +++ b/src/forge/CardFactory_Lands.java @@ -1868,6 +1868,27 @@ class CardFactory_Lands { }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Sheltered Valley")) { + + final Command comesIntoPlay = new Command() { + private static final long serialVersionUID = 685604326470832887L; + + public void execute() { + final Player player = card.getController(); + CardList land = AllZoneUtil.getPlayerCardsInPlay(player, "Sheltered Valley"); + land.remove(card); + + if( land.size() > 0 ) { + for(Card c:land) AllZone.GameAction.sacrifice(c); + } + } + }; + + card.addComesIntoPlayCommand(comesIntoPlay); + }//*************** END ************ END ************************** + + //*************** START *********** START ************************** else if(cardName.equals("Scorched Ruins")) { final Command comesIntoPlay = new Command() { diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 79d330e16c6..5e8ec071c42 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -48,6 +48,7 @@ public class GameActionUtil { upkeep_Honden_of_Infinite_Rage(); upkeep_Vensers_Journal(); upkeep_Dega_Sanctuary(); + upkeep_Sheltered_Valley(); upkeep_Land_Tax(); upkeep_Tangle_Wire(); upkeep_Mana_Vault(); @@ -9580,6 +9581,31 @@ public class GameActionUtil { AllZone.Stack.add(ability); }//for }//upkeep_Dega_Sanctuary() + + private static void upkeep_Sheltered_Valley() { + final Player player = AllZone.Phase.getPlayerTurn(); + + CardList list = AllZoneUtil.getPlayerCardsInPlay(player, "Sheltered Valley"); + + for(Card valley:list) { + final Card source = valley; + final Ability ability = new Ability(source, "0") { + public void resolve() { + CardList play = AllZoneUtil.getPlayerLandsInPlay(player); + if(play.size() <= 3) { + player.gainLife(1, source); + } + } + };//Ability + + StringBuilder sb = new StringBuilder(); + sb.append(source.getName()).append(" - "); + sb.append("if you control three or fewer lands, you gain 1 life."); + ability.setStackDescription(sb.toString()); + + AllZone.Stack.add(ability); + }//for + }//upkeep_Sheltered_Valley() private static void upkeep_The_Rack() { final Player player = AllZone.Phase.getPlayerTurn();