diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index 33e71414dfc..2a95d4c4b6d 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -3987,7 +3987,7 @@ public class Card extends GameEntity implements Comparable { // Takes one argument like Permanent.Blue+withFlying @Override public final boolean isValid(final String restriction, final Player sourceController, final Card source, SpellAbility spellAbility) { - if (isImmutable() && !source.isRemembered(this) && + if (isImmutable() && source != null && !source.isRemembered(this) && !(restriction.startsWith("Emblem") || restriction.startsWith("Effect"))) { // special case exclusion return false; } diff --git a/forge-game/src/main/java/forge/game/player/Player.java b/forge-game/src/main/java/forge/game/player/Player.java index e35747ccf55..591515e3be8 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -1159,9 +1159,33 @@ public class Player extends GameEntity implements Comparable { @Override public final boolean canBeTargetedBy(final SpellAbility sa) { - if (hasKeyword("Shroud") || (!equals(sa.getActivatingPlayer()) && hasKeyword("Hexproof")) - || hasProtectionFrom(sa.getHostCard()) - || (hasKeyword("You can't be the targets of spells or activated abilities") && (sa.isSpell() || (sa instanceof AbilityActivated)))) { + if (hasKeyword("Shroud")) { + return false; + } + if (hasKeyword("Hexproof")) { + final Player a = sa.getActivatingPlayer(); + if (isOpponentOf(a)) { + boolean cancelHexproof = false; + for (String k : a.getKeywords()) { + if (k.startsWith("IgnoreHexproof")) { + String m[] = k.split(":"); + if (isValid(m[1].split(","), a, sa.getHostCard(), sa)) { + cancelHexproof = true; + break; + } + } + } + if (!cancelHexproof) { + return false; + } + } + } + + if (hasProtectionFrom(sa.getHostCard())) { + return false; + } + + if ((hasKeyword("You can't be the targets of spells or activated abilities") && (sa.isSpell() || (sa instanceof AbilityActivated)))) { return false; } return true; diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantTarget.java b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantTarget.java index 87ddef0f313..9f6be5cb168 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantTarget.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantTarget.java @@ -89,8 +89,13 @@ public class StaticAbilityCantTarget { } if (params.containsKey("Hexproof") && (activator != null)) { - if (activator.hasKeyword("Spells and abilities you control can target hexproof creatures")) { - return false; + for (String k : activator.getKeywords()) { + if (k.startsWith("IgnoreHexproof")) { + String m[] = k.split(":"); + if (card.isValid(m[1].split(","), activator, source, spellAbility)) { + return false; + } + } } } diff --git a/forge-gui/res/cardsfolder/g/glaring_spotlight.txt b/forge-gui/res/cardsfolder/g/glaring_spotlight.txt index 4d96918ae66..a45d751b09e 100644 --- a/forge-gui/res/cardsfolder/g/glaring_spotlight.txt +++ b/forge-gui/res/cardsfolder/g/glaring_spotlight.txt @@ -1,7 +1,7 @@ Name:Glaring Spotlight ManaCost:1 Types:Artifact -S:Mode$ Continuous | Affected$ You | AddKeyword$ Spells and abilities you control can target hexproof creatures | Description$ Creatures your opponents control with hexproof can be the targets of spells and abilities you control as though they didn't have hexproof. +S:Mode$ Continuous | Affected$ You | AddKeyword$ IgnoreHexproof:Creature.OppCtrl | Description$ Creatures your opponents control with hexproof can be the targets of spells and abilities you control as though they didn't have hexproof. A:AB$ PumpAll | Cost$ 3 Sac<1/CARDNAME> | ValidCards$ Creature.YouCtrl | KW$ Hexproof | SubAbility$ GSEffect | SpellDescription$ Creatures you control gain hexproof until end of turn and can't be blocked this turn. SVar:GSEffect:DB$ Effect | Name$ Glaring Spotlight Effect | StaticAbilities$ KWPump SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouCtrl | AddHiddenKeyword$ Unblockable | Description$ Creatures you control can't be blocked this turn. diff --git a/forge-gui/res/cardsfolder/upcoming/detection_tower.txt b/forge-gui/res/cardsfolder/upcoming/detection_tower.txt new file mode 100644 index 00000000000..6be754bdf1b --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/detection_tower.txt @@ -0,0 +1,9 @@ +Name:Detection Tower +ManaCost:no cost +Types:Land +A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}. +A:AB$ Effect | Cost$ 1 T | StaticAbilities$ STLoseAB | SpellDescription$ Until end of turn, your opponents and creatures your opponents control with hexproof can be the targets of spells and abilities you control as though they didn’t have hexproof. +SVar:STLoseAB:Mode$ Continuous | EffectZone$ Command | Affected$ You | AddKeyword$ IgnoreHexproof:Opponent,Creature.OppCtrl | Description$ Your opponents and creatures your opponents control with hexproof can be the targets of spells and abilities you control as though they didn’t have hexproof. +SVar:RemAIDeck:True +SVar:Picture:http://www.wizards.com/global/images/magic/general/detection_tower.jpg +Oracle:{T}: Add {C}.\n{1}, {T}: Until end of turn, your opponents and creatures your opponents control with hexproof can be the targets of spells and abilities you control as though they didn’t have hexproof.