fix: pre-process D30 attack bonus at source for cross-client agreement
Release Creation / build (release) Successful in 48s
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:
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user