From 3e2e22a1f036e4d9632fb1b9652f99708dbc9e7e Mon Sep 17 00:00:00 2001 From: vodofrede Date: Wed, 20 Apr 2022 20:43:56 +0200 Subject: [PATCH] added aux effects --- classes.json | 62 ++++++++++++++++++++++++++++++++++++++++++++ convert_params.py | 65 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 classes.json diff --git a/classes.json b/classes.json new file mode 100644 index 0000000..140d96f --- /dev/null +++ b/classes.json @@ -0,0 +1,62 @@ +[ + { + "id": "wretch", + "name": "Wretch", + "level": 1, + "stats": [10, 10, 10, 10, 10, 10, 10, 10] + }, + { + "id": "bandit", + "name": "Bandit", + "level": 5, + "stats": [10, 11, 10, 9, 13, 9, 8, 14] + }, + { + "id": "astrologer", + "name": "Astrologer", + "level": 6, + "stats": [9, 15, 9, 8, 12, 16, 7, 9] + }, + { + "id": "hero", + "name": "Hero", + "level": 7, + "stats": [14, 9, 12, 16, 9, 7, 8, 11] + }, + { + "id": "prophet", + "name": "Prophet", + "level": 7, + "stats": [10, 14, 8, 11, 10, 7, 16, 10] + }, + { + "id": "warrior", + "name": "Warrior", + "level": 8, + "stats": [11, 12, 11, 10, 16, 10, 8, 9] + }, + { + "id": "vagabond", + "name": "Vagabond", + "level": 9, + "stats": [15, 10, 11, 14, 13, 9, 9, 7] + }, + { + "id": "samurai", + "name": "Samurai", + "level": 9, + "stats": [12, 11, 13, 12, 15, 9, 8, 8] + }, + { + "id": "prisoner", + "name": "Prisoner", + "level": 9, + "stats": [11, 12, 11, 11, 14, 14, 6, 9] + }, + { + "id": "confessor", + "name": "Confessor", + "level": 10, + "stats": [10, 13, 10, 12, 12, 9, 14, 9] + } +] diff --git a/convert_params.py b/convert_params.py index ab4c0b8..42ea7f5 100644 --- a/convert_params.py +++ b/convert_params.py @@ -169,6 +169,7 @@ def main(): open("input/AttackElementCorrectParam.csv") as af, open("input/EquipParamWeapon.csv") as wf, open("input/CalcCorrectGraph.csv") as cf, + open("input/SpEffectParam.csv") as sf, ): rows = list(csv.DictReader(wf, delimiter=";")) @@ -182,9 +183,12 @@ def main(): row["Row ID"]: row for row in softcaps if 0 <= int(row["Row ID"]) <= 16 } + effects = list(csv.DictReader(sf, delimiter=";")) + effects = {row["Row ID"]: row for row in effects} + for row in rows: if not ignored(row): - process_weapon(row, masks, softcaps) + process_weapon(row, masks, effects) process_damage(softcaps) @@ -430,7 +434,7 @@ def to_mask(str): return 0 -def process_weapon(row, masks, caps): +def process_weapon(row, masks, effects): name, infusion = split_weapon_name(row["Row Name"]) id = to_kebab(name) @@ -501,12 +505,68 @@ def process_weapon(row, masks, caps): buffable = "True" in row["Is Buffable"] + # Auxiliary Effects (blood, poison) + aux = {} + for aux_id in [row["Behavior SpEffect 1"], row["Behavior SpEffect 2"]]: + if int(aux_id) != -1 and int(aux_id) > 100000: + aux_name = effects[aux_id]["Row Name"] + xs = [x for x in range(0, 26)] + ys = [effects[str(int(aux_id) + x)] for x in xs] + + if "Hemorrhage" in aux_name: + ty = "bleed" + ys = [int(y["Inflict Hemorrhage +"]) for y in ys] + elif "Frostbite" in aux_name: + ty = "frost" + ys = [int(y["Inflict Frostbite +"]) for y in ys] + elif "Poison" in aux_name: + ty = "poison" + ys = [int(y["Inflict Poison +"]) for y in ys] + elif "Scarlet Rot" in aux_name: + ty = "scarlet_rot" + ys = [int(y["Inflict Scarlet Rot +"]) for y in ys] + elif "Madness" in aux_name: + ty = "madness" + ys = [int(y["Inflict Madness +"]) for y in ys] + elif "Sleep" in aux_name: + ty = "sleep" + ys = [int(y["Inflict Sleep +"]) for y in ys] + elif "Blight" in aux_name: + ty = "blight" + ys = [int(y["Inflict Blight +"]) for y in ys] + aux[ty] = regression(xs, ys) + elif int(aux_id) != -1 and int(aux_id) <= 100000: + aux_name = effects[aux_id]["Row Name"] + if "Hemorrhage" in aux_name: + ty = "bleed" + base = effects[aux_id]["Inflict Hemorrhage +"] + elif "Frostbite" in aux_name: + ty = "frost" + base = effects[aux_id]["Inflict Frostbite +"] + elif "Poison" in aux_name: + ty = "poison" + base = effects[aux_id]["Inflict Poison +"] + elif "Scarlet Rot" in aux_name: + ty = "scarlet_rot" + base = effects[aux_id]["Inflict Scarlet Rot +"] + elif "Madness" in aux_name: + ty = "madness" + base = effects[aux_id]["Inflict Madness +"] + elif "Sleep" in aux_name: + ty = "sleep" + base = effects[aux_id]["Inflict Sleep +"] + elif "Blight" in aux_name: + ty = "blight" + base = effects[aux_id]["Inflict Blight +"] + aux[ty] = [0.0, aux_name] + if id in weapons: if not id in IGNORED_WEAPON_INFUSIONS: weapon = weapons[id] weapon["infusions"][infusion] = { "damage": damage, "scaling": scaling, + "aux": aux, "masks": weapon_masks, "corrections": corrections, "buffable": buffable, @@ -537,6 +597,7 @@ def process_weapon(row, masks, caps): weapon["infusions"][infusion] = { "damage": damage, "scaling": scaling, + "aux": aux, "masks": weapon_masks, "corrections": corrections, "buffable": buffable,