feedback7: merge fb7-render — #382 赤刃明霄陈 S3 sword-qi drawn (sim chen3Wave fx), #381 enemy attack recovery held in interpolation, #380 push / pull slide (corpse stays where pushed; same-step kills finish the slide), #384 eye masks, 香槟炸弹 HP bar hidden, #246 an unwound attack plays its whole clip
- Conflicts with the merged fb7-hud (both added display-only snapshot lists): server/sim/battle/events.js, types/core.js,
public/js/render/interp.js, docs/SIM.md, docs/design/network.md — union of ammo / wolves / neg and stand / standCut.
- Grok review: MERGE AFTER FIXES — the HIGH finding (same-step push kill) fixed on the branch (7a33bc7e).
- Golden: diy-073 / diy-074 (fx counts only; union OK); broad node --test 5442 (5441 pass, 0 fail, 1 skipped); lint 0
errors; typecheck.
This commit is contained in:
commit
cf98f4c3f8
27 files changed
+1812
-53
No files matched your search
@@ -32,6 +32,16 @@ export class BattleEvents {
|
||||
return ev;
|
||||
}
|
||||
|
||||
/**
|
||||
* Record that an enemy's attack recovery (atkStandUntil) is cut or ignored now — snapshot `standCut`, display metadata
|
||||
* (render/interp.js); never changes the attack's timing or state.
|
||||
*/
|
||||
_cutAttackStand(unit) {
|
||||
if (unit.side === 'enemy' && Number.isFinite(unit.atkStandUntil) && unit.atkStandUntil > this.time) {
|
||||
unit.atkStandCutAt = this.time;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compact full snapshot of this field (DESIGN §8.2 b.snap), plus (only when non-empty):
|
||||
* down: [[id, respawnAt, respawnTime, state, row, col]] — operators that left the field waiting to redeploy (isDown): the
|
||||
@@ -40,8 +50,13 @@ export class BattleEvents {
|
||||
* elem: [[id, element, fill, cooldownEnd, cooldown]] — the element gauge each unit shows (damage.js elementView);
|
||||
* ammo: [[id, rounds left, rounds in the magazine]] — a running ammo skill, whole rounds (snapshot.js ammoView): the segmented bar;
|
||||
* wolves: [[id, 狼影 left, the talent's maximum]] — 伺夜's 狼群 (snapshot.js wolfView): the pips under the HP bar;
|
||||
* neg: [[id, fill]] — the share of its cap a negative-HP pool holds (snapshot.js negView; 斩业星熊's 我执): the red bar.
|
||||
* The last three are display only: no sim state reads them, and the nine-field unit tuples are unchanged.
|
||||
* neg: [[id, fill]] — the share of its cap a negative-HP pool holds (snapshot.js negView; 斩业星熊's 我执): the red bar;
|
||||
* stand: [[id, until]] — when each enemy's attack recovery ends (atkStandUntil; alive, deployed, visible, not
|
||||
* feared or stunned) — display metadata (render/interp.js holds the position until then);
|
||||
* standCut: [[id, at]] — the latest time each listed enemy's recovery was cut or ignored (_cutAttackStand), the
|
||||
* dying ones in their death window included.
|
||||
* ammo / wolves / neg / stand / standCut are display only: no sim state reads them, and the nine-field unit tuples are
|
||||
* unchanged.
|
||||
*/
|
||||
snapshot() {
|
||||
const snap = {
|
||||
@@ -64,9 +79,18 @@ export class BattleEvents {
|
||||
(down || (down = [])).push([u.id, r2(u.respawnAt), r2(Math.max(0, u.respawnAt - u.deathAt)), this._downState(u), ...this.restTile(u)]);
|
||||
}
|
||||
if (down) snap.down = down;
|
||||
let elem = null, ammo = null, wolves = null, neg = null;
|
||||
let elem = null, ammo = null, wolves = null, neg = null, stand = null, standCut = null;
|
||||
let listed = null; // the ids in snap.units, built for the first enemy with a cut to report
|
||||
for (const u of this.units) {
|
||||
if (u.side === 'enemy' && u.atkStandCutAt >= 0) {
|
||||
const cutAt = Math.round(u.atkStandCutAt * 1000) / 1000;
|
||||
if (cutAt <= snap.t && (listed || (listed = new Set(snap.units.map((x) => x[0])))).has(u.id)) (standCut || (standCut = [])).push([u.id, cutAt]);
|
||||
}
|
||||
if (!u.alive || !u.deployed || u.hidden) continue;
|
||||
const until = Math.round(u.atkStandUntil * 1000) / 1000;
|
||||
if (u.side === 'enemy' && !u.s.flags.fear && !u.s.flags.stun && Number.isFinite(until) && until > snap.t) {
|
||||
(stand || (stand = [])).push([u.id, until]);
|
||||
}
|
||||
const v = elementView(u, this.time);
|
||||
if (v) (elem || (elem = [])).push([u.id, v[0], v[1], v[2], v[3]]);
|
||||
const am = ammoView(u);
|
||||
@@ -80,6 +104,8 @@ export class BattleEvents {
|
||||
if (ammo) snap.ammo = ammo;
|
||||
if (wolves) snap.wolves = wolves;
|
||||
if (neg) snap.neg = neg;
|
||||
if (stand) snap.stand = stand;
|
||||
if (standCut) snap.standCut = standCut;
|
||||
return snap;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user