diff options
author | Your Name <you@example.com> | 2021-05-09 19:01:59 -0400 |
---|---|---|
committer | Your Name <you@example.com> | 2021-05-09 19:01:59 -0400 |
commit | e044fc4255aa64ef1dbc3d20ed87ed6e2f61a6bd (patch) | |
tree | 344c09421c5839a764a132fe9166f0e6e3f90e45 /parser | |
parent | d13358b71ec15085f2638fd9c3fc634df62dfc94 (diff) | |
download | dmtool-e044fc4255aa64ef1dbc3d20ed87ed6e2f61a6bd.tar.gz dmtool-e044fc4255aa64ef1dbc3d20ed87ed6e2f61a6bd.tar.bz2 dmtool-e044fc4255aa64ef1dbc3d20ed87ed6e2f61a6bd.zip |
Code refactoring
Diffstat (limited to 'parser')
-rwxr-xr-x | parser/scrapeToJson.py | 4 |
1 files changed, 4 insertions, 0 deletions
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']) |