Fixes to extra equip and recipes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -0,0 +1 @@
|
|||||||
|
.vscode/settings.json
|
||||||
|
|||||||
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"todo-tree.tree.scanMode": "workspace",
|
"todo-tree.tree.scanMode": "workspace",
|
||||||
"zomboid_user_folder": "C:/Users/picch/Zomboid",
|
"zomboid_user_folder": "C:/Users/picch/Zomboid",
|
||||||
"zomboid_folder": "E:\\Steam\\steamapps\\common\\ProjectZomboid",
|
"zomboid_folder": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\ProjectZomboid",
|
||||||
"zomboid_server_folder": "E:\\Steam\\steamapps\\common\\Project Zomboid Dedicated Server",
|
"zomboid_server_folder": "E:\\Steam\\steamapps\\common\\Project Zomboid Dedicated Server",
|
||||||
"Lua.diagnostics.globals": [
|
"Lua.diagnostics.globals": [
|
||||||
"ModOptions",
|
"ModOptions",
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ end
|
|||||||
local og_ISWearClothing_isValid = ISWearClothing.isValid
|
local og_ISWearClothing_isValid = ISWearClothing.isValid
|
||||||
function ISWearClothing:isValid()
|
function ISWearClothing:isValid()
|
||||||
local isEquippable = og_ISWearClothing_isValid(self)
|
local isEquippable = og_ISWearClothing_isValid(self)
|
||||||
|
|
||||||
|
-- TODO Do we actually need this?
|
||||||
local isProst = ProsthesisHandler.CheckIfProst(self.item)
|
local isProst = ProsthesisHandler.CheckIfProst(self.item)
|
||||||
|
|
||||||
if not isProst then return isEquippable end
|
if not isProst then return isEquippable end
|
||||||
@@ -111,27 +113,29 @@ local og_ISClothingExtraAction_isValid = ISClothingExtraAction.isValid
|
|||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
function ISClothingExtraAction:isValid()
|
function ISClothingExtraAction:isValid()
|
||||||
local isEquippable = og_ISClothingExtraAction_isValid(self)
|
local isEquippable = og_ISClothingExtraAction_isValid(self)
|
||||||
local isProst = ProsthesisHandler.CheckIfProst(self.itemExtra)
|
|
||||||
|
|
||||||
if not isProst then return isEquippable end
|
|
||||||
|
|
||||||
--the item that we gets is the OG one, so if we're coming from the left one and wanna switch to the right one we're still gonna get the Left bodylocation
|
--the item that we gets is the OG one, so if we're coming from the left one and wanna switch to the right one we're still gonna get the Left bodylocation
|
||||||
local testItem = InventoryItemFactory.CreateItem(self.extra)
|
local testItem = InventoryItemFactory.CreateItem(self.extra)
|
||||||
|
local isProst = ProsthesisHandler.CheckIfProst(testItem)
|
||||||
|
|
||||||
|
-- Early exit if it's not a prostheesis
|
||||||
|
if not isProst then return isEquippable end
|
||||||
|
|
||||||
|
if isEquippable and isProst then
|
||||||
local bodyLocation = testItem:getBodyLocation()
|
local bodyLocation = testItem:getBodyLocation()
|
||||||
if isEquippable and string.contains(bodyLocation, bodyLocArmProst) then
|
|
||||||
isEquippable = ProsthesisHandler.CheckIfEquippable(bodyLocation)
|
isEquippable = ProsthesisHandler.CheckIfEquippable(bodyLocation)
|
||||||
|
|
||||||
|
-- Just to let the player know
|
||||||
|
if not isEquippable then
|
||||||
|
-- TODO if its in here then it's gonna run at least 2 times
|
||||||
|
getPlayer():Say(getText("UI_Say_CantEquip"))
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return isEquippable
|
return isEquippable
|
||||||
end
|
end
|
||||||
|
|
||||||
local og_ISClothingExtraAction_stop = ISClothingExtraAction.stop
|
|
||||||
function ISClothingExtraAction:stop()
|
|
||||||
og_ISClothingExtraAction_stop(self)
|
|
||||||
if ProsthesisHandler.CheckIfProst(self.item) then
|
|
||||||
getPlayer():Say(getText("UI_Say_CantEquip"))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local og_ISClothingExtraAction_perform = ISClothingExtraAction.perform
|
local og_ISClothingExtraAction_perform = ISClothingExtraAction.perform
|
||||||
function ISClothingExtraAction:perform()
|
function ISClothingExtraAction:perform()
|
||||||
|
|||||||
4
media/lua/shared/Translate/EN/Recipes_EN.txt
Normal file
4
media/lua/shared/Translate/EN/Recipes_EN.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Recipes_EN = {
|
||||||
|
Recipe_Craft_Prosthetic_Arm = "Craft Prosthetic Arm",
|
||||||
|
Recipe_Craft_Prosthetic_Hook = "Craft Prosthetic Hook",
|
||||||
|
}
|
||||||
@@ -118,46 +118,5 @@ module TOC
|
|||||||
Icon = genericAmputation,
|
Icon = genericAmputation,
|
||||||
CanHaveHoles = false,
|
CanHaveHoles = false,
|
||||||
}
|
}
|
||||||
/****************** Clothing that look like a cut limb ******************/
|
|
||||||
|
|
||||||
item Prost_Hook_L
|
|
||||||
{
|
|
||||||
Type = Clothing,
|
|
||||||
DisplayCategory = Prosthesis,
|
|
||||||
DisplayName = ProstArmHook,
|
|
||||||
ClothingItem = Prost_Hook_L,
|
|
||||||
ClothingItemExtra = Prost_Hook_R,
|
|
||||||
ClothingItemExtraOption = InstallProstRight,
|
|
||||||
clothingExtraSubmenu = InstallProstLeft,
|
|
||||||
BodyLocation = TOC_ArmProst_L,
|
|
||||||
Weight = 0,
|
|
||||||
CombatSpeedModifier = 0.7,
|
|
||||||
BloodLocation = UpperArms;UpperBody,
|
|
||||||
Insulation = 1.0,
|
|
||||||
WindResistance = 1.0,
|
|
||||||
WaterResistance = 1.0,
|
|
||||||
Icon = genericAmputation,
|
|
||||||
CanHaveHoles = false,
|
|
||||||
}
|
|
||||||
|
|
||||||
item Prost_Hook_R
|
|
||||||
{
|
|
||||||
Type = Clothing,
|
|
||||||
DisplayCategory = Prosthesis,
|
|
||||||
DisplayName = ProstArmHook,
|
|
||||||
ClothingItem = Prost_Hook_R,
|
|
||||||
ClothingItemExtra = Prost_Hook_L,
|
|
||||||
ClothingItemExtraOption = InstallProstLeft,
|
|
||||||
clothingExtraSubmenu = InstallProstRight,
|
|
||||||
BodyLocation = TOC_ArmProst_R,
|
|
||||||
|
|
||||||
Weight = 0,
|
|
||||||
CombatSpeedModifier = 0.7,
|
|
||||||
BloodLocation = UpperArms;UpperBody,
|
|
||||||
Insulation = 1.0,
|
|
||||||
WindResistance = 1.0,
|
|
||||||
WaterResistance = 1.0,
|
|
||||||
Icon = genericAmputation,
|
|
||||||
CanHaveHoles = false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -7,33 +7,27 @@ module TOC
|
|||||||
/*************Craft Prosthetics*******************/
|
/*************Craft Prosthetics*******************/
|
||||||
recipe Craft Prosthetic Arm
|
recipe Craft Prosthetic Arm
|
||||||
{
|
{
|
||||||
ProstPart_WoodenBase,
|
MetalPipe=4,
|
||||||
ProstPart_WoodenHook,
|
Plank=2,
|
||||||
|
keep [Recipe.GetItemTypes.WeldingMask],
|
||||||
|
|
||||||
Time: 10.0,
|
|
||||||
Result:Prost_NormalArm_L,
|
Result:Prost_NormalArm_L,
|
||||||
|
Time:150.0,
|
||||||
|
Category:Welding,
|
||||||
|
OnGiveXP:Recipe.OnGiveXP.MetalWelding10,
|
||||||
NeedToBeLearn:true,
|
NeedToBeLearn:true,
|
||||||
CanBeDoneFromFloor: false,
|
|
||||||
OnGiveXP: NoXP_OnGiveXP,
|
|
||||||
SkillRequired: FirstAid=2,
|
|
||||||
Category: Surgeon,
|
|
||||||
OnCreate:ProsthesisRecipes.OnCreateProsthesis,
|
|
||||||
Tooltip: Recipe_Tooltip_AssembleProsthesis,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
recipe Craft Prosthetic Hook
|
recipe Craft Prosthetic Hook
|
||||||
{
|
{
|
||||||
ProstPart_WoodenBase,
|
MetalPipe=2,
|
||||||
ProstPart_WoodenHook,
|
Plank=2,
|
||||||
|
keep [Recipe.GetItemTypes.WeldingMask],
|
||||||
|
|
||||||
Time: 10.0,
|
|
||||||
Result:Prost_HookArm_L,
|
Result:Prost_HookArm_L,
|
||||||
NeedToBeLearn: true,
|
Time:150.0,
|
||||||
CanBeDoneFromFloor: false,
|
Category:Welding,
|
||||||
OnGiveXP: NoXP_OnGiveXP,
|
OnGiveXP:Recipe.OnGiveXP.MetalWelding10,
|
||||||
SkillRequired: FirstAid=2,
|
NeedToBeLearn:false,
|
||||||
Category: Surgeon,
|
|
||||||
OnCreate:ProsthesisRecipes.OnCreateProsthesis,
|
|
||||||
Tooltip: Recipe_Tooltip_AssembleProsthesis,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user