parent
89848aa849
commit
f8d101bfe3
|
|
@ -1,5 +1,6 @@
|
|||
import {LiturgyData} from "../data/miracle/liturgyData.mjs";
|
||||
import {Talent} from "../data/talent.mjs";
|
||||
import {evaluateRoll} from "../globals/DSARoll.mjs";
|
||||
|
||||
const {
|
||||
ApplicationV2,
|
||||
|
|
@ -137,14 +138,15 @@ export class LiturgyDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
|
||||
const castingTime = this.#normalizeCastingTime(this._liturgy)
|
||||
|
||||
//TODO push it into the sun eeerh cooldown queue
|
||||
if (castingTime > 0) {
|
||||
const cooldowns = this._actor.system.cooldowns
|
||||
let m = (queue, data) => {
|
||||
|
||||
new game.DSA41.Talent({
|
||||
name: data.title,
|
||||
taw: data.taw,
|
||||
mod: data.mod,
|
||||
owner: data.actor,
|
||||
eigenschaften: {
|
||||
mu: data.eigenschaften.mu,
|
||||
in: data.eigenschaften.in,
|
||||
|
|
@ -154,11 +156,33 @@ export class LiturgyDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
eigenschaft2: "in",
|
||||
eigenschaft3: "ch"
|
||||
}).evaluate("publicroll").then(result => {
|
||||
const context = {
|
||||
liturgy: data.title,
|
||||
lkw: data.taw,
|
||||
mod: data.mod,
|
||||
owner: data.actor,
|
||||
lkp: result.tap,
|
||||
meisterlich: result.meisterlich,
|
||||
patzer: result.patzer
|
||||
}
|
||||
|
||||
if(result.tap>0) {
|
||||
context.remaining = Math.abs(result.tap)
|
||||
} else if (result.tap===0) {
|
||||
context.remaining = 1
|
||||
} else {
|
||||
context.missing = Math.abs(result.tap)
|
||||
}
|
||||
game.DSA41.displayRoll(
|
||||
result.evaluated,
|
||||
game.user,
|
||||
data.actor,
|
||||
false,
|
||||
false,
|
||||
'systems/DSA_4-1/templates/chat/liturgy-chat-message.hbs',
|
||||
context
|
||||
)
|
||||
|
||||
result.evaluatedRoll.toMessage({
|
||||
speaker: ChatMessage.getSpeaker({actor: game.actors.get(data.actorId)}),
|
||||
flavor: `Liturgie: ${data.title}<br/>LkP*: ${result.tap}<br/>${result.meisterlich ? "Meisterlich" : ""}${result.patzer ? "Petzer" : ""}<br/>${data.variant}`,
|
||||
})
|
||||
})
|
||||
}
|
||||
cooldowns.push({
|
||||
|
|
@ -169,6 +193,7 @@ export class LiturgyDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
title: this._liturgy.name,
|
||||
taw: lkp,
|
||||
mod: mod,
|
||||
owner: this._actor._id,
|
||||
actorId: this._actor._id,
|
||||
variant: this._variation.effect,
|
||||
eigenschaften: {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
import {ATTRIBUTE} from "../data/attribute.mjs";
|
||||
import {spoModData, leadingAttribute} from "../data/spellData/spellData.mjs";
|
||||
import {evaluateRoll} from "../globals/DSARoll.mjs";
|
||||
import {displayRoll} from "../globals/displayRoll.js";
|
||||
|
||||
const {
|
||||
ApplicationV2,
|
||||
|
|
@ -53,6 +54,7 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
_costModel = {}
|
||||
_castTimeModel = {}
|
||||
_spoMods = {}
|
||||
_spell = null
|
||||
displayModResult = 0
|
||||
|
||||
constructor(actor, spellId) {
|
||||
|
|
@ -257,6 +259,53 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
owner: this._actor
|
||||
}
|
||||
)
|
||||
|
||||
const taw = this._spell.system.zfw
|
||||
|
||||
let spellDie3 = this._spell.system.probe[2]
|
||||
|
||||
if (spellDie3 === "*") {
|
||||
spellDie3 = this._spellDie
|
||||
}
|
||||
|
||||
const context = {
|
||||
spell: this._spell,
|
||||
zfp: result.tap,
|
||||
|
||||
ergebnis: [
|
||||
{
|
||||
eigenschaft: this._spell.system.probe[0],
|
||||
eigenschaftWert: this._actor.system.attribute[this._spell.system.probe[0].toLowerCase()].aktuell,
|
||||
wuerfelErgebnis: result.evaluated.terms[0].results[0].result,
|
||||
|
||||
},
|
||||
{
|
||||
eigenschaft: this._spell.system.probe[1],
|
||||
eigenschaftWert: this._actor.system.attribute[this._spell.system.probe[1].toLowerCase()].aktuell,
|
||||
wuerfelErgebnis: result.evaluated.terms[0].results[1].result,
|
||||
|
||||
},
|
||||
{
|
||||
eigenschaft: this._spell.system.probe[2],
|
||||
eigenschaftWert: this._actor.system.attribute[spellDie3.toLowerCase()].aktuell,
|
||||
wuerfelErgebnis: result.evaluated.terms[0].results[2].result,
|
||||
}
|
||||
],
|
||||
patzer: result.patzer,
|
||||
meisterlich: result.meisterlich,
|
||||
}
|
||||
|
||||
|
||||
if(result.tap>0) {
|
||||
context.remaining = Math.abs(result.tap)
|
||||
} else if (result.tap===0) {
|
||||
context.remaining = 1
|
||||
} else {
|
||||
context.missing = Math.abs(result.tap)
|
||||
}
|
||||
|
||||
displayRoll(result.evaluated, game.user, this._actor, true, true, 'systems/DSA_4-1/templates/chat/spell-chat-message.hbs', context)
|
||||
/*
|
||||
if (result.tap >= 0) { // erfolg
|
||||
await result.evaluated.toMessage({
|
||||
speaker: ChatMessage.getSpeaker({actor: this._actor}),
|
||||
|
|
@ -267,7 +316,7 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
speaker: ChatMessage.getSpeaker({actor: this._actor}),
|
||||
flavor: ` ${result.meisterlich ? 'Gepatzt' : ''} mit ${Math.abs(result.tap)} Punkten daneben`,
|
||||
})
|
||||
}
|
||||
}*/
|
||||
this.zfp = result.tap
|
||||
|
||||
this.zfpDetermined = true
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ import {Character} from "../documents/character.mjs";
|
|||
import {currency} from "../handlebar-helpers/currency.mjs";
|
||||
import {DeityDataModel} from "../data/deity.mjs";
|
||||
import {ItemBrowserDialog} from "../dialog/itemBrowserDialog.mjs";
|
||||
import {displayRoll} from "../globals/displayRoll.js";
|
||||
import {evaluateRoll} from "../globals/DSARoll.mjs";
|
||||
|
||||
function initGlobalAccess() {
|
||||
|
||||
|
|
@ -33,7 +35,9 @@ function initGlobalAccess() {
|
|||
BattleDialog,
|
||||
ItemBrowserDialog,
|
||||
Talent,
|
||||
displayCurrency: currency
|
||||
displayCurrency: currency,
|
||||
displayRoll,
|
||||
evaluateRoll
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import {StandaloneSpells} from "./character-standalone/spells.mjs";
|
|||
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";
|
||||
|
||||
const {HandlebarsApplicationMixin, DocumentSheetV2} = foundry.applications.api
|
||||
const {ActorSheetV2} = foundry.applications.sheets
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
|
||||
<div>
|
||||
<div>{{liturgy}} (LkP*: {{lkp}})</div>
|
||||
<div>Modifiziert: {{mod}}</div>
|
||||
<div>Gewürfelt:</div>
|
||||
<hr>
|
||||
{{#if missing}}
|
||||
<div>Gefehlt: {{missing}}</div>
|
||||
{{else}}
|
||||
<div>Übrig: {{remaining}}</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
|
||||
<div>
|
||||
<div>{{spell.name}} (ZfP*: {{zfp}})</div>
|
||||
<div>Modifiziert: {{mod}}</div>
|
||||
<div>Gewürfelt:</div>
|
||||
<section class="die">
|
||||
{{#each ergebnis}}
|
||||
<div>
|
||||
<span class="provided {{#if reduced}}modified{{/if}}">{{eigenschaft}} ({{eigenschaftWert}})</span>
|
||||
<span class="value">{{wuerfelErgebnis}}</span>
|
||||
</div>
|
||||
{{/each}}
|
||||
</section>
|
||||
<hr>
|
||||
{{#if missing}}
|
||||
<div>Gefehlt: {{missing}}</div>
|
||||
{{else}}
|
||||
<div>Übrig: {{remaining}}</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
Loading…
Reference in New Issue