UNPKG

@randsum/root-rpg

Version:

A flexible, type-safe dice roller for the Root RPG system

4 lines (2 loc) 539 B
import{roll as r}from"@randsum/roller";function e(t){switch(!0){case t>=10:return"Strong Hit";case(t>=7&&t<=9):return"Weak Hit";default:return"Miss"}}function l(t){if(!Number.isFinite(t))throw new Error(`Root RPG bonus must be a finite number, received: ${t}`);if(t<-20||t>20)throw new Error(`Root RPG bonus is outside reasonable range (-20 to +20), received: ${t}`);let o=r({quantity:2,sides:6,modifiers:{plus:t}});return{...o,result:{hit:e(o.total),total:o.total}}}export{l as rollRootRpg}; //# debugId=56C0FCA76DC630BD64756E2164756E21