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:
1 parent
901d5b9613
commit
cc57afa8c4
6 files changed
+17
-3
No files matched your search
@@ -88,6 +88,13 @@ describe('D4 暴鸰: the drone lets go of its bomb on screen', () => {
|
||||
assert.equal(v.atkInterval, 5, 'a one-off drop leaves the attack rhythm alone');
|
||||
});
|
||||
|
||||
test('render/app.js keeps UnitInfo.form (a field opened after the drop) and hands the atk kind to the view', () => {
|
||||
const src = readFileSync(path.join(ROOT, 'public/js/render/app.js'), 'utf8');
|
||||
assert.match(src, /function addInfo\(u\)[\s\S]{0,2000}form: typeof u\.form === 'string' \? u\.form : undefined/);
|
||||
assert.match(src, /src\.onAttack\?\.\(tgt, now, e\[3\]\)/);
|
||||
assert.match(src, /v\.windUp\(t - upcomingT, e\[3\]\)/);
|
||||
});
|
||||
|
||||
test('the drop draws a falling bomb at the sim\'s speed and the mode change draws nothing of its own', () => {
|
||||
assert.ok(PROJ.droneBomb, 'PROJ.droneBomb');
|
||||
assert.equal(PROJ.droneBomb.speed, PROJECTILE_SPEEDS.droneBomb);
|
||||
|
||||
@@ -70,6 +70,7 @@ describe('D4 暴鸰: the bomb leaves the drone and lands', () => {
|
||||
assert.ok(Math.abs(relT - castAt - RELEASE) <= TICK + 1e-9, `released ${(relT - castAt).toFixed(3)} s after the trigger (OnAttack ${RELEASE})`);
|
||||
const phase = log.find(([, ev]) => ev[0] === 'fx' && ev[1] === 'phase');
|
||||
assert.ok(phase && phase[1][4].kind === 'bombed' && Math.abs(phase[0] - relT) < 1e-9, 'the model drops to its bomb-less mode at the release');
|
||||
if (drone.alive) assert.equal(b.fieldMeta().units.find((u) => u.id === drone.id).form, 'bombed', 'a field opened later draws it bomb-less');
|
||||
assert.ok(hitAt != null, 'the bomb lands');
|
||||
assert.equal(firstHit.id, relEv[2], 'on the operator it was dropped on');
|
||||
assert.ok(hitAt - relT > TICK, `then flies (${(hitAt - relT).toFixed(3)} s at ${PROJECTILE_SPEEDS.droneBomb} tiles/s)`);
|
||||
|
||||
Reference in new issue
Block a user