first commit

This commit is contained in:
Pao
2023-01-09 22:01:35 +01:00
commit 55c338f976
129 changed files with 3103 additions and 0 deletions

BIN
generic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 KiB

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

16
media/README.md Normal file
View File

@@ -0,0 +1,16 @@
# The only cure - PZ mod
Bitten by a zombie? Do not panic ! At least if it's at the level of the arms.
I introduce you the only cure. The saw.
If you apply the saw to the infected area a maximum of 12 hours after being bitten. The infection will go away and you can resume your life as normal!
Small flat on the other hand, during the application of the remedy you risk to scream very loudly. That's why I recommend having a box of painkillers with you at this time. (The fuller the box, the more efficient).
I also recommend having a bandage, with alcohol is better, at the time to reduce healing time.
Once the saw is applied, you end up with a wound that needs to heal. For that you can wait but it takes a lot of time. You can also operate with a surgeon's kit to speed up the process. There are three craftable kits, some better than others. You can also heal instantly by using an oven but that gonna leave a mark.
Now with your hand cut off, everything will take a long time and some actions (like holding a weapon in your hand) are no longer available. But then how to do? Once again, don't panic. I also offer prostheses to replace your severed limb! (Not available for fully cut arms).
There are 3 prosthesis models, wooden hook, metal hook and metal hand. Equipped with a better prosthesis to reduce the time taken for actions. You need to be fully heal to equip it.
# Context
This is the beta of my first mod, it means that the main features are there, but I'm still adding features and fixing bugs. I also learn how to use git with this mod. I envy an act 2 to my mod for the legs once it is finished. If you want to redo the model, texture and icon, you are welcome! Contact me on the official game discord. @MrBounty. If you encounter a bug, try to detail as much as possible the conditions for the appearance of the bug. Like the exact action that created this bug and the previous few actions, or whatever you think is relevant.

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmLeft_MetalHand_hand</m_MaleModel>
<m_FemaleModel>ArmLeft_MetalHand_hand_female</m_FemaleModel>
<m_GUID>2101af26-54b9-455b-abc0-7533ce37f84b</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Clothes\metal</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmLeft_MetalHand_fore</m_MaleModel>
<m_FemaleModel>ArmLeft_MetalHand_fore_female</m_FemaleModel>
<m_GUID>0405a4c0-f71b-45a8-9edc-489fc81dca39</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Clothes\metal</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmLeft_Hook_hand</m_MaleModel>
<m_FemaleModel>ArmLeft_Hook_hand_female</m_FemaleModel>
<m_GUID>6b4f4e13-d51f-48ab-80b0-6e0923650fc4</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Clothes\metal</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmLeft_Hook_fore</m_MaleModel>
<m_FemaleModel>ArmLeft_Hook_fore_female</m_FemaleModel>
<m_GUID>129ee688-d4bb-4297-8eb2-f88974001217</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Clothes\metal</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmLeft_Hook_hand</m_MaleModel>
<m_FemaleModel>ArmLeft_Hook_hand_female</m_FemaleModel>
<m_GUID>0def629e-fe4f-4485-bdae-2d6032e150be</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Clothes\wood</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmLeft_Hook_fore</m_MaleModel>
<m_FemaleModel>ArmLeft_Hook_fore_female</m_FemaleModel>
<m_GUID>aea8e02a-cba0-48d0-9eb0-7087651306b0</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Clothes\wood</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmLeft_noArm</m_MaleModel>
<m_FemaleModel>ArmLeft_noArm</m_FemaleModel>
<m_GUID>646cafa5-3fa1-41af-9ca0-aa57cca3b36d</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<m_Masks>3</m_Masks>
<m_Masks>4</m_Masks>
<textureChoices>Clothes\prototype</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmLeft_noForeArm</m_MaleModel>
<m_FemaleModel>ArmLeft_noForeArm</m_FemaleModel>
<m_GUID>d3816fe0-48e1-4cf5-a8e4-48c72595edb4</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<m_Masks>3</m_Masks>
<m_Masks>4</m_Masks>
<textureChoices>Clothes\prototype</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmLeft_noHand</m_MaleModel>
<m_FemaleModel>ArmLeft_noHand</m_FemaleModel>
<m_GUID>2de93af2-b7a8-4c04-84d1-28d92cce8a0f</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<m_Masks>4</m_Masks>
<textureChoices>Clothes\prototype</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmRight_MetalHand_hand</m_MaleModel>
<m_FemaleModel>ArmRight_MetalHand_hand_female</m_FemaleModel>
<m_GUID>731c280a-9682-4e2e-84cf-470bf00dd02f</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Clothes\metal</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmRight_MetalHand_fore</m_MaleModel>
<m_FemaleModel>ArmRight_MetalHand_fore_female</m_FemaleModel>
<m_GUID>27758f1e-6298-42eb-b027-b9be31465c11</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Clothes\metal</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmRight_Hook_hand</m_MaleModel>
<m_FemaleModel>ArmRight_Hook_hand_female</m_FemaleModel>
<m_GUID>dd7b749b-7e81-4547-91b0-81b1a1e9f7b8</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Clothes\metal</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmRight_Hook_forearm</m_MaleModel>
<m_FemaleModel>ArmRight_Hook_forearm_female</m_FemaleModel>
<m_GUID>1eb56768-d7ef-46e4-ac07-91d0e43d15fb</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Clothes\metal</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmRight_Hook_hand</m_MaleModel>
<m_FemaleModel>ArmRight_Hook_hand_female</m_FemaleModel>
<m_GUID>1fcc7523-d577-4cb0-a019-f077ef281d3a</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Clothes\wood</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmRight_Hook_forearm</m_MaleModel>
<m_FemaleModel>ArmRight_Hook_forearm_female</m_FemaleModel>
<m_GUID>714b78a7-8895-4f48-a29d-b6f12909db0e</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<textureChoices>Clothes\wood</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmRight_noArm</m_MaleModel>
<m_FemaleModel>ArmRight_noArm</m_FemaleModel>
<m_GUID>db8ccad2-b76f-44bd-93ab-1eefa25beade</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<m_Masks>5</m_Masks>
<m_Masks>6</m_Masks>
<textureChoices>Clothes\prototype</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmRight_noForeArm</m_MaleModel>
<m_FemaleModel>ArmRight_noForeArm</m_FemaleModel>
<m_GUID>e6f80efd-22e5-49e0-8b24-537519d42b37</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<m_Masks>5</m_Masks>
<m_Masks>6</m_Masks>
<textureChoices>Clothes\prototype</textureChoices>
</clothingItem>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>ArmRight_noHand</m_MaleModel>
<m_FemaleModel>ArmRight_noHand</m_FemaleModel>
<m_GUID>f114e53a-b92e-4639-8d8c-2b43ab981885</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<m_Masks>6</m_Masks>
<textureChoices>Clothes\prototype</textureChoices>
</clothingItem>

76
media/fileGuidTable.xml Normal file
View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<fileGuidTable>
<files>
<path>media/clothing/clothingItems/ArmRight_noHand.xml</path>
<guid>f114e53a-b92e-4639-8d8c-2b43ab981885</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmRight_noForeArm.xml</path>
<guid>e6f80efd-22e5-49e0-8b24-537519d42b37</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmRight_noArm.xml</path>
<guid>db8ccad2-b76f-44bd-93ab-1eefa25beade</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmLeft_noHand.xml</path>
<guid>2de93af2-b7a8-4c04-84d1-28d92cce8a0f</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmLeft_noForeArm.xml</path>
<guid>d3816fe0-48e1-4cf5-a8e4-48c72595edb4</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmLeft_noArm.xml</path>
<guid>646cafa5-3fa1-41af-9ca0-aa57cca3b36d</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmRight_WoodenHook.xml</path>
<guid>1fcc7523-d577-4cb0-a019-f077ef281d3a</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmLeft_WoodenHook.xml</path>
<guid>0def629e-fe4f-4485-bdae-2d6032e150be</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmRight_MetalHook.xml</path>
<guid>dd7b749b-7e81-4547-91b0-81b1a1e9f7b8</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmLeft_MetalHook.xml</path>
<guid>6b4f4e13-d51f-48ab-80b0-6e0923650fc4</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmRight_MetalHand.xml</path>
<guid>731c280a-9682-4e2e-84cf-470bf00dd02f</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmLeft_MetalHand.xml</path>
<guid>2101af26-54b9-455b-abc0-7533ce37f84b</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmRight_WoodenHook_fore.xml</path>
<guid>714b78a7-8895-4f48-a29d-b6f12909db0e</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmRight_MetalHook_fore.xml</path>
<guid>1eb56768-d7ef-46e4-ac07-91d0e43d15fb</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmRight_MetalHand_fore.xml</path>
<guid>27758f1e-6298-42eb-b027-b9be31465c11</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmLeft_WoodenHook_fore.xml</path>
<guid>aea8e02a-cba0-48d0-9eb0-7087651306b0</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmLeft_MetalHook_fore.xml</path>
<guid>129ee688-d4bb-4297-8eb2-f88974001217</guid>
</files>
<files>
<path>media/clothing/clothingItems/ArmLeft_MetalHand_fore.xml</path>
<guid>0405a4c0-f71b-45a8-9edc-489fc81dca39</guid>
</files>
</fileGuidTable>

View File

@@ -0,0 +1,100 @@
local function healUpdatePart(partName, modData, player)
local modData_part = modData.TOC[partName];
local bodyDamage = player:getBodyDamage();
local bodyPart = bodyDamage:getBodyPart(TOC_getBodyPart(partName));
if not bodyPart then
print("TOC ERROR : Can't update health of " .. partName);
return fasle;
end
local isBand = false;
local bandLife = 0;
local bandType = "";
if bodyPart:bandaged() then isBand = true; bandLife = bodyPart:getBandageLife(); bandType = bodyPart:getBandageType() end
--Set max heal
if modData_part.IsCicatrized and bodyPart:getHealth() > 80 then
bodyPart:SetHealth(80);
elseif bodyPart:getHealth() > 40 then
bodyPart:SetHealth(40);
end
--Heal
if modData_part.IsCicatrized then
if bodyPart:deepWounded() then bodyPart:setDeepWounded(false) end
if bodyPart:bleeding() then bodyPart:setBleeding(false) end
end
if bodyPart:bitten() then
bodyPart:SetBitten(false);
if not modData.TOC.OtherBody_IsInfected and not isOtherArmInfect(modData, partName) then
bodyDamage:setInfected(false);
bodyDamage:setInfectionMortalityDuration(-1);
bodyDamage:setInfectionTime(-1);
bodyDamage:setInfectionLevel(0);
local bodyParts = bodyDamage:getBodyParts();
for i=bodyParts:size()-1, 0, -1 do
local bodyPart = bodyParts:get(i);
bodyPart:SetInfected(false);
end
end
end
if bodyPart:scratched() then bodyPart:setScratched(false, false) end
if bodyPart:haveGlass() then bodyPart:setHaveGlass(false) end
if bodyPart:haveBullet() then bodyPart:setHaveBullet(false, 0) end
if bodyPart:isInfectedWound() then bodyPart:setInfectedWound(false) end
if bodyPart:isBurnt() then bodyPart:setBurnTime(0) end
if bodyPart:isCut() then bodyPart:setCut(false, false) end
if bodyPart:getFractureTime()>0 then bodyPart:setFractureTime(0) end
-- 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.CicaTimeLeft < 0 then
player:Say(getText('UI_ContextMenu_My') .. partName .. getText('UI_ContextMenu_Now_cut')) -- dunno if this works.
modData_part.IsCicatrized = true;
player:getTraits():add("Brave")
player:getTraits():add("Insensitive")
bodyPart:setBleeding(false);
bodyPart:setDeepWounded(false);
bodyPart:setBleedingTime(0);
bodyPart:setDeepWoundTime(0);
player:transmitModData()
end
end
--Phantom pain
if modData_part.ToDisplay then
if ZombRand(1, 100) < 10 then
if modData_part.IsBurn then x = 60 else x = 30 end
bodyPart:setAdditionalPain(ZombRand(1, x));
end
end
if isBand then bodyPart:setBandaged(true, bandLife, false, bandType) end
end
local function isOtherArmInfect(modData, partName)
local names = {"RightHand", "RightForearm", "RightArm", "LeftHand", "LeftForearm", "LeftArm"}
names[partName] = nil;
for i,v in pairs(names) do
if modData.TOC[v].IsInfected then return true end
end
return false
end
function UpdatePlayerHealth(player, modData)
local bodyDamage = player:getBodyDamage()
local partNames = {"RightHand", "RightForearm", "RightArm", "LeftHand", "LeftForearm", "LeftArm"}
if player:HasTrait("Insensitive") then bodyDamage:setPainReduction(49) end
for i,name in pairs(partNames) do
if modData.TOC[name].IsCut then healUpdatePart(name, modData, player) end
end
end

View File

@@ -0,0 +1,16 @@
function CheckIfInfect(player, modData)
local bd = player:getBodyDamage()
local Keys = {BodyPartType.Torso_Upper, BodyPartType.Torso_Lower, BodyPartType.Head, BodyPartType.Neck, BodyPartType.Groin, BodyPartType.UpperLeg_L, BodyPartType.UpperLeg_R, BodyPartType.LowerLeg_L, BodyPartType.LowerLeg_R, BodyPartType.Foot_L, BodyPartType.Foot_R, BodyPartType.Back}
if bd:getBodyPart(BodyPartType.Hand_R):bitten() and not modData.TOC.RightHand.IsCut then modData.TOC.RightHand.IsInfected = true; player:transmitModData()
elseif bd:getBodyPart(BodyPartType.ForeArm_R):bitten() and not modData.TOC.RightForearm.IsCut then modData.TOC.RightForearm.IsInfected = true; player:transmitModData()
elseif bd:getBodyPart(BodyPartType.UpperArm_R):bitten() and not modData.TOC.RightArm.IsCut then modData.TOC.RightArm.IsInfected = true; player:transmitModData()
elseif bd:getBodyPart(BodyPartType.Hand_L):bitten() and not modData.TOC.LeftHand.IsCut then modData.TOC.LeftHand.IsInfected = true; player:transmitModData()
elseif bd:getBodyPart(BodyPartType.ForeArm_L):bitten() and not modData.TOC.LeftForearm.IsCut then modData.TOC.LeftForearm.IsInfected = true; player:transmitModData()
elseif bd:getBodyPart(BodyPartType.UpperArm_L):bitten() and not modData.TOC.LeftArm.IsCut then modData.TOC.LeftArm.IsInfected = true; player:transmitModData()
else
for index, value in ipairs(Keys) do
if bd:getBodyPart(value):bitten() then modData.TOC.OtherBody_IsInfected = true; player:transmitModData() end
end
end
end

View File

@@ -0,0 +1,94 @@
--- A rly big thx to Fenris_Wolf and Chuck to help me with that. Love you guy
local Commands = {}
-- Surgeon (send)
function SendCutArm(player, partName, surgeonFact, useBandage, bandageAlcool, usePainkiller, painkillerCount)
local arg = {};
arg["From"] = getPlayer():getOnlineID();
arg["To"] = player:getOnlineID();
arg["command"] = "CutArm";
arg["toSend"] = {partName, surgeonFact, useBandage, bandageAlcool, usePainkiller, painkillerCount};
sendClientCommand("TOC", "SendServer", arg);
end
function SendOperateArm(player, partName, surgeonFact, useOven)
local arg = {};
arg["From"] = getPlayer():getOnlineID();
arg["To"] = player:getOnlineID();
arg["command"] = "OperateArm";
arg["toSend"] = {partName, surgeonFact, useOven};
sendClientCommand("TOC", "SendServer", arg);
end
function AskCanCutArm(player, partName)
GetConfirmUIMP().responseReceive = false;
local arg = {};
arg["From"] = getPlayer():getOnlineID();
arg["To"] = player:getOnlineID();
arg["command"] = "CanCutArm";
arg["toSend"] = partName;
sendClientCommand("TOC", "SendServer", arg);
end
function AskCanOperateArm(player, partName)
GetConfirmUIMP().responseReceive = false;
local arg = {};
arg["From"] = getPlayer():getOnlineID();
arg["To"] = player:getOnlineID();
arg["command"] = "CanOperateArm";
arg["toSend"] = partName;
sendClientCommand("TOC", "SendServer", arg);
end
Commands["responseCanArm"] = function(arg)
local ui = GetConfirmUIMP()
ui.responseReceive = true;
ui.responseAction = arg["toSend"][2];
ui.responsePartName = arg["toSend"][1];
ui.responseCan = arg["toSend"][3];
ui.responseUserName = getPlayerByOnlineID(arg["From"]):getUsername();
ui.responseActionIsBitten = getPlayerByOnlineID(arg["From"]):getBodyDamage():getBodyPart(TOC_getBodyPart(ui.responsePartName)):bitten();
end
-- Patient (receive)
Commands["CutArm"] = function(arg)
local arg = arg["toSend"];
CutArm(arg[1], arg[2], arg[3], arg[4], arg[5], arg[6]);
end
Commands["OperateArm"] = function(arg)
local arg = arg["toSend"];
OperateArm(arg[1], arg[2], arg[3]);
end
Commands["CanCutArm"] = function(arg)
local partName = arg["toSend"];
arg["To"] = arg["From"];
arg["From"] = getPlayer():getOnlineID();
arg["command"] = "responseCanArm";
arg["toSend"] = {partName, "Cut", CanBeCut(partName)};
sendClientCommand("TOC", "SendServer", arg);
end
Commands["CanOperateArm"] = function(arg)
local partName = arg["toSend"];
arg["To"] = arg["From"];
arg["From"] = getPlayer():getOnlineID();
arg["command"] = "responseCanArm";
arg["toSend"] = {partName, "Operate", CanBeOperate(partName)};
sendClientCommand("TOC", "SendServer", arg);
end
-- Event
local onServerCommand = function(module, command, args)
if module == "TOC" and Commands[command] then
args = args or {}
Commands[command](args)
end
end
Events.OnServerCommand.Add(onServerCommand)

View File

@@ -0,0 +1,103 @@
local function operateLocal(partName)
local player = getPlayer();
ISTimedActionQueue.add(ISOperateArm:new(player, player, _, partName, true));
end
local function otherPlayerLocal(_, partName, action, patient)
local ui = GetConfirmUIMP();
if not ui then
MakeConfirmUIMP();
ui = GetConfirmUIMP();
end
if action == "Cut" then
AskCanCutArm(patient, partName);
else
AskCanOperateArm(patient, partName);
end
ui.actionAct = action;
ui.partNameAct = partName;
ui.patient = patient;
SetConfirmUIMP("Wait server");
end
local function TOC_onFillWorldObjectContextMenu(playerId, context, worldobjects, _)
local player = getSpecificPlayer(playerId);
local clickedPlayer
local modData = player:getModData();
for _,object in ipairs(worldobjects) do
local square = object:getSquare()
if square then
for i=1,square:getObjects():size() do
local object2 = square:getObjects():get(i-1);
--For the oven operate part
if instanceof(object2, "IsoStove") and (player:HasTrait("Brave") or player:getPerkLevel(Perks.Strength) >= 6) then
if not object2:isMicrowave() and object2:getCurrentTemperature() > 250 then
local rootMenu = context:addOption(getText('UI_ContextMenu_OperateOven'), worldobjects, nil);
local subMenu = context:getNew(context);
context:addSubMenu(rootMenu, subMenu)
if modData.TOC.RightHand.IsCut and not modData.TOC.RightForearm.IsCut and not modData.TOC.RightHand.IsOperated then
subMenu:addOption(getText('UI_ContextMenu_RightHand'), worldobjects, operateLocal, "RightHand");
end
if modData.TOC.LeftHand.IsCut and not modData.TOC.LeftForearm.IsCut and not modData.TOC.LeftHand.IsOperated then
subMenu:addOption(getText('UI_ContextMenu_LeftHand'), worldobjects, operateLocal, "LeftHand");
end
if modData.TOC.RightForearm.IsCut and not modData.TOC.RightArm.IsCut and not modData.TOC.RightForearm.IsOperated then
subMenu:addOption(getText('UI_ContextMenu_RightForearm'), worldobjects, operateLocal, "RightForearm");
end
if modData.TOC.LeftForearm.IsCut and not modData.TOC.LeftArm.IsCut and not modData.TOC.LeftForearm.IsOperated then
subMenu:addOption(getText('UI_ContextMenu_LeftForearm'), worldobjects, operateLocal, "LeftForearm");
end
if modData.TOC.RightArm.IsCut and not modData.TOC.RightArm.IsOperated then
subMenu:addOption(getText('UI_ContextMenu_RightArm'), worldobjects, operateLocal, "RightArm");
end
if modData.TOC.LeftArm.IsCut and not modData.TOC.LeftArm.IsOperated then
subMenu:addOption(getText('UI_ContextMenu_LeftArm'), worldobjects, operateLocal, "LeftArm");
end
end
end
end
local movingObjects = square:getMovingObjects()
for i = 0, movingObjects:size() - 1 do
local o = movingObjects:get(i)
if instanceof(o, "IsoPlayer") then
clickedPlayer = o;
break
end
end
if clickedPlayer then
if not ((-1 < clickedPlayer:getX() - player:getX() and clickedPlayer:getX() - player:getX() < 1) and (-1 < clickedPlayer:getY() - player:getY() and clickedPlayer:getY() - player:getY() < 1)) then
return false;
end
local rootOption = context:addOption("The Only Cure on " .. clickedPlayer:getUsername());
local rootMenu = context:getNew(context);
local cutOption = rootMenu:addOption("Cut");
local operateOption = rootMenu:addOption("Operate");
local cutMenu = context:getNew(context);
local operateMenu = context:getNew(context);
context:addSubMenu(rootOption, rootMenu);
context:addSubMenu(cutOption, cutMenu);
context:addSubMenu(operateOption, operateMenu);
cutMenu:addOption(getText('UI_ContextMenu_RightHand'), worldobjects, otherPlayerLocal, "RightHand", "Cut", clickedPlayer);
cutMenu:addOption(getText('UI_ContextMenu_LeftHand'), worldobjects, otherPlayerLocal, "LeftHand", "Cut", clickedPlayer);
cutMenu:addOption(getText('UI_ContextMenu_RightForearm'), worldobjects, otherPlayerLocal, "RightForearm", "Cut", clickedPlayer);
cutMenu:addOption(getText('UI_ContextMenu_LeftForearm'), worldobjects, otherPlayerLocal, "LeftForearm", "Cut", clickedPlayer);
cutMenu:addOption(getText('UI_ContextMenu_RightArm'), worldobjects, otherPlayerLocal, "RightArm", "Cut", clickedPlayer);
cutMenu:addOption(getText('UI_ContextMenu_LeftArm'), worldobjects, otherPlayerLocal, "LeftArm", "Cut", clickedPlayer);
operateMenu:addOption(getText('UI_ContextMenu_RightHand'), worldobjects, otherPlayerLocal, "RightHand", "Operate", clickedPlayer);
operateMenu:addOption(getText('UI_ContextMenu_LeftHand'), worldobjects, otherPlayerLocal, "LeftHand", "Operate", clickedPlayer);
operateMenu:addOption(getText('UI_ContextMenu_RightForearm'), worldobjects, otherPlayerLocal, "RightForearm", "Operate", clickedPlayer);
operateMenu:addOption(getText('UI_ContextMenu_LeftForearm'), worldobjects, otherPlayerLocal, "LeftForearm", "Operate", clickedPlayer);
operateMenu:addOption(getText('UI_ContextMenu_RightArm'), worldobjects, otherPlayerLocal, "RightArm", "Operate", clickedPlayer);
operateMenu:addOption(getText('UI_ContextMenu_LeftArm'), worldobjects, otherPlayerLocal, "LeftArm", "Operate", clickedPlayer);
end
end
end
end
Events.OnFillWorldObjectContextMenu.Add(TOC_onFillWorldObjectContextMenu);

View File

@@ -0,0 +1,262 @@
local function cureInfection(bodyDamage)
bodyDamage:setInfected(false);
bodyDamage:setInfectionMortalityDuration(-1);
bodyDamage:setInfectionTime(-1);
bodyDamage:setInfectionLevel(0);
local bodyParts = bodyDamage:getBodyParts();
for i=bodyParts:size()-1, 0, -1 do
local bodyPart = bodyParts:get(i);
bodyPart:SetInfected(false);
end
end
function CutArm(partName, surgeonFact, useBandage, bandageAlcool, usePainkiller, painkillerCount)
local player = getPlayer();
local modData = player:getModData().TOC;
local bodyPart = player:getBodyDamage():getBodyPart(TOC_getBodyPart(partName));
--Set dommage of bodypart & stress & endu
local stats = player:getStats();
bodyPart:AddDamage(100 - surgeonFact);
bodyPart:setAdditionalPain(100 - surgeonFact);
bodyPart:setBleeding(true);
bodyPart:setBleedingTime(100 - surgeonFact);
bodyPart:setDeepWounded(true)
bodyPart:setDeepWoundTime(100 - surgeonFact);
stats:setEndurance(0 + surgeonFact);
stats:setStress(100 - surgeonFact);
--TODO this is broken
-- Bandage
--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
if usePainkiller then
for _ = 1,painkillerCount+1 do
player:getBodyDamage():JustTookPill(painkiller);
end
if painkillerCount < 10 then addSound(player, player:getX(), player:getY(), player:getZ(), 50-painkillerCount*5, 50-painkillerCount*5) end
else
addSound(player, player:getX(), player:getY(), player:getZ(), 50, 50)
end
-- Change modData
if bodyPart:getType() == BodyPartType.Hand_R then
modData.RightHand.IsCut = true;
modData.RightHand.ToDisplay = true;
modData.RightHand.CicaTimeLeft = 1700 - surgeonFact * 50;
elseif bodyPart:getType() == BodyPartType.ForeArm_R then
modData.RightForearm.IsCut = true; modData.RightHand.IsCut = true;
modData.RightForearm.ToDisplay = true; modData.RightHand.ToDisplay = false;
modData.RightHand.IsBurn = false;
modData.RightForearm.CicaTimeLeft = 1800 - surgeonFact * 50; modData.RightHand.CicaTimeLeft = 1800 - surgeonFact * 50;
elseif bodyPart:getType() == BodyPartType.UpperArm_R then
modData.RightArm.IsCut = true; modData.RightForearm.IsCut = true; modData.RightHand.IsCut = true;
modData.RightArm.ToDisplay = true; modData.RightForearm.ToDisplay = false; modData.RightHand.ToDisplay = false;
modData.RightHand.IsBurn = false; modData.RightForearm.IsBurn = false;
modData.RightArm.CicaTimeLeft = 2000 - surgeonFact * 50; modData.RightForearm.CicaTimeLeft = 2000 - surgeonFact * 50; modData.RightHand.CicaTimeLeft = 2000 - surgeonFact * 50;
elseif bodyPart:getType() == BodyPartType.Hand_L then
modData.LeftHand.IsCut = true;
modData.LeftHand.ToDisplay = true;
modData.LeftHand.CicaTimeLeft = 1700 - surgeonFact * 50;
elseif bodyPart:getType() == BodyPartType.ForeArm_L then
modData.LeftForearm.IsCut = true; modData.LeftHand.IsCut = true;
modData.LeftForearm.ToDisplay = true; modData.LeftHand.ToDisplay = false;
modData.LeftHand.IsBurn = false;
modData.LeftForearm.CicaTimeLeft = 1800 - surgeonFact * 50; modData.LeftHand.CicaTimeLeft = 1800 - surgeonFact * 50;
elseif bodyPart:getType() == BodyPartType.UpperArm_L then
modData.LeftArm.IsCut = true; modData.LeftForearm.IsCut = true; modData.LeftHand.IsCut = true;
modData.LeftArm.ToDisplay = true; modData.LeftForearm.ToDisplay = false; modData.LeftHand.ToDisplay = false;
modData.LeftHand.IsBurn = false; modData.LeftForearm.IsBurn = false;
modData.LeftArm.CicaTimeLeft = 2000 - surgeonFact * 50; modData.LeftForearm.CicaTimeLeft = 2000 - surgeonFact * 50; modData.LeftHand.CicaTimeLeft = 2000 - surgeonFact * 50;
end
--Heal the infection
local bd = player:getBodyDamage()
if bodyPart:getType() == BodyPartType.Hand_R then
if bd:getInfectionLevel() < 20 and modData.RightHand.IsInfected and not (modData.RightForearm.IsInfected or modData.RightArm.IsInfected or modData.LeftArm.IsInfected or modData.LeftForearm.IsInfected or modData.LeftHand.IsInfected or modData.OtherBody_IsInfected) then
player:Say("I healed !");
bd:getBodyPart(BodyPartType.Hand_R):SetBitten(false);
cureInfection(bd);
else
player:Say("I did that for nothing...");
end
modData.RightHand.IsInfected = false;
elseif bodyPart:getType() == BodyPartType.ForeArm_R then
if bd:getInfectionLevel() < 20 and modData.RightForearm.IsInfected and not (modData.RightArm.IsInfected or modData.LeftArm.IsInfected or modData.LeftForearm.IsInfected or modData.LeftHand.IsInfected or modData.OtherBody_IsInfected) then
player:Say("I healed !");
bd:getBodyPart(BodyPartType.Hand_R):SetBitten(false); bd:getBodyPart(BodyPartType.ForeArm_R):SetBitten(false);
cureInfection(bd);
else
player:Say("I did that for nothing...");
end
modData.RightHand.IsInfected = false;
modData.RightForearm.IsInfected = false;
elseif bodyPart:getType() == BodyPartType.UpperArm_R then
if bd:getInfectionLevel() < 20 and modData.RightArm.IsInfected and not (modData.LeftArm.IsInfected or modData.LeftForearm.IsInfected or modData.LeftHand.IsInfected or modData.OtherBody_IsInfected) then
player:Say("I healed !");
bd:getBodyPart(BodyPartType.Hand_R):SetBitten(false); bd:getBodyPart(BodyPartType.ForeArm_R):SetBitten(false); bd:getBodyPart(BodyPartType.UpperArm_R):SetBitten(false);
cureInfection(bd);
else
player:Say("I did that for nothing...");
end
modData.RightHand.IsInfected = false; modData.RightForearm.IsInfected = false; modData.RightArm.IsInfected = false;
elseif bodyPart:getType() == BodyPartType.Hand_L then
if bd:getInfectionLevel() < 20 and modData.LeftHand.IsInfected and not (modData.RightForearm.IsInfected or modData.RightArm.IsInfected or modData.LeftArm.IsInfected or modData.LeftForearm.IsInfected or modData.RightHand.IsInfected or modData.OtherBody_IsInfected) then
player:Say("I healed !");
bd:getBodyPart(BodyPartType.Hand_L):SetBitten(false);
cureInfection(bd);
else
player:Say("I did that for nothing...");
end
modData.LeftHand.IsInfected = false;
elseif bodyPart:getType() == BodyPartType.ForeArm_L then
if bd:getInfectionLevel() < 20 and modData.LeftForearm.IsInfected and not (modData.RightForearm.IsInfected or modData.RightArm.IsInfected or modData.LeftArm.IsInfected or modData.RightHand.IsInfected or modData.OtherBody_IsInfected) then
player:Say("I healed !");
bd:getBodyPart(BodyPartType.Hand_L):SetBitten(false); bd:getBodyPart(BodyPartType.ForeArm_L):SetBitten(false);
cureInfection(bd);
else
player:Say("I did that for nothing...");
end
modData.LeftHand.IsInfected = false; modData.LeftForearm.IsInfected = false;
elseif bodyPart:getType() == BodyPartType.UpperArm_L then
if bd:getInfectionLevel() < 20 and modData.LeftArm.IsInfected and not (modData.RightForearm.IsInfected or modData.RightArm.IsInfected or modData.RightHand.IsInfected or modData.OtherBody_IsInfected) then
player:Say("I healed !");
bd:getBodyPart(BodyPartType.Hand_L):SetBitten(false); bd:getBodyPart(BodyPartType.ForeArm_L):SetBitten(false); bd:getBodyPart(BodyPartType.UpperArm_L):SetBitten(false);
cureInfection(bd);
else
player:Say("I did that for nothing...");
end
modData.LeftHand.IsInfected = false; modData.LeftForearm.IsInfected = false; modData.LeftArm.IsInfected = false;
end
--Equip cloth
local cloth = player:getInventory():AddItem(find_clothName2_TOC(partName));
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();
end
function OperateArm(partName, surgeonFact, useOven)
local player = getPlayer();
local modData = player:getModData().TOC;
if UseOven then
local stats = character:getStats();
bodyPart:AddDamage(100);
bodyPart:setAdditionalPain(100);
stats:setEndurance(0);
stats:setStress(100);
end
if partName == "RightHand" and not modData.RightHand.IsOperated then
modData.RightHand.IsOperated = true;
modData.RightHand.CicaTimeLeft = modData.RightHand.CicaTimeLeft - (surgeonFact * 200);
if UseOven then modData.RightHand.IsBurn = true end
elseif partName == "RightForearm" and not modData.RightForearm.IsOperated then
modData.RightForearm.IsOperated = true;
modData.RightHand.IsOperated = true;
modData.RightForearm.CicaTimeLeft = modData.RightForearm.CicaTimeLeft - (surgeonFact * 200);
modData.RightHand.CicaTimeLeft = modData.RightHand.CicaTimeLeft - (surgeonFact * 200);
if UseOven then
modData.TOC.RightHand.IsBurn = true;
modData.TOC.RightForearm.IsBurn = true;
end
elseif partName == "RightArm" and not modData.RightArm.IsOperated then
modData.RightArm.IsOperated = true;
modData.RightForearm.IsOperated = true;
modData.RightHand.IsOperated = true;
modData.RightArm.CicaTimeLeft = modData.RightArm.CicaTimeLeft - (surgeonFact * 200);
modData.RightForearm.CicaTimeLeft = modData.RightForearm.CicaTimeLeft - (surgeonFact * 200);
modData.RightHand.CicaTimeLeft = modData.RightHand.CicaTimeLeft - (surgeonFact * 200);
if UseOven then
modData.RightHand.IsBurn = true;
modData.RightForearm.IsBurn = true;
modData.RightArm.IsBurn = true;
end
elseif partName == "LeftHand" and not modData.LeftHand.IsOperated then
modData.LeftHand.IsOperated = true;
modData.LeftHand.CicaTimeLeft = modData.LeftHand.CicaTimeLeft - (surgeonFact * 200);
if UseOven then modData.LeftHand.IsBurn = true end
elseif partName == "LeftForearm" and not modData.LeftForearm.IsOperated then
modData.LeftForearm.IsOperated = true;
modData.LeftHand.IsOperated = true;
modData.LeftForearm.CicaTimeLeft = modData.LeftForearm.CicaTimeLeft - (surgeonFact * 200);
modData.LeftHand.CicaTimeLeft = modData.LeftHand.CicaTimeLeft - (surgeonFact * 200);
if UseOven then
modData.LeftHand.IsBurn = true;
modData.LeftForearm.IsBurn = true;
end
elseif partName == "LeftArm" and not modData.LeftArm.IsOperated then
modData.LeftArm.IsOperated = true;
modData.LeftForearm.IsOperated = true;
modData.LeftHand.IsOperated = true;
modData.LeftArm.CicaTimeLeft = modData.LeftArm.CicaTimeLeft - (surgeonFact * 200);
modData.LeftForearm.CicaTimeLeft = modData.LeftForearm.CicaTimeLeft - (surgeonFact * 200);
modData.LeftHand.CicaTimeLeft = modData.LeftHand.CicaTimeLeft - (surgeonFact * 200);
if UseOven then
modData.LeftHand.IsBurn = true;
modData.LeftForearm.IsBurn = true;
modData.LeftArm.IsBurn = true;
end
end
FixDeepWound(partname)
player:transmitModData();
end
function FixDeepWound(partName)
a_rightArm = {"RightArm", "RightForearm", "RightHand"}
a_rightForearm = {"RightForearm", "RightHand"}
a_rightHand = {"RightHand"}
a_leftArm = {"LeftArm", "LeftForearm", "LeftHand"}
a_leftForearm = {"LeftForearm", "LeftHand"}
a_leftHand = {"LeftHand"}
if partName == "RightArm" then
chosen_array = a_rightArm
elseif partName == "RightForearm" then
chosen_array = a_rightForearm
elseif partName == "RightHand" then
chosen_array = a_rightHand
elseif partName == "LeftArm" then
chosen_array = a_leftArm
elseif partName == "LeftForearm" then
chosen_array = a_leftForearm
elseif partName == "LeftHand" then
chosen_array = a_leftHand
end
for k,v in pairs(chosen_array) do
local tmpBodyPart = bodyDamage:getBodyPart(TOC_getBodyPart(v));
tmpBodyPart:setDeepWounded(false); -- Basically like stictching
tmpBodyPart:setDeepWoundTime(0);
bodyPart:setBleeding(true);
bodyPart:setBleedingTime(10); -- Reset the bleeding
end
end

583
media/lua/client/TOC_UI.lua Normal file
View File

@@ -0,0 +1,583 @@
local mainUI, descUI, confirmUI, confirmUIMP
function GetConfirmUIMP()
return confirmUIMP;
end
-- Usefull
local function prerenderFuncMP()
local toSee = confirmUIMP;
if confirmUIMP.responseReceive then
if not confirmUIMP.responseCan then
getPlayer():Say("I can't do that !")
confirmUIMP.responseReceive = false;
confirmUIMP:close();
return false;
end
SetConfirmUIMP(confirmUIMP.responseAction, confirmUIMP.responseIsBitten, confirmUIMP.responseUserName, confirmUIMP.responsePartName);
end
end
local function isPlayerHaveSaw()
local playerInv = getPlayer():getInventory();
local item = playerInv:getItemFromType('Saw') or playerInv:getItemFromType('GardenSaw') or playerInv:getItemFromType('Chainsaw');
return item;
end
local function isPlayerHavePainkiller()
local playerInv = getPlayer():getInventory();
local item = playerInv:getItemFromType('Pills');
return item;
end
local function isPlayerHaveBandage()
local playerInv = getPlayer():getInventory();
local item = playerInv:getItemFromType('AlcoholBandage') or playerInv:getItemFromType('Bandage');
return item;
end
local function getImageName(partName, modData)
local partData = modData[partName];
local name = "";
if partData.IsCut and partData.IsCicatrized and partData.IsEquiped then -- Cut and equip
if partName == "RightHand" or partName == "LeftHand" then
name = "media/ui/TOC/" .. partName .. "/Hook.png";
else
name = "media/ui/TOC/" .. partName .. "/Prothesis.png";
end
elseif partData.IsCut and partData.IsCicatrized and not partData.IsEquiped and partData.ToDisplay then -- Cut and heal
name = "media/ui/TOC/" .. partName .. "/Cut.png";
elseif partData.IsCut and not partData.IsCicatrized and partData.ToDisplay and not partData.IsOperated then -- Cut not heal
name = "media/ui/TOC/" .. partName .. "/Bleed.png";
elseif partData.IsCut and not partData.IsCicatrized and partData.ToDisplay and partData.IsOperated then -- Cut not heal
name = "media/ui/TOC/" .. partName .. "/Operate.png";
elseif partData.IsCut and not partData.ToDisplay then -- Empty (like hand if forearm cut)
name = "media/ui/TOC/Empty.png";
elseif not partData.IsCut and getPlayer():getBodyDamage():getBodyPart(TOC_getBodyPart(partName)):bitten() then -- Not cut but bitten
name = "media/ui/TOC/" .. partName .. "/Bite.png";
else -- Not cut
name = "media/ui/TOC/" .. partName .. "/Base.png";
end
-- If foreaerm equip, change hand
if partName == "RightHand" and modData["RightForearm"].IsEquiped then
name = "media/ui/TOC/" .. partName .. "/Hook.png";
elseif partName == "LeftHand" and modData["LeftForearm"].IsEquiped then
name = "media/ui/TOC/" .. partName .. "/Hook.png";
end
return name;
end
local function partNameToBodyLoc(name)
if name == "RightHand" then return "ArmRight_Prot" end
if name == "RightForearm" then return "ArmRight_Prot" end
if name == "RightArm" then return "ArmRight_Prot" end
if name == "LeftHand" then return "ArmLeft_Prot" end
if name == "LeftForearm" then return "ArmLeft_Prot" end
if name == "LeftArm" then return "ArmLeft_Prot" end
end
function find_itemWorn_TOC(partName)
local wornItems = getPlayer():getWornItems();
for i=1,wornItems:size()-1 do -- Maybe wornItems:size()-1
local item = wornItems:get(i):getItem();
if item:getBodyLocation() == partNameToBodyLoc(partName) then
return item;
end
end
return false;
end
local function findMinMax(lv)
local min, max
if lv == 1 then
min = 0;
max = 75;
elseif lv == 2 then
min = 75;
max = 150 + 75;
elseif lv == 3 then
min = 150;
max = 300 + 75 + 150;
elseif lv == 4 then
min = 300;
max = 750 + 75 + 150 + 300;
elseif lv == 5 then
min = 750;
max = 1500 + 75 + 150 + 300 + 750;
elseif lv == 6 then
min = 1500;
max = 3000 + 75 + 150 + 300 + 750 + 1500;
elseif lv == 7 then
min = 3000;
max = 4500 + 75 + 150 + 300 + 750 + 1500 + 3000;
elseif lv == 8 then
min = 4500;
max = 6000 + 75 + 150 + 300 + 750 + 1500 + 3000 + 4500;
elseif lv == 9 then
min = 6000;
max = 7500 + 75 + 150 + 300 + 750 + 1500 + 3000 + 4500 + 6000;
elseif lv == 10 then
min = 7500;
max = 9000 + 75 + 150 + 300 + 750 + 1500 + 3000 + 4500 + 6000 + 7500;
end
return min, max;
end
-- end Usefull
-- Function to update text/button of UIs
local function setDescUI(partName)
local modData = getPlayer():getModData().TOC;
local partData = modData[partName];
descUI["textTitle"]:setText(getDisplayText_TOC(partName));
descUI.partNameAct = partName;
if partData.IsCut and partData.IsCicatrized and partData.IsEquiped then -- Cut and equip
descUI["textEtat"]:setText("Cut and healed");
descUI["textEtat"]:setColor(1, 0, 1, 0);
descUI["b1"]:setText("Unequip");
descUI["b1"]:addArg("option", "Unequip");
descUI["b1"]:setVisible(true);
elseif partData.IsCut and partData.IsCicatrized and not partData.IsEquiped and partData.ToDisplay then -- Cut and healed
descUI["textEtat"]:setText("Cut and healed");
descUI["textEtat"]:setColor(1, 0, 1, 0);
if partName == "RightArm" or partName == "LeftArm" then
descUI["b1"]:setVisible(false);
else
descUI["b1"]:setText("Equip");
descUI["b1"]:addArg("option", "Equip");
descUI["b1"]:setVisible(true);
end
elseif partData.IsCut and not partData.IsCicatrized and partData.ToDisplay then -- Cut not healed
if partData.IsOperated then:
if partData.CicaTimeLeft > 1000 then
descUI["textEtat"]:setText("Still a long way to go")
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2);
elseif partData.CicaTimeLeft > 500 then
descUI["textEtat"]:setText("Starting to get better")
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2)
elseif partData.CicaTime > 100
descUI["textEtat"]:setText("Almost cicatrized");
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2);
else
if partData.CicaTimeLeft > 1000 then
descUI["textEtat"]:setText("It hurts so much..." .. partData.CicaTimeLeft)
descUI["textEtat"]:setColor(1, 1, 0, 0)
elseif partData.CicaTimeLeft > 500 then
descUI["textEtat"]:setText("It still hurts a lot")
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2)
elseif partData.CicaTimeLeft > 500 then
descUI["textEtat"]:setText("I think it's almost over...")
descUI["textEtat"]:setColor(1, 0.8, 1, 0.2)
if partData.IsOperated then
descUI["b1"]:setVisible(false)
else
descUI["b1"]:setText("Operate")
descUI["b1"]:addArg("option", "Operate")
descUI["b1"]:setVisible(true)
end
elseif partData.IsCut and not partData.ToDisplay then -- Empty (hand if forearm cut)
descUI["textEtat"]:setText("Nothing here...");
descUI["textEtat"]:setColor(1, 1, 1, 1);
descUI["b1"]:setVisible(false);
elseif not partData.IsCut and getPlayer():getBodyDamage():getBodyPart(TOC_getBodyPart(partName)):bitten() then
descUI["textEtat"]:setText("Bitten...");
descUI["textEtat"]:setColor(1, 1, 0, 0);
if isPlayerHaveSaw() then
descUI["b1"]:setVisible(true);
descUI["b1"]:setText("Cut");
descUI["b1"]:addArg("option", "Cut");
else
descUI["b1"]:setVisible(false);
end
elseif not partData.IsCut then -- Not cut
descUI["textEtat"]:setText("Not cut");
descUI["textEtat"]:setColor(1, 1, 1, 1);
if isPlayerHaveSaw() then
descUI["b1"]:setVisible(true);
descUI["b1"]:setText("Cut");
descUI["b1"]:addArg("option", "Cut");
else
descUI["b1"]:setVisible(false);
end
end
-- Set text for level
local player = getPlayer();
if string.find(partName, "Right") then
local lv = player:getPerkLevel(Perks.RightHand) + 1;
descUI["textLV2"]:setText("Level: " .. lv .. " / 10");
local xp = player:getXp():getXP(Perks.RightHand);
local min, max = findMinMax(lv);
descUI["pbarNLV"]:setMinMax(min, max);
descUI["pbarNLV"]:setValue(xp);
else
local lv = player:getPerkLevel(Perks.LeftHand) + 1;
descUI["textLV2"]:setText("Level: " .. lv .. " / 10");
local xp = player:getXp():getXP(Perks.LeftHand);
local min, max = findMinMax(lv);
descUI["pbarNLV"]:setMinMax(min, max);
descUI["pbarNLV"]:setValue(xp);
end
end
local function setConfirmUI(action)
confirmUI.actionAct = action;
confirmUI:setInCenterOfScreen();
confirmUI:bringToTop();
confirmUI:open();
if action == "Cut" then
if isPlayerHaveBandage() and isPlayerHavePainkiller() then
confirmUI["text2"]:setText("You have bandage and painkiller");
confirmUI["text2"]:setColor(1, 0, 1, 0);
else
confirmUI["text2"]:setText("You miss bandage or painkiller");
confirmUI["text2"]:setColor(1, 1, 0, 0);
end
if isPlayerHaveSaw() and getPlayer():getBodyDamage():getBodyPart(TOC_getBodyPart(descUI.partNameAct)):bitten() then
confirmUI["text3"]:setText("You are well bitten and you have a saw... it's time");
confirmUI["text3"]:setColor(1, 0, 1, 0);
elseif isPlayerHaveSaw() and not getPlayer():getBodyDamage():getBodyPart(TOC_getBodyPart(descUI.partNameAct)):bitten() then
confirmUI["text3"]:setText("What are you doing? You're okay !");
confirmUI["text3"]:setColor(1, 1, 0, 0);
else
confirmUI["text3"]:setText("You miss a saw");
confirmUI["text3"]:setColor(1, 1, 0, 0);
end
elseif action == "Operate" then
confirmUI["text2"]:setText("");
confirmUI["text3"]:setText("You are going to operate " .. getDisplayText_TOC(descUI.partNameAct));
confirmUI["text3"]:setColor(1, 1, 1, 1);
end
end
function SetConfirmUIMP(action, isBitten, userName, partName)
confirmUIMP:setInCenterOfScreen();
confirmUIMP:bringToTop();
confirmUIMP:open();
if action == "Cut" then
confirmUIMP["text4"]:setText("You gonna " .. action .. " the " .. getDisplayText_TOC(partName) .. " of " .. userName);
if isPlayerHaveBandage() and isPlayerHavePainkiller() then
confirmUIMP["text2"]:setText("You have bandage and painkiller");
confirmUIMP["text2"]:setColor(1, 0, 1, 0);
else
confirmUIMP["text2"]:setText("You miss bandage or painkiller");
confirmUIMP["text2"]:setColor(1, 1, 0, 0);
end
if isPlayerHaveSaw() and isBitten then
confirmUIMP["text3"]:setText("You are well bitten and you have a saw... it's time");
confirmUIMP["text3"]:setColor(1, 0, 1, 0);
confirmUIMP["b1"]:setVisible(true);
confirmUIMP["b2"]:setVisible(true);
elseif isPlayerHaveSaw() and not isBitten then
confirmUIMP["text3"]:setText("What are you doing? You're okay !");
confirmUIMP["text3"]:setColor(1, 1, 0, 0);
confirmUIMP["b1"]:setVisible(true);
confirmUIMP["b2"]:setVisible(true);
else
confirmUIMP["text3"]:setText("You miss a saw");
confirmUIMP["text3"]:setColor(1, 1, 0, 0);
confirmUIMP["b1"]:setVisible(false);
confirmUIMP["b2"]:setVisible(true);
end
elseif action == "Operate" then
confirmUIMP["text4"]:setText("You gonna " .. action .. " the " .. getDisplayText_TOC(partName) .. " of " .. userName);
confirmUIMP["text2"]:setText("");
confirmUIMP["text3"]:setText("");
confirmUIMP["b1"]:setVisible(true);
confirmUIMP["b2"]:setVisible(true);
elseif action == "Wait server" then
confirmUIMP["text4"]:setText(action);
confirmUIMP["text3"]:setText("");
confirmUIMP["text2"]:setText("");
confirmUIMP["b1"]:setVisible(false);
confirmUIMP["b2"]:setVisible(false);
end
end
local function setImageMainUI()
local modData = getPlayer():getModData().TOC
mainUI["b11"]:setPath(getImageName("RightArm", modData));
mainUI["b12"]:setPath(getImageName("LeftArm", modData));
mainUI["b21"]:setPath(getImageName("RightForearm", modData));
mainUI["b22"]:setPath(getImageName("LeftForearm", modData));
mainUI["b31"]:setPath(getImageName("RightHand", modData));
mainUI["b32"]:setPath(getImageName("LeftHand", modData));
end
-- Functions for button of UIs
local function confirmPress(button, args)
local player = getPlayer();
if confirmUI.actionAct == "Cut" then
if args.option == "yes" then
ISTimedActionQueue.add(IsCutArm:new(player, player, descUI.partNameAct));
else
getPlayer():Say("Never mind");
end
end
if confirmUI.actionAct == "Operate" then
if args.option == "yes" then
local playerInv = player:getInventory();
local item = playerInv:getItemFromType('TOC.Real_surgeon_kit') or playerInv:getItemFromType('TOC.Surgeon_kit') or playerInv:getItemFromType('TOC.Improvised_surgeon_kit');
if item then
ISTimedActionQueue.add(ISOperateArm:new(player, player, item, descUI.partNameAct, false));
else
player:Say("I need a kit");
end
else
getPlayer():Say("Never mind");
end
end
mainUI:close();
end
local function confirmPressMP(button, args)
local player = getPlayer();
if confirmUIMP.actionAct == "Cut" then
if args.option == "yes" then
getPlayer():Say("Ok let's begging, courage !");
ISTimedActionQueue.add(IsCutArm:new(confirmUIMP.patient, player, confirmUIMP.partNameAct));
else
getPlayer():Say("Never mind");
end
end
if confirmUIMP.actionAct == "Operate" then
if args.option == "yes" then
local playerInv = player:getInventory();
local item = playerInv:getItemFromType('TOC.Real_surgeon_kit') or playerInv:getItemFromType('TOC.Surgeon_kit') or playerInv:getItemFromType('TOC.Improvised_surgeon_kit');
if item then
getPlayer():Say("Not moving ! Ok ?");
ISTimedActionQueue.add(ISOperateArm:new(confirmUIMP.patient, player, item, confirmUIMP.partNameAct, false));
else
player:Say("I need a kit");
end
else
getPlayer():Say("Never mind");
end
end
confirmUIMP:close();
confirmUIMP.responseReceive = false;
end
local function mainPress(button, args)
descUI:open();
descUI:setPositionPixel(mainUI:getRight(), mainUI:getY());
setDescUI(args.part);
end
local function descPress(button, args)
local player = getPlayer();
local playerInv = player:getInventory();
if args.option == "Cut" then
local modData = player:getModData().TOC;
-- Do not cut if prothesis equip
if (string.find(descUI.partNameAct, "Right") and (modData["RightHand"].IsEquiped or modData["RightForearm"].IsEquiped))
or (string.find(descUI.partNameAct, "Left") and (modData["LeftHand"].IsEquiped or modData["LeftForearm"].IsEquiped)) then
player:Say("I need to remove my prothesis first");
mainUI:close();
return false;
end
setConfirmUI("Cut");
elseif args.option == "Operate" then
setConfirmUI("Operate");
elseif args.option == "Equip" then
local item = playerInv:getItemFromType('TOC.MetalHand') or playerInv:getItemFromType('TOC.MetalHook') or playerInv:getItemFromType('TOC.WoodenHook');
if item then
ISTimedActionQueue.add(ISInstallProthesis:new(player, item, player:getBodyDamage():getBodyPart(TOC_getBodyPart(descUI.partNameAct))))
else
player:Say("I need a prosthesis");
end
mainUI:close();
elseif args.option == "Unequip" then
ISTimedActionQueue.add(ISUninstallProthesis:new(player, find_itemWorn_TOC(descUI.partNameAct), player:getBodyDamage():getBodyPart(TOC_getBodyPart(descUI.partNameAct))));
mainUI:close();
end
end
-- Make the UIS
local function makeMainUI()
mainUI = NewUI();
mainUI:setTitle("The only cure main menu");
mainUI:setWidthPercent(0.1);
mainUI:addImageButton("b11", "", mainPress);
mainUI["b11"]:addArg("part", "RightArm");
mainUI:addImageButton("b12", "", mainPress);
mainUI["b12"]:addArg("part", "LeftArm");
mainUI:nextLine();
mainUI:addImageButton("b21", "", mainPress);
mainUI["b21"]:addArg("part", "RightForearm");
mainUI:addImageButton("b22", "", mainPress);
mainUI["b22"]:addArg("part", "LeftForearm");
mainUI:nextLine();
mainUI:addImageButton("b31", "", mainPress);
mainUI["b31"]:addArg("part", "RightHand");
mainUI:addImageButton("b32", "", mainPress);
mainUI["b32"]:addArg("part", "LeftHand");
mainUI:saveLayout();
end
local function makeDescUI()
descUI = NewUI();
descUI:setTitle("The only cure description");
descUI:isSubUIOf(mainUI);
descUI:setWidthPixel(250);
descUI:setColumnWidthPixel(1, 100);
descUI:addText("textTitle", "Right arm", "Large", "Center");
descUI:nextLine();
descUI:addText("textLV2", "Level 3/10", _, "Center");
descUI:nextLine();
descUI:addText("textLV", "Next LV:", _, "Right");
descUI:addProgressBar("pbarNLV", 39, 0, 100);
descUI["pbarNLV"]:setMarginPixel(10, 6);
descUI:nextLine();
descUI:addEmpty("border1");
descUI:setLineHeightPixel(1);
descUI["border1"]:setBorder(true);
descUI:nextLine();
descUI:addEmpty();
descUI:nextLine();
descUI:addText("textEtat", "Is Cut !", "Medium", "Center");
descUI["textEtat"]:setColor(1, 1, 0, 0);
descUI:nextLine();
descUI:addEmpty();
descUI:nextLine();
descUI:addButton("b1", "Operate", descPress);
descUI:saveLayout();
end
local function makeConfirmUI()
confirmUI = NewUI();
confirmUI:isSubUIOf(descUI);
confirmUI:addText("text1", "Are you sure ?", "Title", "Center");
confirmUI:setLineHeightPixel(getTextManager():getFontHeight(confirmUI.text1.font) + 10)
confirmUI:nextLine();
confirmUI:addText("text2", "", _, "Center");
confirmUI:nextLine();
confirmUI:addText("text3", "", _, "Center");
confirmUI:nextLine();
confirmUI:addEmpty();
confirmUI:nextLine();
confirmUI:addEmpty();
confirmUI:addButton("b1", "Yes", confirmPress);
confirmUI.b1:addArg("option", "yes");
confirmUI:addEmpty();
confirmUI:addButton("b2", "No", confirmPress);
confirmUI:addEmpty();
confirmUI:nextLine();
confirmUI:addEmpty();
confirmUI:saveLayout();
end
function MakeConfirmUIMP()
confirmUIMP = NewUI();
confirmUIMP.responseReceive = false;
confirmUIMP:addText("text1", "Are you sure ?", "Title", "Center");
confirmUIMP:setLineHeightPixel(getTextManager():getFontHeight(confirmUIMP.text1.font) + 10)
confirmUIMP:nextLine();
confirmUIMP:addText("text4", "", "Medium", "Center");
confirmUIMP:setLineHeightPixel(getTextManager():getFontHeight(confirmUIMP.text4.font) + 10)
confirmUIMP:nextLine();
confirmUIMP:addText("text2", "", _, "Center");
confirmUIMP:nextLine();
confirmUIMP:addText("text3", "", _, "Center");
confirmUIMP:nextLine();
confirmUIMP:addEmpty();
confirmUIMP:nextLine();
confirmUIMP:addEmpty();
confirmUIMP:addButton("b1", "Yes", confirmPressMP);
confirmUIMP.b1:addArg("option", "yes");
confirmUIMP:addEmpty();
confirmUIMP:addButton("b2", "No", confirmPressMP);
confirmUIMP:addEmpty();
confirmUIMP:nextLine();
confirmUIMP:addEmpty();
confirmUIMP:saveLayout();
confirmUIMP:addPrerenderFunction(prerenderFuncMP);
confirmUIMP:close();
end
local function onCreateUI()
makeMainUI();
makeDescUI();
makeConfirmUI();
if isClient() then MakeConfirmUIMP() end
mainUI:close();
end
Events.OnCreateUI.Add(onCreateUI)
-- Add button to health panel
function ISNewHealthPanel.onClick_TOC(button)
mainUI:toggle();
mainUI:setInCenterOfScreen();
setImageMainUI();
end
local ISHealthPanel_createChildren = ISHealthPanel.createChildren
function ISHealthPanel:createChildren()
ISHealthPanel_createChildren(self);
self.fitness:setWidth(self.fitness:getWidth()/1.5);
self.TOCButton = ISButton:new(self.fitness:getRight(), self.healthPanel.y, 20, 20, "", self, ISNewHealthPanel.onClick_TOC);
self.TOCButton:setImage(getTexture("media/ui/TOC/iconForMenu.png"));
self.TOCButton.anchorTop = false
self.TOCButton.anchorBottom = true
self.TOCButton:initialise();
self.TOCButton:instantiate();
self:addChild(self.TOCButton);
if getCore():getGameMode() == "Tutorial" then
self.TOCButton:setVisible(false);
end
end
local ISHealthPanel_render = ISHealthPanel.render
function ISHealthPanel:render()
ISHealthPanel_render(self);
self.TOCButton:setY(self.fitness:getY());
end

View File

@@ -0,0 +1,178 @@
local function dropItem(player, modData)
if (modData.TOC.RightHand.IsCut and not (modData.TOC.RightHand.IsEquiped or modData.TOC.RightForearm.IsEquiped)) or (modData.TOC.RightForearm.IsCut and not modData.TOC.RightForearm.IsEquiped) then
if player:getPrimaryHandItem() ~= nil then
if player:getPrimaryHandItem():getName() ~= "Bare Hands" then player:dropHandItems() end
end
end
if (modData.TOC.LeftHand.IsCut and not (modData.TOC.LeftHand.IsEquiped or modData.TOC.LeftForearm.IsEquiped)) or (modData.TOC.LeftForearm.IsCut and not modData.TOC.LeftForearm.IsEquiped) then
if player:getSecondaryHandItem() ~= nil then
if player:getSecondaryHandItem():getName() ~= "Bare Hands" then player:dropHandItems() end
end
end
end
local function everyOneMinute()
local player = getPlayer();
local modData = player:getModData();
if modData.TOC ~= nil then
dropItem(player, modData);
CheckIfInfect(player, modData);
UpdatePlayerHealth(player, modData);
end
end
local function everyTenMinutes()
local player = getPlayer()
local modData = player:getModData()
if modData.TOC ~= nil then
local names = {"RightHand", "RightForearm", "RightArm", "LeftHand", "LeftForearm", "LeftArm"}
--Augmente l'xp si equip
if modData.TOC.RightHand.IsEquiped or modData.TOC.RightForearm.IsEquiped then player:getXp():AddXP(Perks.RightHand, 4) end
if modData.TOC.LeftHand.IsEquiped or modData.TOC.LeftForearm.IsEquiped then player:getXp():AddXP(Perks.LeftHand, 4) end
--Reduit le temps de cicatri restant
for i,name in pairs(names) do
if modData.TOC[name].IsCut and not modData.TOC[name].IsCicatrized then
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()
end
end
end
end
local function initVariable(_, player)
local modData = player:getModData()
if modData.TOC == nil then
modData.TOC = {};
modData.TOC.RightHand = {};
modData.TOC.RightForearm = {};
modData.TOC.RightArm = {};
modData.TOC.LeftHand = {};
modData.TOC.LeftForearm = {};
modData.TOC.LeftArm = {};
modData.TOC.RightHand.IsCut = false;
modData.TOC.RightForearm.IsCut = false;
modData.TOC.RightArm.IsCut = false;
modData.TOC.LeftHand.IsCut = false;
modData.TOC.LeftForearm.IsCut = false;
modData.TOC.LeftArm.IsCut = false;
modData.TOC.RightHand.IsInfected = false;
modData.TOC.RightForearm.IsInfected = false;
modData.TOC.RightArm.IsInfected = false;
modData.TOC.LeftHand.IsInfected = false;
modData.TOC.LeftForearm.IsInfected = false;
modData.TOC.LeftArm.IsInfected = false;
modData.TOC.RightHand.IsOperated = false;
modData.TOC.RightForearm.IsOperated = false;
modData.TOC.RightArm.IsOperated = false;
modData.TOC.LeftHand.IsOperated = false;
modData.TOC.LeftForearm.IsOperated = false;
modData.TOC.LeftArm.IsOperated = false;
modData.TOC.RightHand.IsCicatrized = false;
modData.TOC.RightForearm.IsCicatrized = false;
modData.TOC.RightArm.IsCicatrized = false;
modData.TOC.LeftHand.IsCicatrized = false;
modData.TOC.LeftForearm.IsCicatrized = false;
modData.TOC.LeftArm.IsCicatrized = false;
modData.TOC.RightHand.IsEquiped = false;
modData.TOC.RightForearm.IsEquiped = false;
modData.TOC.RightArm.IsEquiped = false;
modData.TOC.LeftHand.IsEquiped = false;
modData.TOC.LeftForearm.IsEquiped = false;
modData.TOC.LeftArm.IsEquiped = false;
modData.TOC.RightHand.IsBurn = false;
modData.TOC.RightForearm.IsBurn = false;
modData.TOC.RightArm.IsBurn = false;
modData.TOC.LeftHand.IsBurn = false;
modData.TOC.LeftForearm.IsBurn = false;
modData.TOC.LeftArm.IsBurn = false;
modData.TOC.RightHand.EquipFact = 1.0;
modData.TOC.RightForearm.EquipFact = 1.0;
modData.TOC.RightArm.EquipFact = 1.0;
modData.TOC.LeftHand.EquipFact = 1.0;
modData.TOC.LeftForearm.EquipFact = 1.0;
modData.TOC.LeftArm.EquipFact = 1.0;
modData.TOC.RightHand.Equip_mat_id = nil;
modData.TOC.RightForearm.Equip_mat_id = nil;
modData.TOC.RightArm.Equip_mat_id = nil;
modData.TOC.LeftHand.Equip_mat_id = nil;
modData.TOC.LeftForearm.Equip_mat_id = nil;
modData.TOC.LeftArm.Equip_mat_id = nil;
modData.TOC.RightHand.CicaTimeLeft = 0;
modData.TOC.RightForearm.CicaTimeLeft = 0;
modData.TOC.RightArm.CicaTimeLeft = 0;
modData.TOC.LeftHand.CicaTimeLeft = 0;
modData.TOC.LeftForearm.CicaTimeLeft = 0;
modData.TOC.LeftArm.CicaTimeLeft = 0;
modData.TOC.RightHand.ToDisplay = false;
modData.TOC.RightForearm.ToDisplay = false;
modData.TOC.RightArm.ToDisplay = false;
modData.TOC.LeftHand.ToDisplay = false;
modData.TOC.LeftForearm.ToDisplay = false;
modData.TOC.LeftArm.ToDisplay = false;
modData.TOC.InitDone = true;
modData.TOC.OtherBody_IsInfected = false;
if player:HasTrait("amputee1") then
local cloth = player:getInventory():AddItem("TOC.ArmLeft_noHand");
player:setWornItem(cloth:getBodyLocation(), cloth);
modData.TOC.LeftHand.IsCut=true; modData.TOC.LeftHand.IsOperated=true; modData.TOC.LeftHand.ToDisplay=true; modData.TOC.LeftHand.IsCicatrized=true;
player:getInventory():AddItem("TOC.MetalHook");
end
if player:HasTrait("amputee2") then
local cloth = player:getInventory():AddItem("TOC.ArmLeft_noForearm");
player:setWornItem(cloth:getBodyLocation(), cloth);
modData.TOC.LeftHand.IsCut=true; modData.TOC.LeftHand.IsOperated=true;
modData.TOC.LeftForearm.IsCut=true; modData.TOC.LeftForearm.IsOperated=true; modData.TOC.LeftForearm.ToDisplay=true; modData.TOC.LeftForearm.IsCicatrized=true;
player:getInventory():AddItem("TOC.MetalHook");
end
if player:HasTrait("amputee3") then
local cloth = player:getInventory():AddItem("TOC.ArmLeft_noArm");
player:setWornItem(cloth:getBodyLocation(), cloth);
modData.TOC.LeftHand.IsCut=true; modData.TOC.LeftHand.IsOperated=true;
modData.TOC.LeftForearm.IsCut=true; modData.TOC.LeftForearm.IsOperated=true;
modData.TOC.LeftArm.IsCut=true; modData.TOC.LeftArm.IsOperated=true; modData.TOC.LeftArm.ToDisplay=true; modData.TOC.LeftArm.IsCicatrized=true;
player:getInventory():AddItem("TOC.MetalHook");
end
player:transmitModData()
end
end
local function initTOCTraits()
local amp1 = TraitFactory.addTrait("amputee1", getText("UI_trait_Amputee1"), -8, getText("UI_trait_Amputee1desc"), false, false);
amp1:addXPBoost(Perks.LeftHand, 4);
local amp2 = TraitFactory.addTrait("amputee2", getText("UI_trait_Amputee2"), -10, getText("UI_trait_Amputee2desc"), false, false);
amp2:addXPBoost(Perks.LeftHand, 4);
local amp3 = TraitFactory.addTrait("amputee3", getText("UI_trait_Amputee3"), -20, getText("UI_trait_Amputee3desc"), false, false);
amp3:addXPBoost(Perks.LeftHand, 4);
TraitFactory.addTrait("Insensitive", getText("UI_trait_Insensitive"), 6, getText("UI_trait_Insensitivedesc"), false, false);
TraitFactory.setMutualExclusive("amputee1", "amputee2");
TraitFactory.setMutualExclusive("amputee1", "amputee3");
TraitFactory.setMutualExclusive("amputee2", "amputee3");
end
Events.EveryHours.Add(everyHours);
Events.EveryTenMinutes.Add(everyTenMinutes);
Events.EveryOneMinute.Add(everyOneMinute);
Events.OnCreatePlayer.Add(initVariable);
Events.OnGameBoot.Add(initTOCTraits);

View File

@@ -0,0 +1,163 @@
require "TimedActions/ISBaseTimedAction"
require "TimedActions/ISEquipWeaponAction"
local burnFact = 1.3
function ISBaseTimedAction:adjustMaxTime(maxTime)
if maxTime ~= -1 then
local maxTime_org = maxTime
-- add a slight maxtime if the character is unhappy
maxTime = maxTime + ((self.character:getMoodles():getMoodleLevel(MoodleType.Unhappy)) * 10)
-- add more time if the character have his hands wounded
if not self.ignoreHandsWounds then
for i=BodyPartType.ToIndex(BodyPartType.Hand_L), BodyPartType.ToIndex(BodyPartType.ForeArm_R) do
local part = self.character:getBodyDamage():getBodyPart(BodyPartType.FromIndex(i));
maxTime = maxTime + part:getPain();
end
end
-- Apply a multiplier based on body temperature.
maxTime = maxTime * self.character:getTimedActionTimeModifier();
if self.noAfectByCut then return maxTime; end
--Added if cut
local modData = getPlayer():getModData()
local protPartNames = {"RightHand", "RightForearm", "LeftHand", "LeftForearm"}
local otherPartNames = {"RightArm", "LeftArm"}
for i,name in ipairs(protPartNames) do
if modData.TOC[name].IsCut then
if modData.TOC[name].IsEquiped then
maxTime = maxTime * modData.TOC[name].EquipFact;
else
maxTime = maxTime * 2;
end
if modData.TOC[name].IsBurn then maxTime = maxTime * burnFact end
end
end
for i,name in ipairs(otherPartNames) do
if modData.TOC[name].IsCut then
maxTime = maxTime * 2
if modData.TOC[name].IsBurn then maxTime = maxTime * burnFact end
end
end
-- Protheses perks stuff
if modData.TOC.RightHand.IsCut then maxTime = maxTime * (1 + (9 - self.character:getPerkLevel(Perks.RightHand)) / 20) end
if modData.TOC.LeftHand.IsCut then maxTime = maxTime * (1 + (9 - self.character:getPerkLevel(Perks.LeftHand)) / 20) end
if maxTime > 10 * maxTime_org then maxTime = 10 * maxTime_org end
end
return maxTime;
end
function ISEquipWeaponAction:perform()
if self.sound then
self.character:getEmitter():stopSound(self.sound)
end
self.item:setJobDelta(0.0);
if self:isAlreadyEquipped(self.item) then
ISBaseTimedAction.perform(self);
return
end
if self.character:isEquippedClothing(self.item) then
self.character:removeWornItem(self.item)
triggerEvent("OnClothingUpdated", self.character)
end
self.item:getContainer():setDrawDirty(true);
forceDropHeavyItems(self.character)
if self.fromHotbar then
local hotbar = getPlayerHotbar(self.character:getPlayerNum());
hotbar.chr:removeAttachedItem(self.item);
self:setOverrideHandModels(self.item, nil)
end
if not self.twoHands then
-- equip primary weapon
if(self.primary) then
-- if the previous weapon need to be equipped in both hands, we then remove it
if self.character:getSecondaryHandItem() and self.character:getSecondaryHandItem():isRequiresEquippedBothHands() then
self.character:setSecondaryHandItem(nil);
end
-- if this weapon is already equiped in the 2nd hand, we remove it
if(self.character:getSecondaryHandItem() == self.item or self.character:getSecondaryHandItem() == self.character:getPrimaryHandItem()) then
self.character:setSecondaryHandItem(nil);
end
if not self.character:getPrimaryHandItem() or self.character:getPrimaryHandItem() ~= self.item then
self.character:setPrimaryHandItem(nil);
self.character:setPrimaryHandItem(self.item);
end
else -- second hand weapon
-- if the previous weapon need to be equipped in both hands, we then remove it
if self.character:getPrimaryHandItem() and self.character:getPrimaryHandItem():isRequiresEquippedBothHands() then
self.character:setPrimaryHandItem(nil);
end
-- if this weapon is already equiped in the 1st hand, we remove it
if(self.character:getPrimaryHandItem() == self.item or self.character:getSecondaryHandItem() == self.character:getPrimaryHandItem()) then
self.character:setPrimaryHandItem(nil);
end
if not self.character:getSecondaryHandItem() or self.character:getSecondaryHandItem() ~= self.item then
self.character:setSecondaryHandItem(nil);
self.character:setSecondaryHandItem(self.item);
end
end
else
self.character:setPrimaryHandItem(nil);
self.character:setSecondaryHandItem(nil);
self.character:setPrimaryHandItem(self.item);
self.character:setSecondaryHandItem(self.item);
end
local modData = self.character:getModData()
if not self.item:isRequiresEquippedBothHands() then
if modData.TOC.RightHand.IsCut then
if modData.TOC.RightForearm.IsCut then
if not modData.TOC.RightForearm.IsEquiped then
self.character:setPrimaryHandItem(nil);
self.character:setSecondaryHandItem(self.item);
end
else
if not modData.TOC.RightHand.IsEquiped then
self.character:setPrimaryHandItem(nil);
self.character:setSecondaryHandItem(self.item);
end
end
end
if modData.TOC.LeftHand.IsCut then
if modData.TOC.LeftForearm.IsCut then
if not modData.TOC.LeftForearm.IsEquiped then
self.character:setPrimaryHandItem(self.item);
self.character:setSecondaryHandItem(nil);
end
else
if not modData.TOC.LeftHand.IsEquiped then
self.character:setPrimaryHandItem(self.item);
self.character:setSecondaryHandItem(nil);
end
end
end
if (modData.TOC.RightHand.IsCut and not (modData.TOC.RightHand.IsEquiped or modData.TOC.RightForearm.IsEquiped)) and (modData.TOC.LeftHand.IsCut and not (modData.TOC.LeftHand.IsEquiped or modData.TOC.LeftForearm.IsEquiped)) then
self.character:dropHandItems();
end
end
if self.item:isRequiresEquippedBothHands() and ((modData.TOC.RightHand.IsCut and not modData.TOC.RightHand.IsEquiped) or (modData.TOC.RightForearm.IsCut and not modData.TOC.RightForearm.IsEquiped) or (modData.TOC.LeftHand.IsCut and not modData.TOC.LeftHand.IsEquiped) or (modData.TOC.LeftForearm.IsCut and not modData.TOC.LeftForearm.IsEquiped)) then
self.character:dropHandItems();
end
--if self.item:canBeActivated() and ((instanceof("Drainable", self.item) and self.item:getUsedDelta() > 0) or not instanceof("Drainable", self.item)) then
if self.item:canBeActivated() then
self.item:setActivated(true);
end
getPlayerInventory(self.character:getPlayerNum()):refreshBackpacks();
-- needed to remove from queue / start next.
ISBaseTimedAction.perform(self);
end

View File

@@ -0,0 +1,96 @@
require "TimedActions/ISBaseTimedAction"
IsCutArm = ISBaseTimedAction:derive("IsCutArm");
function IsCutArm:isValid()
return self.patientX == self.patient:getX() and self.patientY == self.patient:getY();
end
function IsCutArm:waitToStart()
if self.patient == self.surgeon then
return false
end
self.surgeon:faceThisObject(self.patient)
return self.surgeon:shouldBeTurning()
end
function IsCutArm:update()
if self.patient ~= self.surgeon then
self.surgeon:faceThisObject(self.patient)
end
end
function IsCutArm:start()
if self.patient == self.surgeon then
self:setActionAnim("WearClothing");
self:setAnimVariable("WearClothingLocation", "Jacket")
else
self:setActionAnim("Loot")
self.patient:SetVariable("LootPosition", "Mid")
end
end
function IsCutArm:findArgs()
local useBandage, bandageAlcool, usePainkiller, painkillerCount
local surgeonFact = self.surgeon:getPerkLevel(Perks.Doctor);
if self.surgeon:getDescriptor():getProfession() == "surgeon" then surgeonFact = surgeonFact + 15 end
if self.surgeon:getDescriptor():getProfession() == "doctor" then surgeonFact = surgeonFact + 9 end
if self.surgeon:getDescriptor():getProfession() == "nurse" then surgeonFact = surgeonFact + 4 end
local bandage = self.surgeon:getInventory():FindAndReturn('Bandage');
local albandage = self.surgeon:getInventory():FindAndReturn('AlcoholBandage');
if albandage then
useBandage = true;
bandageAlcool = true;
self.patient:getInventory():Remove(albandage);
surgeonFact = surgeonFact + 4
elseif bandage then
useBandage = true;
self.patient:getInventory():Remove(bandage);
surgeonFact = surgeonFact + 2
end
local painkiller = self.surgeon:getInventory():FindAndReturn('Pills');
if painkiller then
usePainkiller = true;
painkillerCount = painkiller:getRemainingUses();
end
return surgeonFact, useBandage, bandageAlcool, usePainkiller, painkillerCount;
end
function IsCutArm:perform()
local surgeonFact, useBandage, bandageAlcool, usePainkiller, painkillerCount = self:findArgs();
if self.patient ~= self.surgeon and isClient() then
SendCutArm(self.patient, self.partName, surgeonFact, useBandage, bandageAlcool, usePainkiller, painkillerCount);
else
CutArm(self.partName, surgeonFact, useBandage, bandageAlcool, usePainkiller, painkillerCount);
end
self.surgeon:getXp():AddXP(Perks.Doctor, 400);
ISBaseTimedAction.perform(self);
end
function IsCutArm:new(patient, surgeon, partName)
local o = {}
setmetatable(o, self)
self.__index = self
o.partName = partName;
o.bodyPart = TOC_getBodyPart(partName);
o.character = surgeon; -- For anim
o.surgeon = surgeon; -- Surgeon or player that make the operation
o.patient = patient; -- Player to cut
o.patientX = patient:getX();
o.patientY = patient:getY();
o.maxTime = 1000 - (surgeon:getPerkLevel(Perks.Doctor) * 50);
o.stopOnWalk = true;
o.stopOnRun = true;
o.ignoreHandsWounds = false;
o.fromHotbar = true;
if o.patient:isTimedActionInstant() then o.maxTime = 1; end
return o;
end

View File

@@ -0,0 +1,89 @@
require "TimedActions/ISBaseTimedAction"
ISOperateArm = ISBaseTimedAction:derive("ISOperateArm");
function ISOperateArm:isValid()
return self.patientX == self.patient:getX() and self.patientY == self.patient:getY();
end
function ISOperateArm:waitToStart()
if self.patient == self.surgeon then
return false
end
self.surgeon:faceThisObject(self.patient)
return self.surgeon:shouldBeTurning()
end
function ISOperateArm:update()
if self.patient ~= self.surgeon then
self.surgeon:faceThisObject(self.patient)
end
end
function ISOperateArm:start()
self:setActionAnim("MedicalCheck");
if self.UseOven then
self.sound = self.patient:getEmitter():playSound("Burn_sound")
self:forceComplete();
end
end
function ISOperateArm:findArgs()
local surgeonFact = self.surgeon:getPerkLevel(Perks.Doctor);
if self.UseOven then
surgeonFact = surgeonFact + 100;
else
if self.kit then
local weight = math.floor(self.kit:getWeight() * 10 + 0.5)
if weight == 1 then
surgeonFact = surgeonFact + 2;
elseif weight == surgeonFact2 then
surgeonFact = surgeonFact + 4;
elseif weight == 3 then
surgeonFact = surgeonFact + 6;
end
end
if self.surgeon:getDescriptor():getProfession() == "surgeon" then surgeonFact = surgeonFact + 10 end
if self.surgeon:getDescriptor():getProfession() == "doctor" then surgeonFact = surgeonFact + 5 end
if self.surgeon:getDescriptor():getProfession() == "nurse" then surgeonFact = surgeonFact + 2 end
end
return surgeonFact, self.useOven;
end
function ISOperateArm:perform()
local surgeonFact, useOven = self:findArgs();
if self.patient ~= self.surgeon and isClient() then
SendOperateArm(self.patient, self.partName, surgeonFact, useOven);
else
OperateArm(self.partName, surgeonFact, useOven);
end
self.surgeon:getXp():AddXP(Perks.Doctor, 400);
if self.kit then
self.surgeon:getInventory():Remove(self.kit);
end
ISBaseTimedAction.perform(self);
end
function ISOperateArm:new(patient, surgeon, kit, partName, UseOven)
local o = ISBaseTimedAction.new(self, patient);
o.partName = partName;
o.patient = patient;
o.character = surgeon; -- For anim
o.patientX = patient:getX();
o.patientY = patient:getY();
o.surgeon = surgeon;
o.kit = kit;
o.UseOven = UseOven;
if UseOven then o.maxTime = 30 else o.maxTime = 200 - (surgeon:getPerkLevel(Perks.Doctor) * 10) end
o.stopOnWalk = true;
o.stopOnRun = true;
o.ignoreHandsWounds = false;
o.fromHotbar = true;
if o.patient:isTimedActionInstant() then o.maxTime = 1; end
return o;
end

View File

@@ -0,0 +1,133 @@
require "TimedActions/ISBaseTimedAction"
ISInstallProthesis = ISBaseTimedAction:derive("ISInstallProthesis");
function ISInstallProthesis:isValid()
return true;
end
function ISInstallProthesis:update()
self.item:setJobDelta(self:getJobDelta());
end
function ISInstallProthesis:start()
self.item:setJobType("Install prothesis");
self.item:setJobDelta(0.0);
self:setActionAnim("WearClothing");
self:setAnimVariable("WearClothingLocation", "Jacket");
end
function ISInstallProthesis:stop()
ISBaseTimedAction.stop(self);
self.item:setJobDelta(0.0);
end
function ISInstallProthesis:perform()
self.item:setJobDelta(0.0);
local modData = self.character:getModData();
local lor = 0
local foh = 0
if self.bodyPart:getType() == BodyPartType.Hand_R then lor = 1; foh = 1
elseif self.bodyPart:getType() == BodyPartType.ForeArm_R then lor = 1; foh = 2
elseif self.bodyPart:getType() == BodyPartType.Hand_L then lor = 0; foh = 1
elseif self.bodyPart:getType() == BodyPartType.ForeArm_L then lor = 0; foh = 2
end
local mat_id = 0
local weight = math.floor(self.item:getWeight() * 10 + 0.5) / 10
if weight == 1 and foh == 1 then
if lor == 1 then
self.cloth = self.character:getInventory():AddItem("TOC.WoodenHook_right_noHand");
mat_id = 1;
else
self.cloth = self.character:getInventory():AddItem("TOC.WoodenHook_left_noHand");
mat_id = 1;
end
elseif weight == 0.5 and foh == 1 then
if lor == 1 then
self.cloth = self.character:getInventory():AddItem("TOC.MetalHook_right_noHand");
mat_id = 2;
else
self.cloth = self.character:getInventory():AddItem("TOC.MetalHook_left_noHand");
mat_id = 2;
end
elseif weight == 0.3 and foh == 1 then
if lor == 1 then
self.cloth = self.character:getInventory():AddItem("TOC.MetalHand_right_noHand");
mat_id = 3;
else
self.cloth = self.character:getInventory():AddItem("TOC.MetalHand_left_noHand");
mat_id = 3;
end
elseif weight == 1 and foh == 2 then
if lor == 1 then
self.cloth = self.character:getInventory():AddItem("TOC.WoodenHook_right_noForearm");
mat_id = 1;
else
self.cloth = self.character:getInventory():AddItem("TOC.WoodenHook_left_noForearm");
mat_id = 1;
end
elseif weight == 0.5 and foh == 2 then
if lor == 1 then
self.cloth = self.character:getInventory():AddItem("TOC.MetalHook_right_noForearm");
mat_id = 2;
else
self.cloth = self.character:getInventory():AddItem("TOC.MetalHook_left_noForearm");
mat_id = 2;
end
elseif weight == 0.3 and foh == 2 then
if lor == 1 then
self.cloth = self.character:getInventory():AddItem("TOC.MetalHand_right_noForearm");
mat_id = 3;
else
self.cloth = self.character:getInventory():AddItem("TOC.MetalHand_left_noForearm");
mat_id = 3;
end
end
if self.cloth ~= nil then
if self.bodyPart:getType() == BodyPartType.Hand_R then
modData.TOC.RightHand.IsEquiped = true;
modData.TOC.RightHand.Equip_mat_id = mat_id;
modData.TOC.RightHand.EquipFact = find_protheseFact_TOC(self.cloth);
elseif self.bodyPart:getType() == BodyPartType.ForeArm_R then
modData.TOC.RightForearm.IsEquiped = true;
modData.TOC.RightForearm.Equip_mat_id = mat_id;
modData.TOC.RightForearm.EquipFact = find_protheseFact_TOC(self.cloth);
elseif self.bodyPart:getType() == BodyPartType.Hand_L then
modData.TOC.LeftHand.IsEquiped = true;
modData.TOC.LeftHand.Equip_mat_id = mat_id;
modData.TOC.LeftHand.EquipFact = find_protheseFact_TOC(self.cloth);
elseif self.bodyPart:getType() == BodyPartType.ForeArm_L then
modData.TOC.LeftForearm.IsEquiped = true;
modData.TOC.LeftForearm.Equip_mat_id = mat_id;
modData.TOC.LeftForearm.EquipFact = find_protheseFact_TOC(self.cloth);
end
self.character:getInventory():Remove(self.item);
self.character:setWornItem(self.cloth:getBodyLocation(), self.cloth);
end
self.character:transmitModData()
-- needed to remove from queue / start next.
ISBaseTimedAction.perform(self);
end
function ISInstallProthesis:new(character, item, bodyPart)
local o = ISBaseTimedAction.new(self, character);
o.item = item;
o.bodyPart = bodyPart;
o.maxTime = 100;
o.stopOnWalk = true;
o.stopOnRun = true;
o.cloth = nil;
o.ignoreHandsWounds = false;
o.fromHotbar = true; -- just to disable hotbar:update() during the wearing
if o.character:isTimedActionInstant() then o.maxTime = 1; end
return o;
end

View File

@@ -0,0 +1,92 @@
require "TimedActions/ISBaseTimedAction"
ISUninstallProthesis = ISBaseTimedAction:derive("ISUninstallProthesis");
function ISUninstallProthesis:isValid()
return true;
end
function ISUninstallProthesis:update()
self.item:setJobDelta(self:getJobDelta());
end
function ISUninstallProthesis:start()
self.item:setJobType("Uninstall prothesis");
self.item:setJobDelta(0.0);
self:setActionAnim("WearClothing");
if self.item:IsClothing() then
self:setAnimVariable("WearClothingLocation", "Jacket")
elseif self.item:IsInventoryContainer() and self.item:canBeEquipped() ~= "" then
self:setAnimVariable("WearClothingLocation", "Jacket")
end
end
function ISUninstallProthesis:stop()
ISBaseTimedAction.stop(self);
self.item:setJobDelta(0.0);
end
function ISUninstallProthesis:perform()
self.item:getContainer():setDrawDirty(true);
self.item:setJobDelta(0.0);
if instanceof(self.item, "InventoryContainer") and self.item:canBeEquipped() ~= "" then
self.character:removeFromHands(self.item);
self.character:setWornItem(self.item:canBeEquipped(), self.item);
getPlayerInventory(self.character:getPlayerNum()):refreshBackpacks();
elseif self.item:getCategory() == "Clothing" then
if self.item:getBodyLocation() ~= "" then
self.character:setWornItem(self.item:getBodyLocation(), self.item);
end
end
local modData = self.character:getModData()
if self.bodyPart:getType() == BodyPartType.Hand_R then
modData.TOC.RightHand.IsEquiped = false;
modData.TOC.RightHand.EquipFact = 1;
elseif self.bodyPart:getType() == BodyPartType.ForeArm_R then
modData.TOC.RightForearm.IsEquiped = false;
modData.TOC.RightForearm.EquipFact = 1;
elseif self.bodyPart:getType() == BodyPartType.Hand_L then
modData.TOC.LeftHand.IsEquiped = false;
modData.TOC.LeftHand.EquipFact = 1;
elseif self.bodyPart:getType() == BodyPartType.ForeArm_L then
modData.TOC.LeftForearm.IsEquiped = false;
modData.TOC.LeftForearm.EquipFact = 1;
end
local weight = math.floor(self.item:getWeight() * 10 + 0.5)
if weight == 10 then
self.character:getInventory():AddItem("TOC.WoodenHook")
elseif weight == 5 then
self.character:getInventory():AddItem("TOC.MetalHook")
elseif weight == 3 then
self.character:getInventory():AddItem("TOC.MetalHand")
elseif weight == 20 then
self.character:getInventory():AddItem("TOC.WoodenHook")
elseif weight == 15 then
self.character:getInventory():AddItem("TOC.MetalHook")
elseif weight == 12 then
self.character:getInventory():AddItem("TOC.MetalHand")
end
self.character:setWornItem(self.item:getBodyLocation(), nil);
self.character:getInventory():Remove(self.item);
self.character:transmitModData();
-- needed to remove from queue / start next.
ISBaseTimedAction.perform(self);
end
function ISUninstallProthesis:new(character, item, bodyPart)
local o = ISBaseTimedAction.new(self, character);
o.item = item;
o.character = character;
o.bodyPart = bodyPart;
o.maxTime = 100;
o.stopOnWalk = true;
o.stopOnRun = true;
o.ignoreHandsWounds = false;
o.fromHotbar = true; -- just to disable hotbar:update() during the wearing
if o.character:isTimedActionInstant() then o.maxTime = 1; end
return o;
end

View File

@@ -0,0 +1,77 @@
function find_clothName_TOC(bodyPart)
if bodyPart:getType() == BodyPartType.Hand_R then return "TOC.ArmRight_noHand"
elseif bodyPart:getType() == BodyPartType.ForeArm_R then return "TOC.ArmRight_noForearm"
elseif bodyPart:getType() == BodyPartType.UpperArm_R then return "TOC.ArmRight_noArm"
elseif bodyPart:getType() == BodyPartType.Hand_L then return "TOC.ArmLeft_noHand"
elseif bodyPart:getType() == BodyPartType.ForeArm_L then return "TOC.ArmLeft_noForearm"
elseif bodyPart:getType() == BodyPartType.UpperArm_L then return "TOC.ArmLeft_noArm"
else return nil
end
end
function getDisplayText_TOC(name)
if name == "RightHand" then return getText("UI_ContextMenu_RightHand") end
if name == "RightForearm" then return getText("UI_ContextMenu_RightForearm") end
if name == "RightArm" then return getText("UI_ContextMenu_RightArm") end
if name == "LeftHand" then return getText("UI_ContextMenu_LeftHand") end
if name == "LeftForearm" then return getText("UI_ContextMenu_LeftForearm") end
if name == "LeftArm" then return getText("UI_ContextMenu_LeftArm") end
end
function TOC_getBodyPart(name)
if name == "RightHand" then return BodyPartType.Hand_R end
if name == "RightForearm" then return BodyPartType.ForeArm_R end
if name == "RightArm" then return BodyPartType.UpperArm_R end
if name == "LeftHand" then return BodyPartType.Hand_L end
if name == "LeftForearm" then return BodyPartType.ForeArm_L end
if name == "LeftArm" then return BodyPartType.UpperArm_L end
end
function find_clothName2_TOC(name)
if name == "RightHand" then return "TOC.ArmRight_noHand" end
if name == "RightForearm" then return "TOC.ArmRight_noForearm" end
if name == "RightArm" then return "TOC.ArmRight_noArm" end
if name == "LeftHand" then return "TOC.ArmLeft_noHand" end
if name == "LeftForearm" then return "TOC.ArmLeft_noForearm" end
if name == "LeftArm" then return "TOC.ArmLeft_noArm" end
end
function find_bodyPart_TOC(modData, bodyPart)
if modData.RightHand == nil then modData = modData.TOC end
if bodyPart:getType() == BodyPartType.Hand_R then return modData.RightHand
elseif bodyPart:getType() == BodyPartType.ForeArm_R then return modData.RightForearm
elseif bodyPart:getType() == BodyPartType.UpperArm_R then return modData.RightArm
elseif bodyPart:getType() == BodyPartType.Hand_L then return modData.LeftHand
elseif bodyPart:getType() == BodyPartType.ForeArm_L then return modData.LeftForearm
elseif bodyPart:getType() == BodyPartType.UpperArm_L then return modData.LeftArm
else return nil
end
end
function find_protheseID_TOC(item)
local itemType = item:getType()
if string.find(itemType, "WoodenHook") then return 1
elseif string.find(itemType, "MetalHook") then return 2
elseif string.find(itemType, "MetalHand") then return 3
else return 0
end
end
function find_protheseFact_TOC(item)
local itemType = item:getType()
if string.find(itemType, "WoodenHook") and string.find(itemType, "noHand") then return 1.5
elseif string.find(itemType, "WoodenHook") and string.find(itemType, "noForearm") then return 1.65
elseif string.find(itemType, "MetalHook") and string.find(itemType, "noHand") then return 1.3
elseif string.find(itemType, "MetalHook") and string.find(itemType, "noForearm") then return 1.45
elseif string.find(itemType, "MetalHand") and string.find(itemType, "noHand") then return 1.1
elseif string.find(itemType, "MetalHand") and string.find(itemType, "noForearm") then return 1.25
end
end
function CanBeCut(partName)
return not getPlayer():getModData().TOC[partName].IsCut
end
function CanBeOperate(partName)
return getPlayer():getModData().TOC[partName].IsCut and not getPlayer():getModData().TOC[partName].IsOperated and not getPlayer():getModData().TOC[partName].IsCicatrized
end

View File

@@ -0,0 +1,67 @@
require 'Items/ProceduralDistributions'
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "TOC.SurgeonMag1");
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 10);
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "TOC.SurgeonMag1");
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 10);
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "TOC.SurgeonMag1");
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 10);
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "TOC.SurgeonMag1");
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 10);
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "TOC.SurgeonMag2");
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 10);
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "TOC.SurgeonMag2");
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 10);
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "TOC.SurgeonMag2");
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 10);
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "TOC.SurgeonMag2");
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 10);
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "TOC.SurgeonMag3");
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 10);
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "TOC.SurgeonMag3");
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 10);
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "TOC.SurgeonMag3");
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 10);
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "TOC.SurgeonMag3");
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 10);
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "TOC.ProthesisMag1");
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 5);
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "TOC.ProthesisMag1");
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 5);
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "TOC.ProthesisMag1");
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 5);
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "TOC.ProthesisMag1");
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 5);
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, "TOC.ProthesisMag1");
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, 5);
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, "TOC.ProthesisMag1");
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, 5);
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "TOC.ProthesisMag2");
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 5);
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "TOC.ProthesisMag2");
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 5);
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "TOC.ProthesisMag2");
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 5);
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "TOC.ProthesisMag2");
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 5);
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, "TOC.ProthesisMag2");
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, 5);
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, "TOC.ProthesisMag2");
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, 5);
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "TOC.ProthesisMag3");
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 5);
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "TOC.ProthesisMag3");
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 5);
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "TOC.ProthesisMag3");
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 5);
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "TOC.ProthesisMag3");
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 5);
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, "TOC.ProthesisMag3");
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, 5);
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, "TOC.ProthesisMag3");
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, 5);

View File

@@ -0,0 +1,18 @@
--- A rly big thx to Fenris_Wolf and Chuck to help me with that. Love you guy
---Server side
local Commands = {}
Commands["SendServer"] = function(player, arg)
local otherPlayer = getPlayerByOnlineID(arg["To"])
print("The Only Cure Command: ", arg['command'])
sendServerCommand(otherPlayer, "TOC", arg["command"], arg)
end
local onClientCommand = function(module, command, player, args)
if module == 'TOC' and Commands[command] then
args = args or {}
Commands[command](_, args)
end
end
Events.OnClientCommand.Add(onClientCommand)

View File

@@ -0,0 +1,15 @@
--***********************************************************
--** THE INDIE STONE **
--***********************************************************
-- Locations must be declared in render-order.
-- Location IDs must match BodyLocation= and CanBeEquipped= values in items.txt.
local group = BodyLocations.getGroup("Human")
group:getOrCreateLocation("ArmRight")
group:getOrCreateLocation("ArmLeft")
group:getOrCreateLocation("LegRight")
group:getOrCreateLocation("LegLeft")
group:getOrCreateLocation("ArmRight_Prot")
group:getOrCreateLocation("ArmLeft_Prot")

View File

@@ -0,0 +1,26 @@
local function AddProfession()
local surgeon = ProfessionFactory.addProfession(
'surgeon',
getText("UI_prof_surgeon"),
"profession_surgeon",
-6,
getText("UI_profdesc_surgeon")
);
surgeon:addXPBoost(Perks.Doctor, 4);
surgeon:addXPBoost(Perks.SmallBlade, 3);
surgeon:getFreeRecipes():add("Make metal hand");
surgeon:getFreeRecipes():add("Make metal hook");
surgeon:getFreeRecipes():add("Make wooden hook");
surgeon:getFreeRecipes():add("Combine real surgeon kit");
surgeon:getFreeRecipes():add("Combine surgeon kit");
surgeon:getFreeRecipes():add("Combine improvised surgeon kit");
local profList = ProfessionFactory.getProfessions()
for i=1,profList:size() do
local prof = profList:get(i-1)
BaseGameCharacterDetails.SetProfessionDescription(prof)
end
end
Events.OnGameBoot.Add(AddProfession);

View File

@@ -0,0 +1,4 @@
ContextMenu_EN = {
ContextMenu_Cut_Arm = "Cut arm",
ContextMenu_Operate_Arm = "Operate arm",
}

View File

@@ -0,0 +1,18 @@
IGUI_EN = {
IGUI_ItemCat_Prosthesis = "Prosthesis",
IGUI_ItemCat_Surgeon_kit = "Surgeon kit",
IGUI_TOC_health_Cut = "Is cut",
IGUI_TOC_health_Cica = " and heal",
IGUI_TOC_health_Operate = " and operate",
IGUI_TOC_health_time1 = " - There is a long time left before heal",
IGUI_TOC_health_time2 = " - There is some time left before heal",
IGUI_TOC_health_time3 = " - There is a little time left before heal",
IGUI_TOC_health_time4 = " - No idea how long until it's healed.",
IGUI_char_Hand_multi = "Time multi due to amp/tot",
IGUI_perks_RightHand = "Right hand",
IGUI_perks_LeftHand = "Left hand",
IGUI_perks_Protheses = "Protheses skills",
}

View File

@@ -0,0 +1,31 @@
DisplayName_EN = {
ItemName_TOC.WoodenHook = "Wooden hook",
ItemName_TOC.MetalHook = "Metal hook",
ItemName_TOC.MetalHand = "Metal Hand",
ItemName_TOC.WoodenHook_right_noHand = "Wooden hook",
ItemName_TOC.WoodenHook_left_noHand = "Wooden hook",
ItemName_TOC.WoodenHook_right_noForearm = "Wooden hook",
ItemName_TOC.WoodenHook_right_noForearm = "Wooden hook",
ItemName_TOC.MetalHook_right_noHand = "Metal hook",
ItemName_TOC.MetalHook_left_noHand = "Metal hook",
ItemName_TOC.MetalHook_right_noForearm = "Metal hook",
ItemName_TOC.MetalHook_left_noForearm = "Metal hook",
ItemName_TOC.MetalHand_right_noHand = "Metal Hand",
ItemName_TOC.MetalHand_left_noHand = "Metal Hand",
ItemName_TOC.MetalHand_right_noForearm = "Metal Hand",
ItemName_TOC.MetalHand_left_noForearm = "Metal Hand",
ItemName_TOC.Improvised_surgeon_kit = "Improvised surgeon kit",
ItemName_TOC.Surgeon_kit = "Surgeon kit",
ItemName_TOC.Real_surgeon_kit = "Real surgeon kit",
ItemName_TOC.SurgeonMag1 = "Surgeon magazine for dummies",
ItemName_TOC.SurgeonMag2 = "Surgeon magazine for students",
ItemName_TOC.SurgeonMag3 = "Surgeon magazine for experts",
ItemName_TOC.ProthesisMag1 = "Prothesis magazine for dummies",
ItemName_TOC.ProthesisMag2 = "Prothesis magazine for experienced",
ItemName_TOC.ProthesisMag3 = "Prothesis magazine for experts",
}

View File

@@ -0,0 +1,26 @@
Tooltip_EN = {
Tooltip_Real_surgeon_kit = "Real surgeon kit. To use on a cut limb.<br>Big heal dor the severed limb, reduce time to cicatrize.",
Tooltip_Surgeon_kit = "Surgeon kit. To use on a cut limb.<br>Heal for the severed limb, reduce time to cicatrize.",
Tooltip_Improvised_surgeon_kit = "Improvised surgeon kit. To use on a cut limb.<br>Small heal for the severed limb, reduce time to cicatrize.",
Tooltip_equip_prothesis_hand = "Water Resistance is the time multiplier for actions<br>Without prosthesis, the multiplier is 2"
Tooltip_equip_prothesis_fore = "Water Resistance is the time multiplier for actions<br>Without prosthesis, the multiplier is 2.5"
Tooltip_prothesis_hand = "Prosthesis for hand. You need to cicatrize to use.<br> It's done by having a bandage (alcohol is better) when cut, use a surgeon kit and wait."
Tooltip_prothesis_fore = "Prosthesis for forearm. You need to cicatrize to use.<br> It's done by having a bandage (alcohol is better) when cut, use a surgeon kit and wait."
Recipe_Tooltip_Wooden_hook = "Make a prothesis wooden hook.<br>To use on a cut hand or fore arm.<br>Cut arm cannot be equip."
Recipe_Tooltip_Metal_hook = "Make a prothesis metal hook.<br>To use on a cut hand or fore arm.<br>Cut arm cannot be equip."
Recipe_Tooltip_Metal_hand = "Make a prothesis metal hand.<br>To use on a cut hand or fore arm.<br>Cut arm cannot be equip."
Recipe_Tooltip_Real_surgeon_kit = "Make a real surgeon kit.<br>Big heal dor the severed limb, reduce time to cicatrize."
Recipe_Tooltip_Surgeon_kit = "Make a surgeon kit.<br>Heal for the severed limb, reduce time to cicatrize."
Recipe_Tooltip_Improvised_surgeon_kit = "Make an improvised surgeon kit.<br>Small heal for the severed limb, reduce time to cicatrize."
Tooltip_SurgeonMag1 = "Learn how to make an improvised surgeon kit!"
Tooltip_SurgeonMag2 = "Learn how to make a surgeon kit!"
Tooltip_SurgeonMag3 = "Learn how to make a real surgeon kit!"
Tooltip_ProthesisMag1 = "Learn how to make a wooden hook!"
Tooltip_ProthesisMag2 = "Learn how to make a metal hook!"
Tooltip_ProthesisMag3 = "Learn how to make a metal hand!"
}

View File

@@ -0,0 +1,32 @@
UI_EN = {
UI_ContextMenu_InstallProthesis = "Install prothesis",
UI_ContextMenu_UninstallProthesis = "Uninstall prothesis",
UI_ContextMenu_Operate = "Operate",
UI_ContextMenu_OperateOven = "Operate with oven",
UI_ContextMenu_CutArm = "Cut arm",
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_trait_Amputee1 = "Amputee hand",
UI_trait_Amputee1desc = "Begin the game a hand cut and heal but also a metal hook.",
UI_trait_Amputee2 = "Amputee forearm",
UI_trait_Amputee2desc = "Begin the game a forearm cut and heal but also a metal hook.",
UI_trait_Amputee3 = "Amputee arm",
UI_trait_Amputee3desc = "Begin the game an arm cut and heal, good luck.",
UI_trait_Insensitive = "Insensitive to pain",
UI_trait_Insensitivedesc = "Reduces maximum pain.",
UI_ContextMenu_RightHand = "Right hand",
UI_ContextMenu_RightForearm = "Right forearm",
UI_ContextMenu_RightArm = "Right arm",
UI_ContextMenu_LeftHand = "Left hand",
UI_ContextMenu_LeftForearm = "Left forearm",
UI_ContextMenu_LeftArm = "Left arm",
UI_ContextMenu_My = "My ",
UI_ContextMenu_Now_cut = " is now heal !",
UI_ContextMenu_Heal_from_zomb = "I heal from zombification !",
UI_ContextMenu_Cut_for_nothing = "I cut for nothing..."
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

54
media/perks.txt Normal file
View File

@@ -0,0 +1,54 @@
VERSION = 1,
perk Protheses
{
parent = None,
translation = Protheses,
passive = false,
xp1 = 0,
xp2 = 0,
xp3 = 0,
xp4 = 0,
xp5 = 0,
xp6 = 0,
xp7 = 0,
xp8 = 0,
xp9 = 0,
xp10 = 0,
}
perk LeftHand
{
parent = Protheses,
name = LeftHand,
translation = LeftHand,
passive = false,
xp1 = 50,
xp2 = 100,
xp3 = 200,
xp4 = 500,
xp5 = 1000,
xp6 = 2500,
xp7 = 4000,
xp8 = 5000,
xp9 = 7000,
xp10 = 9000,
}
perk RightHand
{
parent = Protheses,
name = RightHand,
translation = RightHand,
passive = false,
xp1 = 50,
xp2 = 100,
xp3 = 200,
xp4 = 500,
xp5 = 1000,
xp6 = 2500,
xp7 = 4000,
xp8 = 6000,
xp9 = 7000,
xp10 = 9000,
}

375
media/scripts/TOC_items.txt Normal file
View File

@@ -0,0 +1,375 @@
module TOC
{
imports
{
Base
}
/****************** Cloth that look like a cut arm ******************/
item ArmRight_noHand
{
Type = Clothing,
ClothingItem = ArmRight_noHand,
BodyLocation = ArmRight,
Weight = 0,
CombatSpeedModifier = 0.9,
Insulation = 1.0,
WindResistance = 1.0,
WaterResistance = 1.0,
}
item ArmRight_noForearm
{
Type = Clothing,
ClothingItem = ArmRight_noForeArm,
BodyLocation = ArmRight,
Weight = 0,
CombatSpeedModifier = 0.8,
Insulation = 1.0,
WindResistance = 1.0,
WaterResistance = 1.0,
}
item ArmRight_noArm
{
Type = Clothing,
ClothingItem = ArmRight_noArm,
BodyLocation = ArmRight,
Weight = 0,
CombatSpeedModifier = 0.7,
Insulation = 1.0,
WindResistance = 1.0,
WaterResistance = 1.0,
}
item ArmLeft_noHand
{
Type = Clothing,
ClothingItem = ArmLeft_noHand,
BodyLocation = ArmLeft,
Weight = 0,
CombatSpeedModifier = 0.9,
Insulation = 1.0,
WindResistance = 1.0,
WaterResistance = 1.0,
}
item ArmLeft_noForearm
{
Type = Clothing,
ClothingItem = ArmLeft_noForeArm,
BodyLocation = ArmLeft,
Weight = 0,
CombatSpeedModifier = 0.8,
Insulation = 1.0,
WindResistance = 1.0,
WaterResistance = 1.0,
}
item ArmLeft_noArm
{
Type = Clothing,
ClothingItem = ArmLeft_noArm,
BodyLocation = ArmLeft,
Weight = 0,
CombatSpeedModifier = 0.7,
Insulation = 1.0,
WindResistance = 1.0,
WaterResistance = 1.0,
}
/************************ Other items ************************/
item Improvised_surgeon_kit
{
Type = Normal,
Weight = 0.1,
DisplayCategory = Surgeon_kit,
DisplayName = Improvised surgeon kit,
Tooltip = Tooltip_Improvised_surgeon_kit,
Icon = surgeonKit,
}
item Surgeon_kit
{
Type = Normal,
Weight = 0.2,
DisplayCategory = Surgeon_kit,
DisplayName = Surgeon kit,
Tooltip = Tooltip_Surgeon_kit,
Icon = surgeonKit,
}
item Real_surgeon_kit
{
Type = Normal,
Weight = 0.3,
DisplayCategory = Surgeon_kit,
DisplayName = Real surgeon kit,
Tooltip = Tooltip_Real_surgeon_kit,
Icon = surgeonKit,
}
/************************ Prothese cloth ************************/
item WoodenHook_right_noHand
{
Weight = 1,
Type = Clothing,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_woodenHook,
ClothingItem = ArmRight_WoodenHook,
BodyLocation = ArmRight_Prot,
Icon = woodenHook,
Tooltip = Tooltip_equip_prothesis_hand,
WaterResistance = 15,
}
item WoodenHook_left_noHand
{
Weight = 1,
Type = Clothing,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_woodenHook,
ClothingItem = ArmLeft_WoodenHook,
BodyLocation = ArmLeft_Prot,
Icon = woodenHook,
Tooltip = Tooltip_equip_prothesis_hand,
WaterResistance = 15,
}
item MetalHook_right_noHand
{
Weight = 0.5,
Type = Clothing,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_metalHook,
ClothingItem = ArmRight_MetalHook,
BodyLocation = ArmRight_Prot,
Icon = metalHook,
Tooltip = Tooltip_equip_prothesis_hand,
WaterResistance = 13,
}
item MetalHook_left_noHand
{
Weight = 0.5,
Type = Clothing,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_metalHook,
ClothingItem = ArmLeft_MetalHook,
BodyLocation = ArmLeft_Prot,
Icon = metalHook,
Tooltip = Tooltip_equip_prothesis_hand,
WaterResistance = 13,
}
item MetalHand_right_noHand
{
Weight = 0.3,
Type = Clothing,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_metalHand,
ClothingItem = ArmRight_MetalHamd,
BodyLocation = ArmRight_Prot,
Icon = metalHand,
Tooltip = Tooltip_equip_prothesis_hand,
WaterResistance = 11,
}
item MetalHand_left_noHand
{
Weight = 0.3,
Type = Clothing,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_metalHand,
ClothingItem = ArmLeft_MetalHand,
BodyLocation = ArmLeft_Prot,
Icon = metalHand,
Tooltip = Tooltip_equip_prothesis_hand",
WaterResistance = 11,
}
item WoodenHook_right_noForearm
{
Weight = 2,
Type = Clothing,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_woodenHook,
ClothingItem = ArmRight_WoodenHook_fore,
BodyLocation = ArmRight_Prot,
Icon = woodenHook,
Tooltip = Tooltip_equip_prothesis_fore,
WaterResistance = 16,
}
item WoodenHook_left_noForearm
{
Weight = 2,
Type = Clothing,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_woodenHook,
ClothingItem = ArmLeft_WoodenHook_fore,
BodyLocation = ArmLeft_Prot,
Icon = woodenHook,
Tooltip = Tooltip_equip_prothesis_fore,
WaterResistance = 16,
}
item MetalHook_right_noForearm
{
Weight = 1.5,
Type = Clothing,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_metalHook,
ClothingItem = ArmRight_MetalHook_fore,
BodyLocation = ArmRight_Prot,
Icon = metalHook,
Tooltip = Tooltip_equip_prothesis_fore,
WaterResistance = 14,
}
item MetalHook_left_noForearm
{
Weight = 1.5,
Type = Clothing,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_metalHook,
ClothingItem = ArmLeft_MetalHook_fore,
BodyLocation = ArmLeft_Prot,
Icon = metalHook,
Tooltip = Tooltip_equip_prothesis_fore,
WaterResistance = 14,
}
item MetalHand_right_noForearm
{
Weight = 1.2,
Type = Clothing,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_metalHand,
ClothingItem = ArmRight_MetalHand_fore,
BodyLocation = ArmRight_Prot,
Icon = metalHand,
Tooltip = Tooltip_equip_prothesis_fore,
WaterResistance = 12,
}
item MetalHand_left_noForearm
{
Weight = 1.2,
Type = Clothing,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_metalHand,
ClothingItem = ArmLeft_MetalHand_fore,
BodyLocation = ArmLeft_Prot,
Icon = metalHand,
Tooltip = Tooltip_equip_prothesis_fore,
WaterResistance = 12,
}
/************************ Prothese items ************************/
item WoodenHook
{
Weight = 1,
Type = Normal,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_woodenHook,
Icon = woodenHook,
Tooltip = Tooltip_prothesis_hand,
}
item MetalHook
{
Weight = 0.5,
Type = Normal,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_metalHook,
Icon = metalHook,
Tooltip = Tooltip_prothesis_hand,
}
item MetalHand
{
Weight = 0.3,
Type = Normal,
DisplayCategory = Prosthesis,
DisplayName = DisplayName_metalHand,
Icon = metalHand,
Tooltip = Tooltip_prothesis_hand,
}
/**************************** Mags ****************************/
item SurgeonMag1
{
Weight = 0.1,
Type = Literature,
DisplayName = ,
Icon = surgeonMag1,
TeachedRecipes = Combine improvised surgeon kit,
ReplaceOnUse = SurgeonMag1,
Tooltip = Tooltip_SurgeonMag1,
}
item SurgeonMag2
{
Weight = 0.1,
Type = Literature,
DisplayName = ,
Icon = surgeonMag2,
TeachedRecipes = Combine surgeon kit,
ReplaceOnUse = SurgeonMag2,
Tooltip = Tooltip_SurgeonMag2,
}
item SurgeonMag3
{
Weight = 0.1,
Type = Literature,
DisplayName = ,
Icon = surgeonMag3,
TeachedRecipes = Combine real surgeon kit,
ReplaceOnUse = SurgeonMag3,
Tooltip = Tooltip_SurgeonMag3,
}
item ProthesisMag1
{
Weight = 0.1,
Type = Literature,
DisplayName = ,
Icon = ProthesisMag1,
TeachedRecipes = Make wooden hook,
ReplaceOnUse = ProthesisMag1,
Tooltip = Tooltip_ProthesisMag1,
}
item ProthesisMag2
{
Weight = 0.1,
Type = Literature,
DisplayName = ,
Icon = ProthesisMag2,
TeachedRecipes = Make metal hook,
ReplaceOnUse = ProthesisMag2,
Tooltip = Tooltip_ProthesisMag2,
}
item ProthesisMag3
{
Weight = 0.1,
Type = Literature,
DisplayName = ,
Icon = ProthesisMag3,
TeachedRecipes = Make metal hand,
ReplaceOnUse = ProthesisMag3,
Tooltip = Tooltip_ProthesisMag2,
}
}

View File

@@ -0,0 +1,125 @@
module TOC
{
imports
{
Base
TOC
}
/*************RECIPES*******************/
recipe Combine improvised surgeon kit
{
Nails,
Thread=3,
Result: Improvised_surgeon_kit,
Time: 30.0,
NeedToBeLearn: false,
CanBeDoneFromFloor: false,
OnGiveXP: NoXP_OnGiveXP,
SkillRequired: FirstAid=2,
Category: Surgeon,
Tooltip: Recipe_Tooltip_Improvised_surgeon_kit,
NeedToBeLearn: true,
}
recipe Combine surgeon kit
{
Needle,
Thread=3,
Bandage,
AlcoholWipes/Disinfectant,
Result: Surgeon_kit,
Time: 30.0,
NeedToBeLearn: false,
CanBeDoneFromFloor: false,
OnGiveXP: NoXP_OnGiveXP,
SkillRequired: FirstAid=4,
Category: Surgeon,
Tooltip: Recipe_Tooltip_Surgeon_kit,
NeedToBeLearn: true,
}
recipe Combine real surgeon kit
{
SutureNeedle,
Thread=3,
AlcoholWipes/Disinfectant,
SutureNeedleHolder,
Tweezers,
Gloves_Surgical,
Scalpel,
CottonBalls,
Bandage,
Result: Real_surgeon_kit,
Time: 30.0,
NeedToBeLearn: false,
CanBeDoneFromFloor: false,
OnGiveXP: NoXP_OnGiveXP,
SkillRequired: FirstAid=4,
Category: Surgeon,
Tooltip: Recipe_Tooltip_Real_surgeon_kit,
NeedToBeLearn: true,
}
recipe Make wooden hook
{
Nails=10,
Plank=3,
keep [Recipe.GetItemTypes.Saw],
keep [Recipe.GetItemTypes.Hammer],
Result: WoodenHook,
Time: 100.0,
NeedToBeLearn: false,
CanBeDoneFromFloor: false,
OnGiveXP: NoXP_OnGiveXP,
SkillRequired: Carpentry=4,
Category: Surgeon,
Tooltip: Recipe_Tooltip_Wooden_hook,
NeedToBeLearn: true,
}
recipe Make metal hook
{
SheetMetal,
BlowTorch=7,
keep WeldingMask,
Result: MetalHook,
Time: 250.0,
NeedToBeLearn: false,
CanBeDoneFromFloor: false,
OnGiveXP: NoXP_OnGiveXP,
SkillRequired: MetalWelding=4,
Category: Surgeon,
Tooltip: Recipe_Tooltip_Metal_hook,
NeedToBeLearn: true,
}
recipe Make metal hand
{
Nails=10,
Plank,
keep [Recipe.GetItemTypes.Saw],
keep [Recipe.GetItemTypes.Hammer],
SheetMetal,
BlowTorch=7,
keep WeldingMask,
Result: MetalHand,
Time: 250.0,
NeedToBeLearn: false,
CanBeDoneFromFloor: false,
OnGiveXP: NoXP_OnGiveXP,
SkillRequired: Carpentry=8,
SkillRequired: MetalWelding=8,
Category: Surgeon,
Tooltip: Recipe_Tooltip_Metal_hand,
NeedToBeLearn: true,
}
}

View File

@@ -0,0 +1,35 @@
module base {
sound Cut_sound {
category = TOC,
loop = true,
is3D = true,
clip {
file = media/sound/Cut_sound.ogg,
distanceMax = 3,
volume = 1.0,
}
}
sound Operate_sound {
category = TOC,
loop = true,
is3D = true,
clip {
file = media/sound/Hit_sound.ogg,
distanceMax = 3,
volume = 1.0,
}
}
sound Burn_sound {
category = TOC,
loop = false,
is3D = true,
clip {
file = media/sound/Burn_sound.ogg,
distanceMax = 5,
volume = 1.0,
}
}
}

BIN
media/sound/Burn_sound.ogg Normal file

Binary file not shown.

BIN
media/sound/Cut_sound.ogg Normal file

Binary file not shown.

BIN
media/sound/Hit_sound.ogg Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
media/ui/TOC/Empty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Some files were not shown because too many files have changed in this diff Show More