From 46a8ddc207b3f5be16ab05b53939dc7431bd3536 Mon Sep 17 00:00:00 2001 From: ZioPao Date: Tue, 7 May 2024 17:13:27 +0200 Subject: [PATCH] Added some tests --- .../lua/client/TOC/Controllers/LocalPlayerController.lua | 3 +-- media/lua/client/TOC/Tests.lua | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/media/lua/client/TOC/Controllers/LocalPlayerController.lua b/media/lua/client/TOC/Controllers/LocalPlayerController.lua index fb1a4ed..319037a 100644 --- a/media/lua/client/TOC/Controllers/LocalPlayerController.lua +++ b/media/lua/client/TOC/Controllers/LocalPlayerController.lua @@ -131,10 +131,9 @@ function LocalPlayerController.TryRandomBleed(character, limbName) -- we need to check if the wound is already bleeding before doing anything else to prevent issues with bandages local bp = character:getBodyDamage():getBodyPart(adjacentBodyPartType) bp:setBleedingTime(20) -- TODO Should depend on cicatrization instead of a fixed time + -- ADD Could break bandages if bleeding is too much? - - --character:getBodyDamage():getBodyPart(adjacentBodyPartType):setBleeding(true) end end diff --git a/media/lua/client/TOC/Tests.lua b/media/lua/client/TOC/Tests.lua index 170ef6c..a636c15 100644 --- a/media/lua/client/TOC/Tests.lua +++ b/media/lua/client/TOC/Tests.lua @@ -145,6 +145,14 @@ end) TestFramework.registerTestModule("Various", "Player", function() local Tests = {} + + function Tests.BleedTest() + local pl = getPlayer() + + --pl:getBodyDamage():getBodyPart(BodyPartType.ForeArm_R):setBleeding(true) + pl:getBodyDamage():getBodyPart(BodyPartType.ForeArm_R):setBleedingTime(20) + end + function Tests.Kill() getPlayer():Kill(getPlayer()) end