fix: D30 special effects breaking combat comparison, map auto-pan, dead targets
Release Creation / build (release) Successful in 1m35s
Release Creation / build (release) Successful in 1m35s
- Fix handleAttackBoosted guard: replaced attackerIsCrossClient check with defenderIsMine so the socket handler runs whenever the current user controls the defender. Previously, when a GM-controlled monster attacked with a D30 special result (damage multiplier, bleed, DR multiplier, mulligan), the createChatMessage hook was suppressed (d30PendingFromGM) but handleAttackBoosted returned early because the attacker wasn't a cross-client PC, so nobody created the comparison message. - Remove map auto-pan on target/damage button hover (mouseenter/mouseleave handlers on .request-defense-btn and .apply-wounds-btn). - Filter defeated combatants and dead monster tokens from the target selection list. Characters at 0 HP are still selectable (death saves). - Restore 3D dice animation for damage rolls (lethal-fantasy.mjs, character-sheet.mjs). - Allow negative bonuses on weapon items (damaged weapons). - Allow negative HP for characters (death saving throws). - Fix D30Roll.convertToInternalType guard to warn on missing weapon regardless of isRanged flag. - Fix ranged weapon loading comparison (<= to <). - Add isRangedAttack to rollTarget for consistent ranged detection. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -33,38 +33,12 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
|
||||
}
|
||||
|
||||
for (const btn of html.querySelectorAll(".apply-wounds-btn")) {
|
||||
btn.addEventListener("mouseenter", () => {
|
||||
const combatantId = btn.dataset.combatantId
|
||||
if (combatantId && game.combat) {
|
||||
const combatant = game.combat.combatants.get(combatantId)
|
||||
if (combatant?.token) {
|
||||
const token = canvas.tokens.get(combatant.token.id)
|
||||
if (token) {
|
||||
token.control({ releaseOthers: true })
|
||||
canvas.animatePan(token.center)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
btn.addEventListener("mouseleave", () => canvas.tokens.releaseAll())
|
||||
btn.addEventListener("click", event => LethalFantasyUtils.applyDamage(message, event))
|
||||
}
|
||||
}
|
||||
|
||||
// Gestion du survol et du clic sur les boutons de défense
|
||||
for (const btn of html.querySelectorAll(".request-defense-btn")) {
|
||||
btn.addEventListener("mouseenter", () => {
|
||||
const tokenId = btn.dataset.tokenId
|
||||
if (tokenId) {
|
||||
const token = canvas.tokens.get(tokenId)
|
||||
if (token) {
|
||||
token.control({ releaseOthers: true })
|
||||
canvas.animatePan(token.center)
|
||||
}
|
||||
}
|
||||
})
|
||||
btn.addEventListener("mouseleave", () => canvas.tokens.releaseAll())
|
||||
|
||||
// Gestionnaire pour les boutons de demande de défense
|
||||
btn.addEventListener("click", async event => {
|
||||
event.preventDefault()
|
||||
|
||||
Reference in New Issue
Block a user