diff --git a/Neurotrauma/Lua/Scripts/Server/fuckbots.lua b/Neurotrauma/Lua/Scripts/Server/fuckbots.lua index 2b79d034..f90153d0 100644 --- a/Neurotrauma/Lua/Scripts/Server/fuckbots.lua +++ b/Neurotrauma/Lua/Scripts/Server/fuckbots.lua @@ -1,3 +1,5 @@ +LuaUserData.MakeMethodAccessible(Descriptors["Barotrauma.HumanAIController"], "SpeakAboutIssues") + -- hopefully this stops bots from doing any rescuing at all. -- and also hopefully my assumption that this very specific thing -- about bots is what is causing them to eat frames is correct. @@ -21,3 +23,28 @@ if NTConfig.Get("NT_disableBotAlgorithms", true) then return false end, Hook.HookMethodType.Before) end + +-- allows npcs to talk about their neuro afflictions + +Hook.Patch("Barotrauma.HumanAIController", "SpeakAboutIssues", function(instance) + + local character = instance.Character + + local message = "" + + local chatType = ChatMessageType.Default + if character.Inventory.GetItemInLimbSlot(InvSlotType.Headset) then + chatType = ChatMessageType.Radio + end + + if HF.HasAffliction(character, "sym_palpitations", 1) then + message = "I can hear my heart beating." + character.Speak(message, chatType, math.random(0,5), Identifier("DialogPalpitations"), 600.0) + end + + if HF.HasAffliction(character, "inflammation", 1) then + message = "My wound feels warm and swollen." + character.Speak(message, chatType, math.random(0,5), Identifier("DialogueInflammation"), 120.0) + end + +end, Hook.HookMethodType.After) \ No newline at end of file