Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Neurotrauma/Lua/Scripts/Server/fuckbots.lua
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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)