feedback7: merge fb7-late — #389 / PR #390 画卷 keeps the items to copy across a merge, #385 / PR #387 spectator bond details count the hand like the own popup, #394 / PR #395 Enter during facing selection follows the focus, #281 the attack range drawn on a tapped operator, #388 引星棘刺 S1 DEF stacks, PR #386 谢拉格 寒风 blows bottom-up (owner)
- Golden union OK (roster-033 / roster-034 moved on both sides: #298 and #388); broad node --test 5598 (5596 pass, 0 fail, 2 skipped); lint 0 errors.
This commit is contained in:
commit
2492966c4f
32 files changed
+913
-138
No files matched your search
@@ -0,0 +1,60 @@
|
||||
// test/render/fxchill.test.js — the 'chill' fx of coldWind (render/fx/simfx.js + zones.js snowfall), PR #386 by
|
||||
// @leiming2333: 谢拉格's 盟约寒风 blows a blizzard UP the field (the official direction, the owner's confirmation of
|
||||
// 2026-10-08) with a stronger cold flash; an operator's own coldWind (灵知 S3, 麦哲伦 S1's pulse every 3 s — emitted with
|
||||
// the unit's `id`) keeps the light downward flurry and the softer flash. Against the headless fake PIXI
|
||||
// (test/render/fakepixi.js), like fxchen3wave.test.js.
|
||||
|
||||
import { test, describe, before, after } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { installFakePixi, fakeViewCtx } from './fakepixi.js';
|
||||
import { presetCamera } from '../../public/js/render/projection.js';
|
||||
|
||||
let fake, FX;
|
||||
before(async () => {
|
||||
fake = installFakePixi();
|
||||
FX = await import('../../public/js/render/fx.js');
|
||||
});
|
||||
after(() => fake.restore());
|
||||
|
||||
const W = 1600, H = 900;
|
||||
const cam = presetCamera('normal', { width: W, height: H });
|
||||
|
||||
function makeFx(quality = 'high') {
|
||||
const P = fake.P;
|
||||
const ctx = fakeViewCtx(P);
|
||||
const unit = { id: 7, x: 5, y: 10, z: 0, hover: 0, _headTiles: 1.2, alive: true, destroyed: false, info: { defId: 'x' }, onHit() {} };
|
||||
return new FX.FxSystem({
|
||||
P, layers: ctx.layers, cam: () => cam, heightAt: () => 0, settings: { quality, damageNumbers: true },
|
||||
timeScale: () => 1, loadLevel: () => 0, subProfOf: () => null, view: (id) => (id === unit.id ? unit : null),
|
||||
screenSize: () => ({ width: W, height: H }), fieldTop: () => 120,
|
||||
});
|
||||
}
|
||||
const live = (fx) => fx.parts.filter((p) => p.sp && p.sp.visible !== false);
|
||||
|
||||
describe('coldWind: 谢拉格\'s 盟约寒风 blows up the field, an operator\'s own cold keeps the light flurry', () => {
|
||||
test('the bond\'s gust (the device emits no anchor unit): 48 flakes and 10 streaks rising from the bottom, the stronger flash', () => {
|
||||
const fx = makeFx();
|
||||
// server/sim/content/devices.js startColdWind: the field centre, the player, the cold stacks, the cold duration
|
||||
fx.simFx('coldWind', 8, 9, { x: 8, y: 9, playerId: 'p1', n: 3, duration: 5 });
|
||||
const ps = live(fx);
|
||||
assert.equal(ps.length, 58, '48 flakes + 10 streaks at quality high');
|
||||
assert.ok(ps.every((p) => p.vy < 0), 'every particle rises (screen y grows downward)');
|
||||
assert.ok(ps.every((p) => p.vx > 0), 'on a crosswind');
|
||||
assert.ok(ps.every((p) => p.y >= H * 0.55 - 1e-9), 'lifted off the lower part of the screen (some start below it)');
|
||||
assert.equal(ps.filter((p) => p.sp.texture === fx.tex.streak).length, 10, 'gust streaks');
|
||||
assert.deepEqual([fx.tintA, fx.tintDur], [0.45, 1]);
|
||||
const low = makeFx('low');
|
||||
low.simFx('coldWind', 8, 9, { x: 8, y: 9, playerId: 'p1', n: 3, duration: 5 });
|
||||
assert.equal(live(low).length, 26, 'quality low: 22 flakes + 4 streaks');
|
||||
});
|
||||
|
||||
test('an operator\'s own coldWind (灵知 S3, 麦哲伦\'s pulse: `id` = the unit): the light flurry drifting down, the softer flash', () => {
|
||||
const fx = makeFx();
|
||||
fx.simFx('coldWind', 5, 10, { x: 5, y: 10, id: 7, n: 2 });
|
||||
const ps = live(fx);
|
||||
assert.equal(ps.length, 26);
|
||||
assert.ok(ps.every((p) => p.vy > 0), 'falling as before');
|
||||
assert.equal(ps.filter((p) => p.sp.texture === fx.tex.streak).length, 0, 'no gust streaks');
|
||||
assert.deepEqual([fx.tintA, fx.tintDur], [0.35, 0.8]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user