From e044fc4255aa64ef1dbc3d20ed87ed6e2f61a6bd Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 9 May 2021 19:01:59 -0400 Subject: Code refactoring --- parser/scrapeToJson.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'parser/scrapeToJson.py') diff --git a/parser/scrapeToJson.py b/parser/scrapeToJson.py index c4627ea..b1534c2 100755 --- a/parser/scrapeToJson.py +++ b/parser/scrapeToJson.py @@ -49,6 +49,10 @@ def processMonster(data, weapons, armors, spells): return (desc['stats'][ability] - 10) // 2 desc['inventory'] = [] # Fill with weapons and armor desc['observant'] = False # maybe set to true later + # Add a few null-valued items that will be set when the creature is first generated + desc['givenName'] = 'NAME' + desc['hpMax'] = -1 + desc['hp'] = -1 # Modify ac stuff desc['natural_armor'] = {'name': '', 'bonus': 0} correctAC = int(desc['ac'].split(' ')[0] if ' ' in desc['ac'] else desc['ac']) -- cgit v1.2.3