Fixed a stupid mistake that broke the ovens
This commit is contained in:
@@ -46,15 +46,9 @@ local function healUpdatePart(partName, modData, player)
|
|||||||
if bodyPart:getFractureTime()>0 then bodyPart:setFractureTime(0) end
|
if bodyPart:getFractureTime()>0 then bodyPart:setFractureTime(0) end
|
||||||
|
|
||||||
-- During healing
|
-- During healing
|
||||||
-- this will not happen every 10 sec or some shit like that.
|
|
||||||
-- We will allow stitching. Surgery is needed only to have a faster cicatrization
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if modData_part.IsCut and not modData_part.IsCicatrized then
|
if modData_part.IsCut and not modData_part.IsCicatrized then
|
||||||
|
if modData_part.CicaTimeLeft < 0 then
|
||||||
if modData_part.CicaTimeLeft < 0 then
|
player:Say(getText('UI_ContextMenu_My') .. partName .. getText('UI_ContextMenu_Now_cut'))
|
||||||
player:Say(getText('UI_ContextMenu_My') .. partName .. getText('UI_ContextMenu_Now_cut')) -- dunno if this works.
|
|
||||||
modData_part.IsCicatrized = true;
|
modData_part.IsCicatrized = true;
|
||||||
player:getTraits():add("Brave")
|
player:getTraits():add("Brave")
|
||||||
player:getTraits():add("Insensitive")
|
player:getTraits():add("Insensitive")
|
||||||
@@ -63,9 +57,7 @@ local function healUpdatePart(partName, modData, player)
|
|||||||
bodyPart:setBleedingTime(0);
|
bodyPart:setBleedingTime(0);
|
||||||
bodyPart:setDeepWoundTime(0);
|
bodyPart:setDeepWoundTime(0);
|
||||||
player:transmitModData()
|
player:transmitModData()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--Phantom pain
|
--Phantom pain
|
||||||
|
|||||||
@@ -26,19 +26,12 @@ function CutArm(partName, surgeonFact, useBandage, bandageAlcool, usePainkiller,
|
|||||||
stats:setEndurance(0 + surgeonFact);
|
stats:setEndurance(0 + surgeonFact);
|
||||||
stats:setStress(100 - surgeonFact);
|
stats:setStress(100 - surgeonFact);
|
||||||
|
|
||||||
|
|
||||||
--TODO this is broken
|
|
||||||
-- Bandage
|
-- Bandage
|
||||||
|
if useBandage and bandageAlcool then
|
||||||
|
bodyPart:setBandaged(true, 10, true, bandage:getType());
|
||||||
if useBandage then
|
elseif useBandage and not bandageAlcool then
|
||||||
bodyPart:setBandaged(true, 10)
|
bodyPart:setBandaged(true, 10, false, bandage:getType());
|
||||||
|
end
|
||||||
--if useBandage and bandageAlcool then
|
|
||||||
-- bodyPart:setBandaged(true, 10, true, bandage:getType());
|
|
||||||
--elseif useBandage and not bandageAlcool then
|
|
||||||
-- bodyPart:setBandaged(true, 10, false, bandage:getType());
|
|
||||||
--end
|
|
||||||
|
|
||||||
-- Painkiller
|
-- Painkiller
|
||||||
if usePainkiller then
|
if usePainkiller then
|
||||||
@@ -143,13 +136,6 @@ function CutArm(partName, surgeonFact, useBandage, bandageAlcool, usePainkiller,
|
|||||||
--Equip cloth
|
--Equip cloth
|
||||||
local cloth = player:getInventory():AddItem(find_clothName2_TOC(partName));
|
local cloth = player:getInventory():AddItem(find_clothName2_TOC(partName));
|
||||||
player:setWornItem(cloth:getBodyLocation(), cloth);
|
player:setWornItem(cloth:getBodyLocation(), cloth);
|
||||||
|
|
||||||
-- Set the correct stats for the injury
|
|
||||||
bodyPart:setBleeding(true);
|
|
||||||
bodyPart:setDeepWounded(true);
|
|
||||||
bodyPart:setBleedingTime(100);
|
|
||||||
bodyPart:setDeepWoundTime(100);
|
|
||||||
|
|
||||||
player:transmitModData();
|
player:transmitModData();
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -157,7 +143,7 @@ function OperateArm(partName, surgeonFact, useOven)
|
|||||||
local player = getPlayer();
|
local player = getPlayer();
|
||||||
local modData = player:getModData().TOC;
|
local modData = player:getModData().TOC;
|
||||||
|
|
||||||
if UseOven then
|
if useOven then
|
||||||
local stats = character:getStats();
|
local stats = character:getStats();
|
||||||
bodyPart:AddDamage(100);
|
bodyPart:AddDamage(100);
|
||||||
bodyPart:setAdditionalPain(100);
|
bodyPart:setAdditionalPain(100);
|
||||||
@@ -168,13 +154,13 @@ function OperateArm(partName, surgeonFact, useOven)
|
|||||||
if partName == "RightHand" and not modData.RightHand.IsOperated then
|
if partName == "RightHand" and not modData.RightHand.IsOperated then
|
||||||
modData.RightHand.IsOperated = true;
|
modData.RightHand.IsOperated = true;
|
||||||
modData.RightHand.CicaTimeLeft = modData.RightHand.CicaTimeLeft - (surgeonFact * 200);
|
modData.RightHand.CicaTimeLeft = modData.RightHand.CicaTimeLeft - (surgeonFact * 200);
|
||||||
if UseOven then modData.RightHand.IsBurn = true end
|
if useOven then modData.RightHand.IsBurn = true end
|
||||||
elseif partName == "RightForearm" and not modData.RightForearm.IsOperated then
|
elseif partName == "RightForearm" and not modData.RightForearm.IsOperated then
|
||||||
modData.RightForearm.IsOperated = true;
|
modData.RightForearm.IsOperated = true;
|
||||||
modData.RightHand.IsOperated = true;
|
modData.RightHand.IsOperated = true;
|
||||||
modData.RightForearm.CicaTimeLeft = modData.RightForearm.CicaTimeLeft - (surgeonFact * 200);
|
modData.RightForearm.CicaTimeLeft = modData.RightForearm.CicaTimeLeft - (surgeonFact * 200);
|
||||||
modData.RightHand.CicaTimeLeft = modData.RightHand.CicaTimeLeft - (surgeonFact * 200);
|
modData.RightHand.CicaTimeLeft = modData.RightHand.CicaTimeLeft - (surgeonFact * 200);
|
||||||
if UseOven then
|
if useOven then
|
||||||
modData.TOC.RightHand.IsBurn = true;
|
modData.TOC.RightHand.IsBurn = true;
|
||||||
modData.TOC.RightForearm.IsBurn = true;
|
modData.TOC.RightForearm.IsBurn = true;
|
||||||
end
|
end
|
||||||
@@ -185,7 +171,7 @@ function OperateArm(partName, surgeonFact, useOven)
|
|||||||
modData.RightArm.CicaTimeLeft = modData.RightArm.CicaTimeLeft - (surgeonFact * 200);
|
modData.RightArm.CicaTimeLeft = modData.RightArm.CicaTimeLeft - (surgeonFact * 200);
|
||||||
modData.RightForearm.CicaTimeLeft = modData.RightForearm.CicaTimeLeft - (surgeonFact * 200);
|
modData.RightForearm.CicaTimeLeft = modData.RightForearm.CicaTimeLeft - (surgeonFact * 200);
|
||||||
modData.RightHand.CicaTimeLeft = modData.RightHand.CicaTimeLeft - (surgeonFact * 200);
|
modData.RightHand.CicaTimeLeft = modData.RightHand.CicaTimeLeft - (surgeonFact * 200);
|
||||||
if UseOven then
|
if useOven then
|
||||||
modData.RightHand.IsBurn = true;
|
modData.RightHand.IsBurn = true;
|
||||||
modData.RightForearm.IsBurn = true;
|
modData.RightForearm.IsBurn = true;
|
||||||
modData.RightArm.IsBurn = true;
|
modData.RightArm.IsBurn = true;
|
||||||
@@ -193,13 +179,13 @@ function OperateArm(partName, surgeonFact, useOven)
|
|||||||
elseif partName == "LeftHand" and not modData.LeftHand.IsOperated then
|
elseif partName == "LeftHand" and not modData.LeftHand.IsOperated then
|
||||||
modData.LeftHand.IsOperated = true;
|
modData.LeftHand.IsOperated = true;
|
||||||
modData.LeftHand.CicaTimeLeft = modData.LeftHand.CicaTimeLeft - (surgeonFact * 200);
|
modData.LeftHand.CicaTimeLeft = modData.LeftHand.CicaTimeLeft - (surgeonFact * 200);
|
||||||
if UseOven then modData.LeftHand.IsBurn = true end
|
if useOven then modData.LeftHand.IsBurn = true end
|
||||||
elseif partName == "LeftForearm" and not modData.LeftForearm.IsOperated then
|
elseif partName == "LeftForearm" and not modData.LeftForearm.IsOperated then
|
||||||
modData.LeftForearm.IsOperated = true;
|
modData.LeftForearm.IsOperated = true;
|
||||||
modData.LeftHand.IsOperated = true;
|
modData.LeftHand.IsOperated = true;
|
||||||
modData.LeftForearm.CicaTimeLeft = modData.LeftForearm.CicaTimeLeft - (surgeonFact * 200);
|
modData.LeftForearm.CicaTimeLeft = modData.LeftForearm.CicaTimeLeft - (surgeonFact * 200);
|
||||||
modData.LeftHand.CicaTimeLeft = modData.LeftHand.CicaTimeLeft - (surgeonFact * 200);
|
modData.LeftHand.CicaTimeLeft = modData.LeftHand.CicaTimeLeft - (surgeonFact * 200);
|
||||||
if UseOven then
|
if useOven then
|
||||||
modData.LeftHand.IsBurn = true;
|
modData.LeftHand.IsBurn = true;
|
||||||
modData.LeftForearm.IsBurn = true;
|
modData.LeftForearm.IsBurn = true;
|
||||||
end
|
end
|
||||||
@@ -210,7 +196,7 @@ function OperateArm(partName, surgeonFact, useOven)
|
|||||||
modData.LeftArm.CicaTimeLeft = modData.LeftArm.CicaTimeLeft - (surgeonFact * 200);
|
modData.LeftArm.CicaTimeLeft = modData.LeftArm.CicaTimeLeft - (surgeonFact * 200);
|
||||||
modData.LeftForearm.CicaTimeLeft = modData.LeftForearm.CicaTimeLeft - (surgeonFact * 200);
|
modData.LeftForearm.CicaTimeLeft = modData.LeftForearm.CicaTimeLeft - (surgeonFact * 200);
|
||||||
modData.LeftHand.CicaTimeLeft = modData.LeftHand.CicaTimeLeft - (surgeonFact * 200);
|
modData.LeftHand.CicaTimeLeft = modData.LeftHand.CicaTimeLeft - (surgeonFact * 200);
|
||||||
if UseOven then
|
if useOven then
|
||||||
modData.LeftHand.IsBurn = true;
|
modData.LeftHand.IsBurn = true;
|
||||||
modData.LeftForearm.IsBurn = true;
|
modData.LeftForearm.IsBurn = true;
|
||||||
modData.LeftArm.IsBurn = true;
|
modData.LeftArm.IsBurn = true;
|
||||||
@@ -218,23 +204,21 @@ function OperateArm(partName, surgeonFact, useOven)
|
|||||||
end
|
end
|
||||||
|
|
||||||
FixDeepWound(partName)
|
FixDeepWound(partName)
|
||||||
|
|
||||||
|
|
||||||
player:transmitModData();
|
player:transmitModData();
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function FixDeepWound(partName)
|
function FixDeepWound(partName)
|
||||||
|
|
||||||
a_rightArm = {"RightArm", "RightForearm", "RightHand"}
|
local a_rightArm = {"RightArm", "RightForearm", "RightHand"}
|
||||||
a_rightForearm = {"RightForearm", "RightHand"}
|
local a_rightForearm = {"RightForearm", "RightHand"}
|
||||||
a_rightHand = {"RightHand"}
|
local a_rightHand = {"RightHand"}
|
||||||
|
|
||||||
a_leftArm = {"LeftArm", "LeftForearm", "LeftHand"}
|
|
||||||
a_leftForearm = {"LeftForearm", "LeftHand"}
|
|
||||||
a_leftHand = {"LeftHand"}
|
|
||||||
|
|
||||||
|
local a_leftArm = {"LeftArm", "LeftForearm", "LeftHand"}
|
||||||
|
local a_leftForearm = {"LeftForearm", "LeftHand"}
|
||||||
|
local a_leftHand = {"LeftHand"}
|
||||||
|
|
||||||
|
local chosen_array = {}
|
||||||
if partName == "RightArm" then
|
if partName == "RightArm" then
|
||||||
chosen_array = a_rightArm
|
chosen_array = a_rightArm
|
||||||
|
|
||||||
|
|||||||
@@ -132,15 +132,16 @@ local function setDescUI(partName)
|
|||||||
descUI["textTitle"]:setText(getDisplayText_TOC(partName));
|
descUI["textTitle"]:setText(getDisplayText_TOC(partName));
|
||||||
descUI.partNameAct = partName;
|
descUI.partNameAct = partName;
|
||||||
|
|
||||||
|
-- Cut and equip
|
||||||
|
if partData.IsCut and partData.IsCicatrized and partData.IsEquiped then
|
||||||
if partData.IsCut and partData.IsCicatrized and partData.IsEquiped then -- Cut and equip
|
|
||||||
descUI["textEtat"]:setText("Cut and healed");
|
descUI["textEtat"]:setText("Cut and healed");
|
||||||
descUI["textEtat"]:setColor(1, 0, 1, 0);
|
descUI["textEtat"]:setColor(1, 0, 1, 0);
|
||||||
descUI["b1"]:setText("Unequip");
|
descUI["b1"]:setText("Unequip");
|
||||||
descUI["b1"]:addArg("option", "Unequip");
|
descUI["b1"]:addArg("option", "Unequip");
|
||||||
descUI["b1"]:setVisible(true);
|
descUI["b1"]:setVisible(true);
|
||||||
elseif partData.IsCut and partData.IsCicatrized and not partData.IsEquiped and partData.ToDisplay then -- Cut and healed
|
|
||||||
|
-- Cut and healed
|
||||||
|
elseif partData.IsCut and partData.IsCicatrized and not partData.IsEquiped and partData.ToDisplay then
|
||||||
descUI["textEtat"]:setText("Cut and healed");
|
descUI["textEtat"]:setText("Cut and healed");
|
||||||
descUI["textEtat"]:setColor(1, 0, 1, 0);
|
descUI["textEtat"]:setColor(1, 0, 1, 0);
|
||||||
if partName == "RightArm" or partName == "LeftArm" then
|
if partName == "RightArm" or partName == "LeftArm" then
|
||||||
@@ -151,10 +152,9 @@ local function setDescUI(partName)
|
|||||||
descUI["b1"]:setVisible(true);
|
descUI["b1"]:setVisible(true);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Cut but not healed
|
||||||
elseif partData.IsCut and not partData.IsCicatrized and partData.ToDisplay then -- Cut not healed
|
elseif partData.IsCut and not partData.IsCicatrized and partData.ToDisplay then
|
||||||
|
if partData.IsOperated then
|
||||||
if partData.IsOperated then:
|
|
||||||
if partData.CicaTimeLeft > 1000 then
|
if partData.CicaTimeLeft > 1000 then
|
||||||
descUI["textEtat"]:setText("Still a long way to go")
|
descUI["textEtat"]:setText("Still a long way to go")
|
||||||
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2);
|
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2);
|
||||||
@@ -162,12 +162,13 @@ local function setDescUI(partName)
|
|||||||
descUI["textEtat"]:setText("Starting to get better")
|
descUI["textEtat"]:setText("Starting to get better")
|
||||||
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2)
|
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2)
|
||||||
|
|
||||||
elseif partData.CicaTime > 100
|
elseif partData.CicaTimeLeft > 100 then
|
||||||
descUI["textEtat"]:setText("Almost cicatrized");
|
descUI["textEtat"]:setText("Almost cicatrized");
|
||||||
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2);
|
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if partData.CicaTimeLeft > 1000 then
|
if partData.CicaTimeLeft > 1000 then
|
||||||
descUI["textEtat"]:setText("It hurts so much..." .. partData.CicaTimeLeft)
|
descUI["textEtat"]:setText("It hurts so much...")
|
||||||
descUI["textEtat"]:setColor(1, 1, 0, 0)
|
descUI["textEtat"]:setColor(1, 1, 0, 0)
|
||||||
elseif partData.CicaTimeLeft > 500 then
|
elseif partData.CicaTimeLeft > 500 then
|
||||||
descUI["textEtat"]:setText("It still hurts a lot")
|
descUI["textEtat"]:setText("It still hurts a lot")
|
||||||
@@ -175,13 +176,17 @@ local function setDescUI(partName)
|
|||||||
elseif partData.CicaTimeLeft > 500 then
|
elseif partData.CicaTimeLeft > 500 then
|
||||||
descUI["textEtat"]:setText("I think it's almost over...")
|
descUI["textEtat"]:setText("I think it's almost over...")
|
||||||
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2)
|
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- Set visibility
|
||||||
if partData.IsOperated then
|
if partData.IsOperated then
|
||||||
descUI["b1"]:setVisible(false)
|
descUI["b1"]:setVisible(false);
|
||||||
else
|
else
|
||||||
descUI["b1"]:setText("Operate")
|
descUI["b1"]:setText("Operate");
|
||||||
descUI["b1"]:addArg("option", "Operate")
|
descUI["b1"]:addArg("option", "Operate");
|
||||||
descUI["b1"]:setVisible(true)
|
descUI["b1"]:setVisible(true);
|
||||||
end
|
end
|
||||||
elseif partData.IsCut and not partData.ToDisplay then -- Empty (hand if forearm cut)
|
elseif partData.IsCut and not partData.ToDisplay then -- Empty (hand if forearm cut)
|
||||||
descUI["textEtat"]:setText("Nothing here...");
|
descUI["textEtat"]:setText("Nothing here...");
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ end
|
|||||||
local function everyTenMinutes()
|
local function everyTenMinutes()
|
||||||
local player = getPlayer()
|
local player = getPlayer()
|
||||||
local modData = player:getModData()
|
local modData = player:getModData()
|
||||||
|
|
||||||
if modData.TOC ~= nil then
|
if modData.TOC ~= nil then
|
||||||
local names = {"RightHand", "RightForearm", "RightArm", "LeftHand", "LeftForearm", "LeftArm"}
|
local names = {"RightHand", "RightForearm", "RightArm", "LeftHand", "LeftForearm", "LeftArm"}
|
||||||
|
|
||||||
@@ -34,14 +33,8 @@ local function everyTenMinutes()
|
|||||||
|
|
||||||
--Reduit le temps de cicatri restant
|
--Reduit le temps de cicatri restant
|
||||||
for i,name in pairs(names) do
|
for i,name in pairs(names) do
|
||||||
|
|
||||||
if modData.TOC[name].IsCut and not modData.TOC[name].IsCicatrized then
|
if modData.TOC[name].IsCut and not modData.TOC[name].IsCicatrized then
|
||||||
|
modData.TOC[name].CicaTimeLeft = modData.TOC[name].CicaTimeLeft - 1;
|
||||||
if modData.TOC[name].IsOperated then
|
|
||||||
modData.TOC[name].CicaTimeLeft = modData.TOC[name].CicaTimeLeft - 1;
|
|
||||||
else
|
|
||||||
modData.TOC[name].CicaTimeLeft = modData.TOC[name].CicaTimeLeft - 10;
|
|
||||||
|
|
||||||
player:transmitModData()
|
player:transmitModData()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ UI_EN = {
|
|||||||
UI_ContextMenu_CutArm = "Cut arm",
|
UI_ContextMenu_CutArm = "Cut arm",
|
||||||
|
|
||||||
UI_prof_surgeon = "Surgeon",
|
UI_prof_surgeon = "Surgeon",
|
||||||
UI_profdesc_surgeon = "You are a surgeon ! Start with all recipe of the mod the only cure.<br>You are also better to cut and operate.",
|
UI_profdesc_surgeon = "You are a surgeon! Start with all recipe of the mod the only cure.<br>You are also better to cut and operate.",
|
||||||
|
|
||||||
UI_trait_Amputee1 = "Amputee hand",
|
UI_trait_Amputee1 = "Amputee hand",
|
||||||
UI_trait_Amputee1desc = "Begin the game a hand cut and heal but also a metal hook.",
|
UI_trait_Amputee1desc = "Begin the game without a hand but also a metal hook.",
|
||||||
UI_trait_Amputee2 = "Amputee forearm",
|
UI_trait_Amputee2 = "Amputee forearm",
|
||||||
UI_trait_Amputee2desc = "Begin the game a forearm cut and heal but also a metal hook.",
|
UI_trait_Amputee2desc = "Begin the game without a forearm but also a metal hook.",
|
||||||
UI_trait_Amputee3 = "Amputee arm",
|
UI_trait_Amputee3 = "Amputee arm",
|
||||||
UI_trait_Amputee3desc = "Begin the game an arm cut and heal, good luck.",
|
UI_trait_Amputee3desc = "Begin the game without an arm, good luck.",
|
||||||
UI_trait_Insensitive = "Insensitive to pain",
|
UI_trait_Insensitive = "Insensitive to pain",
|
||||||
UI_trait_Insensitivedesc = "Reduces maximum pain.",
|
UI_trait_Insensitivedesc = "Reduces maximum pain.",
|
||||||
|
|
||||||
@@ -25,8 +25,8 @@ UI_EN = {
|
|||||||
UI_ContextMenu_LeftArm = "Left arm",
|
UI_ContextMenu_LeftArm = "Left arm",
|
||||||
|
|
||||||
UI_ContextMenu_My = "My ",
|
UI_ContextMenu_My = "My ",
|
||||||
UI_ContextMenu_Now_cut = " is now heal !",
|
UI_ContextMenu_Now_cut = " is now healed!",
|
||||||
|
|
||||||
UI_ContextMenu_Heal_from_zomb = "I heal from zombification !",
|
UI_ContextMenu_Heal_from_zomb = "I heal from zombification !",
|
||||||
UI_ContextMenu_Cut_for_nothing = "I cut for nothing..."
|
UI_ContextMenu_Cut_for_nothing = "I did it for nothing..."
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user