aboutsummaryrefslogtreecommitdiff
path: root/parser
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-05-09 13:56:46 -0400
committerYour Name <you@example.com>2021-05-09 13:56:46 -0400
commitd13358b71ec15085f2638fd9c3fc634df62dfc94 (patch)
tree467c643a068bf2d83da3632823a6434244ae004e /parser
parente3aaa68a2ea1a403256150121c57a0287014162f (diff)
downloaddmtool-d13358b71ec15085f2638fd9c3fc634df62dfc94.tar.gz
dmtool-d13358b71ec15085f2638fd9c3fc634df62dfc94.tar.bz2
dmtool-d13358b71ec15085f2638fd9c3fc634df62dfc94.zip
Reduced dependency on json-related hacks
Diffstat (limited to 'parser')
-rwxr-xr-xparser/scrapeToJson.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/parser/scrapeToJson.py b/parser/scrapeToJson.py
index 9128190..c4627ea 100755
--- a/parser/scrapeToJson.py
+++ b/parser/scrapeToJson.py
@@ -48,6 +48,7 @@ def processMonster(data, weapons, armors, spells):
def getBonus(ability):
return (desc['stats'][ability] - 10) // 2
desc['inventory'] = [] # Fill with weapons and armor
+ desc['observant'] = False # maybe set to true later
# Modify ac stuff
desc['natural_armor'] = {'name': '', 'bonus': 0}
correctAC = int(desc['ac'].split(' ')[0] if ' ' in desc['ac'] else desc['ac'])
@@ -274,7 +275,10 @@ def processMonster(data, weapons, armors, spells):
if 'Perception' in desc['skills']:
shouldBe += desc['skills']['Perception'] * desc['prof']
if passivePercep != shouldBe:
- print('Passive perception didn\'t come out right for {}: is {}, but should be {}'.format(desc['name'], passivePercep, shouldBe))
+ if(passivePercep - 5 == shouldBe):
+ desc['observant'] = True
+ else:
+ print('Passive perception didn\'t come out right for {}: is {}, but should be {}'.format(desc['name'], passivePercep, shouldBe))
desc['senses'] = desc['senses'].split(', ')[:-1]
return desc