Manage selective fire

This commit is contained in:
2025-06-15 00:30:24 +02:00
parent e0400793ff
commit 9e4d76298c
35 changed files with 654 additions and 122 deletions

View File

@@ -199,7 +199,7 @@ export default class CthulhuEternalProtagonistSheet extends CthulhuEternalActorS
* corresponding value from the document's system and performs the roll.
*/
async _onRoll(event, target) {
const rollType = $(event.currentTarget).data("roll-type")
let rollType = $(event.currentTarget).data("roll-type")
let item
let li
// Debug : console.log(">>>>", event, target, rollType)
@@ -231,6 +231,12 @@ export default class CthulhuEternalProtagonistSheet extends CthulhuEternalActorS
item.name = game.i18n.localize("CTHULHUETERNAL.Label.SAN")
item.targetScore = item.value
break;
case "luck":
item = foundry.utils.duplicate(this.actor.system.characteristics.int)
item.name = game.i18n.localize("CTHULHUETERNAL.Label.Luck")
item.value = 10
item.targetScore = 50
break;
default:
throw new Error(`Unknown roll type ${rollType}`)
}

View File

@@ -18,4 +18,13 @@ export default class CthulhuEternalWeaponSheet extends CthulhuEternalItemSheet {
template: "systems/fvtt-cthulhu-eternal/templates/weapon.hbs",
},
}
async _prepareContext() {
let context = await super._prepareContext()
context.isFireArm = this.item.system.isFireArm()
context.isRanged = this.item.system.isRanged()
return context
}
}