Immunities refresh

This commit is contained in:
2024-06-26 20:24:05 -05:00
parent 9e4b596aa1
commit 2a3ae6eaec
+15 -15
View File
@@ -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;