Roll damages and so on
All checks were successful
Release Creation / build (release) Successful in 56s

This commit is contained in:
2025-12-14 21:18:00 +01:00
parent f6b35536de
commit 96062c6fd9
34 changed files with 285 additions and 100 deletions

View File

@@ -185,6 +185,32 @@ Hooks.on(hookName, (message, html, data) => {
LethalFantasyUtils.applyDamage(message, event)
})
}
// Gestionnaire pour les boutons de jet de dégâts
$(html).find(".damage-roll-btn").click(async (event) => {
const button = $(event.currentTarget)
const weaponId = button.data("weapon-id")
const damageType = button.data("damage-type")
const damageFormula = button.data("damage-formula")
// Récupérer l'acteur qui a fait le jet initial
const actor = game.actors.get(message.rolls[0]?.actorId)
if (!actor) {
ui.notifications.error("Actor not found")
return
}
// Récupérer l'arme
const weapon = actor.items.get(weaponId)
if (!weapon) {
ui.notifications.error("Weapon not found")
return
}
// Lancer les dégâts avec la bonne méthode
const rollType = damageType === "small" ? "weapon-damage-small" : "weapon-damage-medium"
await actor.prepareRoll(rollType, weaponId)
})
})
Hooks.on("getCombatTrackerEntryContext", (html, options) => {