Enhance spell damage and messages content
Release Creation / build (release) Successful in 44s

This commit is contained in:
2026-05-19 10:52:03 +02:00
parent 96306623e5
commit 6cf0880ad3
29 changed files with 145 additions and 97 deletions
+8 -2
View File
@@ -230,9 +230,15 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
const weaponName = message.rolls[0]?.rollName || "weapon"
const attackRoll = message.rolls[0]?.rollTotal || 0
const defenderName = combatant.name
const attackWeaponId = message.rolls[0]?.rollTarget?.weapon?.id || message.rolls[0]?.rollTarget?.weapon?._id
const attackRollType = message.rolls[0]?.type
const attackRollKey = message.rolls[0]?.rollTarget?.rollKey
const rollTargetData = message.rolls[0]?.rollTarget
// For spell/miracle attacks, rollTarget IS the spell item (serialised as its data object).
// For weapon attacks, rollTarget is a plain skill+weapon object and weapon.id is the weapon.
const isSpellMiracleAttack = attackRollType === "spell-attack" || attackRollType === "miracle-attack"
const attackWeaponId = isSpellMiracleAttack
? (rollTargetData?._id || rollTargetData?.id)
: (rollTargetData?.weapon?.id || rollTargetData?.weapon?._id)
const attackRollKey = rollTargetData?.rollKey
console.log(`[LF] request-defense-btn | attackRollType=${attackRollType} defender=${defenderName} defenderType=${combatant.actor?.type}`)
const attackD30result = message.rolls[0]?.options?.D30result || null
const attackD30message = message.rolls[0]?.options?.D30message || null