diff --git a/.gitattributes b/.gitattributes index 30734ad2976..67268e46a54 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2761,6 +2761,7 @@ res/cardsfolder/lotus_bloom.txt -text svneol=native#text/plain res/cardsfolder/lotus_cobra.txt -text svneol=native#text/plain res/cardsfolder/lotus_guardian.txt -text svneol=native#text/plain res/cardsfolder/lotus_petal.txt -text svneol=native#text/plain +res/cardsfolder/lotus_vale.txt -text svneol=native#text/plain res/cardsfolder/lovisa_coldeyes.txt -text svneol=native#text/plain res/cardsfolder/lowland_giant.txt -text svneol=native#text/plain res/cardsfolder/loxodon_gatekeeper.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/lotus_vale.txt b/res/cardsfolder/lotus_vale.txt new file mode 100644 index 00000000000..31e3baeb128 --- /dev/null +++ b/res/cardsfolder/lotus_vale.txt @@ -0,0 +1,13 @@ +Name:Lotus Vale +ManaCost:no cost +Types:Land +Text:If Lotus Vale would enter the battlefield, sacrifice two untapped lands instead. If you do, put Lotus Vale onto the battlefield. If you don't, put it into its owner's graveyard. +K:tap: add W W W +K:tap: add U U U +K:tap: add B B B +K:tap: add R R R +K:tap: add G G G +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/lotus_vale.jpg +End \ No newline at end of file diff --git a/src/forge/CardFactory_Lands.java b/src/forge/CardFactory_Lands.java index 4b741c2275f..65029239faf 100644 --- a/src/forge/CardFactory_Lands.java +++ b/src/forge/CardFactory_Lands.java @@ -8,7 +8,7 @@ import javax.swing.JOptionPane; class CardFactory_Lands { - public static Card getCard(final Card card, String cardName, Player owner) { + public static Card getCard(final Card card, final String cardName, Player owner) { // computer plays 2 land of these type instead of just 1 per turn @@ -2923,10 +2923,61 @@ class CardFactory_Lands { card.addSpellAbility(ability1); card.addSpellAbility(ability2); }//*************** END ************ END ************************** + + //*************** START *********** START ************************** + else if(cardName.equals("Lotus Vale")) { + /* + * If Lotus Vale would enter the battlefield, sacrifice two untapped + * lands instead. If you do, put Lotus Vale onto the battlefield. + * If you don't, put it into its owner's graveyard. + */ + final Command comesIntoPlay = new Command() { + private static final long serialVersionUID = -194247993330560188L; + + final Player player = card.getController(); + public void execute() { + if(player.isHuman()) { + final int[] paid = {0}; + + Input target = new Input() { + private static final long serialVersionUID = -7835834281866473546L; + public void showMessage() { + AllZone.Display.showMessage(cardName+" - Select an untapped land to sacrifice"); + ButtonUtil.enableOnlyCancel(); + } + public void selectButtonCancel() { + AllZone.GameAction.sacrifice(card); + stop(); + } + public void selectCard(Card c, PlayerZone zone) { + if(c.isLand() && zone.is(Constant.Zone.Play) && c.isUntapped()) { + AllZone.GameAction.sacrifice(c); + if(paid[0] < 1) { + paid[0]++; + AllZone.Display.showMessage(cardName+" - Select an untapped land to sacrifice"); + } + else stop(); + } + }//selectCard() + };//Input + if ((AllZoneUtil.getPlayerLandsInPlay(AllZone.HumanPlayer).filter(AllZoneUtil.untapped).size() < 2)) { + AllZone.GameAction.sacrifice(card); + return; + } + else AllZone.InputControl.setInput(target); + } + else { + //compy can't play this card because it has no mana pool + } + } + }; + + card.addComesIntoPlayCommand(comesIntoPlay); + }//*************** END ************ END ************************** //*************** START *********** START ************************** - if(cardName.equals("Kjeldoran Outpost")) { + else if(cardName.equals("Kjeldoran Outpost")) { final Command comesIntoPlay = new Command() { private static final long serialVersionUID = 6175830918425915833L; final Player player = card.getController();