jbhaywood / 5e-statblock-importer

A module for FoundryVTT that creates a new actor from any 5e monster or NPC statblock.
MIT License
18 stars 14 forks source link

Doesn't like use of "feet" instead of "ft." in atacks #56

Closed RebelMage closed 1 year ago

RebelMage commented 1 year ago

I was testing out trying to import a statblock from Nightfell. Most of it worked correctly (expect a feature which didn't end with a period being merged with the feature after it, but that's an easy thing to fix while importing and isn't important), but I ran into an issue with the attack, which doesn't automatically parse the rolls. I compared it with the example, which did import correctly, and noticed the difference is that it has "feet" instead of "ft." in the description:

Slam. Melee Weapon Attack: +3 to hit, reach 5 feet, one target. Hit: 4 (1d6+1) bludgeoning damage. On a hit, target creature must make a DC 12 Wisdom Saving throw. On a failed save it loses 1 (1d2) Soul Points.

After changing "feet" to "ft." it did import correctly. However, perhaps this is an issue that could be easily fixed?

(Did some mild digging around in the code, and it seems to be as simple as adding "feet|" to the regex for reach or range. I'm not sure which; I edited it in both just to make certain, and then it worked, and using ft. also still worked.)

jbhaywood commented 1 year ago

That’s sounds like the right fix. Do you want to do a pull request with your change? If you’re not set up to do that I can do it when I get a chance.

RebelMage commented 1 year ago

I can't currently do that, and I'm not in any rush, so take your time!

RebelMage commented 1 year ago

Okay, ended up making a pull request, with a suggestion from a friend who likes regex. :P

jbhaywood commented 1 year ago

Fixed in version 1.69. Thanks for the pull request.