Add secondary stats + char rolls

This commit is contained in:
2024-12-18 18:45:47 +01:00
parent 4d3c15a2a8
commit 93901d5f1e
12 changed files with 150 additions and 34 deletions

View File

@ -148,9 +148,19 @@ export default class CthulhuEternalProtagonistSheet extends CthulhuEternalActorS
let item
// Debug : console.log(">>>>", event, target, rollType)
// Deprecated : if (this.isEditMode) return
if (rollType === "skill") {
const li = $(event.currentTarget).parents(".item");
item = this.actor.items.get(li.data("item-id"));
switch(rollType) {
case "char":
let charId = $(event.currentTarget).data("char-id")
item = foundry.utils.duplicate(this.actor.system.characteristics[charId])
item.name = game.i18n.localize("CTHULHUETERNAL.Label." + charId + "Long")
item.targetScore = item.value * 5
break
case "skill":
const li = $(event.currentTarget).parents(".item");
item = this.actor.items.get(li.data("item-id"));
break
default:
throw new Error(`Unknown roll type ${rollType}`)
}
await this.document.system.roll(rollType, item)
}