mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[Feature] Beastform Compendium (#434)
* Various fixes * Added fixes to make beastforms work * . * Added all SRD beastforms
This commit is contained in:
parent
0fe6c4066a
commit
187a0dc090
80 changed files with 6189 additions and 89 deletions
|
|
@ -35,7 +35,13 @@ export default class FormulaField extends foundry.data.fields.StringField {
|
|||
|
||||
/** @inheritDoc */
|
||||
_validateType(value) {
|
||||
const roll = new Roll(value.replace(/@([a-z.0-9_-]+)/gi, '1'));
|
||||
/* A bit suss, but seems to work */
|
||||
let roll = null;
|
||||
try {
|
||||
roll = new Roll(value.replace(/@([a-z.0-9_-]+)/gi, '1'));
|
||||
} catch (_) {
|
||||
roll = new Roll(value.replace(/@([a-z.0-9_-]+)/gi, 'd6'));
|
||||
}
|
||||
roll.evaluateSync({ strict: false });
|
||||
if (this.options.deterministic && !roll.isDeterministic)
|
||||
throw new Error(`must not contain dice terms: ${value}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue