diff --git a/server/sim/content/kits/index.js b/server/sim/content/kits/index.js index 65bad48b..f76ba9a2 100644 --- a/server/sim/content/kits/index.js +++ b/server/sim/content/kits/index.js @@ -78,13 +78,17 @@ 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-chen.js', 'op-irene.js', 'op-helage.js', 'op-shining.js', 'op-cgbird.js', 'op-saga.js', + 'op-amgoat.js', + 'op-cerber.js', + 'op-heyak.js', ]); /** 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/diy.json b/test/golden/diy.json index e2f9318b..14fdb076 100644 --- a/test/golden/diy.json +++ b/test/golden/diy.json @@ -579,127 +579,127 @@ "snaps": "139545f0 29393223 af71a5ff f0163efe a9da66a7 136d4411 c07df6f7 80c80aa5 9fb44dd7 4ebb38f0 5334365a 625edb1c 0c3fc668 a66e9ef9 dc0775ba 570d25e8 6398e94c ebde2a20 72f3754c bcb5d344 8311f146 9e54ae25" }, "diy-015": { - "about": "5_diy1_a=cdfend 5_diy2_b=cdfend 6_diy1_b=saga/S1/002_saga 6_diy2_b=saga/S2/002_saga 6_diy1_b=saga/S3/002_saga 6_diy2_b=saga/S1/003_saga 6_diy1_b=saga/S2/003_saga 6_diy2_b=saga/S3/003_saga 5_diy1_a=cguard 5_diy2_b=cguard 5_diy1_a=csnipe 5_diy2_b=csnipe", - "fast": true, + "about": "6_diy1_b=saga/S1/002_saga 6_diy2_b=saga/S2/002_saga 6_diy1_b=saga/S3/002_saga 6_diy2_b=saga/S1/003_saga 6_diy1_b=saga/S2/003_saga 6_diy2_b=saga/S3/003_saga 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", + "fast": false, "kind": "normal", "stageId": "act1autochess_m04", "modeId": "mode_single_normal", "round": 13, "seed": 2805115174, "waveId": "act1autochess_h06", - "time": 228.93, - "ticks": 6868, + "time": 223.57, + "ticks": 6707, "reason": "cleared", - "killed": 19, + "killed": 33, "total": 129, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 145, + "rngDraws": 792, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":19,"total":129,"perfect":false,"leaks":110,"leaksUncounted":0,"coins":0,"dmg":200146,"bossDmg":0,"heal":20892,"deaths":22,"layerGains":{}}}, + "players": {"p1":{"killed":33,"total":129,"perfect":false,"leaks":96,"leaksUncounted":0,"coins":0,"dmg":664675,"bossDmg":0,"heal":20775,"deaths":20,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,156,0,262,6384,0,19,1], - ["p1",2,"op","chess_char_5_diy2_b",2,"none",0,0,138,0,604,5816,0,38,1], - ["p1",3,"op","chess_char_6_diy1_b",0,"uniequip_002_saga",0,0,158,0,968,9420,3033,35,2], - ["p1",4,"op","chess_char_6_diy2_b",1,"uniequip_002_saga",0,0,101,3,24966,8239,3981,52,7], - ["p1",5,"op","chess_char_6_diy1_b",2,"uniequip_002_saga",927.35,1,159,0,36825,10635,5176,50,2], - ["p1",6,"op","chess_char_6_diy2_b",0,"uniequip_003_saga",2004,1,161,0,4279,6890,2882,60,2], - ["p1",7,"op","chess_char_6_diy1_b",1,"uniequip_003_saga",0,0,132,0,59591,7007,2999,88,7], - ["p1",8,"op","chess_char_6_diy2_b",2,"uniequip_003_saga",2004,1,160,0,31668,6829,2821,61,2], - ["p1",9,"op","chess_char_5_diy1_a",2,null,2564,1,152,0,4398,5128,0,17,1], - ["p1",10,"op","chess_char_5_diy2_b",2,"none",3334,1,145,0,2300,6668,0,14,1], - ["p1",11,"op","chess_char_5_diy1_a",2,null,1271,1,4,0,15488,0,0,198,3], - ["p1",12,"op","chess_char_5_diy2_b",2,"none",1510,1,5,2,18797,0,0,206,4], + ["p1",1,"op","chess_char_6_diy1_b",0,"uniequip_002_saga",0,0,96,0,15524,7159,2901,48,2], + ["p1",2,"op","chess_char_6_diy2_b",1,"uniequip_002_saga",0,0,128,0,18790,8884,4626,52,5], + ["p1",3,"op","chess_char_6_diy1_b",2,"uniequip_002_saga",0,0,98,0,12660,7206,2948,27,2], + ["p1",4,"op","chess_char_6_diy2_b",0,"uniequip_003_saga",2004,1,159,0,6847,7007,2999,54,2], + ["p1",5,"op","chess_char_6_diy1_b",1,"uniequip_003_saga",0,0,157,1,46947,10314,4302,76,6], + ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_003_saga",2004,1,158,0,15383,7007,2999,68,3], + ["p1",7,"op","chess_char_5_diy1_a",0,null,1359,1,4,0,15995,0,0,31,2], + ["p1",8,"op","chess_char_5_diy2_a",1,null,1359,1,5,11,193243,0,0,119,29], + ["p1",9,"op","chess_char_5_diy1_a",2,null,1359,1,15,5,204940,0,0,161,2], + ["p1",10,"op","chess_char_5_diy2_b",0,"none",1614,1,146,1,25198,3228,0,43,2], + ["p1",11,"op","chess_char_5_diy1_b",1,"none",1614,1,143,2,92055,3228,0,48,16], + ["p1",12,"op","chess_char_5_diy2_b",2,"none",0,0,138,0,17093,4842,0,28,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_10124_uashld_2":[18,0,18,25716,36236],"enemy_1043_zomsbr":[66,19,47,2425,177615],"enemy_1061_zomshd":[45,0,45,38785,118952]}, - "hooks": [1,161,6868,1261,1261,3359,3255,44463,41,151,33,32,0,28415,0,62,129,110,1,49,0,0,104], - "events": {"atk":1302,"deploy":29,"die":41,"dmg":3255,"fx":167,"leak":110,"skill":65,"spawn":144,"status":44}, - "fx": {"aoe":14,"buff":14,"dodge":104,"dp":18,"dying":17}, - "snaps": "bba0f774 83a7fe2a 8e13d5aa 4bb67145 e79aa0b4 38e547de 36b43066 56a64a01 d4d007b7 6e27fab1 f6f8669c bbacc967 be4172d9 d55bad91 4d605caf fb745e4a 93002000 0e1af5c3 a3d025c7 82b41ecd 8e13ba87 c7c33611 5048d3b1" + "enemies": {"enemy_10124_uashld_2":[18,0,18,15861,120545],"enemy_1043_zomsbr":[66,31,35,1342,281173],"enemy_1061_zomshd":[45,2,43,33062,392464]}, + "hooks": [1,159,6707,1048,1048,3575,3461,59651,53,149,71,70,0,32282,0,54,129,96,1,68,0,0,114], + "events": {"atk":1249,"deploy":27,"die":53,"dmg":3461,"fx":215,"leak":96,"skill":141,"spawn":144,"status":43}, + "fx": {"aoe":11,"buff":13,"dodge":114,"dp":15,"dying":17,"explosion":45}, + "snaps": "16295416 fba275f2 635566cc 2e3e6a18 f20f8ef2 2aaccd2c aae17d6a 99cd3ff6 a1ee2f48 b38c7b9b 5a02d9fe dbd1ec17 05bbeb89 34b71379 e86b1ee6 770c6674 e962160f 957dc960 6f072e78 3ff4fbd4 4b247ed5 22f35900 d30acbaf" }, "diy-016": { - "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", + "about": "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 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", "fast": false, "kind": "normal", "stageId": "act1autochess_m05", "modeId": "mode_multi_abyss", - "round": 12, + "round": 13, "seed": 1164779827, - "waveId": "act1autochess_h05", - "time": 230, - "ticks": 6900, - "reason": "timeout", - "killed": 10, - "total": 129, + "waveId": "act1autochess_h06", + "time": 215.8, + "ticks": 6474, + "reason": "cleared", + "killed": 1, + "total": 123, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 0, + "rngDraws": 1311, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":10,"total":129,"perfect":false,"leaks":119,"leaksUncounted":0,"coins":0,"dmg":1302151,"bossDmg":0,"heal":64999,"deaths":8,"layerGains":{}}}, + "players": {"p1":{"killed":1,"total":123,"perfect":false,"leaks":122,"leaksUncounted":0,"coins":0,"dmg":1385299,"bossDmg":0,"heal":0,"deaths":12,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_5_diy1_a",2,null,2604,1,146,0,4582,6677,0,21,1], - ["p1",2,"op","chess_char_5_diy2_b",2,"uniequip_002_acfend",3371,1,4,1,29987,38053,0,161,3], - ["p1",3,"op","chess_char_5_diy1_a",2,null,1529,1,147,0,305817,7402,0,61,4], - ["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acpion",1904,1,148,1,673341,9901,0,65,5], - ["p1",5,"op","chess_char_5_diy1_a",2,null,2638,1,9,0,110941,15041,0,161,4], - ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acguad",0,0,96,0,75825,6822,0,52,2], - ["p1",7,"op","chess_char_5_diy1_a",2,null,1133,1,10,0,13450,0,0,63,2], - ["p1",8,"op","chess_char_5_diy2_b",2,"none",1360,1,11,0,29042,0,0,114,3], - ["p1",9,"op","chess_char_5_diy1_a",2,null,1218,1,1,0,0,0,28266,69,4], - ["p1",10,"op","chess_char_5_diy2_b",2,"none",1374,1,3,0,0,0,36732,75,4], - ["p1",11,"op","chess_char_5_diy1_a",2,null,932,1,5,0,25478,0,0,142,4], - ["p1",12,"op","chess_char_5_diy2_b",2,"none",1131,1,7,0,33688,0,0,161,4] + ["p1",1,"op","chess_char_5_diy1_b",0,"uniequip_002_amgoat",1744,1,10,0,41502,0,0,76,3], + ["p1",2,"op","chess_char_5_diy2_b",1,"uniequip_002_amgoat",1744,1,11,0,111875,0,0,75,27], + ["p1",3,"op","chess_char_5_diy1_b",2,"uniequip_002_amgoat",1744,1,1,0,304917,0,0,158,2], + ["p1",4,"op","chess_char_5_diy2_b",0,"uniequip_003_amgoat",1794,1,3,0,78257,0,0,150,4], + ["p1",5,"op","chess_char_5_diy1_b",1,"uniequip_003_amgoat",1794,1,5,0,297905,0,0,124,49], + ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_003_amgoat",1794,1,7,1,343044,0,0,178,3], + ["p1",7,"op","chess_char_6_diy1_a",0,null,1359,1,9,0,0,0,0,0,0], + ["p1",8,"op","chess_char_6_diy2_a",1,null,1359,1,12,0,139144,0,0,124,29], + ["p1",9,"op","chess_char_6_diy1_a",2,null,0,0,136,0,9594,4077,0,27,0], + ["p1",10,"op","chess_char_6_diy2_b",0,"none",0,0,137,0,12979,4842,0,30,1], + ["p1",11,"op","chess_char_6_diy1_b",1,"none",0,0,130,0,33531,4842,0,16,7], + ["p1",12,"op","chess_char_6_diy2_b",2,"none",0,0,131,0,12551,4842,0,28,0] ], - "enemies": {"enemy_1288_duskls":[36,4,32,8694,384228],"enemy_1288_duskls_2":[51,4,47,18716,487509],"enemy_1292_duskld":[42,2,36,56485,593026]}, - "hooks": [1,148,6900,1334,1334,6884,6884,144,18,133,40,35,0,39897,302,49,129,115,1,31,0,0,0], - "events": {"atk":1334,"deploy":19,"die":18,"dmg":6884,"fx":161,"heal":144,"leak":115,"skill":75,"spawn":141,"status":595}, - "fx": {"aoe":69,"dp":10,"ember":10,"slash":72}, - "snaps": "950798c3 af3aacaa 15bc2a8e 1db933ba afcb4e5a 9dd60327 313fb4fc a9a7c988 995cd476 18dfeaeb f0e3d1e3 5e96d2bc 85790c53 e2a78c2e 82e24969 b7cbc177 724c41b8 eeb13a15 4ca505dc 87cbb93c a1aec30f 6e8f8a35 88e54a01" + "enemies": {"enemy_1010_demon":[54,0,54,4332,549815],"enemy_1422_lrsldr_2":[39,1,38,4356,432755],"enemy_1425_lrcmra_2":[30,0,30,9915,499049]}, + "hooks": [1,143,6474,1007,1007,4602,4602,0,13,135,125,125,0,40054,0,13,123,122,1,13,0,0,0], + "events": {"atk":1542,"deploy":20,"die":13,"dmg":4602,"fx":112,"leak":122,"skill":250,"spawn":135}, + "fx": {"explosion":112}, + "snaps": "4136957e ff979ac1 99dc17a0 464104ed 8a15871d 2caabc28 c1dd887f c102125c a2356aaf 89ad10f2 d1bc460f 5155ee77 e46c587b 76d21c4f bf7cfd91 0e98aef9 8f7c2eda be7d713c 3ea703db b7dfa36e b0f1fe1c 502a59af" }, "diy-017": { - "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", + "about": "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 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", "fast": false, "kind": "normal", "stageId": "act1autochess_m06", "modeId": "mode_multi_funny", - "round": 12, + "round": 13, "seed": 1791740796, - "waveId": "act1autochess_h05", - "time": 230, - "ticks": 6900, - "reason": "timeout", - "killed": 31, - "total": 129, + "waveId": "act1autochess_h06", + "time": 216.3, + "ticks": 6489, + "reason": "cleared", + "killed": 40, + "total": 105, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 1152, + "rngDraws": 27, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":31,"total":129,"perfect":false,"leaks":98,"leaksUncounted":0,"coins":0,"dmg":706203,"bossDmg":0,"heal":65284,"deaths":9,"layerGains":{}}}, + "players": {"p1":{"killed":40,"total":105,"perfect":false,"leaks":65,"leaksUncounted":0,"coins":0,"dmg":662377,"bossDmg":0,"heal":0,"deaths":20,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_5_diy1_a",0,null,0,0,143,1,16557,3730,0,65,2], - ["p1",2,"op","chess_char_5_diy2_b",0,"uniequip_002_sharp2",2374,1,6,10,297934,0,0,163,3], - ["p1",3,"op","chess_char_5_diy1_a",2,null,1154,1,9,0,0,0,0,0,0], - ["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acspec",1448,1,12,0,9103,17433,0,245,0], - ["p1",5,"op","chess_char_5_diy1_a",2,null,0,0,144,4,33164,2544,0,102,1], - ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acnipe",0,0,138,10,63698,3174,0,103,1], - ["p1",7,"op","chess_char_5_diy1_a",2,null,1372,1,146,3,81968,1676,0,40,1], - ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_accast",0,0,139,2,133296,3498,0,42,2], - ["p1",9,"op","chess_char_5_diy1_a",2,null,1224,1,8,0,0,13670,39528,92,3], - ["p1",10,"op","chess_char_5_diy2_b",2,"uniequip_002_acmedc",1414,1,10,0,0,11233,25756,85,3], - ["p1",11,"op","chess_char_5_diy1_a",2,null,1160,1,11,0,34031,12085,0,145,4], - ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acsupo",1430,1,7,1,36453,10559,0,145,3] + ["p1",1,"op","chess_char_6_diy1_b",0,"uniequip_002_amgoat",1794,1,122,2,44019,1794,0,56,2], + ["p1",2,"op","chess_char_6_diy2_b",1,"uniequip_002_amgoat",1794,1,127,4,126769,1794,0,56,19], + ["p1",3,"op","chess_char_6_diy1_b",2,"uniequip_002_amgoat",0,0,5,11,89809,1794,0,67,1], + ["p1",4,"op","chess_char_6_diy2_b",0,"uniequip_003_amgoat",0,0,2,4,34907,1844,0,43,2], + ["p1",5,"op","chess_char_6_diy1_b",1,"uniequip_003_amgoat",0,0,79,6,83876,3688,0,30,14], + ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_003_amgoat",0,0,74,3,61500,3688,0,30,1], + ["p1",7,"op","chess_char_5_diy1_a",0,null,0,0,66,1,18543,2440,0,19,3], + ["p1",8,"op","chess_char_5_diy2_a",1,null,0,0,81,3,29731,2440,0,33,1], + ["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,73,0,26322,2440,0,28,0], + ["p1",10,"op","chess_char_5_diy2_b",0,"none",0,0,69,1,23839,2898,0,21,4], + ["p1",11,"op","chess_char_5_diy1_b",1,"none",0,0,113,2,70138,2898,0,68,1], + ["p1",12,"op","chess_char_5_diy2_b",2,"none",0,0,104,3,52924,2898,0,43,1] ], - "enemies": {"enemy_1288_duskls":[36,9,26,16821,139007],"enemy_1288_duskls_2":[51,12,38,16750,229385],"enemy_1292_duskld":[42,10,29,46031,337811]}, - "hooks": [1,146,6900,1736,1736,2223,2411,326,40,133,23,20,0,32700,19289,76,129,93,1,122,0,0,12], - "events": {"atk":1984,"deploy":17,"die":40,"dmg":2411,"fx":186,"heal":276,"leak":93,"skill":43,"spawn":141,"status":1376}, - "fx": {"aoe":9,"dodge":52,"ember":82,"revive":43}, - "snaps": "554a5ebc 9e43a33e bb797ba0 b3fa2b0d a8d36bc6 31b302ef 529006ab 38501f79 36327a80 cf730116 c5d3cb85 d2c1eacc 1b1ccb54 2ee482e3 e9a344fb b1094511 cf3ba2a6 b06c6743 8b06b756 21ac81b3 56fa3031 a0a55b07 00a9721a" + "enemies": {"enemy_1116_liprr_2":[27,10,17,2608,81818],"enemy_1119_vofsd":[48,19,29,12099,261141],"enemy_1121_lifbos_2":[30,11,19,15909,319418]}, + "hooks": [1,127,6489,566,566,919,919,638,60,125,49,49,0,18805,7,51,105,65,1,60,0,0,0], + "events": {"atk":614,"deploy":22,"die":60,"dmg":919,"fx":45,"leak":65,"skill":98,"spawn":117,"status":143}, + "fx": {"explosion":32,"liberate":13}, + "snaps": "d9c99b22 31e833b6 82cc3a13 e8197969 a2c825a4 4ca31cdb 4d13e180 36cd1df5 4d64afb5 1af3f651 d707d2c2 ec28710a d045ee1f ebcbf523 bc3891db e8e2e634 0d2e69cc 7d15e716 5b276fdc bb9ff685 14dea4eb e3a0a927" }, "diy-018": { - "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", + "about": "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 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", "fast": false, "kind": "normal", "stageId": "act1autochess_m07", @@ -707,40 +707,40 @@ "round": 13, "seed": 151019241, "waveId": "act1autochess_h06", - "time": 229.47, - "ticks": 6884, - "reason": "cleared", - "killed": 14, + "time": 230, + "ticks": 6900, + "reason": "timeout", + "killed": 5, "total": 66, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 140, + "rngDraws": 0, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":14,"total":66,"perfect":false,"leaks":52,"leaksUncounted":0,"coins":0,"dmg":145919,"bossDmg":0,"heal":10797,"deaths":22,"layerGains":{}}}, + "players": {"p1":{"killed":5,"total":66,"perfect":false,"leaks":61,"leaksUncounted":0,"coins":0,"dmg":69851,"bossDmg":0,"heal":0,"deaths":20,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_6_diy1_a",2,null,0,0,3,0,0,2604,0,0,0], - ["p1",2,"op","chess_char_6_diy2_b",2,"uniequip_002_acfend",0,0,6,0,0,5264,0,0,0], - ["p1",3,"op","chess_char_6_diy1_a",2,null,1529,1,92,1,8350,3058,0,0,3], - ["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acpion",1175.46,1,91,2,46935,5252,0,0,4], - ["p1",5,"op","chess_char_6_diy1_a",2,null,2638,1,94,0,0,6617,0,0,0], - ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acguad",0,0,56,0,0,7062,0,0,0], - ["p1",7,"op","chess_char_6_diy1_a",2,null,1272,1,95,2,9262,2544,0,19,1], - ["p1",8,"op","chess_char_6_diy2_b",2,"uniequip_002_acnipe",1643,1,93,2,37345,3989,0,26,1], - ["p1",9,"op","chess_char_6_diy1_a",2,null,0,0,9,3,21458,2098,0,8,1], - ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_accast",0,0,57,4,22568,6623,0,10,1], - ["p1",11,"op","chess_char_6_diy1_a",2,null,0,0,88,0,0,4800,1128,6,1], - ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_002_acmedc",0,0,76,0,0,4293,9669,12,1], + ["p1",1,"op","chess_char_5_diy1_b",0,"uniequip_002_cerber",905.59,1,90,1,12303,3831,0,19,6], + ["p1",2,"op","chess_char_5_diy2_b",1,"uniequip_002_cerber",1579,1,91,0,6746,3158,0,12,1], + ["p1",3,"op","chess_char_5_diy1_b",2,"uniequip_002_cerber",0,0,84,0,4163,3158,0,9,0], + ["p1",4,"op","chess_char_5_diy2_b",0,"uniequip_003_cerber",25.33,1,88,0,12981,4562,0,17,7], + ["p1",5,"op","chess_char_5_diy1_b",1,"uniequip_003_cerber",0,0,51,1,3662,3058,0,7,0], + ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_003_cerber",0,0,6,1,8701,1529,0,7,1], + ["p1",7,"op","chess_char_6_diy1_a",0,null,0,0,8,0,339,1220,0,1,1], + ["p1",8,"op","chess_char_6_diy2_a",1,null,0,0,59,0,1508,2440,0,7,0], + ["p1",9,"op","chess_char_6_diy1_a",2,null,0,0,55,0,1081,2440,0,5,0], + ["p1",10,"op","chess_char_6_diy2_b",0,"none",0,0,47,0,1551,2898,0,5,2], + ["p1",11,"op","chess_char_6_diy1_b",1,"none",0,0,3,2,8910,1449,0,15,1], + ["p1",12,"op","chess_char_6_diy2_b",2,"none",0,0,4,0,7905,1449,0,6,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_1005_yokai_2":[12,4,8,2859,10285],"enemy_1041_lazerd_2":[24,7,17,51346,73453],"enemy_1042_frostd":[30,3,27,0,62181]}, - "hooks": [1,95,6884,219,219,409,406,30,36,88,13,13,0,15472,0,0,66,52,1,36,0,0,3], - "events": {"atk":265,"deploy":27,"die":36,"dmg":406,"fx":77,"heal":28,"leak":52,"skill":26,"spawn":80,"status":70}, - "fx": {"aoe":8,"dodge":3,"dp":10,"slash":49,"spGain":7}, - "snaps": "f2a9f471 04b39488 23993030 35ed6830 b5437606 d3f911db 07212186 f3242d93 226a6dd0 4e481925 fe09eafe ed71cd44 5fc4c6b7 9b821568 d267706d e3bb0e6d c9278acf 5dab0b7b e63dd125 ff34cf11 72bc01ed 3d6ce7c2 155f6593" + "enemies": {"enemy_1005_yokai_2":[12,4,8,3982,10285],"enemy_1041_lazerd_2":[24,0,24,27210,24080],"enemy_1042_frostd":[30,1,28,0,35486]}, + "hooks": [1,91,6900,229,229,306,306,0,25,85,20,20,0,11356,24,0,66,60,1,25,0,0,0], + "events": {"atk":229,"deploy":23,"die":25,"dmg":306,"leak":60,"skill":40,"spawn":80,"status":76}, + "fx": {}, + "snaps": "7cee673a 0c2b1cbd 61954cdc 99fa1027 989a1ca1 13facebd b9342091 1a3a9947 c865ff92 b953ca9c df328f21 4e6260d5 014ffdab 8dd5a417 69d56480 cae4ce8e dffc6b60 ca2c08e2 a6178db4 1d338c05 58374fe8 d58f8ded c04611d9" }, "diy-019": { - "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", + "about": "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 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", "fast": false, "kind": "normal", "stageId": "act2autochess_m01", @@ -748,29 +748,282 @@ "round": 13, "seed": 777575195, "waveId": "act1autochess_h06", - "time": 226.37, - "ticks": 6791, + "time": 221.87, + "ticks": 6656, "reason": "cleared", "killed": 0, "total": 123, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 48, + "rngDraws": 84, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":0,"total":123,"perfect":false,"leaks":123,"leaksUncounted":0,"coins":0,"dmg":80622,"bossDmg":0,"heal":0,"deaths":26,"layerGains":{}}}, + "players": {"p1":{"killed":0,"total":123,"perfect":false,"leaks":123,"leaksUncounted":0,"coins":0,"dmg":77468,"bossDmg":0,"heal":0,"deaths":22,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,84,0,2677,3730,0,10,0], - ["p1",2,"op","chess_char_6_diy2_b",0,"uniequip_002_sharp2",0,0,81,0,10830,4988,0,10,1], - ["p1",3,"op","chess_char_6_diy1_a",2,null,445.15,1,150,0,14344,12249,0,21,0], - ["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acspec",1305.72,1,151,0,40481,13534,0,25,0], - ["p1",5,"op","chess_char_6_diy1_a",2,null,0,0,144,0,5093,2320,0,13,1], - ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acsupo",0,0,2,0,7196,1450,0,12,1] + ["p1",1,"op","chess_char_6_diy1_b",0,"uniequip_002_cerber",0,0,145,0,12724,4887,0,17,5], + ["p1",2,"op","chess_char_6_diy2_b",1,"uniequip_002_cerber",1629,1,146,0,13671,3258,0,23,1], + ["p1",3,"op","chess_char_6_diy1_b",2,"uniequip_002_cerber",0,0,128,0,10797,3258,0,15,1], + ["p1",4,"op","chess_char_6_diy2_b",0,"uniequip_003_cerber",0,0,138,0,8540,4707,0,12,4], + ["p1",5,"op","chess_char_6_diy1_b",1,"uniequip_003_cerber",0,0,9,0,4960,1569,0,9,0], + ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_003_cerber",0,0,75,0,3090,3138,0,6,0], + ["p1",7,"op","chess_char_5_diy1_a",0,null,0,0,7,0,706,1380,0,1,1], + ["p1",8,"op","chess_char_5_diy2_a",1,null,0,0,74,0,1050,2760,0,3,0], + ["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,80,0,3465,2760,0,9,0], + ["p1",10,"op","chess_char_5_diy2_b",0,"none",0,0,71,0,836,3278,0,2,0], + ["p1",11,"op","chess_char_5_diy1_b",1,"none",0,0,1,0,5408,1639,0,4,1], + ["p1",12,"op","chess_char_5_diy2_b",2,"none",0,0,5,0,12222,1639,0,11,1] ], - "enemies": {"enemy_1019_jshoot_2":[57,0,57,27300,13901],"enemy_1299_ymkilr_2":[27,0,27,8814,15599],"enemy_1422_lrsldr_2":[39,0,39,2157,51121]}, - "hooks": [1,151,6791,268,268,311,322,0,26,149,3,22,0,2673,831,24,123,123,1,26,0,0,0], - "events": {"atk":269,"deploy":28,"die":26,"dmg":292,"fx":17,"leak":123,"skill":6,"spawn":129,"status":148}, - "fx": {"displace":16,"dodge":1}, - "snaps": "d3c36d93 c8105b93 41795df3 3046aeff a5dda3f7 c89d03fb 8b0755bf 812c58cf 0e95d7b1 e01cf127 9fac8774 2622d747 5741d29b ae6a2b21 361fa71f 174be52a dc2ff8bd 55bf9d28 6f794424 593fdf3b c893bb85 57a582f3 c2eec42e" + "enemies": {"enemy_1019_jshoot_2":[57,0,57,23908,672],"enemy_1299_ymkilr_2":[27,0,27,8715,29589],"enemy_1422_lrsldr_2":[39,0,39,1650,47206]}, + "hooks": [1,146,6656,221,225,313,313,0,22,145,14,14,0,7462,38,14,123,123,1,22,0,0,0], + "events": {"atk":253,"deploy":23,"die":22,"dmg":313,"fx":92,"leak":123,"skill":28,"spawn":135,"status":120}, + "fx": {"tornado":86,"tornadoPulse":6}, + "snaps": "f7ae5bde 659eeb55 a6fea098 ecf9afaf c0c59203 97894aee 6216bbe1 40a32490 b1eae1a2 71ae2db4 3d794870 1e07a170 def7e30c 399c3318 6ec37466 2bb3307f 4907aa44 6aece016 d9da6c87 f487b5a6 0d581c19 6fac680f f372326b" + }, + "diy-020": { + "about": "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 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", + "fast": false, + "kind": "normal", + "stageId": "act2autochess_m02", + "modeId": "mode_multi_hard", + "round": 12, + "seed": 3432466190, + "waveId": "act1autochess_h05", + "time": 224.07, + "ticks": 6722, + "reason": "cleared", + "killed": 15, + "total": 117, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 249, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":15,"total":117,"perfect":false,"leaks":102,"leaksUncounted":0,"coins":0,"dmg":103166,"bossDmg":0,"heal":0,"deaths":22,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_b",0,"uniequip_002_heyak",0,0,141,1,10628,5277,0,17,4], + ["p1",2,"op","chess_char_5_diy2_b",1,"uniequip_002_heyak",1759,1,142,2,8095,3518,0,7,1], + ["p1",3,"op","chess_char_5_diy1_b",2,"uniequip_002_heyak",0,0,140,0,6727,5277,0,10,0], + ["p1",4,"op","chess_char_5_diy2_b",0,"uniequip_003_heyak",0,0,131,0,8227,3488,0,7,3], + ["p1",5,"op","chess_char_5_diy1_b",1,"uniequip_003_heyak",0,0,5,1,7578,1744,0,7,1], + ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_003_heyak",0,0,8,3,18221,1744,0,9,1], + ["p1",7,"op","chess_char_5_diy1_b",0,"uniequip_004_heyak",0,0,86,2,3953,3478,0,7,2], + ["p1",8,"op","chess_char_5_diy2_b",1,"uniequip_004_heyak",0,0,89,3,6514,3478,0,7,1], + ["p1",9,"op","chess_char_5_diy1_b",2,"uniequip_004_heyak",0,0,85,0,8215,3478,0,11,0], + ["p1",10,"op","chess_char_6_diy1_a",0,null,0,0,10,1,4307,1380,0,5,2], + ["p1",11,"op","chess_char_6_diy2_a",1,null,0,0,77,0,1575,2760,0,3,0], + ["p1",12,"op","chess_char_6_diy1_a",2,null,0,0,3,2,19126,1380,0,7,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_1005_yokai":[51,11,40,0,33306],"enemy_1005_yokai_2":[54,4,50,20431,34319],"enemy_1112_emppnt":[12,0,12,0,35540]}, + "hooks": [1,142,6722,215,225,287,287,0,37,139,16,16,0,7863,184,0,117,102,1,37,0,0,0], + "events": {"atk":332,"deploy":23,"die":37,"dmg":287,"fx":274,"leak":102,"skill":32,"spawn":131,"status":329}, + "fx": {"bombard":30,"bombardShell":30,"tornado":192,"tornadoPulse":22}, + "snaps": "0ea317dd e4ef0efd 0f75b724 fb55e181 2df1c099 9065533e 709835ae 43639274 9b2e3494 903332a5 7d489728 c2b62f65 2eced12b 7bc988e3 9532960b 8d53c14b 2547c4d4 c6218f24 1a86704b 388176ba 379dffe2 cec0e88f eba2bd69" + }, + "diy-021": { + "about": "6_diy1_b=heyak/S1 6_diy2_b=heyak/S2 6_diy1_b=heyak/S3 6_diy2_b=heyak/S1/002_heyak 6_diy1_b=heyak/S2/002_heyak 6_diy2_b=heyak/S3/002_heyak 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", + "fast": false, + "kind": "normal", + "stageId": "act2autochess_m03", + "modeId": "mode_single_normal", + "round": 13, + "seed": 2403220507, + "waveId": "act1autochess_h06", + "time": 209.83, + "ticks": 6295, + "reason": "cleared", + "killed": 38, + "total": 123, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 2116, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":38,"total":123,"perfect":false,"leaks":85,"leaksUncounted":0,"coins":0,"dmg":1041884,"bossDmg":0,"heal":0,"deaths":9,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_6_diy1_b",0,"none",1639,1,8,8,113014,0,0,121,25], + ["p1",2,"op","chess_char_6_diy2_b",1,"none",1639,1,11,5,119247,0,0,124,5], + ["p1",3,"op","chess_char_6_diy1_b",2,"none",1639,1,13,2,116709,0,0,99,2], + ["p1",4,"op","chess_char_6_diy2_b",0,"uniequip_002_heyak",1814,1,15,0,127755,0,0,123,24], + ["p1",5,"op","chess_char_6_diy1_b",1,"uniequip_002_heyak",1814,1,4,6,134083,0,0,120,4], + ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_heyak",1814,1,9,6,177973,0,0,97,2], + ["p1",7,"op","chess_char_6_diy1_b",0,"uniequip_003_heyak",1779,1,134,0,9640,1779,0,4,3], + ["p1",8,"op","chess_char_6_diy2_b",1,"uniequip_003_heyak",1779,1,130,6,51375,1779,0,36,2], + ["p1",9,"op","chess_char_6_diy1_b",2,"uniequip_003_heyak",0,0,123,1,36920,3558,0,30,1], + ["p1",10,"op","chess_char_6_diy2_b",0,"uniequip_004_heyak",0,0,84,1,36103,3538,0,33,7], + ["p1",11,"op","chess_char_6_diy1_b",1,"uniequip_004_heyak",1769,1,126,0,9672,3538,0,9,1], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_004_heyak",1769,1,137,3,109394,1769,0,57,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], + ["-","~3","device","trap_1105_accrate",null,null,100,1,3,0,0,0,0,0,null] + ], + "enemies": {"enemy_1006_shield_3":[21,1,20,4778,347551],"enemy_1043_zomsbr":[66,32,34,1042,256175],"enemy_1402_tgshd_2":[36,5,31,10142,438158]}, + "hooks": [1,145,6295,795,883,1782,1782,19520,47,132,78,76,0,37103,1170,20,123,85,1,47,0,0,0], + "events": {"atk":1681,"deploy":19,"die":47,"dmg":1782,"fx":1976,"leak":85,"skill":154,"spawn":138,"status":1242}, + "fx": {"expose":327,"tornado":1507,"tornadoPulse":142}, + "snaps": "154c679b 3d6402ec 6e769538 6ab466ef 62867862 da8a1d4c b45529ad 173fec15 5cf39f28 50909bd4 9b896c35 f3a66c2e e37801fa 65130b32 aa798f03 165a46dc 8a61b747 404ad7d9 7f4ac4d0 e744d033 b0313af3" + }, + "diy-022": { + "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, + "kind": "normal", + "stageId": "act2autochess_m04", + "modeId": "mode_multi_abyss", + "round": 12, + "seed": 4043654158, + "waveId": "act1autochess_h05", + "time": 217.17, + "ticks": 6515, + "reason": "cleared", + "killed": 0, + "total": 60, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 0, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":0,"total":60,"perfect":false,"leaks":60,"leaksUncounted":0,"coins":0,"dmg":238265,"bossDmg":0,"heal":15821,"deaths":11,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,78,0,193,9709,0,14,0], + ["p1",2,"op","chess_char_5_diy2_b",2,"none",0,0,69,0,636,10746,0,40,1], + ["p1",3,"op","chess_char_5_diy1_a",2,null,0,0,80,0,2406,10463,0,14,1], + ["p1",4,"op","chess_char_5_diy2_b",2,"none",0,0,81,0,6489,14796,0,25,1], + ["p1",5,"op","chess_char_5_diy1_a",2,null,1271,1,3,0,4404,0,0,186,3], + ["p1",6,"op","chess_char_5_diy2_b",2,"none",1510,1,4,0,5674,0,0,191,3], + ["p1",7,"op","chess_char_5_diy1_a",2,null,1133,1,11,0,62578,0,0,134,3], + ["p1",8,"op","chess_char_5_diy2_b",2,"none",1360,1,13,0,41175,0,0,75,3], + ["p1",9,"op","chess_char_5_diy1_a",2,null,1218,1,5,0,0,0,15821,34,3], + ["p1",10,"op","chess_char_5_diy2_b",2,"none",1374,1,10,0,0,0,0,0,0], + ["p1",11,"op","chess_char_5_diy1_a",2,null,932,1,12,0,52535,0,0,133,3], + ["p1",12,"op","chess_char_5_diy2_b",2,"none",1131,1,14,0,62176,0,0,134,3], + ["-","~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_1045_hammer_2":[12,0,12,9413,62906],"enemy_1061_zomshd":[48,0,48,36302,193719]}, + "hooks": [1,81,6515,1074,1074,1499,1499,28159,11,71,24,24,0,30191,267,19,60,60,1,11,0,0,0], + "events": {"atk":1074,"deploy":19,"die":11,"dmg":1499,"heal":34,"leak":60,"skill":48,"spawn":74,"status":526}, + "fx": {}, + "snaps": "ed45c79d 41c1e676 2e14b30d b48b95c8 4b801cd2 41ab4233 9026deca a3296660 429cf1b6 89decde1 7777667a d5618a1c 8ca97be1 052d4cef 6c2cd06c d430d438 4c299321 c4a11a5a b70b2578 d2452c1b 77f7fcda a3cbdc7d" + }, + "diy-023": { + "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", + "fast": false, + "kind": "normal", + "stageId": "act1autochess_m01", + "modeId": "mode_multi_funny", + "round": 12, + "seed": 3417269346, + "waveId": "act1autochess_h05", + "time": 227.1, + "ticks": 6813, + "reason": "cleared", + "killed": 69, + "total": 90, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 590, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":69,"total":90,"perfect":false,"leaks":21,"leaksUncounted":0,"coins":0,"dmg":1023477,"bossDmg":0,"heal":14586,"deaths":8,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",2,null,1521.6,1,109,2,15495,5294,0,65,1], + ["p1",2,"op","chess_char_5_diy2_b",2,"uniequip_002_acfend",3241.64,1,110,1,12911,3500,0,72,1], + ["p1",3,"op","chess_char_5_diy1_a",2,null,833,1,111,3,17512,3754,0,35,4], + ["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acpion",1904,1,112,11,98576,3808,0,46,4], + ["p1",5,"op","chess_char_5_diy1_a",2,null,0,0,99,3,32149,5276,0,76,2], + ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acguad",3411,1,8,8,77972,12979,0,80,4], + ["p1",7,"op","chess_char_5_diy1_a",2,null,1272,1,4,1,12574,0,0,99,2], + ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_acnipe",1587,1,5,7,43402,0,0,167,3], + ["p1",9,"op","chess_char_5_diy1_a",2,null,1372,1,11,14,325543,0,0,77,2], + ["p1",10,"op","chess_char_5_diy2_b",2,"uniequip_002_accast",1749,1,13,19,387342,0,0,82,2], + ["p1",11,"op","chess_char_5_diy1_a",2,null,1224,1,6,0,0,0,14586,36,2], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acmedc",1414,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_1116_liprr_2":[27,23,4,530,184905],"enemy_1119_vofsd":[39,31,8,7229,394032],"enemy_1121_lifbos_2":[24,15,9,26852,444539]}, + "hooks": [1,112,6813,1008,1008,2264,2242,4720,77,98,27,25,0,36404,0,68,90,21,1,78,0,0,22], + "events": {"atk":1164,"deploy":19,"die":77,"dmg":2242,"fx":208,"heal":53,"leak":21,"skill":52,"spawn":105,"status":140}, + "fx": {"aoe":83,"dodge":22,"dp":22,"liberate":17,"slash":64}, + "snaps": "41a18c9d bd868b70 27d2436e b7492865 3ab2f457 71e187b0 a5cd2c30 fe0d034b bbeb3ead 65ae5d1e bc1f9489 f11d020f 48862f4d a3dbe46b 02028874 38b6aabd d482bde2 5e407c1e 0271a614 23fb46c3 df7cee7b 1a073763 e8b77221" + }, + "diy-024": { + "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", + "fast": false, + "kind": "normal", + "stageId": "act1autochess_m02", + "modeId": "mode_single_hard", + "round": 13, + "seed": 762369271, + "waveId": "act1autochess_h06", + "time": 228.6, + "ticks": 6858, + "reason": "cleared", + "killed": 50, + "total": 150, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 361, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":50,"total":150,"perfect":false,"leaks":100,"leaksUncounted":0,"coins":0,"dmg":577408,"bossDmg":0,"heal":0,"deaths":20,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_6_diy1_a",2,null,0,0,149,3,23880,5208,0,93,2], + ["p1",2,"op","chess_char_6_diy2_b",2,"uniequip_002_acfend",1158.22,1,1,1,20866,2273,0,87,2], + ["p1",3,"op","chess_char_5_diy1_a",0,null,554.31,1,166,4,38417,3176,0,82,2], + ["p1",4,"op","chess_char_5_diy2_b",0,"uniequip_002_sharp2",0,0,158,11,122141,4748,0,114,2], + ["p1",5,"op","chess_char_6_diy1_a",2,null,1529,1,178,10,73708,3058,0,27,3], + ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acpion",1904,1,176,5,112191,3808,0,44,4], + ["p1",7,"op","chess_char_5_diy1_a",2,null,1154,1,168,0,4091,6924,0,55,0], + ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_acspec",1448,1,177,0,7334,2896,0,39,0], + ["p1",9,"op","chess_char_6_diy1_a",2,null,0,0,3,1,5989,2638,0,17,1], + ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_acguad",0,0,153,2,36613,7062,0,82,2], + ["p1",11,"op","chess_char_5_diy1_a",2,null,1160,1,6,4,54429,0,0,139,3], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acsupo",1430,1,8,9,77750,0,0,152,3] + ], + "enemies": {"enemy_1249_lysdb_2":[60,23,37,12691,277690],"enemy_1251_lysyta":[51,19,32,951,106585],"enemy_1329_cbshld":[39,8,31,28149,193132]}, + "hooks": [1,178,6858,1304,1304,2040,2118,0,70,170,24,29,0,27635,12377,61,150,100,1,70,0,0,18], + "events": {"atk":1366,"deploy":28,"die":70,"dmg":2101,"fx":273,"leak":100,"skill":45,"spawn":162,"status":955}, + "fx": {"aoe":91,"displace":8,"dodge":46,"dp":22,"shieldBreak":50,"slash":56}, + "snaps": "bf720db8 3551effc aec52c42 fddc5dfc 5a03ba5d 8759b1f3 c422cfd3 46c45547 1e6a1048 114adde0 5a35acfe 65b1e213 17b8e6ba 80238f40 a9480213 e5bf3780 4a4c8f92 d2daf783 37a3cba2 2207b2e3 c43ba464 b96a5ea8 e898dc69" + }, + "diy-025": { + "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", + "fast": false, + "kind": "normal", + "stageId": "act1autochess_m03", + "modeId": "mode_multi_normal", + "round": 13, + "seed": 135818316, + "waveId": "act1autochess_h06", + "time": 230, + "ticks": 6900, + "reason": "timeout", + "killed": 19, + "total": 93, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 161, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":19,"total":93,"perfect":false,"leaks":74,"leaksUncounted":0,"coins":0,"dmg":188129,"bossDmg":0,"heal":12396,"deaths":30,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,5,0,0,1865,0,0,0], + ["p1",2,"op","chess_char_6_diy2_b",0,"uniequip_002_sharp2",0,0,7,8,32894,2494,0,16,1], + ["p1",3,"op","chess_char_6_diy1_a",2,null,0,0,127,0,0,11168,0,0,0], + ["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acspec",1218.18,1,126,0,0,12711,0,0,0], + ["p1",5,"op","chess_char_6_diy1_a",2,null,0,0,114,2,27126,2544,0,22,1], + ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acnipe",1643,1,128,3,40029,5274,0,28,1], + ["p1",7,"op","chess_char_6_diy1_a",2,null,0,0,69,2,7324,3365,0,4,0], + ["p1",8,"op","chess_char_6_diy2_b",2,"uniequip_002_accast",0,0,4,4,66037,1819,0,9,1], + ["p1",9,"op","chess_char_6_diy1_a",2,null,0,0,6,0,0,1451,5675,10,1], + ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_acmedc",0,0,9,0,0,3252,6721,14,1], + ["p1",11,"op","chess_char_6_diy1_a",2,null,0,0,76,0,5096,2978,0,10,1], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_002_acsupo",0,0,75,0,9623,5690,0,12,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_1005_yokai":[33,8,25,0,19102],"enemy_1005_yokai_2":[48,11,35,14812,48875],"enemy_1005_yokai_3":[12,0,12,39799,120152]}, + "hooks": [1,128,6900,397,397,477,490,48,49,121,8,23,0,7222,492,0,93,72,1,49,0,0,0], + "events": {"atk":445,"deploy":32,"die":49,"dmg":490,"fx":17,"heal":33,"leak":72,"skill":16,"spawn":108,"status":106}, + "fx": {"aoe":1,"dodge":5,"spGain":11}, + "snaps": "23838382 76cbf86d d3ab405e cee04457 5c293fcc e3a8b2aa 467d33a8 822b9661 2c316180 8998addc 70e829a7 927c2541 812fb701 8d8e74fa 7b940531 f24d2714 326d6baf ed42cbb6 f905a7a2 ea68c7f1 7fcaf95d 21d52b01 648da7f9" } } }