Roll damages and so on
All checks were successful
Release Creation / build (release) Successful in 56s
All checks were successful
Release Creation / build (release) Successful in 56s
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user