Browse Source

fixed immunities in powers manager

postwipe-guilds
FatBoy-DOTC 6 months ago
parent
commit
33c923b0de
  1. 15
      src/engine/gameManager/PowersManager.java

15
src/engine/gameManager/PowersManager.java

@ -925,9 +925,20 @@ public enum PowersManager {
if (pb.isHarmful()) if (pb.isHarmful())
mobTarget.handleDirectAggro(playerCharacter); 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; 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 // update target of used power timer

Loading…
Cancel
Save