From f22b20e5122cd65d94135964a8787b3c485b2957 Mon Sep 17 00:00:00 2001 From: swordshine Date: Sun, 7 Apr 2013 00:21:27 +0000 Subject: [PATCH] - Added Giant Slug and Illusionary Presence --- .gitattributes | 2 ++ res/cardsfolder/g/giant_slug.txt | 13 ++++++++++++ res/cardsfolder/i/illusionary_presence.txt | 11 ++++++++++ .../ability/effects/ChooseTypeEffect.java | 21 +++++++++++++++---- .../card/ability/effects/PumpEffect.java | 9 +++++++- .../java/forge/game/phase/CombatUtil.java | 8 +++++++ 6 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 res/cardsfolder/g/giant_slug.txt create mode 100644 res/cardsfolder/i/illusionary_presence.txt diff --git a/.gitattributes b/.gitattributes index 169044bf3d4..1a9b3cbe71a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4144,6 +4144,7 @@ res/cardsfolder/g/giant_mantis.txt svneol=native#text/plain res/cardsfolder/g/giant_octopus.txt svneol=native#text/plain res/cardsfolder/g/giant_scorpion.txt svneol=native#text/plain res/cardsfolder/g/giant_shark.txt svneol=native#text/plain +res/cardsfolder/g/giant_slug.txt -text res/cardsfolder/g/giant_solifuge.txt svneol=native#text/plain res/cardsfolder/g/giant_spider.txt svneol=native#text/plain res/cardsfolder/g/giant_strength.txt svneol=native#text/plain @@ -5154,6 +5155,7 @@ res/cardsfolder/i/illuminated_wings.txt svneol=native#text/plain res/cardsfolder/i/illumination.txt svneol=native#text/plain res/cardsfolder/i/illusion_reality.txt -text res/cardsfolder/i/illusionary_forces.txt svneol=native#text/plain +res/cardsfolder/i/illusionary_presence.txt -text res/cardsfolder/i/illusionary_servant.txt svneol=native#text/plain res/cardsfolder/i/illusionary_wall.txt svneol=native#text/plain res/cardsfolder/i/illusionists_bracers.txt -text diff --git a/res/cardsfolder/g/giant_slug.txt b/res/cardsfolder/g/giant_slug.txt new file mode 100644 index 00000000000..db4b166feaa --- /dev/null +++ b/res/cardsfolder/g/giant_slug.txt @@ -0,0 +1,13 @@ +Name:Giant Slug +ManaCost:1 B +Types:Creature Slug +PT:1/1 +A:AB$ Effect | Cost$ 5 | Duration$ Permanent | Triggers$ ChooseBasicTrig | AILogic$ Always | SVars$ ChooseB,ExileEffect,DBPump | RememberObjects$ Self | SpellDescription$ At the beginning of your next upkeep, choose a basic land type. CARDNAME gains landwalk of the chosen type until the end of that turn. +SVar:ChooseBasicTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Command | Execute$ ChooseB | TriggerDescription$ At the beginning of your next upkeep, choose a basic land type. Giant Slug gains landwalk of the chosen type until the end of that turn. +SVar:ChooseB:AB$ ChooseType | Cost$ 0 | Defined$ You | Type$ Basic Land | AILogic$ ChosenLandwalk | SubAbility$ DBPump +SVar:DBPump:DB$ Pump | Defined$ Remembered | KW$ ChosenTypewalk | DefinedChosenKW$ Type | SubAbility$ ExileEffect +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile +SVar:Picture:http://www.wizards.com/global/images/magic/general/giant_slug.jpg +Oracle:{5}: At the beginning of your next upkeep, choose a basic land type. Giant Slug gains landwalk of the chosen type until the end of that turn. +SetInfo:CHR Common +SetInfo:LEG Common \ No newline at end of file diff --git a/res/cardsfolder/i/illusionary_presence.txt b/res/cardsfolder/i/illusionary_presence.txt new file mode 100644 index 00000000000..8bbabbe3aad --- /dev/null +++ b/res/cardsfolder/i/illusionary_presence.txt @@ -0,0 +1,11 @@ +Name:Illusionary Presence +ManaCost:1 U U +Types:Creature Illusion +PT:2/2 +K:Cumulative upkeep:U +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigCL | TriggerDescription$ At the beginning of your upkeep, choose a land type. CARDNAME gains landwalk of the chosen type until end of turn. +SVar:TrigCL:AB$ ChooseType | Cost$ 0 | Defined$ You | Type$ Land | AILogic$ ChosenLandwalk | SubAbility$ DBPump +SVar:DBPump:DB$ Pump | KW$ ChosenTypewalk | DefinedChosenKW$ Type +SVar:Picture:http://www.wizards.com/global/images/magic/general/illusionary_presence.jpg +Oracle:Cumulative upkeep {U} (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.)\nAt the beginning of your upkeep, choose a land type. Illusionary Presence gains landwalk of the chosen type until end of turn. +SetInfo:ICE Rare \ No newline at end of file diff --git a/src/main/java/forge/card/ability/effects/ChooseTypeEffect.java b/src/main/java/forge/card/ability/effects/ChooseTypeEffect.java index 79def09b27d..dac03234ec8 100644 --- a/src/main/java/forge/card/ability/effects/ChooseTypeEffect.java +++ b/src/main/java/forge/card/ability/effects/ChooseTypeEffect.java @@ -162,6 +162,17 @@ public class ChooseTypeEffect extends SpellAbilityEffect { } } } + } else if (logic.equals("ChosenLandwalk")) { + final List lands = p.getOpponent().getLandsInPlay(); + for (Card c : lands) { + for (String t : c.getType()) { + if (!invalidTypes.contains(t) + && CardType.isABasicLandType(t)) { + chosen = t; + break; + } + } + } } } @@ -192,11 +203,13 @@ public class ChooseTypeEffect extends SpellAbilityEffect { final String logic = sa.getParam("AILogic"); if (logic.equals("ChosenLandwalk")) { final List lands = p.getOpponent().getLandsInPlay(); - final List totallands = CardType.getLandTypes(); for (Card c : lands) { - if (!invalidTypes.contains(c.getName())) { - choice = c.getName(); - break; + for (String t : c.getType()) { + if (!invalidTypes.contains(t) + && CardType.isALandType(t)) { + choice = t; + break; + } } } } diff --git a/src/main/java/forge/card/ability/effects/PumpEffect.java b/src/main/java/forge/card/ability/effects/PumpEffect.java index 66c5b0756b0..f13fb67c5f8 100644 --- a/src/main/java/forge/card/ability/effects/PumpEffect.java +++ b/src/main/java/forge/card/ability/effects/PumpEffect.java @@ -195,7 +195,14 @@ public class PumpEffect extends SpellAbilityEffect { tgtCards = AbilityUtils.getDefinedCards(sa.getSourceCard(), sa.getParam("Defined"), sa); } } - + if (sa.hasParam("DefinedChosenKW")) { + if (sa.getParam("DefinedChosenKW").equals("Type")) { + final String t = sa.getSourceCard().getChosenType(); + for (int i = 0; i < keywords.size(); i++) { + keywords.set(i, keywords.get(i).replaceAll("ChosenType", t)); + } + } + } if (sa.hasParam("RandomKeyword")) { final String num = sa.hasParam("RandomKWNum") ? sa.getParam("RandomKWNum") : "1"; final int numkw = AbilityUtils.calculateAmount(sa.getSourceCard(), num, sa); diff --git a/src/main/java/forge/game/phase/CombatUtil.java b/src/main/java/forge/game/phase/CombatUtil.java index f1e674fe80e..2cbdb922aab 100644 --- a/src/main/java/forge/game/phase/CombatUtil.java +++ b/src/main/java/forge/game/phase/CombatUtil.java @@ -35,6 +35,7 @@ import forge.Command; import forge.Constant; import forge.GameEntity; import forge.Singletons; +import forge.card.CardType; import forge.card.ability.ApiType; import forge.card.cardfactory.CardFactoryUtil; import forge.card.cost.Cost; @@ -269,6 +270,13 @@ public class CombatUtil { walkTypes.add("Land.nonBasic"); } else if (keyword.equals("Snow landwalk")) { walkTypes.add("Land.Snow"); + } else if (keyword.endsWith("walk")) { + final String landtype = keyword.replace("walk", ""); + if (CardType.isALandType(landtype)) { + if (!walkTypes.contains(landtype)) { + walkTypes.add(landtype); + } + } } }