diff --git a/src/module/data/miracle/liturgyData.mjs b/src/module/data/miracle/liturgyData.mjs index af08145d..399ecbc2 100644 --- a/src/module/data/miracle/liturgyData.mjs +++ b/src/module/data/miracle/liturgyData.mjs @@ -165,7 +165,6 @@ export class LiturgyData { if (found) { durationText = this.#ranks[currentDuration].duration - console.log({currentDuration, durationText, adjustedDurationText}) return {currentDuration, durationText, adjustedDurationText} } diff --git a/src/module/dialog/spellDialog.mjs b/src/module/dialog/spellDialog.mjs index a5a9563b..1dfb74b4 100644 --- a/src/module/dialog/spellDialog.mjs +++ b/src/module/dialog/spellDialog.mjs @@ -96,10 +96,9 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) { static async #onSubmitForm(event, form, formData) { event.preventDefault() - console.log(formData.object) // handle changes in variable Inputs this._selectedRepresentation = formData.object.representation ?? this._selectedRepresentation - this._variants = foundry.utils.expandObject(formData.object)["variants"] ?? {} + this._variants = foundry.utils.expandObject(formData.object)["variants"] ?? this._variants if (this._spell.system.probe.includes("*")) { // ATTRIBUTO if (this._variants["Mut"]) { this._spellDie = "MU" @@ -121,15 +120,8 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) { this._spellDie = null } } - if (this._selectedRepresentation) { - this._costModel = this._spell.system.kosten.find(c => c.repräsentation === context.selectedRepresentation) ?? this._spell.system.kosten.find(c => c.repräsentation === "") - this._castTimeModel = this._spell.system.zauberdauer - this._castTimeMutators = {} - this._costMutators = {} - this._costModel.variables.forEach(v => this._costMutators[v] = 0) - this._castTimeModel.variables.forEach(v => this._castTimeMutators[v] = 0) - } - let costMutators = foundry.utils.expandObject(formData.object)["costMutators"] + + let costMutators = foundry.utils.expandObject(formData.object)["costMutators"] ?? this._costMutators if (costMutators) { this._costMutators = costMutators @@ -137,9 +129,9 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) { this.cost = this.normalizeCastingCost() - let castTimeMutators = foundry.utils.expandObject(formData.object)["castTimeMutators"] + let castTimeMutators = foundry.utils.expandObject(formData.object)["castTimeMutators"] ?? this._castTimeMutators - this._castTimeMutators = castTimeMutators ?? {} + this._castTimeMutators = castTimeMutators this.mod = 0 @@ -196,6 +188,62 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) { } static async #cast(event, target) { + ChatMessage.create({ + user: game.user._id, + speaker: {actor: this._actor}, + content: `beginnt ${this._spell.name} zu wirken`, + type: CONST.CHAT_MESSAGE_TYPES.IC + }) + const cooldowns = this._actor.system.cooldowns + let m = (queue, data) => { + + + ChatMessage.create({ + user: game.user._id, + speaker: {actor: this._actor}, + content: data.message, + type: CONST.CHAT_MESSAGE_TYPES.IC + }) + } + + let message = this._spell.system.wirkung + if (this._activeVariants.length > 0) { + message += "
" + message += this._activeVariants.map(v => v.name).join(", ") + } + if (Object.keys(this._spoMods).length > 0) { + message += "
" + Object.entries(this._spoMods).forEach(([modName, times]) => { + if (times > 0) { + message += times + "x" + modName + "
" + } + }) + } + + if (Object.keys({...this._castTimeMutators, ...this._costMutators}).length > 0) { + message += "
" + Object.entries({...this._castTimeMutators, ...this._costMutators}).forEach(([mutatorName, mutatorValue]) => { + message += mutatorName + ": " + mutatorValue + "
" + }) + } + + + cooldowns.push({ + start: this.castingTime, + current: 0, + data: { + cssClass: "Magisch", + title: this._spell.name, + taw: this.zfp, + mod: 0, + actorId: this._actor._id, + spellId: this._spell._id, + message, + maneuver: m.toString() + } + + }) + await this._actor.update({"system.cooldowns": cooldowns}) } @@ -208,12 +256,12 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) { } ) if (result.tap >= 0) { // erfolg - result.evaluated.toMessage({ + await result.evaluated.toMessage({ speaker: ChatMessage.getSpeaker({actor: this._actor}), flavor: ` ${result.meisterlich ? 'Meisterlich geschafft' : 'Geschafft'} mit ${result.tap} Punkten übrig`, }) } else { // misserfolg - result.evaluated.toMessage({ + await result.evaluated.toMessage({ speaker: ChatMessage.getSpeaker({actor: this._actor}), flavor: ` ${result.meisterlich ? 'Gepatzt' : ''} mit ${Math.abs(result.tap)} Punkten daneben`, }) @@ -279,7 +327,6 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) { let formula = spell.system.zauberdauer.additionalFormula if (formula) { Object.entries(additionalFormulaData).forEach(([variableName, variableValue]) => { - console.log(variableName, variableValue) formula = formula.replaceAll(variableName, variableValue) }) diff --git a/src/module/setup/config.mjs b/src/module/setup/config.mjs index b603f42e..a69c1f3f 100644 --- a/src/module/setup/config.mjs +++ b/src/module/setup/config.mjs @@ -77,7 +77,6 @@ function initSocketLib() { Hooks.on("socketlib.ready", () => { - console.log("Socketlib is registering") let socket = socketlib.registerSystem("DSA_4-1") socket.register("removeFromLootTable", removeFromLootTable) socket.register("buyFromLootTable", buyFromLootTable) diff --git a/src/module/sheets/actions/action-manager.mjs b/src/module/sheets/actions/action-manager.mjs index c48e0765..7b7bf49e 100644 --- a/src/module/sheets/actions/action-manager.mjs +++ b/src/module/sheets/actions/action-manager.mjs @@ -127,7 +127,6 @@ export class ActionManager { source: ActionManager.SF, cooldown: (options) => options.mod - 2, activate: (queue, data) => { - console.log(queue, data) data.actor.rollAttack(data) return true }, diff --git a/src/module/sheets/character-standalone/liturgies.mjs b/src/module/sheets/character-standalone/liturgies.mjs index e88459df..34efe32d 100644 --- a/src/module/sheets/character-standalone/liturgies.mjs +++ b/src/module/sheets/character-standalone/liturgies.mjs @@ -104,7 +104,6 @@ export class StandaloneLiturgies extends HandlebarsApplicationMixin(ActorSheetV2 // sort by rank const rankData = LiturgyData.getRankOfLiturgy(item.system, deity) if (rankData) { - console.log(rankData) let {index, name, lkp, mod, costKaP} = rankData; insertObject["count" + name] = insertObject["count" + name] + 1; diff --git a/src/module/sheets/character/equipment.mjs b/src/module/sheets/character/equipment.mjs index d32c63b4..9b851d5e 100644 --- a/src/module/sheets/character/equipment.mjs +++ b/src/module/sheets/character/equipment.mjs @@ -158,7 +158,6 @@ export default { initial: thisObject.actor.system.setEquipped ? "pane" + (thisObject.actor.system.setEquipped + 1) : "pane1", group: "set-tabs", callback: (event, tab, tabName) => { - console.log(event, tab, tabName) thisObject.selectedTab = tabName thisObject.element.querySelectorAll(tab._contentSelector).forEach( (tab) => { diff --git a/src/module/sheets/character/liturgies.mjs b/src/module/sheets/character/liturgies.mjs index ac5022c8..49fae613 100644 --- a/src/module/sheets/character/liturgies.mjs +++ b/src/module/sheets/character/liturgies.mjs @@ -57,7 +57,6 @@ export default { // sort by rank const rankData = LiturgyData.getRankOfLiturgy(item.system, deity) if (rankData) { - console.log(rankData) let {index, name, lkp, mod, costKaP} = rankData; insertObject["count" + name] = insertObject["count" + name] + 1; diff --git a/src/module/sheets/characterSheet.mjs b/src/module/sheets/characterSheet.mjs index 59b8c385..cc9b2a7f 100644 --- a/src/module/sheets/characterSheet.mjs +++ b/src/module/sheets/characterSheet.mjs @@ -189,7 +189,6 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { if (cooldown && cooldown.current >= cooldown.start) { const am = new ActionManager(this.document) - console.log(cooldown.data.maneuver) const action = new Function(`return ${cooldown.data.maneuver}`) if (action) { @@ -245,13 +244,11 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { static openSpellDialog(event, target) { const {itemId} = target.dataset - console.log(itemId) this.document.itemTypes["Spell"]?.find(p => p.id === itemId)?.sheet.render(true) } static castSpell(event, target) { const {itemId} = target.dataset - console.log(itemId) new SpellDialog(this.document, itemId).render(true) }