fix immunities

This commit is contained in:
2025-03-04 18:31:02 -06:00
parent f4af11b38f
commit c761cd982f
3 changed files with 30 additions and 101 deletions
+21 -16
View File
@@ -244,25 +244,30 @@ public class ActionsBase {
if (bonus == null)
return false;
//TODO make this more efficient then testing strings
if (this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo, SourceType.Stun))
return true; //Currently stun immune. Skip stun
else if (this.stackType.equals("Snare") && bonus.getBool(ModType.ImmuneTo, SourceType.Snare))
return true; //Currently snare immune. Skip snare
else if (this.stackType.equals("Blindness") && bonus.getBool(ModType.ImmuneTo, SourceType.Blind))
return true; //Currently blind immune. Skip blind
else if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock))
return true; //Currently power block immune. Skip power block
else if (this.stackType.equals("Root") && bonus.getBool(ModType.ImmuneTo, SourceType.Root))
SourceType sourceType = SourceType.GetSourceType(this.stackType);
if(sourceType != null && (bonus.getBool(ModType.ImmuneTo,sourceType) || bonus.getBool(ModType.NoMod,sourceType)))
return true;
// else if (pb.isHeal() && (bonus.getByte("immuneTo.Heal")) >= trains)
// return true; //Currently shadowmantled. Skip heals
else if (this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.Fly))
if(pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN))
return true;
else if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))
if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))
return true;
else
return pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN);
if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock))
return true;
if(ac.effects.containsKey(this.stackType)) {
Effect eff = ac.effects.get(this.stackType);
if(eff != null) {
if (this.greaterThan && trains <= eff.getTrains())
return true;
if (this.greaterThanEqual && trains < eff.getTrains())
return true;
}
}
}
return false;
}