Compare commits
4 Commits
b459c96961
...
013967e066
| Author | SHA1 | Date |
|---|---|---|
|
|
013967e066 | |
|
|
4b915d2e47 | |
|
|
029f6dd325 | |
|
|
efb9a415e4 |
|
|
@ -24,6 +24,7 @@ import {StandaloneLiturgies} from "./character-standalone/liturgies.mjs";
|
|||
import {StandaloneHealth} from "./character-standalone/health.mjs";
|
||||
import {SpellDialog} from "../dialog/spellDialog.mjs";
|
||||
import {displayRoll} from "../globals/displayRoll.js";
|
||||
import {evaluateRoll} from "../globals/DSARoll.mjs";
|
||||
|
||||
const {HandlebarsApplicationMixin, DocumentSheetV2} = foundry.applications.api
|
||||
const {ActorSheetV2} = foundry.applications.sheets
|
||||
|
|
@ -73,7 +74,8 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
openStandaloneLiturgies: CharacterSheet.#openStandaloneLiturgies,
|
||||
openStandaloneHealth: CharacterSheet.#openStandaloneHealth,
|
||||
setWounds: CharacterSheet.#setWounds,
|
||||
switchSet: CharacterSheet.#switchSet
|
||||
switchSet: CharacterSheet.#switchSet,
|
||||
openInitiative: CharacterSheet.#openInitiative,
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -157,6 +159,18 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
new AttributeDialog(this.document, target.dataset.itemId).render(true)
|
||||
}
|
||||
|
||||
// TODO: add combat statistics and dialog
|
||||
static async #openInitiative(event, target) {
|
||||
const {formula} = target.dataset
|
||||
const evaluated = await new Roll(formula.replace("w", "d")).evaluate()
|
||||
const context = {
|
||||
formula,
|
||||
initiativeRolled: evaluated.terms[0].results[0].result,
|
||||
total: evaluated.total
|
||||
}
|
||||
await displayRoll(evaluated, game.user, this.document, false, false, 'systems/DSA_4-1/templates/chat/initiative-message.hbs', context)
|
||||
}
|
||||
|
||||
static async #progressCooldown(event, target) {
|
||||
const {cooldownId} = target.dataset
|
||||
const cooldowns = this.document.system.cooldowns
|
||||
|
|
@ -356,6 +370,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
event.preventDefault()
|
||||
|
||||
await this.document.update(formData.object)
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
@ -719,6 +734,8 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
Liturgies._onRender(context, options, this.element)
|
||||
Skills._onRender(context, options, this.element)
|
||||
Spells._onRender(context, options, this.element)
|
||||
|
||||
this._onPosition(this.position)
|
||||
}
|
||||
|
||||
async _canDragDrop() {
|
||||
|
|
|
|||
|
|
@ -97,10 +97,17 @@ $rollable_colours_font: (
|
|||
top: 0;
|
||||
height: 32px;
|
||||
padding-left: 24px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
|
||||
span.name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
text-wrap: nowrap;
|
||||
line-height: 32px;
|
||||
vertical-align: middle;
|
||||
word-break: break-all;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,13 +45,13 @@
|
|||
|
||||
{{#if this.hasLiturgies}}
|
||||
<div class="sidebar-element resource-bar">
|
||||
<label>KaP: {{this.ke}}</label><span class="resource-fill kap" style="width: {{this.keper}}%"></span>
|
||||
<label>KaP: {{this.kapcurrent}}</label><span class="resource-fill kap" style="width: {{this.keper}}%"></span>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if this.hasSpells}}
|
||||
<div class="sidebar-element resource-bar">
|
||||
<label>AsP: {{this.asp}}</label><span class="resource-fill asp" style="width: {{this.aspper}}%"></span>
|
||||
<label>AsP: {{this.aspcurrent}}</label><span class="resource-fill asp" style="width: {{this.aspper}}%"></span>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
|
|
@ -91,7 +91,8 @@
|
|||
{{/if}}
|
||||
{{#if this.ini}}
|
||||
<div data-tooltip="{{localize "WEAPON.initiative" weapon=this.name}}"
|
||||
class="ini sidebar-element rollable" data-action="openInitiative"><label>INI</label>
|
||||
class="ini sidebar-element rollable" data-action="openInitiative" data-formula="{{this.ini}}">
|
||||
<label>INI</label>
|
||||
<div class="formula">{{this.ini}}</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
<div>
|
||||
<div>Formel: {{formula}}</div>
|
||||
<div>Gewürfelt: {{initiativeRolled}}</div>
|
||||
<hr/>
|
||||
<div>Initiative: {{total}}</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue