Browse Source

Immunities refresh

postwipe-hostile
FatBoy-DOTC 5 months ago
parent
commit
2a3ae6eaec
  1. 30
      src/engine/gameManager/PowersManager.java

30
src/engine/gameManager/PowersManager.java

@ -926,21 +926,6 @@ public enum PowersManager { @@ -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 { @@ -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;

Loading…
Cancel
Save