ENH: Initiative mod for monsters

master
U~man 2020-07-04 19:51:29 +02:00
parent 2c62d33c82
commit 7f333082fd
4 changed files with 33 additions and 18 deletions

View File

@ -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
/* -------------------------------------------- */

View File

@ -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,
};

View File

@ -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
},

View File

@ -23,6 +23,18 @@
/>
</div>
</div>
<div class="form-group">
<label>{{localize "OSE.InitiativeBonus"}}</label>
<div class="form-fields">
<input
type="text"
name="data.initiative.mod"
id="initiative"
value="{{data.initiative.mod}}"
data-dtype="Number"
/>
</div>
</div>
{{#if (eq this.type 'character')}}
<div class="form-group">
<label>{{localize "OSE.ExperienceBonus"}} (%)</label>
@ -59,18 +71,6 @@
/>
</div>
</div>
<div class="form-group">
<label>{{localize "OSE.InitiativeBonus"}}</label>
<div class="form-fields">
<input
type="text"
name="data.initiative.mod"
id="initiative"
value="{{data.initiative.mod}}"
data-dtype="Number"
/>
</div>
</div>
<div class="form-group">
<label>{{localize "OSE.Encumbrance"}}</label>
<div class="form-fields">