aboutsummaryrefslogtreecommitdiff
path: root/parser
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-05-09 19:01:59 -0400
committerYour Name <you@example.com>2021-05-09 19:01:59 -0400
commite044fc4255aa64ef1dbc3d20ed87ed6e2f61a6bd (patch)
tree344c09421c5839a764a132fe9166f0e6e3f90e45 /parser
parentd13358b71ec15085f2638fd9c3fc634df62dfc94 (diff)
downloaddmtool-e044fc4255aa64ef1dbc3d20ed87ed6e2f61a6bd.tar.gz
dmtool-e044fc4255aa64ef1dbc3d20ed87ed6e2f61a6bd.tar.bz2
dmtool-e044fc4255aa64ef1dbc3d20ed87ed6e2f61a6bd.zip
Code refactoring
Diffstat (limited to 'parser')
-rwxr-xr-xparser/scrapeToJson.py4
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'])