Fixed recipes again

This commit is contained in:
Pao
2023-03-03 00:32:01 +01:00
parent b66707ba10
commit 46175964f1
3 changed files with 30 additions and 14 deletions

View File

@@ -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()
run_recipe_assemble_generation()

View File

@@ -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)

View File

@@ -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*******************/