Caves of Qud

Caves of Qud

Not enough ratings
Brave Sir Robin
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
82.207 KB
4 Dec, 2022 @ 5:51pm
5 Aug, 2023 @ 12:55pm
2 Change Notes ( view )

Subscribe to download
Brave Sir Robin

Description
This mod is designed to cause NPCs to run away from any hostile targets that they are not strong enough to take on.
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.