From 62965ae94095531dbbe5328eecebefc7ce445e5c Mon Sep 17 00:00:00 2001 From: Sloth Date: Thu, 8 Dec 2011 20:52:38 +0000 Subject: [PATCH] - Added the variable "EnchantedController" to isValid in the player class. - Added Brand of Ill Omen by Jeff. --- .gitattributes | 1 + res/cardsfolder/b/brand_of_ill_omen.txt | 13 +++++++++++++ src/main/java/forge/Player.java | 26 +++++++++++++++++++++---- 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 res/cardsfolder/b/brand_of_ill_omen.txt diff --git a/.gitattributes b/.gitattributes index 334537dc70a..5ba1ee2d6c5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1004,6 +1004,7 @@ res/cardsfolder/b/bramblesnap.txt svneol=native#text/plain res/cardsfolder/b/bramblewood_paragon.txt svneol=native#text/plain res/cardsfolder/b/branching_bolt.txt svneol=native#text/plain res/cardsfolder/b/branchsnap_lorian.txt svneol=native#text/plain +res/cardsfolder/b/brand_of_ill_omen.txt -text res/cardsfolder/b/branded_brawlers.txt svneol=native#text/plain res/cardsfolder/b/brass_gnat.txt svneol=native#text/plain res/cardsfolder/b/brass_herald.txt svneol=native#text/plain diff --git a/res/cardsfolder/b/brand_of_ill_omen.txt b/res/cardsfolder/b/brand_of_ill_omen.txt new file mode 100644 index 00000000000..aa3f8b40fa7 --- /dev/null +++ b/res/cardsfolder/b/brand_of_ill_omen.txt @@ -0,0 +1,13 @@ +Name:Brand of Ill Omen +ManaCost:3 R +Types:Enchantment Aura +Text:no text +K:Cumulative upkeep:R +A:SP$ Attach | Cost$ 3 R | ValidTgts$ Creature | AILogic$ Curse +S:Mode$ CantBeCast | ValidCard$ Creature | Caster$ EnchantedController | Description$ Enchanted creature's controller can't cast creature spells. +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/brand_of_ill_omen.jpg +SetInfo:ICE|Rare|http://magiccards.info/scans/en/ia/177.jpg +Oracle:Enchant creature\nCumulative upkeep {R} (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.)\nEnchanted creature's controller can't cast creature spells. +End \ No newline at end of file diff --git a/src/main/java/forge/Player.java b/src/main/java/forge/Player.java index 3822156a1d2..d2e72306a45 100644 --- a/src/main/java/forge/Player.java +++ b/src/main/java/forge/Player.java @@ -2219,10 +2219,28 @@ public abstract class Player extends GameEntity { public final boolean isValid(final String restriction, final Player sourceController, final Card source) { final String[] incR = restriction.split("\\."); - - if (!incR[0].equals("Player") && !(incR[0].equals("Opponent") && !this.equals(sourceController)) - && !(incR[0].equals("You") && this.equals(sourceController))) { - return false; + + if (incR[0].equals("Opponent")) { + if (this.equals(sourceController)) { + return false; + } + } else if (incR[0].equals("You")) { + if (!this.equals(sourceController)) { + return false; + } + } else if (incR[0].equals("EnchantedController")) { + GameEntity enchanted = source.getEnchanting(); + if (enchanted == null || !(enchanted instanceof Card)) { + return false; + } + Card enchantedCard = (Card) enchanted; + if (!this.equals(enchantedCard.getController())) { + return false; + } + } else { + if (!incR[0].equals("Player")) { + return false; + } } if (incR.length > 1) {