fix: pre-process D30 attack bonus at source for cross-client agreement
Release Creation / build (release) Successful in 48s

D30 bonus dice now rolled at defense request time, not in defense handler.
Sends boosted attackRoll + d30AttackEffects in socket/nextDefenseData
so both clients agree on the value. Adds stale flag for mulligan rerolls
to bypass stale pre-computed effects and process the new D30 fresh.
This commit is contained in:
2026-07-03 22:39:10 +02:00
parent 1ea1a4b4b7
commit 96e5bd5b4d
3 changed files with 52 additions and 10 deletions
+2
View File
@@ -302,6 +302,7 @@ export async function showDefenseRequest(msg) {
const attackD30result = msg.attackD30result
const attackD30message = msg.attackD30message
const attackRerollContext = msg.attackRerollContext
const d30AttackEffects = msg.d30AttackEffects
const combatantId = msg.combatantId
const tokenId = msg.tokenId
@@ -351,6 +352,7 @@ export async function showDefenseRequest(msg) {
damageTier: msg.damageTier,
defenderId: defender.id, defenderTokenId,
...(msg.attackNaturalRoll !== undefined && { attackNaturalRoll: msg.attackNaturalRoll }),
...(d30AttackEffects !== undefined && { d30AttackEffects }),
...(opts.isRanged !== undefined && { isRanged: opts.isRanged })
}
}