fixed immunities in powers manager

This commit is contained in:
2024-06-13 20:47:28 -05:00
parent 02d524663a
commit 33c923b0de
+13 -2
View File
@@ -925,9 +925,20 @@ public enum PowersManager {
if (pb.isHarmful())
mobTarget.handleDirectAggro(playerCharacter);
}
//Power is aiding a target, handle aggro if combat target is a Mob.
if (!pb.isHarmful() && target.getObjectType() == GameObjectType.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