feedback1d WN: a field opened after 暴鸰's drop draws it without its bomb (UnitInfo.form)

The bomb-less mode lived only in the client that saw the fx 'phase' event. UnitInfo now
carries an enemy's recorded mode (unit.form, set by kitBombd at the release), and the
renderer keeps it on the unit info, so a field watched or rejoined later starts on the
*_2 clips.
This commit is contained in:
sganggs committed 2026-10-03 04:22:36 +08:00
1 parent 901d5b9613
commit cc57afa8c4
6 files changed
+17 -3

No files matched your search

+1
View File
@@ -1502,6 +1502,7 @@ function kitBombd(ab) {
if (!e.alive) return;
const atk = e.s.atk;
b._ev(['atk', e.id, t.id, 'droneBomb']);
e.form = 'bombed'; // UnitInfo.form: a view built later draws it bomb-less
b.fx('phase', { x: e.x, y: e.y, id: e.id, kind: 'bombed' });
b.addProjectile({ from: e, target: t, speed: PROJECTILE_SPEEDS.droneBomb, visual: 'droneBomb', source: e, hitDead: true,
onHit: (c) => land(b, e, atk, c.target, c.x, c.y) });
+5 -2
View File
@@ -1,8 +1,10 @@
// server/sim/snapshot.js — compact serialization for clients (DESIGN §8.2).
//
// b.snap = { fieldId, t, units: [[id, x, y, hp, maxHp, sp, spMax, flags, anim]], dp, killed, total }
// UnitInfo = { id, kind, side, ownerId, defId, name, tier, golden, spine, avatar, x, y, facing, dir, maxHp, skillIndex?, moduleId? }
// dir = 'UP'|'RIGHT'|'DOWN'|'LEFT' (allies: the deploy direction, sim/dir.js); facing = its horizontal sign (±1).
// UnitInfo = { id, kind, side, ownerId, defId, name, tier, golden, spine, avatar, x, y, facing, dir, maxHp, skillIndex?, moduleId?, form? }
// dir = 'UP'|'RIGHT'|'DOWN'|'LEFT' (allies: the deploy direction, sim/dir.js); facing = its horizontal sign (±1);
// form = an enemy's current mode (`unit.form`, the last fx 'phase' kind content recorded — 暴鸰 'bombed'), so a view
// built after the change (a field opened mid-battle) draws it (render/units.js FORMS).
// flags bits & anim codes come from shared/constants.js (UF / ANIM).
import { UF, ANIM } from '../../shared/constants.js';
@@ -33,6 +35,7 @@ export function unitInfo(u) {
motion: u.motion === 'FLY' ? 'FLY' : undefined,
boss: u.isBoss ? true : undefined,
uid: u.uid ?? undefined,
form: typeof u.form === 'string' ? u.form : undefined,
// DESIGN §16: the equipped skill's index (the renderer / audio pick that skill's Spine clip and sound)
skillIndex: u.side === 'ally' && Number.isInteger(d.skill?.index) ? d.skill.index : undefined,
// DESIGN §16: an elite ally's equipped module (uniEquipId | 'none'; display only — a teammate's unit in a shared