Add stat Extra Blood for Gorefoot

This commit is contained in:
2023-10-26 00:02:40 +02:00
parent 5beb79607a
commit f8a628a65f
3 changed files with 47 additions and 15 deletions

View File

@@ -36,6 +36,7 @@ special_stats = {
"template": "ama",
"param_tooltips": ["ama", "pal", "nec", "sor", "bar", "dru", "ass"],
},
"item_extrablood": {"text": "Extra Blood"},
}
# Patching of missing data in properties.txt
@@ -98,21 +99,36 @@ for stat in itemstatcost:
continue
# special.template: properties.txt row
prop = properties[special["template"]]
obj = {
"text": prop["tooltip"],
"save_bits": [],
"save_add": itemstatcost[stat]["save_add"],
"save_param_bits": itemstatcost[stat]["save_param_bits"],
}
for prop_stat in prop["stats"]:
if prop_stat == "VARIABLE":
prop_stat = stat
if itemstatcost[prop_stat]["save_add"] != obj["save_add"]:
print(
f"Unexpected divergence in save_add for stats in prop {special_stats[stat]}"
)
obj["save_bits"].append(itemstatcost[prop_stat]["save_bits"])
if "template" in special:
prop = properties[special["template"]]
obj = {
"text": prop["tooltip"],
"save_bits": [],
"save_add": itemstatcost[stat]["save_add"],
"save_param_bits": itemstatcost[stat]["save_param_bits"],
}
for prop_stat in prop["stats"]:
if prop_stat == "VARIABLE":
prop_stat = stat
if itemstatcost[prop_stat]["save_add"] != obj["save_add"]:
print(
f"Unexpected divergence in save_add for stats in prop {special_stats[stat]}"
)
obj["save_bits"].append(itemstatcost[prop_stat]["save_bits"])
# else: use stat row + custom data
else:
obj = {
"text": "" if "text" not in special else special["text"],
"save_bits": [itemstatcost[stat]["save_bits"]]
if "save_bits" not in special
else special["save_bits"],
"save_add": itemstatcost[stat]["save_add"]
if "save_add" not in special
else special["save_add"],
"save_param_bits": itemstatcost[stat]["save_param_bits"]
if "save_param_bits" not in special
else special["save_param_bits"],
}
# special.param_tooltips: extra tooltips depending on param value
if "param_tooltips" in special:

View File

@@ -740,6 +740,14 @@
"save_add": 0,
"save_param_bits": null
},
"140": {
"text": "Extra Blood",
"save_bits": [
7
],
"save_add": 0,
"save_param_bits": null
},
"141": {
"text": "#% Deadly Strike",
"save_bits": [

View File

@@ -197,3 +197,11 @@ class ParseItemTest(unittest.TestCase):
data, item = parse_item(data)
self.assertEqual(data, b"")
self.assertEqual(str(item.stats[4]), "Indestructible")
def test_gorefoot(self):
data = bytes.fromhex(
"10008000050475a7260ca7d38d420f3610018706103c7cb0800f81130118d41a426244f80f"
)
data, item = parse_item(data)
self.assertEqual(data, b"")
self.assertEqual(item.stats[6].id, 140) # Extra Blood special stat