adds combat initiative
Pull Request Check / testing (pull_request) Successful in 18s
Details
Pull Request Check / testing (pull_request) Successful in 18s
Details
parent
cc460eb06c
commit
adff5b951f
|
|
@ -49,7 +49,7 @@ Hooks.once("init", () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG.Combat.initiative = {
|
CONFIG.Combat.initiative = {
|
||||||
formula: `1d6 + @attribute.ini`,
|
formula: `(@attribute.ini.wuerfel)d6 + @attribute.ini.aktuell`,
|
||||||
decimals: 0
|
decimals: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,8 +95,9 @@ export class PlayerCharacterDataModel extends foundry.abstract.TypeDataModel {
|
||||||
mod: new NumberField({ required: true, integer: true }),
|
mod: new NumberField({ required: true, integer: true }),
|
||||||
}),
|
}),
|
||||||
ini: new SchemaField({
|
ini: new SchemaField({
|
||||||
aktuell: new NumberField({ required: true, integer: true }),
|
aktuell: new NumberField({ required: true, integer: true, initial: 0 }),
|
||||||
mod: new NumberField({ required: true, integer: true }),
|
mod: new NumberField({ required: true, integer: true, initial: 0 }),
|
||||||
|
wuerfel: new NumberField({ required: true, integer: true, initial: 1}),
|
||||||
}),
|
}),
|
||||||
so: new SchemaField({
|
so: new SchemaField({
|
||||||
start: new NumberField({ required: true, integer: true }),
|
start: new NumberField({ required: true, integer: true }),
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ export class CharacterSheet extends ActorSheet {
|
||||||
this.#addAdvantagesToContext(context)
|
this.#addAdvantagesToContext(context)
|
||||||
this.#addAttributesToContext(context)
|
this.#addAttributesToContext(context)
|
||||||
this.#addEquipmentsToContext(context)
|
this.#addEquipmentsToContext(context)
|
||||||
|
this.#addCombatStatistics(context)
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
@ -170,6 +171,15 @@ export class CharacterSheet extends ActorSheet {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#addCombatStatistics(context) {
|
||||||
|
const actorData = context.data;
|
||||||
|
context.inidice = actorData.system.attribute.ini.wuerfel;
|
||||||
|
context.inivalue = actorData.system.attribute.ini.aktuell;
|
||||||
|
context.inimod = actorData.system.attribute.ini.mod;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#addEquipmentsToContext(context) {
|
#addEquipmentsToContext(context) {
|
||||||
context.equipments = [];
|
context.equipments = [];
|
||||||
const actorData = context.data;
|
const actorData = context.data;
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,35 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.tab.combat {
|
||||||
|
|
||||||
|
.initiaitve {
|
||||||
|
width: 100%;
|
||||||
|
height: 48px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
label {
|
||||||
|
width: 80px;
|
||||||
|
line-height: 48px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
display: inline-block;
|
||||||
|
width: 40px;
|
||||||
|
height: 48px;
|
||||||
|
}
|
||||||
|
span.inline {
|
||||||
|
line-height: 48px;
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 40px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,13 @@
|
||||||
|
|
||||||
<div class="tab combat" data-group="primary" data-tab="combat">
|
<div class="tab combat" data-group="primary" data-tab="combat">
|
||||||
|
|
||||||
|
<div class="initiaitve">
|
||||||
|
<label>Initiative:</label>
|
||||||
|
<input type="number" name="system.attribute.ini.wuerfel" value="{{this.inidice}}"/>
|
||||||
|
<span class="inline">w6</span>
|
||||||
|
<input type="number" name="system.attribute.ini.aktuell" value="{{this.inivalue}}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="tab skills" data-group="primary" data-tab="skills">
|
<div class="tab skills" data-group="primary" data-tab="skills">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue