Readded tourniquet

This commit is contained in:
ZioPao
2024-01-09 14:42:56 +01:00
parent aeb1bca94d
commit a41f976949
13 changed files with 100 additions and 15 deletions

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>Surgery\Tourniquet_Left</m_MaleModel>
<m_FemaleModel>Surgery\Tourniquet_Left</m_FemaleModel>
<m_GUID>afbab35d-8bd4-4d61-87c7-054651ead1bd</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Surgery\tourniquet</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>Surgery\Tourniquet_Right</m_MaleModel>
<m_FemaleModel>Surgery\Tourniquet_Right</m_FemaleModel>
<m_GUID>9a5fe063-63c7-4e6f-81ca-ee77c6678e0d</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Surgery\tourniquet</textureChoices>
</clothingItem>

View File

@@ -26,6 +26,7 @@
<guid>646cafa5-3fa1-41af-9ca0-aa57cca3b36d</guid> <guid>646cafa5-3fa1-41af-9ca0-aa57cca3b36d</guid>
</files> </files>
<!--Prosthetics -->
<files> <files>
<path>media/clothing/clothingItems/Prost_HookArm_L.xml</path> <path>media/clothing/clothingItems/Prost_HookArm_L.xml</path>
@@ -44,4 +45,17 @@
<path>media/clothing/clothingItems/Prost_NormalArm_R.xml</path> <path>media/clothing/clothingItems/Prost_NormalArm_R.xml</path>
<guid>0e24eb76-4745-46af-9147-ba21e0ebbb2e</guid> <guid>0e24eb76-4745-46af-9147-ba21e0ebbb2e</guid>
</files> </files>
<!--Surgery -->
<files>
<path>media/clothing/clothingItems/Surg_Arm_Tourniquet_L.xml</path>
<guid>afbab35d-8bd4-4d61-87c7-054651ead1bd</guid>
</files>
<files>
<path>media/clothing/clothingItems/Surg_Arm_Tourniquet_R.xml</path>
<guid>9a5fe063-63c7-4e6f-81ca-ee77c6678e0d</guid>
</files>
</fileGuidTable> </fileGuidTable>

View File

@@ -57,7 +57,7 @@ function DataController:setup(key)
prostheses = {} prostheses = {}
} }
---@type partData ---@type partDataType
local defaultParams = { local defaultParams = {
isCut = false, isInfected = false, isOperated = false, isCicatrized = false, isCauterized = false, isCut = false, isInfected = false, isOperated = false, isCicatrized = false, isCauterized = false,
woundDirtyness = -1, cicatrizationTime = -1, woundDirtyness = -1, cicatrizationTime = -1,
@@ -269,9 +269,7 @@ function DataController:setCutLimb(limbName, isOperated, isCicatrized, isCauteri
cicatrizationTime = StaticData.LIMBS_CICATRIZATION_TIME_IND_NUM[limbName] - surgeonFactor cicatrizationTime = StaticData.LIMBS_CICATRIZATION_TIME_IND_NUM[limbName] - surgeonFactor
end end
-- TODO Set WoundDirtyness here! For now it's just 0 ---@type partDataType
---@type partData
local params = {isCut = true, isInfected = false, isOperated = isOperated, isCicatrized = isCicatrized, isCauterized = isCauterized, woundDirtyness = 0, isVisible = true} local params = {isCut = true, isInfected = false, isOperated = isOperated, isCicatrized = isCicatrized, isCauterized = isCauterized, woundDirtyness = 0, isVisible = true}
self:setLimbParams(limbName, params, cicatrizationTime) self:setLimbParams(limbName, params, cicatrizationTime)
@@ -292,7 +290,7 @@ end
---Set a limb data ---Set a limb data
---@param limbName string ---@param limbName string
---@param ampStatus partData {isCut, isInfected, isOperated, isCicatrized, isCauterized, isVisible} ---@param ampStatus partDataType {isCut, isInfected, isOperated, isCicatrized, isCauterized, isVisible}
---@param cicatrizationTime integer? ---@param cicatrizationTime integer?
function DataController:setLimbParams(limbName, ampStatus, cicatrizationTime) function DataController:setLimbParams(limbName, ampStatus, cicatrizationTime)
local limbData = self.tocData.limbs[limbName] local limbData = self.tocData.limbs[limbName]

View File

@@ -117,7 +117,6 @@ function LocalPlayerController.TryRandomBleed(character, limbName)
-- Chance should be determined by the cicatrization time -- Chance should be determined by the cicatrization time
local cicTime = DataController.GetInstance():getCicatrizationTime(limbName) local cicTime = DataController.GetInstance():getCicatrizationTime(limbName)
if cicTime == 0 then return end if cicTime == 0 then return end
-- TODO Sometimes we get cicTime = 0... Shouldn't really do it
-- TODO This is just a placeholder, we need to figure out a better way to calculate this chance -- TODO This is just a placeholder, we need to figure out a better way to calculate this chance
local normCicTime = CommonMethods.Normalize(cicTime, 0, StaticData.LIMBS_CICATRIZATION_TIME_IND_NUM[limbName])/2 local normCicTime = CommonMethods.Normalize(cicTime, 0, StaticData.LIMBS_CICATRIZATION_TIME_IND_NUM[limbName])/2

View File

@@ -1,7 +1,6 @@
require "TimedActions/ISBaseTimedAction" require "TimedActions/ISBaseTimedAction"
local AmputationHandler = require("TOC/Handlers/AmputationHandler") local AmputationHandler = require("TOC/Handlers/AmputationHandler")
local CommandsData = require("TOC/CommandsData") local CommandsData = require("TOC/CommandsData")
local CommonMethods = require("TOC/CommonMethods")
----------------------------- -----------------------------
@@ -46,8 +45,7 @@ function CutLimbAction:new(surgeon, patient, limbName, item, stitchesItem, banda
end end
function CutLimbAction:isValid() function CutLimbAction:isValid()
-- TODO Surgeon should be close to patient return not ISHealthPanel.DidPatientMove(self.patient, self.character, self.patient:getX(), self.patient:getY())
return true
end end
function CutLimbAction:start() function CutLimbAction:start()

View File

@@ -1,5 +1,5 @@
---@alias partData { isCut : boolean?, isInfected : boolean?, isOperated : boolean?, isCicatrized : boolean?, isCauterized : boolean?, isVisible : boolean?, woundDirtyness : number, cicatrizationTime : number } ---@alias partDataType { isCut : boolean?, isInfected : boolean?, isOperated : boolean?, isCicatrized : boolean?, isCauterized : boolean?, isVisible : boolean?, woundDirtyness : number, cicatrizationTime : number }
---@alias limbsTable {Hand_L : partData, ForeArm_L : partData, UpperArm_L : partData, Hand_R : partData, ForeArm_R : partData, UpperArm_R : partData } ---@alias limbsTable {Hand_L : partDataType, ForeArm_L : partDataType, UpperArm_L : partDataType, Hand_R : partDataType, ForeArm_R : partDataType, UpperArm_R : partDataType }
---@alias prosthesisData {isProstEquipped : boolean, prostFactor : number } ---@alias prosthesisData {isProstEquipped : boolean, prostFactor : number }
---@alias prosthesesTable {Top_L : prosthesisData, Top_R : prosthesisData } -- TODO add Bottom_L and Bottom_R ---@alias prosthesesTable {Top_L : prosthesisData, Top_R : prosthesisData } -- TODO add Bottom_L and Bottom_R
---@alias tocModDataType { limbs : limbsTable, prostheses : prosthesesTable, isIgnoredPartInfected : boolean, isAnyLimbCut : boolean } ---@alias tocModDataType { limbs : limbsTable, prostheses : prosthesesTable, isIgnoredPartInfected : boolean, isAnyLimbCut : boolean }

View File

@@ -12,13 +12,17 @@ ContextMenu_EN = {
ContextMenu_Limb_UpperArm_L = "Left UpperArm" ContextMenu_Limb_UpperArm_L = "Left UpperArm"
ContextMenu_Limb_Hand_R = "Right Hand", ContextMenu_Limb_Hand_R = "Right Hand",
ContextMenu_Limb_ForeArm_R = "Right Forearm", ContextMenu_Limb_ForeArm_R = "Right Forearm",
ContextMenu_Limb_UpperArm_R = "Right UpperArm" ContextMenu_Limb_UpperArm_R = "Right UpperArm",
ContextMenu_InstallProstRight = "Install prosthesis on right arm", ContextMenu_InstallProstRight = "Install prosthesis on right arm",
ContextMenu_InstallProstLeft = "Install prosthesis on left arm", ContextMenu_InstallProstLeft = "Install prosthesis on left arm",
ContextMenu_PutTourniquetArmLeft = "Put tourniquet on left arm",
ContextMenu_PutTourniquetLegL = "Put tourniquet on left leg",
ContextMenu_PutTourniquetArmRight = "Put tourniquet on right arm",
ContextMenu_PutTourniquetLegR = "Put tourniquet on right leg",
ContextMenu_CleanWound = "Clean Wound", ContextMenu_CleanWound = "Clean Wound",
} }

View File

@@ -1,4 +1,8 @@
ItemName_EN = { ItemName_EN = {
ItemName_TOC.Surg_Arm_Tourniquet_L = "Tourniquet",
ItemName_TOC.Surg_Arm_Tourniquet_R = "Tourniquet",
ItemName_TOC.Prost_NormalArm_L = "Prosthetic Arm", ItemName_TOC.Prost_NormalArm_L = "Prosthetic Arm",
ItemName_TOC.Prost_NormalArm_R = "Prosthetic Arm", ItemName_TOC.Prost_NormalArm_R = "Prosthetic Arm",

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,48 @@
module TOC
{
imports
{
Base
}
item Surg_Arm_Tourniquet_L
{
Type = Clothing,
DisplayCategory = Surgery,
DisplayName = Tourniquet,
ClothingItem = Surg_Arm_Tourniquet_L,
ClothingItemExtra = Surg_Arm_Tourniquet_R,
ClothingItemExtraOption = PutTourniquetArmRight,
clothingExtraSubmenu = PutTourniquetArmLeft,
BodyLocation = Hands,
BloodLocation = UpperArms;UpperBody,
Weight = 1,
Icon = tourniquet,
Tooltip = Test,
CanHaveHoles = false,
}
item Surg_Arm_Tourniquet_R
{
Type = Clothing,
DisplayCategory = Surgery,
DisplayName = Tourniquet,
ClothingItem = Surg_Arm_Tourniquet_R,
ClothingItemExtra = Surg_Arm_Tourniquet_L,
ClothingItemExtraOption = PutTourniquetArmLeft,
clothingExtraSubmenu = PutTourniquetArmRight,
BodyLocation = Hands,
BloodLocation = UpperArms;UpperBody,
Weight = 1,
Icon = tourniquet,
Tooltip = Test,
CanHaveHoles = false,
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B