Added recipe generation
This commit is contained in:
38
.gitignore
vendored
Normal file
38
.gitignore
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
python_helpers/outputs/output_clothing/Prost_Left_Hand_LeatherBase_MetalHand.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_Hand_LeatherBase_MetalHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_Hand_LeatherBase_WoodenHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_Hand_MetalBase_MetalHand.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_Hand_MetalBase_MetalHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_Hand_MetalBase_WoodenHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_Hand_WoodenBase_MetalHand.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_Hand_WoodenBase_MetalHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_Hand_WoodenBase_WoodenHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_LowerArm_LeatherBase_MetalHand.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_LowerArm_LeatherBase_MetalHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_LowerArm_LeatherBase_WoodenHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_LowerArm_MetalBase_MetalHand.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_LowerArm_MetalBase_MetalHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_LowerArm_MetalBase_WoodenHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_LowerArm_WoodenBase_MetalHand.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_LowerArm_WoodenBase_MetalHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Left_LowerArm_WoodenBase_WoodenHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_Hand_LeatherBase_MetalHand.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_Hand_LeatherBase_MetalHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_Hand_LeatherBase_WoodenHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_Hand_MetalBase_MetalHand.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_Hand_MetalBase_MetalHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_Hand_MetalBase_WoodenHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_Hand_WoodenBase_MetalHand.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_Hand_WoodenBase_MetalHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_Hand_WoodenBase_WoodenHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_LowerArm_LeatherBase_MetalHand.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_LowerArm_LeatherBase_MetalHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_LowerArm_LeatherBase_WoodenHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_LowerArm_MetalBase_MetalHand.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_LowerArm_MetalBase_MetalHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_LowerArm_MetalBase_WoodenHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_LowerArm_WoodenBase_MetalHand.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_LowerArm_WoodenBase_MetalHook.xml
|
||||||
|
python_helpers/outputs/output_clothing/Prost_Right_LowerArm_WoodenBase_WoodenHook.xml
|
||||||
|
python_helpers/outputs/output_item/script.txt
|
||||||
|
python_helpers/outputs/output_recipe/script.txt
|
||||||
BIN
media/textures/Item_ProstTestBase.png
Normal file
BIN
media/textures/Item_ProstTestBase.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
media/textures/Item_ProstTestTop.png
Normal file
BIN
media/textures/Item_ProstTestTop.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -60,10 +60,12 @@ def generate_recipe(recipe_name, recipe_items, result_name, time, skill_required
|
|||||||
root_element += "\t\tCategory: Surgeon,\n"
|
root_element += "\t\tCategory: Surgeon,\n"
|
||||||
root_element += f"\t\tTooltip: {tooltip},\n"
|
root_element += f"\t\tTooltip: {tooltip},\n"
|
||||||
|
|
||||||
root_element += "\t}"
|
root_element += "\t}\n"
|
||||||
|
|
||||||
|
|
||||||
with open("Test_recipe.txt", "wt") as file:
|
path = r'python_helpers/outputs/output_recipe/script.txt'
|
||||||
|
|
||||||
|
with open(path, "at") as file:
|
||||||
file.write(root_element)
|
file.write(root_element)
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
@@ -148,7 +150,7 @@ for base_row in df_base.iterrows():
|
|||||||
base_id = base_row[1]["Base"]
|
base_id = base_row[1]["Base"]
|
||||||
top_id = top_row[1]["Top"]
|
top_id = top_row[1]["Top"]
|
||||||
|
|
||||||
item_id = base_id + "_" + top_id
|
item_id = "Prost_" + base_id + "_" + top_id
|
||||||
item_type = "Clothing"
|
item_type = "Clothing"
|
||||||
weight = "{0:.2f}".format(float(base_row[1]["Weight"]) + float(top_row[1]["Weight"]))
|
weight = "{0:.2f}".format(float(base_row[1]["Weight"]) + float(top_row[1]["Weight"]))
|
||||||
display_category = "Prosthesis"
|
display_category = "Prosthesis"
|
||||||
@@ -158,23 +160,47 @@ for base_row in df_base.iterrows():
|
|||||||
for side in sides:
|
for side in sides:
|
||||||
clothing_item_name = "Prost_" + side + "_" + limb + "_" + base_id + "_" + top_id
|
clothing_item_name = "Prost_" + side + "_" + limb + "_" + base_id + "_" + top_id
|
||||||
bl = prost_bodylocations[0] if side == "Right" else prost_bodylocations[1]
|
bl = prost_bodylocations[0] if side == "Right" else prost_bodylocations[1]
|
||||||
generate_item(item_id, weight, item_type, display_category, display_name, "TempIcon", "TempTooltip", "false", clothing_item_name, bl, "TestBloodLocation")
|
|
||||||
|
icon = "metalLeg"
|
||||||
|
generate_item(item_id, weight, item_type, display_category, display_name, icon, "TempTooltip", "false", clothing_item_name, bl, "TestBloodLocation")
|
||||||
|
|
||||||
|
|
||||||
# ITEM GENERATION PASS - Single item to assemble stuff
|
# ITEM GENERATION PASS - Single item to assemble stuff
|
||||||
def generate_normal_items(df, type):
|
def generate_normal_items(df, type):
|
||||||
for row in df.iterrows():
|
for row in df.iterrows():
|
||||||
item_id = "ProsthPart_" + row[1][type]
|
item_id = "ProstPart_" + row[1][type]
|
||||||
item_type = "Normal"
|
item_type = "Normal"
|
||||||
weight = "{0:.2f}".format(float(row[1]["Weight"]))
|
weight = "{0:.2f}".format(float(row[1]["Weight"]))
|
||||||
display_category = "Prosthesis"
|
display_category = "Prosthesis"
|
||||||
display_name = row[1]["Display Name"]
|
display_name = row[1]["Display Name"]
|
||||||
generate_item(item_id, weight, item_type, display_category, display_name, "TempIcon", "TempTooltip", "false")
|
icon = "ProstTest" + type
|
||||||
|
generate_item(item_id, weight, item_type, display_category, display_name, icon, "TempTooltip", "false")
|
||||||
|
|
||||||
generate_normal_items(df_base, "Base")
|
generate_normal_items(df_base, "Base")
|
||||||
generate_normal_items(df_top, "Top")
|
generate_normal_items(df_top, "Top")
|
||||||
|
|
||||||
|
|
||||||
|
# RECIPE GENERATION PASS
|
||||||
|
for base_row in df_base.iterrows():
|
||||||
|
for top_row in df_top.iterrows():
|
||||||
|
recipe_name = f"Craft prosthesis with {base_name} and {top_name}"
|
||||||
|
|
||||||
|
first_item = "ProstPart_" + base_row[1]["Base"]
|
||||||
|
second_item = "ProstPart_" + top_row[1]["Top"]
|
||||||
|
|
||||||
|
recipe_items = [first_item, second_item]
|
||||||
|
result = "Prost_" + base_row[1]["Base"] + "_" + top_row[1]["Top"]
|
||||||
|
time = 10 # TODO Change this
|
||||||
|
skill_required = ["FirstAid","2"] # TODO Change this
|
||||||
|
tooltip = "Tooltip_test"
|
||||||
|
generate_recipe(recipe_name, recipe_items, result, time, skill_required, tooltip)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
|
|
||||||
recipe_name = "Test Recipe"
|
recipe_name = "Test Recipe"
|
||||||
|
|||||||
Reference in New Issue
Block a user