fixed Hexproof from color abilities not working on players (fixes Veil of Summer issues)
@@ -606,12 +606,46 @@ public abstract class PlayerImpl implements Player, Serializable {
if (abilities.containsKey(ShroudAbility.getInstance().getId())) {
return false;
}
+
if (abilities.containsKey(HexproofAbility.getInstance().getId())) {
if (sourceControllerId != null && this.hasOpponent(sourceControllerId, game)
&& null == game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.HEXPROOF, null, sourceControllerId, game)) {
return false;
}
}
+
+ if (abilities.containsKey(HexproofFromWhiteAbility.getInstance().getId())) {
+ if (sourceControllerId != null && this.hasOpponent(sourceControllerId, game)
+ && null == game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.HEXPROOF, null, sourceControllerId, game)
+ && source.getColor(game).isWhite()) {
+ return false;
+ }
+ }
+
+ if (abilities.containsKey(HexproofFromBlueAbility.getInstance().getId())) {
+ if (sourceControllerId != null && this.hasOpponent(sourceControllerId, game)
+ && null == game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.HEXPROOF, null, sourceControllerId, game)
+ && source.getColor(game).isBlue()) {
+ return false;
+ }
+ }
+
+ if (abilities.containsKey(HexproofFromBlackAbility.getInstance().getId())) {
+ if (sourceControllerId != null && this.hasOpponent(sourceControllerId, game)
+ && null == game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.HEXPROOF, null, sourceControllerId, game)
+ && source.getColor(game).isBlack()) {
+ return false;
+ }
+ }
+
+ if (abilities.containsKey(HexproofFromMonocoloredAbility.getInstance().getId())) {
+ if (sourceControllerId != null && this.hasOpponent(sourceControllerId, game)
+ && null == game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.HEXPROOF, null, sourceControllerId, game)
+ && !source.getColor(game).isColorless() && !source.getColor(game).isMulticolored()) {
+ return false;
+ }
+ }
+
return !hasProtectionFrom(source, game);
}
