Lavaeolous / PF1-StatBlock-Converter-Module

FoundryVTT Module to convert PF1 Statblocks into Foundry Actors (PC or NPC).
MIT License
14 stars 12 forks source link

Parser fails to find CMB and Concentration bonuses #508

Closed mkahvi closed 2 years ago

mkahvi commented 2 years ago

Elder Air Elemental for example fails CMB

Savage Plant Sage fails CMB and concentration

Concentration failure seems to be due to "Conc." string.

CMB failure seems more strange, as testing suggests the source line is altered somewhere for some reason.

For example, input of: Base Atk +3; CMB +7; CMD 18 becomes Base Atk +3; CM +7; CMD 18 when it is actually trying to parse CMB, thus never being found.

mkahvi commented 2 years ago

CMB issue is caused by this line:

.replace(/(APG\b|ACG\b|UE\b|UM\b|HA\b|OA\b|ISWG\b|B\b)/gm, "")

Lavaeolous commented 2 years ago

Yeah thats filtering Sourcematerial thats sometimes written in superscript in spells, feats and stuff.

mkahvi commented 2 years ago

Simple fix for CMB was this:

.replace(/(APG\b|ACG\b|UE\b|UM\b|HA\b|OA\b|ISWG\b|[^M]B\b)/gm, "")

Lavaeolous commented 2 years ago

Yeah, that should work and leaves only the edge cases of edge cases, where spells/feats are written in caps, end in an M and have B as source :)

But thats totally fine from my side, we can't catch every case of weird formatting.