diff options
author | Your Name <you@example.com> | 2021-05-09 13:56:46 -0400 |
---|---|---|
committer | Your Name <you@example.com> | 2021-05-09 13:56:46 -0400 |
commit | d13358b71ec15085f2638fd9c3fc634df62dfc94 (patch) | |
tree | 467c643a068bf2d83da3632823a6434244ae004e /parser | |
parent | e3aaa68a2ea1a403256150121c57a0287014162f (diff) | |
download | dmtool-d13358b71ec15085f2638fd9c3fc634df62dfc94.tar.gz dmtool-d13358b71ec15085f2638fd9c3fc634df62dfc94.tar.bz2 dmtool-d13358b71ec15085f2638fd9c3fc634df62dfc94.zip |
Reduced dependency on json-related hacks
Diffstat (limited to 'parser')
-rwxr-xr-x | parser/scrapeToJson.py | 6 |
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 |