Add stat fire-max for Cathan's Rule

This commit is contained in:
2023-10-31 12:00:41 +01:00
parent 9057f81d5f
commit 8b94171d22
3 changed files with 20 additions and 1 deletions

View File

@@ -13,7 +13,9 @@ path = sys.argv[1] if len(sys.argv) >= 2 else "."
# into one. Same applies for all stats. # into one. Same applies for all stats.
special_stats = { special_stats = {
"firemindam": {"template": "dmg-fire"}, "firemindam": {"template": "dmg-fire"},
"firemaxdam": None, "firemaxdam": {
"template": "fire-max"
}, # Cathan's rule, no other max ele dmg source exists
"lightmindam": {"template": "dmg-ltng"}, "lightmindam": {"template": "dmg-ltng"},
"lightmaxdam": None, "lightmaxdam": None,
"magicmindam": {"template": "dmg-mag"}, "magicmindam": {"template": "dmg-mag"},

View File

@@ -273,6 +273,14 @@
"save_add": 0, "save_add": 0,
"save_param_bits": null "save_param_bits": null
}, },
"49": {
"text": "+# to Maximum Fire Damage",
"save_bits": [
9
],
"save_add": 0,
"save_param_bits": null
},
"50": { "50": {
"text": "Adds #-# Lightning Damage", "text": "Adds #-# Lightning Damage",
"save_bits": [ "save_bits": [

View File

@@ -239,3 +239,12 @@ class ParseItemTest(unittest.TestCase):
self.assertAlmostEqual( self.assertAlmostEqual(
lookup_affix(item.suffixes[2], False)["name"], "of Charged Shield" lookup_affix(item.suffixes[2], False)["name"], "of Charged Shield"
) )
def test_cathans_rule(self):
# Cathan's Rule: Only source of fire-max stat
data = bytes.fromhex(
"10008000050054c90448ad74276f910150448c180afc24ff1348fd3f212d85b415d25a48fb0f"
)
data, item = parse_item(data)
self.assertEqual(data, b"")
self.assertEqual(str(item.stats[0]), "+10 to Maximum Fire Damage")