javalent / fantasy-statblocks

Create Dungeons and Dragons style statblocks for Obsidian.md
MIT License
339 stars 69 forks source link

🧩 kh option in statblock #386

Closed Sponchiatto closed 2 months ago

Sponchiatto commented 2 months ago

Scope

I tried to insert in my statblock custom monster, the following formula (19 (3d20kh +10)) to keep the highiest value, like its made in dice roller plugin. But it didn't work. I tought about this because of different systems that use more than 1d20, like Tormenta or Ordem Paranormal.

Discovery

Maybe add a way to includes this conditions, making the plugin more customizable to diferent systems

Validate

I tested in obsidian And I tought about the Dice Parsing / Regular Expression, but I don't know if it works that way. I know that i can look in the formula results and make the count by head, but I tought it's worth asking :) Thanks in advance

valentine195 commented 2 months ago

Yeah, the default dice parsers won't support this. You could probably update this one to include it:

/(\d+)\s\((\d+d\d+(?:\s*[+\-]\s*\d+)?)\)/

becomes

/(\d+)\s\((\d+d\d+(?:kh)?(?:\s*[+\-]\s*\d+)?)\)/