From f4b826fe28383abf1a0ae85c9a32f98a6333395a Mon Sep 17 00:00:00 2001 From: sganggs Date: Tue, 6 Oct 2026 00:00:14 +0800 Subject: [PATCH] =?UTF-8?q?feedback5=20O2:=20=E8=87=AA=E9=80=89=20operator?= =?UTF-8?q?=20kits=20for=20=E8=89=BE=E9=9B=85=E6=B3=95=E6=8B=89,=20?= =?UTF-8?q?=E5=88=BB=E4=BF=84=E6=9F=8F=20and=20=E9=9C=8D=E5=B0=94=E6=B5=B7?= =?UTF-8?q?=E9=9B=85=20=E2=80=94=20every=20skill,=20talent,=20trait=20and?= =?UTF-8?q?=20module=20(stages=201=20and=203)=20at=20every=20form,=20with?= =?UTF-8?q?=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - kits/ops/op-amgoat.js (艾雅法拉): S1 二重咏唱 (ATK from the second cast of a deployment), S2 点燃 (main target's RES cut first, ½ explosion r1.5 on all, ½ again on the main target), S3 火山 (x-3, −1.1 s, lava on random 4 / 5 enemies), 炎息 aura (CCR-X Lv3 携带时 22 %), 乱火 deploy SP (CCR-Y Lv3 ASPD, maxima with an elite / leader in range), CCR-X RES ignore, CCR-Y SP per hit on an elite / leader. - kits/ops/op-cerber.js (刻俄柏): S1 unblocked first + 束缚, S2 interval ×0.6 / ×0.4 highest DEF, S3 3-3 physical lowest DEF + silence, 剥壳 DEF × ratio arts (CCR-X Lv3 ramp 50 → 75 %), 独行长路 x-5 incl. PRTS's enemy-like-ally rule (CCR-Y Lv3: decided per deployment). - kits/ops/op-heyak.js (霍尔海雅): S1 two targets / single-target 浮空, S2 nine random shots with 浮空 rolls, S3 three whirlwinds (PRTS speed 1, 1x1 box, 5 tiles, 1.77 s ramp, away rules), 传承终焉 (lifts resolve first), 曾有羽翼 失重 / CCR-Y Lv3 法术脆弱; ISW-A: attributes and 传承终焉 numbers only (its trait and hidden talents are validInGameTag roguelike). - kits/index.js: the three files appended to OPERATOR_KIT_FILES (one line per file). - Golden: only the diy family moved — diy-003 … diy-006 re-packed and diy-007 … diy-013 new, because the diy family fields every kitted owned 6★ in every form × module × skill (the three new operators, then the prototypes); diy-001 / 002 and every other family (roster, bonds, fields, matches, standins) byte-identical. test/golden/README.md counts updated (13 diy battles, 61 of 157 fast). - Reported, not changed: 艾雅法拉 S3's data trigger is SKILL_RANGE (攻击范围增大 escapes build-data's ATTACK_RANGE_CHANGE). --- server/sim/content/kits/index.js | 7 +- server/sim/content/kits/ops/op-amgoat.js | 192 +++++++++ server/sim/content/kits/ops/op-cerber.js | 180 +++++++++ server/sim/content/kits/ops/op-heyak.js | 275 +++++++++++++ test/content/op_amgoat.test.js | 330 ++++++++++++++++ test/content/op_cerber.test.js | 294 ++++++++++++++ test/content/op_heyak.test.js | 362 +++++++++++++++++ test/golden/README.md | 4 +- test/golden/diy.json | 479 ++++++++++++++++++----- 9 files changed, 2020 insertions(+), 103 deletions(-) create mode 100644 server/sim/content/kits/ops/op-amgoat.js create mode 100644 server/sim/content/kits/ops/op-cerber.js create mode 100644 server/sim/content/kits/ops/op-heyak.js create mode 100644 test/content/op_amgoat.test.js create mode 100644 test/content/op_cerber.test.js create mode 100644 test/content/op_heyak.test.js diff --git a/server/sim/content/kits/index.js b/server/sim/content/kits/index.js index b47d568b..71486e65 100644 --- a/server/sim/content/kits/index.js +++ b/server/sim/content/kits/index.js @@ -78,7 +78,12 @@ export const STANDIN_KIT_FILES = Object.freeze(['standin-acguad.js', 'standin-sh * The 自选 operator kit files (`ops/op-.js`, registry key = the operator's charId, an owned-6★ pick of * data/backups.json; a new file is appended). An operator without a file is not offered as a 自选 pick (KITTED_CHARS). */ -export const OPERATOR_KIT_FILES = Object.freeze(['op-siege.js']); +export const OPERATOR_KIT_FILES = Object.freeze([ + 'op-siege.js', + 'op-amgoat.js', + 'op-cerber.js', + 'op-heyak.js', +]); /** * The 预备干员 whose every skill the generic kit covers exactly (冲锋号令, 攻击力 / 防御力 / 治疗强化, 战术咏唱, 一击即退 — diff --git a/server/sim/content/kits/ops/op-amgoat.js b/server/sim/content/kits/ops/op-amgoat.js new file mode 100644 index 00000000..891d2e5a --- /dev/null +++ b/server/sim/content/kits/ops/op-amgoat.js @@ -0,0 +1,192 @@ +// server/sim/content/kits/ops/op-amgoat.js — 艾雅法拉 (char_180_amgoat) 自选 operator kit: 6★ 中坚术师 (术师), an owned-6★ +// pick of the tier-5 and tier-6 自选 slots; every skill, both talents, the trait and both modules at every form. +// Kit contract and the 自选 rules: ../README.md ("How to add an operator (自选)"). +// +// Forms (data/backups.json units.char_180_amgoat, the DIY slot statuses): normal = E2 Lv1, skills at rank 4, no module; +// elite = E2 Lv60, rank 7, the picked module at stage 1 (tier 5) or 3 (tier 6). Potential 0 [ASSUMED: no account]. +// Sources: character_table / skill_table / battle_equip_table (zh_CN, as built into backups.json; every module part is +// valid outside 集成战略 — no `validInGameTag`) and PRTS 艾雅法拉 (S1 备注 "每次部署艾雅法拉时,重新计算该技能的使用次数"; +// S2 备注 "爆炸范围为半径1.5", "技能实际效果为先削减主攻击目标的法术抗性,再对爆炸范围内所有敌人造成½倍率的伤害(包括主攻击目标), +// 最后对主攻击目标额外造成一次½倍率的伤害", 法术抗性 "{{**|80%|-20%}}" = a multiplier; S3 "攻击间隔大幅度缩短(-1.1)"; +// 乱火's hidden 备注 "在最小值与最大值之间随机生成一个浮点数后向下取整"). +// - Trait (中坚术师) "攻击造成法术伤害": the profession default (ranged arts, hits air, block 1). Module CCR-X “错过的声音” +// adds "无视目标10点法术抗性" (trait bb magic_resist_penetrate_fixed: a permanent resIgnoreFlat), CCR-Y “宠物大赛第一名” +// "普通攻击命中精英或领袖敌人时获得1点技力" (trait bb sp: per hit of one of her attacks on an elite / leader — the S2 +// explosion's splash and its second ½ are not further 命中 [ASSUMED]; a running timed skill takes no SP, as always). +// - T1 炎息 "在场时,所有友方【术师】职业干员的攻击力+14%": an aura on every 【术师】 operator of the field (her included) while +// she is deployed (installAura, the kits' convention for field-wide talents; several sources keep the strongest). CCR-X +// stage 2+ turns it into "携带时…+22%" (the module talent's bb): the same aura whether she is on the field or not — she +// is carried while she belongs to the battle, knocked out or waiting to redeploy included. +// - T2 乱火 "部署后立即随机获得7~15点技力" (bb sp_min 7, sp_max 16): floor(uniform [sp_min, sp_max)) SP at every deployment +// (PRTS hidden 备注). CCR-Y stage 3 adds "并随机提升6~15的攻击速度" (attack_speed_min / _max, the same draw) for that +// deployment [ASSUMED: no duration given — until she leaves the field], and with `factor` "部署后范围内存在精英或领袖敌人时, +// 获得的技力和提升的攻击速度取最大值": an elite or leader enemy in her attack range at that deployment gives the text's +// maxima, 15 SP / 15 ASPD — the blackboard maxima are the exclusive bounds of the draw (stage 2's attack_speed_max 1 +// with no ASPD in its text says so) [ASSUMED: 取最大值 = the largest value the draw yields; checked at the deployment +// instant — at the battle start no enemy is on the field yet]. +// - S1 二重咏唱 (MANUAL, 25 s, data DEFAULT): ASPD +[a].attack_speed; from the second cast of a deployment on, ASPD +// +[b].attack_speed and ATK +[b].atk (PRTS 备注: the count restarts at every deployment). +// - S2 点燃 (AUTO, 可充能 2, data DEFAULT): the next attack, on impact — the main target's RES ×(1 + magic_resistance) for +// `duration` s first, then an explosion of radius 1.5 around it (a 中点判定 splash) dealing atk_scale × ATK arts to +// every enemy in it, the main target included, each of the others then getting the same RES cut, and last +// atk_scale_2 × ATK arts to the main target again (the PRTS 备注's order; it names the main target's cut only as +// coming first, so the others' cut follows their hit [ASSUMED]; the cut is "同名效果取最高" through applyStrongest). +// The explosion reaches air units and skips enemies an area effect cannot select (foesInRadius); like the engine's +// profession splash it can be dodged. +// - S3 火山 (MANUAL, 15 s): ATK +atk, attack interval base_attack_time (−1.1 s flat on her 1.6 s), the attack range x-3 +// while it runs, each attack throws lava at attack@max_target enemies of that range drawn at random (all of them when +// fewer) — one projectile each, no splash [ASSUMED: the text names none]. Trigger: the data's SKILL_RANGE on +// x-3 — its text says "攻击范围增大", which tools/build-data.mjs ATTACK_RANGE_CHANGE does not list, so the owner's +// ACTIVE_RANGE rule did not reach it (reported; the kit keeps the data rule). +// - No summon (the forms list no token). + +import { num, talentBb, traitBb, skillRec, statBuff, installAura, batMod, giveSp, onHitBy } from '../shared/tier1.js'; +import { hasHp } from '../../../damage.js'; +import { canTargetEnemy } from '../../../targeting.js'; +import { bodyInKeys } from '../../../body.js'; + +const S1 = 'skchr_amgoat_1'; +const S2 = 'skchr_amgoat_2'; +const S3 = 'skchr_amgoat_3'; +/** S2 点燃: the explosion radius (PRTS 备注 "爆炸范围为半径1.5"; no blackboard key). */ +const IGNITE_RADIUS = 1.5; +/** S3 火山's 技能范围 x-3 when the data carries no grid (range_table x-3: the tiles within 3 steps). */ +const X3 = Object.freeze([[3, 0], [2, -1], [2, 0], [2, 1], [1, -2], [1, -1], [1, 0], [1, 1], [1, 2], [0, -3], [0, -2], [0, -1], + [0, 0], [0, 1], [0, 2], [0, 3], [-1, -2], [-1, -1], [-1, 0], [-1, 1], [-1, 2], [-2, -1], [-2, 0], [-2, 1], [-3, 0]]); +/** Damage of the S2 explosion and its second ½ (not a further 命中 of the attack: CCR-Y counts the first). */ +const IGNITE_TAG = 'amgoat:ignite'; +const AURA_KEY = 'talent:amgoat:casters'; +const AURA_EVERY = 0.5; + +const bbOf = (chess, id) => skillRec(chess, id)?.bb ?? {}; +/** A 【术师】 operator (summons are never operators). */ +const isCaster = (a) => !!a && a.kind === 'op' && a.def?.profession === 'CASTER'; +/** An elite or leader enemy (精英或领袖敌人). */ +const isEliteEnemy = (e) => !!e && e.side === 'enemy' && (e.isBoss || e.def?.rank === 'ELITE' || e.def?.rank === 'BOSS'); +const tagged = (d, tag) => !!(d && d.tags && d.tags.includes(tag)); +/** A module trait that works 在集成战略中 only (ISW modules): nothing of it applies in this mode. */ +const roguelikeOnly = (chess) => /集成战略/.test(String(chess?.trait?.moduleDesc ?? '')); +/** Named talent `i` of the record (its desc tells the module stage's wording). */ +const talentRec = (chess, i) => (chess?.talents ?? []).filter((t) => t && t.index !== -1)[i] ?? null; + +/** "携带时": the aura of installAura, held while she belongs to the battle — on the field or not. */ +function carriedAura(battle, unit, { key, select, mods, value }) { + battle.every(AURA_EVERY, () => { + for (const a of battle.alliesFor(unit)) { + if (!select(a)) continue; + const cur = a.findBuff(key); + if (cur && cur.source !== unit && (cur.data?.v ?? 0) > value && cur.timeLeft > 0.05) continue; + battle.addBuff(a, { key, duration: AURA_EVERY + 0.1, mods, source: unit, data: { v: value }, tags: ['aura'] }); + } + }, { owner: unit, immediate: true }); +} + +export default { + char_180_amgoat: (bb, chess) => { + const t0 = talentBb(chess, 0), t1 = talentBb(chess, 1); + const carried = /携带时/.test(String(talentRec(chess, 0)?.desc ?? '')); + const b1 = bbOf(chess, S1), b2 = bbOf(chess, S2), b3 = bbOf(chess, S3); + const s2 = skillRec(chess, S2), s3 = skillRec(chess, S3); + const mr = num(b2.magic_resistance), resDur = num(b2.duration); + const resCut = (battle, unit, e) => { + if (e && e.alive && mr) battle.applyStrongest(e, 'amgoat:ignite', { duration: resDur, value: mr, mods: (v) => ({ resMul: Math.max(0, 1 + v) }), source: unit }); + }; + const maxLava = Math.max(1, Math.floor(num(b3['attack@max_target'], 1))); + return { + skills: { + [S1]: { + kind: 'duration', + onStart({ battle, unit }) { + // the casts of this deployment (PRTS 备注: "每次部署…重新计算该技能的使用次数") + const n = unit.mem.amgoatDuetSeq === unit.deploySeq ? num(unit.mem.amgoatDuetN) + 1 : 1; + unit.mem.amgoatDuetSeq = unit.deploySeq; + unit.mem.amgoatDuetN = n; + const mods = n >= 2 + ? { aspd: num(b1['amgoat_s_1[b].attack_speed']), atkPct: num(b1['amgoat_s_1[b].atk']) } + : { aspd: num(b1['amgoat_s_1[a].attack_speed']) }; + battle.addBuff(unit, { key: 'skill:amgoat:duet', mods, tags: ['skill'] }); + }, + onEnd({ battle, unit }) { battle.removeBuff(unit, 'skill:amgoat:duet'); }, + }, + [S2]: { + kind: num(s2?.maxChargeTime, 1) > 1 ? 'charges' : 'instant', + attack: { + // the engine's hit on the main target is its share of the explosion (½); the RES cut came first (install) + atkScale: num(b2.atk_scale, 1), + onEachHit({ battle, unit, target, kind }) { + if (kind !== 'main' || !target) return; + const atk = unit.s.atk, x = target.x, y = target.y; + for (const e of battle.foesInRadius(x, y, IGNITE_RADIUS, true)) { + if (e === target) continue; + battle.dealDamage(unit, e, { amount: atk * num(b2.atk_scale, 1), type: 'arts', isAttack: true, isSplash: true, isSkill: true, tags: [IGNITE_TAG] }); + resCut(battle, unit, e); + } + if (hasHp(target)) battle.dealDamage(unit, target, { amount: atk * num(b2.atk_scale_2, num(b2.atk_scale, 1)), type: 'arts', isAttack: true, isSkill: true, tags: [IGNITE_TAG] }); + battle.fx('explosion', { x, y, id: unit.id, r: IGNITE_RADIUS, dmgType: 'arts' }); + }, + }, + }, + [S3]: { + kind: 'duration', + mods: { atkPct: num(b3.atk), batPct: batMod(b3.base_attack_time, chess) }, + // every enemy of x-3 is a candidate; install draws the lava targets among them + targeting: { rangeGrid: s3?.rangeGrid ?? X3, allInRange: true }, + }, + }, + talents: [ + { install(battle, unit) { // 炎息: the field's 【术师】 ATK +atk — while she is deployed, or (CCR-X stage 2+) carried + const a = num(t0.atk); + if (!(a > 0)) return; + const opts = { key: AURA_KEY, value: a, select: isCaster, mods: { atkPct: a } }; + if (carried) carriedAura(battle, unit, opts); + else installAura(battle, unit, { ...opts, interval: AURA_EVERY }); + } }, + { install(battle, unit) { // 乱火: SP (and with CCR-Y stage 3 ASPD) at every deployment; the maxima with an elite in range + const spLo = num(t1.sp_min), spHi = num(t1.sp_max), asLo = num(t1.attack_speed_min), asHi = num(t1.attack_speed_max); + const maxRule = num(t1.factor) > 0; + battle.on('deploy', (ctx) => { + if (ctx.unit !== unit || !unit.alive) return; + // (a scan of the enemies: the tile index of enemiesInKeys is the last tick's) + const top = maxRule && battle.enemies.some((e) => isEliteEnemy(e) && canTargetEnemy(unit, e, unit.profile) && bodyInKeys(e, unit.rangeKeySet)); + // floor of a uniform draw in [lo, hi); "取最大值" = the largest value the draw yields (hi − 1 for integer bounds) + const draw = (lo, hi) => (hi > lo ? (top ? Math.ceil(hi) - 1 : Math.floor(battle.rng.range(lo, hi))) : 0); + const sp = draw(spLo, spHi); + if (sp > 0) giveSp(unit, sp); + const as = draw(asLo, asHi); + if (as > 0) battle.addBuff(unit, { key: 'talent:amgoat:wildfire', mods: { aspd: as }, tags: ['talent'] }); + }, { owner: unit }); + } }, + ], + install(battle, unit) { + // module traits (none on the normal form): CCR-X 无视目标10点法术抗性, CCR-Y SP per hit on an elite / leader + if (!roguelikeOnly(chess)) { + const tb = traitBb(chess); + const pen = num(tb.magic_resist_penetrate_fixed); + if (pen > 0) statBuff(battle, unit, 'trait:amgoat:resIgnore', { resIgnoreFlat: pen }); + const sp = num(tb.sp); + if (sp > 0) { + battle.on('damaged', (ctx) => { + const d = ctx.dmg; + if (ctx.source !== unit || !d || !d.isAttack || d.isSplash || tagged(d, IGNITE_TAG) || !isEliteEnemy(ctx.target)) return; + giveSp(unit, sp, 'trait'); + }, { owner: unit }); + } + } + const sid = unit.skill?.id; + if (sid === S2) { + // 点燃: "先削减主攻击目标的法术抗性" — the main target's RES cut lands before the first damage of the attack + onHitBy(battle, unit, (ctx) => { + const d = ctx.dmg; + if (d.isAttack && d.isSkill && !d.isSplash && !tagged(d, IGNITE_TAG)) resCut(battle, unit, ctx.target); + }, 50); + } else if (sid === S3) { + // 火山: "随机对攻击范围内至多N个敌人发射熔岩" — a random draw among every enemy of the range + battle.on('beforeAttack', (ctx) => { + if (ctx.attacker !== unit || !unit.skill?.active || ctx.targets.length <= maxLava) return; + ctx.targets = battle.rng.shuffle(ctx.targets.slice()).slice(0, maxLava); + }, { owner: unit }); + } + }, + }; + }, +}; diff --git a/server/sim/content/kits/ops/op-cerber.js b/server/sim/content/kits/ops/op-cerber.js new file mode 100644 index 00000000..95f3efcc --- /dev/null +++ b/server/sim/content/kits/ops/op-cerber.js @@ -0,0 +1,180 @@ +// server/sim/content/kits/ops/op-cerber.js — 刻俄柏 (char_2013_cerber) 自选 operator kit: 6★ 中坚术师 (术师), an owned-6★ +// pick of the tier-5 and tier-6 自选 slots; every skill, both talents, the trait and both modules at every form. +// Kit contract and the 自选 rules: ../README.md ("How to add an operator (自选)"). +// +// Forms (data/backups.json units.char_2013_cerber, the DIY slot statuses): normal = E2 Lv1, skills at rank 4, no module; +// elite = E2 Lv60, rank 7, the picked module at stage 1 (tier 5) or 3 (tier 6). Potential 0 [ASSUMED: no account]. +// Sources: character_table / skill_table / battle_equip_table (zh_CN, as built into backups.json; every module part is +// valid outside 集成战略 — no `validInGameTag`) and PRTS 刻俄柏 (S2 "攻击间隔缩短(*0.6)" / "较大幅度缩短(*0.4)": a ratio of the +// interval; 剥壳 备注 "处理敌人防御力时不考虑物理穿透", "每次攻击与上一次攻击相同的目标时,将提升5%的比例值(第五次后达到 +// 最大值,于剥壳伤害前处理);攻击不同目标时比例值立刻重置"; 独行长路 能力生效范围 x-5 and 备注 "天赋判定范围包括刻俄柏所在格,不判定 +// 目标的可选性、实体类型等;天赋生效期间检测到敌人类我方单位时不会主动失效,但失效期间检测到敌人类我方单位后,直到该敌人类我方单位退场前 +// 无法重新生效", "本天赋不再通过原本的判定方式生效/失效…部署时检测到敌人类我方单位也会失效"). +// - Trait (中坚术师) "攻击造成法术伤害": the profession default (ranged arts, hits air, block 1). Module CCR-X “很干的面包” +// adds "无视目标10点法术抗性" (trait bb magic_resist_penetrate_fixed: a permanent resIgnoreFlat), CCR-Y “我打的刀” +// "普通攻击命中精英或领袖敌人时获得1点技力" (trait bb sp: per hit of one of her attacks on an elite / leader; a running timed +// skill takes no SP, as always). +// - T1 剥壳 "攻击时对目标额外造成相当于其防御力40%的法术伤害": each hit of her attacks (S3's physical spear too) is followed by +// atk_scale × the target's DEF (its current DEF, her own penetration ignored — she has none) as arts damage, a damage +// instance of the talent (not an attack: no further on-hit effects). A target with no DEF takes none (PRTS: she "tries" +// and deals nothing; no flat arts bonus exists in this mode that a zero hit could carry). CCR-X stage 2+ (bb +// basic_atk_scale / delta_atk_scale / max_atk_scale): 50 % +5 % per consecutive hit on the same target, ≤ 75 %, back to +// 50 % on another target (PRTS 备注), counted from the start of each deployment [ASSUMED]. +// - T2 独行长路 "当周围四格内没有其他友方单位时,攻击力+8%,攻击速度+8": while no other ally unit (operator, summon or device — +// PRTS: no selectability / entity check) stands on her tile or the four next to it (x-5), with the 敌人类我方单位 rule +// of the 备注 (炎佑: an ally built from an enemy record; it does not switch the talent off, but one seen while it is off +// keeps it off until that unit leaves the field). CCR-Y stage 2+ ("部署时若周围四格内没有其他友方单位,攻击力+15%,攻击速度 +// +15"): checked once per deployment — an ally of either kind there switches it off for that deployment; the battle's +// initial deployment counts as one moment, every board piece already placed [ASSUMED: the pieces of the mode are on the +// board together before the battle starts; the official deploys one at a time]. +// - S1 “很冰的斧” (AUTO, 可充能 1 / 2, data DEFAULT): the next attack at atk_scale × ATK, on an enemy that nobody blocks first +// (the usual order among those, then the blocked ones), binding (束缚) it for `duration` s. +// - S2 “很热的刀” (MANUAL, 33 / 36 s, data DEFAULT): attack interval × base_attack_time (0.6 / 0.4: PRTS "(*0.4)"), the +// highest-DEF enemy first. +// - S3 “很重的枪” (MANUAL, 56 / 57 s, data ACTIVE_RANGE on 3-3): attack range 3-3 while it runs, ATK +atk, physical damage, +// the lowest-DEF enemy first, each hit silences (失去特殊能力) for attack@silence s. +// - No summon (the forms list no token). + +import { num, talentBb, traitBb, skillRec, statBuff, toggleBuff, batMod, giveSp, up } from '../shared/tier1.js'; +import { sortEnemyTargets } from '../../../targeting.js'; +import { offsetTile } from '../../../dir.js'; +import { hasHp } from '../../../damage.js'; + +const S1 = 'skchr_cerber_1'; +const S2 = 'skchr_cerber_2'; +const S3 = 'skchr_cerber_3'; +/** 独行长路's area: her tile and the four next to it (PRTS 能力生效范围 x-5; the data carries no talent grid). */ +const X5 = Object.freeze([[0, 0], [1, 0], [-1, 0], [0, 1], [0, -1]]); +/** S3's 3-3 when the data carries no grid. */ +const R33 = Object.freeze([[1, 0], [1, 1], [1, 2], [1, 3], [0, 0], [0, 1], [0, 2], [0, 3], [-1, 0], [-1, 1], [-1, 2], [-1, 3]]); +/** 剥壳's extra damage (a talent instance: never itself followed by 剥壳). */ +const SHELL_TAG = 'cerber:shell'; +const LONE_KEY = 'talent:cerber:lone'; + +const bbOf = (chess, id) => skillRec(chess, id)?.bb ?? {}; +/** An elite or leader enemy (精英或领袖敌人). */ +const isEliteEnemy = (e) => !!e && e.side === 'enemy' && (e.isBoss || e.def?.rank === 'ELITE' || e.def?.rank === 'BOSS'); +const tagged = (d, tag) => !!(d && d.tags && d.tags.includes(tag)); +/** A module trait that works 在集成战略中 only (ISW modules): nothing of it applies in this mode. */ +const roguelikeOnly = (chess) => /集成战略/.test(String(chess?.trait?.moduleDesc ?? '')); +/** Named talent `i` of the record (its desc tells the module stage's wording). */ +const talentRec = (chess, i) => (chess?.talents ?? []).filter((t) => t && t.index !== -1)[i] ?? null; +/** PRTS's 敌人类我方单位: an ally built from an enemy record (炎佑 enemy_9012_acloon, content/items/battle.js). */ +const enemyLike = (a) => /^enemy_/.test(String(a?.defId ?? a?.def?.id ?? '')); + +/** The other ally units on her x-5 (any kind — PRTS: "不判定目标的可选性、实体类型等"). */ +function othersAround(battle, unit) { + const out = []; + for (const [dr, dc] of X5) { + const [r, c] = offsetTile(unit.tileR, unit.tileC, dr, dc, unit.dir); + const o = battle.grid.inBounds(r, c) ? battle.unitAt(r, c) : null; + if (o && o !== unit && o.side === 'ally' && !out.includes(o)) out.push(o); + } + return out; +} + +export default { + char_2013_cerber: (bb, chess) => { + const t0 = talentBb(chess, 0), t1 = talentBb(chess, 1); + const onDeploy = /部署时/.test(String(talentRec(chess, 1)?.desc ?? '')); // CCR-Y stage 2+ + const b1 = bbOf(chess, S1), b2 = bbOf(chess, S2), b3 = bbOf(chess, S3); + const s1 = skillRec(chess, S1), s2 = skillRec(chess, S2), s3 = skillRec(chess, S3); + return { + skills: { + [S1]: { + kind: num(s1?.maxChargeTime, 1) > 1 ? 'charges' : 'instant', + attack: { atkScale: num(b1.atk_scale, 1), onHitStatus: { key: 'bind', duration: num(b1.duration) } }, + }, + [S2]: { + kind: 'duration', + mods: { batPct: batMod(b2.base_attack_time, chess, s2?.desc) }, + targeting: { priority: 'highDef' }, + }, + [S3]: { + kind: 'duration', + mods: { atkPct: num(b3.atk) }, + targeting: { rangeGrid: s3?.rangeGrid ?? R33, priority: 'lowDef' }, + attack: { dmgType: 'phys', onHitStatus: { key: 'silence', duration: num(b3['attack@silence']) } }, + }, + }, + talents: [ + { install(battle, unit) { // 剥壳: DEF × ratio arts after each hit; CCR-X stage 2+: the ratio climbs on the same target + const base = num(t0.basic_atk_scale, num(t0.atk_scale)), delta = num(t0.delta_atk_scale), top = num(t0.max_atk_scale, base); + if (!(base > 0)) return; + battle.on('deploy', (ctx) => { if (ctx.unit === unit) { unit.mem.cerberShellTarget = null; unit.mem.cerberShellScale = base; } }, { owner: unit }); + battle.on('damaged', (ctx) => { + const t = ctx.target, d = ctx.dmg; + if (ctx.source !== unit || !t || t.side !== 'enemy' || !d || !d.isAttack || d.isSplash || tagged(d, SHELL_TAG)) return; + let sc = base; + if (delta > 0) { + // "于剥壳伤害前处理": the same target as her previous hit +delta (≤ max), another one back to the base + sc = unit.mem.cerberShellTarget === t ? Math.min(top, num(unit.mem.cerberShellScale, base) + delta) : base; + unit.mem.cerberShellTarget = t; + unit.mem.cerberShellScale = sc; + } + const def = t.s.def; + if (def > 0 && hasHp(t)) battle.dealDamage(unit, t, { amount: def * sc, type: 'arts', tags: [SHELL_TAG] }); + }, { owner: unit }); + } }, + { install(battle, unit) { // 独行长路 + const mods = { atkPct: num(t1.atk), aspd: num(t1.attack_speed) }; + if (!mods.atkPct && !mods.aspd) return; + if (onDeploy) { + // CCR-Y stage 2+: the deployment's check, for the whole deployment + const check = () => { + if (!up(unit)) return; + if (othersAround(battle, unit).length) battle.removeBuff(unit, LONE_KEY); + else battle.addBuff(unit, { key: LONE_KEY, mods, tags: ['talent'] }); + }; + battle.on('battleStart', check, { owner: unit }); + battle.on('deploy', (ctx) => { if (ctx.unit === unit && battle.started) check(); }, { owner: unit }); + return; + } + // the base talent, checked every tick: an ordinary ally switches it off; an enemy-like one seen while it is off + // keeps it off until that unit leaves the field + let on = false; + const locks = new Set(); + battle.on('tick', () => { + if (!up(unit)) { on = false; locks.clear(); return; } + const near = othersAround(battle, unit); + if (on && near.some((a) => !enemyLike(a))) on = false; + if (!on) { + for (const a of near) if (enemyLike(a)) locks.add(a); + for (const a of locks) if (!a.alive || !a.deployed) locks.delete(a); + if (!near.length && !locks.size) on = true; + } + }, { owner: unit, priority: 1 }); + toggleBuff(battle, unit, LONE_KEY, () => on, mods); + } }, + ], + install(battle, unit) { + // module traits (none on the normal form): CCR-X 无视目标10点法术抗性, CCR-Y SP per hit on an elite / leader + if (!roguelikeOnly(chess)) { + const tb = traitBb(chess); + const pen = num(tb.magic_resist_penetrate_fixed); + if (pen > 0) statBuff(battle, unit, 'trait:cerber:resIgnore', { resIgnoreFlat: pen }); + const sp = num(tb.sp); + if (sp > 0) { + battle.on('damaged', (ctx) => { + const d = ctx.dmg; + if (ctx.source !== unit || !d || !d.isAttack || d.isSplash || !isEliteEnemy(ctx.target)) return; + giveSp(unit, sp, 'trait'); + }, { owner: unit }); + } + } + if (unit.skill?.id === S1) { + // “很冰的斧” "优先攻击没有被阻挡的目标": the pending attack re-picks its target, unblocked enemies first + battle.on('beforeAttack', (ctx) => { + if (ctx.attacker !== unit || !ctx.isSkill || !ctx.targets.length) return; + const prof = ctx.profile; + const cands = battle.enemiesInKeys(unit.rangeKeys, unit, prof); + for (const e of battle.blockedTargets(unit, prof)) if (!cands.includes(e)) cands.push(e); + if (!cands.length) return; + sortEnemyTargets(battle, unit, cands, prof.priority); + ctx.targets = [cands.find((e) => !e.blockedBy) ?? cands[0]]; + }, { owner: unit }); + } + }, + }; + }, +}; diff --git a/server/sim/content/kits/ops/op-heyak.js b/server/sim/content/kits/ops/op-heyak.js new file mode 100644 index 00000000..29e60eb4 --- /dev/null +++ b/server/sim/content/kits/ops/op-heyak.js @@ -0,0 +1,275 @@ +// server/sim/content/kits/ops/op-heyak.js — 霍尔海雅 (char_4027_heyak) 自选 operator kit: 6★ 中坚术师 (术师), an owned-6★ +// pick of the tier-5 and tier-6 自选 slots; every skill, both talents, the trait and the three modules at every form. +// Kit contract and the 自选 rules: ../README.md ("How to add an operator (自选)"). +// +// Forms (data/backups.json units.char_4027_heyak, the DIY slot statuses): normal = E2 Lv1, skills at rank 4, no module; +// elite = E2 Lv60, rank 7, the picked module at stage 1 (tier 5) or 3 (tier 6). Potential 0 [ASSUMED: no account]. +// Sources: character_table / skill_table / battle_equip_table (zh_CN, as built into backups.json) and PRTS 霍尔海雅 +// (传承终焉 备注 "技能触发的浮空效果于本天赋结算前进行结算"; S1 备注 "“仅攻击到1名目标”仅判定实际发射的弹道数"; S3 备注 "攻击以自身格 +// 中心处为准,于此处、左1.0、右1.0格在0~0.3s内随机延迟后生成三股旋风", "移动速度1.0,碰撞范围为1×1的正方形,旋风移动至5格远处中心点 +// 自然消失,造成伤害时实时应用霍尔海雅的当前攻击力", "旋风在生成后1.77s内,攻击倍率由最低值线性递增至最大值", "霍尔海雅离场时已存在的旋风 +// 不会因此立刻消失,但其命中敌人时不享受模组加成,不触发第一天赋"). +// - Trait (中坚术师) "攻击造成法术伤害": the profession default (ranged arts, hits air, block 1). Module CCR-X “图书馆” adds +// "无视目标10点法术抗性" (trait bb magic_resist_penetrate_fixed: a permanent resIgnoreFlat), CCR-Y “羽蛇的时间博物馆” +// "普通攻击命中精英或领袖敌人时获得1点技力" (trait bb sp: per hit of one of her attacks on an elite / leader; a running timed +// skill takes no SP). ISW-A “霍尔海雅特限证章”: its trait "在集成战略中,无视目标10点法术抗性,每个敌人首次进入目标点所在地块时,恢复 +// 自身30%的技力" and its hidden talents (首次部署 1 点临时目标生命值, the goal-tile 浮空 15 s, stage 3's radius-1.1 skill +// splash "自身技能会对敌人及其周围的目标同时造成浮空效果和伤害效果") are battle_equip_table parts with `validInGameTag: +// roguelike` — N/A here; what applies is its stats and, at stage 2+, 传承终焉's new numbers (a TALENT_DATA_ONLY part with +// no game tag: 145 % / 5 s at stage 3). +// - T1 传承终焉 "攻击空中目标时攻击力提升至120%,并使其特殊能力失效3秒": every hit of her attacks on an air unit (flying, 近地悬浮 +// or 浮空) at the hit is × atk_scale and silences it for `silence` s. Her skills' 浮空 of that very hit resolve first (PRTS +// 备注), so a target her S1 / S2 / S3 lifts takes the ×atk_scale of that hit: the S1 / S2 lifts land in the hit's `hit` +// step, ahead of this talent (a dodged hit has lifted already [ASSUMED]). CCR-X stage 3: 135 % / 5 s, ISW-A stage 3: +// 145 % / 5 s (the talent's merged bb). +// - T2 曾有羽翼 "攻击范围内所有生命值高于80%的敌人失重": every enemy of her current attack range (a running S3's included) above +// hp_ratio of its HP is 失重 (weight −1 level, 同名效果不可叠加: none of hers while another source's 失重 is on it), off +// again at once below it or outside the range. CCR-Y stage 3 lowers it to 50 % and adds "生命值低于50%的敌人获得20%的 +// 【法术脆弱】" (its hidden talent: damage_scale 1.2, hp_ratio 0.5): the 法术脆弱 status, renewed every 0.2 s for 0.3 s +// (as 史尔特尔 AFT-Y's). +// - S1 但为求索 (AUTO, 可充能 1 / 2, data DEFAULT): the next attack hits one more target (2), atk_scale × ATK arts each; when +// it fires at one target only it lifts it (浮空) `levitate` s — counted at the shot (PRTS 备注). +// - S2 群星逶迤 (MANUAL, 16 s, data DEFAULT): each attack becomes SHOTS (9, the text's "9连发"; no blackboard key) shots of +// attack@atk_scale × ATK, each at a random enemy of her range (independent draws), each with attack@prob to lift it +// attack@levitate s [ASSUMED: the nine leave with the attack; the burst's spacing is not modelled]. +// - S3 博览者的狂语 (MANUAL, 45 s, data ACTIVE_RANGE on 3-10): attack range 3-10 while it runs, attack interval +1.4 s +// (base_attack_time, flat); each attack (an enemy in that range, her attack timer) releases three whirlwinds from the +// centre of her tile and the tiles left and right of it, each after its own random 0–0.3 s delay. A whirlwind flies +// straight forward at 1 tile/s over 5 tiles (PRTS; a 1×1 square), hits the first enemy it touches — an enemy her +// attacks can select, air units too [ASSUMED] — lifting it attack@levitate s and then dealing (min + (max − min) × +// min(1, age / 1.77 s)) × her current ATK arts (attack@min_atk_scale → attack@max_atk_scale), and is gone; the nearest +// of several touched at once is hit first [ASSUMED]. A whirlwind out when she leaves the field flies on, without 传承终焉 +// and without her module's RES ignore [ASSUMED: "模组加成" = the module's trait; its attributes stay in her ATK]. +// (wiki.gg reads the end of the flight as the far end of her range, 4 tiles; PRTS's 5 is kept.) +// - No summon (the forms list no token). + +import { num, talentBb, traitBb, skillRec, statBuff, batMod, giveSp, onHitBy, up } from '../shared/tier1.js'; +import { canTargetEnemy } from '../../../targeting.js'; +import { dirVec, rotateOffset } from '../../../dir.js'; +import { bodyDist, hitRect } from '../../../body.js'; + +const S1 = 'skchr_heyak_1'; +const S2 = 'skchr_heyak_2'; +const S3 = 'skchr_heyak_3'; +/** S1 "额外攻击一个目标": the next attack's targets (no blackboard key; `cnt` is the charge count). */ +const S1_TARGETS = 2; +/** S2 "9连发": shots per attack when the text gives no number (no blackboard key). */ +const SHOTS = 9; +/** S3 whirlwinds (PRTS 备注): lanes (facing-RIGHT row offsets: her row, "左1.0", "右1.0"), spawn delay, speed, flight, box. */ +const WIND_LANES = Object.freeze([0, 1, -1]); +const WIND_DELAY = 0.3; +const WIND_SPEED = 1; +const WIND_RANGE = 5; +const WIND_HALF = 0.5; +/** "旋风在生成后1.77s内,攻击倍率由最低值线性递增至最大值". */ +const WIND_RAMP = 1.77; +/** How often a flying whirlwind is drawn again (fx 'tornado'). */ +const WIND_FX_EVERY = 0.5; +/** S3's 3-10 when the data carries no grid. */ +const R310 = Object.freeze([[1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [0, 0], [0, 1], [0, 2], [0, 3], [0, 4], [-1, 0], [-1, 1], [-1, 2], [-1, 3], [-1, 4]]); +/** A whirlwind hit after she left the field: no 传承终焉, no module trait (PRTS 备注). */ +const AWAY_TAG = 'heyak:away'; +const WEIGHTLESS_KEY = 'heyak:weightless'; +const FRAGILE_EVERY = 0.2; + +const bbOf = (chess, id) => skillRec(chess, id)?.bb ?? {}; +/** An elite or leader enemy (精英或领袖敌人). */ +const isEliteEnemy = (e) => !!e && e.side === 'enemy' && (e.isBoss || e.def?.rank === 'ELITE' || e.def?.rank === 'BOSS'); +const tagged = (d, tag) => !!(d && d.tags && d.tags.includes(tag)); +/** A module trait that works 在集成战略中 only (ISW-A): nothing of it applies in this mode. */ +const roguelikeOnly = (chess) => /集成战略/.test(String(chess?.trait?.moduleDesc ?? '')); +/** The record's active module, or null. */ +const activeModule = (chess) => (chess?.module?.active ? (chess.modules ?? []).find((m) => m && m.uniEquipId === chess.module.id) ?? null : null); +/** Does the enemy's body touch the 1×1 square centred on (x, y)? */ +function inBox(e, x, y) { + const R = hitRect(e); + if (!R) return Math.abs(e.x - x) <= WIND_HALF + 1e-9 && Math.abs(e.y - y) <= WIND_HALF + 1e-9; + return R.x0 <= x + WIND_HALF && R.x1 >= x - WIND_HALF && R.y0 <= y + WIND_HALF && R.y1 >= y - WIND_HALF; +} + +export default { + char_4027_heyak: (bb, chess) => { + const t0 = talentBb(chess, 0), t1 = talentBb(chess, 1); + const isw = roguelikeOnly(chess); + const mod = activeModule(chess); + // CCR-Y's hidden part (the 【法术脆弱】 rider); an ISW module's hidden parts are 集成战略-only + const rider = isw || !mod ? {} : Object.assign({}, ...(mod.talentChanges ?? []).filter((t) => t && t.talentIndex === -1).map((t) => t.bb ?? {})); + const tb = isw ? {} : traitBb(chess); + const pen = num(tb.magic_resist_penetrate_fixed); + const b1 = bbOf(chess, S1), b2 = bbOf(chess, S2), b3 = bbOf(chess, S3); + const s1 = skillRec(chess, S1), s2 = skillRec(chess, S2), s3 = skillRec(chess, S3); + const shots = Math.max(1, Math.floor(num(+(/(\d+)连发/.exec(String(s2?.desc ?? ''))?.[1]), SHOTS))); + + /** S3: release one attack's three whirlwinds. */ + function releaseWinds(battle, unit, winds) { + const seq = unit.deploySeq; + const [fr, fc] = dirVec(unit.dir); + const x0 = unit.tileC, y0 = unit.tileR; + for (const lane of WIND_LANES) { + const [dr, dc] = rotateOffset(lane, 0, unit.dir); + const delay = battle.rng.range(0, WIND_DELAY); + battle.after(delay, () => { + // a whirlwind not yet out when she left is never released [ASSUMED: "已存在的旋风" only fly on] + if (!(unit.alive && unit.deployed && unit.deploySeq === seq)) return; + const w = { x: x0 + dc, y: y0 + dr, dx: fc, dy: fr, left: WIND_RANGE, age: 0, fxAge: 0, seq }; + battle.fx('tornado', { x: w.x, y: w.y, id: unit.id, r: WIND_HALF, dur: WIND_FX_EVERY + 0.1 }); + if (!windHit(battle, unit, w)) winds.push(w); + }, { owner: unit }); + } + } + /** The first enemy the whirlwind touches, struck: 浮空 first (PRTS: before 传承终焉), then the damage. True when it hit. */ + function windHit(battle, unit, w) { + let best = null, bd = Infinity; + for (const e of battle.enemies) { + if (!e.alive || !inBox(e, w.x, w.y) || !canTargetEnemy(unit, e, unit.profile)) continue; + const d = bodyDist(e, w.x, w.y); + if (d < bd - 1e-9 || (Math.abs(d - bd) <= 1e-9 && best && e.spawnSeq < best.spawnSeq)) { bd = d; best = e; } + } + if (!best) return false; + const away = !(unit.alive && unit.deployed && unit.deploySeq === w.seq); + const lev = num(b3['attack@levitate']); + if (lev > 0) battle.applyStatus(best, 'levitate', { duration: lev, source: unit }); + const lo = num(b3['attack@min_atk_scale']), hi = num(b3['attack@max_atk_scale'], lo); + const scale = lo + (hi - lo) * Math.min(1, w.age / WIND_RAMP); + if (best.alive) { + battle.dealDamage(unit, best, { + amount: unit.s.atk * scale, type: 'arts', isAttack: true, isSkill: true, + ...(away ? { resIgnoreFlat: -pen, tags: [AWAY_TAG] } : null), + }); + } + battle.fx('tornadoPulse', { x: w.x, y: w.y, id: unit.id, r: WIND_HALF }); + return true; + } + + return { + skills: { + [S1]: { + kind: num(s1?.maxChargeTime, 1) > 1 ? 'charges' : 'instant', + targeting: { maxTargets: S1_TARGETS }, + attack: { atkScale: num(b1.atk_scale, 1) }, + }, + [S2]: { + kind: 'duration', + attack: { atkScale: num(b2['attack@atk_scale'], 1) }, + }, + [S3]: { + kind: 'duration', + mods: { batPct: batMod(b3.base_attack_time, chess) }, + targeting: { rangeGrid: s3?.rangeGrid ?? R310 }, + // the attack becomes the whirlwinds (onTick): her attack timer, an enemy of the skill's range, no projectile + attack: { noAttack: true }, + onTick({ battle, unit }) { + if (unit.atkCd > 0 || !unit.canAct || unit.s.flags.disarm) return; + const foes = battle.enemiesInKeys(unit.rangeKeys, unit, unit.profile); + if (!foes.length) return; + unit.atkCd = unit.s.interval; + unit.lastAttackAt = battle.time; + unit.stats.attacks++; + releaseWinds(battle, unit, unit.mem.heyakWinds); + // an attack was performed ("攻击时" content), the whirlwinds still on their way + if (battle.hasHook('attack')) battle.emit('attack', { attacker: unit, targets: foes.slice(0, 1), isSkill: true }); + }, + }, + }, + talents: [ + { install(battle, unit) { // 传承终焉: × atk_scale and 沉默 on an air unit hit by her attack + const sc = num(t0.atk_scale, 1), sil = num(t0.silence); + onHitBy(battle, unit, (ctx) => { + const d = ctx.dmg, t = ctx.target; + if (!d.isAttack || tagged(d, AWAY_TAG) || !t.isFlying) return; + if (sc !== 1) d.amount *= sc; + if (sil > 0 && t.alive) battle.applyStatus(t, 'silence', { duration: sil, source: unit }); + }); + } }, + { install(battle, unit) { // 曾有羽翼: 失重 above hp_ratio in her range; CCR-Y stage 3: 【法术脆弱】 below its hp_ratio + const hiRatio = num(t1.hp_ratio, 1); + battle.on('tick', () => { + const on = up(unit); + const inRange = on ? new Set(battle.enemiesInKeys(unit.rangeKeys, unit, { canHitFly: true })) : null; + for (const e of battle.enemies) { + if (!e.alive) continue; + // (another 霍尔海雅's 失重 carries the same key: it is hers to keep or drop) + const mine = e.findBuff(WEIGHTLESS_KEY); + const want = on && inRange.has(e) && e.hpRatio > hiRatio + 1e-9 + && !e.buffs.some((b) => b.status === 'weightless' && b.key !== WEIGHTLESS_KEY); + if (want && !mine) battle.addBuff(e, { key: WEIGHTLESS_KEY, status: 'weightless', visible: true, mods: { massFlat: -1 }, source: unit }); + else if (!want && mine && mine.source === unit) battle.removeBuff(e, mine); + } + }, { owner: unit }); + const fragile = Math.round((num(rider.damage_scale, 1) - 1) * 1e6) / 1e6, loRatio = num(rider.hp_ratio); // 1.2 → 0.2 + if (fragile > 0) { + battle.every(FRAGILE_EVERY, () => { + if (!up(unit)) return; + for (const e of battle.enemiesInKeys(unit.rangeKeys, unit, { canHitFly: true })) { + if (e.hpRatio < loRatio - 1e-9) battle.applyStatus(e, 'artsFragile', { duration: FRAGILE_EVERY + 0.1, value: fragile, source: unit }); + } + }, { owner: unit, immediate: true }); + } + } }, + ], + install(battle, unit) { + // module traits (none on the normal form, nothing of ISW-A's): CCR-X RES ignore, CCR-Y SP per hit on an elite / leader + if (pen > 0) statBuff(battle, unit, 'trait:heyak:resIgnore', { resIgnoreFlat: pen }); + const sp = num(tb.sp); + if (sp > 0) { + battle.on('damaged', (ctx) => { + const d = ctx.dmg; + if (ctx.source !== unit || !d || !d.isAttack || d.isSplash || tagged(d, AWAY_TAG) || !isEliteEnemy(ctx.target)) return; + giveSp(unit, sp, 'trait'); + }, { owner: unit }); + } + const sid = unit.skill?.id; + if (sid === S1) { + // 但为求索: the shot count decides the 浮空 (PRTS: the shots fired, whatever happens in flight) + const lev = num(b1.levitate); + battle.on('beforeAttack', (ctx) => { + if (ctx.attacker !== unit || !ctx.isSkill) return; + unit.mem.heyakLift = ctx.targets.length === 1 ? ctx.targets[0] : null; + }, { owner: unit, priority: -10 }); + onHitBy(battle, unit, (ctx) => { // before 传承终焉 (priority 0): the lift is settled first + const d = ctx.dmg; + if (!d.isAttack || !d.isSkill || unit.mem.heyakLift !== ctx.target) return; + unit.mem.heyakLift = null; + if (lev > 0) battle.applyStatus(ctx.target, 'levitate', { duration: lev, source: unit }); + }, 10); + } else if (sid === S2) { + // 群星逶迤: the nine shots, each at a random enemy of her range, each rolling its 浮空 before 传承终焉 + const prob = num(b2['attack@prob']), lev = num(b2['attack@levitate']); + battle.on('beforeAttack', (ctx) => { + if (ctx.attacker !== unit || !unit.skill?.active || !ctx.targets.length) return; + const cands = battle.enemiesInKeys(unit.rangeKeys, unit, ctx.profile); + for (const e of battle.blockedTargets(unit, ctx.profile)) if (!cands.includes(e)) cands.push(e); + if (!cands.length) return; + const out = []; + for (let i = 0; i < shots; i++) out.push(battle.rng.pick(cands)); + ctx.targets = out; + }, { owner: unit }); + onHitBy(battle, unit, (ctx) => { + const d = ctx.dmg; + if (!d.isAttack || !d.isSkill || !(prob > 0) || !(lev > 0)) return; + if (battle.rng.chance(prob)) battle.applyStatus(ctx.target, 'levitate', { duration: lev, source: unit }); + }, 10); + } else if (sid === S3) { + // 博览者的狂语: the whirlwinds in flight (also after she left the field) + const winds = (unit.mem.heyakWinds = []); + battle.on('tick', ({ dt }) => { + for (let i = winds.length - 1; i >= 0; i--) { + const w = winds[i]; + const step = Math.min(WIND_SPEED * dt, w.left); + w.x += w.dx * step; + w.y += w.dy * step; + w.left -= step; + w.age += dt; + if (windHit(battle, unit, w) || w.left <= 1e-9) { winds.splice(i, 1); continue; } + w.fxAge += dt; + if (w.fxAge + 1e-9 >= WIND_FX_EVERY) { + w.fxAge = 0; + battle.fx('tornado', { x: w.x, y: w.y, id: unit.id, r: WIND_HALF, dur: WIND_FX_EVERY + 0.1 }); + } + } + }, { owner: unit }); + } + }, + }; + }, +}; diff --git a/test/content/op_amgoat.test.js b/test/content/op_amgoat.test.js new file mode 100644 index 00000000..805a223d --- /dev/null +++ b/test/content/op_amgoat.test.js @@ -0,0 +1,330 @@ +// test/content/op_amgoat.test.js — the 自选 operator kit of 艾雅法拉 (char_180_amgoat, 6★ 中坚术师; kit +// server/sim/content/kits/ops/op-amgoat.js), fielded the production way (a DIY slot + its `diy` pick, simdata getDiy) in +// every form: tiers 5 / 6, normal (E2 Lv1, skill rank 4, no module) and elite (E2 Lv60, rank 7) with no module, CCR-X +// “错过的声音” or CCR-Y “宠物大赛第一名” at stage 1 (tier 5) / 3 (tier 6). Every number is read back from data/backups.json +// (the form of that slot status); the fidelity checklist of kits/README.md item by item. +// Run: node --test test/content/op_amgoat.test.js + +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, OPERATOR_KITS, KITS } from '../../server/sim/content/kits/index.js'; +import { diyPool, validateDiyPicks } from '../../shared/diy.js'; + +const load = (f) => JSON.parse(readFileSync(new URL(`../../data/${f}.json`, import.meta.url), 'utf8')); +const CHESS = load('chess'); +const BACKUPS = load('backups'); +const ID = 'char_180_amgoat'; +const FORMS = BACKUPS.units[ID].forms; +const SLOT = { 5: 'chess_char_5_diy1_a', 6: 'chess_char_6_diy1_a' }; +const CCRX = 'uniequip_002_amgoat', CCRY = 'uniequip_003_amgoat'; +const S1 = 'skchr_amgoat_1', S2 = 'skchr_amgoat_2', S3 = 'skchr_amgoat_3'; +const formOf = (tier, elite) => FORMS[elite ? (tier === 5 ? '2/60/7/1' : '2/60/7/3') : '2/1/4/0']; +const skillOf = (tier, elite, id) => formOf(tier, elite).skills.find((s) => s.skillId === id); +const modOf = (tier, mod) => (mod ? formOf(tier, true).modules.find((m) => m.uniEquipId === mod) : null); +const approx = (a, b, msg, eps = 1e-6) => assert.ok(Math.abs(a - b) <= eps * Math.max(1, Math.abs(b)), `${msg}: ${a} vs ${b}`); +const dummy = (key, o = {}) => enemyRec({ key, hp: 1e9, speed: 0, mass: 0, res: 50, ...o }); +const ENEMIES = { + enemy_dummy: dummy('enemy_dummy'), enemy_fly: dummy('enemy_fly', { motion: 'FLY' }), + enemy_elite: dummy('enemy_elite', { rank: 'ELITE' }), enemy_boss: dummy('enemy_boss', { rank: 'BOSS' }), +}; +/** Every 自选 form: [tier, elite, module]. */ +const FORMS_ALL = [[5, false, null], [6, false, null], ...[5, 6].flatMap((t) => [null, CCRX, CCRY].map((m) => [t, true, m]))]; +const label = ([tier, elite, mod]) => `T${tier} ${elite ? 'elite' : 'normal'} ${mod ?? 'none'}`; + +/** A battle with 艾雅法拉 as uid 1 at (row, col) facing RIGHT, plus `others`. */ +function field({ tier = 5, elite = false, mod = null, skill = 2, row = 10, col = 5, others = [], seed = 5, setup = null } = {}) { + const h = makeBattle({ + defs: { enemies: ENEMIES }, timeLimit: 900, autoFinish: false, seed, + flags: { dpPerSec: 0, dpMax: 999 }, hooks: ['damaged', 'skillStart', 'skillEnd', 'statusApplied', 'spGain', 'deploy'], captureNoisy: true, + units: [{ uid: 1, diy: { slot: SLOT[tier], charId: ID, skillIndex: skill, uniEquipId: mod }, elite, row, col }, ...others], + setup, + }); + h.step(); + return { h, u: h.unit(1) }; +} +const hitsBy = (h, u) => h.hooksOf('damaged').filter((c) => c.source === u); +function done(h) { + checkInvariants(h.b); + assert.equal(h.b.errors.length, 0, JSON.stringify(h.b.errors[0])); +} +/** Arts damage of `amount` on RES `res` with `ignore` flat RES ignored. */ +const arts = (amount, res, ignore = 0) => Math.max(amount * (1 - Math.max(0, res - ignore) / 100), amount * 0.05); + +test('艾雅法拉 in every 自选 form: her operator kit (all three skills authored), the form\'s stats + module attributes, 3-1 range, ranged arts that hits air, block 1, 1.6 s, 空 bonds, no 特质', () => { + assert.equal(OPERATOR_KITS[ID], KITS[ID]); + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + for (const skill of [0, 1, 2]) { + const { h, u } = field({ tier, elite, mod, skill }); + const form = formOf(tier, elite), m = elite ? modOf(tier, mod) : null; + assert.deepEqual([u.def.charId, u.def.diyFor, u.skill.id, !!u.kit.generic, u.kit.skillSource], [ID, SLOT[tier], form.skills[skill].skillId, false, 'skills'], label(f)); + assert.deepEqual([u.base.maxHp, u.base.atk, u.base.def, u.base.res], [form.stats.maxHp + (m?.attr.maxHp ?? 0), form.stats.atk + (m?.attr.atk ?? 0), form.stats.def + (m?.attr.def ?? 0), 20], `${label(f)}: stats`); + assert.deepEqual([u.s.blockCnt, u.profile.attack, u.profile.dmgType, u.profile.canHitFly, u.profile.groundOnly, u.base.bat], [1, 'ranged', 'arts', true, false, 1.6], `${label(f)}: 中坚术师`); + assert.deepEqual(u.liveRangeGrid, form.rangeGrid, `${label(f)}: 3-1`); + assert.deepEqual([u.def.bonds, u.def.raw.garrisonIds, u.def.raw.tokens], [['emptyShip'], [], []], `${label(f)}: bonds / 特质 / no summon`); + assert.ok(!u.s.flags.liftoff && !u.s.flags.camou && !u.s.flags.stealth && !u.s.flags.untargetable, `${label(f)}: ground enemies target her`); + done(h); + } + } + // the numbers of the forms (zh_CN): E2 Lv1 1359 / 535 / 109, E2 Lv60 1614 / 608 / 118; CCR-X +130 / +40 → +180 / +65, + // CCR-Y +180 / +25 → +230 / +50 HP / ATK + assert.deepEqual([FORMS['2/1/4/0'].stats.maxHp, FORMS['2/1/4/0'].stats.atk, FORMS['2/60/7/1'].stats.maxHp, FORMS['2/60/7/1'].stats.atk], [1359, 535, 1614, 608]); + assert.deepEqual([modOf(5, CCRX).attr, modOf(6, CCRX).attr, modOf(5, CCRY).attr, modOf(6, CCRY).attr], [{ maxHp: 130, atk: 40 }, { maxHp: 180, atk: 65 }, { maxHp: 180, atk: 25 }, { maxHp: 230, atk: 50 }]); +}); + +test('a 自选 pick: 艾雅法拉 is offered at tiers 5 and 6 (she has a kit) and a roster with her passes validateDiyPicks', () => { + const data = { chess: CHESS, backups: BACKUPS }; + assert.ok(KITTED_CHARS.includes(ID)); + for (const t of [5, 6]) assert.ok(diyPool(t, { data, kitted: KITTED_CHARS }).includes(ID), `tier ${t}`); + assert.deepEqual(validateDiyPicks({ [SLOT[6]]: { charId: ID, skillIndex: 2, uniEquipId: CCRY } }, { data, kitted: KITTED_CHARS }), + { ok: true, picks: { [SLOT[6]]: { charId: ID, skillIndex: 2, uniEquipId: CCRY } } }); +}); + +test('S1 二重咏唱 (MANUAL, data DEFAULT, 25 s): ASPD +38 / +45 on the first cast of a deployment; ASPD and ATK +38 % / +45 % from the second; the count restarts after a redeploy', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S1); + const { h, u } = field({ tier, elite, skill: 0 }); + const a = sk.bb['amgoat_s_1[a].attack_speed'], b = sk.bb['amgoat_s_1[b].attack_speed'], atk = sk.bb['amgoat_s_1[b].atk']; + assert.deepEqual([u.skill.rule, sk.duration, sk.spCost, sk.initSp, a, b, atk], ['DEFAULT', 25, elite ? 39 : 42, elite ? 20 : 15, elite ? 45 : 38, elite ? 45 : 38, elite ? 0.45 : 0.38], `T${tier}`); + h.run(0.6); + const aspd0 = u.s.aspd, atk0 = u.s.atk; + u.skill.gainSp(999); + h.run(2); + assert.equal(u.skill.activations, 0, `T${tier}: no enemy, no cast`); + h.spawn('enemy_dummy', { pos: [10, 6] }); + assert.ok(h.runUntil(() => u.skill.active, 3), `T${tier}: cast with an enemy in her range`); + approx(u.skill.timeLeft, 25, `T${tier}: 25 s`, 0.01); + assert.deepEqual(u.findBuff('skill:amgoat:duet')?.mods, { aspd: a }, `T${tier}: the first cast`); + approx(u.s.aspd, aspd0 + a, `T${tier}: ASPD`); + approx(u.s.atk, atk0, `T${tier}: no ATK on the first cast`); + assert.ok(h.runUntil(() => !u.skill.active, 26)); + assert.equal(u.findBuff('skill:amgoat:duet'), null, `T${tier}: gone after it`); + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.active, 5), `T${tier}: the second cast`); + assert.deepEqual(u.findBuff('skill:amgoat:duet')?.mods, { aspd: b, atkPct: atk }, `T${tier}: the second cast`); + approx(u.s.atk, u.base.atk * (1 + 0.14 + atk), `T${tier}: ATK with 炎息`); + h.b.retreat(u); + h.b.redeploy(u); + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.active, 5), `T${tier}: a cast after the redeploy`); + assert.deepEqual(u.findBuff('skill:amgoat:duet')?.mods, { aspd: a }, `T${tier}: the count restarted (PRTS 备注)`); + done(h); + } +}); + +test('S2 点燃 (AUTO, 2 charges, data DEFAULT): main target RES ×0.85 / ×0.8 first, ½ explosion on every enemy within 1.5 (flyers too), then ½ again on the main target; the others\' RES cut after their hit, 6 s', () => { + for (const [tier, elite, mod] of [[5, false, null], [6, true, null], [6, true, CCRX]]) { + const sk = skillOf(tier, elite, S2); + const { h, u } = field({ tier, elite, mod, skill: 1 }); + assert.deepEqual([u.skill.rule, u.skill.kind, u.skill.maxCharges, sk.spCost, sk.bb.atk_scale, sk.bb.atk_scale_2, sk.bb.magic_resistance, sk.bb.duration], + ['DEFAULT', 'charges', 2, elite ? 6 : 7, elite ? 1.55 : 1.375, elite ? 1.55 : 1.375, elite ? -0.2 : -0.15, 6], `T${tier}`); + const ign = mod === CCRX ? 10 : 0; + h.run(0.6); + // 乱火 filled 1–2 charges at the deployment: spent before the scene is set + u.skill.charges = 0; + u.skill.sp = 0; + // the main target alone in her range (its tip 0,3); three around it outside the range, one beyond the explosion + const main = h.spawn('enemy_dummy', { pos: [10, 8] }); + const n1 = h.spawn('enemy_dummy', { pos: [10, 9] }), n2 = h.spawn('enemy_dummy', { pos: [11, 9] }), fly = h.spawn('enemy_fly', { pos: [9, 9] }); + const far = h.spawn('enemy_dummy', { pos: [10, 10] }); + u.skill.gainSp(999); + assert.equal(u.skill.charges, 2); + const n0 = hitsBy(h, u).length; + assert.ok(h.runUntil(() => hitsBy(h, u).slice(n0).filter((c) => c.target === main).length >= 2, 4), `T${tier}: the ignited attack lands`); + h.step(); + const hits = hitsBy(h, u).slice(n0); + const atk = u.s.atk; + const cut = 50 * (1 + sk.bb.magic_resistance); + const onMain = hits.filter((c) => c.target === main); + assert.equal(onMain.length, 2, `T${tier}: two ½ hits on the main target`); + for (const c of onMain) approx(c.amount, arts(atk * sk.bb.atk_scale, cut, ign), `T${tier}: ½ on the main target after its RES cut`); + for (const e of [n1, n2, fly]) { + const hs = hits.filter((c) => c.target === e); + assert.equal(hs.length, 1, `T${tier}: one explosion hit on ${e.tileR},${e.tileC}`); + approx(hs[0].amount, arts(atk * sk.bb.atk_scale, 50, ign), `T${tier}: ½ before its own RES cut`); + assert.deepEqual([hs[0].type, hs[0].dmg.isSplash, hs[0].dmg.isSkill], ['arts', true, true]); + } + assert.ok(!hits.some((c) => c.target === far), `T${tier}: 2 tiles away — outside the 1.5 explosion`); + for (const e of [main, n1, n2, fly]) approx(e.s.res, cut, `T${tier}: RES ×${1 + sk.bb.magic_resistance}`); + approx(far.s.res, 50, `T${tier}: untouched`); + assert.equal(u.skill.charges, 1, `T${tier}: one charge spent`); + // the next attack spends the second charge; the cut stays one (同名效果取最高) and lasts 6 s + assert.ok(h.runUntil(() => u.skill.charges === 0, 4)); + h.run(0.5); + approx(main.s.res, cut, `T${tier}: one RES cut, not two`); + h.b.retreat(u); // no further ignition: the cut runs out + h.run(6.2); + approx(main.s.res, 50, `T${tier}: back after 6 s`); + done(h); + } +}); + +test('S3 火山 (MANUAL, data SKILL_RANGE on x-3): 15 s, ATK +70 % / +85 %, interval 1.6 − 1.1 = 0.5 s, range x-3 while on, lava on 4 / 5 random different enemies of it per attack (all when fewer); back after', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S3); + const { h, u } = field({ tier, elite, skill: 2, seed: 9 }); + const n = sk.bb['attack@max_target']; + assert.deepEqual([u.skill.rule, sk.trigger.rawRule, sk.rangeId, sk.duration, sk.bb.atk, sk.bb.base_attack_time, n, sk.spCost, sk.initSp], + ['SKILL_RANGE', 'DEFAULT', 'x-3', 15, elite ? 0.85 : 0.7, -1.1, elite ? 5 : 4, 80, elite ? 40 : 33], `T${tier}`); + assert.deepEqual(u.skill.triggerGrid, sk.rangeGrid, `T${tier}: the trigger grid is x-3`); + h.run(0.6); + const atk0 = u.s.atk; + approx(u.s.interval, 1.6, `T${tier}: own interval`); + u.skill.gainSp(999); + h.run(1); + assert.equal(u.skill.activations, 0, `T${tier}: nobody on x-3`); + // seven enemies: x-3 holds (8,5) / (12,5) / (10,2), none of them in her own 3-1 + const spots = [[10, 6], [9, 7], [11, 7], [10, 8], [8, 5], [12, 5], [10, 2]]; + const foes = spots.map((p) => h.spawn('enemy_dummy', { pos: p })); + assert.ok(h.runUntil(() => u.skill.active, 2), `T${tier}: cast`); + approx(u.skill.timeLeft, 15, `T${tier}: 15 s`, 0.05); + assert.deepEqual(u.liveRangeGrid, sk.rangeGrid, `T${tier}: x-3 while on`); + approx(u.s.interval, 0.5, `T${tier}: 0.5 s`); + approx(u.s.atk, atk0 + u.base.atk * sk.bb.atk, `T${tier}: ATK +${sk.bb.atk * 100} %`); + const n0 = hitsBy(h, u).length; + h.run(6); + assert.ok(u.skill.active); + u.skill.end('test'); + h.run(0.5); // the last lava lands + const hits = hitsBy(h, u).slice(n0).filter((c) => c.dmg.isAttack && c.dmg.isSkill); + const byAttack = new Map(); + for (const c of hits) byAttack.set(c.dmg.attackId, [...(byAttack.get(c.dmg.attackId) ?? []), c.target]); + assert.ok(byAttack.size >= 11, `T${tier}: ${byAttack.size} attacks in 6 s (one per 0.5 s)`); + const counts = new Map(foes.map((e) => [e, 0])); + for (const [, ts] of byAttack) { + assert.equal(ts.length, n, `T${tier}: ${n} lava per attack`); + assert.equal(new Set(ts).size, n, `T${tier}: different enemies`); + for (const t of ts) counts.set(t, counts.get(t) + 1); + } + for (const [e, k] of counts) assert.ok(k > 0, `T${tier}: ${e.tileR},${e.tileC} drew lava (random draw)`); + for (const c of hits.slice(0, 4)) approx(c.amount, arts(atk0 + u.base.atk * sk.bb.atk, 50), `T${tier}: 100 % of her S3 ATK, arts`); + assert.deepEqual(u.liveRangeGrid, formOf(tier, elite).rangeGrid, `T${tier}: back to 3-1`); + approx(u.s.interval, 1.6, `T${tier}: interval back`); + done(h); + } + // two enemies of x-3 only: both every attack + const { h, u } = field({ tier: 6, elite: true, skill: 2, seed: 4 }); + const two = [h.spawn('enemy_dummy', { pos: [10, 6] }), h.spawn('enemy_dummy', { pos: [10, 8] })]; + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.active, 2)); + const n0 = hitsBy(h, u).length; + h.run(3); + const byAttack = new Map(); + for (const c of hitsBy(h, u).slice(n0).filter((x) => x.dmg.isSkill)) byAttack.set(c.dmg.attackId, [...(byAttack.get(c.dmg.attackId) ?? []), c.target]); + [...byAttack.keys()].slice(0, -1).forEach((k) => assert.deepEqual(new Set(byAttack.get(k)), new Set(two), 'fewer enemies than lava: each of them')); + assert.ok(byAttack.size >= 5); + done(h); +}); + +test('T1 炎息: every 【术师】 operator of the field ATK +14 % while she is deployed (惊蛰 yes, 德克萨斯 no); CCR-X stage 3 "携带时" +22 %, kept while she is knocked out', () => { + const others = [{ uid: 2, chessId: 'chess_char_1_03_a', row: 12, col: 3 }, { uid: 3, chessId: 'chess_char_1_08_a', row: 12, col: 8 }]; + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u } = field({ tier, elite, mod, skill: 0, others }); + h.run(0.6); + const leizi = h.unit(2), texas = h.unit(3); + const carried = elite && tier === 6 && mod === CCRX; + const v = carried ? 0.22 : 0.14; + const t0 = u.def.raw.talents.find((t) => t.index === 0); + assert.equal(t0.bb.atk, v, `${label(f)}: the data`); + assert.match(t0.desc, carried ? /^携带时/ : /^在场时/, `${label(f)}: the text`); + assert.deepEqual(leizi.findBuff('talent:amgoat:casters')?.mods, { atkPct: v }, `${label(f)}: 惊蛰 (术师)`); + assert.deepEqual(u.findBuff('talent:amgoat:casters')?.mods, { atkPct: v }, `${label(f)}: herself`); + assert.equal(texas.findBuff('talent:amgoat:casters'), null, `${label(f)}: 德克萨斯 (先锋) gets nothing`); + h.b.kill(u, null); + h.run(1.2); + assert.equal(!!leizi.findBuff('talent:amgoat:casters'), carried, `${label(f)}: after she is knocked out`); + done(h); + } +}); + +test('T2 乱火: 7–15 SP at every deployment (a floored draw); CCR-Y stage 3 also ASPD +6–15, both the maxima (15 / 15) with an elite or leader in range at the deployment; stage 1 and no module: no ASPD, no maximum rule', () => { + const seen = new Set(), seenAs = new Set(); + for (let seed = 1; seed <= 40; seed++) { + const gifts = []; + const setup = (b) => b.on('deploy', (c) => { if (c.unit.uid === 1) gifts.push([c.unit.skill.sp, c.unit.findBuff('talent:amgoat:wildfire')?.mods?.aspd ?? 0]); }, { priority: -100 }); + const y3 = seed % 2 === 0; + const { h } = field({ tier: 6, elite: true, mod: y3 ? CCRY : null, skill: 2, seed, setup }); + const sk = skillOf(6, true, S3); + const [sp, as] = gifts[0]; + const k = sp - sk.initSp; + assert.ok(Number.isInteger(k) && k >= 7 && k <= 15, `seed ${seed}: +${k} SP`); + seen.add(k); + if (y3) { assert.ok(Number.isInteger(as) && as >= 6 && as <= 15, `seed ${seed}: ASPD +${as}`); seenAs.add(as); } else assert.equal(as, 0); + done(h); + } + assert.ok(seen.size >= 6 && seenAs.size >= 4, `a spread of draws: SP ${[...seen].sort((a, b) => a - b)}, ASPD ${[...seenAs].sort((a, b) => a - b)}`); + // an elite / leader in range at a deployment: the maxima with CCR-Y stage 3; a draw otherwise + for (const [tier, mod, rank] of [[6, CCRY, 'enemy_elite'], [6, CCRY, 'enemy_boss'], [5, CCRY, 'enemy_elite'], [6, null, 'enemy_elite'], [6, CCRY, 'enemy_dummy']]) { + const lab = `T${tier} ${mod ?? 'none'} ${rank}`; + const top = tier === 6 && mod === CCRY && rank !== 'enemy_dummy'; + let maxed = 0; + for (let seed = 1; seed <= 6; seed++) { + const gifts = []; + const setup = (b) => b.on('deploy', (c) => { if (c.unit.uid === 1) gifts.push([c.unit.skill.sp, c.unit.findBuff('talent:amgoat:wildfire')?.mods?.aspd ?? 0]); }, { priority: -100 }); + const { h, u } = field({ tier, elite: true, mod, skill: 2, seed, setup }); + const sk = skillOf(tier, true, S3); + h.spawn(rank, { pos: [10, 6] }); + h.b.retreat(u); + h.b.redeploy(u); + const [sp, as] = gifts[1]; + if (top) assert.deepEqual([sp - sk.initSp, as], [15, 15], `${lab} seed ${seed}: the maxima`); + else { + assert.ok(sp - sk.initSp >= 7 && sp - sk.initSp <= 15, lab); + if (sp - sk.initSp === 15) maxed++; + if (mod !== CCRY || tier === 5) assert.equal(as, 0, `${lab}: no ASPD`); + } + done(h); + } + if (!top) assert.ok(maxed < 6, `${lab}: not always the maximum`); + } + // the talent's text and blackboard (stage 3 CCR-Y) + const t1 = formOf(6, true).modules.find((m) => m.uniEquipId === CCRY).talentChanges.find((t) => t.talentIndex === 1); + assert.deepEqual(t1.bb, { sp_min: 7, sp_max: 16, attack_speed_min: 6, attack_speed_max: 16, factor: 1 }); + assert.match(t1.desc, /随机获得7~15点技力并随机提升6~15的攻击速度/); +}); + +test('modules: CCR-X "无视目标10点法术抗性" at stages 1 and 3 (her normal attack on RES 50 deals × 0.6); CCR-Y "普通攻击命中精英或领袖敌人时获得1点技力" — not on a normal enemy, not from S2\'s explosion', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u } = field({ tier, elite, mod, skill: 2 }); + const x = elite && mod === CCRX, y = elite && mod === CCRY; + assert.equal(u.s.resIgnoreFlat, x ? 10 : 0, `${label(f)}: RES ignore`); + if (x) assert.equal(u.def.raw.trait.moduleDesc, '无视目标10点法术抗性'); + if (y) assert.deepEqual(u.def.raw.trait.bb, { sp: 1 }); + const foe = h.spawn('enemy_dummy', { pos: [10, 6] }); + h.run(0.6); + const n0 = hitsBy(h, u).length; + h.run(4); + const hits = hitsBy(h, u).slice(n0).filter((c) => c.target === foe && c.dmg.isAttack); + assert.ok(hits.length >= 2, label(f)); + approx(hits[0].amount, arts(u.s.atk, 50, x ? 10 : 0), `${label(f)}: arts on RES 50`); + const talentSp = () => h.hooksOf('spGain').filter((c) => c.unit === u && c.reason === 'trait').length; + assert.equal(talentSp(), 0, `${label(f)}: no SP from a normal enemy`); + h.b.kill(foe, null); + const el = h.spawn('enemy_elite', { pos: [10, 6] }); + const k0 = talentSp(), a0 = hitsBy(h, u).filter((c) => c.target === el && c.dmg.isAttack).length; + h.run(4); + const hitsE = hitsBy(h, u).filter((c) => c.target === el && c.dmg.isAttack).length - a0; + assert.ok(hitsE >= 2, label(f)); + const gained = talentSp() - k0; + assert.equal(gained, y ? hitsE : 0, `${label(f)}: +1 SP per hit on an elite`); + if (y) for (const c of h.hooksOf('spGain').filter((s) => s.unit === u && s.reason === 'trait')) assert.equal(c.amount, 1); + done(h); + } + // S2's explosion and second ½ are no further 命中 (CCR-Y stage 3): one SP per ignited attack on an elite + const { h, u } = field({ tier: 6, elite: true, mod: CCRY, skill: 1 }); + h.run(0.6); + u.skill.charges = 0; + u.skill.sp = 0; + const el = h.spawn('enemy_elite', { pos: [10, 8] }); + h.spawn('enemy_elite', { pos: [10, 9] }); + u.skill.gainSp(999); + const k0 = h.hooksOf('spGain').filter((c) => c.unit === u && c.reason === 'trait').length; + assert.ok(h.runUntil(() => hitsBy(h, u).filter((c) => c.target === el && c.dmg.isSkill).length >= 2, 4)); + h.step(); + assert.equal(h.hooksOf('spGain').filter((c) => c.unit === u && c.reason === 'trait').length - k0, 1, 'one SP for the ignited attack'); + done(h); +}); diff --git a/test/content/op_cerber.test.js b/test/content/op_cerber.test.js new file mode 100644 index 00000000..66f5845b --- /dev/null +++ b/test/content/op_cerber.test.js @@ -0,0 +1,294 @@ +// test/content/op_cerber.test.js — the 自选 operator kit of 刻俄柏 (char_2013_cerber, 6★ 中坚术师; kit +// server/sim/content/kits/ops/op-cerber.js), fielded the production way (a DIY slot + its `diy` pick, simdata getDiy) in +// every form: tiers 5 / 6, normal (E2 Lv1, skill rank 4, no module) and elite (E2 Lv60, rank 7) with no module, CCR-X +// “很干的面包” or CCR-Y “我打的刀” at stage 1 (tier 5) / 3 (tier 6). Every number is read back from data/backups.json (the +// form of that slot status); the fidelity checklist of kits/README.md item by item. +// Run: node --test test/content/op_cerber.test.js + +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, OPERATOR_KITS, KITS } from '../../server/sim/content/kits/index.js'; +import { diyPool, validateDiyPicks } from '../../shared/diy.js'; + +const load = (f) => JSON.parse(readFileSync(new URL(`../../data/${f}.json`, import.meta.url), 'utf8')); +const CHESS = load('chess'); +const BACKUPS = load('backups'); +const ID = 'char_2013_cerber'; +const FORMS = BACKUPS.units[ID].forms; +const SLOT = { 5: 'chess_char_5_diy1_a', 6: 'chess_char_6_diy1_a' }; +const CCRX = 'uniequip_002_cerber', CCRY = 'uniequip_003_cerber'; +const S1 = 'skchr_cerber_1', S2 = 'skchr_cerber_2', S3 = 'skchr_cerber_3'; +const formOf = (tier, elite) => FORMS[elite ? (tier === 5 ? '2/60/7/1' : '2/60/7/3') : '2/1/4/0']; +const skillOf = (tier, elite, id) => formOf(tier, elite).skills.find((s) => s.skillId === id); +const modOf = (tier, mod) => (mod ? formOf(tier, true).modules.find((m) => m.uniEquipId === mod) : null); +const approx = (a, b, msg, eps = 1e-6) => assert.ok(Math.abs(a - b) <= eps * Math.max(1, Math.abs(b)), `${msg}: ${a} vs ${b}`); +const dummy = (key, o = {}) => enemyRec({ key, hp: 1e9, speed: 0, mass: 0, ...o }); +const ENEMIES = { + enemy_dummy: dummy('enemy_dummy'), enemy_fly: dummy('enemy_fly', { motion: 'FLY' }), + enemy_d100: dummy('enemy_d100', { def: 100 }), enemy_d200: dummy('enemy_d200', { def: 200 }), enemy_d300: dummy('enemy_d300', { def: 300 }), + enemy_d400: dummy('enemy_d400', { def: 400 }), enemy_r50: dummy('enemy_r50', { res: 50 }), + enemy_elite: dummy('enemy_elite', { rank: 'ELITE' }), enemy_boss: dummy('enemy_boss', { rank: 'BOSS' }), +}; +/** Every 自选 form: [tier, elite, module]. */ +const FORMS_ALL = [[5, false, null], [6, false, null], ...[5, 6].flatMap((t) => [null, CCRX, CCRY].map((m) => [t, true, m]))]; +const label = ([tier, elite, mod]) => `T${tier} ${elite ? 'elite' : 'normal'} ${mod ?? 'none'}`; +const SHELL = 'cerber:shell'; +const shellOf = (c) => !!c.dmg?.tags?.includes(SHELL); + +/** A battle with 刻俄柏 as uid 1 at (row, col) facing RIGHT, plus `others`. */ +function field({ tier = 5, elite = false, mod = null, skill = 2, row = 10, col = 5, others = [], seed = 5, setup = null } = {}) { + const h = makeBattle({ + defs: { enemies: ENEMIES }, timeLimit: 900, autoFinish: false, seed, + flags: { dpPerSec: 0, dpMax: 999 }, hooks: ['damaged', 'skillStart', 'skillEnd', 'statusApplied', 'spGain'], captureNoisy: true, + units: [{ uid: 1, diy: { slot: SLOT[tier], charId: ID, skillIndex: skill, uniEquipId: mod }, elite, row, col }, ...others], + setup, + }); + h.step(); + return { h, u: h.unit(1) }; +} +const hitsBy = (h, u) => h.hooksOf('damaged').filter((c) => c.source === u); +const atkHits = (h, u) => hitsBy(h, u).filter((c) => c.dmg?.isAttack); +function done(h) { + checkInvariants(h.b); + assert.equal(h.b.errors.length, 0, JSON.stringify(h.b.errors[0])); +} +const arts = (amount, res, ignore = 0) => Math.max(amount * (1 - Math.max(0, res - ignore) / 100), amount * 0.05); + +test('刻俄柏 in every 自选 form: her operator kit (all three skills authored), the form\'s stats + module attributes, 3-1 range, ranged arts that hits air, block 1, 1.6 s, 空 bonds, no 特质', () => { + assert.equal(OPERATOR_KITS[ID], KITS[ID]); + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + for (const skill of [0, 1, 2]) { + const { h, u } = field({ tier, elite, mod, skill }); + const form = formOf(tier, elite), m = elite ? modOf(tier, mod) : null; + assert.deepEqual([u.def.charId, u.def.diyFor, u.skill.id, !!u.kit.generic, u.kit.skillSource], [ID, SLOT[tier], form.skills[skill].skillId, false, 'skills'], label(f)); + assert.deepEqual([u.base.maxHp, u.base.atk, u.base.def, u.base.res], [form.stats.maxHp + (m?.attr.maxHp ?? 0), form.stats.atk + (m?.attr.atk ?? 0), form.stats.def + (m?.attr.def ?? 0), 20], `${label(f)}: stats`); + assert.deepEqual([u.s.blockCnt, u.profile.attack, u.profile.dmgType, u.profile.canHitFly, u.profile.groundOnly, u.base.bat], [1, 'ranged', 'arts', true, false, 1.6], `${label(f)}: 中坚术师`); + assert.deepEqual(u.liveRangeGrid, form.rangeGrid, `${label(f)}: 3-1`); + assert.deepEqual([u.def.bonds, u.def.raw.garrisonIds, u.def.raw.tokens], [['emptyShip'], [], []], `${label(f)}: bonds / 特质 / no summon`); + assert.ok(!u.s.flags.liftoff && !u.s.flags.camou && !u.s.flags.stealth && !u.s.flags.untargetable, `${label(f)}: ground enemies target her`); + done(h); + } + } + // E2 Lv1 1220 / 553 / 114, E2 Lv60 1449 / 629 / 123; CCR-X +130 / +40 → +180 / +65, CCR-Y +80 / +40 / +17 → +120 / +56 / +23 + assert.deepEqual([FORMS['2/1/4/0'].stats.maxHp, FORMS['2/1/4/0'].stats.atk, FORMS['2/60/7/1'].stats.maxHp, FORMS['2/60/7/1'].stats.atk], [1220, 553, 1449, 629]); + assert.deepEqual([modOf(5, CCRX).attr, modOf(6, CCRX).attr, modOf(5, CCRY).attr, modOf(6, CCRY).attr], [{ maxHp: 130, atk: 40 }, { maxHp: 180, atk: 65 }, { maxHp: 80, atk: 40, def: 17 }, { maxHp: 120, atk: 56, def: 23 }]); +}); + +test('a 自选 pick: 刻俄柏 is offered at tiers 5 and 6 and a roster with her passes validateDiyPicks', () => { + const data = { chess: CHESS, backups: BACKUPS }; + assert.ok(KITTED_CHARS.includes(ID)); + for (const t of [5, 6]) assert.ok(diyPool(t, { data, kitted: KITTED_CHARS }).includes(ID), `tier ${t}`); + assert.deepEqual(validateDiyPicks({ [SLOT[5]]: { charId: ID, skillIndex: 0, uniEquipId: CCRX } }, { data, kitted: KITTED_CHARS }), + { ok: true, picks: { [SLOT[5]]: { charId: ID, skillIndex: 0, uniEquipId: CCRX } } }); +}); + +test('S1 “很冰的斧” (AUTO, 1 / 2 charges, data DEFAULT): the next attack at 165 % / 180 % ATK arts on an unblocked enemy rather than a blocked one, binding it 2 / 2.5 s', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S1); + // 角峰 blocks the dummy spawned on its tile; the other dummy is free (both in her range; the blocked one is nearer its goal) + const { h, u } = field({ tier, elite, skill: 0, others: [{ uid: 2, chessId: 'chess_char_1_02_a', row: 10, col: 7 }] }); + assert.deepEqual([u.skill.rule, u.skill.kind, u.skill.maxCharges, sk.spCost, sk.bb.atk_scale, sk.bb.duration], ['DEFAULT', elite ? 'charges' : 'instant', elite ? 2 : 1, 7, elite ? 1.8 : 1.65, elite ? 2.5 : 2], `T${tier}`); + u.skill.charges = 0; + u.skill.sp = 0; + const blocked = h.spawn('enemy_dummy', { pos: [10, 7] }); + const free = h.spawn('enemy_dummy', { pos: [11, 7] }); + h.run(0.2); + assert.equal(blocked.blockedBy, h.unit(2), `T${tier}: 角峰 blocks it`); + const n0 = atkHits(h, u).length; + h.run(1.7); + const plain = atkHits(h, u).slice(n0); + assert.ok(plain.length >= 1 && plain.every((c) => c.target === blocked && !c.dmg.isSkill), `T${tier}: her plain attacks go to the blocked one`); + u.skill.gainSp(999); + const n1 = atkHits(h, u).length; + assert.ok(h.runUntil(() => atkHits(h, u).slice(n1).some((c) => c.dmg.isSkill), 3), `T${tier}: cast`); + const sh = atkHits(h, u).slice(n1).find((c) => c.dmg.isSkill); + assert.equal(sh.target, free, `T${tier}: "优先攻击没有被阻挡的目标"`); + approx(sh.amount, u.s.atk * sk.bb.atk_scale, `T${tier}: ${sk.bb.atk_scale * 100} % ATK`); + assert.equal(sh.type, 'arts'); + const bind = h.hooksOf('statusApplied').find((c) => c.source === u && c.status === 'bind'); + assert.ok(bind && bind.target === free, `T${tier}: bound`); + approx(bind.duration, sk.bb.duration, `T${tier}: 束缚 ${sk.bb.duration} s`); + done(h); + } +}); + +test('S2 “很热的刀” (MANUAL, data DEFAULT): 33 / 36 s, attack interval × 0.6 / × 0.4 (PRTS "(*0.4)"), the highest-DEF enemy first; all back after', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S2); + const { h, u } = field({ tier, elite, skill: 1 }); + assert.deepEqual([u.skill.rule, sk.duration, sk.bb.base_attack_time, sk.spCost, sk.initSp], ['DEFAULT', elite ? 36 : 33, elite ? 0.4 : 0.6, elite ? 44 : 47, elite ? 16 : 13], `T${tier}`); + h.run(0.6); + const iv0 = u.s.interval; + const d1 = h.spawn('enemy_d100', { pos: [10, 6] }), d3 = h.spawn('enemy_d300', { pos: [11, 7] }), d2 = h.spawn('enemy_d200', { pos: [9, 6] }); + void d1; void d2; + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.active, 3), `T${tier}: cast`); + approx(u.skill.timeLeft, sk.duration, `T${tier}: ${sk.duration} s`, 0.05); + approx(u.s.interval, iv0 * sk.bb.base_attack_time, `T${tier}: interval × ${sk.bb.base_attack_time}`); + const n0 = atkHits(h, u).length; + h.run(5); + const hits = atkHits(h, u).slice(n0); + assert.ok(hits.length >= Math.floor(5 / u.s.interval) - 1, `T${tier}: ${hits.length} attacks`); + assert.ok(hits.every((c) => c.target === d3), `T${tier}: the DEF 300 enemy`); + assert.ok(h.runUntil(() => !u.skill.active, sk.duration)); + approx(u.s.interval, iv0, `T${tier}: interval back`); + done(h); + } +}); + +test('S3 “很重的枪” (MANUAL, data ACTIVE_RANGE on 3-3): 56 / 57 s, range 3-3 while on, ATK +130 % / +160 %, physical, the lowest-DEF enemy first, each hit silences 2.5 / 3 s; arts and 3-1 again after', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S3); + const { h, u } = field({ tier, elite, skill: 2, seed: 7 }); + assert.deepEqual([u.skill.rule, sk.trigger.rawRule, sk.rangeId, sk.duration, sk.bb.atk, sk.bb['attack@silence'], sk.initSp], ['ACTIVE_RANGE', 'DEFAULT', '3-3', elite ? 57 : 56, elite ? 1.6 : 1.3, elite ? 3 : 2.5, elite ? 47 : 41], `T${tier}`); + assert.deepEqual(u.skill.triggerGrid, sk.rangeGrid, `T${tier}: the trigger grid is 3-3`); + h.run(0.6); + const atk0 = u.s.atk; + u.skill.gainSp(999); + // (9,8) / (11,8) are on 3-3, not on her 3-1: the cast comes with an enemy there + const hi = h.spawn('enemy_d300', { pos: [9, 8] }); + const lo = h.spawn('enemy_d100', { pos: [11, 8] }); + assert.ok(h.runUntil(() => u.skill.active, 2), `T${tier}: cast with enemies on 3-3 only`); + assert.deepEqual(u.liveRangeGrid, sk.rangeGrid, `T${tier}: 3-3 while on`); + approx(u.s.atk, atk0 + u.base.atk * sk.bb.atk, `T${tier}: ATK`); + const n0 = atkHits(h, u).length; + h.run(5); + const hits = atkHits(h, u).slice(n0); + assert.ok(hits.length >= 2 && hits.every((c) => c.target === lo && c.type === 'phys'), `T${tier}: physical, on the lowest DEF`); + approx(hits[0].amount, Math.max(u.s.atk - 100, u.s.atk * 0.05), `T${tier}: physical on DEF 100`); + const sil = h.hooksOf('statusApplied').filter((c) => c.source === u && c.status === 'silence'); + assert.ok(sil.length >= hits.length && sil.every((c) => c.target === lo), `T${tier}: silenced on every hit`); + approx(sil[0].duration, sk.bb['attack@silence'], `T${tier}: ${sk.bb['attack@silence']} s`); + // 剥壳 stays arts: DEF 100 × 40 % + const shells = hitsBy(h, u).slice(n0).filter(shellOf); + assert.ok(shells.length >= hits.length - 1 && shells.every((c) => c.type === 'arts'), `T${tier}: 剥壳 arts`); + u.skill.end('test'); + h.run(0.1); + assert.deepEqual(u.liveRangeGrid, formOf(tier, elite).rangeGrid, `T${tier}: back to 3-1`); + void hi; + done(h); + } +}); + +test('T1 剥壳: each hit of her attacks adds DEF × 40 % arts (none on DEF 0); CCR-X stage 3: 50 % +5 % per hit on the same target up to 75 %, back to 50 % on another; stage 1 keeps 40 %', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u } = field({ tier, elite, mod, skill: 1 }); + const x3 = elite && tier === 6 && mod === CCRX; + const t0 = u.def.raw.talents.find((t) => t.index === 0); + assert.equal(t0.bb.atk_scale, x3 ? 0.5 : 0.4, `${label(f)}: the data`); + u.skill.charges = 0; + const a = h.spawn('enemy_d400', { pos: [10, 6] }); + const n0 = hitsBy(h, u).length; + h.run(1.6 * 8 + 0.4); + const shells = hitsBy(h, u).slice(n0).filter((c) => shellOf(c) && c.target === a); + const plain = hitsBy(h, u).slice(n0).filter((c) => c.dmg.isAttack && c.target === a); + assert.ok(plain.length >= 7 && shells.length === plain.length, `${label(f)}: one 剥壳 per hit (${shells.length} / ${plain.length})`); + const want = x3 ? [0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.75] : Array(7).fill(0.4); + shells.slice(0, 7).forEach((c, i) => { + approx(c.amount, 400 * want[i], `${label(f)}: hit ${i + 1}`); + assert.deepEqual([c.type, !!c.dmg.isAttack], ['arts', false], `${label(f)}: a talent arts instance`); + }); + // another target: back to the base ratio; a DEF-0 target takes no 剥壳 + h.b.kill(a, null); + const b = h.spawn('enemy_d200', { pos: [10, 6] }); + const n1 = hitsBy(h, u).length; + h.run(1.7); + const sb = hitsBy(h, u).slice(n1).filter((c) => shellOf(c) && c.target === b); + assert.ok(sb.length >= 1); + approx(sb[0].amount, 200 * (x3 ? 0.5 : 0.4), `${label(f)}: a new target — the base ratio`); + h.b.kill(b, null); + const z = h.spawn('enemy_dummy', { pos: [10, 6] }); + const n2 = hitsBy(h, u).length; + h.run(1.7); + assert.ok(hitsBy(h, u).slice(n2).some((c) => c.target === z && c.dmg.isAttack), label(f)); + assert.ok(!hitsBy(h, u).slice(n2).some((c) => c.target === z && shellOf(c)), `${label(f)}: no 剥壳 on DEF 0`); + done(h); + } +}); + +test('T2 独行长路: ATK +8 % / ASPD +8 while nobody else is on her x-5 (a device too), off with a neighbour; an enemy-like ally does not switch it off but, seen while it is off, keeps it off until it leaves; CCR-Y stage 3: +15 % / +15 decided once per deployment', () => { + const lone = (u) => u.findBuff('talent:cerber:lone'); + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const y3 = elite && tier === 6 && mod === CCRY; + const { h, u } = field({ tier, elite, mod, skill: 1 }); + h.step(); + const v = y3 ? { atkPct: 0.15, aspd: 15 } : { atkPct: 0.08, aspd: 8 }; + assert.deepEqual(lone(u)?.mods, v, `${label(f)}: alone`); + const dev = h.b.spawnDevice('trap_1105_accrate', 10, 6, { name: 'test crate' }); + assert.ok(dev && dev.side === 'ally', label(f)); + h.step(); + assert.equal(!!lone(u), y3, `${label(f)}: a crate in front of her ${y3 ? '(the deployment decided)' : ''}`); + h.b.kill(dev, null); + h.step(); + assert.deepEqual(lone(u)?.mods, v, `${label(f)}: alone again`); + if (!y3) { + // an enemy-like ally (炎佑's kind: an ally built from an enemy record): stays on while on … + const like = h.b.spawnDevice('trap_1105_accrate', 9, 5, { name: 'enemy-like' }); + like.defId = 'enemy_9012_acloon'; + h.step(); + assert.ok(lone(u), `${label(f)}: an enemy-like ally does not switch it off`); + // … but seen while off (an ordinary neighbour came first) it keeps it off until it leaves the field + const mate = h.b.spawnDevice('trap_1105_accrate', 11, 5, { name: 'mate' }); + h.step(); + assert.equal(lone(u), null, `${label(f)}: off with an ordinary neighbour`); + h.b.kill(mate, null); + h.step(); + assert.equal(lone(u), null, `${label(f)}: the enemy-like ally seen while off keeps it off`); + h.b.relocate(like, 12, 9); + h.step(); + assert.equal(lone(u), null, `${label(f)}: even away from her`); + h.b.kill(like, null); + h.step(); + assert.ok(lone(u), `${label(f)}: on once it left the field`); + } + done(h); + } + // CCR-Y stage 3 with a neighbour at the deployment: none for that deployment, then a lone redeploy gets it + const { h, u } = field({ tier: 6, elite: true, mod: CCRY, skill: 1, others: [{ uid: 2, chessId: 'chess_char_1_08_a', row: 11, col: 5 }] }); + h.run(0.5); + assert.equal(lone(u), null, 'a neighbour at the battle-start deployment'); + h.b.retreat(h.unit(2)); + h.run(0.5); + assert.equal(lone(u), null, 'still none: decided at the deployment'); + h.b.retreat(u); + h.b.redeploy(u); + h.step(); + assert.deepEqual(lone(u)?.mods, { atkPct: 0.15, aspd: 15 }, 'a lone redeploy'); + done(h); + const t1 = formOf(6, true).modules.find((m) => m.uniEquipId === CCRY).talentChanges.find((t) => t.talentIndex === 1); + assert.match(t1.desc, /^部署时若周围四格内没有其他友方单位/); +}); + +test('modules: CCR-X "无视目标10点法术抗性" at stages 1 and 3 (× 0.6 on RES 50); CCR-Y "普通攻击命中精英或领袖敌人时获得1点技力" — not on a normal enemy, not from 剥壳', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u } = field({ tier, elite, mod, skill: 2 }); + const x = elite && mod === CCRX, y = elite && mod === CCRY; + assert.equal(u.s.resIgnoreFlat, x ? 10 : 0, `${label(f)}: RES ignore`); + if (y) assert.deepEqual(u.def.raw.trait.bb, { sp: 1 }); + const foe = h.spawn('enemy_r50', { pos: [10, 6] }); + const n0 = hitsBy(h, u).length; + h.run(3.5); + const hits = hitsBy(h, u).slice(n0).filter((c) => c.target === foe && c.dmg.isAttack); + assert.ok(hits.length >= 2, label(f)); + approx(hits[0].amount, arts(u.s.atk, 50, x ? 10 : 0), `${label(f)}: arts on RES 50`); + const traitSp = () => h.hooksOf('spGain').filter((c) => c.unit === u && c.reason === 'trait').length; + assert.equal(traitSp(), 0, `${label(f)}: no SP from a normal enemy`); + h.b.kill(foe, null); + for (const key of ['enemy_elite', 'enemy_boss']) { + const el = h.spawn(key, { pos: [10, 6] }); + const k0 = traitSp(), a0 = atkHits(h, u).filter((c) => c.target === el).length; + h.run(3.5); + const hitsE = atkHits(h, u).filter((c) => c.target === el).length - a0; + assert.ok(hitsE >= 2, label(f)); + assert.equal(traitSp() - k0, y ? hitsE : 0, `${label(f)}: +1 SP per hit on an ${key}`); + h.b.kill(el, null); + } + done(h); + } +}); diff --git a/test/content/op_heyak.test.js b/test/content/op_heyak.test.js new file mode 100644 index 00000000..17bd0ded --- /dev/null +++ b/test/content/op_heyak.test.js @@ -0,0 +1,362 @@ +// test/content/op_heyak.test.js — the 自选 operator kit of 霍尔海雅 (char_4027_heyak, 6★ 中坚术师; kit +// server/sim/content/kits/ops/op-heyak.js), fielded the production way (a DIY slot + its `diy` pick, simdata getDiy) in +// every form: tiers 5 / 6, normal (E2 Lv1, skill rank 4, no module) and elite (E2 Lv60, rank 7) with no module, CCR-X +// “图书馆”, CCR-Y “羽蛇的时间博物馆” or ISW-A “霍尔海雅特限证章” at stage 1 (tier 5) / 3 (tier 6). Every number is read back from +// data/backups.json (the form of that slot status); the fidelity checklist of kits/README.md item by item. +// Run: node --test test/content/op_heyak.test.js + +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, OPERATOR_KITS, KITS } from '../../server/sim/content/kits/index.js'; +import { diyPool, validateDiyPicks } from '../../shared/diy.js'; + +const load = (f) => JSON.parse(readFileSync(new URL(`../../data/${f}.json`, import.meta.url), 'utf8')); +const CHESS = load('chess'); +const BACKUPS = load('backups'); +const ID = 'char_4027_heyak'; +const FORMS = BACKUPS.units[ID].forms; +const SLOT = { 5: 'chess_char_5_diy1_a', 6: 'chess_char_6_diy1_a' }; +const CCRX = 'uniequip_002_heyak', CCRY = 'uniequip_003_heyak', ISWA = 'uniequip_004_heyak'; +const S1 = 'skchr_heyak_1', S2 = 'skchr_heyak_2', S3 = 'skchr_heyak_3'; +const formOf = (tier, elite) => FORMS[elite ? (tier === 5 ? '2/60/7/1' : '2/60/7/3') : '2/1/4/0']; +const skillOf = (tier, elite, id) => formOf(tier, elite).skills.find((s) => s.skillId === id); +const modOf = (tier, mod) => (mod ? formOf(tier, true).modules.find((m) => m.uniEquipId === mod) : null); +const approx = (a, b, msg, eps = 1e-6) => assert.ok(Math.abs(a - b) <= eps * Math.max(1, Math.abs(b)), `${msg}: ${a} vs ${b}`); +const dummy = (key, o = {}) => enemyRec({ key, hp: 1e9, speed: 0, mass: 0, ...o }); +const ENEMIES = { + enemy_dummy: dummy('enemy_dummy'), enemy_fly: dummy('enemy_fly', { motion: 'FLY' }), enemy_heavy: dummy('enemy_heavy', { mass: 2 }), + enemy_r50: dummy('enemy_r50', { res: 50 }), enemy_elite: dummy('enemy_elite', { rank: 'ELITE' }), enemy_boss: dummy('enemy_boss', { rank: 'BOSS' }), +}; +/** Every 自选 form: [tier, elite, module]. */ +const FORMS_ALL = [[5, false, null], [6, false, null], ...[5, 6].flatMap((t) => [null, CCRX, CCRY, ISWA].map((m) => [t, true, m]))]; +const label = ([tier, elite, mod]) => `T${tier} ${elite ? 'elite' : 'normal'} ${mod ?? 'none'}`; + +/** A battle with 霍尔海雅 as uid 1 at (row, col) facing RIGHT, plus `others`. */ +function field({ tier = 5, elite = false, mod = null, skill = 2, row = 10, col = 5, others = [], seed = 5, setup = null } = {}) { + const h = makeBattle({ + defs: { enemies: ENEMIES }, timeLimit: 900, autoFinish: false, seed, + flags: { dpPerSec: 0, dpMax: 999 }, hooks: ['damaged', 'skillStart', 'skillEnd', 'statusApplied', 'spGain'], captureNoisy: true, + units: [{ uid: 1, diy: { slot: SLOT[tier], charId: ID, skillIndex: skill, uniEquipId: mod }, elite, row, col }, ...others], + setup, + }); + h.step(); + return { h, u: h.unit(1) }; +} +const hitsBy = (h, u) => h.hooksOf('damaged').filter((c) => c.source === u); +const statusBy = (h, u, key) => h.hooksOf('statusApplied').filter((c) => c.source === u && c.status === key); +function done(h) { + checkInvariants(h.b); + assert.equal(h.b.errors.length, 0, JSON.stringify(h.b.errors[0])); +} +const arts = (amount, res, ignore = 0) => Math.max(amount * (1 - Math.max(0, res - ignore) / 100), amount * 0.05); +/** 传承终焉's numbers in a form: [atk_scale, silence]. */ +const t0Of = (tier, elite, mod) => { + const t = (mod ? modOf(tier, mod).talentChanges.find((c) => c.talentIndex === 0) : null) ?? formOf(tier, elite).talents.find((c) => c.index === 0); + return [t.bb.atk_scale, t.bb.silence]; +}; + +test('霍尔海雅 in every 自选 form: her operator kit (all three skills authored), the form\'s stats + module attributes, 3-1 range, ranged arts that hits air, block 1, 1.6 s, 空 bonds, no 特质', () => { + assert.equal(OPERATOR_KITS[ID], KITS[ID]); + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + for (const skill of [0, 1, 2]) { + const { h, u } = field({ tier, elite, mod, skill }); + const form = formOf(tier, elite), m = elite ? modOf(tier, mod) : null; + assert.deepEqual([u.def.charId, u.def.diyFor, u.skill.id, !!u.kit.generic, u.kit.skillSource], [ID, SLOT[tier], form.skills[skill].skillId, false, 'skills'], label(f)); + assert.deepEqual([u.base.maxHp, u.base.atk, u.base.def, u.base.res], [form.stats.maxHp + (m?.attr.maxHp ?? 0), form.stats.atk + (m?.attr.atk ?? 0), form.stats.def + (m?.attr.def ?? 0), 20], `${label(f)}: stats`); + assert.deepEqual([u.s.blockCnt, u.profile.attack, u.profile.dmgType, u.profile.canHitFly, u.profile.groundOnly, u.base.bat], [1, 'ranged', 'arts', true, false, 1.6], `${label(f)}: 中坚术师`); + assert.deepEqual(u.liveRangeGrid, form.rangeGrid, `${label(f)}: 3-1`); + assert.deepEqual([u.def.bonds, u.def.raw.garrisonIds, u.def.raw.tokens], [['emptyShip'], [], []], `${label(f)}: bonds / 特质 / no summon`); + assert.ok(!u.s.flags.liftoff && !u.s.flags.camou && !u.s.flags.stealth && !u.s.flags.untargetable, `${label(f)}: ground enemies target her`); + done(h); + } + } + // E2 Lv1 1380 / 525 / 116, E2 Lv60 1639 / 597 / 125; CCR-X +120 / +40 → +175 / +65, CCR-Y +105 / +32 / +15 → +140 / +45 / + // +25, ISW-A +100 / +55 → +130 / +80 + assert.deepEqual([FORMS['2/1/4/0'].stats.maxHp, FORMS['2/1/4/0'].stats.atk, FORMS['2/60/7/1'].stats.maxHp, FORMS['2/60/7/1'].stats.atk], [1380, 525, 1639, 597]); + assert.deepEqual([modOf(5, CCRX).attr, modOf(6, CCRX).attr, modOf(5, CCRY).attr, modOf(6, CCRY).attr, modOf(5, ISWA).attr, modOf(6, ISWA).attr], + [{ maxHp: 120, atk: 40 }, { maxHp: 175, atk: 65 }, { maxHp: 105, atk: 32, def: 15 }, { maxHp: 140, atk: 45, def: 25 }, { maxHp: 100, atk: 55 }, { maxHp: 130, atk: 80 }]); +}); + +test('a 自选 pick: 霍尔海雅 is offered at tiers 5 and 6 and a roster with her (ISW-A included) passes validateDiyPicks', () => { + const data = { chess: CHESS, backups: BACKUPS }; + assert.ok(KITTED_CHARS.includes(ID)); + for (const t of [5, 6]) assert.ok(diyPool(t, { data, kitted: KITTED_CHARS }).includes(ID), `tier ${t}`); + assert.deepEqual(validateDiyPicks({ [SLOT[6]]: { charId: ID, skillIndex: 2, uniEquipId: ISWA } }, { data, kitted: KITTED_CHARS }), + { ok: true, picks: { [SLOT[6]]: { charId: ID, skillIndex: 2, uniEquipId: ISWA } } }); +}); + +test('S1 但为求索 (AUTO, 1 / 2 charges, data DEFAULT): the next attack hits two enemies at 200 % / 240 % ATK arts; with one enemy only it lifts it 2.5 / 3 s — before 传承终焉, so that hit is × 1.2 and silences', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S1); + const [ts, sil] = t0Of(tier, elite, null); + assert.deepEqual([sk.skillType, sk.spCost, sk.maxChargeTime, sk.bb.atk_scale, sk.bb.levitate, ts, sil], ['AUTO', 8, elite ? 2 : 1, elite ? 2.4 : 2, elite ? 3 : 2.5, 1.2, 3], `T${tier}`); + // two enemies: two shots, no lift + { + const { h, u } = field({ tier, elite, skill: 0 }); + assert.deepEqual([u.skill.rule, u.skill.kind, u.skill.maxCharges], ['DEFAULT', elite ? 'charges' : 'instant', elite ? 2 : 1], `T${tier}`); + u.skill.charges = 0; + u.skill.sp = 0; + const a = h.spawn('enemy_dummy', { pos: [10, 6] }), b = h.spawn('enemy_dummy', { pos: [11, 7] }); + u.skill.gainSp(999); + const n0 = hitsBy(h, u).length; + assert.ok(h.runUntil(() => hitsBy(h, u).slice(n0).filter((c) => c.dmg.isSkill).length >= 2, 3), `T${tier}: cast`); + const sh = hitsBy(h, u).slice(n0).filter((c) => c.dmg.isSkill); + assert.deepEqual(new Set(sh.slice(0, 2).map((c) => c.target)), new Set([a, b]), `T${tier}: one more target`); + for (const c of sh.slice(0, 2)) approx(c.amount, u.s.atk * sk.bb.atk_scale, `T${tier}: ${sk.bb.atk_scale * 100} % ATK`); + assert.equal(statusBy(h, u, 'levitate').length, 0, `T${tier}: two shots — no lift`); + done(h); + } + // one enemy: lifted, and that hit already counts as one on an air unit + { + const { h, u } = field({ tier, elite, skill: 0 }); + u.skill.charges = 0; + u.skill.sp = 0; + const a = h.spawn('enemy_dummy', { pos: [10, 6] }); + u.skill.gainSp(999); + const n0 = hitsBy(h, u).length; + assert.ok(h.runUntil(() => hitsBy(h, u).slice(n0).some((c) => c.dmg.isSkill), 3), `T${tier}: cast`); + const sh = hitsBy(h, u).slice(n0).find((c) => c.dmg.isSkill); + assert.equal(sh.target, a); + approx(sh.amount, u.s.atk * sk.bb.atk_scale * ts, `T${tier}: × ${ts} (lifted first)`); + const lev = statusBy(h, u, 'levitate'); + assert.equal(lev.length, 1, `T${tier}: lifted`); + approx(lev[0].duration, sk.bb.levitate, `T${tier}: 浮空 ${sk.bb.levitate} s`); + const sl = statusBy(h, u, 'silence'); + assert.ok(sl.length >= 1 && sl[0].target === a, `T${tier}: silenced`); + approx(sl[0].duration, sil, `T${tier}: ${sil} s`); + done(h); + } + } +}); + +test('S2 群星逶迤 (MANUAL, data DEFAULT): 16 s, each attack 9 shots of 27 % / 35 % ATK at random enemies of her range, each rolling 10 % / 12 % to lift 1 s; a lifted or flying target takes × 1.2', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S2); + const sc = sk.bb['attack@atk_scale'], p = sk.bb['attack@prob']; + assert.deepEqual([sk.duration, sc, p, sk.bb['attack@levitate'], sk.spCost, sk.initSp], [16, elite ? 0.35 : 0.27, elite ? 0.12 : 0.1, 1, elite ? 32 : 36, elite ? 22 : 21], `T${tier}`); + assert.match(sk.desc, /9连发/); + const flying = []; + const setup = (b) => b.on('damaged', (c) => { if (c.source?.uid === 1) flying.push(c.target.isFlying); }, { priority: -100 }); + const { h, u } = field({ tier, elite, skill: 1, seed: 21, setup }); + assert.equal(u.skill.rule, 'DEFAULT'); + let rolls = 0; + const chance = h.b.rng.chance; + h.b.rng.chance = (q) => { if (q === p) rolls++; return chance(q); }; + const foes = [[10, 6], [9, 6], [11, 6], [10, 7], [9, 7], [11, 7]].map((pos) => h.spawn('enemy_dummy', { pos })); + const fly = h.spawn('enemy_fly', { pos: [10, 8] }); + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.active, 3), `T${tier}: cast`); + approx(u.skill.timeLeft, 16, `T${tier}: 16 s`, 0.05); + const n0 = hitsBy(h, u).length, f0 = flying.length; + assert.ok(h.runUntil(() => !u.skill.active, 17)); + h.run(0.6); + const shots = hitsBy(h, u).slice(n0).filter((c) => c.dmg.isSkill); + const fl = flying.slice(f0, f0 + hitsBy(h, u).slice(n0).length); + const byAttack = new Map(); + for (const c of shots) byAttack.set(c.dmg.attackId, [...(byAttack.get(c.dmg.attackId) ?? []), c.target]); + assert.ok(byAttack.size >= 9, `T${tier}: ${byAttack.size} attacks`); + for (const [, ts] of byAttack) assert.equal(ts.length, 9, `T${tier}: 9 shots per attack`); + for (const e of [...foes, fly]) assert.ok(shots.some((c) => c.target === e), `T${tier}: ${e.tileR},${e.tileC} drew shots (random)`); + assert.equal(rolls, shots.length, `T${tier}: one ${p * 100} % roll per shot`); + const lifts = statusBy(h, u, 'levitate'); + assert.ok(lifts.length > 0.5 * p * shots.length && lifts.length <= 1.3 * p * shots.length, `T${tier}: ${lifts.length} lifts of ${shots.length} shots`); + assert.ok(lifts.every((c) => c.target !== fly && Math.abs(c.duration - 1) < 1e-9), `T${tier}: 1 s, never on a data flyer`); + const all = hitsBy(h, u).slice(n0); + all.forEach((c, i) => { + if (!c.dmg.isSkill) return; + approx(c.amount, u.s.atk * sc * (fl[i] ? 1.2 : 1), `T${tier}: shot ${i} (${fl[i] ? 'air' : 'ground'})`); + }); + assert.ok(fl.filter(Boolean).length > shots.filter((c) => c.target === fly).length, `T${tier}: lifted ground enemies took × 1.2 too`); + done(h); + } +}); + +test('S3 博览者的狂语 (MANUAL, data ACTIVE_RANGE on 3-10): 45 s, interval 1.6 + 1.4 = 3.0 s, range 3-10 while on; each attack three whirlwinds (her row and the rows beside), 1 tile/s, each lifting the first enemy it touches then dealing 2.33→3.5 / 2.53→3.8 × ATK over 1.77 s (× 1.2: lifted)', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S3); + const lo = sk.bb['attack@min_atk_scale'], hi = sk.bb['attack@max_atk_scale'], lev = sk.bb['attack@levitate']; + assert.deepEqual([sk.rangeId, sk.duration, sk.bb.base_attack_time, lo, hi, lev, sk.spCost, sk.initSp], ['3-10', 45, 1.4, elite ? 2.53 : 2.33, elite ? 3.8 : 3.5, elite ? 2 : 1.8, elite ? 64 : 67, elite ? 42 : 41], `T${tier}`); + const { h, u } = field({ tier, elite, skill: 2 }); + assert.deepEqual([u.skill.rule, u.skill.triggerGrid], ['ACTIVE_RANGE', sk.rangeGrid], `T${tier}: the trigger`); + h.run(0.6); + u.skill.gainSp(999); + // (10,9) is on 3-10 only: the cast comes with it; lanes: row 9 → (9,6) 1 tile ahead, row 10 → (10,8) before (10,9), row 11 → (11,9) + const far = h.spawn('enemy_dummy', { pos: [10, 9] }); + assert.ok(h.runUntil(() => u.skill.active, 2), `T${tier}: cast with an enemy on 3-10 only`); + const near = h.spawn('enemy_dummy', { pos: [9, 6] }), mid = h.spawn('enemy_dummy', { pos: [10, 8] }), low = h.spawn('enemy_dummy', { pos: [11, 9] }); + assert.deepEqual(u.liveRangeGrid, sk.rangeGrid, `T${tier}: 3-10 while on`); + approx(u.s.interval, 3, `T${tier}: 3.0 s`); + const n0 = hitsBy(h, u).length; + h.run(6.5); + const hits = hitsBy(h, u).slice(n0); + const first = (e) => hits.find((c) => c.target === e); + const scale = (age) => lo + (hi - lo) * Math.min(1, age / 1.77); + approx(first(near).amount, u.s.atk * scale(0.5) * 1.2, `T${tier}: 0.5 tile flown`, 1e-3); + approx(first(mid).amount, u.s.atk * hi * 1.2, `T${tier}: 2.5 tiles — the maximum`); + approx(first(low).amount, u.s.atk * hi * 1.2, `T${tier}: 3.5 tiles`); + assert.ok(!hits.some((c) => c.target === far), `T${tier}: (10,9) behind (10,8) in its lane is never reached`); + for (const c of hits) assert.deepEqual([c.type, c.dmg.isAttack, c.dmg.isSkill], ['arts', true, true]); + const lifts = statusBy(h, u, 'levitate'); + assert.ok(lifts.length >= 3 && lifts.every((c) => Math.abs(c.duration - lev) < 1e-9), `T${tier}: 浮空 ${lev} s`); + assert.ok(statusBy(h, u, 'silence').length >= 3, `T${tier}: 传承终焉 silences the lifted`); + u.skill.end('test'); + h.run(0.1); + assert.deepEqual(u.liveRangeGrid, formOf(tier, elite).rangeGrid, `T${tier}: back to 3-1`); + approx(u.s.interval, 1.6, `T${tier}: interval back`); + done(h); + } +}); + +test('S3 whirlwinds: they fly 5 tiles at most, a heavy (mass > 3) target is lifted half as long, and those out when she leaves fly on without 传承终焉 or her module\'s RES ignore', () => { + // 5 tiles: from her centre (col 4) a box reaches col 9.5 — (11,9) is struck 4.5 tiles out, (10,10) never + { + const { h, u } = field({ tier: 6, elite: true, skill: 2, col: 4 }); + u.skill.gainSp(999); + const trig = h.spawn('enemy_dummy', { pos: [9, 8] }); + const edge = h.spawn('enemy_dummy', { pos: [11, 9] }), beyond = h.spawn('enemy_dummy', { pos: [10, 10] }); + assert.ok(h.runUntil(() => u.skill.active, 2)); + h.run(7); + assert.ok(hitsBy(h, u).some((c) => c.target === trig && c.dmg.isSkill), 'the lane-9 whirlwind'); + assert.ok(hitsBy(h, u).some((c) => c.target === edge && c.dmg.isSkill), 'struck 4.5 tiles out'); + assert.ok(!hitsBy(h, u).some((c) => c.target === beyond), '6 tiles out: the whirlwind is gone'); + done(h); + } + // her module leaves with her (CCR-X stage 3 on RES 50): a whirlwind out when she retreats hits × 1 without the RES ignore + { + const { h, u } = field({ tier: 6, elite: true, mod: CCRX, skill: 2 }); + u.skill.gainSp(999); + const e = h.spawn('enemy_r50', { pos: [10, 9] }); + assert.ok(h.runUntil(() => u.skill.active, 2)); + assert.ok(h.runUntil(() => u.mem.heyakWinds.length > 0, 5), 'whirlwinds out'); + h.run(0.5); + const atk = u.s.atk; + h.b.retreat(u); + const s0 = statusBy(h, u, 'silence').length; + assert.ok(h.runUntil(() => hitsBy(h, u).some((c) => c.target === e), 6), 'the whirlwind flies on'); + const c = hitsBy(h, u).find((x) => x.target === e); + approx(c.amount, arts(atk * 3.8, 50, 0), 'no 传承终焉 (× 1.2) and no RES ignore'); + assert.equal(statusBy(h, u, 'silence').length, s0, 'no silence'); + assert.equal(statusBy(h, u, 'levitate').filter((x) => x.target === e).length, 1, 'still lifted'); + done(h); + } + // a mass-4 target: 浮空 halved (2 s → 1 s at rank 7); 曾有羽翼's 失重 lowers it to 3 while above 80 % HP + { + const { h, u } = field({ tier: 6, elite: true, skill: 2 }); + u.skill.gainSp(999); + const heavy = h.spawn('enemy_heavy', { pos: [10, 9] }); + heavy.base.massLevel = 4; + heavy.markDirty(); + heavy.hp = heavy.s.maxHp * 0.7; // below 80 %: no 失重 + assert.ok(h.runUntil(() => u.skill.active, 2)); + assert.ok(h.runUntil(() => statusBy(h, u, 'levitate').length > 0, 8)); + approx(statusBy(h, u, 'levitate')[0].duration, 1, 'mass 4: half of 2 s'); + done(h); + } +}); + +test('T1 传承终焉: hits on air units × 1.2 and silence 3 s (CCR-X stage 3: × 1.35 / 5 s, ISW-A stage 3: × 1.45 / 5 s; stage 1 modules keep 1.2 / 3); ground targets: neither', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const [ts, sil] = t0Of(tier, elite, elite ? mod : null); + const want = elite && tier === 6 && mod === CCRX ? [1.35, 5] : elite && tier === 6 && mod === ISWA ? [1.45, 5] : [1.2, 3]; + assert.deepEqual([ts, sil], want, `${label(f)}: the data`); + const { h, u } = field({ tier, elite, mod, skill: 2 }); + const fly = h.spawn('enemy_fly', { pos: [10, 6] }); + const n0 = hitsBy(h, u).length; + h.run(1.7); + const c = hitsBy(h, u).slice(n0).find((x) => x.target === fly && x.dmg.isAttack); + assert.ok(c, label(f)); + approx(c.amount, u.s.atk * ts, `${label(f)}: × ${ts} on a flyer`); + const sl = statusBy(h, u, 'silence').find((x) => x.target === fly); + assert.ok(sl, `${label(f)}: silenced`); + approx(sl.duration, sil, `${label(f)}: ${sil} s`); + h.b.kill(fly, null); + const g = h.spawn('enemy_dummy', { pos: [10, 6] }); + const n1 = hitsBy(h, u).length, s1 = statusBy(h, u, 'silence').length; + h.run(1.7); + const cg = hitsBy(h, u).slice(n1).find((x) => x.target === g && x.dmg.isAttack); + approx(cg.amount, u.s.atk, `${label(f)}: × 1 on the ground`); + assert.equal(statusBy(h, u, 'silence').length, s1, `${label(f)}: no silence on the ground`); + done(h); + } +}); + +test('T2 曾有羽翼: 失重 (weight −1) on every enemy of her range above 80 % HP, gone below it or out of range, never on top of another 失重; CCR-Y stage 3: above 50 %, and 20 % 【法术脆弱】 below 50 %', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const y3 = elite && tier === 6 && mod === CCRY; + const thr = y3 ? 0.5 : 0.8; + const { h, u } = field({ tier, elite, mod, skill: 1 }); + const inR = h.spawn('enemy_heavy', { pos: [10, 6] }), out = h.spawn('enemy_heavy', { pos: [10, 10] }); + h.step(2); + assert.ok(inR.findBuff('heyak:weightless'), `${label(f)}: full HP in range`); + assert.equal(inR.weight, 1, `${label(f)}: mass 2 → 1`); + assert.equal(out.findBuff('heyak:weightless'), null, `${label(f)}: out of range`); + inR.hp = inR.s.maxHp * (thr + 0.01); + h.step(); + assert.ok(inR.findBuff('heyak:weightless'), `${label(f)}: above ${thr * 100} %`); + inR.hp = inR.s.maxHp * (thr - 0.01); + h.step(); + assert.equal(inR.findBuff('heyak:weightless'), null, `${label(f)}: below ${thr * 100} %`); + assert.equal(inR.weight, 2, `${label(f)}: mass back`); + inR.hp = inR.s.maxHp * 0.3; + h.run(0.5); + const fr = h.hooksOf('statusApplied').filter((c) => c.source === u && c.status === 'artsFragile' && c.target === inR); + assert.equal(fr.length > 0, y3, `${label(f)}: 【法术脆弱】 below 50 %`); + if (y3) { assert.equal(fr[0].value, 0.2); approx(inR.s.artsTakenMul, 1.2, `${label(f)}: arts taken × 1.2`); } + // another source's 失重 (安洁莉娜's key): not doubled + inR.hp = inR.s.maxHp; + h.b.addBuff(inR, { key: 'aglina:weightless', status: 'weightless', duration: 1, mods: { massFlat: -1 } }); + h.step(); + assert.equal(inR.findBuff('heyak:weightless'), null, `${label(f)}: 同名效果不可叠加`); + assert.equal(inR.weight, 1); + h.run(1.1); + assert.ok(inR.findBuff('heyak:weightless'), `${label(f)}: hers again once the other ended`); + h.b.retreat(u); + h.step(); + assert.equal(inR.findBuff('heyak:weightless'), null, `${label(f)}: gone when she leaves`); + done(h); + } + const hp = formOf(6, true).modules.find((m) => m.uniEquipId === CCRY).talentChanges; + assert.deepEqual([hp.find((t) => t.talentIndex === 1).bb, hp.find((t) => t.talentIndex === -1).bb], [{ hp_ratio: 0.5 }, { damage_scale: 1.2, hp_ratio: 0.5 }]); +}); + +test('modules: CCR-X "无视目标10点法术抗性" (stages 1 and 3); CCR-Y "普通攻击命中精英或领袖敌人时获得1点技力"; ISW-A (集成战略 only): no RES ignore, no SP, no goal-tile 浮空, no radius-1.1 skill splash — its stats and 传承终焉 numbers only', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u } = field({ tier, elite, mod, skill: 2 }); + const x = elite && mod === CCRX, y = elite && mod === CCRY, w = elite && mod === ISWA; + assert.equal(u.s.resIgnoreFlat, x ? 10 : 0, `${label(f)}: RES ignore`); + if (w) assert.match(u.def.raw.trait.moduleDesc, /^在集成战略中/, `${label(f)}: the ISW trait text`); + const foe = h.spawn('enemy_r50', { pos: [10, 6] }); + const n0 = hitsBy(h, u).length; + h.run(3.5); + const hits = hitsBy(h, u).slice(n0).filter((c) => c.target === foe && c.dmg.isAttack); + assert.ok(hits.length >= 2, label(f)); + approx(hits[0].amount, arts(u.s.atk, 50, x ? 10 : 0), `${label(f)}: arts on RES 50`); + const traitSp = () => h.hooksOf('spGain').filter((c) => c.unit === u && c.reason === 'trait').length; + assert.equal(traitSp(), 0, `${label(f)}: no SP from a normal enemy`); + h.b.kill(foe, null); + const el = h.spawn('enemy_elite', { pos: [10, 6] }); + const k0 = traitSp(), a0 = hitsBy(h, u).filter((c) => c.target === el && c.dmg.isAttack).length; + h.run(3.5); + const hitsE = hitsBy(h, u).filter((c) => c.target === el && c.dmg.isAttack).length - a0; + assert.equal(traitSp() - k0, y ? hitsE : 0, `${label(f)}: +1 SP per hit on an elite`); + done(h); + } + // ISW-A stage 3: a whirlwind strikes its target only (the 1.1 splash is 集成战略-only) + const { h, u } = field({ tier: 6, elite: true, mod: ISWA, skill: 2 }); + u.skill.gainSp(999); + const t = h.spawn('enemy_dummy', { pos: [10, 9] }); + const side = h.spawn('enemy_dummy', { pos: [10, 9] }); + side.x = 9.6; side.y = 9.7; // 0.67 from it, behind it in lane 10 (whose whirlwind is spent on it), outside lane 9 + assert.ok(h.runUntil(() => u.skill.active, 2)); + h.run(8); + assert.ok(hitsBy(h, u).some((c) => c.target === t), 'the target'); + assert.ok(!hitsBy(h, u).some((c) => c.target === side), 'nothing beside it'); + assert.ok(!statusBy(h, u, 'levitate').some((c) => c.target === side), 'no splash 浮空'); + done(h); +}); diff --git a/test/golden/README.md b/test/golden/README.md index 6e070f89..fca5a14f 100644 --- a/test/golden/README.md +++ b/test/golden/README.md @@ -19,7 +19,7 @@ through. | `fields` | 22 battles: every Final Assault / Hidden Core leader on a pair and a solo template (shared pool, 200 s cap) and the 联防 field with 1 and 2 helpers on its own map (carried HP / SP, a knocked-out operator, two leakers' enemies) | | `matches` | 17 matches to the end in virtual time: 16 bot-only (solo 标准 / 险境 / 绝境 / 终极 × 2 seeds, co-op 2 / 3 / 4, one server-run combat match, two runs boosted to the Hidden Core) and one co-op match whose human seat (AI 托管, offline) does not own 7 NORMAL chess — they fight as their 补位 stand-ins (its digest lists them per round, `standIns`) | | `standins` | 10 battles: every NORMAL chess record (normal and elite, 110) fielded as its 补位 stand-in (`standIn: true`: the stand-in's body, backup skill / module and kit — all 17 stand-ins, every skill a chess names for them), 12 per battle by strength band, laid out by the stand-in's position on a real stage, against the round's real wave three times over plus 8 ground enemy kinds (melee stand-ins always meet an enemy), an item each, bonds from the board | -| `diy` | 6 battles of 自选 pieces (a DIY slot with its `diy` pick, `shared/diy.js`): every owned 6★ with an operator kit (`kits/index.js OPERATOR_KITS` — 推进之王 so far) in each form of tiers 5 and 6 (normal; elite with no module and with each module) under each skill, then every prototype pick with a kit at its locked selection, normal and elite, 12 per battle against the round's real wave; a new operator kit adds its scenarios | +| `diy` | 13 battles of 自选 pieces (a DIY slot with its `diy` pick, `shared/diy.js`): every owned 6★ with an operator kit (`kits/index.js OPERATOR_KITS` — 推进之王, 艾雅法拉, 刻俄柏, 霍尔海雅 so far) in each form of tiers 5 and 6 (normal; elite with no module and with each module) under each skill, then every prototype pick with a kit at its locked selection, normal and elite, 12 per battle against the round's real wave; a new operator kit adds its scenarios | Battles go through the production BattleSpec path (`server/sim/spec.js`, as browsers and the server's headless fields run them); matches construct `Match` directly with a `VirtualScheduler`. Every option is explicit, so a change to a @@ -32,7 +32,7 @@ to 2 decimals. `npm test` runs the fast subset (the scenarios marked `"fast": true`: every chess record with its default loadout, every stage and every non-leader enemy kind, every bond at its top tier, six fields, six matches, the five stand-in -battles of the normal records, the first 自选 battle of the operator kits and of the prototypes — 61 of the 150). `GOLDEN_FULL=1` checks everything. +battles of the normal records, the first 自选 battle of the operator kits and of the prototypes — 61 of the 157). `GOLDEN_FULL=1` checks everything. ## Workflow diff --git a/test/golden/diy.json b/test/golden/diy.json index d842b158..58933dc6 100644 --- a/test/golden/diy.json +++ b/test/golden/diy.json @@ -90,130 +90,130 @@ "snaps": "d7b739d1 f5e170c4 bc463f9c 6ebd80ed 93f8e1ae ea1947a7 9541a28f e8dbac5b b0b3c196 14ae4a64 46640828 01c55ea9 0f261678 f447848b 0aad3542 db5850a3 631cc5ca 455c1dbc 68ad7134 24c71ebb 34a3ee93 37b05130 7a58a87e" }, "diy-003": { - "about": "5_diy1_a=cdfend 5_diy2_b=cdfend 5_diy1_a=cguard 5_diy2_b=cguard 5_diy1_a=csnipe 5_diy2_b=csnipe 5_diy1_a=ccast 5_diy2_b=ccast 5_diy1_a=cmedic 5_diy2_b=cmedic 5_diy1_a=csuppo 5_diy2_b=csuppo", - "fast": true, + "about": "5_diy1_a=amgoat/S1 5_diy2_a=amgoat/S2 5_diy1_a=amgoat/S3 5_diy2_b=amgoat/S1 5_diy1_b=amgoat/S2 5_diy2_b=amgoat/S3 5_diy1_b=amgoat/S1/002_amgoat 5_diy2_b=amgoat/S2/002_amgoat 5_diy1_b=amgoat/S3/002_amgoat 5_diy2_b=amgoat/S1/003_amgoat 5_diy1_b=amgoat/S2/003_amgoat 5_diy2_b=amgoat/S3/003_amgoat", + "fast": false, "kind": "normal", "stageId": "act1autochess_m03", "modeId": "mode_single_normal", "round": 12, "seed": 3865246633, "waveId": "act1autochess_h05", - "time": 196.5, - "ticks": 5895, + "time": 193, + "ticks": 5790, "reason": "cleared", - "killed": 8, + "killed": 30, "total": 93, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 0, + "rngDraws": 166, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":8,"total":93,"perfect":false,"leaks":85,"leaksUncounted":0,"coins":0,"dmg":306215,"bossDmg":0,"heal":22436,"deaths":11,"layerGains":{}}}, + "players": {"p1":{"killed":30,"total":93,"perfect":false,"leaks":63,"leaksUncounted":0,"coins":0,"dmg":963951,"bossDmg":0,"heal":0,"deaths":12,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,114,0,690,6384,0,13,0], - ["p1",2,"op","chess_char_5_diy2_b",2,"none",0,0,98,1,7246,10191,0,56,1], - ["p1",3,"op","chess_char_5_diy1_a",2,null,2564,1,116,1,16020,8139,0,28,1], - ["p1",4,"op","chess_char_5_diy2_b",2,"none",0,0,74,3,34176,12589,0,37,2], - ["p1",5,"op","chess_char_5_diy1_a",2,null,871,1,8,1,22261,400,0,129,3], - ["p1",6,"op","chess_char_5_diy2_b",2,"none",1510,1,12,0,32187,200,0,108,3], - ["p1",7,"op","chess_char_5_diy1_a",2,null,1133,1,14,0,30588,200,0,77,2], - ["p1",8,"op","chess_char_5_diy2_b",2,"none",1160,1,4,1,71148,200,0,154,3], - ["p1",9,"op","chess_char_5_diy1_a",2,null,1218,1,6,0,0,600,18186,48,3], - ["p1",10,"op","chess_char_5_diy2_b",2,"none",1374,1,115,0,0,8077,4251,12,2], - ["p1",11,"op","chess_char_5_diy1_a",2,null,932,1,13,1,40672,2000,0,123,3], - ["p1",12,"op","chess_char_5_diy2_b",2,"none",1131,1,15,0,51226,800,0,132,3], + ["p1",1,"op","chess_char_5_diy1_a",0,null,959,1,6,3,50628,400,0,87,3], + ["p1",2,"op","chess_char_5_diy2_a",1,null,190.45,1,11,2,58735,1169,0,69,21], + ["p1",3,"op","chess_char_5_diy1_a",2,null,684,1,14,2,196041,675,0,109,2], + ["p1",4,"op","chess_char_5_diy2_b",0,"none",45.45,1,4,6,83367,1569,0,127,3], + ["p1",5,"op","chess_char_5_diy1_b",1,"none",0,0,5,4,145937,1614,0,100,28], + ["p1",6,"op","chess_char_5_diy2_b",2,"none",0,0,78,6,48217,3228,0,34,1], + ["p1",7,"op","chess_char_5_diy1_b",0,"uniequip_002_amgoat",0,0,12,2,62089,1744,0,82,3], + ["p1",8,"op","chess_char_5_diy2_b",1,"uniequip_002_amgoat",544,1,15,1,183584,1200,0,110,31], + ["p1",9,"op","chess_char_5_diy1_b",2,"uniequip_002_amgoat",1744,1,114,1,10176,3488,0,16,0], + ["p1",10,"op","chess_char_5_diy2_b",0,"uniequip_003_amgoat",1794,1,111,0,9696,3588,0,16,1], + ["p1",11,"op","chess_char_5_diy1_b",1,"uniequip_003_amgoat",1794,1,109,1,16090,3588,0,11,6], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_003_amgoat",1794,1,117,2,99391,3588,0,29,1], ["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null], ["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null], ["-","~3","device","trap_1105_accrate",null,null,100,1,3,0,0,0,0,0,null] ], - "enemies": {"enemy_1267_nhpbr_2":[36,8,28,17650,131613],"enemy_1270_nhstlk_2":[27,0,27,15235,63417],"enemy_9006_actoxi":[30,0,30,16896,111185]}, - "hooks": [1,116,5895,1089,1089,1215,1215,60,19,104,26,24,0,28385,254,28,93,85,1,19,0,0,0], - "events": {"atk":1089,"deploy":20,"die":19,"dmg":1215,"fx":8,"heal":60,"leak":85,"skill":50,"spawn":108,"status":504}, - "fx": {"zone":8}, - "snaps": "b1b2dda9 6ac577d6 84811e80 eb6305ea 52a34c95 c2fd4731 45525f0b dbcc3ddb ddfcbc11 0874e859 206cd671 4c83f44b f4f5331a 194da7d5 1fe13dbf 6b7331b4 4cf19629 7bae5e13 5b7078fc 65a8a1f5" + "enemies": {"enemy_1267_nhpbr_2":[36,17,19,8389,263150],"enemy_1270_nhstlk_2":[27,3,24,10759,237686],"enemy_9006_actoxi":[30,10,20,4064,463114]}, + "hooks": [1,117,5790,819,819,1565,1565,0,42,105,100,100,0,34275,0,12,93,63,1,42,0,0,0], + "events": {"atk":1050,"deploy":21,"die":42,"dmg":1565,"fx":112,"leak":63,"skill":200,"spawn":108,"status":14}, + "fx": {"explosion":85,"zone":27}, + "snaps": "3069dddb 6778f951 3d8a39e4 fc04db5b 6bb9d8e1 1eff74f6 4b09ddae dab16187 be28aa1c d97f7e83 a797d5c9 481ef3fd 9a01def6 93881217 6e980dab 9fa5c282 c2633be4 9181ff20 572b3ae0 dfe62af5" }, "diy-004": { - "about": "5_diy1_a=acfend 5_diy2_b=acfend 5_diy1_a=acpion 5_diy2_b=acpion 5_diy1_a=acguad 5_diy2_b=acguad 5_diy1_a=acnipe 5_diy2_b=acnipe 5_diy1_a=accast 5_diy2_b=accast 5_diy1_a=acmedc 5_diy2_b=acmedc", + "about": "6_diy1_a=amgoat/S1 6_diy2_a=amgoat/S2 6_diy1_a=amgoat/S3 6_diy2_b=amgoat/S1 6_diy1_b=amgoat/S2 6_diy2_b=amgoat/S3 6_diy1_b=amgoat/S1/002_amgoat 6_diy2_b=amgoat/S2/002_amgoat 6_diy1_b=amgoat/S3/002_amgoat 6_diy2_b=amgoat/S1/003_amgoat 6_diy1_b=amgoat/S2/003_amgoat 6_diy2_b=amgoat/S3/003_amgoat", "fast": false, "kind": "normal", "stageId": "act1autochess_m04", "modeId": "mode_multi_abyss", - "round": 12, + "round": 13, "seed": 1210847140, - "waveId": "act1autochess_h05", - "time": 224.77, - "ticks": 6743, + "waveId": "act1autochess_h06", + "time": 211.87, + "ticks": 6356, "reason": "cleared", - "killed": 21, - "total": 117, + "killed": 0, + "total": 111, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 350, + "rngDraws": 268, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":21,"total":117,"perfect":false,"leaks":96,"leaksUncounted":0,"coins":0,"dmg":374057,"bossDmg":0,"heal":25487,"deaths":23,"layerGains":{}}}, + "players": {"p1":{"killed":0,"total":111,"perfect":false,"leaks":111,"leaksUncounted":0,"coins":0,"dmg":484623,"bossDmg":0,"heal":0,"deaths":17,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,116,0,0,5208,0,0,0], - ["p1",2,"op","chess_char_5_diy2_b",2,"uniequip_002_acfend",100.37,1,143,0,0,6642,0,0,0], - ["p1",3,"op","chess_char_5_diy1_a",2,null,1060.28,1,145,0,4912,3527,0,0,1], - ["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acpion",0,0,98,5,85077,5533,0,0,3], - ["p1",5,"op","chess_char_5_diy1_a",2,null,0,0,104,0,0,8356,0,0,0], - ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acguad",0,0,100,0,0,20296,0,0,0], - ["p1",7,"op","chess_char_5_diy1_a",2,null,0,0,132,0,16051,2544,0,16,1], - ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_acnipe",0,0,135,5,91286,3174,0,37,1], - ["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,77,0,6653,2744,0,3,0], - ["p1",10,"op","chess_char_5_diy2_b",2,"uniequip_002_accast",0,0,7,11,170077,1749,0,21,1], - ["p1",11,"op","chess_char_5_diy1_a",2,null,0,0,144,0,0,5333,10172,24,1], - ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acmedc",0,0,94,0,0,8375,15315,21,1], + ["p1",1,"op","chess_char_6_diy1_a",0,null,1359,1,4,0,58140,0,0,137,3], + ["p1",2,"op","chess_char_6_diy2_a",1,null,1359,1,5,0,113611,0,0,126,30], + ["p1",3,"op","chess_char_6_diy1_a",2,null,1359,1,15,0,162915,0,0,159,2], + ["p1",4,"op","chess_char_6_diy2_b",0,"none",0,0,86,0,13381,3228,0,28,2], + ["p1",5,"op","chess_char_6_diy1_b",1,"none",0,0,78,0,39074,3228,0,30,10], + ["p1",6,"op","chess_char_6_diy2_b",2,"none",0,0,129,0,15042,4842,0,29,0], + ["p1",7,"op","chess_char_6_diy1_b",0,"uniequip_002_amgoat",1794,1,120,0,2688,3588,0,5,1], + ["p1",8,"op","chess_char_6_diy2_b",1,"uniequip_002_amgoat",1794,1,136,0,9290,3588,0,7,3], + ["p1",9,"op","chess_char_6_diy1_b",2,"uniequip_002_amgoat",0,0,110,0,10010,3588,0,15,0], + ["p1",10,"op","chess_char_6_diy2_b",0,"uniequip_003_amgoat",0,0,9,0,11271,1844,0,19,1], + ["p1",11,"op","chess_char_6_diy1_b",1,"uniequip_003_amgoat",0,0,75,0,41111,3688,0,16,7], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_003_amgoat",0,0,13,0,8092,1844,0,14,0], ["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null], ["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null], ["-","~3","device","trap_1105_accrate",null,null,100,1,3,0,0,0,0,0,null] ], - "enemies": {"enemy_1005_yokai":[51,16,35,0,83756],"enemy_1005_yokai_2":[54,5,49,24107,111017],"enemy_1005_yokai_3":[12,0,12,42273,179284]}, - "hooks": [1,145,6743,501,501,975,936,86,44,140,9,9,0,14181,0,0,117,96,1,44,0,0,39], - "events": {"atk":594,"deploy":25,"die":44,"dmg":936,"fx":87,"heal":78,"leak":96,"skill":18,"spawn":132,"status":8}, - "fx": {"aoe":1,"dodge":39,"dp":9,"slash":32,"spGain":6}, - "snaps": "6b632c98 e087bd9f f5b9da13 f7038fad bb4d7811 5178d072 0c0de684 872f1892 81773c41 3d296a6a 66f1329a 3a99c8b1 aa011a13 319c8ec5 26231cc7 f808b9be 73dd7977 75857859 817f18b6 d1cdd533 cd927f27 64106a51 89f62784" + "enemies": {"enemy_1010_demon":[54,0,54,15710,228441],"enemy_1320_wdrrl_2":[18,0,18,0,150127],"enemy_1422_lrsldr_2":[39,0,39,9154,195795]}, + "hooks": [1,136,6356,621,621,2281,2281,0,17,128,59,59,0,22424,0,16,111,111,1,17,0,0,0], + "events": {"atk":769,"deploy":22,"die":17,"dmg":2281,"fx":50,"leak":111,"skill":118,"spawn":126}, + "fx": {"explosion":50}, + "snaps": "0c492035 ab8dc46e 0b22ed34 b96a440c 5dcb36c1 4b743566 67b554d6 218fd235 a1bf1435 41239423 04aec195 2352cb16 0304f36b 69885543 8da70555 defafc9e 90856b04 9f919d8a 86029e91 546db575 bd70bd7b 07d03564" }, "diy-005": { - "about": "6_diy1_a=acfend 6_diy2_b=acfend 5_diy1_a=sharp2 5_diy2_b=sharp2 6_diy1_a=acpion 6_diy2_b=acpion 5_diy1_a=acspec 5_diy2_b=acspec 6_diy1_a=acguad 6_diy2_b=acguad 5_diy1_a=acsupo 5_diy2_b=acsupo", + "about": "5_diy1_a=cerber/S1 5_diy2_a=cerber/S2 5_diy1_a=cerber/S3 5_diy2_b=cerber/S1 5_diy1_b=cerber/S2 5_diy2_b=cerber/S3 5_diy1_b=cerber/S1/002_cerber 5_diy2_b=cerber/S2/002_cerber 5_diy1_b=cerber/S3/002_cerber 5_diy2_b=cerber/S1/003_cerber 5_diy1_b=cerber/S2/003_cerber 5_diy2_b=cerber/S3/003_cerber", "fast": false, "kind": "normal", "stageId": "act1autochess_m05", "modeId": "mode_multi_funny", - "round": 13, + "round": 12, "seed": 823748262, - "waveId": "act1autochess_h06", - "time": 230, - "ticks": 6900, - "reason": "timeout", - "killed": 63, - "total": 123, + "waveId": "act1autochess_h05", + "time": 180.77, + "ticks": 5423, + "reason": "cleared", + "killed": 60, + "total": 60, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 117, + "rngDraws": 0, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":63,"total":123,"perfect":false,"leaks":60,"leaksUncounted":0,"coins":0,"dmg":274732,"bossDmg":0,"heal":0,"deaths":20,"layerGains":{}}}, + "players": {"p1":{"killed":60,"total":60,"perfect":true,"leaks":0,"leaksUncounted":0,"coins":0,"dmg":739167,"bossDmg":0,"heal":0,"deaths":0,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_6_diy1_a",2,null,1834,1,132,5,19446,3374,0,80,2], - ["p1",2,"op","chess_char_6_diy2_b",2,"uniequip_002_acfend",2142.36,1,141,5,29488,4720,0,101,2], - ["p1",3,"op","chess_char_5_diy1_a",0,null,1865,1,154,3,27639,3730,0,42,1], - ["p1",4,"op","chess_char_5_diy2_b",0,"uniequip_002_sharp2",2374,1,152,11,43106,4748,0,39,1], - ["p1",5,"op","chess_char_6_diy1_a",2,null,0,0,135,3,18986,4587,0,18,1], - ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acpion",1808.52,1,143,18,92036,3903,0,40,4], - ["p1",7,"op","chess_char_5_diy1_a",2,null,117.2,1,130,12,39744,6807,0,115,0], - ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_acspec",1448,1,1,0,0,0,0,0,0], - ["p1",9,"op","chess_char_6_diy1_a",2,null,2638,1,3,0,0,0,0,0,0], - ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_acguad",3531,1,5,0,0,0,0,0,0], - ["p1",11,"op","chess_char_5_diy1_a",2,null,1160,1,153,0,1743,2320,0,7,0], - ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acsupo",1120.4,1,145,0,2545,3170,0,7,1] + ["p1",1,"op","chess_char_5_diy1_a",0,null,1220,1,10,0,69676,0,0,68,14], + ["p1",2,"op","chess_char_5_diy2_a",1,null,1220,1,11,7,83949,0,0,91,2], + ["p1",3,"op","chess_char_5_diy1_a",2,null,1220,1,1,0,0,0,0,0,0], + ["p1",4,"op","chess_char_5_diy2_b",0,"none",1449,1,3,0,0,0,0,0,0], + ["p1",5,"op","chess_char_5_diy1_b",1,"none",1449,1,5,5,27281,0,0,30,2], + ["p1",6,"op","chess_char_5_diy2_b",2,"none",1449,1,7,4,92582,0,0,95,2], + ["p1",7,"op","chess_char_5_diy1_b",0,"uniequip_002_cerber",1579,1,9,0,0,0,0,0,0], + ["p1",8,"op","chess_char_5_diy2_b",1,"uniequip_002_cerber",1579,1,12,19,189053,0,0,171,2], + ["p1",9,"op","chess_char_5_diy1_b",2,"uniequip_002_cerber",1579,1,2,0,0,0,0,0,0], + ["p1",10,"op","chess_char_5_diy2_b",0,"uniequip_003_cerber",1529,1,4,3,21450,0,0,20,14], + ["p1",11,"op","chess_char_5_diy1_b",1,"uniequip_003_cerber",1529,1,6,12,135263,0,0,135,3], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_003_cerber",1529,1,8,10,119913,0,0,107,2] ], - "enemies": {"enemy_1019_jshoot_2":[57,37,20,9953,112024],"enemy_1299_ymkilr_2":[27,6,20,25821,123649],"enemy_1422_lrsldr_2":[39,20,19,1584,123193]}, - "hooks": [1,154,6900,835,835,3335,3375,0,83,142,12,15,0,16427,38,83,123,59,1,83,0,0,0], - "events": {"atk":851,"deploy":31,"die":83,"dmg":3367,"fx":150,"leak":59,"skill":22,"spawn":135,"status":47}, - "fx": {"aoe":83,"displace":3,"dp":26,"slash":38}, - "snaps": "aa4b712f 51a2360b 59868653 c815c7eb 7dd47d06 3f3f03f4 89e883c3 60e1e7f6 2355716a 5d734980 75cde05f c0dd657c 4e5bd257 0f8a040d b1aafe05 c04cbb36 e6d37890 8457998a a19143e5 d709bc2b 4283543b 0d9edf54 6ef9963d" + "enemies": {"enemy_1045_hammer_2":[12,12,0,0,230400],"enemy_1061_zomshd":[48,48,0,0,515047]}, + "hooks": [1,72,5423,717,717,1498,1498,8159,60,60,41,37,0,25672,118,0,60,0,1,60,0,0,0], + "events": {"atk":717,"deploy":12,"die":60,"dmg":1498,"skill":78,"spawn":72,"status":69}, + "fx": {}, + "snaps": "5fc483b1 4e17e082 8548e13b 9fe12b3d 38c503ba fb87cf28 4ccf788a 8144b7c1 6b14c250 4737690a d3257d88 313cff8f c651f169 d3940943 a86d9122 f34f6de0 be833256 c1807206" }, "diy-006": { - "about": "6_diy1_a=sharp2 6_diy2_b=sharp2 6_diy1_a=acspec 6_diy2_b=acspec 6_diy1_a=acnipe 6_diy2_b=acnipe 6_diy1_a=accast 6_diy2_b=accast 6_diy1_a=acmedc 6_diy2_b=acmedc 6_diy1_a=acsupo 6_diy2_b=acsupo", + "about": "6_diy1_a=cerber/S1 6_diy2_a=cerber/S2 6_diy1_a=cerber/S3 6_diy2_b=cerber/S1 6_diy1_b=cerber/S2 6_diy2_b=cerber/S3 6_diy1_b=cerber/S1/002_cerber 6_diy2_b=cerber/S2/002_cerber 6_diy1_b=cerber/S3/002_cerber 6_diy2_b=cerber/S1/003_cerber 6_diy1_b=cerber/S2/003_cerber 6_diy2_b=cerber/S3/003_cerber", "fast": false, "kind": "normal", "stageId": "act1autochess_m06", @@ -221,35 +221,314 @@ "round": 13, "seed": 2464539579, "waveId": "act1autochess_h06", - "time": 210.23, - "ticks": 6307, + "time": 211, + "ticks": 6330, "reason": "cleared", - "killed": 5, + "killed": 0, "total": 81, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 123, + "rngDraws": 0, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":5,"total":81,"perfect":false,"leaks":76,"leaksUncounted":0,"coins":0,"dmg":185202,"bossDmg":0,"heal":4048,"deaths":30,"layerGains":{}}}, + "players": {"p1":{"killed":0,"total":81,"perfect":false,"leaks":81,"leaksUncounted":0,"coins":0,"dmg":70171,"bossDmg":0,"heal":0,"deaths":20,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,3,0,11325,1865,0,7,1], - ["p1",2,"op","chess_char_6_diy2_b",0,"uniequip_002_sharp2",0,0,6,3,52957,2494,0,16,1], - ["p1",3,"op","chess_char_6_diy1_a",2,null,1154,1,112,0,15444,8178,0,22,0], - ["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acspec",0,0,109,2,51553,12663,0,57,0], - ["p1",5,"op","chess_char_6_diy1_a",2,null,1272,1,113,0,4256,2544,0,15,0], - ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acnipe",0,0,105,0,10180,3286,0,19,0], - ["p1",7,"op","chess_char_6_diy1_a",2,null,0,0,5,0,3060,1372,0,2,0], - ["p1",8,"op","chess_char_6_diy2_b",2,"uniequip_002_accast",0,0,2,0,30589,1819,0,4,1], - ["p1",9,"op","chess_char_6_diy1_a",2,null,0,0,8,0,0,2028,2464,7,1], - ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_acmedc",0,0,61,0,0,3890,1584,6,1], - ["p1",11,"op","chess_char_6_diy1_a",2,null,0,0,58,0,2490,3291,0,7,1], - ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_002_acsupo",0,0,60,0,3347,3320,0,8,0] + ["p1",1,"op","chess_char_6_diy1_a",0,null,1220,1,98,0,13983,2440,0,24,5], + ["p1",2,"op","chess_char_6_diy2_a",1,null,1220,1,103,0,7043,2440,0,14,0], + ["p1",3,"op","chess_char_6_diy1_a",2,null,0,0,84,0,5268,2440,0,10,0], + ["p1",4,"op","chess_char_6_diy2_b",0,"none",0,0,92,0,5826,2898,0,8,3], + ["p1",5,"op","chess_char_6_diy1_b",1,"none",0,0,8,0,4479,1449,0,6,0], + ["p1",6,"op","chess_char_6_diy2_b",2,"none",0,0,57,0,6689,2898,0,8,0], + ["p1",7,"op","chess_char_6_diy1_b",0,"uniequip_002_cerber",0,0,50,0,2832,3258,0,4,0], + ["p1",8,"op","chess_char_6_diy2_b",1,"uniequip_002_cerber",0,0,7,0,5182,1629,0,7,0], + ["p1",9,"op","chess_char_6_diy1_b",2,"uniequip_002_cerber",0,0,55,0,6108,3258,0,8,0], + ["p1",10,"op","chess_char_6_diy2_b",0,"uniequip_003_cerber",0,0,51,0,4014,3138,0,6,1], + ["p1",11,"op","chess_char_6_diy1_b",1,"uniequip_003_cerber",0,0,4,0,4527,1569,0,7,1], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_003_cerber",0,0,6,0,4221,1569,0,6,0] ], - "enemies": {"enemy_1267_nhpbr_2":[27,5,22,7765,89733],"enemy_1270_nhstlk_2":[36,0,36,14278,68347],"enemy_1272_nhtank_2":[18,0,18,24706,27121]}, - "hooks": [1,113,6307,262,262,449,476,16,35,111,6,21,0,5828,86,24,81,76,1,35,0,0,0], - "events": {"atk":283,"deploy":32,"die":35,"dmg":441,"fx":58,"heal":15,"leak":76,"skill":12,"spawn":93,"status":142}, - "fx": {"aoe":7,"displace":21,"spGain":6,"zone":24}, - "snaps": "1dcf4706 8bd55683 d93e4d02 ab832ad5 132699ab f37b039d f12175ca fe30225b 6b2b77c0 2caefa3a 1018f9e1 a60a2364 f81df3c0 d0f2780e 0e940f53 372c90ef 46af3a81 a6b2adf1 63234976 3b8b7c59 b62aa8d4" + "enemies": {"enemy_1267_nhpbr_2":[27,0,27,1939,18605],"enemy_1270_nhstlk_2":[36,0,36,9078,36229],"enemy_1272_nhtank_2":[18,0,18,17968,15337]}, + "hooks": [1,103,6330,152,152,332,332,0,20,101,10,10,0,7735,9,12,81,81,1,20,0,0,0], + "events": {"atk":152,"deploy":22,"die":20,"dmg":332,"fx":14,"leak":81,"skill":20,"spawn":93,"status":34}, + "fx": {"zone":14}, + "snaps": "313d7c97 13002169 ec0f6001 61351396 71a9fb3c 51e8a5a4 3712fcb3 f52fbe94 0b605aee 39303477 4172e529 96f8eacc bc4db9da d59d5e0b 2dba04a4 238b4737 ca090321 09e413fe ad24036f 479d642c fbb40004 ffdcf451" + }, + "diy-007": { + "about": "5_diy1_a=heyak/S1 5_diy2_a=heyak/S2 5_diy1_a=heyak/S3 5_diy2_b=heyak/S1 5_diy1_b=heyak/S2 5_diy2_b=heyak/S3 5_diy1_b=heyak/S1/002_heyak 5_diy2_b=heyak/S2/002_heyak 5_diy1_b=heyak/S3/002_heyak 5_diy2_b=heyak/S1/003_heyak 5_diy1_b=heyak/S2/003_heyak 5_diy2_b=heyak/S3/003_heyak", + "fast": false, + "kind": "normal", + "stageId": "act1autochess_m07", + "modeId": "mode_multi_normal", + "round": 12, + "seed": 1837403644, + "waveId": "act1autochess_h05", + "time": 215.8, + "ticks": 6474, + "reason": "cleared", + "killed": 14, + "total": 90, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 2445, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":14,"total":90,"perfect":false,"leaks":76,"leaksUncounted":0,"coins":0,"dmg":625302,"bossDmg":0,"heal":0,"deaths":4,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",0,null,1380,1,5,2,36991,0,0,87,17], + ["p1",2,"op","chess_char_5_diy2_a",1,null,1380,1,7,2,40426,0,0,81,3], + ["p1",3,"op","chess_char_5_diy1_a",2,null,1380,1,9,1,30737,0,0,56,2], + ["p1",4,"op","chess_char_5_diy2_b",0,"none",1639,1,11,2,42333,0,0,71,17], + ["p1",5,"op","chess_char_5_diy1_b",1,"none",1639,1,13,1,50187,0,0,66,3], + ["p1",6,"op","chess_char_5_diy2_b",2,"none",1639,1,6,0,53289,0,0,87,2], + ["p1",7,"op","chess_char_5_diy1_b",0,"uniequip_002_heyak",1759,1,8,5,59096,0,0,87,22], + ["p1",8,"op","chess_char_5_diy2_b",1,"uniequip_002_heyak",1759,1,10,0,93166,0,0,114,4], + ["p1",9,"op","chess_char_5_diy1_b",2,"uniequip_002_heyak",1759,1,12,0,67740,0,0,88,2], + ["p1",10,"op","chess_char_5_diy2_b",0,"uniequip_003_heyak",1744,1,14,0,76190,0,0,115,23], + ["p1",11,"op","chess_char_5_diy1_b",1,"uniequip_003_heyak",0,0,102,1,44985,3488,0,62,4], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_003_heyak",0,0,95,0,30162,3488,0,39,1], + ["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null], + ["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null] + ], + "enemies": {"enemy_1229_darmy":[27,3,24,0,122229],"enemy_1229_darmy_2":[51,11,40,2154,341777],"enemy_9007_acelem":[12,0,12,4822,161297]}, + "hooks": [1,106,6474,864,958,1955,1960,0,18,94,100,100,0,46509,983,26,90,76,1,18,0,0,0], + "events": {"atk":1877,"deploy":14,"die":18,"dmg":1960,"fx":2131,"leak":76,"skill":200,"spawn":104,"status":938}, + "fx": {"beam":23,"tornado":2014,"tornadoPulse":94}, + "snaps": "3d86dd35 3ff0c985 2064373b 180d0463 4fe3528a f010e89d 553ab857 3fb2e969 f1e38e7b 55def0ca d8c0e4a3 2a8d89a1 1bd57303 c8726930 6cd231d5 d57feda3 e0f812a5 92894208 9212b2fa 4a62393b c8ea5365 0dd2dadc" + }, + "diy-008": { + "about": "5_diy1_b=heyak/S1/004_heyak 5_diy2_b=heyak/S2/004_heyak 5_diy1_b=heyak/S3/004_heyak 6_diy1_a=heyak/S1 6_diy2_a=heyak/S2 6_diy1_a=heyak/S3 6_diy2_b=heyak/S1 6_diy1_b=heyak/S2 6_diy2_b=heyak/S3 6_diy1_b=heyak/S1/002_heyak 6_diy2_b=heyak/S2/002_heyak 6_diy1_b=heyak/S3/002_heyak", + "fast": false, + "kind": "normal", + "stageId": "act2autochess_m01", + "modeId": "mode_multi_hard", + "round": 13, + "seed": 3478524561, + "waveId": "act1autochess_h06", + "time": 220.9, + "ticks": 6627, + "reason": "cleared", + "killed": 3, + "total": 147, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 1272, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":3,"total":147,"perfect":false,"leaks":144,"leaksUncounted":0,"coins":0,"dmg":346761,"bossDmg":0,"heal":0,"deaths":19,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_b",0,"uniequip_004_heyak",1739,1,2,0,68603,0,0,119,25], + ["p1",2,"op","chess_char_5_diy2_b",1,"uniequip_004_heyak",1739,1,3,0,72289,0,0,123,5], + ["p1",3,"op","chess_char_5_diy1_b",2,"uniequip_004_heyak",1739,1,4,1,117884,0,0,101,2], + ["p1",4,"op","chess_char_6_diy1_a",0,null,0,0,162,0,4463,4140,0,10,2], + ["p1",5,"op","chess_char_6_diy2_a",1,null,0,0,169,0,8698,4140,0,17,1], + ["p1",6,"op","chess_char_6_diy1_a",2,null,0,0,93,0,3780,2760,0,15,0], + ["p1",7,"op","chess_char_6_diy2_b",0,"none",0,0,107,0,3328,3278,0,9,2], + ["p1",8,"op","chess_char_6_diy1_b",1,"none",0,0,88,0,5458,3278,0,13,1], + ["p1",9,"op","chess_char_6_diy2_b",2,"none",0,0,135,1,22615,3278,0,18,1], + ["p1",10,"op","chess_char_6_diy1_b",0,"uniequip_002_heyak",0,0,86,0,3919,3628,0,11,1], + ["p1",11,"op","chess_char_6_diy2_b",1,"uniequip_002_heyak",0,0,151,1,11600,3628,0,11,1], + ["p1",12,"op","chess_char_6_diy1_b",2,"uniequip_002_heyak",0,0,5,0,24124,1814,0,14,1] + ], + "enemies": {"enemy_1166_dusbr_2":[39,1,38,10294,95138],"enemy_1169_duphlx_2":[57,2,55,7224,128395],"enemy_1170_dushld_2":[51,0,51,12426,123228]}, + "hooks": [1,169,6627,465,505,1119,1119,0,22,166,42,41,0,20240,457,23,147,144,1,22,0,0,0], + "events": {"atk":1004,"deploy":22,"die":22,"dmg":1119,"fx":382,"leak":144,"skill":83,"spawn":159,"status":2294}, + "fx": {"tornado":267,"tornadoPulse":115}, + "snaps": "18e5cc43 9f337255 f0a32e0f 03d2099a bfb348e3 6872c08f 7cc843bd 7eb37a77 910d3a01 f4295769 441d3884 fe318962 18be2da9 d4af5adc 247cbc81 b3f6f16e 03365b82 d73cdfbb eb7ea096 9ca64954 bac1a6a7 e58739fb" + }, + "diy-009": { + "about": "5_diy1_a=cdfend 5_diy2_b=cdfend 5_diy1_a=cguard 5_diy2_b=cguard 6_diy1_b=heyak/S1/003_heyak 6_diy2_b=heyak/S2/003_heyak 6_diy1_b=heyak/S3/003_heyak 6_diy2_b=heyak/S1/004_heyak 6_diy1_b=heyak/S2/004_heyak 6_diy2_b=heyak/S3/004_heyak 5_diy1_a=csnipe 5_diy2_b=csnipe", + "fast": true, + "kind": "normal", + "stageId": "act2autochess_m02", + "modeId": "mode_single_normal", + "round": 13, + "seed": 2612428600, + "waveId": "act1autochess_h06", + "time": 204, + "ticks": 6120, + "reason": "cleared", + "killed": 12, + "total": 102, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 1493, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":12,"total":102,"perfect":false,"leaks":90,"leaksUncounted":0,"coins":0,"dmg":705050,"bossDmg":0,"heal":0,"deaths":14,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,118,0,639,6384,0,12,0], + ["p1",2,"op","chess_char_5_diy2_b",2,"none",0,0,124,0,3062,8724,0,26,1], + ["p1",3,"op","chess_char_5_diy1_a",2,null,0,0,115,0,7456,7692,0,17,0], + ["p1",4,"op","chess_char_5_diy2_b",2,"none",0,0,119,0,12989,10002,0,23,0], + ["p1",5,"op","chess_char_6_diy1_b",0,"uniequip_003_heyak",1379,1,8,3,101353,400,0,95,32], + ["p1",6,"op","chess_char_6_diy2_b",1,"uniequip_003_heyak",979,1,9,4,89729,800,0,68,5], + ["p1",7,"op","chess_char_6_diy1_b",2,"uniequip_003_heyak",546.09,1,13,2,95186,1233,0,73,2], + ["p1",8,"op","chess_char_6_diy2_b",0,"uniequip_004_heyak",1569,1,4,1,119307,200,0,116,24], + ["p1",9,"op","chess_char_6_diy1_b",1,"uniequip_004_heyak",1369,1,6,1,127560,400,0,118,4], + ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_004_heyak",1369,1,10,1,104534,400,0,91,2], + ["p1",11,"op","chess_char_5_diy1_a",2,null,871,1,14,0,36916,400,0,184,3], + ["p1",12,"op","chess_char_5_diy2_b",2,"none",1510,1,126,0,6319,3020,0,28,1], + ["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null], + ["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null] + ], + "enemies": {"enemy_1267_nhpbr_2":[27,3,24,4459,125488],"enemy_1270_nhstlk_2":[36,3,33,14194,199539],"enemy_9006_actoxi":[39,6,33,20569,380024]}, + "hooks": [1,126,6120,906,961,1693,1693,0,26,116,74,74,0,35228,1488,34,102,90,1,26,0,0,0], + "events": {"atk":1538,"deploy":22,"die":26,"dmg":1693,"fx":1136,"leak":90,"skill":148,"spawn":116,"status":703}, + "fx": {"tornado":1067,"tornadoPulse":65,"zone":4}, + "snaps": "f5e10799 52135f94 60d746f3 687cf769 5b14f8b2 febc1ae6 36e8d275 73573dae e4ffde94 83f49d15 d737b501 717266a2 2094e44a 518a5d47 e07fece2 5ad94814 6d519e1a b7855c32 3c8376b8 2595b329 5585579e" + }, + "diy-010": { + "about": "5_diy1_a=acfend 5_diy2_b=acfend 5_diy1_a=acpion 5_diy2_b=acpion 5_diy1_a=acguad 5_diy2_b=acguad 5_diy1_a=ccast 5_diy2_b=ccast 5_diy1_a=cmedic 5_diy2_b=cmedic 5_diy1_a=csuppo 5_diy2_b=csuppo", + "fast": false, + "kind": "normal", + "stageId": "act2autochess_m03", + "modeId": "mode_multi_abyss", + "round": 12, + "seed": 4252812069, + "waveId": "act1autochess_h05", + "time": 198.83, + "ticks": 5965, + "reason": "cleared", + "killed": 1, + "total": 114, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 83, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":1,"total":114,"perfect":false,"leaks":113,"leaksUncounted":0,"coins":0,"dmg":88013,"bossDmg":0,"heal":2979,"deaths":25,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,5,0,1224,2604,0,8,0], + ["p1",2,"op","chess_char_5_diy2_b",2,"uniequip_002_acfend",0,0,6,0,6376,3371,0,17,1], + ["p1",3,"op","chess_char_5_diy1_a",2,null,0,0,139,0,19464,4587,0,16,1], + ["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acpion",0,0,132,0,14161,6079,0,6,1], + ["p1",5,"op","chess_char_5_diy1_a",2,null,0,0,81,0,2402,7097,0,3,0], + ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acguad",0,0,123,1,32254,6822,0,13,1], + ["p1",7,"op","chess_char_5_diy1_a",2,null,0,0,108,0,3736,2266,0,8,0], + ["p1",8,"op","chess_char_5_diy2_b",2,"none",0,0,78,0,3843,2720,0,7,0], + ["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,76,0,0,2803,1939,6,0], + ["p1",10,"op","chess_char_5_diy2_b",2,"none",0,0,71,0,0,3171,1040,4,0], + ["p1",11,"op","chess_char_5_diy1_a",2,null,0,0,142,0,3160,2796,0,8,0], + ["p1",12,"op","chess_char_5_diy2_b",2,"none",0,0,80,0,1392,2262,0,3,0], + ["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null], + ["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null], + ["-","~3","device","trap_1105_accrate",null,null,100,1,3,0,0,0,0,0,null] + ], + "enemies": {"enemy_1019_jshoot_2":[51,0,51,10772,5074],"enemy_1381_winman":[27,1,26,3589,81570],"enemy_1389_winbab_2":[36,0,36,32218,1369]}, + "hooks": [1,142,5965,362,362,362,341,10,26,139,4,4,0,8414,11,22,114,113,1,67,0,0,21], + "events": {"atk":362,"deploy":25,"die":26,"dmg":341,"fx":43,"heal":10,"leak":113,"skill":8,"spawn":129,"status":22}, + "fx": {"aoe":4,"dodge":21,"dp":2,"slash":16}, + "snaps": "f95ec6b3 ed7d838d fb316f9c dab9952a 3ece6e1c cc394bf0 4406f186 500cf7f9 85835d90 0fbaf17d 904fc882 ab8ec4e4 42d37e57 1cf0f337 dbd9f5b6 d472d89b 3e7d68bd 953cd5f8 e3b8230a 1ab756a8" + }, + "diy-011": { + "about": "5_diy1_a=sharp2 5_diy2_b=sharp2 5_diy1_a=acspec 5_diy2_b=acspec 5_diy1_a=acnipe 5_diy2_b=acnipe 5_diy1_a=accast 5_diy2_b=accast 5_diy1_a=acmedc 5_diy2_b=acmedc 5_diy1_a=acsupo 5_diy2_b=acsupo", + "fast": false, + "kind": "normal", + "stageId": "act2autochess_m04", + "modeId": "mode_multi_funny", + "round": 12, + "seed": 538212341, + "waveId": "act1autochess_h05", + "time": 210.13, + "ticks": 6304, + "reason": "cleared", + "killed": 83, + "total": 114, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 1149, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":83,"total":114,"perfect":false,"leaks":31,"leaksUncounted":0,"coins":0,"dmg":674779,"bossDmg":0,"heal":30475,"deaths":5,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",0,null,1099,1,132,12,52984,13333,0,108,3], + ["p1",2,"op","chess_char_5_diy2_b",0,"uniequip_002_sharp2",1787,1,131,19,125786,8523,0,123,3], + ["p1",3,"op","chess_char_5_diy1_a",2,null,1154,1,133,1,4263,9289,0,80,0], + ["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acspec",978,1,108,3,7850,9148,0,105,0], + ["p1",5,"op","chess_char_5_diy1_a",2,null,1272,1,3,8,18374,0,0,185,2], + ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acnipe",1587,1,4,8,29112,0,0,189,3], + ["p1",7,"op","chess_char_5_diy1_a",2,null,1372,1,11,24,275224,0,0,83,2], + ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_accast",1749,1,13,7,85351,0,0,51,2], + ["p1",9,"op","chess_char_5_diy1_a",2,null,1224,1,5,0,0,0,30475,58,2], + ["p1",10,"op","chess_char_5_diy2_b",2,"uniequip_002_acmedc",1414,1,10,0,0,0,0,0,0], + ["p1",11,"op","chess_char_5_diy1_a",2,null,1160,1,12,0,29193,0,0,137,2], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acsupo",1430,1,14,0,46642,0,0,131,2], + ["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null], + ["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null] + ], + "enemies": {"enemy_10124_uashld_2":[12,3,9,23019,173497],"enemy_1043_zomsbr":[72,64,8,297,212674],"enemy_1061_zomshd":[30,16,14,16977,315575]}, + "hooks": [1,133,6304,1429,1429,3149,3332,39660,88,119,21,21,0,33441,7581,38,114,31,1,88,0,0,0], + "events": {"atk":1866,"deploy":17,"die":88,"dmg":3329,"fx":14,"heal":94,"leak":31,"skill":39,"spawn":128,"status":771}, + "fx": {"aoe":9,"spGain":5}, + "snaps": "9e077552 b355e47c b24fef80 9630611b ba6aaa68 a55a9e35 55de81c3 0200ff41 1c975365 6d65c907 2fa8927d 65a7475d c5555eff 97949f97 1b5b5829 eca6487a 5c3a07cb ca46ec36 57dff451 c868cecd de89d5db" + }, + "diy-012": { + "about": "6_diy1_a=acfend 6_diy2_b=acfend 6_diy1_a=acpion 6_diy2_b=acpion 6_diy1_a=acguad 6_diy2_b=acguad 6_diy1_a=acnipe 6_diy2_b=acnipe 6_diy1_a=accast 6_diy2_b=accast 6_diy1_a=acmedc 6_diy2_b=acmedc", + "fast": false, + "kind": "normal", + "stageId": "act1autochess_m01", + "modeId": "mode_single_hard", + "round": 13, + "seed": 3192456040, + "waveId": "act1autochess_h06", + "time": 230, + "ticks": 6900, + "reason": "timeout", + "killed": 25, + "total": 117, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 1031, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":25,"total":117,"perfect":false,"leaks":92,"leaksUncounted":0,"coins":0,"dmg":917801,"bossDmg":0,"heal":18388,"deaths":13,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_6_diy1_a",2,null,0,0,140,0,1944,8114,0,26,1], + ["p1",2,"op","chess_char_6_diy2_b",2,"uniequip_002_acfend",0,0,121,0,10155,6862,0,85,2], + ["p1",3,"op","chess_char_6_diy1_a",2,null,0,0,133,0,7609,4587,0,20,1], + ["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acpion",0,0,130,6,51717,5712,0,19,2], + ["p1",5,"op","chess_char_6_diy1_a",2,null,0,0,90,1,23844,5276,0,50,2], + ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acguad",3531,1,8,6,145774,18086,0,124,5], + ["p1",7,"op","chess_char_6_diy1_a",2,null,1272,1,4,0,33279,0,0,157,2], + ["p1",8,"op","chess_char_6_diy2_b",2,"uniequip_002_acnipe",1643,1,5,6,96326,0,0,192,3], + ["p1",9,"op","chess_char_6_diy1_a",2,null,1372,1,11,4,255529,0,0,78,2], + ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_accast",1819,1,13,2,291625,0,0,83,3], + ["p1",11,"op","chess_char_6_diy1_a",2,null,1224,1,6,0,0,0,18388,45,2], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_002_acmedc",1464,1,14,0,0,0,0,0,0], + ["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null], + ["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null], + ["-","~3","device","trap_1105_accrate",null,null,100,1,3,0,0,0,0,0,null] + ], + "enemies": {"enemy_1166_dusbr_2":[39,14,25,1375,203044],"enemy_1170_dushld_2":[39,8,30,14781,221543],"enemy_9011_acrefr":[39,3,35,32481,493214]}, + "hooks": [1,140,6900,1061,1061,3100,3078,67,38,128,25,22,0,33015,0,48,117,90,1,42,0,0,22], + "events": {"atk":1376,"deploy":20,"die":38,"dmg":3078,"fx":136,"heal":57,"leak":90,"skill":47,"spawn":132,"status":123}, + "fx": {"aoe":81,"dodge":22,"dp":9,"slash":24}, + "snaps": "5798fc78 bc32724f 41014680 b37499e1 77e4e7eb 80e45344 7e9b1723 c72901e2 a0b40309 48335b9f 4eeefd52 e9aa29a1 5be95678 4ab19904 6c6204e0 7a33f9b8 8284dbb5 3e831607 c6b72c15 45727786 199e1234 e693dda1 4aabdf76" + }, + "diy-013": { + "about": "6_diy1_a=sharp2 6_diy2_b=sharp2 6_diy1_a=acspec 6_diy2_b=acspec 6_diy1_a=acsupo 6_diy2_b=acsupo", + "fast": false, + "kind": "normal", + "stageId": "act1autochess_m02", + "modeId": "mode_multi_normal", + "round": 13, + "seed": 3819019976, + "waveId": "act1autochess_h06", + "time": 219.27, + "ticks": 6578, + "reason": "cleared", + "killed": 3, + "total": 132, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 25, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":3,"total":132,"perfect":false,"leaks":129,"leaksUncounted":0,"coins":0,"dmg":61168,"bossDmg":0,"heal":0,"deaths":28,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,2,0,15633,1865,0,8,1], + ["p1",2,"op","chess_char_6_diy2_b",0,"uniequip_002_sharp2",0,0,1,2,28961,2494,0,15,1], + ["p1",3,"op","chess_char_6_diy1_a",2,null,0,0,160,1,4413,12694,0,13,0], + ["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acspec",1484,1,161,0,8683,14840,0,9,0], + ["p1",5,"op","chess_char_6_diy1_a",2,null,0,0,144,0,1909,3480,0,5,0], + ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acsupo",0,0,77,0,1569,2900,0,3,0] + ], + "enemies": {"enemy_1019_jshoot_2":[57,2,55,9362,21392],"enemy_1381_winman":[27,1,26,526,39174],"enemy_1389_winbab_2":[48,0,48,28385,602]}, + "hooks": [1,161,6578,288,288,172,187,0,31,160,2,23,0,2383,13,14,132,129,1,31,0,0,0], + "events": {"atk":295,"deploy":29,"die":31,"dmg":182,"fx":5,"leak":129,"skill":4,"spawn":138,"status":26}, + "fx": {"displace":4,"dodge":1}, + "snaps": "e5204fab 982d07f3 584cb188 44820d62 8695b17e 5d029e3f ce97f399 5b27b71e 4cbc4a9f 5565a881 55fe5bb0 1854b616 0b410158 0618ca70 a9b7268d 2cfac889 7fb3e5b8 15a58d3f 87049a47 0b595d41 cc6b4807 964b9bf0" } } }