diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index 08e3127b259..d6c8c2a37b5 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -634,13 +634,19 @@ public abstract class PlayerImpl implements Player, Serializable { return false; } if (source != null) { + // there is only variant of shroud, so check the instance and any asthougheffects that would ignore it if (abilities.containsKey(ShroudAbility.getInstance().getId()) && game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.SHROUD, null, sourceControllerId, game) == null) { return false; } - if (abilities.containsKey(HexproofAbility.getInstance().getId()) - && game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.HEXPROOF, null, sourceControllerId, game) == null) { - return false; + // check for all variants of hexproof and any asthougheffects that would ignore it + // TODO there may be "prevented by rule-modification" effects, so add them if known + for (Ability a : abilities) { + if (a instanceof HexproofBaseAbility + && ((HexproofBaseAbility) a).checkObject(source, game) + && game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.HEXPROOF, null, sourceControllerId, game) == null) { + return false; + } } return !hasProtectionFrom(source, game); }