From d13358b71ec15085f2638fd9c3fc634df62dfc94 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 9 May 2021 13:56:46 -0400 Subject: Reduced dependency on json-related hacks --- parser/scrapeToJson.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'parser/scrapeToJson.py') 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 -- cgit v1.2.3