diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index 84b8d0a9..1372763a 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -926,21 +926,6 @@ public enum PowersManager { mobTarget.handleDirectAggro(playerCharacter); } - //Check for immunities - if (target.getObjectType() == GameObjectType.PlayerCharacter) { - PlayerCharacter pcTarget = (PlayerCharacter) target; - PlayerBonuses tarBonus = pcTarget.getBonuses(); - SourceType source = SourceType.GetSourceType(pb.category); - boolean immune = tarBonus.getBool(ModType.ImmuneTo, source); - if(!immune){ - DamageType damageType = DamageType.getDamageType(pb.category); - immune = pcTarget.getResists().immuneTo(damageType); - } - if(immune){ - return; - } - } - // update target of used power timer if (pb.isHarmful()) @@ -967,6 +952,21 @@ public enum PowersManager { continue; } + //Check for immunities + if (target.getObjectType() == GameObjectType.PlayerCharacter) { + PlayerCharacter pcTarget = (PlayerCharacter) target; + PlayerBonuses tarBonus = pcTarget.getBonuses(); + SourceType source = SourceType.GetSourceType(ab.stackType); + boolean immune = tarBonus.getBool(ModType.ImmuneTo, source); + if(!immune){ + DamageType damageType = DamageType.getDamageType(ab.stackType); + immune = pcTarget.getResists().immuneTo(damageType); + } + if(immune){ + continue; + } + } + // TODO handle overwrite stack order here String stackType = ab.getStackType(); stackType = (stackType.equals("IgnoreStack")) ? Integer.toString(ab.getUUID()) : stackType;