0.2.3: add Clementia and Shu/Ulpianus modules (#437)
Regenerate roster-019, roster-038 and diy-059 through diy-140 for added and regrouped loadouts; other golden families unchanged.
This commit is contained in:
1 parent
62eb113419
commit
2e122873f0
21 files changed
+2940
-2312
No files matched your search
@@ -0,0 +1,114 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { KITS } from '../../server/sim/content/kits/index.js';
|
||||
import { makeBattle, chessRec, enemyRec, checkInvariants } from '../helpers/battleHarness.js';
|
||||
|
||||
const GUAY = 'uniequip_003_shu', CRUY = 'uniequip_003_ulpia';
|
||||
const approx = (a, b) => assert.ok(Math.abs(a - b) < 1e-6, `${a} != ${b}`);
|
||||
const target = enemyRec({ key: 'dummy', hp: 1e8, speed: 0, def: 0, atk: 0 });
|
||||
const war = chessRec({ id: 'war', profession: 'WARRIOR', skill: null, stats: { atk: 100, blockCnt: 0 } });
|
||||
const med = chessRec({ id: 'med', profession: 'MEDIC', skill: null, stats: { atk: 100, blockCnt: 0 } });
|
||||
const helpers = [2, 3, 4].map((uid) => ({ uid, chessId: 'war', row: 10, col: uid }));
|
||||
function shu(tier, others = []) {
|
||||
const h = makeBattle({ defs: { enemies: { dummy: target }, chess: { war, med } }, autoFinish: false,
|
||||
units: [{ uid: 1, diy: { slot: tier, charId: 'char_2025_shu', skillIndex: 2, uniEquipId: GUAY }, elite: true, row: 11, col: 5 }, ...others] });
|
||||
h.step(); return { h, u: h.unit(1) };
|
||||
}
|
||||
|
||||
test('黍 GUA-Y stage 1/3 reduces incoming damage by 15%, independently of HP, after deployment', () => {
|
||||
for (const tier of [5, 6]) {
|
||||
const { h, u } = shu(tier);
|
||||
approx(u.s.dmgTakenMul, 0.85);
|
||||
const e = h.spawn('dummy', { pos: [10, 9] });
|
||||
const hp = u.hp;
|
||||
h.b.dealDamage(e, u, { amount: 100, type: 'true' });
|
||||
approx(hp - u.hp, 85);
|
||||
const hp2 = u.hp;
|
||||
h.b.dealDamage(e, u, { amount: 100, type: 'elemental' });
|
||||
approx(hp2 - u.hp, 100);
|
||||
checkInvariants(h.b); assert.equal(h.b.errors.length, 0);
|
||||
}
|
||||
});
|
||||
|
||||
test('黍 GUA-Y stage 3 requires two conditions, buffs each operator once, and drops the bonus when a condition ends', () => {
|
||||
for (const tier of [5, 6]) {
|
||||
const { h, u } = shu(tier, [...helpers, { uid: 5, chessId: 'med', row: 9, col: 3 }]);
|
||||
h.run(0.3);
|
||||
const a = h.unit(2);
|
||||
approx(a.s.atk / a.base.atk, tier === 6 ? 1.05 : 1);
|
||||
assert.equal(a.s.aspd, tier === 6 ? 116 : 112);
|
||||
h.b.retreat(h.unit(5), { permanent: true });
|
||||
h.run(0.7);
|
||||
approx(a.s.atk / a.base.atk, 1);
|
||||
assert.equal(u.s.aspd, tier === 6 ? 116 : 112);
|
||||
checkInvariants(h.b); assert.equal(h.b.errors.length, 0);
|
||||
}
|
||||
});
|
||||
|
||||
function ulpia({ moduleId = CRUY, potential = 6, stage3 = false } = {}) {
|
||||
// The mode's tier-5 elite only exposes module stage 1. Exercise its stage-3 talent separately using the
|
||||
// official CRU-Y blackboard (battle_equip_table, 2026-10-09); do not change the production slot's module level.
|
||||
const kits = stage3 ? { chess_char_5_05_a: (bb, raw, def) => {
|
||||
const rec = structuredClone(raw);
|
||||
rec.talents.find((t) => t.index === 1).bb = {
|
||||
max_stack_cnt: potential === 6 ? 10 : 9, max_hp: 150, atk: 38,
|
||||
'ulpia_t_1[abyssal].max_hp': 90, 'ulpia_t_1[abyssal].atk': 22.799999,
|
||||
'ulpia_t_1[abyssal].max_stack_cnt': potential === 6 ? 10 : 9,
|
||||
block_cnt: 1, add_block_cnt_stack_cnt: 9,
|
||||
};
|
||||
return KITS.chess_char_5_05_a(bb, rec, def);
|
||||
} } : undefined;
|
||||
const h = makeBattle({ autoFinish: false, kits, defs: { enemies: { dummy: target, victim: enemyRec({ key: 'victim', hp: 1, atk: 0, speed: 0 }) } },
|
||||
units: [{ uid: 1, chessId: 'chess_char_5_05_b', row: 10, col: 5, moduleId, skillIndex: 0, potential },
|
||||
{ uid: 2, chessId: 'chess_char_3_05_a', row: 11, col: 5 },
|
||||
{ uid: 3, chessId: 'chess_char_1_01_a', row: 9, col: 5 }] });
|
||||
h.step(); return { h, u: h.unit(1), hunter: h.unit(2), other: h.unit(3) };
|
||||
}
|
||||
|
||||
test('乌尔比安 CRU-Y scales damage against enemies blocked by any ally, including skill damage', () => {
|
||||
const { h, u, hunter } = ulpia();
|
||||
const e = h.spawn('dummy', { pos: [10, 7] });
|
||||
const amount = () => h.b.dealDamage(u, e, { amount: 100, type: 'phys', isSkill: true });
|
||||
approx(amount(), 100);
|
||||
e.blockedBy = hunter; hunter.blocking.push(e);
|
||||
approx(amount(), 110);
|
||||
e.blockedBy = null; hunter.blocking.length = 0;
|
||||
checkInvariants(h.b); assert.equal(h.b.errors.length, 0);
|
||||
});
|
||||
|
||||
test('乌尔比安 CRU-Y hunters share kill stacks; block +1 at nine, potential cap ten, other operators do not trigger it', () => {
|
||||
for (const potential of [1, 6]) {
|
||||
const { h, u, hunter, other } = ulpia({ potential, stage3: true });
|
||||
const kill = (killer) => h.b.dealDamage(killer, h.spawn('victim', { pos: [10, 8] }), { amount: 100, type: 'true' });
|
||||
kill(other); assert.equal(u.findBuff('ulpia:blood'), null);
|
||||
const block = u.s.blockCnt;
|
||||
for (let n = 1; n <= 12; n++) {
|
||||
kill(hunter);
|
||||
assert.equal(u.findBuff('ulpia:blood')?.stacks, Math.min(n, potential === 6 ? 10 : 9));
|
||||
assert.equal(u.s.blockCnt, block + (n >= 9 ? 1 : 0));
|
||||
}
|
||||
assert.ok(hunter.findBuff('ulpia:bloodShare'));
|
||||
checkInvariants(h.b); assert.equal(h.b.errors.length, 0);
|
||||
}
|
||||
});
|
||||
|
||||
test('乌尔比安 without the new module still only gains stacks from his own kills', () => {
|
||||
const { h, u, hunter } = ulpia({ moduleId: 'none' });
|
||||
h.b.dealDamage(hunter, h.spawn('victim', { pos: [10, 8] }), { amount: 100, type: 'true' });
|
||||
assert.equal(u.findBuff('ulpia:blood'), null);
|
||||
h.b.dealDamage(u, h.spawn('victim', { pos: [10, 8] }), { amount: 100, type: 'true' });
|
||||
assert.equal(u.findBuff('ulpia:blood').stacks, 1);
|
||||
checkInvariants(h.b); assert.equal(h.b.errors.length, 0);
|
||||
});
|
||||
|
||||
|
||||
test('乌尔比安 CRU-Y counts a withdrawn hunter’s delayed credited kill only while Ulpianus is deployed', () => {
|
||||
const { h, u, hunter } = ulpia({ stage3: true });
|
||||
h.b.retreat(hunter, { permanent: true });
|
||||
h.b.dealDamage(hunter, h.spawn('victim', { pos: [10, 8] }), { amount: 100, type: 'true' });
|
||||
assert.equal(u.findBuff('ulpia:blood')?.stacks, 1);
|
||||
h.b.retreat(u, { permanent: true });
|
||||
h.b.dealDamage(hunter, h.spawn('victim', { pos: [10, 8] }), { amount: 100, type: 'true' });
|
||||
assert.ok((u.findBuff('ulpia:blood')?.stacks ?? 0) <= 1);
|
||||
checkInvariants(h.b); assert.deepEqual(h.b.errors, []);
|
||||
});
|
||||
@@ -0,0 +1,153 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { makeBattle, enemyRec, checkInvariants } from '../helpers/battleHarness.js';
|
||||
import { KITTED_CHARS } from '../../server/sim/content/kits/index.js';
|
||||
import { diyPool } from '../../shared/diy.js';
|
||||
import { performAttack, effectiveProfile } from '../../server/sim/ai.js';
|
||||
const C = 'char_4231_clemnt';
|
||||
const data = Object.fromEntries(['chess', 'backups'].map((f) => [f, JSON.parse(readFileSync(new URL(`../../data/${f}.json`, import.meta.url)))]));
|
||||
const approx = (a, b, label = '') => assert.ok(Math.abs(a - b) < 1e-5 * Math.max(1, Math.abs(b)), `${label}: ${a} != ${b}`);
|
||||
const enemy = (key, opts = {}) => enemyRec({ key, hp: 1e8, atk: 0, speed: 0, ...opts });
|
||||
const defs = { enemies: { dummy: enemy('dummy'), light: enemy('light', { mass: 3 }), heavy: enemy('heavy', { mass: 9 }),
|
||||
fly: enemy('fly', { motion: 'FLY' }), zero: enemy('zero', { mass: 0 }), armored: enemy('armored', { def: 100 }) } };
|
||||
function field({ tier = 6, elite = true, skill = 0, potential = 6, dir = 'RIGHT', row = 10, col = 3 } = {}) {
|
||||
const h = makeBattle({ seed: 23, autoFinish: false, timeLimit: 180, defs,
|
||||
hooks: ['damaged', 'attack', 'elementBurst', 'ammoUsed'], captureNoisy: true,
|
||||
units: [{ uid: 1, diy: { slot: tier, charId: C, skillIndex: skill }, elite, potential, row, col, dir }] });
|
||||
h.step(); return { h, u: h.unit(1) };
|
||||
}
|
||||
function done(h) { checkInvariants(h.b); assert.deepEqual(h.b.errors, []); }
|
||||
function start(u) { u.skill.gainSp(999, 'init'); assert.equal(u.skill.activate('test'), true); }
|
||||
const hits = (h, tag) => h.hooksOf('damaged').filter((c) => c.dmg?.tags?.includes(tag));
|
||||
|
||||
test('克莱门莎 is selectable with authored skills in both slots, every form and potential', () => {
|
||||
assert.ok(KITTED_CHARS.includes(C));
|
||||
for (const tier of [5, 6]) {
|
||||
assert.ok(diyPool(tier, { data, kitted: KITTED_CHARS }).includes(C));
|
||||
for (const elite of [false, true]) for (const skill of [0, 1, 2]) for (const potential of [1, 6]) {
|
||||
const { h, u } = field({ tier, elite, skill, potential });
|
||||
assert.equal(u.def.charId, C); assert.equal(u.kit.skillSource, 'skills'); assert.ok(!u.kit.generic);
|
||||
assert.equal(u.skill.id, `skchr_clemnt_${skill + 1}`);
|
||||
assert.deepEqual([u.profile.dmgType, u.profile.canHitFly, u.s.blockCnt, u.base.bat], ['phys', false, 2, 1.2]);
|
||||
assert.ok(u.def.bonds.includes('egirShip'));
|
||||
assert.equal(u.skill.rule, skill ? 'ACTIVE_RANGE' : 'DEFAULT');
|
||||
done(h);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('生死定夺 checks current versus initial DEF for each physical hit; scales before DEF, never elemental damage', () => {
|
||||
for (const potential of [1, 3, 6]) {
|
||||
const { h, u } = field({ potential });
|
||||
const e = h.spawn('armored', { pos: [10, 6] }); h.b.rng = () => 0.3;
|
||||
approx(h.b.dealDamage(u, e, { amount: 1000, type: 'phys' }), 900);
|
||||
h.b.addBuff(e, { key: 'test:def', mods: { defFlat: -50 } });
|
||||
approx(h.b.dealDamage(u, e, { amount: 1000, type: 'phys' }), 1000 * (potential >= 3 ? 1.5 : 1.35) - 50);
|
||||
approx(h.b.dealDamage(u, e, { amount: 1000, type: 'elemental' }), 1000);
|
||||
const z = h.spawn('dummy', { pos: [10, 7] }); h.b.addBuff(z, { key: 'test:def', mods: { defFlat: -50 } });
|
||||
approx(h.b.dealDamage(u, z, { amount: 1000, type: 'phys' }), 1000);
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('习得性防御 handles all facings, boundary tiles, blocked enemies, seamonsters, and damage types', () => {
|
||||
for (const dir of ['RIGHT', 'LEFT', 'UP', 'DOWN']) {
|
||||
const { h, u } = field({ dir, col: 5 });
|
||||
const e = h.spawn('dummy', { pos: [10, 5] });
|
||||
const take = (type = 'arts') => { u.hp = u.s.maxHp; return h.b.dealDamage(e, u, { amount: 100, type }); };
|
||||
approx(take(), 100 * 0.9 * 0.65); // same tile/column belongs to the forward half-plane
|
||||
const [dr, dc] = { RIGHT: [0, 1], LEFT: [0, -1], UP: [1, 0], DOWN: [-1, 0] }[dir];
|
||||
e.x = 5 - dc; e.y = 10 - dr; approx(take(), 90);
|
||||
e.blockedBy = u; u.blocking.push(e); approx(take(), 90 * 0.65);
|
||||
e.def = { ...e.def, tags: ['seamonster'] }; approx(take(), 90 * 0.45);
|
||||
approx(take('true'), 100); approx(take('elemental'), 100);
|
||||
e.blockedBy = null; u.blocking.length = 0; done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('冲蚀 is every fourth attack and fills erosion from actual post-mitigation damage, with no air target', () => {
|
||||
for (const elite of [false, true]) {
|
||||
const { h, u } = field({ elite }); const e = h.spawn('dummy', { pos: [10, 4] }); h.b.rng = () => 0.99;
|
||||
h.run(5);
|
||||
const dealt = h.hooksOf('damaged').filter((c) => c.source === u && c.dmg.isAttack);
|
||||
assert.ok(dealt.length >= 4);
|
||||
dealt.forEach((c, i) => assert.equal(c.dmg.isSkill, i % 4 === 3));
|
||||
const r = hits(h, 'clemnt:rider'); assert.ok(r.length > 0);
|
||||
const first = dealt.find((c) => c.dmg.isSkill);
|
||||
approx(r[0].amount, first.amount * (elite ? 0.3 : 0.25));
|
||||
assert.ok(e.elem.erosion > 0); done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('风暴潮 carries at most eight total weight, excludes flyers/self-bound enemies and releases after three tiles', () => {
|
||||
const { h, u } = field({ skill: 1 });
|
||||
const es = [0, 1, 2].map(() => h.spawn('light', { pos: [10, 4] }));
|
||||
const heavy = h.spawn('heavy', { pos: [10, 4] }), fly = h.spawn('fly', { pos: [10, 4] });
|
||||
const bound = h.spawn('zero', { pos: [10, 4] }); h.b.addBuff(bound, { key: 'test:bound', flags: { selfBound: true, noMove: true } });
|
||||
start(u); assert.ok(u.s.flags.disarm); h.run(0.7);
|
||||
assert.equal(u.mem.clemntCabin.passengers.length, 2);
|
||||
assert.equal(u.mem.clemntCabin.mass, 2);
|
||||
assert.ok(es[0].s.flags.unblockable && es[0].s.flags.disarm);
|
||||
for (const e of [heavy, fly, bound]) assert.ok(!u.mem.clemntCabin.passengers.includes(e));
|
||||
h.run(0.9); assert.ok(u.mem.clemntCabin.stopped); approx(u.mem.clemntCabin.x, 6);
|
||||
assert.ok(!u.s.flags.disarm); assert.ok(!es[0].s.flags.unblockable);
|
||||
approx(es[0].x, 6); done(h);
|
||||
});
|
||||
|
||||
test('风暴潮 caps passengers at fifteen and cleans them on early skill end', () => {
|
||||
const { h, u } = field({ skill: 1 });
|
||||
for (let n = 0; n < 20; n++) h.spawn('zero', { pos: [10, 4] });
|
||||
start(u); h.run(0.4); assert.equal(u.mem.clemntCabin.passengers.length, 15);
|
||||
const es = [...u.mem.clemntCabin.passengers]; u.skill.stop();
|
||||
assert.ok(es.every((e) => !e.s.flags.disarm && !e.s.flags.unblockable && !e.s.flags.noMove));
|
||||
assert.equal(u.mem.clemntCabin, null); done(h);
|
||||
});
|
||||
|
||||
test('风暴潮 stops before a blocked tile; vortex keeps its continuous stop point, hits air and applies normal erosion resistance', () => {
|
||||
const { h, u } = field({ skill: 1 }); h.b.grid.setObstacle(10, 5, true);
|
||||
const fly = h.spawn('fly', { pos: [10, 5.55] });
|
||||
fly.def = { ...fly.def, epResistance: 99 };
|
||||
start(u); h.run(0.7); assert.ok(u.mem.clemntCabin.stopped);
|
||||
approx(u.mem.clemntCabin.x, 4.1); h.run(1.1);
|
||||
approx(fly.findBuff(`clemnt:vortex:${u.id}`).mods.moveMul, 0.3); approx(fly.elem.erosion, 10); // damage formula's 5% floor at 99 resistance
|
||||
assert.ok(hits(h, 'clemnt:vortex').some((c) => c.target === fly)); done(h);
|
||||
});
|
||||
|
||||
test('风暴潮 normal attack hits five ground enemies in total, never all neighbours or a flyer', () => {
|
||||
const { h, u } = field({ skill: 1 }); start(u); h.run(1.6);
|
||||
const es = Array.from({ length: 9 }, () => h.spawn('heavy', { pos: [10, 4] }));
|
||||
const fly = h.spawn('fly', { pos: [10, 4] });
|
||||
const before = h.hooksOf('damaged').length;
|
||||
performAttack(h.b, u, effectiveProfile(u), [es[0]]);
|
||||
const victims = new Set(h.hooksOf('damaged').slice(before).filter((c) => c.dmg.isAttack).map((c) => c.target));
|
||||
assert.equal(victims.size, 5); assert.ok(!victims.has(fly)); done(h);
|
||||
});
|
||||
|
||||
test('与海为敌 normal attacks hit three and spend no ammunition; remote erosion bursts fire three cross-shaped mixed hits', () => {
|
||||
const { h, u } = field({ skill: 2 }); start(u); h.b.rng = () => 0.99;
|
||||
const close = Array.from({ length: 3 }, () => h.spawn('dummy', { pos: [10, 4] }));
|
||||
performAttack(h.b, u, effectiveProfile(u), close);
|
||||
assert.equal(u.skill.ammoLeft, 10);
|
||||
const remote = h.spawn('dummy', { pos: [11, 9] }), near = h.spawn('dummy', { pos: [12, 9] });
|
||||
const diagonal = h.spawn('dummy', { pos: [12, 8] }), fly = h.spawn('fly', { pos: [11, 9] });
|
||||
h.b.dealDamage(u, remote, { amount: 1000, type: 'element', element: 'erosion' }); h.step();
|
||||
assert.equal(u.skill.ammoLeft, 9); u.skill.stop(); h.run(2.6);
|
||||
const bombs = hits(h, 'clemnt:bomb');
|
||||
for (const e of [remote, near]) {
|
||||
assert.equal(bombs.filter((c) => c.target === e && c.type === 'phys').length, 3);
|
||||
assert.equal(bombs.filter((c) => c.target === e && c.type === 'elemental').length, 3);
|
||||
}
|
||||
assert.ok(!bombs.some((c) => c.target === diagonal || c.target === fly)); done(h);
|
||||
});
|
||||
|
||||
test('与海为敌 selects nearest marked enemy, suppresses duplicate bombing tiles and does not mark air or sleeping units', () => {
|
||||
const { h, u } = field({ skill: 2 }); start(u);
|
||||
const far = h.spawn('dummy', { pos: [12, 9] }), near = h.spawn('dummy', { pos: [11, 7] });
|
||||
const same = h.spawn('dummy', { pos: [11, 7] }), fly = h.spawn('fly', { pos: [11, 8] });
|
||||
const asleep = h.spawn('dummy', { pos: [11, 6] }); h.b.applyStatus(asleep, 'sleep', { duration: 5 });
|
||||
for (const target of [far, near, same, fly, asleep]) h.b.emit('elementBurst', { source: null, target, element: 'erosion' });
|
||||
h.step(); assert.equal(u.skill.ammoLeft, 9); assert.ok(!u.mem.clemntBombs.marks.has(near));
|
||||
h.step(); assert.equal(u.skill.ammoLeft, 8); assert.ok(!u.mem.clemntBombs.marks.has(far));
|
||||
h.run(1.1); assert.equal(u.skill.ammoLeft, 8); assert.equal(u.mem.clemntBombs.marks.size, 0); done(h);
|
||||
});
|
||||
Reference in new issue
Block a user