@@ -127,8 +127,14 @@ function LocalPlayerController.TryRandomBleed(character, limbName)
|
|||||||
if chance > normCicTime then
|
if chance > normCicTime then
|
||||||
TOC_DEBUG.print("Triggered bleeding from non cicatrized wound")
|
TOC_DEBUG.print("Triggered bleeding from non cicatrized wound")
|
||||||
local adjacentBodyPartType = BodyPartType[StaticData.LIMBS_ADJACENT_IND_STR[limbName]]
|
local adjacentBodyPartType = BodyPartType[StaticData.LIMBS_ADJACENT_IND_STR[limbName]]
|
||||||
character:getBodyDamage():getBodyPart(adjacentBodyPartType):setBleeding(true)
|
|
||||||
character:getBodyDamage():getBodyPart(adjacentBodyPartType):setBleedingTime(20)
|
-- 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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -132,36 +132,26 @@ function ISClothingExtraAction:isValid()
|
|||||||
return HandleProsthesisValidation(testItem, isEquippable)
|
return HandleProsthesisValidation(testItem, isEquippable)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
|
||||||
|
local og_ISClothingExtraAction_perform = ISClothingExtraAction.perform
|
||||||
|
function ISClothingExtraAction:perform()
|
||||||
|
local extraItem = InventoryItemFactory.CreateItem(self.extra)
|
||||||
|
ProsthesisHandler.SearchAndSetupProsthesis(extraItem, true)
|
||||||
|
og_ISClothingExtraAction_perform(self)
|
||||||
|
end
|
||||||
|
|
||||||
|
local og_ISUnequipAction_perform = ISUnequipAction.perform
|
||||||
|
function ISUnequipAction:perform()
|
||||||
|
|
||||||
|
--[[
|
||||||
Horrendous workaround
|
Horrendous workaround
|
||||||
|
|
||||||
To unequp items, the java side uses WornItems.setItem, which has
|
To unequp items, the java side uses WornItems.setItem, which has
|
||||||
a check for multiItem. Basically, if it's active, it won't actually remove the item,
|
a check for multiItem. Basically, if it's active, it won't actually remove the item,
|
||||||
fucking things up. So, to be 100% sure that we're removing the items, we're gonna
|
fucking things up. So, to be 100% sure that we're removing the items, we're gonna
|
||||||
disable and re-enable the multi-item bool for the Unequip Action.
|
disable and re-enable the multi-item bool for the Unequip Action.
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local og_ISClothingExtraAction_perform = ISClothingExtraAction.perform
|
|
||||||
function ISClothingExtraAction:perform()
|
|
||||||
local extraItem = InventoryItemFactory.CreateItem(self.extra)
|
|
||||||
local isProst = ProsthesisHandler.SearchAndSetupProsthesis(extraItem, true)
|
|
||||||
local group
|
|
||||||
if isProst then
|
|
||||||
group = BodyLocations.getGroup("Human")
|
|
||||||
group:setMultiItem("TOC_ArmProst", false)
|
|
||||||
end
|
|
||||||
|
|
||||||
og_ISClothingExtraAction_perform(self)
|
|
||||||
|
|
||||||
if isProst then
|
|
||||||
group:setMultiItem("TOC_ArmProst", true)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local og_ISUnequipAction_perform = ISUnequipAction.perform
|
|
||||||
function ISUnequipAction:perform()
|
|
||||||
local isProst = ProsthesisHandler.SearchAndSetupProsthesis(self.item, false)
|
local isProst = ProsthesisHandler.SearchAndSetupProsthesis(self.item, false)
|
||||||
local group
|
local group
|
||||||
if isProst then
|
if isProst then
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ require("TOC/Events")
|
|||||||
|
|
||||||
---@class Main
|
---@class Main
|
||||||
local Main = {
|
local Main = {
|
||||||
_version = "2.0.8"
|
_version = "2.0.9"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Main.Start()
|
function Main.Start()
|
||||||
|
|||||||
@@ -145,6 +145,14 @@ end)
|
|||||||
TestFramework.registerTestModule("Various", "Player", function()
|
TestFramework.registerTestModule("Various", "Player", function()
|
||||||
local Tests = {}
|
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()
|
function Tests.Kill()
|
||||||
getPlayer():Kill(getPlayer())
|
getPlayer():Kill(getPlayer())
|
||||||
end
|
end
|
||||||
|
|||||||
2
mod.info
2
mod.info
@@ -4,5 +4,5 @@ description=You've been bitten. You have only two choices.
|
|||||||
id=TheOnlyCure
|
id=TheOnlyCure
|
||||||
icon=icon.png
|
icon=icon.png
|
||||||
url=https://github.com/ZioPao/The-Only-Cure
|
url=https://github.com/ZioPao/The-Only-Cure
|
||||||
modversion=2.0.8
|
modversion=2.0.9
|
||||||
pzversion=41.65
|
pzversion=41.65
|
||||||
|
|||||||
Reference in New Issue
Block a user