Compare commits

..

2 Commits

Author SHA1 Message Date
uberwald 709e69fac8 Fix progression roll
Release Creation / build (release) Successful in 1m33s
2026-04-29 09:34:16 +02:00
uberwald e26db56585 Fix for v14
Release Creation / build (release) Successful in 48s
2026-04-28 07:52:18 +02:00
47 changed files with 148 additions and 121 deletions
+1
View File
@@ -0,0 +1 @@
packs/** filter=lfs diff=lfs merge=lfs -text
+2
View File
@@ -5,4 +5,6 @@ styles/*.css
# Node Modules # Node Modules
node_modules/ node_modules/
.github/
.history/
+5
View File
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"CTHULHUETERNAL"
]
}
+20
View File
@@ -677,6 +677,12 @@ i.fvtt-cthulhu-eternal {
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 4px; gap: 4px;
} }
.fvtt-cthulhu-eternal .empty-state {
color: var(--color-text-light-6);
font-style: italic;
padding: 0.5rem 0.25rem;
grid-column: 1 / -1;
}
.fvtt-cthulhu-eternal .tab.protagonist-skills .main-div .skills .skill { .fvtt-cthulhu-eternal .tab.protagonist-skills .main-div .skills .skill {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -918,6 +924,20 @@ i.fvtt-cthulhu-eternal {
min-width: 1.8rem; min-width: 1.8rem;
max-width: 1.8rem; max-width: 1.8rem;
} }
.fvtt-cthulhu-eternal .tab.protagonist-equipment .main-div .armors .armor .equipped-toggle {
font-size: 1rem;
min-width: 1.4rem;
max-width: 1.4rem;
cursor: pointer;
color: #888;
text-align: center;
}
.fvtt-cthulhu-eternal .tab.protagonist-equipment .main-div .armors .armor .equipped-toggle.active {
color: #4caf50;
}
.fvtt-cthulhu-eternal .tab.protagonist-equipment .main-div .armors .armor .equipped-toggle:hover {
color: #2196f3;
}
.fvtt-cthulhu-eternal .tab.protagonist-equipment .main-div .armors .armor .protection { .fvtt-cthulhu-eternal .tab.protagonist-equipment .main-div .armors .armor .protection {
min-width: 5rem; min-width: 5rem;
max-width: 5rem; max-width: 5rem;
+8
View File
@@ -734,6 +734,8 @@
"newMentalDisorder": "New Mental Disorder", "newMentalDisorder": "New Mental Disorder",
"newWeapon": "New Weapon", "newWeapon": "New Weapon",
"newArmor": "New Armor", "newArmor": "New Armor",
"equipped": "Equipped (click to unequip)",
"unequipped": "Not equipped (click to equip)",
"newInjury": "New Injury", "newInjury": "New Injury",
"newGear": "New Gear", "newGear": "New Gear",
"newArcane": "New Arcane", "newArcane": "New Arcane",
@@ -751,6 +753,12 @@
"unconscious": "Unconscious", "unconscious": "Unconscious",
"dying": "Dying", "dying": "Dying",
"unconsciousWarning": "The Protagonist is unconscious. He cannot act until he has at least 3 HP.", "unconsciousWarning": "The Protagonist is unconscious. He cannot act until he has at least 3 HP.",
"stunnedWarning": "The Protagonist is stunned. He cannot act until he succeeds at a CON × 5 test.",
"deadWarning": "The Protagonist is dying. He will die if not treated within {con} minutes.",
"noSkills": "No skills. Add skills to this character.",
"noWeapons": "No weapons. Add weapons in edit mode.",
"noArmors": "No armor. Add armor in edit mode.",
"noGears": "No gear. Add gear in edit mode.",
"luck": "Luck", "luck": "Luck",
"Other": "Other", "Other": "Other",
"Skills": "Skills", "Skills": "Skills",
+6
View File
@@ -726,6 +726,8 @@
"newMentalDisorder": "Nouveau Trouble mental", "newMentalDisorder": "Nouveau Trouble mental",
"newWeapon": "Nouvelle Arme", "newWeapon": "Nouvelle Arme",
"newArmor": "Nouvelle Armure", "newArmor": "Nouvelle Armure",
"equipped": "Équipée (cliquer pour déséquiper)",
"unequipped": "Non équipée (cliquer pour équiper)",
"newInjury": "Nouvelle Blessure", "newInjury": "Nouvelle Blessure",
"newGear": "Nouvel Equipement", "newGear": "Nouvel Equipement",
"newArcane": "Nouvel Arcane", "newArcane": "Nouvel Arcane",
@@ -745,6 +747,10 @@
"stunnedWarning": "Votre protagoniste est étourdi. Il ne peut pas agir tant qu'il n'a pas réussi un test de CON x 5.", "stunnedWarning": "Votre protagoniste est étourdi. Il ne peut pas agir tant qu'il n'a pas réussi un test de CON x 5.",
"deadWarning": "Votre protagoniste est mourrant. Il mourra s'il n'est pas soigné dans les {con} minutes", "deadWarning": "Votre protagoniste est mourrant. Il mourra s'il n'est pas soigné dans les {con} minutes",
"unconsciousWarning": "Votre protagoniste est inconscient. Il ne peut pas agir tant qu'il n'a pas atteint 3 PV.", "unconsciousWarning": "Votre protagoniste est inconscient. Il ne peut pas agir tant qu'il n'a pas atteint 3 PV.",
"noSkills": "Aucune compétence. Ajoutez des compétences à ce personnage.",
"noWeapons": "Aucune arme. Ajoutez des armes en mode édition.",
"noArmors": "Aucune armure. Ajoutez une armure en mode édition.",
"noGears": "Aucun équipement. Ajoutez de l'équipement en mode édition.",
"luck": "Chance", "luck": "Chance",
"Other": "Autre", "Other": "Autre",
"Skills": "Compétences", "Skills": "Compétences",
+11 -27
View File
@@ -1,6 +1,4 @@
// System Module Imports // System Module Imports
import { Utils } from './utils.js'
import { SYSTEM } from "../../config/system.mjs"
import CthulhuEternalUtils from '../../utils.mjs' import CthulhuEternalUtils from '../../utils.mjs'
export let ActionHandler = null export let ActionHandler = null
@@ -17,8 +15,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
* @param {array} groupIds * @param {array} groupIds
*/ */
async buildSystemActions(groupIds) { async buildSystemActions(groupIds) {
// Set actor and token variables // this.actor and this.actors are provided by the base class (TAH Core v2+)
this.actors = (!this.actor) ? this._getActors() : [this.actor]
this.actorType = this.actor?.type this.actorType = this.actor?.type
// Set items variable // Set items variable
@@ -28,9 +25,11 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
this.items = items this.items = items
} }
if (this.actor) {
if (this.actorType !== 'vehicle') { if (this.actorType !== 'vehicle') {
this.#buildCharacterActions() this.#buildCharacterActions()
} else if (!this.actor) { }
} else {
this.#buildMultipleTokenActions() this.#buildMultipleTokenActions()
} }
} }
@@ -201,7 +200,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
// Build alpha sorted skill list // Build alpha sorted skill list
let skills = this.actor.items.filter(i => i.type === 'skill') let skills = this.actor.items.filter(i => i.type === 'skill')
skills = skills.sort((a, b) => a.name.localeCompare(b.name)) skills = skills.sort((a, b) => a.name.localeCompare(b.name))
console.log('Building skills actions for skills:', skills)
for (const skill of skills) { for (const skill of skills) {
//console.log('Processing skill item:', skill) //console.log('Processing skill item:', skill)
if (skill.system.skillTotal > 0) { if (skill.system.skillTotal > 0) {
@@ -224,8 +223,8 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
async buildEquipment() { async buildEquipment() {
let era = game.settings.get("fvtt-cthulhu-eternal", "settings-era") let era = game.settings.get("fvtt-cthulhu-eternal", "settings-era")
// const rituals = [] const weapons = this.actor.items.filter(i => i.type === 'weapon')
for (const item of this.actor.items) { for (const item of weapons) {
// Push the weapon name as a new group // Push the weapon name as a new group
const groupData = { const groupData = {
id: `weapons_${item._id}`, id: `weapons_${item._id}`,
@@ -233,16 +232,14 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
type: 'system' type: 'system'
} }
this.addGroup(groupData, { id: 'weapons', type: 'system' }, true) this.addGroup(groupData, { id: 'weapons', type: 'system' }, true)
if (item.type === 'weapon') {
let skill = CthulhuEternalUtils.getWeaponSkill(this.actor, item, era) let skill = CthulhuEternalUtils.getWeaponSkill(this.actor, item, era)
item.skillTotal = skill ? skill.system.skillTotal : 0 item.skillTotal = skill ? skill.system.skillTotal : 0
let weapons = [] let weaponActions = []
const tooltip = { const tooltip = {
content: String(item.skillTotal), content: String(item.skillTotal),
direction: 'LEFT' direction: 'LEFT'
} }
console.log('Weapon skill total for', item.name, 'is', item.skillTotal, item._id) weaponActions.push({
weapons.push({
name: `${item.name} (${item.skillTotal})`, name: `${item.name} (${item.skillTotal})`,
id: `weapon_${item._id}`, id: `weapon_${item._id}`,
info1: this.#showValue() ? { text: tooltip.content } : null, info1: this.#showValue() ? { text: tooltip.content } : null,
@@ -260,7 +257,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
direction: 'LEFT' direction: 'LEFT'
} }
if (item.system.damage !== '') { if (item.system.damage !== '') {
weapons.push({ weaponActions.push({
name: `${coreModule.api.Utils.i18n('CTHULHUETERNAL.Label.Damage')} (${damage})`, name: `${coreModule.api.Utils.i18n('CTHULHUETERNAL.Label.Damage')} (${damage})`,
id: `damage_${item._id}`, id: `damage_${item._id}`,
info1: this.#showValue() ? { text: damageTooltip.content } : null, info1: this.#showValue() ? { text: damageTooltip.content } : null,
@@ -268,23 +265,10 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
tooltip: damageTooltip tooltip: damageTooltip
}) })
} }
console.log('Adding weapon actions for', item.name, weapons) await this.addActions(weaponActions, {
await this.addActions(weapons, {
id: `weapons_${item._id}`, id: `weapons_${item._id}`,
type: 'system' type: 'system'
}) })
}/* else if (item.type === 'ritual') {
rituals.push({
name: item.name,
id: item._id,
encodedValue: ['rituals', item.name].join(this.delimiter)
})
} */
/* await this.addActions(rituals, {
id: 'rituals',
type: 'system'
}) */
} }
} }
+1 -1
View File
@@ -15,7 +15,7 @@ export const CORE_MODULE = {
/** /**
* Core module version required by the system module * Core module version required by the system module
*/ */
export const REQUIRED_CORE_MODULE_VERSION = '2.0' export const REQUIRED_CORE_MODULE_VERSION = '2'
/** /**
* Action types * Action types
+9 -13
View File
@@ -1,6 +1,3 @@
import { SYSTEM } from "../../config/system.mjs"
export let RollHandler = null export let RollHandler = null
Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => { Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
@@ -66,7 +63,6 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
* @param {string} actionId The actionId * @param {string} actionId The actionId
*/ */
async #handleAction(event, actor, token, actionTypeId, actionId) { async #handleAction(event, actor, token, actionTypeId, actionId) {
console.log('Handling action', actionId, 'of type', actionTypeId, 'for actor', actor.name)
switch (actionTypeId) { switch (actionTypeId) {
case 'characteristics': case 'characteristics':
await this.#handleCharacteristicsAction(event, actor, actionId) await this.#handleCharacteristicsAction(event, actor, actionId)
@@ -100,19 +96,17 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
* @param {string} actionId The action id * @param {string} actionId The action id
*/ */
async #handleCharacteristicsAction(event, actor, actionId) { async #handleCharacteristicsAction(event, actor, actionId) {
let rollType
if (actionId === 'wp' || actionId === 'hp') return if (actionId === 'wp' || actionId === 'hp') return
if (actionId.includes('_add') || actionId.includes('_subtract')) { if (actionId.includes('_add') || actionId.includes('_subtract')) {
const attr = actionId.split('_')[0] const attr = actionId.split('_')[0]
const action = actionId.split('_')[1] const action = actionId.split('_')[1]
console.log('Updating', attr, 'with action', action)
const update = {} const update = {}
update.system = {} update.system = {}
update.system[attr] = {} update.system[attr] = {}
update.system[attr].value = action === 'add' ? this.actor.system[attr].value + 1 : this.actor.system[attr].value - 1 update.system[attr].value = action === 'add' ? actor.system[attr].value + 1 : actor.system[attr].value - 1
if (update.system[attr].value > this.actor.system[attr].max || update.system[attr].value < this.actor.system[attr].min) return if (update.system[attr].value > actor.system[attr].max || update.system[attr].value < actor.system[attr].min) return
return await this.actor.update(update) return await actor.update(update)
} }
if (actionId === 'san') { if (actionId === 'san') {
let item = foundry.utils.duplicate(actor.system.san) let item = foundry.utils.duplicate(actor.system.san)
@@ -155,7 +149,8 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
* @param {string} actionId The action id * @param {string} actionId The action id
*/ */
async #handleWeaponsAction(event, actor, actionId) { async #handleWeaponsAction(event, actor, actionId) {
let weapon = actor.items.find(i => i.type === 'weapon' && i.id === actionId) const weapon = actor.items.find(i => i.type === 'weapon' && i.id === actionId)
if (!weapon) return ui.notifications.warn(`Weapon not found for action id '${actionId}'`)
weapon.damageFormula = weapon.system.damage weapon.damageFormula = weapon.system.damage
weapon.damageBonus = actor.system.damageBonus weapon.damageBonus = actor.system.damageBonus
await actor.system.roll('weapon', weapon) await actor.system.roll('weapon', weapon)
@@ -169,7 +164,8 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
* @param {string} actionId The action id * @param {string} actionId The action id
*/ */
async #handleDamageAction(event, actor, actionId) { async #handleDamageAction(event, actor, actionId) {
let weapon = actor.items.find(i => i.type === 'weapon' && i.id === actionId) const weapon = actor.items.find(i => i.type === 'weapon' && i.id === actionId)
if (!weapon) return ui.notifications.warn(`Weapon not found for action id '${actionId}'`)
weapon.damageFormula = weapon.system.damage weapon.damageFormula = weapon.system.damage
weapon.damageBonus = actor.system.damageBonus weapon.damageBonus = actor.system.damageBonus
await actor.system.roll('damage', weapon) await actor.system.roll('damage', weapon)
@@ -183,13 +179,13 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
* @param {string} actionId The action id * @param {string} actionId The action id
*/ */
async #handleLethalityAction(event, actor, actionId) { async #handleLethalityAction(event, actor, actionId) {
const item = await this.actor.items.get(actionId) const item = actor.items.get(actionId)
if (item.system.damage !== '' && event.ctrlKey) { if (item.system.damage !== '' && event.ctrlKey) {
const isLethal = !item.system.isLethal const isLethal = !item.system.isLethal
await item.update({ 'system.isLethal': isLethal }) await item.update({ 'system.isLethal': isLethal })
} else { } else {
const options = { const options = {
actor: this.actor, actor,
rollType: 'lethality', rollType: 'lethality',
key: item.system.lethality, key: item.system.lethality,
item item
+2 -9
View File
@@ -1,7 +1,6 @@
// System Module Imports // System Module Imports
import { ActionHandler } from './action-handler.js' import { ActionHandler } from './action-handler.js'
import { RollHandler as Core } from './roll-handler.js' import { RollHandler as Core } from './roll-handler.js'
import { MODULE } from './constants.js'
import { DEFAULTS } from './defaults.js' import { DEFAULTS } from './defaults.js'
import * as systemSettings from './settings.js' import * as systemSettings from './settings.js'
@@ -79,14 +78,8 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
* @returns {object} The TAH system styles * @returns {object} The TAH system styles
*/ */
registerStyles() { registerStyles() {
return { // No system-specific styles; use the core styles only
template: { return {}
class: 'tah-style-template-style', // The class to add to first DIV element
file: 'tah-template-style', // The file without the css extension
moduleId: MODULE.ID, // The module ID
name: 'Template Style' // The name to display in the Token Action HUD Core 'Style' module setting
}
}
} }
} }
}) })
@@ -140,7 +140,6 @@ export default class CthulhuEternalActorSheet extends HandlebarsApplicationMixin
_onDragOver(event) {} _onDragOver(event) {}
async _onDropItem(item) { async _onDropItem(item) {
console.log("Dropped item", item)
let itemData = item.toObject() let itemData = item.toObject()
await this.document.createEmbeddedDocuments("Item", [itemData], { renderSheet: false }) await this.document.createEmbeddedDocuments("Item", [itemData], { renderSheet: false })
} }
@@ -160,15 +159,12 @@ export default class CthulhuEternalActorSheet extends HandlebarsApplicationMixin
} }
static #onUpdateCheckboxArray(event, target) { static #onUpdateCheckboxArray(event, target) {
console.log("Update checkbox array", event, target)
let arrayName = target.dataset.name let arrayName = target.dataset.name
let arrayIdx = Number(target.dataset.index) let arrayIdx = Number(target.dataset.index)
let dataPath = `system.san.${arrayName}` let dataPath = `system.san.${arrayName}`
let tab = foundry.utils.duplicate(this.document.system.san[arrayName]) let tab = foundry.utils.duplicate(this.document.system.san[arrayName])
tab[arrayIdx] = target.checked tab[arrayIdx] = target.checked
this.actor.update( { [dataPath]: tab } ) this.actor.update( { [dataPath]: tab } )
// Dump
console.log("Array name", arrayName, arrayIdx, target.checked, dataPath)
} }
/** /**
@@ -13,6 +13,7 @@ export default class CthulhuEternalProtagonistSheet extends CthulhuEternalActorS
}, },
actions: { actions: {
setBP: CthulhuEternalProtagonistSheet.#onSetBP, setBP: CthulhuEternalProtagonistSheet.#onSetBP,
toggleEquipped: CthulhuEternalProtagonistSheet.#onToggleEquipped,
createGear: CthulhuEternalProtagonistSheet.#onCreateGear, createGear: CthulhuEternalProtagonistSheet.#onCreateGear,
createArmor: CthulhuEternalProtagonistSheet.#onCreateArmor, createArmor: CthulhuEternalProtagonistSheet.#onCreateArmor,
createWeapon: CthulhuEternalProtagonistSheet.#onCreateWeapon, createWeapon: CthulhuEternalProtagonistSheet.#onCreateWeapon,
@@ -155,6 +156,12 @@ export default class CthulhuEternalProtagonistSheet extends CthulhuEternalActorS
this.document.system.setBP() this.document.system.setBP()
} }
static #onToggleEquipped(event, target) {
const itemId = target.dataset.itemId
const item = this.document.items.get(itemId)
if (item) item.update({ "system.equipped": !item.system.equipped })
}
static #onCreateGear(event, target) { static #onCreateGear(event, target) {
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("CTHULHUETERNAL.Label.newGear"), type: "gear" }]) this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("CTHULHUETERNAL.Label.newGear"), type: "gear" }])
} }
+1 -2
View File
@@ -32,7 +32,6 @@ export default class CthulhuEternalSkillSheet extends CthulhuEternalItemSheet {
} }
static async #onRollProgress(event, target) { static async #onRollProgress(event, target) {
console.log("Rolling progress for skill", this, event, target)
if (this.actor) { if (this.actor) {
const roll = await new Roll("1d4").evaluate() const roll = await new Roll("1d4").evaluate()
if (roll) { if (roll) {
@@ -41,7 +40,7 @@ export default class CthulhuEternalSkillSheet extends CthulhuEternalItemSheet {
user: game.user.id, user: game.user.id,
speaker: ChatMessage.getSpeaker({ actor: this.actor }), speaker: ChatMessage.getSpeaker({ actor: this.actor }),
content: `<div class="progress-roll">${game.i18n.localize("CTHULHUETERNAL.Label.skillProgress")} - ${this.document.name} +${roll.total}</div>`, content: `<div class="progress-roll">${game.i18n.localize("CTHULHUETERNAL.Label.skillProgress")} - ${this.document.name} +${roll.total}</div>`,
type: CONST.CHAT_MESSAGE_TYPES.ROLL, type: CONST.CHAT_MESSAGE_STYLES.ROLL,
roll: roll, roll: roll,
}; };
await ChatMessage.create(chatData); await ChatMessage.create(chatData);
+6 -1
View File
@@ -42,6 +42,12 @@ export default class CthulhuEternalActor extends Actor {
type: CONST.CHAT_MESSAGE_STYLES.OTHER type: CONST.CHAT_MESSAGE_STYLES.OTHER
}) })
} }
if (this.type === "protagonist" && changed?.system?.hp !== undefined) {
const hp = this.system.hp
this.toggleStatusEffect("dead", { active: !!hp.dead })
this.toggleStatusEffect("unconscious", { active: !!hp.unconscious && !hp.dead })
this.toggleStatusEffect("stun", { active: !!hp.stunned && !hp.dead && !hp.unconscious })
}
return super._onUpdate(changed, options, userId) return super._onUpdate(changed, options, userId)
} }
@@ -69,7 +75,6 @@ export default class CthulhuEternalActor extends Actor {
if (this.system.hp.value !== hp) { if (this.system.hp.value !== hp) {
this.update({ "system.hp.value": hp }) this.update({ "system.hp.value": hp })
} }
console.log("Applying wounds", { woundData, totalArmor, effectiveWounds })
// Chat message for GM only // Chat message for GM only
if (game.user.isGM) { if (game.user.isGM) {
let armorText = totalArmor > 0 ? game.i18n.format("CTHULHUETERNAL.Chat.armorAbsorbed", { armor: totalArmor }) : game.i18n.localize("CTHULHUETERNAL.Chat.noArmor") let armorText = totalArmor > 0 ? game.i18n.format("CTHULHUETERNAL.Chat.armorAbsorbed", { armor: totalArmor }) : game.i18n.localize("CTHULHUETERNAL.Chat.noArmor")
-4
View File
@@ -290,12 +290,10 @@ export default class CthulhuEternalRoll extends Roll {
let era = game.settings.get("fvtt-cthulhu-eternal", "settings-era") let era = game.settings.get("fvtt-cthulhu-eternal", "settings-era")
if (era !== options.rollItem.system.settings) { if (era !== options.rollItem.system.settings) {
ui.notifications.error(game.i18n.localize("CTHULHUETERNAL.Notifications.WrongEra")) ui.notifications.error(game.i18n.localize("CTHULHUETERNAL.Notifications.WrongEra"))
console.log("WP Wrong Era", era, options.rollItem.system.weaponType)
return return
} }
if (!SYSTEM.WEAPON_SKILL_MAPPING[era]?.[options.rollItem.system.weaponType]) { if (!SYSTEM.WEAPON_SKILL_MAPPING[era]?.[options.rollItem.system.weaponType]) {
ui.notifications.error(game.i18n.localize("CTHULHUETERNAL.Notifications.NoWeaponType")) ui.notifications.error(game.i18n.localize("CTHULHUETERNAL.Notifications.NoWeaponType"))
console.log("WP Not found", era, options.rollItem.system.weaponType)
return return
} }
/*if (!target) { /*if (!target) {
@@ -442,8 +440,6 @@ export default class CthulhuEternalRoll extends Roll {
rollData.rollMode = rollContext.visibility rollData.rollMode = rollContext.visibility
// Update target score // Update target score
console.log("Rolldata", rollData)
if (options.rollType === "resource") { if (options.rollType === "resource") {
rollData.targetScore = options.initialScore * Number(rollContext.multiplier) rollData.targetScore = options.initialScore * Number(rollContext.multiplier)
} else { } else {
+1
View File
@@ -12,6 +12,7 @@ export default class CthulhuEternalArmor extends foundry.abstract.TypeDataModel
schema.protection = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }) schema.protection = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.resourceLevel = new fields.NumberField({ required: true, initial: 0, min: 0 }) schema.resourceLevel = new fields.NumberField({ required: true, initial: 0, min: 0 })
schema.equipped = new fields.BooleanField({ required: true, initial: false })
return schema return schema
} }
-1
View File
@@ -277,7 +277,6 @@ export default class CthulhuEternalProtagonist extends foundry.abstract.TypeData
template = "systems/fvtt-cthulhu-eternal/templates/chat-san-loss-none.hbs" template = "systems/fvtt-cthulhu-eternal/templates/chat-san-loss-none.hbs"
} }
console.log("CthulhuEternalProtagonist.applySANConsequences", rollData, updates, template)
let content = await foundry.applications.handlebars.renderTemplate(template, msgData) let content = await foundry.applications.handlebars.renderTemplate(template, msgData)
let msg = await ChatMessage.create({ let msg = await ChatMessage.create({
content: content, content: content,
-1
View File
@@ -54,7 +54,6 @@ export default class CthulhuEternalWeapon extends foundry.abstract.TypeDataModel
} }
isRanged() { isRanged() {
console.log("isRanged", this.weaponType, this)
return this.weaponType.match("ranged") return this.weaponType.match("ranged")
} }
-9
View File
@@ -118,9 +118,6 @@ export default class CthulhuEternalUtils {
return Object.keys(obj).length; return Object.keys(obj).length;
}) })
Handlebars.registerHelper('isEnabled', function (configKey) {
return game.settings.get("bol", configKey);
})
Handlebars.registerHelper('split', function (str, separator, keep) { Handlebars.registerHelper('split', function (str, separator, keep) {
return str.split(separator)[keep]; return str.split(separator)[keep];
}) })
@@ -164,7 +161,6 @@ export default class CthulhuEternalUtils {
return eval(expr); return eval(expr);
}) })
Handlebars.registerHelper('isOwnerOrGM', function (actor) { Handlebars.registerHelper('isOwnerOrGM', function (actor) {
console.log("Testing actor", actor.isOwner, game.userId)
return actor.isOwner || game.isGM; return actor.isOwner || game.isGM;
}) })
Handlebars.registerHelper('upperFirst', function (text) { Handlebars.registerHelper('upperFirst', function (text) {
@@ -382,8 +378,6 @@ export default class CthulhuEternalUtils {
loser = { actor: actor1, rollData: roll1.rollData, messageId: roll1.messageId } loser = { actor: actor1, rollData: roll1.rollData, messageId: roll1.messageId }
} }
console.log("Opposed roll result", winner, loser)
// Check if winner was attacking with a weapon that can apply damage // Check if winner was attacking with a weapon that can apply damage
let canApplyDamage = winner && winner.rollData?.weapon && winner.rollData.weapon.system let canApplyDamage = winner && winner.rollData?.weapon && winner.rollData.weapon.system
@@ -476,7 +470,6 @@ export default class CthulhuEternalUtils {
return return
} }
console.log("Damage roll data", rollData)
rollData.weapon.resultType = rollData.resultType // Keep the result type from the roll message rollData.weapon.resultType = rollData.resultType // Keep the result type from the roll message
rollData.weapon.selectiveFireChoice = rollData.selectiveFireChoice // Keep the selected fire choice from the roll message rollData.weapon.selectiveFireChoice = rollData.selectiveFireChoice // Keep the selected fire choice from the roll message
rollData.weapon.damageFormula = formula || rollData.weapon.system.damage rollData.weapon.damageFormula = formula || rollData.weapon.system.damage
@@ -555,7 +548,6 @@ export default class CthulhuEternalUtils {
// Build options table for the select operator between minValue and maxValue // Build options table for the select operator between minValue and maxValue
dialogContext.nudgeOptions = Array.from({ length: dialogContext.maxValue - dialogContext.minValue + 1 }, (_, i) => dialogContext.minValue + i) dialogContext.nudgeOptions = Array.from({ length: dialogContext.maxValue - dialogContext.minValue + 1 }, (_, i) => dialogContext.minValue + i)
console.log(dialogContext)
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-cthulhu-eternal/templates/nudge-dialog.hbs", dialogContext) const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-cthulhu-eternal/templates/nudge-dialog.hbs", dialogContext)
@@ -650,7 +642,6 @@ export default class CthulhuEternalUtils {
ui.notifications.error(game.i18n.localize("CTHULHUETERNAL.Notifications.noActorFound")) ui.notifications.error(game.i18n.localize("CTHULHUETERNAL.Notifications.noActorFound"))
return return
} }
console.log("Applying wounds", woundData)
// Remove the chat message // Remove the chat message
this.removeChatMessageId(message.id) this.removeChatMessageId(message.id)
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000281 MANIFEST-000293
+11 -7
View File
@@ -1,7 +1,11 @@
2026/04/01-22:53:01.206674 7fcc60fed6c0 Recovering log #279 2026/04/28-23:36:37.192093 7f5797fff6c0 Delete type=3 #1
2026/04/01-22:53:01.217456 7fcc60fed6c0 Delete type=3 #277 2026/04/28-23:37:29.068330 7f57977fe6c0 Level-0 table #296: started
2026/04/01-22:53:01.217537 7fcc60fed6c0 Delete type=0 #279 2026/04/28-23:37:29.068358 7f57977fe6c0 Level-0 table #296: 0 bytes OK
2026/04/01-22:56:08.533863 7fcc4affd6c0 Level-0 table #284: started 2026/04/28-23:37:29.074817 7f57977fe6c0 Delete type=0 #294
2026/04/01-22:56:08.533906 7fcc4affd6c0 Level-0 table #284: 0 bytes OK 2026/04/28-23:37:29.106904 7f57977fe6c0 Manual compaction at level-0 from '!items!4oyPRBWPBWAChrJP' @ 72057594037927935 : 1 .. '!items!zVFfp3o0G0Zg3Ia4' @ 0 : 0; will stop at '!items!zVFfp3o0G0Zg3Ia4' @ 52 : 1
2026/04/01-22:56:08.586584 7fcc4affd6c0 Delete type=0 #282 2026/04/28-23:37:29.106913 7f57977fe6c0 Compacting 1@0 + 0@1 files
2026/04/01-22:56:08.586750 7fcc4affd6c0 Manual compaction at level-0 from '!items!4oyPRBWPBWAChrJP' @ 72057594037927935 : 1 .. '!items!zVFfp3o0G0Zg3Ia4' @ 0 : 0; will stop at (end) 2026/04/28-23:37:29.111066 7f57977fe6c0 Generated table #297@0: 26 keys, 60964 bytes
2026/04/28-23:37:29.111082 7f57977fe6c0 Compacted 1@0 + 0@1 files => 60964 bytes
2026/04/28-23:37:29.117095 7f57977fe6c0 compacted to: files[ 0 1 0 0 0 0 0 ]
2026/04/28-23:37:29.117212 7f57977fe6c0 Delete type=2 #248
2026/04/28-23:37:29.117383 7f57977fe6c0 Manual compaction at level-0 from '!items!zVFfp3o0G0Zg3Ia4' @ 52 : 1 .. '!items!zVFfp3o0G0Zg3Ia4' @ 0 : 0; will stop at (end)
+4 -7
View File
@@ -1,7 +1,4 @@
2025/12/23-21:58:00.777018 7f1118ff96c0 Recovering log #275 2026/04/28-23:36:37.170404 7f5797fff6c0 Log #291: 0 ops saved to Table #292 OK
2025/12/23-21:58:00.909461 7f1118ff96c0 Delete type=3 #273 2026/04/28-23:36:37.170516 7f5797fff6c0 Archiving /home/morr/foundry/foundrydata-dev/Data/systems/fvtt-cthulhu-eternal/packs-system/rituals/000291.log: OK
2025/12/23-21:58:00.909547 7f1118ff96c0 Delete type=0 #275 2026/04/28-23:36:37.171708 7f5797fff6c0 Table #248: 26 entries OK
2025/12/23-22:36:20.406495 7f0e7bfff6c0 Level-0 table #280: started 2026/04/28-23:36:37.175280 7f5797fff6c0 **** Repaired leveldb /home/morr/foundry/foundrydata-dev/Data/systems/fvtt-cthulhu-eternal/packs-system/rituals; recovered 1 files; 60964 bytes. Some data may have been lost. ****
2025/12/23-22:36:20.406537 7f0e7bfff6c0 Level-0 table #280: 0 bytes OK
2025/12/23-22:36:20.412428 7f0e7bfff6c0 Delete type=0 #278
2025/12/23-22:36:20.419890 7f0e7bfff6c0 Manual compaction at level-0 from '!items!4oyPRBWPBWAChrJP' @ 72057594037927935 : 1 .. '!items!zVFfp3o0G0Zg3Ia4' @ 0 : 0; will stop at (end)
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000450 MANIFEST-000462
+11 -7
View File
@@ -1,7 +1,11 @@
2026/04/01-22:53:01.173017 7fcc60fed6c0 Recovering log #448 2026/04/28-23:36:37.131149 7f57a57ee6c0 Delete type=3 #1
2026/04/01-22:53:01.184049 7fcc60fed6c0 Delete type=3 #446 2026/04/28-23:37:29.054894 7f57977fe6c0 Level-0 table #465: started
2026/04/01-22:53:01.184114 7fcc60fed6c0 Delete type=0 #448 2026/04/28-23:37:29.054961 7f57977fe6c0 Level-0 table #465: 0 bytes OK
2026/04/01-22:56:08.365689 7fcc4affd6c0 Level-0 table #453: started 2026/04/28-23:37:29.061529 7f57977fe6c0 Delete type=0 #463
2026/04/01-22:56:08.365761 7fcc4affd6c0 Level-0 table #453: 0 bytes OK 2026/04/28-23:37:29.081738 7f57977fe6c0 Manual compaction at level-0 from '!folders!5PrT9QmN1cFPzDFP' @ 72057594037927935 : 1 .. '!items!zvoUByzWSWZ87fxA' @ 0 : 0; will stop at '!items!zvoUByzWSWZ87fxA' @ 1281 : 1
2026/04/01-22:56:08.421424 7fcc4affd6c0 Delete type=0 #451 2026/04/28-23:37:29.081748 7f57977fe6c0 Compacting 1@0 + 0@1 files
2026/04/01-22:56:08.586720 7fcc4affd6c0 Manual compaction at level-0 from '!folders!5PrT9QmN1cFPzDFP' @ 72057594037927935 : 1 .. '!items!zvoUByzWSWZ87fxA' @ 0 : 0; will stop at (end) 2026/04/28-23:37:29.088487 7f57977fe6c0 Generated table #466@0: 556 keys, 320457 bytes
2026/04/28-23:37:29.088505 7f57977fe6c0 Compacted 1@0 + 0@1 files => 320457 bytes
2026/04/28-23:37:29.094678 7f57977fe6c0 compacted to: files[ 0 1 0 0 0 0 0 ]
2026/04/28-23:37:29.094831 7f57977fe6c0 Delete type=2 #417
2026/04/28-23:37:29.117360 7f57977fe6c0 Manual compaction at level-0 from '!items!zvoUByzWSWZ87fxA' @ 1281 : 1 .. '!items!zvoUByzWSWZ87fxA' @ 0 : 0; will stop at (end)
+4 -7
View File
@@ -1,7 +1,4 @@
2025/12/23-21:58:00.532068 7f1119ffb6c0 Recovering log #444 2026/04/28-23:36:36.935963 7f57a57ee6c0 Log #460: 0 ops saved to Table #461 OK
2025/12/23-21:58:00.647819 7f1119ffb6c0 Delete type=3 #442 2026/04/28-23:36:36.936025 7f57a57ee6c0 Archiving /home/morr/foundry/foundrydata-dev/Data/systems/fvtt-cthulhu-eternal/packs-system/skills/000460.log: OK
2025/12/23-21:58:00.647954 7f1119ffb6c0 Delete type=0 #444 2026/04/28-23:36:36.942723 7f57a57ee6c0 Table #417: 556 entries OK
2025/12/23-22:36:20.355345 7f0e7bfff6c0 Level-0 table #449: started 2026/04/28-23:36:36.946588 7f57a57ee6c0 **** Repaired leveldb /home/morr/foundry/foundrydata-dev/Data/systems/fvtt-cthulhu-eternal/packs-system/skills; recovered 1 files; 320457 bytes. Some data may have been lost. ****
2025/12/23-22:36:20.355397 7f0e7bfff6c0 Level-0 table #449: 0 bytes OK
2025/12/23-22:36:20.362045 7f0e7bfff6c0 Delete type=0 #447
2025/12/23-22:36:20.385891 7f0e7bfff6c0 Manual compaction at level-0 from '!folders!5PrT9QmN1cFPzDFP' @ 72057594037927935 : 1 .. '!items!zvoUByzWSWZ87fxA' @ 0 : 0; will stop at (end)
Binary file not shown.
Binary file not shown.
View File
View File
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000096 MANIFEST-000108
+11 -7
View File
@@ -1,7 +1,11 @@
2026/04/01-22:53:01.192292 7fcc4b7fe6c0 Recovering log #94 2026/04/28-23:36:37.166060 7f57a4fed6c0 Delete type=3 #1
2026/04/01-22:53:01.202349 7fcc4b7fe6c0 Delete type=3 #92 2026/04/28-23:37:29.061681 7f57977fe6c0 Level-0 table #111: started
2026/04/01-22:53:01.202397 7fcc4b7fe6c0 Delete type=0 #94 2026/04/28-23:37:29.061722 7f57977fe6c0 Level-0 table #111: 0 bytes OK
2026/04/01-22:56:08.421577 7fcc4affd6c0 Level-0 table #99: started 2026/04/28-23:37:29.068229 7f57977fe6c0 Delete type=0 #109
2026/04/01-22:56:08.421606 7fcc4affd6c0 Level-0 table #99: 0 bytes OK 2026/04/28-23:37:29.095030 7f57977fe6c0 Manual compaction at level-0 from '!folders!0DI3T2jve3nsmsfZ' @ 72057594037927935 : 1 .. '!items!zyxA9DhO36t5OBDv' @ 0 : 0; will stop at '!items!zyxA9DhO36t5OBDv' @ 55 : 1
2026/04/01-22:56:08.475595 7fcc4affd6c0 Delete type=0 #97 2026/04/28-23:37:29.095044 7f57977fe6c0 Compacting 1@0 + 0@1 files
2026/04/01-22:56:08.586731 7fcc4affd6c0 Manual compaction at level-0 from '!folders!0DI3T2jve3nsmsfZ' @ 72057594037927935 : 1 .. '!items!zyxA9DhO36t5OBDv' @ 0 : 0; will stop at (end) 2026/04/28-23:37:29.100652 7f57977fe6c0 Generated table #112@0: 362 keys, 93592 bytes
2026/04/28-23:37:29.100675 7f57977fe6c0 Compacted 1@0 + 0@1 files => 93592 bytes
2026/04/28-23:37:29.106685 7f57977fe6c0 compacted to: files[ 0 1 0 0 0 0 0 ]
2026/04/28-23:37:29.106785 7f57977fe6c0 Delete type=2 #63
2026/04/28-23:37:29.117373 7f57977fe6c0 Manual compaction at level-0 from '!items!zyxA9DhO36t5OBDv' @ 55 : 1 .. '!items!zyxA9DhO36t5OBDv' @ 0 : 0; will stop at (end)
+4 -7
View File
@@ -1,7 +1,4 @@
2025/12/23-21:58:00.654695 7f1119ffb6c0 Recovering log #90 2026/04/28-23:36:37.136506 7f57a4fed6c0 Log #106: 0 ops saved to Table #107 OK
2025/12/23-21:58:00.773269 7f1119ffb6c0 Delete type=3 #88 2026/04/28-23:36:37.136625 7f57a4fed6c0 Archiving /home/morr/foundry/foundrydata-dev/Data/systems/fvtt-cthulhu-eternal/packs-system/weapons/000106.log: OK
2025/12/23-21:58:00.773360 7f1119ffb6c0 Delete type=0 #90 2026/04/28-23:36:37.141991 7f57a4fed6c0 Table #63: 362 entries OK
2025/12/23-22:36:20.362172 7f0e7bfff6c0 Level-0 table #95: started 2026/04/28-23:36:37.145196 7f57a4fed6c0 **** Repaired leveldb /home/morr/foundry/foundrydata-dev/Data/systems/fvtt-cthulhu-eternal/packs-system/weapons; recovered 1 files; 93592 bytes. Some data may have been lost. ****
2025/12/23-22:36:20.362202 7f0e7bfff6c0 Level-0 table #95: 0 bytes OK
2025/12/23-22:36:20.368698 7f0e7bfff6c0 Delete type=0 #93
2025/12/23-22:36:20.385910 7f0e7bfff6c0 Manual compaction at level-0 from '!folders!0DI3T2jve3nsmsfZ' @ 72057594037927935 : 1 .. '!items!zyxA9DhO36t5OBDv' @ 0 : 0; will stop at (end)
Binary file not shown.
Binary file not shown.
+1
View File
@@ -8,6 +8,7 @@
{{formField systemFields.settings value=system.settings localize=true}} {{formField systemFields.settings value=system.settings localize=true}}
{{formField systemFields.protection value=system.protection}} {{formField systemFields.protection value=system.protection}}
{{formField systemFields.resourceLevel value=system.resourceLevel}} {{formField systemFields.resourceLevel value=system.resourceLevel}}
{{formField systemFields.equipped value=system.equipped}}
</fieldset> </fieldset>
+1 -1
View File
@@ -6,7 +6,7 @@
<fieldset> <fieldset>
<legend>{{localize "CTHULHUETERNAL.Label.description"}}</legend> <legend>{{localize "CTHULHUETERNAL.Label.description"}}</legend>
{{formInput systemFields.description enriched=enrichedDescriptionw value=system.description name="system.description" toggled=true}} {{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
</fieldset> </fieldset>
</section> </section>
+14 -1
View File
@@ -9,7 +9,7 @@
{{#each weapons as |item|}} {{#each weapons as |item|}}
{{!log 'weapon' this}} {{!log 'weapon' this}}
<div class="weapon item" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-drag="true"> <div class="weapon item" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-drag="true">
<!-- content -->
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" /> <img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
<img src="systems/fvtt-cthulhu-eternal/assets/ui/d100.svg" class="d100" /> <img src="systems/fvtt-cthulhu-eternal/assets/ui/d100.svg" class="d100" />
<div class="name rollable" data-roll-type="weapon" data-tooltip="{{{item.system.description}}}"> <div class="name rollable" data-roll-type="weapon" data-tooltip="{{{item.system.description}}}">
@@ -81,6 +81,8 @@
data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a> data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a>
</div> </div>
</div> </div>
{{else}}
<div class="empty-state">{{localize "CTHULHUETERNAL.Label.noWeapons"}}</div>
{{/each}} {{/each}}
</div> </div>
</fieldset> </fieldset>
@@ -99,6 +101,13 @@
{{item.name}} {{item.name}}
</div> </div>
<span class="protection">{{localize "CTHULHUETERNAL.Label.armor"}} : {{item.system.protection}}</span> <span class="protection">{{localize "CTHULHUETERNAL.Label.armor"}} : {{item.system.protection}}</span>
<a class="equipped-toggle {{#if item.system.equipped}}active{{/if}}"
data-action="toggleEquipped"
data-item-id="{{item.id}}"
data-item-uuid="{{item.uuid}}"
data-tooltip="{{#if item.system.equipped}}{{localize 'CTHULHUETERNAL.Label.equipped'}}{{else}}{{localize 'CTHULHUETERNAL.Label.unequipped'}}{{/if}}">
<i class="fas {{#if item.system.equipped}}fa-shield-halved{{else}}fa-shield{{/if}}"></i>
</a>
<div class="controls"> <div class="controls">
<a data-tooltip="{{localize 'CTHULHUETERNAL.Edit'}}" data-action="edit" data-item-id="{{item.id}}" <a data-tooltip="{{localize 'CTHULHUETERNAL.Edit'}}" data-action="edit" data-item-id="{{item.id}}"
data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a> data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a>
@@ -106,6 +115,8 @@
data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a> data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a>
</div> </div>
</div> </div>
{{else}}
<div class="empty-state">{{localize "CTHULHUETERNAL.Label.noArmors"}}</div>
{{/each}} {{/each}}
</div> </div>
</fieldset> </fieldset>
@@ -130,6 +141,8 @@
data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a> data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a>
</div> </div>
</div> </div>
{{else}}
<div class="empty-state">{{localize "CTHULHUETERNAL.Label.noGears"}}</div>
{{/each}} {{/each}}
</div> </div>
</fieldset> </fieldset>
+2
View File
@@ -17,6 +17,8 @@
<a data-tooltip="{{localize 'CTHULHUETERNAL.Delete'}}" data-action="delete" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a> <a data-tooltip="{{localize 'CTHULHUETERNAL.Delete'}}" data-action="delete" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a>
</div> </div>
</div> </div>
{{else}}
<div class="empty-state">{{localize "CTHULHUETERNAL.Label.noSkills"}}</div>
{{/each}} {{/each}}
</div> </div>
</fieldset> </fieldset>