Add damage management and DR for monsters also
All checks were successful
Release Creation / build (release) Successful in 1m48s
All checks were successful
Release Creation / build (release) Successful in 1m48s
This commit is contained in:
@@ -192,6 +192,8 @@ Hooks.on(hookName, (message, html, data) => {
|
||||
const weaponId = button.data("weapon-id")
|
||||
const damageType = button.data("damage-type")
|
||||
const damageFormula = button.data("damage-formula")
|
||||
const damageModifier = button.data("damage-modifier")
|
||||
const isMonster = button.data("is-monster")
|
||||
|
||||
// Récupérer l'acteur qui a fait le jet initial
|
||||
const actor = game.actors.get(message.rolls[0]?.actorId)
|
||||
@@ -200,7 +202,13 @@ Hooks.on(hookName, (message, html, data) => {
|
||||
return
|
||||
}
|
||||
|
||||
// Récupérer l'arme
|
||||
// Pour les monstres, utiliser prepareMonsterRoll
|
||||
if (isMonster || actor.type === "monster") {
|
||||
await actor.system.prepareMonsterRoll("monster-damage", weaponId, undefined, undefined, damageModifier)
|
||||
return
|
||||
}
|
||||
|
||||
// Pour les personnages, récupérer l'arme
|
||||
const weapon = actor.items.get(weaponId)
|
||||
if (!weapon) {
|
||||
ui.notifications.error("Weapon not found")
|
||||
|
||||
Reference in New Issue
Block a user