Caves of Qud

Caves of Qud

Brave Sir Robin
3 Comments
chef 30 Dec, 2022 @ 11:22am 
Thanks for the detail!
Eboreg  [author] 27 Dec, 2022 @ 2:41pm 
@chef Basically, whenever an AI decides to kill a target, it runs the "IsTooDangerous" method on the target. There's a method in the game called "DifficultyEvaluation.GetDifficultyRating" that checks how difficult a target is. Now... where things get fuzzy here is that this is actually an improvement of the "Discretionary Valor" mod and I use the same values it does to determine whether or not a target is too difficult to attack and I don't really understand what each of those numbers mean. If the "IsTooDangerous" method returns "true" the AI will always halt the attack but if the target isn't asleep, enclosed, frozen, paralyzed, or electromagnetically pulsed, then the AI will begin to flee. Also, if the AI decides to attack a target in melee, it will check if the target is a) AI-controlled and b) capable of using the dismember skill and if both are true, the target will cancel the order to melee attack and back off for five turns.
chef 16 Dec, 2022 @ 3:32pm 
This sounds like exactly what I'm looking for to avoid snapjaws suiciding themselves, but could you detail how this functions?

i.e. If the hostile target's threat-rating is 'Impossible' they will flee; If the level-difference between the NPC and target hits the XP gain floor the NPC will flee; etc.