From ecbba9f1c076c1ab22c89d4f6e616ff4eea09ff1 Mon Sep 17 00:00:00 2001 From: swordshine Date: Tue, 10 Dec 2013 13:10:32 +0000 Subject: [PATCH] - Added Sheltering Ancient --- .gitattributes | 1 + .../res/cardsfolder/s/sheltering_ancient.txt | 9 +++++++++ .../java/forge/game/cost/CostPutCounter.java | 10 ++++++---- .../main/java/forge/game/player/HumanPlay.java | 16 ++++++++++++++-- 4 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 forge-gui/res/cardsfolder/s/sheltering_ancient.txt diff --git a/.gitattributes b/.gitattributes index 4591246766a..4943693f279 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10249,6 +10249,7 @@ forge-gui/res/cardsfolder/s/shell_skulkin.txt svneol=native#text/plain forge-gui/res/cardsfolder/s/shelldock_isle.txt -text forge-gui/res/cardsfolder/s/shelter.txt -text forge-gui/res/cardsfolder/s/sheltered_valley.txt svneol=native#text/plain +forge-gui/res/cardsfolder/s/sheltering_ancient.txt -text forge-gui/res/cardsfolder/s/sheltering_prayers.txt svneol=native#text/plain forge-gui/res/cardsfolder/s/sheltering_word.txt -text forge-gui/res/cardsfolder/s/sheoldred_whispering_one.txt svneol=native#text/plain diff --git a/forge-gui/res/cardsfolder/s/sheltering_ancient.txt b/forge-gui/res/cardsfolder/s/sheltering_ancient.txt new file mode 100644 index 00000000000..569634ea2de --- /dev/null +++ b/forge-gui/res/cardsfolder/s/sheltering_ancient.txt @@ -0,0 +1,9 @@ +Name:Sheltering Ancient +ManaCost:1 G +Types:Creature Treefolk +PT:5/5 +K:Trample +K:Cumulative upkeep:AddCounter<1/P1P1/Creature.OppCtrl/creature an opponent controls>:Put a +1/+1 counter on a creature an opponent controls. +SVar:RemAIDeck:True +SVar:Picture:http://www.wizards.com/global/images/magic/general/sheltering_ancient.jpg +Oracle:Trample\nCumulative upkeep-Put a +1/+1 counter on a creature an opponent controls. (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.) diff --git a/forge-gui/src/main/java/forge/game/cost/CostPutCounter.java b/forge-gui/src/main/java/forge/game/cost/CostPutCounter.java index 04060ca87b9..0cc7a2854fc 100644 --- a/forge-gui/src/main/java/forge/game/cost/CostPutCounter.java +++ b/forge-gui/src/main/java/forge/game/cost/CostPutCounter.java @@ -216,7 +216,7 @@ public class CostPutCounter extends CostPartWithList { } } else { // 3 Cards have Put a -1/-1 Counter on a Creature you control. - final List typeList = CardLists.getValidCards(activator.getCardsIn(ZoneType.Battlefield), this.getType().split(";"), activator, source); + final List typeList = CardLists.getValidCards(activator.getGame().getCardsIn(ZoneType.Battlefield), this.getType().split(";"), activator, source); if (typeList.size() == 0) { return false; @@ -240,7 +240,9 @@ public class CostPutCounter extends CostPartWithList { executePayment(ability, source, c); } else { // Put counter on chosen card - executePayment(ability, decision.cards); + for (int i = 0; i < c; i++) { + executePayment(ability, decision.cards); + } } return true; } @@ -264,7 +266,7 @@ public class CostPutCounter extends CostPartWithList { } else { // Cards to use this branch: Scarscale Ritual, Wandering Mage - each adds only one counter final Player actor = ability.getActivatingPlayer(); - List typeList = CardLists.getValidCards(actor.getCardsIn(ZoneType.Battlefield), getType().split(";"), actor, ability.getSourceCard()); + List typeList = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), getType().split(";"), actor, ability.getSourceCard()); InputSelectCardToPutCounter inp = new InputSelectCardToPutCounter(c, typeList); inp.setMessage("Put %d " + getCounter().getName() + " counter on " + getDescriptiveType()); @@ -332,7 +334,7 @@ public class CostPutCounter extends CostPartWithList { } - final List typeList = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), this.getType().split(";"), ai, source); + final List typeList = CardLists.getValidCards(ai.getGame().getCardsIn(ZoneType.Battlefield), this.getType().split(";"), ai, source); Card card = null; if (this.getType().equals("Creature.YouCtrl")) { diff --git a/forge-gui/src/main/java/forge/game/player/HumanPlay.java b/forge-gui/src/main/java/forge/game/player/HumanPlay.java index e134ca3faf0..f1db9369f46 100644 --- a/forge-gui/src/main/java/forge/game/player/HumanPlay.java +++ b/forge-gui/src/main/java/forge/game/player/HumanPlay.java @@ -415,8 +415,20 @@ public class HumanPlay { } else { List list = p.getGame().getCardsIn(ZoneType.Battlefield); list = CardLists.getValidCards(list, part.getType().split(";"), p, source); - boolean hasPaid = payCostPart(sourceAbility, (CostPartWithList)part, amount, list, "add a counter." + orString); - if (!hasPaid) return false; + if (list.isEmpty()) return false; + if (!GuiDialog.confirm(source, "Do you want to put " + Lang.nounWithAmount(amount, counterType.getName() + " counter") + " on " + part.getTypeDescription() + "?")) + return false; + while (amount > 0) { + InputSelectCards inp = new InputSelectCardsFromList(1, 1, list); + inp.setMessage("Select a card to add a counter"); + inp.setCancelAllowed(true); + Singletons.getControl().getInputQueue().setInputAndWait(inp); + if (inp.hasCancelled()) + continue; + Card selected = inp.getSelected().get(0); + selected.addCounter(counterType, 1, false); + amount--; + } } } else if (part instanceof CostRemoveCounter) {