diff --git a/.gitattributes b/.gitattributes index 9444c3dcf21..cbe933118fa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11258,6 +11258,7 @@ res/cardsfolder/t/traumatic_visions.txt svneol=native#text/plain res/cardsfolder/t/traumatize.txt svneol=native#text/plain res/cardsfolder/t/travel_preparations.txt -text res/cardsfolder/t/travelers_amulet.txt -text +res/cardsfolder/t/travelers_cloak.txt -text res/cardsfolder/t/treacherous_link.txt svneol=native#text/plain res/cardsfolder/t/treacherous_pit_dweller.txt -text res/cardsfolder/t/treacherous_urge.txt svneol=native#text/plain diff --git a/res/cardsfolder/t/travelers_cloak.txt b/res/cardsfolder/t/travelers_cloak.txt new file mode 100644 index 00000000000..15344e8936e --- /dev/null +++ b/res/cardsfolder/t/travelers_cloak.txt @@ -0,0 +1,12 @@ +Name:Traveler's Cloak +ManaCost:2 U +Types:Enchantment Aura +K:Enchant creature +A:SP$ Attach | Cost$ 2 U | ValidTgts$ Creature | AILogic$ Pump +K:ETBReplacement:Other:ChooseLT +SVar:ChooseLT:DB$ ChooseType | Defined$ You | Type$ Land | AILogic$ ChosenLandwalk | SpellDescription$ As CARDNAME enters the battlefield, choose a land type. +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDraw | TriggerDescription$ When CARDNAME enters the battlefield, draw a card. +SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 +S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ ChosenTypewalk | Description$ Enchanted creature has landwalk of the chosen type. +SVar:Picture:http://www.wizards.com/global/images/magic/general/travelers_cloak.jpg +SetInfo:INV Common \ 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 59c7c6bfb65..79def09b27d 100644 --- a/src/main/java/forge/card/ability/effects/ChooseTypeEffect.java +++ b/src/main/java/forge/card/ability/effects/ChooseTypeEffect.java @@ -186,10 +186,22 @@ public class ChooseTypeEffect extends SpellAbilityEffect { valid = true; card.setChosenType(choice); } - } else { - // TODO - // computer will need to choose a type - card.setChosenType("Island"); + } else {//AI + String choice = null; + if (sa.hasParam("AILogic")) { + 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; + } + } + } + } + card.setChosenType(choice != null ? choice :"Island"); valid = true; } }