diff --git a/src/module/actor/entity.js b/src/module/actor/entity.js index 816c223..3381c08 100644 --- a/src/module/actor/entity.js +++ b/src/module/actor/entity.js @@ -5,6 +5,21 @@ export class OseActor extends Actor { * Extends data from base Actor class */ + prepareData() { + super.prepareData(); + const data = this.data.data; + + // Determine Initiative + if (game.settings.get('ose', 'individualInit')) { + data.initiative.value = data.initiative.mod ; + if (this.data.type == 'character') { + const mods = this.computeModifiers(); + data.initiative.value += mods.dex; + } + } else { + data.initiative.value = 0; + } + } /* -------------------------------------------- */ /* Socket Listeners and Handlers /* -------------------------------------------- */ diff --git a/src/ose.js b/src/ose.js index 7011227..be24242 100644 --- a/src/ose.js +++ b/src/ose.js @@ -19,7 +19,7 @@ Hooks.once("init", async function () { * @type {String} */ CONFIG.Combat.initiative = { - formula: "1d6 + @initiative.value + @initiative.mod", + formula: "1d6 + @initiative.value", decimals: 2, }; diff --git a/src/template.json b/src/template.json index 01e4953..706d0b3 100644 --- a/src/template.json +++ b/src/template.json @@ -37,7 +37,11 @@ }, "movement": { "base": 120 - } + }, + "initative": { + "value": 0, + "mod": 0 + } }, "spellcaster": { "spells": { @@ -116,10 +120,6 @@ "mod": 0 } }, - "initative": { - "value": 0, - "mod": 0 - }, "encumbrance": { "max": 1600 }, diff --git a/src/templates/actors/dialogs/tweaks-dialog.html b/src/templates/actors/dialogs/tweaks-dialog.html index 036f5ca..c6b0cce 100644 --- a/src/templates/actors/dialogs/tweaks-dialog.html +++ b/src/templates/actors/dialogs/tweaks-dialog.html @@ -23,6 +23,18 @@ /> +
+ +
+ +
+
{{#if (eq this.type 'character')}}
@@ -59,18 +71,6 @@ />
-
- -
- -
-