mouse0270 / Beyonds-Toolbox

MIT License
21 stars 6 forks source link

Homebrew Monsters Attacks #1

Open mouse0270 opened 6 years ago

mouse0270 commented 6 years ago

Homebrew Monsters Attacks do not always get properly detected. Take for example the Goblin Archer This creature has the following attacks

Scimitar. Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) slashing damage. Shortbow. Ranged Weapon Attack: +4 to hit, range 80/320 ft., one target. Hit: 5 (1d6 + 2) piercing damage.

However, the script only picks up the Scimitar attack and rolls for both the Scimitar and Shortbow damage when you click on it.

This is because of how my script loops through all of the children under the actions of a monsters stat block. However, since Homebrew monsters are not subject to the same formatting as official monsters, these attacks are not separated they are right next to each other. My script is unable to determine when one attack ends and the next starts.

Currently, I do not know how to work around this type of issue. If I figure out how I will update this issue.

mouse0270 commented 6 years ago

Through some ghetto code, I have been able to provide better support to homebrewed monsters. Basically, I parse out the code and replace break lines with an ending and closing paragraph tag. This way my script can more easily identify different attacks.

In short, if people would freaking hit enter instead of shift+enter this code wouldn't even be needed, but if you let people enter stuff, they're going to screw it up.

This is still considered not supported and as is. This is because I am sure people will screw up the formatting in new and creative ways. I am not going to code for every outcome, instead, I am going to do my best to support as much as possible and have the creators of the homebrew content police their own formatting otherwise it simply won't work.