From 48b689f94a6e1e0cea20fbb0ac1290169e6d624b Mon Sep 17 00:00:00 2001 From: swordshine Date: Sun, 5 May 2013 04:46:59 +0000 Subject: [PATCH] - Added Deep Spawn --- .gitattributes | 1 + res/cardsfolder/d/deep_spawn.txt | 15 +++++++++++++++ src/main/java/forge/game/GameActionUtil.java | 11 +++++++++++ 3 files changed, 27 insertions(+) create mode 100644 res/cardsfolder/d/deep_spawn.txt diff --git a/.gitattributes b/.gitattributes index 07bf62500b9..b95fd071989 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2518,6 +2518,7 @@ res/cardsfolder/d/deep_reconnaissance.txt svneol=native#text/plain res/cardsfolder/d/deep_sea_kraken.txt svneol=native#text/plain res/cardsfolder/d/deep_sea_serpent.txt svneol=native#text/plain res/cardsfolder/d/deep_slumber_titan.txt svneol=native#text/plain +res/cardsfolder/d/deep_spawn.txt -text res/cardsfolder/d/deep_wood.txt -text res/cardsfolder/d/deepcavern_imp.txt -text res/cardsfolder/d/deepchannel_mentor.txt svneol=native#text/plain diff --git a/res/cardsfolder/d/deep_spawn.txt b/res/cardsfolder/d/deep_spawn.txt new file mode 100644 index 00000000000..afa8daeb46f --- /dev/null +++ b/res/cardsfolder/d/deep_spawn.txt @@ -0,0 +1,15 @@ +Name:Deep Spawn +ManaCost:5 U U U +Types:Creature Homarid +Text:no text +PT:6/6 +K:Trample +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigSac | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, sacrifice CARDNAME unless you put the top two cards of your library into your graveyard. +SVar:TrigSac:AB$ Sacrifice | Cost$ 0 | Defined$ Self | UnlessCost$ Mill<2> | UnlessPayer$ You +A:AB$ Pump | Cost$ U | KW$ Shroud | SubAbility$ DBPump | SpellDescription$ CARDNAME gains shroud until end of turn and doesn't untap during your next untap step. Tap CARDNAME. (A permanent with shroud can't be the target of spells or abilities.) +SVar:DBPump:DB$ Pump | KW$ HIDDEN This card doesn't untap during your next untap step. | Permanent$ True | SubAbility$ DBTap +SVar:DBTap:DB$ Tap | Defined$ Self +SVar:RemAIDeck:True +SVar:Picture:http://www.wizards.com/global/images/magic/general/deep_spawn.jpg +Oracle:Trample\nAt the beginning of your upkeep, sacrifice Deep Spawn unless you put the top two cards of your library into your graveyard.\n{U}: Deep Spawn gains shroud until end of turn and doesn't untap during your next untap step. Tap Deep Spawn. (A permanent with shroud can't be the target of spells or abilities.) +SetInfo:FEM Uncommon \ No newline at end of file diff --git a/src/main/java/forge/game/GameActionUtil.java b/src/main/java/forge/game/GameActionUtil.java index 7c5993e5e54..c0a85cac129 100644 --- a/src/main/java/forge/game/GameActionUtil.java +++ b/src/main/java/forge/game/GameActionUtil.java @@ -46,6 +46,7 @@ import forge.card.cost.Cost; import forge.card.cost.CostDamage; import forge.card.cost.CostDiscard; import forge.card.cost.CostExile; +import forge.card.cost.CostMill; import forge.card.cost.CostPart; import forge.card.cost.CostPartMana; import forge.card.cost.CostPartWithList; @@ -448,6 +449,16 @@ public final class GameActionUtil { p.payLife(amount, null); } + else if (part instanceof CostMill) { + final int amount = getAmountFromPart(part, source, sourceAbility); + final List list = p.getCardsIn(ZoneType.Library); + if (list.size() < amount) return false; + if (!GuiDialog.confirm(source, "Do you want to mill " + amount + " card(s)?" + orString)) + return false; + List listmill = p.getCardsIn(ZoneType.Library, amount); + ((CostMill) part).executePayment(sourceAbility, listmill); + } + else if (part instanceof CostDamage) { int amount = getAmountFromPartX(part, source, sourceAbility); if (!p.canPayLife(amount))