From 46175964f1cd7ed6cc88be67deab5126a58ea263 Mon Sep 17 00:00:00 2001 From: Pao Date: Fri, 3 Mar 2023 00:32:01 +0100 Subject: [PATCH] Fixed recipes again --- dev_stuff/python_helpers/main.py | 15 +++++++---- media/lua/client/JCIO_ProsthesisHandler.lua | 1 + media/scripts/JCIO_recipes.txt | 28 ++++++++++++++------- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/dev_stuff/python_helpers/main.py b/dev_stuff/python_helpers/main.py index d971409..f12d988 100644 --- a/dev_stuff/python_helpers/main.py +++ b/dev_stuff/python_helpers/main.py @@ -75,7 +75,7 @@ def generate_clothing_item(name, model, texture_choices): with open(path_idtable, "ab") as file: tree_guid.write(file, encoding='utf-8', pretty_print=True) -def generate_recipe(recipe_name, recipe_items, on_create_func, time, skill_required, tooltip): +def generate_recipe(recipe_name, result_name, recipe_items, on_create_func, time, skill_required, tooltip): root_element = f"recipe {recipe_name}\n" root_element += "\t{\n" @@ -86,7 +86,8 @@ def generate_recipe(recipe_name, recipe_items, on_create_func, time, skill_requi # if result != "": # root_element += f"\t\tResult: {result_name},\n" - root_element += f"\t\tTime: {time:.2f},\n" + root_element += f"\t\tTime: {time:.1f},\n" + root_element += f"\t\tResult: {result_name},\n" root_element += "\t\tNeedToBeLearn: true,\n" root_element += "\t\tCanBeDoneFromFloor: false,\n" root_element += "\t\tOnGiveXP: NoXP_OnGiveXP,\n" @@ -232,12 +233,13 @@ def run_recipe_assemble_generation(): # TODO add screwdriver and some screws to the items + result_name = "Prost_" + base_row[1]["Base"] + "_" + top_row[1]["Top"] recipe_items = [first_item, second_item] on_create_func = "ProsthesisRecipes.OnCreateProsthesis" time = 10 # TODO Change this skill_required = ["FirstAid", "2"] # TODO Change this tooltip = "Recipe_Tooltip_AssembleProsthesis" - generate_recipe(recipe_name, recipe_items, on_create_func, time, skill_required, tooltip) + generate_recipe(recipe_name, result_name, recipe_items, on_create_func, time, skill_required, tooltip) # RECIPE GENERATION PASS - Disassembly @@ -251,13 +253,16 @@ def run_recipe_disassemble_generation(): base_display_name = base_row[1]["Display Name"] top_display_name = top_row[1]["Display Name"] + + # TODO Add result name + result_name = "" recipe_name = f"Disassemble prosthesis with {base_display_name} and {top_display_name}" recipe_item = [f"Prost_{base_name}_{top_name}"] on_create_func = "ProsthesisRecipes.OnDisassembleProsthesis" time = 10 # TODO Change this skill_required = ["FirstAid", "2"] # TODO Change this tooltip = "Recipe_Tooltip_DisassembleProsthesis" - generate_recipe(recipe_name, recipe_item, on_create_func, time, skill_required, tooltip) + generate_recipe(recipe_name, result_name, recipe_item, on_create_func, time, skill_required, tooltip) # RECIPE GENERATION PASS - Single parts - Base @@ -266,4 +271,4 @@ def run_recipe_disassemble_generation(): -run_single_part_item_generation() \ No newline at end of file +run_recipe_assemble_generation() \ No newline at end of file diff --git a/media/lua/client/JCIO_ProsthesisHandler.lua b/media/lua/client/JCIO_ProsthesisHandler.lua index 9e9f068..31c2a0b 100644 --- a/media/lua/client/JCIO_ProsthesisHandler.lua +++ b/media/lua/client/JCIO_ProsthesisHandler.lua @@ -119,6 +119,7 @@ function ProsthesisRecipes.OnCreateProsthesis(items, result, player, selectedIte -- Set mod data for item with durability and all that crap -- Get condition from the items + print("JCIO: setting stats for prosthesis item") local condition = 0 for i=1,items:size() do local item = items:get(i-1) diff --git a/media/scripts/JCIO_recipes.txt b/media/scripts/JCIO_recipes.txt index 3bcd337..5c4ec85 100644 --- a/media/scripts/JCIO_recipes.txt +++ b/media/scripts/JCIO_recipes.txt @@ -74,7 +74,8 @@ recipe Craft prosthesis with Wooden Base and Wooden Hook ProstPart_WoodenHook, - Time: 10.00, + Time: 10.0, + Result: Prost_WoodenBase_WoodenHook, NeedToBeLearn: true, CanBeDoneFromFloor: false, OnGiveXP: NoXP_OnGiveXP, @@ -89,7 +90,8 @@ recipe Craft prosthesis with Wooden Base and Metal Hook ProstPart_MetalHook, - Time: 10.00, + Time: 10.0, + Result: Prost_WoodenBase_MetalHook, NeedToBeLearn: true, CanBeDoneFromFloor: false, OnGiveXP: NoXP_OnGiveXP, @@ -104,7 +106,8 @@ recipe Craft prosthesis with Wooden Base and Metal Hand ProstPart_MetalHand, - Time: 10.00, + Time: 10.0, + Result: Prost_WoodenBase_MetalHand, NeedToBeLearn: true, CanBeDoneFromFloor: false, OnGiveXP: NoXP_OnGiveXP, @@ -119,7 +122,8 @@ recipe Craft prosthesis with Metal Base and Wooden Hook ProstPart_WoodenHook, - Time: 10.00, + Time: 10.0, + Result: Prost_MetalBase_WoodenHook, NeedToBeLearn: true, CanBeDoneFromFloor: false, OnGiveXP: NoXP_OnGiveXP, @@ -134,7 +138,8 @@ recipe Craft prosthesis with Metal Base and Metal Hook ProstPart_MetalHook, - Time: 10.00, + Time: 10.0, + Result: Prost_MetalBase_MetalHook, NeedToBeLearn: true, CanBeDoneFromFloor: false, OnGiveXP: NoXP_OnGiveXP, @@ -149,7 +154,8 @@ recipe Craft prosthesis with Metal Base and Metal Hand ProstPart_MetalHand, - Time: 10.00, + Time: 10.0, + Result: Prost_MetalBase_MetalHand, NeedToBeLearn: true, CanBeDoneFromFloor: false, OnGiveXP: NoXP_OnGiveXP, @@ -164,7 +170,8 @@ recipe Craft prosthesis with Leather Base and Wooden Hook ProstPart_WoodenHook, - Time: 10.00, + Time: 10.0, + Result: Prost_LeatherBase_WoodenHook, NeedToBeLearn: true, CanBeDoneFromFloor: false, OnGiveXP: NoXP_OnGiveXP, @@ -179,7 +186,8 @@ recipe Craft prosthesis with Leather Base and Metal Hook ProstPart_MetalHook, - Time: 10.00, + Time: 10.0, + Result: Prost_LeatherBase_MetalHook, NeedToBeLearn: true, CanBeDoneFromFloor: false, OnGiveXP: NoXP_OnGiveXP, @@ -194,7 +202,8 @@ recipe Craft prosthesis with Leather Base and Metal Hand ProstPart_MetalHand, - Time: 10.00, + Time: 10.0, + Result: Prost_LeatherBase_MetalHand, NeedToBeLearn: true, CanBeDoneFromFloor: false, OnGiveXP: NoXP_OnGiveXP, @@ -204,6 +213,7 @@ recipe Craft prosthesis with Leather Base and Metal Hand Tooltip: Recipe_Tooltip_AssembleProsthesis, } + /*************Disassemble Prosthetics*******************/