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:
@@ -163,7 +163,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
// D'abord, ajouter les combattants du combat actif
|
||||
if (game?.combat?.combatants) {
|
||||
for (let c of game.combat.combatants) {
|
||||
if (c.actorId !== this.actorId) {
|
||||
if (c.actorId !== this.actorId && !c.isDefeated) {
|
||||
combatants.push({ id: c.id, name: c.name, tokenId: c.token.id })
|
||||
}
|
||||
}
|
||||
@@ -174,6 +174,9 @@ export default class LethalFantasyRoll extends Roll {
|
||||
const existingTokenIds = new Set(combatants.map(c => c.tokenId))
|
||||
for (let token of canvas.scene.tokens) {
|
||||
if (token.actorId !== this.actorId && !existingTokenIds.has(token.id)) {
|
||||
// Skip dead tokens: monsters at 0 HP are dead; characters use the defeated flag
|
||||
const tokenActor = game.actors.get(token.actorId)
|
||||
if (tokenActor?.type === "monster" && (Number(tokenActor?.system?.hp?.value) || 0) <= 0) continue
|
||||
combatants.push({
|
||||
id: token.id,
|
||||
name: token.name,
|
||||
|
||||
Reference in New Issue
Block a user