diff --git a/server/sim/content/kits/index.js b/server/sim/content/kits/index.js index b47d568b..d4b5bef8 100644 --- a/server/sim/content/kits/index.js +++ b/server/sim/content/kits/index.js @@ -78,7 +78,11 @@ 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-shining.js', + 'op-cgbird.js', + 'op-saga.js', +]); /** * The 预备干员 whose every skill the generic kit covers exactly (冲锋号令, 攻击力 / 防御力 / 治疗强化, 战术咏唱, 一击即退 — diff --git a/server/sim/content/kits/ops/op-cgbird.js b/server/sim/content/kits/ops/op-cgbird.js new file mode 100644 index 00000000..1af348e5 --- /dev/null +++ b/server/sim/content/kits/ops/op-cgbird.js @@ -0,0 +1,158 @@ +// server/sim/content/kits/ops/op-cgbird.js — 夜莺 (char_179_cgbird) 自选 operator kit: 6★ 群愈师 (医疗), an owned-6★ pick of +// the tier-5 and tier-6 自选 slots; every skill, both talents, the trait, both modules at every form and her summon 幻影. +// Kit contract and the 自选 rules: ../README.md ("How to add an operator (自选)"). +// +// Forms (data/backups.json units.char_179_cgbird, 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; the 幻影 token record +// backups.json tokens.token_10003_cgbird_bird with its owner-form / module variants) and PRTS 夜莺 (S2 备注 +// "多个屏障吸收量可叠加,持续时间独立计算,优先消耗先生成的屏障,法术抗性增加效果不可叠加"; 转瞬即逝的幻影 备注 "幻影的持有上限为3个, +// 每次部署夜莺时补充2个幻影 / Y模组2级时…补充3个 / 夜莺离场时,已部署的幻影会留在场上"); PRTS 卫戍协议/帮助 §作战阶段 (summons: +// "所有手动部署的召唤物,无视所属干员的持有状态,不消耗持有数量,作战开始时立即部署一次", "若战场区初始部署有召唤物,若召唤物在 +// 战斗期间退场,将在满足条件后立即原地再部署1个"). +// - Trait (群愈师) "同时恢复三个友方单位的生命": the profession default (3 heals). Module RIN-Y “莺歌” "同时恢复四个友方单位的 +// 生命" (hidden module talent attack@max_target / skill@max_target 4): 4 heals (kit trait, as 调香师's RIN-Y). RIN-X +// “封闭的希望” "攻击范围扩大": her range becomes the module's own grid (its range-only talent change, talentIndex −1: y-2 +// plus the centre tile [0,3] — PRTS y-3), as shared/loadoutRecord.js attackRangeGrid draws it; 圣域 keeps its own y-4. +// - T1 白恶魔的庇护 "攻击范围内的友方单位法术抗性+15": every ally (operators and summons) standing in her current attack range +// — her own tile included — RES +magic_resistance (flat). RIN-X stage 2+ "…且受到的治疗效果提升5%" (talent change +// heal_scale): also healing received ×heal_scale there. Refreshed every 0.2 s; two sources keep the strongest. +// - T2 转瞬即逝的幻影 (summon token_10003_cgbird_bird: no attack, blocks nothing, RES 75, taunt level 1 — its stats — and +// its talent "30%的物理闪避…每秒流失3%的最大生命": dodgePhys prob, a 流失 of hp_ratio × its max HP every second; RIN-Y +// stage 3 "40%的物理闪避": the module variant's talent). The 幻影 is a hand piece (the match's per-player shop): a placed +// one deploys with the board at the battle start for free and without using her stock. Each deployment of 夜莺 adds +// cnt (2; RIN-Y stage 2+: 3) to her stock, at most PHANTOM_HOLD_CAP; a placed 幻影 that falls comes back on its own tile +// once its redeploy time (respawnTime) has passed and she holds one — using one, paying its DP cost as a deployment +// does [ASSUMED: "满足条件" = a 幻影 held, its redeploy time, the DP], whether 夜莺 is on the field or not (deployed +// 幻影 stay when she leaves: PRTS 备注). No tokens.js kit: its talent and its return are this kit's (owner-coupled, +// as tokens.js "Managed mode"), applied at each of its deployments. +// - S1 治疗强化·γ型 (MANUAL, 30 s, data DEFAULT — heal skill): ATK +atk. +// - S2 法术护盾 (AUTO, 2 charges, data DEFAULT — a "next heal" waits for her heal, as 闪灵's S2): "下次治疗使所有目标获得一个 +// 持续N秒的屏障,屏障能吸收相当于夜莺攻击力X%的法术伤害,同时使目标法术抗性+Y" — every target of that heal (3 / 4) gets a +// 屏障 of atk_scale × her ATK for duration s that absorbs arts damage only (buff shieldType 'arts', damage.js +// absorbShields) and RES +magic_resistance (flat) while one of her barriers lasts (op-shining.js grantBarrier: each +// barrier its own timer, older ones first, the RES bonus not stacking) [ASSUMED: the bonus goes with the last barrier]. +// - S3 圣域 (MANUAL, 60 s, data ACTIVE_RANGE on its y-4 — the owner's rule: an injured ally inside it): range y-4 while it +// runs, ATK +atk; every ally in that range RES +magic_resistance (×(1 + v): "法术抗性+105%") and dodgeArts prob +// ("获得20%的法术闪避"), refreshed every 0.2 s. +// Medic: heals only (dmgType heal), ranged, no anti-air question; ground enemies target her normally (no 起飞 / 迷彩 / 隐匿). + +import { num, talentBb, moduleBb, moduleOn, skillRec } from '../shared/tier1.js'; +import { rangeAura, grantBarrier } from './op-shining.js'; + +const S1 = 'skcom_heal_up[3]'; +const S2 = 'skchr_cgbird_2'; +const S3 = 'skchr_cgbird_3'; +export const PHANTOM = 'token_10003_cgbird_bird'; +/** PRTS 转瞬即逝的幻影 备注 "幻影的持有上限为3个" (no blackboard key). */ +export const PHANTOM_HOLD_CAP = 3; +/** Seconds between two tries of a fallen 幻影 to come back (tile busy, DP short, none held). */ +const RETRY = 0.25; + +const bbOf = (chess, id) => skillRec(chess, id)?.bb ?? {}; + +/** + * RIN-X "攻击范围扩大": the picked module's own range grid (its range-only talent change, talentIndex −1), or null — the + * rule of shared/loadoutRecord.js attackRangeGrid (the card / board range) and shared/tier5.js moduleRangeUp. + */ +function moduleRange(chess) { + if (!chess?.isGolden || !moduleOn(chess) || !/攻击范围扩大/.test(String(chess?.trait?.moduleDesc ?? ''))) return null; + const rec = (chess.modules ?? []).find((m) => m && m.uniEquipId === chess.module.id); + const g = (rec?.talentChanges ?? []).find((t) => t && t.talentIndex === -1 && Array.isArray(t.rangeGrid) && t.rangeGrid.length)?.rangeGrid; + return g ? g.map((p) => [p[0], p[1]]) : null; +} + +/** + * The 幻影's own talent blackboard (`prob`, `hp_ratio`) from its def at the owner's form and module: the last talent + * holding `prob` — a module's upgrade (RIN-Y stage 3: 40 %) follows the base talent in the variant data. + * @param {object} def normalised token def + */ +export function phantomTalent(def) { + let out = {}; + for (const t of def?.talents ?? []) if (t && t.bb && t.bb.prob != null) out = t.bb; + return out; +} + +export default { + char_179_cgbird: (bb, chess) => { + const b1 = bbOf(chess, S1), b2 = bbOf(chess, S2), b3 = bbOf(chess, S3); + const s2 = skillRec(chess, S2), s3 = skillRec(chess, S3); + const t0 = talentBb(chess, 0); // 白恶魔的庇护: magic_resistance (RIN-X stage 2+: heal_scale) + const t1 = talentBb(chess, 1); // 转瞬即逝的幻影: cnt (RIN-Y stage 2+: 3) + const hidden = moduleBb(chess); // RIN-Y: attack@max_target + const heals = Math.floor(num(hidden['attack@max_target'])); + const grid = moduleRange(chess); + const picked = chess?.skill?.skillId ?? null; + const tokenId = (chess?.talents ?? []).find((t) => t && t.tokenKey)?.tokenKey ?? PHANTOM; + return { + trait: heals > 0 ? { heal: { mode: 'multi', count: heals } } : undefined, + skills: { + [S1]: { kind: 'duration', heal: true, mods: { atkPct: num(b1.atk) } }, + [S2]: { + kind: num(s2?.maxChargeTime, 1) > 1 ? 'charges' : 'instant', + heal: true, + attack: { healScale: 1 }, // the next heal (ai.js doHeal calls onHit for every heal target) + onHit({ battle, unit, target }) { + if (!target || target.side !== 'ally') return; + grantBarrier(battle, unit, target, { + key: 'cgbird:barrier', statKey: 'cgbird:barrierRes', shield: unit.s.atk * num(b2.atk_scale), + duration: num(b2.duration), mods: { resFlat: num(b2.magic_resistance) }, shieldType: 'arts', + }); + }, + }, + [S3]: { kind: 'duration', heal: true, mods: { atkPct: num(b3.atk) }, targeting: s3?.rangeGrid ? { rangeGrid: s3.rangeGrid } : undefined }, + }, + talents: [ + { install(battle, unit) { // 白恶魔的庇护: allies in her attack range RES +magic_resistance; RIN-X stage 2+: healing ×heal_scale + const r = num(t0.magic_resistance), hs = num(t0.heal_scale, 1); + if (!(r > 0) && hs === 1) return; + const mods = { ...(r ? { resFlat: r } : null), ...(hs !== 1 ? { healingTakenMul: hs } : null) }; + rangeAura(battle, unit, { key: 'talent:cgbird:res', value: r + (hs - 1) * 100, mods }); + } }, + { install(battle, unit) { // 转瞬即逝的幻影: the 幻影's talent, her stock, a fallen 幻影's return + const cnt = Math.max(0, Math.floor(num(t1.cnt))); + if (!(cnt > 0)) return; + unit.mem.phantomStock = 0; + const mine = (t) => !!t && t.kind === 'token' && t.defId === tokenId && t.ownerUnit === unit; + battle.on('deploy', (ctx) => { + const u = ctx.unit; + if (u === unit) { + unit.mem.phantomStock = Math.min(PHANTOM_HOLD_CAP, (unit.mem.phantomStock ?? 0) + cnt); + return; + } + if (!mine(u)) return; + const tal = phantomTalent(u.def); + const p = num(tal.prob), hr = num(tal.hp_ratio); + if (p > 0) battle.addBuff(u, { key: 'cgbird:phantomDodge', mods: { dodgePhys: p }, tags: ['talent'] }); + if (hr > 0) { + battle.addBuff(u, { + key: 'cgbird:phantomDrain', interval: 1, tags: ['talent'], + onTick: ({ unit: t }) => battle.loseHp(t, t.s.maxHp * hr, { silent: true, tags: ['cgbird:phantom'] }), + }); + } + }, { owner: unit }); + battle.on('death', (ctx) => { + const t = ctx.unit; + if (!mine(t) || ctx.reason !== 'killed' || battle.finished) return; + t.removed = false; // the piece stays (Battle.redeploy accepts it; its hooks are kept) + const at = battle.time + Math.max(0, num(t.base.respawnTime)); + battle.every(RETRY, (b, sched) => { + if (t.alive || t.removed || b.finished) { sched.cancel(); return; } + if (b.time + 1e-9 < at || !((unit.mem.phantomStock ?? 0) > 0)) return; + if (b.redeploy(t, { free: false })) { unit.mem.phantomStock--; sched.cancel(); } + }, { owner: unit }); + }, { owner: unit }); + } }, + ], + install(battle, unit) { + // RIN-X: the module's range is her own (the initial range of the DEFAULT trigger too); 圣域 runs its y-4 + if (grid) { unit.rangeGrid = grid; battle.refreshRange(unit); } + // 圣域: allies in her (y-4) range RES ×(1 + magic_resistance), arts dodge prob, while the skill runs + if (picked === S3) { + const mr = num(b3.magic_resistance), p = num(b3.prob); + if (mr > 0 || p > 0) rangeAura(battle, unit, { key: 'skill:cgbird:sanctuary', value: mr, mods: { resMul: 1 + mr, dodgeArts: p }, on: () => !!unit.skill?.active }); + } + }, + }; + }, +}; diff --git a/server/sim/content/kits/ops/op-saga.js b/server/sim/content/kits/ops/op-saga.js new file mode 100644 index 00000000..a42824af --- /dev/null +++ b/server/sim/content/kits/ops/op-saga.js @@ -0,0 +1,231 @@ +// server/sim/content/kits/ops/op-saga.js — 嵯峨 (char_362_saga) 自选 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_362_saga, 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); gamedata_const ba.dying +// "重伤: 移速下降且无法被阻挡,10秒后自然死亡,被击杀后使击杀者回复数点技力"; PRTS 嵯峨 (劝善 备注 "本天赋第一部分实际效果为: +// 自身造成的伤害不会致命(至多使目标生命值降至1点),成功造成伤害后若目标生命值小于等于1则为目标附加重伤"; 清明 备注 "嵯峨每次 +// 部署都可以触发一次本天赋"; S2 备注 "可选择重伤单位", "攻击附加延迟检测Buff:0.7s后进行检测,强制击杀持有重伤的目标(击杀来源为 +// 嵯峨自身),随后解除目标的重伤"; S3 备注 "造成伤害前判断目标生命值"); PRTS 术语释义 重伤 ("重伤Buff包含:移动速度-80%,禁疗、 +// 禁用近战,阻挡数、生命回复速度、生命回复速度(百分比)归零,从消失状态变为出现的瞬间立刻死亡(消失状态期间不会因重伤自然死亡)", +// "重伤造成的自然死亡为强制死亡(也即可以杀死持有不死的单位),视为无来源击杀", "重伤期间的单位无法再被施加重伤"); PRTS 异常效果 +// 禁用近战 "敌人类单位无法进行阻挡攻击,无法被阻挡". +// - Trait (尖兵) "能够阻挡两个敌人": the profession default (block 2). SOL-X 何处寻驮? "阻挡敌人时攻击力和防御力各+8%" +// (trait bb atk / def): +atk / +def while she blocks an enemy. SOL-Y 身向云泥 "首次部署时部署费用-4" (hidden +// runtime_cost −4): the first deployment of a battle costs nothing in this mode ⇒ no effect (as 推进之王's SOL-Y). +// - T1 劝善: her damage is never lethal to an enemy (a `fatal` hook keeps it at 1 HP — every damage of hers: attacks, 除恶; +// not a 无来源 one, which has no source); after a damage of hers an enemy at ≤ 1 HP becomes 重伤 (the DYING buff, once: +// none while it holds one): move speed ×(1 + move_speed) (−80 %), unblockable (禁用近战: released by its blocker, no +// block attack), 禁疗 (healFree / noHeal), its HP regeneration zeroed; it dies `interval` s later (10) — a forced, 无来源 +// death (battle.kill with no killer: no SP, 不死 does not hold it) — not while it is 消失 (hidden), and at once when it +// comes back from 消失. Whoever kills a 重伤 enemy gets `sp` SP (2; "击杀者技力+2", giveSp: not during a timed skill). +// "嵯峨不攻击重伤单位": the kit trait `skipEnemy` (targeting.js canTargetEnemy) — no normal attack, block target or +// trigger target of hers is a 重伤 enemy. SOL-X stage 2+ "对生命值低于一半的单位造成的伤害提升15%" (hidden hp_ratio / +// damage_scale): ×damage_scale on every damage of hers whose target is below hp_ratio before it. +// A shared-pool leader (boss rounds: its HP is the pool's, damage.js runs no `fatal` step for it) is outside 劝善 +// [ASSUMED: her damage there is ordinary]. +// - T2 清明 "生命值低于40%时,仅一次获得70%物理闪避和每秒回复5%的最大生命,持续15秒": once per deployment (PRTS 备注), the first +// time a damage leaves her below hp_ratio of her max HP: dodgePhys prob and hpRegenRatio for `duration` s — the +// blackboard key hp_recovery_per_sec_by_max_hp_ratio is the 生命回复速度(百分比) attribute (PRTS 异常效果 禁疗 / 术语释义 +// 重伤 name it), as 宴 S1 / 山 / 幽灵鲨 / 蜜蜡 / 烛煌 apply it [ASSUMED: no 备注 of 清明 says so; 余's 闲云隐市 with the same +// key is still open, DESIGN 0.2.0.l3]. SOL-Y stage 2+: the talent change's numbers — at stage 3 the text reads 6 % (its +// potential-5 text 7 %) while the blackboard is 0.065: the game applies the blackboard, so 6.5 % per second. +// - S1 冲锋号令·γ型 (AUTO, no target): +cost DP at once; an AUTO skill acting on nobody fires as soon as its SP is full +// (`trigger: 'SP_FULL'`, as 推进之王's / 德克萨斯's kits cast the same skill — the owner's AUTO rule). +// - S2 除恶 (MANUAL, 2 charges, data SKILL_RANGE on its x-6 cross: any enemy there, 无视其不可选中): +cost DP; the up to +// S2_MAX (6, the text's — no blackboard key) selectable ground enemies of the cross ("地面敌人"; a 重伤 one included: +// "可选择重伤单位"), best targets first (her priority) [ASSUMED order], take atk_scale × ATK physical (a skill damage; +// 劝善 applies); S2_CHECK s later each of them still 重伤 is killed (killer 嵯峨: she gets its SP, stats and bounty; a +// forced kill — battle.kill, no `fatal` step), then its 重伤 is lifted (should a kill handler have revived it). +// - S3 怒目 (MANUAL, 20 s, data ACTIVE_RANGE on her 1-1 + 1): +cost DP every interval s while it runs (value in all; the +// rest of value at its natural end), attack interval +base_attack_time s (+0.5 on her 1.05), 攻击距离 +1 +// (targeting.rangeExtend), ATK +atk, every enemy she blocks at once (hitAllBlocked; one target in range while she +// blocks none), and one more attack on each target that was below attack@hp_ratio before the hit (PRTS 备注: an HP +// snapshot at beforeAttack; the extra attack is a forced one a tick later, no 重伤 target). +// Melee physical, ground-only (canHitFly false), ground enemies target her normally (no 起飞 / 迷彩 / 隐匿). + +import { num, talentBb, moduleBb, traitBb, skillRec, toggleBuff, batMod, giveSp, up } from '../shared/tier1.js'; +import { absoluteRangeKeys, canTargetEnemy, sortEnemyTargets } from '../../../targeting.js'; + +const S1 = 'skcom_charge_cost[3]'; +const S2 = 'skchr_saga_2'; +const S3 = 'skchr_saga_3'; +/** The 重伤 buff (gamedata_const ba.dying): one per enemy — "重伤期间的单位无法再被施加重伤". */ +export const DYING = 'saga:dying'; +/** S2 除恶 备注 "攻击附加延迟检测Buff:0.7s后进行检测" (no blackboard key). */ +export const S2_CHECK = 0.7; +/** S2 除恶 "对十字范围内最多6名地面敌人" — the text's number when it cannot be read (no blackboard key). */ +const S2_MAX = 6; +/** The x-6 cross (skill range) when the data carries no grid. */ +const X6 = Object.freeze([[2, 0], [1, 0], [0, -2], [0, -1], [0, 0], [0, 1], [0, 2], [-1, 0], [-2, 0]]); +/** 除恶's selection: ground enemies only ("地面敌人"), 重伤 ones included (no skipEnemy). */ +const GROUND = Object.freeze({ canHitFly: false, groundOnly: true }); + +/** Is `e` 重伤 (whoever put it there)? */ +export const isDying = (e) => !!(e && typeof e.findBuff === 'function' && e.findBuff(DYING)); + +/** + * 重伤 on enemy `e` from `saga` (PRTS 术语释义 重伤): move speed ×(1 + ms), unblockable (禁用近战), 禁疗, no HP regeneration; + * a forced, 无来源 death `life` s later — never while 消失, at once when it comes back from 消失. The killer of a 重伤 + * enemy gets `sp` SP (the talent's kill hook reads `data.sp`). Nothing when it already holds one. + */ +function applyDying(battle, saga, e, { sp, life, ms }) { + if (!e || !e.alive || isDying(e)) return; + battle.addBuff(e, { + key: DYING, source: saga, visible: true, + mods: { moveMul: Math.max(0, 1 + ms), hpRegen: -1e9 }, + flags: { unblockable: true, healFree: true, noHeal: true }, + data: { sp, until: battle.time + life, hidden: !!e.hidden }, + onTick: ({ battle: b, unit: x, buff }) => { + const d = buff.data; + if ((d.hidden && !x.hidden) || (!x.hidden && b.time + 1e-9 >= d.until)) { b.kill(x, null); return; } + d.hidden = !!x.hidden; + }, + }); + battle.fx('dying', { x: e.x, y: e.y, id: e.id, from: saga.id }); +} + +export default { + char_362_saga: (bb, chess) => { + const b1 = skillRec(chess, S1)?.bb ?? {}, b2 = skillRec(chess, S2)?.bb ?? {}, b3 = skillRec(chess, S3)?.bb ?? {}; + const s2 = skillRec(chess, S2); + const t0 = talentBb(chess, 0); // 劝善: move_speed, sp, interval + const t1 = talentBb(chess, 1); // 清明: hp_ratio, hp_recovery_per_sec_by_max_hp_ratio, prob, duration + const hidden = moduleBb(chess); // SOL-X stage 2+: hp_ratio, damage_scale; SOL-Y: runtime_cost (no effect) + const tb = traitBb(chess); // SOL-X: atk, def while blocking + const picked = chess?.skill?.skillId ?? null; + const maxHit = Math.max(1, Math.floor(num(/最多(\d+)名/.exec(String(s2?.desc ?? ''))?.[1], S2_MAX))); + return { + // 劝善 "嵯峨不攻击重伤单位" + trait: { skipEnemy: isDying }, + skills: { + [S1]: { + kind: 'instant', trigger: 'SP_FULL', + onStart({ battle, unit }) { + const n = num(b1.cost); + battle.addDp(unit.ownerId, n); + battle.fx('dp', { x: unit.x, y: unit.y, n, id: unit.id }); + }, + }, + [S2]: { + kind: num(s2?.maxChargeTime, 1) > 1 ? 'charges' : 'instant', + onStart({ battle, unit }) { + const n = num(b2.cost); + battle.addDp(unit.ownerId, n); + battle.fx('dp', { x: unit.x, y: unit.y, n, id: unit.id }); + const keys = absoluteRangeKeys(s2?.rangeGrid ?? X6, unit.tileR, unit.tileC, unit.dir, 0); + const list = battle.enemiesInKeys(keys, unit, GROUND); + sortEnemyTargets(battle, unit, list, unit.profile?.priority ?? null); + const hit = list.slice(0, maxHit); + battle.fx('aoe', { x: unit.x, y: unit.y, radius: 2, id: unit.id, skill: 'saga:cleanse', n: hit.length }); + for (const e of hit) { + battle.dealDamage(unit, e, { amount: unit.s.atk * num(b2.atk_scale, 1), type: 'phys', isSkill: true, tags: ['saga:s2'] }); + if (!e.alive) continue; + battle.addBuff(e, { + key: 'saga:s2check', refresh: 'independent', maxStacks: 99, duration: S2_CHECK, source: unit, + onExpire: ({ battle: b, unit: x }) => { + if (!x.alive || !isDying(x)) return; + b.kill(x, unit); + if (x.alive) b.removeBuff(x, DYING); + }, + }); + } + }, + }, + [S3]: { + kind: 'duration', + mods: { atkPct: num(b3.atk), batPct: batMod(b3.base_attack_time, chess) }, + targeting: { rangeExtend: num(b3.ability_range_forward_extend) }, + attack: { hitAllBlocked: true }, + onStart({ unit }) { unit.mem.sagaDp = { acc: 0, got: 0 }; }, + onTick({ battle, unit, dt }) { + const st = unit.mem.sagaDp; + const iv = num(b3.interval, 1), n = num(b3.cost), total = num(b3.value); + if (!st || !(iv > 0) || !(n > 0)) return; + st.acc += dt; + while (st.acc + 1e-9 >= iv && st.got + n <= total + 1e-9) { + st.acc -= iv; + st.got += n; + battle.addDp(unit.ownerId, n); + } + }, + onEnd({ battle, unit, reason }) { + const st = unit.mem.sagaDp; + unit.mem.sagaDp = null; + // the last grant falls on the very end of its 20 s + if (st && reason === 'duration' && num(b3.value) - st.got > 1e-9) battle.addDp(unit.ownerId, num(b3.value) - st.got); + }, + }, + }, + talents: [ + { install(battle, unit) { // 劝善 + const sp = num(t0.sp), life = num(t0.interval, 10), ms = num(t0.move_speed, -0.8); + // "自身造成的伤害不会致命(至多使目标生命值降至1点)" — before any other saver: it never was lethal + battle.on('fatal', (c) => { + if (c.source === unit && c.unit && c.unit.side === 'enemy' && !c.prevented) c.prevented = true; + }, { owner: unit, priority: 100 }); + // "成功造成伤害后若目标生命值小于等于1则为目标附加重伤" + battle.on('damaged', (c) => { + const e = c.target; + if (c.source !== unit || !e || e.side !== 'enemy' || !e.alive || e.bossPool || c.type === 'element' || e.hp > 1) return; + applyDying(battle, unit, e, { sp, life, ms }); + }, { owner: unit }); + // "被击杀后使击杀者回复数点技力" — the killer of a 重伤 enemy she marked (none for the 无来源 natural death) + battle.on('kill', (c) => { + const d = c.victim && typeof c.victim.findBuff === 'function' ? c.victim.findBuff(DYING) : null; + if (!d || d.source !== unit || !c.killer || c.killer.side !== 'ally') return; + giveSp(c.killer, num(d.data?.sp)); + }, { owner: unit }); + // SOL-X stage 2+: "对生命值低于一半的单位造成的伤害提升15%" + const hr = num(hidden.hp_ratio), ds = num(hidden.damage_scale, 1); + if (hr > 0 && ds !== 1) { + battle.on('hit', (c) => { + if (c.source === unit && c.target && c.target.side === 'enemy' && c.target.hpRatio < hr) c.dmg.mul *= ds; + }, { owner: unit }); + } + } }, + { install(battle, unit) { // 清明: once per deployment below hp_ratio — dodgePhys prob, hpRegenRatio, `duration` s + const hr = num(t1.hp_ratio), p = num(t1.prob), regen = num(t1.hp_recovery_per_sec_by_max_hp_ratio), dur = num(t1.duration); + if (!(hr > 0) || !(dur > 0)) return; + battle.on('damaged', (c) => { + if (c.target !== unit || !up(unit) || unit.mem.qingmingAt === unit.deploySeq) return; + if (!(unit.hp < unit.s.maxHp * hr)) return; + unit.mem.qingmingAt = unit.deploySeq; + battle.addBuff(unit, { key: 'talent:saga:qingming', duration: dur, mods: { dodgePhys: p, hpRegenRatio: regen }, visible: true, tags: ['talent'] }); + battle.fx('buff', { x: unit.x, y: unit.y, id: unit.id, kind: 'saga:qingming' }); + }, { owner: unit }); + } }, + ], + install(battle, unit) { + // SOL-X 何处寻驮?: 阻挡敌人时攻击力和防御力各+8% + const ma = num(tb.atk), md = num(tb.def); + if (ma || md) toggleBuff(battle, unit, 'trait:saga:block', () => unit.blocking.length > 0, { atkPct: ma, defPct: md }); + // 怒目: one more attack on each target below attack@hp_ratio (checked before the hit) — a forced attack a tick later + if (picked !== S3) return; + const hp3 = num(b3['attack@hp_ratio']); + if (!(hp3 > 0)) return; + let half = null; + battle.on('beforeAttack', (c) => { + if (c.attacker !== unit || unit.mem.sagaExtra || !unit.skill?.active) return; + half = (c.targets || []).filter((e) => e && e.side === 'enemy' && e.hpRatio < hp3); + }, { owner: unit, priority: -100 }); + battle.on('attack', (c) => { + if (c.attacker !== unit || unit.mem.sagaExtra) return; + const list = half; + half = null; + if (!list || !list.length) return; + const dep = unit.deploySeq; + battle.after(0, () => { + if (!up(unit) || unit.deploySeq !== dep || !unit.canAct || unit.s.flags.disarm) return; + const t = list.filter((e) => e.alive && canTargetEnemy(unit, e, unit.profile)); + if (!t.length) return; + unit.mem.sagaExtra = true; + try { battle.forceAttack(unit, t, { noAmmo: true }); } finally { unit.mem.sagaExtra = false; } + }, { owner: unit }); + }, { owner: unit }); + }, + }; + }, +}; diff --git a/server/sim/content/kits/ops/op-shining.js b/server/sim/content/kits/ops/op-shining.js new file mode 100644 index 00000000..d9b57619 --- /dev/null +++ b/server/sim/content/kits/ops/op-shining.js @@ -0,0 +1,142 @@ +// server/sim/content/kits/ops/op-shining.js — 闪灵 (char_147_shining) 自选 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_147_shining, 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 闪灵 (S2 备注 +// "多个屏障吸收量可叠加,持续时间独立计算,优先消耗先生成的屏障,防御力提升效果不可叠加"; PRTS 术语释义 屏障 "若无特殊说明, +// 屏障可吸收全种类伤害"). +// - Trait (医师) "恢复友方单位生命": the profession default (one heal on the lowest-HP% injured ally of her 3-3 range). +// Module PHY-Y 干枯剑鞘 "治疗地面单位时治疗量提升15%" (trait bb heal_scale): ×heal_scale on a heal whose target stands on +// a 地面 tile (unit.ground, as 赫默's PHY-Y); PHY-X “使徒” "治疗生命值低于50%的友方单位时治疗量提升15%" (heal_scale, +// hp_ratio): ×heal_scale when the target is below hp_ratio of its max HP before the heal (as 录武官's / 华法琳's PHY-X). +// - T1 黑恶魔的庇护 "攻击范围内的友方单位防御力+60": every ally (operators and summons: 友方单位) standing in her current +// attack range — her own tile included — DEF +def (flat). PHY-Y stage 2+ "防御力+100,地面单位防御力额外+40" (talent +// change def / def_lowland): def_lowland more on a 地面 tile. Refreshed every AURA s; two sources keep the strongest. +// - T2 法典 "攻击速度+10": ASPD +attack_speed. PHY-X stage 2+ "攻击速度+15,装备技能2时获得+25%攻击力,装备技能3时技力自然 +// 回复速度+0.6/秒" (talent change attack_speed; the hidden module talent's atk / sp_recovery_per_sec): ATK +atk while 自动 +// 掩护 is her picked skill, SP +sp_recovery_per_sec per second while 教条力场 is. +// - S1 信条 (MANUAL, 20 s, data DEFAULT — a heal skill: cast as she is about to heal an injured ally in range): ATK +atk, +// ASPD +attack_speed. +// - S2 自动掩护 (AUTO, 1 charge at rank 4 / 2 at rank 7, data DEFAULT): "下次治疗使目标获得一个持续N秒的屏障,屏障可以吸收相当于 +// 闪灵攻击力X%的伤害,同时使目标防御力+Y%" — a "next heal" waits for her heal, as 推进之王's S2 waits for his attack (the +// owner's SP_FULL rule is for AUTO skills that act on nobody). The heal's target gets a 屏障 of atk_scale × her ATK for +// duration s (every damage type) and DEF +def while it holds: each barrier is its own buff (its own timer; older ones +// absorb first — buff order), the DEF bonus one buff per target, kept while one of her barriers lasts [ASSUMED: it goes +// with the last barrier, broken or expired — the 备注 only says it does not stack]. +// - S3 教条力场 (MANUAL, 60 s, data DEFAULT): ATK +atk; every ally in her attack range DEF +def (%), refreshed every AURA s. +// Medic: heals only (dmgType heal), ranged, no anti-air question; ground enemies target her normally (no 起飞 / 迷彩 / 隐匿). + +import { num, talentBb, moduleBb, traitBb, moduleOn, skillRec, statBuff, up } from '../shared/tier1.js'; + +const S1 = 'skchr_shining_1'; +const S2 = 'skchr_shining_2'; +const S3 = 'skchr_shining_3'; +const PHY_Y = 'uniequip_002_shining'; +const PHY_X = 'uniequip_003_shining'; +/** Aura refresh period and buff life (s): an ally leaving the range loses the buff within one refresh (tier-4 AURA). */ +const AURA = 0.2; +const AURA_DUR = 0.25; + +const bbOf = (chess, id) => skillRec(chess, id)?.bb ?? {}; +const pickedSkill = (chess) => chess?.skill?.skillId ?? null; + +/** + * Keep buff `key` on every ally standing in `unit`'s current attack range (operators and summons, its own tile included; + * never a 孤立 unit — Battle.alliesInGrid) while `on()` holds, refreshed every AURA s; it lapses AURA_DUR s after the + * source stops refreshing it. Several sources of the same effect keep the strongest `value` (same-named buffs). + * Shared with 夜莺's kit (op-cgbird.js). + * @param {object} battle + * @param {object} unit the source + * @param {{ key: string, value: number, mods: object|((ally: object) => object), on?: () => boolean }} o + */ +export function rangeAura(battle, unit, { key, value, mods, on = () => true }) { + battle.every(AURA, () => { + if (!up(unit) || !on()) return; + for (const a of battle.alliesInGrid(unit)) { + const cur = a.findBuff(key); + if (cur && cur.source !== unit && cur.source?.alive && (cur.data?.v ?? 0) > value && cur.timeLeft > 0.05) continue; + battle.addBuff(a, { key, duration: AURA_DUR, mods: typeof mods === 'function' ? mods(a) : mods, source: unit, data: { v: value }, tags: ['aura'] }); + } + }, { owner: unit, immediate: true }); +} + +/** + * A 屏障 on `target` (闪灵 S2 自动掩护, 夜莺 S2 法术护盾): `shield` HP for `duration` s — of `shieldType` damage only when + * given (damage.js absorbShields), else every type — plus the buff `statKey` (`mods`) while any barrier `key` lasts. PRTS + * 备注 of both skills: "多个屏障吸收量可叠加,持续时间独立计算,优先消耗先生成的屏障,…效果不可叠加" — each barrier is its own + * buff (refresh 'independent': its own timer; absorbShields walks the buffs oldest first), the stat bonus one buff whose + * life follows the barriers (it ends when the last one breaks or expires). Shared with 夜莺's kit (op-cgbird.js). + * @param {object} battle + * @param {object} source the operator + * @param {object} target + * @param {{ key: string, statKey: string, shield: number, duration: number, mods: object, shieldType?: string|null }} o + */ +export function grantBarrier(battle, source, target, { key, statKey, shield, duration, mods, shieldType = null }) { + if (!target || !target.alive || !(shield > 0) || !(duration > 0)) return; + const sync = () => { if (!target.buffs.some((b) => b.key === key)) battle.removeBuff(target, statKey); }; + battle.addBuff(target, { + key, refresh: 'independent', maxStacks: 99, duration, shield, shieldType, source, visible: true, onRemove: sync, onExpire: sync, + }); + battle.addBuff(target, { key: statKey, refresh: 'extend', duration, mods, source }); + battle.fx('shield', { x: target.x, y: target.y, id: target.id, from: source.id }); +} + +export default { + char_147_shining: (bb, chess) => { + const b1 = bbOf(chess, S1), b2 = bbOf(chess, S2), b3 = bbOf(chess, S3); + const s2 = skillRec(chess, S2); + const t0 = talentBb(chess, 0); // 黑恶魔的庇护: def (PHY-Y stage 2+: def 100, def_lowland) + const t1 = talentBb(chess, 1); // 法典: attack_speed (PHY-X stage 2+: 15) + const hidden = moduleBb(chess); // PHY-X stage 2+: atk (with S2 picked), sp_recovery_per_sec (with S3 picked) + const tb = traitBb(chess); // PHY-Y: heal_scale; PHY-X: heal_scale, hp_ratio + const mod = moduleOn(chess) ? chess.module.id : null; + const picked = pickedSkill(chess); + return { + skills: { + [S1]: { kind: 'duration', heal: true, mods: { atkPct: num(b1.atk), aspd: num(b1.attack_speed) } }, + [S2]: { + kind: num(s2?.maxChargeTime, 1) > 1 ? 'charges' : 'instant', + heal: true, + attack: { healScale: 1 }, // the next heal (ai.js doHeal calls onHit per heal target) + onHit({ battle, unit, target }) { + if (!target || target.side !== 'ally') return; + grantBarrier(battle, unit, target, { + key: 'shining:barrier', statKey: 'shining:barrierDef', shield: unit.s.atk * num(b2.atk_scale), + duration: num(b2.duration), mods: { defPct: num(b2.def) }, + }); + }, + }, + [S3]: { kind: 'duration', heal: true, mods: { atkPct: num(b3.atk) } }, + }, + talents: [ + { install(battle, unit) { // 黑恶魔的庇护: allies in her attack range DEF +def; PHY-Y stage 2+: 地面 units +def_lowland + const d = num(t0.def), low = num(t0.def_lowland); + if (!(d > 0) && !(low > 0)) return; + rangeAura(battle, unit, { key: 'talent:shining:def', value: d + low, mods: (a) => ({ defFlat: d + (a.ground ? low : 0) }) }); + } }, + { install(battle, unit) { // 法典: ASPD +attack_speed; PHY-X stage 2+: ATK +atk with S2, SP +0.6/s with S3 + statBuff(battle, unit, 'talent:shining:aspd', { aspd: num(t1.attack_speed) }); + if (picked === S2) statBuff(battle, unit, 'talent:shining:s2', { atkPct: num(hidden.atk) }); + if (picked === S3) statBuff(battle, unit, 'talent:shining:s3', { spRecoveryFlat: num(hidden.sp_recovery_per_sec) }); + } }, + ], + install(battle, unit) { + // 教条力场: allies in her attack range DEF +def % while the skill runs + if (picked === S3 && num(b3.def) > 0) { + rangeAura(battle, unit, { key: 'skill:shining:def', value: num(b3.def), mods: { defPct: num(b3.def) }, on: () => !!unit.skill?.active }); + } + // module traits: PHY-Y heals on 地面 units, PHY-X heals on allies below hp_ratio, ×heal_scale + const hs = num(tb.heal_scale, 1); + if (!mod || hs === 1) return; + const boosted = mod === PHY_X ? (t) => t.hpRatio < num(tb.hp_ratio) : mod === PHY_Y ? (t) => !!t.ground : null; + if (!boosted) return; + battle.on('heal', (ctx) => { + if (ctx.source !== unit || ctx.opts?.regen || !ctx.target || !boosted(ctx.target)) return; + ctx.amount *= hs; + }, { owner: unit }); + }, + }; + }, +}; diff --git a/test/content/op_cgbird.test.js b/test/content/op_cgbird.test.js new file mode 100644 index 00000000..e72c2406 --- /dev/null +++ b/test/content/op_cgbird.test.js @@ -0,0 +1,303 @@ +// test/content/op_cgbird.test.js — the 自选 operator kit of 夜莺 (char_179_cgbird, 6★ 群愈师; kit +// server/sim/content/kits/ops/op-cgbird.js) and her summon 幻影 (token_10003_cgbird_bird), fielded the production way (a DIY +// slot + its `diy` pick, simdata getDiy; the 幻影 as a board token piece of hers) in every form: tiers 5 / 6, normal (E2 Lv1, +// skill rank 4, no module) and elite (E2 Lv60, rank 7) with no module, RIN-X “封闭的希望” or RIN-Y “莺歌” at stage 1 +// (tier 5) / 3 (tier 6). Every number is read back from data/backups.json; the fidelity checklist of kits/README.md. +// Run: node --test test/content/op_cgbird.test.js + +import { test } from 'node:test'; +import assert from 'node:assert/strict'; +import { readFileSync } from 'node:fs'; +import { makeBattle, enemyRec, chessRec, checkInvariants } from '../helpers/battleHarness.js'; +import { KITTED_CHARS, OPERATOR_KITS, KITS } from '../../server/sim/content/kits/index.js'; +import { diyPool, validateDiyPicks, diyRecord } from '../../shared/diy.js'; +import { attackRangeGrid } from '../../shared/loadoutRecord.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 CGBIRD = 'char_179_cgbird'; +const PHANTOM = 'token_10003_cgbird_bird'; +const FORMS = BACKUPS.units[CGBIRD].forms; +const SLOT = { 5: 'chess_char_5_diy1_a', 6: 'chess_char_6_diy1_a' }; +const RINX = 'uniequip_002_cgbird', RINY = 'uniequip_003_cgbird'; +const S1 = 'skcom_heal_up[3]', S2 = 'skchr_cgbird_2', S3 = 'skchr_cgbird_3'; +const statusOf = (tier, elite) => (elite ? (tier === 5 ? '2/60/7/1' : '2/60/7/3') : '2/1/4/0'); +const formOf = (tier, elite) => FORMS[statusOf(tier, elite)]; +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 tokenVariant = (tier, elite, mod) => { + const v = BACKUPS.tokens[PHANTOM].variants[`${CGBIRD}@${statusOf(tier, elite)}`]; + return mod && v.byModule?.[mod] ? { ...v, ...v.byModule[mod] } : v; +}; +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 ENEMIES = { enemy_dummy: enemyRec({ key: 'enemy_dummy', hp: 1e9, speed: 0, mass: 0 }) }; +const ALLIES = { test_melee_a: chessRec({ id: 'test_melee_a', profession: 'WARRIOR', stats: { maxHp: 10000, def: 100, res: 10, atk: 0 }, skill: null }) }; +const FORMS_ALL = [[5, false, null], [6, false, null], ...[5, 6].flatMap((t) => [null, RINX, RINY].map((m) => [t, true, m]))]; +const label = ([tier, elite, mod]) => `T${tier} ${elite ? 'elite' : 'normal'} ${mod ?? 'none'}`; + +/** + * 夜莺 as uid 1 on the 高台 tile (11,2) facing RIGHT — her y-2: rows 10–12, cols 1–4; RIN-X adds (11,5); 圣域's y-4 adds + * (11,5) and (9,1)–(9,3) —, allies (melee, no skill) at (11,3) uid 2, (10,3) uid 3, (12,3) uid 4, (10,4) uid 5 (all in + * y-2), (11,5) uid 6 (RIN-X / y-4 only), (9,3) uid 7 (y-4 only), (11,8) uid 8 (outside); `phantom` = a board 幻影 of hers. + */ +function field({ tier = 5, elite = false, mod = null, skill = 0, seed = 5, phantom = null, dp = 0 } = {}) { + const ally = (uid, row, col) => ({ uid, chessId: 'test_melee_a', row, col }); + const h = makeBattle({ + defs: { enemies: ENEMIES, chess: ALLIES }, timeLimit: 900, autoFinish: false, seed, + flags: { dpPerSec: 0, dpMax: 999, dpInit: dp }, hooks: ['damaged', 'heal', 'attack', 'skillStart', 'skillEnd', 'death', 'deploy'], captureNoisy: true, + units: [ + { uid: 1, diy: { slot: SLOT[tier], charId: CGBIRD, skillIndex: skill, uniEquipId: mod }, elite, row: 11, col: 2 }, + ally(2, 11, 3), ally(3, 10, 3), ally(4, 12, 3), ally(5, 10, 4), ally(6, 11, 5), ally(7, 9, 3), ally(8, 11, 8), + ...(phantom ? [{ uid: 9, kind: 'token', tokenId: PHANTOM, ownerUid: 1, row: phantom[0], col: phantom[1] }] : []), + ], + }); + h.step(); + const u = h.unit(1); + return { h, u, a: (uid) => h.unit(uid), bird: phantom ? h.b.allyUnits.find((t) => t.kind === 'token' && t.uid === 9) : null }; +} +function done(h) { + checkInvariants(h.b); + assert.equal(h.b.errors.length, 0, JSON.stringify(h.b.errors[0])); +} +const rangeOf = (tier, elite, mod) => { + const rec = diyRecord(SLOT[tier], { charId: CGBIRD, skillIndex: 0, uniEquipId: mod }, { elite, data: { chess: CHESS, backups: BACKUPS } }); + return attackRangeGrid(rec); +}; + +test('夜莺 in every 自选 form: her operator kit (all three skills authored), the form\'s stats + module attributes, y-2 (RIN-X: its grid), 3 heals (RIN-Y: 4), no 特质', () => { + assert.equal(OPERATOR_KITS[CGBIRD], KITS[CGBIRD]); + 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], [CGBIRD, SLOT[tier], form.skills[skill].skillId, false, 'skills'], label(f)); + assert.deepEqual([u.base.maxHp, u.base.atk, u.base.def, u.base.res, u.base.aspd], + [form.stats.maxHp + (m?.attr.maxHp ?? 0), form.stats.atk + (m?.attr.atk ?? 0), form.stats.def, form.stats.res + (m?.attr.res ?? 0), form.stats.aspd + (m?.attr.aspd ?? 0)], `${label(f)}: stats`); + assert.deepEqual([u.profile.dmgType, u.profile.heal?.mode, u.profile.heal?.count, u.profile.attack], ['heal', 'multi', elite && mod === RINY ? 4 : 3, 'ranged'], `${label(f)}: 群愈师`); + const rinx = elite && mod === RINX; + const mg = rinx ? modOf(tier, RINX).talentChanges.find((t) => t.talentIndex === -1).rangeGrid : form.rangeGrid; + assert.deepEqual(u.liveRangeGrid, mg, `${label(f)}: range`); + assert.deepEqual(u.liveRangeGrid, rangeOf(tier, elite, mod), `${label(f)}: the range the card draws (attackRangeGrid)`); + assert.equal(mg.length, rinx ? 13 : 12, `${label(f)}: y-2 (+ [0,3])`); + assert.deepEqual([u.def.bonds, u.def.raw.garrisonIds], [['emptyShip'], []], `${label(f)}: bonds / 特质`); + assert.ok(!u.s.flags.liftoff && !u.s.flags.camou && !u.s.flags.stealth && !u.s.flags.untargetable, `${label(f)}: enemies target her`); + done(h); + } + } + assert.deepEqual([modOf(5, RINX).attr, modOf(6, RINX).attr, modOf(5, RINY).attr, modOf(6, RINY).attr], [{ atk: 40, res: 5 }, { atk: 65, res: 5 }, { maxHp: 160, aspd: 5 }, { maxHp: 220, aspd: 7 }]); +}); + +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(CGBIRD)); + for (const t of [5, 6]) assert.ok(diyPool(t, { data, kitted: KITTED_CHARS }).includes(CGBIRD), `tier ${t}`); + assert.deepEqual(validateDiyPicks({ [SLOT[6]]: { charId: CGBIRD, skillIndex: 1, uniEquipId: RINY } }, { data, kitted: KITTED_CHARS }), + { ok: true, picks: { [SLOT[6]]: { charId: CGBIRD, skillIndex: 1, uniEquipId: RINY } } }); +}); + +test('群愈师 heals 3 allies at once; RIN-Y “莺歌” 4 (stages 1 and 3)', () => { + for (const f of [[5, false, null], [5, true, RINY], [6, true, RINY], [6, true, RINX]]) { + const [tier, elite, mod] = f; + const { h, u, a } = field({ tier, elite, mod, skill: 0 }); + for (const uid of [2, 3, 4, 5]) a(uid).hp = 1000 + uid; + const n0 = h.hooksOf('attack').length; + assert.ok(h.runUntil(() => h.hooksOf('attack').slice(n0).some((c) => c.attacker === u), 6), label(f)); + const at = h.hooksOf('attack').slice(n0).find((c) => c.attacker === u); + assert.equal(new Set(at.targets.map((t) => t.uid)).size, elite && mod === RINY ? 4 : 3, `${label(f)}: heals per attack`); + done(h); + } +}); + +test('S1 治疗强化·γ型 (MANUAL, data DEFAULT): 30 s of ATK +55 % / +70 %, cast on an injured ally in range; 35 / 32 SP from 20', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S1); + const { h, u, a } = field({ tier, elite, mod: elite ? RINX : null, skill: 0 }); + assert.deepEqual([u.skill.rule, u.skill.spCost, sk.initSp, sk.duration, sk.bb.atk], ['DEFAULT', elite ? 32 : 35, 20, 30, elite ? 0.7 : 0.55], `T${tier}`); + u.skill.gainSp(999); + a(8).hp = 100; // outside her range: no cast + h.run(2); + assert.equal(u.skill.activations, 0, `T${tier}: nobody injured in range`); + a(2).hp = 100; + assert.ok(h.runUntil(() => u.skill.active, 5), `T${tier}: cast`); + approx(u.skill.timeLeft, 30, `T${tier}: 30 s`, 0.01); + approx(u.s.atk, u.base.atk * (1 + sk.bb.atk), `T${tier}: ATK`); + h.runUntil(() => !u.skill.active, 35); + approx(u.s.atk, u.base.atk, `T${tier}: back`); + done(h); + } +}); + +test('S2 法术护盾 (AUTO, data DEFAULT, 2 charges): the next heal gives each of its targets a 屏障 of 50 % / 60 % ATK for 3.5 / 4 s that absorbs arts damage only, and RES +10 / +15 while it holds', () => { + for (const f of [[5, false, null], [6, true, RINY]]) { + const [tier, elite, mod] = f; + const sk = skillOf(tier, elite, S2); + const { h, u, a } = field({ tier, elite, mod, skill: 1 }); + assert.deepEqual([u.skill.rule, u.skill.maxCharges, u.skill.kind, sk.spCost, sk.bb.atk_scale, sk.bb.duration, sk.bb.magic_resistance], + ['DEFAULT', 2, 'charges', 10, elite ? 0.6 : 0.5, elite ? 4 : 3.5, elite ? 15 : 10], label(f)); + u.skill.gainSp(999); + h.run(2); + assert.equal(u.skill.activations, 0, `${label(f)}: nobody injured, no cast`); + const hurt = [2, 3, 4, 5].map(a); + hurt.forEach((x, i) => { x.hp = 1000 + i; }); + assert.ok(h.runUntil(() => u.skill.activations === 1 && hurt.some((x) => x.findBuff('cgbird:barrier')), 5), `${label(f)}: cast with a heal`); + const got = hurt.filter((x) => x.findBuff('cgbird:barrier')); + const first = got.map((x) => x.findBuff('cgbird:barrier')); + assert.equal(got.length, elite && mod === RINY ? 4 : 3, `${label(f)}: every target of that heal`); + for (const x of got) { + const b = x.findBuff('cgbird:barrier'); + approx(b.shield, u.s.atk * sk.bb.atk_scale, `${label(f)}: ${sk.bb.atk_scale * 100} % ATK`); + approx(b.duration, sk.bb.duration, `${label(f)}: ${sk.bb.duration} s`); + assert.equal(b.shieldType, 'arts', `${label(f)}: arts only`); + assert.deepEqual(x.findBuff('cgbird:barrierRes')?.mods, { resFlat: sk.bb.magic_resistance }, `${label(f)}: RES bonus`); + } + const x = got[0], b = x.findBuff('cgbird:barrier'); + const hp0 = x.hp, sh0 = b.shield; + h.b.dealDamage(null, x, { amount: 50, type: 'phys', canDodge: false }); + assert.ok(x.hp < hp0, `${label(f)}: physical damage passes`); + approx(b.shield, sh0, `${label(f)}: the barrier untouched by physical damage`); + h.b.dealDamage(null, x, { amount: 20, type: 'true' }); + approx(b.shield, sh0, `${label(f)}: … and by true damage`); + const hp1 = x.hp; + h.b.dealDamage(null, x, { amount: 30, type: 'arts', canDodge: false }); + approx(x.hp, hp1, `${label(f)}: arts damage absorbed`); + assert.ok(b.shield < sh0, `${label(f)}: the barrier took it`); + h.b.dealDamage(null, x, { amount: 1e6, type: 'arts', canDodge: false, resIgnorePct: 1 }); + assert.equal(x.findBuff('cgbird:barrier'), null, `${label(f)}: broken`); + assert.equal(x.findBuff('cgbird:barrierRes'), null, `${label(f)}: the RES bonus goes with it`); + h.run(sk.bb.duration + 0.1); + got.forEach((y, i) => assert.ok(!y.buffs.includes(first[i]), `${label(f)}: the first heal's barrier expired`)); + done(h); + } +}); + +test('S3 圣域 (MANUAL, data ACTIVE_RANGE on y-4): cast for an injured ally inside y-4 only; 60 s, range y-4, ATK +40 % / +50 %, allies in it RES ×1.9 / ×2.05 and 15 % / 20 % arts dodge; all back after', () => { + for (const f of [[5, false, null], [6, true, null], [6, true, RINX]]) { + const [tier, elite, mod] = f; + const sk = skillOf(tier, elite, S3); + const { h, u, a } = field({ tier, elite, mod, skill: 2 }); + assert.deepEqual([u.skill.rule, sk.duration, sk.spCost, sk.rangeId, sk.bb.atk, sk.bb.magic_resistance, sk.bb.prob], + ['ACTIVE_RANGE', 60, 120, 'y-4', elite ? 0.5 : 0.4, elite ? 1.05 : 0.9, elite ? 0.2 : 0.15], label(f)); + assert.deepEqual(sk.trigger.customRangeGrid, sk.rangeGrid, `${label(f)}: the trigger grid is its running range`); + const base = u.liveRangeGrid; + u.skill.gainSp(999); + a(8).hp = 100; // outside y-4 + h.run(2); + assert.equal(u.skill.activations, 0, `${label(f)}: no injured ally in y-4`); + a(7).hp = 100; // (9,3): y-4 only + assert.ok(h.runUntil(() => u.skill.active, 2), `${label(f)}: cast for the ally 2 rows down`); + assert.deepEqual(u.liveRangeGrid, sk.rangeGrid, `${label(f)}: y-4 while it runs`); + h.run(0.3); + approx(u.s.atk, u.base.atk * (1 + sk.bb.atk), `${label(f)}: ATK`); + for (const uid of [2, 6, 7]) assert.deepEqual(a(uid).findBuff('skill:cgbird:sanctuary')?.mods, { resMul: 1 + sk.bb.magic_resistance, dodgeArts: sk.bb.prob }, `${label(f)}: uid ${uid} in y-4`); + assert.deepEqual(u.findBuff('skill:cgbird:sanctuary')?.mods, { resMul: 1 + sk.bb.magic_resistance, dodgeArts: sk.bb.prob }, `${label(f)}: herself`); + assert.equal(a(8).findBuff('skill:cgbird:sanctuary'), null, `${label(f)}: outside`); + // RES = (10 + 15 talent) × (1 + v) on an ally (base 10) + approx(a(7).s.res, Math.min(100, (10 + 15) * (1 + sk.bb.magic_resistance)), `${label(f)}: RES`); + approx(a(7).s.dodgeArts, sk.bb.prob, `${label(f)}: arts dodge`); + u.skill.end('test'); + h.run(0.3); + assert.deepEqual(u.liveRangeGrid, base, `${label(f)}: own range back`); + for (const uid of [2, 6, 7]) assert.equal(a(uid).findBuff('skill:cgbird:sanctuary'), null, `${label(f)}: uid ${uid} after`); + done(h); + } +}); + +test('T1 白恶魔的庇护: allies in her range RES +15 (herself too, not outside); RIN-X: its range tile too, stage 3 also 受到的治疗效果 ×1.05', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u, a } = field({ tier, elite, mod, skill: 0 }); + h.run(0.3); + const rinx = elite && mod === RINX, x3 = rinx && tier === 6; + const want = x3 ? { resFlat: 15, healingTakenMul: 1.05 } : { resFlat: 15 }; + for (const uid of [2, 3, 4, 5]) assert.deepEqual(a(uid).findBuff('talent:cgbird:res')?.mods, want, `${label(f)}: uid ${uid}`); + assert.deepEqual(u.findBuff('talent:cgbird:res')?.mods, want, `${label(f)}: herself`); + assert.deepEqual(a(6).findBuff('talent:cgbird:res')?.mods ?? null, rinx ? want : null, `${label(f)}: (11,5) — the RIN-X tile`); + for (const uid of [7, 8]) assert.equal(a(uid).findBuff('talent:cgbird:res'), null, `${label(f)}: uid ${uid} outside`); + approx(a(2).s.res, 10 + 15, `${label(f)}: RES`); + if (x3) { + a(2).hp = 1000; + const n0 = h.hooksOf('heal').length; + assert.ok(h.runUntil(() => h.hooksOf('heal').slice(n0).some((c) => c.target === a(2) && c.source === u), 6)); + const c = h.hooksOf('heal').slice(n0).find((x) => x.target === a(2) && x.source === u); + approx(c.amount, u.s.atk * 1.05, `${label(f)}: healing received ×1.05`); + } + done(h); + } +}); + +test('幻影 (T2): the token of her form — HP 3000 / 4989, RES 75, blocks nothing, taunt 1, no attack; 30 % physical dodge (RIN-Y stage 3: 40 %), loses 3 % of its max HP each second', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u, bird } = field({ tier, elite, mod, skill: 0, phantom: [12, 8] }); // outside her range: no heals on it + const v = tokenVariant(tier, elite, mod); + assert.ok(bird && bird.alive, `${label(f)}: deployed with the board`); + assert.equal(bird.ownerUnit, u, `${label(f)}: hers`); + assert.deepEqual([bird.base.maxHp, bird.base.res, bird.s.blockCnt, bird.s.taunt, bird.profile.noAttack], [v.stats.maxHp, 75, 0, 1, true], `${label(f)}: stats`); + assert.equal(v.stats.maxHp, elite ? 4989 : 3000); + const y3 = elite && tier === 6 && mod === RINY; + approx(bird.s.dodgePhys, y3 ? 0.4 : 0.3, `${label(f)}: physical dodge`); + assert.equal(bird.s.dodgeArts, 0, `${label(f)}: no arts dodge`); + const hp0 = bird.hp; + h.run(3.02); + approx(hp0 - bird.hp, 3 * 0.03 * bird.s.maxHp, `${label(f)}: 3 × 3 % in 3 s`, 1e-6); + assert.ok(h.hooksOf('damaged').some((c) => c.target === bird && c.dmg?.tags?.includes('hpLoss')), `${label(f)}: a 流失`); + // enemies: a 30 % dodge on physical hits, none on arts + let dodged = 0; + for (let i = 0; i < 400; i++) if (h.b.dealDamage(null, bird, { amount: 1, type: 'phys' }) === 0) dodged++; + assert.ok(Math.abs(dodged / 400 - (y3 ? 0.4 : 0.3)) < 0.08, `${label(f)}: ${dodged} / 400 dodged`); + done(h); + } +}); + +test('幻影: each 夜莺 deployment adds 2 (RIN-Y stage 3: 3) to her stock, at most 3; a fallen 幻影 comes back on its tile 20 s later using one and paying 5 DP; it stays when she leaves', () => { + for (const f of [[5, true, RINY], [6, true, RINY], [6, false, null]]) { + const [tier, elite, mod] = f; + const { h, u, bird } = field({ tier, elite, mod, skill: 0, phantom: [12, 8], dp: 50 }); + const cnt = elite && tier === 6 && mod === RINY ? 3 : 2; + assert.equal(u.mem.phantomStock, cnt, `${label(f)}: her deployment gave ${cnt}; the board piece used none`); + const tile = [bird.tileR, bird.tileC]; + h.b.kill(bird, null); + assert.ok(!bird.alive && !bird.removed, `${label(f)}: fallen, kept`); + h.run(19.5); + assert.ok(!bird.alive, `${label(f)}: not before its 20 s`); + const dp0 = h.b.players[0].dp; + assert.ok(h.runUntil(() => bird.alive, 1), `${label(f)}: back after 20 s`); + assert.deepEqual([bird.tileR, bird.tileC], tile, `${label(f)}: on its own tile`); + assert.equal(u.mem.phantomStock, cnt - 1, `${label(f)}: one used`); + approx(dp0 - h.b.players[0].dp, 5, `${label(f)}: its DP cost`); + approx(bird.hp, bird.s.maxHp, `${label(f)}: full HP`, 0.05); + approx(bird.s.dodgePhys, tokenVariant(tier, elite, mod).talents.at(-1).bb.prob, `${label(f)}: its talent again`); + // she leaves: the deployed 幻影 stays; she comes back: +cnt (cap 3) + h.b.retreat(u); + h.step(); + assert.ok(bird.alive, `${label(f)}: stays when she leaves`); + h.b.redeploy(u, { free: true }); + assert.equal(u.mem.phantomStock, Math.min(3, cnt - 1 + cnt), `${label(f)}: +${cnt}, at most 3`); + // none held: a fallen 幻影 waits + u.mem.phantomStock = 0; + h.b.kill(bird, null); + h.run(30); + assert.ok(!bird.alive, `${label(f)}: no 幻影 held, none comes`); + u.mem.phantomStock = 1; + assert.ok(h.runUntil(() => bird.alive, 1), `${label(f)}: comes as soon as one is held`); + assert.equal(u.mem.phantomStock, 0); + done(h); + } +}); + +test('幻影 without DP waits for it; 夜莺 heals her 幻影 (an injured 友方单位 in range) and her S2 barrier reaches it', () => { + const { h, u, bird } = field({ tier: 6, elite: true, mod: RINY, skill: 1, phantom: [12, 4], dp: 0 }); + // the drain makes it an injured ally of her range + u.skill.gainSp(999); + assert.ok(h.runUntil(() => bird.findBuff('cgbird:barrier'), 6), 'barrier on the 幻影 with the next heal'); + assert.ok(h.hooksOf('heal').some((c) => c.source === u && c.target === bird), 'healed'); + h.b.kill(bird, null); + h.run(25); + assert.ok(!bird.alive, 'no DP: still down'); + h.b.players[0].dp = 5; + assert.ok(h.runUntil(() => bird.alive, 1), 'back once the DP is there'); + approx(h.b.players[0].dp, 0, 'paid 5'); + done(h); +}); diff --git a/test/content/op_saga.test.js b/test/content/op_saga.test.js new file mode 100644 index 00000000..9f3f40de --- /dev/null +++ b/test/content/op_saga.test.js @@ -0,0 +1,379 @@ +// test/content/op_saga.test.js — the 自选 operator kit of 嵯峨 (char_362_saga, 6★ 尖兵; kit +// server/sim/content/kits/ops/op-saga.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, SOL-Y 身向云泥 or +// SOL-X 何处寻驮? at stage 1 (tier 5) / 3 (tier 6). Every number is read back from data/backups.json; the fidelity +// checklist of kits/README.md item by item (劝善's 重伤 per PRTS 术语释义 重伤 / the talent and S2 备注). +// Run: node --test test/content/op_saga.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'; +import { DYING, S2_CHECK, isDying } from '../../server/sim/content/kits/ops/op-saga.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 SAGA = 'char_362_saga'; +const FORMS = BACKUPS.units[SAGA].forms; +const SLOT = { 5: 'chess_char_5_diy1_a', 6: 'chess_char_6_diy1_a' }; +const SOLY = 'uniequip_002_saga', SOLX = 'uniequip_003_saga'; +const S1 = 'skcom_charge_cost[3]', S2 = 'skchr_saga_2', S3 = 'skchr_saga_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_weak: dummy('enemy_weak', { hp: 100 }), + enemy_walk: enemyRec({ key: 'enemy_walk', hp: 1e9, speed: 0.6, mass: 0 }), +}; +// a regenerating enemy (data/enemies.json has two: 200 HP/s for enemy_1061_zomshd) +ENEMIES.enemy_regen = { ...dummy('enemy_regen', { hp: 100 }), stats: { ...dummy('enemy_regen', { hp: 100 }).stats, hpRecoveryPerSec: 200 } }; +const FORMS_ALL = [[5, false, null], [6, false, null], ...[5, 6].flatMap((t) => [null, SOLY, SOLX].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 = 0, row = 10, col = 5, others = [], seed = 5, dp = 0 } = {}) { + const h = makeBattle({ + defs: { enemies: ENEMIES }, timeLimit: 900, autoFinish: false, seed, + flags: { dpPerSec: 0, dpMax: 999, dpInit: dp }, hooks: ['damaged', 'skillStart', 'skillEnd', 'kill', 'death', 'spGain', 'attack'], captureNoisy: true, + units: [{ uid: 1, diy: { slot: SLOT[tier], charId: SAGA, skillIndex: skill, uniEquipId: mod }, elite, row, col }, ...others], + }); + h.step(); + return { h, u: h.unit(1) }; +} +const hitsBy = (h, u, from = 0) => h.hooksOf('damaged').slice(from).filter((c) => c.source === u && c.target?.side === 'enemy'); +function done(h) { + checkInvariants(h.b); + assert.equal(h.b.errors.length, 0, JSON.stringify(h.b.errors[0])); +} + +test('嵯峨 in every 自选 form: her operator kit (all three skills authored), the form\'s stats + module attributes, 1-1, blocks 2, melee ground-only, no 特质', () => { + assert.equal(OPERATOR_KITS[SAGA], KITS[SAGA]); + 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], [SAGA, SLOT[tier], form.skills[skill].skillId, false, 'skills'], label(f)); + assert.deepEqual([u.base.maxHp, u.base.atk, u.base.def], [form.stats.maxHp + (m?.attr.maxHp ?? 0), form.stats.atk + (m?.attr.atk ?? 0), form.stats.def + (m?.attr.def ?? 0)], `${label(f)}: stats`); + assert.deepEqual([u.s.blockCnt, u.profile.attack, u.profile.dmgType, u.profile.canHitFly, u.base.bat, typeof u.profile.skipEnemy], [2, 'melee', 'phys', false, 1.05, 'function'], `${label(f)}: 尖兵`); + assert.deepEqual(u.liveRangeGrid, form.rangeGrid, `${label(f)}: 1-1`); + assert.deepEqual([u.def.bonds, u.def.raw.garrisonIds], [['emptyShip'], []], `${label(f)}: bonds / 特质`); + assert.ok(!u.s.flags.liftoff && !u.s.flags.camou && !u.s.flags.stealth, `${label(f)}: ground enemies target her`); + done(h); + } + } + // E2 Lv1 1609 / 434 / 297, E2 Lv60 2004 / 498 / 347; SOL-Y +75 / +45 / +15 → +125 / +55 / +20, SOL-X +50 / +28 → +70 / +44 + 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], [1609, 434, 2004, 498]); + assert.deepEqual([modOf(5, SOLY).attr, modOf(6, SOLY).attr, modOf(5, SOLX).attr, modOf(6, SOLX).attr], + [{ maxHp: 75, atk: 45, def: 15 }, { maxHp: 125, atk: 55, def: 20 }, { atk: 50, def: 28 }, { atk: 70, def: 44 }]); +}); + +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(SAGA)); + for (const t of [5, 6]) assert.ok(diyPool(t, { data, kitted: KITTED_CHARS }).includes(SAGA), `tier ${t}`); + assert.deepEqual(validateDiyPicks({ [SLOT[5]]: { charId: SAGA, skillIndex: 1, uniEquipId: SOLX } }, { data, kitted: KITTED_CHARS }), + { ok: true, picks: { [SLOT[5]]: { charId: SAGA, skillIndex: 1, uniEquipId: SOLX } } }); +}); + +test('melee, ground-only: no attack on a flyer in her range; a ground enemy there is attacked (physical, 100 % ATK)', () => { + const { h, u } = field({ tier: 5, skill: 0 }); + const fly = h.spawn('enemy_fly', { pos: [10, 6] }); + h.run(3); + assert.equal(hitsBy(h, u).filter((c) => c.target === fly).length, 0, 'flyer untouched'); + const e = h.spawn('enemy_dummy', { pos: [10, 6] }); + assert.ok(h.runUntil(() => hitsBy(h, u).some((c) => c.target === e), 3)); + const c = hitsBy(h, u).find((x) => x.target === e); + assert.deepEqual([c.type, c.dmg.isAttack], ['phys', true]); + approx(c.amount, u.s.atk, '100 % ATK'); + done(h); +}); + +test('S1 冲锋号令·γ型 (AUTO): +12 DP as soon as its SP is full — no enemy needed (SP_FULL); 41 / 38 SP from 12 / 14', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S1); + const { h, u } = field({ tier, elite, mod: elite ? SOLX : null, skill: 0 }); + assert.deepEqual([u.skill.rule, u.skill.spCost, sk.initSp, sk.bb.cost], ['SP_FULL', elite ? 38 : 41, elite ? 14 : 12, 12], `T${tier}`); + h.b.players[0].dp = 0; + h.run(sk.spCost - sk.initSp - 0.5); + assert.equal(u.skill.activations, 0, `T${tier}: not before`); + assert.ok(h.runUntil(() => u.skill.activations === 1, 1), `T${tier}: at full SP, no enemy`); + approx(h.b.players[0].dp, 12, `T${tier}: +12 DP`); + done(h); + } +}); + +test('S2 除恶 (MANUAL, data SKILL_RANGE on x-6, 2 charges): +4 DP; the cross\'s ground enemies take 280 % / 320 % ATK physical — at most 6, flyers and other tiles untouched', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S2); + const { h, u } = field({ tier, elite, mod: elite ? SOLY : null, skill: 1 }); + assert.deepEqual([u.skill.rule, u.skill.maxCharges, sk.rangeId, sk.bb.atk_scale, sk.bb.cost, sk.spCost, sk.initSp], ['SKILL_RANGE', 2, 'x-6', elite ? 3.2 : 2.8, 4, elite ? 16 : 18, elite ? 10 : 9], `T${tier}`); + assert.match(sk.desc, /最多6名地面敌人/); + const cross = [[12, 5], [11, 5], [10, 3], [10, 4], [10, 6], [10, 7], [9, 5]]; + const ground = cross.map((pos) => h.spawn('enemy_dummy', { pos })); + const fly = h.spawn('enemy_fly', { pos: [8, 5] }); + const diag = h.spawn('enemy_dummy', { pos: [11, 6] }); + h.b.players[0].dp = 0; + const n0 = hitsBy(h, u).length; + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.activations === 1, 1), `T${tier}: cast (enemies in the cross)`); + const hit = hitsBy(h, u, n0).filter((c) => c.dmg.tags?.includes('saga:s2')); + assert.equal(hit.length, 6, `T${tier}: at most 6`); + assert.ok(hit.every((c) => ground.includes(c.target)), `T${tier}: ground enemies of the cross only`); + assert.equal(new Set(hit.map((c) => c.target)).size, 6, `T${tier}: six different`); + for (const c of hit) { + approx(c.amount, u.s.atk * sk.bb.atk_scale, `T${tier}: ${sk.bb.atk_scale * 100} % ATK`); + assert.deepEqual([c.type, c.dmg.isSkill, c.dmg.isAttack], ['phys', true, false], `T${tier}: a physical skill damage`); + } + assert.ok(!hit.some((c) => c.target === fly || c.target === diag), `T${tier}: flyer / diagonal untouched`); + approx(h.b.players[0].dp, 4, `T${tier}: +4 DP`); + assert.equal(u.skill.charges, 1, `T${tier}: one charge left`); + done(h); + } +}); + +test('S2 除恶: its trigger counts any enemy in the cross (a flyer too, 无视其不可选中) but hits ground ones only', () => { + const { h, u } = field({ tier: 6, elite: true, skill: 1 }); + const fly = h.spawn('enemy_fly', { pos: [9, 5] }); + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.activations === 1, 1), 'cast for a flyer alone in the cross'); + assert.equal(hitsBy(h, u).filter((c) => c.target === fly).length, 0, 'but not hit'); + done(h); +}); + +test('S2 除恶: a 重伤 enemy is selected (可选择重伤单位) and every hit enemy still 重伤 0.7 s later is killed by her (killer 嵯峨, +2 SP each)', () => { + const { h, u } = field({ tier: 6, elite: true, skill: 1 }); + const sk = skillOf(6, true, S2); + const weak = h.spawn('enemy_weak', { pos: [10, 7] }); // in the cross, outside her 1-1 + const front = h.spawn('enemy_weak', { pos: [10, 6] }); // in her 1-1 + assert.ok(h.runUntil(() => isDying(front), 3), 'her attack: 重伤'); + assert.deepEqual([front.hp, weak.hp], [1, 100]); + // 除恶 comes by itself once a charge is ready (SKILL_RANGE: enemies in the cross) + assert.ok(h.runUntil(() => u.skill.activations === 1, sk.spCost - sk.initSp + 1), 'cast'); + const tc = h.b.time; + assert.ok(hitsBy(h, u).some((c) => c.target === front && c.dmg.tags?.includes('saga:s2')), '可选择重伤单位'); + assert.ok(isDying(weak) && weak.hp === 1, 'the weak one: 1 HP, 重伤'); + h.run(S2_CHECK - 0.1); + assert.ok(weak.alive && front.alive, 'not before 0.7 s'); + assert.ok(h.runUntil(() => !weak.alive && !front.alive, 0.2), 'both killed at 0.7 s'); + const kills = h.hooksOf('kill').filter((c) => c.victim === weak || c.victim === front); + assert.ok(kills.length === 2 && kills.every((c) => c.killer === u), 'killer: 嵯峨'); + assert.equal(u.stats.kills, 2); + const talentSp = h.hooksOf('spGain').filter((c) => c.unit === u && c.reason === 'talent' && c.t >= tc).reduce((n, c) => n + c.amount, 0); + approx(talentSp, 4, '2 × 2 SP'); + done(h); +}); + +test('S3 怒目 (MANUAL, data ACTIVE_RANGE on 1-1 + 1): 20 s, ATK +70 % / +100 %, interval 1.05 + 0.5 s, range +1, every blocked enemy at once, +20 DP over the skill; all 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, row: 9, col: 5 }); + assert.deepEqual([u.skill.rule, sk.duration, sk.bb.atk, sk.bb.base_attack_time, sk.bb.ability_range_forward_extend, sk.bb.cost, sk.bb.interval, sk.bb.value, sk.bb['attack@hp_ratio']], + ['ACTIVE_RANGE', 20, elite ? 1 : 0.7, 0.5, 1, 1, 1, 20, 0.5], `T${tier}`); + assert.deepEqual(sk.trigger.customRangeGrid, [[0, 0], [0, 1], [0, 2]], `T${tier}: her 1-1 + 1`); + u.skill.gainSp(999); + const far = h.spawn('enemy_dummy', { pos: [9, 7] }); // two tiles ahead: the running range only + assert.ok(h.runUntil(() => u.skill.active, 1), `T${tier}: cast for an enemy 2 tiles ahead`); + h.b.players[0].dp = 0; + assert.deepEqual(u.liveRangeGrid, [[0, 0], [0, 1], [0, 2]], `T${tier}: range +1`); + approx(u.s.atk, u.base.atk * (1 + sk.bb.atk), `T${tier}: ATK`); + approx(u.s.interval, 1.55, `T${tier}: +0.5 s`); + assert.ok(h.runUntil(() => hitsBy(h, u).some((c) => c.target === far), 3), `T${tier}: reaches 2 tiles ahead`); + h.b.kill(far, null); + // two walkers blocked: one attack hits both + h.spawn('enemy_walk', { routeIndex: 0 }); + h.spawn('enemy_walk', { routeIndex: 0, pos: [9, 9] }); + assert.ok(h.runUntil(() => u.blocking.length === 2, 30), `T${tier}: blocking two`); + const n0 = h.hooksOf('attack').length; + assert.ok(h.runUntil(() => h.hooksOf('attack').slice(n0).some((c) => c.attacker === u), 3)); + const at = h.hooksOf('attack').slice(n0).find((c) => c.attacker === u); + assert.equal(at.targets.length, 2, `T${tier}: every blocked enemy`); + h.runUntil(() => !u.skill.active, 25); + approx(h.b.players[0].dp, 20, `T${tier}: +20 DP in all`, 1e-6); + assert.deepEqual(u.liveRangeGrid, formOf(tier, elite).rangeGrid, `T${tier}: 1-1 again`); + approx(u.s.interval, 1.05, `T${tier}: interval back`); + done(h); + } +}); + +test('S3 怒目: DP comes gradually (1 per second) and one more attack follows each attack on a target below half HP (checked before the hit), none above', () => { + const { h, u } = field({ tier: 6, elite: true, skill: 2 }); + const low = h.spawn('enemy_dummy', { pos: [10, 6] }); + low.hp = low.s.maxHp * 0.4; + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.active, 1)); + h.b.players[0].dp = 0; + h.run(5.5); + approx(h.b.players[0].dp, 5, '5 DP after 5.5 s', 1e-6); + // hits on the target, grouped by attack: an extra attack lands one tick after its attack + const groups = (hits) => { + const out = []; + for (const c of hits) { const g = out.at(-1); if (g && c.t - g.at(-1).t < 0.1) g.push(c); else out.push([c]); } + return out.map((g) => g.length); + }; + const n0 = hitsBy(h, u).length; + h.run(6); + const low6 = groups(hitsBy(h, u, n0).filter((c) => c.target === low && c.dmg.isAttack)); + assert.ok(low6.length >= 3, `${low6.length} attacks in 6 s (1.55 s apart)`); + assert.ok(low6.slice(0, -1).every((n) => n === 2), `every attack followed by one more: ${low6}`); + // above half: no extra attack + h.b.kill(low, null); + const high = h.spawn('enemy_dummy', { pos: [10, 6] }); + high.hp = high.s.maxHp * 0.6; + const n1 = hitsBy(h, u).length; + h.run(5); + const high5 = groups(hitsBy(h, u, n1).filter((c) => c.target === high && c.dmg.isAttack)); + assert.ok(high5.length >= 2 && high5.every((n) => n === 1), `one hit per attack: ${high5}`); + done(h); +}); + +test('T1 劝善: her damage leaves an enemy at 1 HP and 重伤 (move ×0.2, unblockable, 禁疗, no regeneration); she never attacks it; it dies 10 s later (无来源, no SP); a 重伤 enemy takes no second 重伤', () => { + for (const f of [[5, false, null], [6, true, SOLY]]) { + const { h, u } = field({ tier: f[0], elite: f[1], mod: f[2], skill: 2 }); + const t0 = BACKUPS.units[SAGA].forms[f[1] ? '2/60/7/3' : '2/1/4/0'].talents[0].bb; + assert.deepEqual(t0, { move_speed: -0.8, sp: 2, interval: 10 }); + const e = h.spawn('enemy_weak', { pos: [10, 6] }); + assert.ok(h.runUntil(() => isDying(e), 3), `${label(f)}: 重伤`); + const at = h.b.time; + assert.deepEqual([e.alive, e.hp], [true, 1], `${label(f)}: 1 HP left`); + const d = e.findBuff(DYING); + assert.equal(d.source, u); + approx(d.mods.moveMul, 0.2, `${label(f)}: move −80 %`); + assert.equal(d.mods.hpRegen, -1e9, `${label(f)}: regeneration zeroed`); + assert.deepEqual(d.flags, { unblockable: true, healFree: true, noHeal: true }, `${label(f)}: 禁用近战 / 禁疗`); + approx(e.s.moveSpeed, e.base.moveSpeed * 0.2, `${label(f)}: move`); + assert.ok(e.s.hpRegen <= 0, `${label(f)}: no regeneration (a cancelling hpRegen)`); + assert.equal(h.b.heal(e, e, 50, { self: true }), 0, `${label(f)}: 禁疗`); + // she never attacks it again + const n0 = hitsBy(h, u).length, a0 = u.stats.attacks; + h.run(4); + assert.equal(hitsBy(h, u, n0).length, 0, `${label(f)}: no damage of hers`); + assert.equal(u.stats.attacks, a0, `${label(f)}: no attack`); + // no second 重伤 + h.b.dealDamage(u, e, { amount: 1000, type: 'true' }); + assert.equal(e.findBuff(DYING), d, `${label(f)}: the same 重伤`); + assert.equal(e.hp, 1, `${label(f)}: still not lethal`); + // 10 s: a forced, 无来源 death + const sp0 = u.skill.sp; + h.run(at + 10 - h.b.time - 0.1); + assert.ok(e.alive, `${label(f)}: alive before 10 s`); + assert.ok(h.runUntil(() => !e.alive, 0.2), `${label(f)}: dead at 10 s`); + const k = h.hooksOf('kill').find((c) => c.victim === e); + assert.deepEqual([k.killer, e.removeReason], [null, 'killed'], `${label(f)}: 无来源 kill`); + assert.equal(h.b.killed, 1, `${label(f)}: counted`); + assert.equal(h.hooksOf('spGain').filter((c) => c.reason === 'talent').length, 0, `${label(f)}: no SP for it`); + assert.ok(u.skill.sp >= sp0, `${label(f)}: (time SP only)`); + done(h); + } +}); + +test('T1 劝善: a 重伤 enemy regenerates nothing (生命回复速度归零) — one with 200 HP/s stays at 1 HP', () => { + const { h, u } = field({ tier: 5, skill: 2 }); + const e = h.spawn('enemy_regen', { pos: [10, 6] }); + assert.equal(e.s.hpRegen, 200, 'it regenerates'); + assert.ok(h.runUntil(() => isDying(e), 3)); + h.run(3); + assert.deepEqual([e.alive, e.hp], [true, 1], 'no HP back while 重伤'); + assert.equal(hitsBy(h, u).filter((c) => c.target === e).length, 1, 'one hit of hers, then none'); + done(h); +}); + +test('T1 劝善: whoever kills a 重伤 enemy gets 2 SP; 重伤 never kills while 消失 and kills at once when it comes back', () => { + const others = [{ uid: 2, chessId: 'chess_char_1_08_a', row: 12, col: 9 }]; + const { h } = field({ tier: 5, skill: 2, others }); + const texas = h.unit(2); + const e = h.spawn('enemy_weak', { pos: [10, 6] }); + assert.ok(h.runUntil(() => isDying(e), 3)); + const sp0 = texas.skill.sp; + h.b.dealDamage(texas, e, { amount: 1e6, type: 'true' }); + assert.ok(!e.alive, 'another operator\'s damage kills it'); + approx(texas.skill.sp - sp0, 2, '+2 SP to 德克萨斯'); + // 消失 + const g = h.spawn('enemy_weak', { pos: [10, 6] }); + assert.ok(h.runUntil(() => isDying(g), 3)); + h.step(); + g.hidden = true; + h.run(12); + assert.ok(g.alive, 'no natural death while 消失'); + g.hidden = false; + h.step(); + assert.ok(!g.alive, 'dead the moment it appears'); + assert.equal(h.hooksOf('kill').find((c) => c.victim === g).killer, null); + done(h); +}); + +test('T1 劝善 SOL-X stage 3: her damage on a target below half HP ×1.15 (stage 1 and the other forms: none)', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u } = field({ tier, elite, mod, skill: 0 }); + const x3 = elite && tier === 6 && mod === SOLX; + const e = h.spawn('enemy_dummy', { pos: [10, 6] }); + const hitAt = (ratio) => { + e.hp = e.s.maxHp * ratio; + const n0 = hitsBy(h, u).length; + assert.ok(h.runUntil(() => hitsBy(h, u, n0).length > 0, 3), label(f)); + return hitsBy(h, u, n0)[0].amount; + }; + const lo = hitAt(0.4), hi = hitAt(0.6); + approx(lo / hi, x3 ? 1.15 : 1, `${label(f)}: below / above half`); + if (x3) assert.match(u.def.raw.talents.find((t) => t.index === 0).desc, /对生命值低于一半的单位造成的伤害提升15%/); + done(h); + } +}); + +test('T2 清明: once per deployment, the first time she drops below 40 %: 70 % physical dodge and 5 % max HP/s for 15 s; SOL-Y stage 3: 6.5 % (its blackboard) for 18 s', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u } = field({ tier, elite, mod, skill: 0, row: 12, col: 9 }); + const y3 = elite && tier === 6 && mod === SOLY; + const tb = u.def.raw.talents.find((t) => t.index === 1).bb; + assert.deepEqual(tb, { hp_ratio: 0.4, hp_recovery_per_sec_by_max_hp_ratio: y3 ? 0.065 : 0.05, prob: 0.7, duration: y3 ? 18 : 15 }, label(f)); + h.b.dealDamage(null, u, { amount: u.s.maxHp * 0.55, type: 'true' }); + assert.equal(u.findBuff('talent:saga:qingming'), null, `${label(f)}: at 45 % nothing`); + h.b.dealDamage(null, u, { amount: u.s.maxHp * 0.1, type: 'true' }); + const b = u.findBuff('talent:saga:qingming'); + assert.ok(b, `${label(f)}: below 40 %`); + assert.deepEqual(b.mods, { dodgePhys: 0.7, hpRegenRatio: y3 ? 0.065 : 0.05 }, `${label(f)}: mods`); + approx(b.duration, y3 ? 18 : 15, `${label(f)}: duration`); + approx(u.s.dodgePhys, 0.7, `${label(f)}: dodge`); + const hp0 = u.hp; + h.run(2.01); + approx(u.hp - hp0, 2 * (y3 ? 0.065 : 0.05) * u.s.maxHp, `${label(f)}: regeneration`, 0.02); + h.run(b.duration); + assert.equal(u.findBuff('talent:saga:qingming'), null, `${label(f)}: over`); + u.hp = u.s.maxHp; + h.b.dealDamage(null, u, { amount: u.s.maxHp * 0.7, type: 'true' }); + assert.equal(u.findBuff('talent:saga:qingming'), null, `${label(f)}: only once`); + h.b.retreat(u); + h.b.redeploy(u, { free: true }); + h.b.dealDamage(null, u, { amount: u.s.maxHp * 0.7, type: 'true' }); + assert.ok(u.findBuff('talent:saga:qingming'), `${label(f)}: again after a new deployment`); + done(h); + } +}); + +test('SOL-X 何处寻驮? trait: ATK / DEF +8 % while she blocks an enemy (stages 1 and 3); none without it; SOL-Y\'s 首次部署时部署费用-4 changes nothing in battle', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u } = field({ tier, elite, mod, skill: 0, row: 9, col: 5 }); + const solx = elite && mod === SOLX; + if (solx) assert.deepEqual(u.def.raw.trait.bb, { atk: 0.08, def: 0.08 }, label(f)); + h.run(1); + assert.equal(u.findBuff('trait:saga:block'), null, `${label(f)}: nothing blocked`); + h.spawn('enemy_walk', { routeIndex: 0 }); + assert.ok(h.runUntil(() => u.blocking.length > 0, 30), `${label(f)}: the walker reaches her`); + h.step(); + assert.equal(!!u.findBuff('trait:saga:block'), solx, `${label(f)}: blocking`); + if (solx) assert.deepEqual(u.findBuff('trait:saga:block').mods, { atkPct: 0.08, defPct: 0.08 }); + if (elite && mod === SOLY) { + assert.deepEqual(u.def.raw.talents.filter((t) => t.index === -1).map((t) => t.bb.runtime_cost).filter((v) => v != null), [-4], `${label(f)}: the data carries it`); + assert.equal(u.base.cost, formOf(tier, true).stats.cost, `${label(f)}: no cost change`); + } + done(h); + } +}); diff --git a/test/content/op_shining.test.js b/test/content/op_shining.test.js new file mode 100644 index 00000000..8360b7df --- /dev/null +++ b/test/content/op_shining.test.js @@ -0,0 +1,252 @@ +// test/content/op_shining.test.js — the 自选 operator kit of 闪灵 (char_147_shining, 6★ 医师; kit +// server/sim/content/kits/ops/op-shining.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, PHY-Y +// 干枯剑鞘 or PHY-X “使徒” 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_shining.test.js + +import { test } from 'node:test'; +import assert from 'node:assert/strict'; +import { readFileSync } from 'node:fs'; +import { makeBattle, enemyRec, chessRec, 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 SHINING = 'char_147_shining'; +const FORMS = BACKUPS.units[SHINING].forms; +const SLOT = { 5: 'chess_char_5_diy1_a', 6: 'chess_char_6_diy1_a' }; +const PHYY = 'uniequip_002_shining', PHYX = 'uniequip_003_shining'; +const S1 = 'skchr_shining_1', S2 = 'skchr_shining_2', S3 = 'skchr_shining_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 ENEMIES = { enemy_dummy: enemyRec({ key: 'enemy_dummy', hp: 1e9, speed: 0, mass: 0 }) }; +/** Synthetic allies with no skill: a melee one (地面 tiles) and a ranged one (高台). */ +const ALLIES = { + test_melee_a: chessRec({ id: 'test_melee_a', profession: 'WARRIOR', stats: { maxHp: 10000, def: 100, atk: 0 }, skill: null }), + test_ranged_a: chessRec({ id: 'test_ranged_a', profession: 'SNIPER', stats: { maxHp: 10000, def: 100, atk: 0 }, skill: null }), +}; +const FORMS_ALL = [[5, false, null], [6, false, null], ...[5, 6].flatMap((t) => [null, PHYY, PHYX].map((m) => [t, true, m]))]; +const label = ([tier, elite, mod]) => `T${tier} ${elite ? 'elite' : 'normal'} ${mod ?? 'none'}`; + +/** + * A battle with 闪灵 as uid 1 on the 高台 tile (11,2) facing RIGHT (her 3-3: rows 10–12, cols 2–5), a melee ally on the + * 地面 tile (10,4) (uid 2) and a ranged ally on the 高台 tile (10,2) (uid 3) — both in her range —, a melee ally outside it + * at (10,8) (uid 4). + */ +function field({ tier = 5, elite = false, mod = null, skill = 0, seed = 5, extra = [] } = {}) { + const h = makeBattle({ + defs: { enemies: ENEMIES, chess: ALLIES }, timeLimit: 600, autoFinish: false, seed, + flags: { dpPerSec: 0, dpMax: 999 }, hooks: ['damaged', 'heal', 'skillStart', 'skillEnd'], captureNoisy: true, + units: [ + { uid: 1, diy: { slot: SLOT[tier], charId: SHINING, skillIndex: skill, uniEquipId: mod }, elite, row: 11, col: 2 }, + { uid: 2, chessId: 'test_melee_a', row: 10, col: 4 }, + { uid: 3, chessId: 'test_ranged_a', row: 10, col: 2 }, + { uid: 4, chessId: 'test_melee_a', row: 10, col: 8 }, + ...extra, + ], + }); + h.step(); + return { h, u: h.unit(1), ground: h.unit(2), high: h.unit(3), out: h.unit(4) }; +} +function done(h) { + checkInvariants(h.b); + assert.equal(h.b.errors.length, 0, JSON.stringify(h.b.errors[0])); +} +const healsOn = (h, u, t, from = 0) => h.hooksOf('heal').slice(from).filter((c) => c.source === u && c.target === t && !c.opts?.regen); + +test('闪灵 in every 自选 form: her operator kit (all three skills authored), the form\'s stats + module attributes, 3-3, one heal (医师), no 特质', () => { + assert.equal(OPERATOR_KITS[SHINING], KITS[SHINING]); + 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], [SHINING, SLOT[tier], form.skills[skill].skillId, false, 'skills'], label(f)); + assert.deepEqual([u.base.maxHp, u.base.atk, u.base.def, u.base.aspd], [form.stats.maxHp + (m?.attr.maxHp ?? 0), form.stats.atk + (m?.attr.atk ?? 0), form.stats.def + (m?.attr.def ?? 0), form.stats.aspd + (m?.attr.aspd ?? 0)], `${label(f)}: stats`); + // a heal attack selects injured allies only (ai.js acquireTargets): no enemy, so no anti-air question + assert.deepEqual([u.profile.dmgType, u.profile.heal?.mode, u.profile.attack, u.base.bat], ['heal', 'single', 'ranged', 2.85], `${label(f)}: 医师`); + assert.deepEqual(u.liveRangeGrid, form.rangeGrid, `${label(f)}: 3-3`); + assert.deepEqual([u.def.bonds, u.def.raw.garrisonIds], [['emptyShip'], []], `${label(f)}: bonds / 特质`); + assert.ok(!u.s.flags.liftoff && !u.s.flags.camou && !u.s.flags.stealth && !u.s.flags.untargetable, `${label(f)}: enemies target her`); + done(h); + } + } + // the numbers of the forms (zh_CN): E2 Lv1 1451 / 424 / 110, E2 Lv60 1558 / 494 / 129; PHY-Y +35 ATK +5 ASPD → +60 / +7, + // PHY-X +45 ATK +13 DEF → +63 / +20 + 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], [1451, 424, 1558, 494]); + assert.deepEqual([modOf(5, PHYY).attr, modOf(6, PHYY).attr, modOf(5, PHYX).attr, modOf(6, PHYX).attr], [{ atk: 35, aspd: 5 }, { atk: 60, aspd: 7 }, { atk: 45, def: 13 }, { atk: 63, def: 20 }]); +}); + +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(SHINING)); + for (const t of [5, 6]) assert.ok(diyPool(t, { data, kitted: KITTED_CHARS }).includes(SHINING), `tier ${t}`); + assert.deepEqual(validateDiyPicks({ [SLOT[5]]: { charId: SHINING, skillIndex: 2, uniEquipId: PHYX } }, { data, kitted: KITTED_CHARS }), + { ok: true, picks: { [SLOT[5]]: { charId: SHINING, skillIndex: 2, uniEquipId: PHYX } } }); +}); + +test('S1 信条 (MANUAL, data DEFAULT): cast on an injured ally in range only; 20 s of ATK +58 % / +67 % and ASPD +10 / +20; 47 / 44 SP from 10 / 14', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S1); + const { h, u, ground } = field({ tier, elite, mod: elite ? PHYY : null, skill: 0 }); + assert.deepEqual([u.skill.rule, u.skill.spCost, sk.initSp, sk.duration, sk.bb.atk, sk.bb.attack_speed], + ['DEFAULT', elite ? 44 : 47, elite ? 14 : 10, 20, elite ? 0.67 : 0.58, elite ? 20 : 10], `T${tier}`); + const aspd0 = u.s.aspd; + u.skill.gainSp(999); + h.run(3); + assert.equal(u.skill.activations, 0, `T${tier}: nobody injured, no cast`); + ground.hp = 100; + assert.ok(h.runUntil(() => u.skill.active, 5), `T${tier}: cast as she heals`); + approx(u.skill.timeLeft, 20, `T${tier}: 20 s`, 0.01); + approx(u.s.atk, u.base.atk * (1 + sk.bb.atk), `T${tier}: ATK`); + approx(u.s.aspd, aspd0 + sk.bb.attack_speed, `T${tier}: ASPD`); + h.runUntil(() => !u.skill.active, 25); + approx(u.s.atk, u.base.atk, `T${tier}: ATK back`); + approx(u.s.aspd, aspd0, `T${tier}: ASPD back`); + done(h); + } +}); + +test('S2 自动掩护 (AUTO, data DEFAULT, 1 / 2 charges): the next heal gives its target a 屏障 of 28 % / 35 % ATK for 2 / 3 s (every damage type) and DEF +25 % / +35 % while it holds', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S2); + const { h, u, ground } = field({ tier, elite, mod: elite ? PHYX : null, skill: 1 }); + assert.deepEqual([u.skill.rule, u.skill.maxCharges, u.skill.kind, sk.spCost, sk.bb.atk_scale, sk.bb.duration, sk.bb.def], + ['DEFAULT', elite ? 2 : 1, elite ? 'charges' : 'instant', 7, elite ? 0.35 : 0.28, elite ? 3 : 2, elite ? 0.35 : 0.25], `T${tier}`); + u.skill.gainSp(999); + h.run(2); + assert.equal(u.skill.activations, 0, `T${tier}: nobody injured, no cast (it waits for a heal)`); + ground.hp = 100; + const def0 = ground.s.def; + assert.ok(h.runUntil(() => ground.findBuff('shining:barrier'), 5), `T${tier}: the barrier comes with the heal`); + assert.equal(healsOn(h, u, ground).length, 1, `T${tier}: one heal so far`); + const bar = ground.findBuff('shining:barrier'); + approx(bar.shield, u.s.atk * sk.bb.atk_scale, `T${tier}: ${sk.bb.atk_scale * 100} % ATK`); + approx(bar.duration, sk.bb.duration, `T${tier}: ${sk.bb.duration} s`); + assert.equal(bar.shieldType, null, `T${tier}: absorbs every damage type`); + assert.deepEqual(ground.findBuff('shining:barrierDef')?.mods, { defPct: sk.bb.def }, `T${tier}: DEF bonus`); + approx(ground.s.def, def0 * (1 + sk.bb.def), `T${tier}: DEF`, 1e-6); + // the barrier takes physical and arts damage alike + const hp0 = ground.hp, sh0 = bar.shield; + h.b.dealDamage(null, ground, { amount: 10, type: 'arts', canDodge: false }); + approx(ground.hp, hp0, `T${tier}: arts absorbed`); + approx(bar.shield, sh0 - 10, `T${tier}: shield −10`); + h.b.dealDamage(null, ground, { amount: 1e6, type: 'true' }); + assert.equal(ground.findBuff('shining:barrier'), null, `T${tier}: broken`); + assert.equal(ground.findBuff('shining:barrierDef'), null, `T${tier}: the DEF bonus goes with it`); + done(h); + } +}); + +test('S2 自动掩护: barriers stack with their own timers, the older absorbs first, the DEF bonus does not stack; all gone after their time', () => { + const sk = skillOf(6, true, S2); + const { h, u, ground } = field({ tier: 6, elite: true, mod: PHYY, skill: 1 }); + ground.hp = 100; + u.skill.gainSp(999); + assert.ok(h.runUntil(() => ground.buffs.filter((b) => b.key === 'shining:barrier').length === 1, 5)); + ground.hp = 100; // still the most injured + assert.ok(h.runUntil(() => ground.buffs.filter((b) => b.key === 'shining:barrier').length === 2, 8), 'the second charge on the next heal'); + const [a, b] = ground.buffs.filter((x) => x.key === 'shining:barrier'); + assert.ok(a.seq < b.seq && a.timeLeft < b.timeLeft, 'own timers'); + assert.equal(ground.buffs.filter((x) => x.key === 'shining:barrierDef').length, 1, 'one DEF bonus'); + approx(ground.findBuff('shining:barrierDef').mods.defPct, sk.bb.def, 'not doubled'); + approx(ground.s.shield, a.shield + b.shield, 'the absorption adds up'); + const sa = a.shield, sb = b.shield; + h.b.dealDamage(null, ground, { amount: sa / 2, type: 'true' }); + approx(a.shield, sa / 2, 'the older one first'); + approx(b.shield, sb, 'the newer one untouched'); + h.run(sk.bb.duration + 0.1); + assert.equal(ground.findBuff('shining:barrier'), null, 'expired'); + assert.equal(ground.findBuff('shining:barrierDef'), null, 'the DEF bonus with them'); + done(h); +}); + +test('S3 教条力场 (MANUAL, data DEFAULT): 60 s, ATK +30 % / +40 %, every ally in her range DEF +45 % / +60 % (not outside it); gone after it ends', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S3); + const { h, u, ground, high, out } = field({ tier, elite, mod: elite ? PHYX : null, skill: 2 }); + assert.deepEqual([u.skill.rule, sk.duration, sk.spCost, sk.initSp, sk.bb.atk, sk.bb.def], ['DEFAULT', 60, 120, 100, elite ? 0.4 : 0.3, elite ? 0.6 : 0.45], `T${tier}`); + u.skill.gainSp(999); + ground.hp = 100; + assert.ok(h.runUntil(() => u.skill.active, 5), `T${tier}: cast on the injured ally`); + h.run(0.3); + approx(u.s.atk, u.base.atk * (1 + sk.bb.atk), `T${tier}: ATK`); + for (const a of [ground, high, u]) assert.deepEqual(a.findBuff('skill:shining:def')?.mods, { defPct: sk.bb.def }, `T${tier}: ${a.defId} in range`); + assert.equal(out.findBuff('skill:shining:def'), null, `T${tier}: outside her range`); + u.skill.end('test'); + h.run(0.3); + for (const a of [ground, high, u]) assert.equal(a.findBuff('skill:shining:def'), null, `T${tier}: gone once it ends`); + done(h); + } +}); + +test('T1 黑恶魔的庇护: allies in her range DEF +60 (herself too, not outside); PHY-Y stage 3: +100 and 地面 units +40 more (stage 1: +60 only)', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u, ground, high, out } = field({ tier, elite, mod, skill: 0 }); + h.run(0.3); + const y3 = elite && tier === 6 && mod === PHYY; + const d = y3 ? 100 : 60, low = y3 ? 40 : 0; + assert.deepEqual(ground.findBuff('talent:shining:def')?.mods, { defFlat: d + low }, `${label(f)}: 地面 ally`); + assert.deepEqual(high.findBuff('talent:shining:def')?.mods, { defFlat: d }, `${label(f)}: 高台 ally`); + assert.deepEqual(u.findBuff('talent:shining:def')?.mods, { defFlat: d }, `${label(f)}: herself (高台)`); + assert.equal(out.findBuff('talent:shining:def'), null, `${label(f)}: outside her range`); + approx(ground.s.def, 100 + d + low, `${label(f)}: DEF of the 地面 ally`); + if (y3) assert.match(u.def.raw.talents.find((t) => t.index === 0).desc, /防御力\+100,地面单位防御力额外\+40/); + h.b.retreat(u); + h.run(0.3); + assert.equal(ground.findBuff('talent:shining:def'), null, `${label(f)}: gone once she leaves`); + done(h); + } +}); + +test('T2 法典: ASPD +10; PHY-X stage 3: ASPD +15, ATK +25 % with 自动掩护 picked, SP +0.6/s with 教条力场 picked (stage 1: ASPD +10 only)', () => { + 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 x3 = elite && tier === 6 && mod === PHYX; + approx(u.s.aspd, u.base.aspd + (x3 ? 15 : 10), `${label(f)} S${skill + 1}: ASPD`); + approx(u.s.atk, u.base.atk * (1 + (x3 && skill === 1 ? 0.25 : 0)), `${label(f)} S${skill + 1}: ATK`); + approx(u.s.spRecovery, 1 + (x3 && skill === 2 ? 0.6 : 0), `${label(f)} S${skill + 1}: SP/s`); + if (x3 && skill === 2) { + const sp0 = u.skill.sp; + h.run(5); + approx(u.skill.sp - sp0, 5 * 1.6, `${label(f)}: 1.6 SP/s`, 0.01); + } + done(h); + } + } +}); + +test('module traits: PHY-Y heals on 地面 units ×1.15 (not on 高台), PHY-X heals on allies below 50 % ×1.15 (stages 1 and 3); none without a module', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u, ground, high } = field({ tier, elite, mod, skill: 0 }); + const tb = u.def.raw.trait.bb; + const y = elite && mod === PHYY, x = elite && mod === PHYX; + if (y) assert.deepEqual(tb, { heal_scale: 1.15 }, label(f)); + if (x) assert.deepEqual(tb, { heal_scale: 1.15, hp_ratio: 0.5 }, label(f)); + const heal = (t, hp) => { + t.hp = hp; + const n0 = h.hooksOf('heal').length; + assert.ok(h.runUntil(() => healsOn(h, u, t, n0).length > 0, 6), `${label(f)}: a heal on ${t.defId}`); + return healsOn(h, u, t, n0)[0].amount; + }; + // 地面 vs 高台, both below 50 % + approx(heal(ground, 100), u.s.atk * (y || x ? 1.15 : 1), `${label(f)}: 地面 ally at 1 %`); + ground.hp = ground.s.maxHp; + approx(heal(high, 100), u.s.atk * (x ? 1.15 : 1), `${label(f)}: 高台 ally at 1 %`); + high.hp = high.s.maxHp; + // above 50 % + approx(heal(ground, 6000), u.s.atk * (y ? 1.15 : 1), `${label(f)}: 地面 ally at 60 %`); + ground.hp = ground.s.maxHp; + approx(heal(high, 6000), u.s.atk, `${label(f)}: 高台 ally at 60 %`); + done(h); + } +}); diff --git a/test/golden/diy.json b/test/golden/diy.json index d842b158..9217128f 100644 --- a/test/golden/diy.json +++ b/test/golden/diy.json @@ -90,130 +90,130 @@ "snaps": "d7b739d1 f5e170c4 bc463f9c 6ebd80ed 93f8e1ae ea1947a7 9541a28f e8dbac5b b0b3c196 14ae4a64 46640828 01c55ea9 0f261678 f447848b 0aad3542 db5850a3 631cc5ca 455c1dbc 68ad7134 24c71ebb 34a3ee93 37b05130 7a58a87e" }, "diy-003": { - "about": "5_diy1_a=cdfend 5_diy2_b=cdfend 5_diy1_a=cguard 5_diy2_b=cguard 5_diy1_a=csnipe 5_diy2_b=csnipe 5_diy1_a=ccast 5_diy2_b=ccast 5_diy1_a=cmedic 5_diy2_b=cmedic 5_diy1_a=csuppo 5_diy2_b=csuppo", - "fast": true, + "about": "5_diy1_a=shining/S1 5_diy2_a=shining/S2 5_diy1_a=shining/S3 5_diy2_b=shining/S1 5_diy1_b=shining/S2 5_diy2_b=shining/S3 5_diy1_b=shining/S1/002_shining 5_diy2_b=shining/S2/002_shining 5_diy1_b=shining/S3/002_shining 5_diy2_b=shining/S1/003_shining 5_diy1_b=shining/S2/003_shining 5_diy2_b=shining/S3/003_shining", + "fast": false, "kind": "normal", "stageId": "act1autochess_m03", "modeId": "mode_single_normal", "round": 12, "seed": 3865246633, "waveId": "act1autochess_h05", - "time": 196.5, - "ticks": 5895, - "reason": "cleared", - "killed": 8, + "time": 230, + "ticks": 6900, + "reason": "timeout", + "killed": 0, "total": 93, "unspawned": 0, "bossHpLeft": null, "rngDraws": 0, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":8,"total":93,"perfect":false,"leaks":85,"leaksUncounted":0,"coins":0,"dmg":306215,"bossDmg":0,"heal":22436,"deaths":11,"layerGains":{}}}, + "players": {"p1":{"killed":0,"total":93,"perfect":false,"leaks":93,"leaksUncounted":0,"coins":0,"dmg":0,"bossDmg":0,"heal":185521,"deaths":0,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,114,0,690,6384,0,13,0], - ["p1",2,"op","chess_char_5_diy2_b",2,"none",0,0,98,1,7246,10191,0,56,1], - ["p1",3,"op","chess_char_5_diy1_a",2,null,2564,1,116,1,16020,8139,0,28,1], - ["p1",4,"op","chess_char_5_diy2_b",2,"none",0,0,74,3,34176,12589,0,37,2], - ["p1",5,"op","chess_char_5_diy1_a",2,null,871,1,8,1,22261,400,0,129,3], - ["p1",6,"op","chess_char_5_diy2_b",2,"none",1510,1,12,0,32187,200,0,108,3], - ["p1",7,"op","chess_char_5_diy1_a",2,null,1133,1,14,0,30588,200,0,77,2], - ["p1",8,"op","chess_char_5_diy2_b",2,"none",1160,1,4,1,71148,200,0,154,3], - ["p1",9,"op","chess_char_5_diy1_a",2,null,1218,1,6,0,0,600,18186,48,3], - ["p1",10,"op","chess_char_5_diy2_b",2,"none",1374,1,115,0,0,8077,4251,12,2], - ["p1",11,"op","chess_char_5_diy1_a",2,null,932,1,13,1,40672,2000,0,123,3], - ["p1",12,"op","chess_char_5_diy2_b",2,"none",1131,1,15,0,51226,800,0,132,3], + ["p1",1,"op","chess_char_5_diy1_a",0,null,1451,1,6,0,0,0,22717,78,3], + ["p1",2,"op","chess_char_5_diy2_a",1,null,1451,1,11,0,0,0,20607,62,27], + ["p1",3,"op","chess_char_5_diy1_a",2,null,1451,1,14,0,0,0,5958,30,2], + ["p1",4,"op","chess_char_5_diy2_b",0,"none",1558,1,4,0,0,0,22320,73,4], + ["p1",5,"op","chess_char_5_diy1_b",1,"none",1558,1,5,0,0,0,24367,66,30], + ["p1",6,"op","chess_char_5_diy2_b",2,"none",1558,1,7,0,0,47004,19636,62,2], + ["p1",7,"op","chess_char_5_diy1_b",0,"uniequip_002_shining",1558,1,12,0,0,0,22281,78,4], + ["p1",8,"op","chess_char_5_diy2_b",1,"uniequip_002_shining",1558,1,15,0,0,0,0,0,0], + ["p1",9,"op","chess_char_5_diy1_b",2,"uniequip_002_shining",1558,1,8,0,0,18646,20659,71,2], + ["p1",10,"op","chess_char_5_diy2_b",0,"uniequip_003_shining",1558,1,10,0,0,51781,8040,30,3], + ["p1",11,"op","chess_char_5_diy1_b",1,"uniequip_003_shining",1558,1,13,0,0,17459,518,2,2], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_003_shining",1558,1,9,0,0,50630,18418,53,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_1267_nhpbr_2":[36,8,28,17650,131613],"enemy_1270_nhstlk_2":[27,0,27,15235,63417],"enemy_9006_actoxi":[30,0,30,16896,111185]}, - "hooks": [1,116,5895,1089,1089,1215,1215,60,19,104,26,24,0,28385,254,28,93,85,1,19,0,0,0], - "events": {"atk":1089,"deploy":20,"die":19,"dmg":1215,"fx":8,"heal":60,"leak":85,"skill":50,"spawn":108,"status":504}, - "fx": {"zone":8}, - "snaps": "b1b2dda9 6ac577d6 84811e80 eb6305ea 52a34c95 c2fd4731 45525f0b dbcc3ddb ddfcbc11 0874e859 206cd671 4c83f44b f4f5331a 194da7d5 1fe13dbf 6b7331b4 4cf19629 7bae5e13 5b7078fc 65a8a1f5" + "enemies": {"enemy_1267_nhpbr_2":[36,0,34,36105,0],"enemy_1270_nhstlk_2":[27,0,24,149416,0],"enemy_9006_actoxi":[30,0,30,0,0]}, + "hooks": [1,108,6900,1122,1122,522,522,605,0,88,81,75,0,49928,0,5,93,88,1,0,0,0,0], + "events": {"atk":1122,"deploy":12,"dmg":520,"fx":59,"heal":605,"leak":88,"skill":156,"spawn":108,"status":802}, + "fx": {"shield":59}, + "snaps": "92e45a7e 4101cb55 09178ded 9593ca19 c4fcc9be ba431ddf fdc4afc9 bfbc54f4 59e11e41 4b3d9740 fea16e87 7b55862e c452f848 605ae98a 231c5a1a 5722213b 3b9ad612 9ef1b38b 5c6ca92b 39361b7d ce737a77 fa8b4f91 ca4d38ea" }, "diy-004": { - "about": "5_diy1_a=acfend 5_diy2_b=acfend 5_diy1_a=acpion 5_diy2_b=acpion 5_diy1_a=acguad 5_diy2_b=acguad 5_diy1_a=acnipe 5_diy2_b=acnipe 5_diy1_a=accast 5_diy2_b=accast 5_diy1_a=acmedc 5_diy2_b=acmedc", + "about": "6_diy1_a=shining/S1 6_diy2_a=shining/S2 6_diy1_a=shining/S3 6_diy2_b=shining/S1 6_diy1_b=shining/S2 6_diy2_b=shining/S3 6_diy1_b=shining/S1/002_shining 6_diy2_b=shining/S2/002_shining 6_diy1_b=shining/S3/002_shining 6_diy2_b=shining/S1/003_shining 6_diy1_b=shining/S2/003_shining 6_diy2_b=shining/S3/003_shining", "fast": false, "kind": "normal", "stageId": "act1autochess_m04", "modeId": "mode_multi_abyss", - "round": 12, - "seed": 1210847140, - "waveId": "act1autochess_h05", - "time": 224.77, - "ticks": 6743, - "reason": "cleared", - "killed": 21, - "total": 117, - "unspawned": 0, - "bossHpLeft": null, - "rngDraws": 350, - "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":21,"total":117,"perfect":false,"leaks":96,"leaksUncounted":0,"coins":0,"dmg":374057,"bossDmg":0,"heal":25487,"deaths":23,"layerGains":{}}}, - "units": [ - ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,116,0,0,5208,0,0,0], - ["p1",2,"op","chess_char_5_diy2_b",2,"uniequip_002_acfend",100.37,1,143,0,0,6642,0,0,0], - ["p1",3,"op","chess_char_5_diy1_a",2,null,1060.28,1,145,0,4912,3527,0,0,1], - ["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acpion",0,0,98,5,85077,5533,0,0,3], - ["p1",5,"op","chess_char_5_diy1_a",2,null,0,0,104,0,0,8356,0,0,0], - ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acguad",0,0,100,0,0,20296,0,0,0], - ["p1",7,"op","chess_char_5_diy1_a",2,null,0,0,132,0,16051,2544,0,16,1], - ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_acnipe",0,0,135,5,91286,3174,0,37,1], - ["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,77,0,6653,2744,0,3,0], - ["p1",10,"op","chess_char_5_diy2_b",2,"uniequip_002_accast",0,0,7,11,170077,1749,0,21,1], - ["p1",11,"op","chess_char_5_diy1_a",2,null,0,0,144,0,0,5333,10172,24,1], - ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acmedc",0,0,94,0,0,8375,15315,21,1], - ["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null], - ["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null], - ["-","~3","device","trap_1105_accrate",null,null,100,1,3,0,0,0,0,0,null] - ], - "enemies": {"enemy_1005_yokai":[51,16,35,0,83756],"enemy_1005_yokai_2":[54,5,49,24107,111017],"enemy_1005_yokai_3":[12,0,12,42273,179284]}, - "hooks": [1,145,6743,501,501,975,936,86,44,140,9,9,0,14181,0,0,117,96,1,44,0,0,39], - "events": {"atk":594,"deploy":25,"die":44,"dmg":936,"fx":87,"heal":78,"leak":96,"skill":18,"spawn":132,"status":8}, - "fx": {"aoe":1,"dodge":39,"dp":9,"slash":32,"spGain":6}, - "snaps": "6b632c98 e087bd9f f5b9da13 f7038fad bb4d7811 5178d072 0c0de684 872f1892 81773c41 3d296a6a 66f1329a 3a99c8b1 aa011a13 319c8ec5 26231cc7 f808b9be 73dd7977 75857859 817f18b6 d1cdd533 cd927f27 64106a51 89f62784" - }, - "diy-005": { - "about": "6_diy1_a=acfend 6_diy2_b=acfend 5_diy1_a=sharp2 5_diy2_b=sharp2 6_diy1_a=acpion 6_diy2_b=acpion 5_diy1_a=acspec 5_diy2_b=acspec 6_diy1_a=acguad 6_diy2_b=acguad 5_diy1_a=acsupo 5_diy2_b=acsupo", - "fast": false, - "kind": "normal", - "stageId": "act1autochess_m05", - "modeId": "mode_multi_funny", "round": 13, - "seed": 823748262, + "seed": 1210847140, "waveId": "act1autochess_h06", "time": 230, "ticks": 6900, "reason": "timeout", - "killed": 63, - "total": 123, + "killed": 0, + "total": 111, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 117, + "rngDraws": 0, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":63,"total":123,"perfect":false,"leaks":60,"leaksUncounted":0,"coins":0,"dmg":274732,"bossDmg":0,"heal":0,"deaths":20,"layerGains":{}}}, + "players": {"p1":{"killed":0,"total":111,"perfect":false,"leaks":111,"leaksUncounted":0,"coins":0,"dmg":0,"bossDmg":0,"heal":317543,"deaths":7,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_6_diy1_a",2,null,1834,1,132,5,19446,3374,0,80,2], - ["p1",2,"op","chess_char_6_diy2_b",2,"uniequip_002_acfend",2142.36,1,141,5,29488,4720,0,101,2], - ["p1",3,"op","chess_char_5_diy1_a",0,null,1865,1,154,3,27639,3730,0,42,1], - ["p1",4,"op","chess_char_5_diy2_b",0,"uniequip_002_sharp2",2374,1,152,11,43106,4748,0,39,1], - ["p1",5,"op","chess_char_6_diy1_a",2,null,0,0,135,3,18986,4587,0,18,1], - ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acpion",1808.52,1,143,18,92036,3903,0,40,4], - ["p1",7,"op","chess_char_5_diy1_a",2,null,117.2,1,130,12,39744,6807,0,115,0], - ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_acspec",1448,1,1,0,0,0,0,0,0], - ["p1",9,"op","chess_char_6_diy1_a",2,null,2638,1,3,0,0,0,0,0,0], - ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_acguad",3531,1,5,0,0,0,0,0,0], - ["p1",11,"op","chess_char_5_diy1_a",2,null,1160,1,153,0,1743,2320,0,7,0], - ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acsupo",1120.4,1,145,0,2545,3170,0,7,1] + ["p1",1,"op","chess_char_6_diy1_a",0,null,1451,1,4,0,0,0,31717,90,3], + ["p1",2,"op","chess_char_6_diy2_a",1,null,1451,1,5,0,0,0,29399,87,28], + ["p1",3,"op","chess_char_6_diy1_a",2,null,1451,1,15,0,0,0,0,0,0], + ["p1",4,"op","chess_char_6_diy2_b",0,"none",1558,1,132,0,0,4210,11525,34,1], + ["p1",5,"op","chess_char_6_diy1_b",1,"none",1558,1,131,0,0,10917,11663,34,11], + ["p1",6,"op","chess_char_6_diy2_b",2,"none",1488,1,10,0,0,98292,41531,101,2], + ["p1",7,"op","chess_char_6_diy1_b",0,"uniequip_002_shining",1558,1,12,0,0,20574,42390,92,4], + ["p1",8,"op","chess_char_6_diy2_b",1,"uniequip_002_shining",819.17,1,14,0,0,77325,33597,67,32], + ["p1",9,"op","chess_char_6_diy1_b",2,"uniequip_002_shining",1558,1,120,0,0,16591,10464,35,2], + ["p1",10,"op","chess_char_6_diy2_b",0,"uniequip_003_shining",1558,1,133,0,0,39587,29777,63,2], + ["p1",11,"op","chess_char_6_diy1_b",1,"uniequip_003_shining",1488,1,11,0,0,39345,47634,100,32], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_003_shining",1558,1,13,0,0,22487,27845,82,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_1019_jshoot_2":[57,37,20,9953,112024],"enemy_1299_ymkilr_2":[27,6,20,25821,123649],"enemy_1422_lrsldr_2":[39,20,19,1584,123193]}, - "hooks": [1,154,6900,835,835,3335,3375,0,83,142,12,15,0,16427,38,83,123,59,1,83,0,0,0], - "events": {"atk":851,"deploy":31,"die":83,"dmg":3367,"fx":150,"leak":59,"skill":22,"spawn":135,"status":47}, - "fx": {"aoe":83,"displace":3,"dp":26,"slash":38}, - "snaps": "aa4b712f 51a2360b 59868653 c815c7eb 7dd47d06 3f3f03f4 89e883c3 60e1e7f6 2355716a 5d734980 75cde05f c0dd657c 4e5bd257 0f8a040d b1aafe05 c04cbb36 e6d37890 8457998a a19143e5 d709bc2b 4283543b 0d9edf54 6ef9963d" + "enemies": {"enemy_1010_demon":[54,0,52,182071,42560],"enemy_1320_wdrrl_2":[18,0,18,0,14490],"enemy_1422_lrsldr_2":[39,0,35,118023,40600]}, + "hooks": [1,133,6900,1312,1312,2382,2382,785,7,112,119,116,0,47642,0,13,111,105,1,7,0,0,0], + "events": {"atk":1312,"deploy":19,"die":7,"dmg":2335,"fx":103,"heal":785,"leak":105,"skill":235,"spawn":126,"status":200}, + "fx": {"shield":103}, + "snaps": "e34671e4 fd6488a7 654f82c0 1b2527d4 b1190f19 2b8c378f 938290e4 341bc480 adfabede 1e8b9417 5b2ff188 4fe6436e b9dd5c96 a5c9611c 00d0abba 26eb74c9 8e7fbbf6 6eace16c 98340e49 31fc6bf2 5ad84568 ffda62d4 13177516" + }, + "diy-005": { + "about": "5_diy1_a=cgbird/S1 5_diy2_a=cgbird/S2 5_diy1_a=cgbird/S3 5_diy2_b=cgbird/S1 5_diy1_b=cgbird/S2 5_diy2_b=cgbird/S3 5_diy1_b=cgbird/S1/002_cgbird 5_diy2_b=cgbird/S2/002_cgbird 5_diy1_b=cgbird/S3/002_cgbird 5_diy2_b=cgbird/S1/003_cgbird 5_diy1_b=cgbird/S2/003_cgbird 5_diy2_b=cgbird/S3/003_cgbird", + "fast": false, + "kind": "normal", + "stageId": "act1autochess_m05", + "modeId": "mode_multi_funny", + "round": 12, + "seed": 823748262, + "waveId": "act1autochess_h05", + "time": 230, + "ticks": 6900, + "reason": "timeout", + "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":0,"bossDmg":0,"heal":46494,"deaths":0,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",0,null,1346,1,10,0,0,0,0,0,0], + ["p1",2,"op","chess_char_5_diy2_a",1,null,1346,1,11,0,0,0,0,0,0], + ["p1",3,"op","chess_char_5_diy1_a",2,null,1346,1,1,0,0,0,10206,32,2], + ["p1",4,"op","chess_char_5_diy2_b",0,"none",1584,1,3,0,0,0,22326,64,4], + ["p1",5,"op","chess_char_5_diy1_b",1,"none",1584,1,5,0,0,0,6180,45,20], + ["p1",6,"op","chess_char_5_diy2_b",2,"none",1584,1,7,0,0,0,0,0,0], + ["p1",7,"op","chess_char_5_diy1_b",0,"uniequip_002_cgbird",1584,1,9,0,0,0,0,0,0], + ["p1",8,"op","chess_char_5_diy2_b",1,"uniequip_002_cgbird",1584,1,12,0,0,0,0,0,0], + ["p1",9,"op","chess_char_5_diy1_b",2,"uniequip_002_cgbird",1584,1,2,0,0,11070,4071,30,2], + ["p1",10,"op","chess_char_5_diy2_b",0,"uniequip_003_cgbird",1744,1,4,0,0,11439,3410,19,2], + ["p1",11,"op","chess_char_5_diy1_b",1,"uniequip_003_cgbird",1744,1,6,0,0,11808,301,7,6], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_003_cgbird",1744,1,8,0,0,12177,0,0,0] + ], + "enemies": {"enemy_1045_hammer_2":[12,0,12,0,15840],"enemy_1061_zomshd":[48,0,44,46494,73120]}, + "hooks": [1,72,6900,323,323,2350,2350,12993,0,56,36,33,0,24809,0,4,60,56,1,0,0,0,0], + "events": {"atk":323,"deploy":12,"dmg":2350,"fx":26,"heal":197,"leak":56,"skill":69,"spawn":72,"status":52}, + "fx": {"shield":26}, + "snaps": "9c64fa22 f9144b95 2a2e17f7 81903282 b65d92e6 7b137146 2380cbf2 12daaf00 eb421192 59336ea4 a361a21a 6a823d10 658278ae 3cfaf71c 3d652e61 cbc0b148 ce6ecf60 b8f8381c ed60da78 cf74230b ea4ea9fc 4a018807 3a70d891" }, "diy-006": { - "about": "6_diy1_a=sharp2 6_diy2_b=sharp2 6_diy1_a=acspec 6_diy2_b=acspec 6_diy1_a=acnipe 6_diy2_b=acnipe 6_diy1_a=accast 6_diy2_b=accast 6_diy1_a=acmedc 6_diy2_b=acmedc 6_diy1_a=acsupo 6_diy2_b=acsupo", + "about": "6_diy1_a=cgbird/S1 6_diy2_a=cgbird/S2 6_diy1_a=cgbird/S3 6_diy2_b=cgbird/S1 6_diy1_b=cgbird/S2 6_diy2_b=cgbird/S3 6_diy1_b=cgbird/S1/002_cgbird 6_diy2_b=cgbird/S2/002_cgbird 6_diy1_b=cgbird/S3/002_cgbird 6_diy2_b=cgbird/S1/003_cgbird 6_diy1_b=cgbird/S2/003_cgbird 6_diy2_b=cgbird/S3/003_cgbird", "fast": false, "kind": "normal", "stageId": "act1autochess_m06", @@ -221,35 +221,281 @@ "round": 13, "seed": 2464539579, "waveId": "act1autochess_h06", - "time": 210.23, - "ticks": 6307, + "time": 209.03, + "ticks": 6271, "reason": "cleared", - "killed": 5, + "killed": 0, "total": 81, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 123, + "rngDraws": 0, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":5,"total":81,"perfect":false,"leaks":76,"leaksUncounted":0,"coins":0,"dmg":185202,"bossDmg":0,"heal":4048,"deaths":30,"layerGains":{}}}, + "players": {"p1":{"killed":0,"total":81,"perfect":false,"leaks":81,"leaksUncounted":0,"coins":0,"dmg":0,"bossDmg":0,"heal":52555,"deaths":23,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,3,0,11325,1865,0,7,1], - ["p1",2,"op","chess_char_6_diy2_b",0,"uniequip_002_sharp2",0,0,6,3,52957,2494,0,16,1], - ["p1",3,"op","chess_char_6_diy1_a",2,null,1154,1,112,0,15444,8178,0,22,0], - ["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acspec",0,0,109,2,51553,12663,0,57,0], - ["p1",5,"op","chess_char_6_diy1_a",2,null,1272,1,113,0,4256,2544,0,15,0], - ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acnipe",0,0,105,0,10180,3286,0,19,0], - ["p1",7,"op","chess_char_6_diy1_a",2,null,0,0,5,0,3060,1372,0,2,0], - ["p1",8,"op","chess_char_6_diy2_b",2,"uniequip_002_accast",0,0,2,0,30589,1819,0,4,1], - ["p1",9,"op","chess_char_6_diy1_a",2,null,0,0,8,0,0,2028,2464,7,1], - ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_acmedc",0,0,61,0,0,3890,1584,6,1], - ["p1",11,"op","chess_char_6_diy1_a",2,null,0,0,58,0,2490,3291,0,7,1], - ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_002_acsupo",0,0,60,0,3347,3320,0,8,0] + ["p1",1,"op","chess_char_6_diy1_a",0,null,1346,1,105,0,0,4782,4964,9,1], + ["p1",2,"op","chess_char_6_diy2_a",1,null,0,0,84,0,0,4663,3952,11,3], + ["p1",3,"op","chess_char_6_diy1_a",2,null,0,0,91,0,0,8254,4631,13,1], + ["p1",4,"op","chess_char_6_diy2_b",0,"none",0,0,96,0,0,6265,4630,10,1], + ["p1",5,"op","chess_char_6_diy1_b",1,"none",0,0,103,0,0,12104,5982,13,2], + ["p1",6,"op","chess_char_6_diy2_b",2,"none",0,0,57,0,0,5131,3913,8,1], + ["p1",7,"op","chess_char_6_diy1_b",0,"uniequip_002_cgbird",0,0,53,0,0,6415,965,4,0], + ["p1",8,"op","chess_char_6_diy2_b",1,"uniequip_002_cgbird",0,0,63,0,0,9905,4778,12,3], + ["p1",9,"op","chess_char_6_diy1_b",2,"uniequip_002_cgbird",0,0,60,0,0,6451,4094,9,1], + ["p1",10,"op","chess_char_6_diy2_b",0,"uniequip_003_cgbird",0,0,58,0,0,14464,3260,9,1], + ["p1",11,"op","chess_char_6_diy1_b",1,"uniequip_003_cgbird",0,0,4,0,0,4070,5591,9,3], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_003_cgbird",0,0,6,0,0,5936,5794,12,1] ], - "enemies": {"enemy_1267_nhpbr_2":[27,5,22,7765,89733],"enemy_1270_nhstlk_2":[36,0,36,14278,68347],"enemy_1272_nhtank_2":[18,0,18,24706,27121]}, - "hooks": [1,113,6307,262,262,449,476,16,35,111,6,21,0,5828,86,24,81,76,1,35,0,0,0], - "events": {"atk":283,"deploy":32,"die":35,"dmg":441,"fx":58,"heal":15,"leak":76,"skill":12,"spawn":93,"status":142}, - "fx": {"aoe":7,"displace":21,"spGain":6,"zone":24}, - "snaps": "1dcf4706 8bd55683 d93e4d02 ab832ad5 132699ab f37b039d f12175ca fe30225b 6b2b77c0 2caefa3a 1018f9e1 a60a2364 f81df3c0 d0f2780e 0e940f53 372c90ef 46af3a81 a6b2adf1 63234976 3b8b7c59 b62aa8d4" + "enemies": {"enemy_1267_nhpbr_2":[27,0,27,11003,0],"enemy_1270_nhstlk_2":[36,0,36,27732,0],"enemy_1272_nhtank_2":[18,0,18,49703,0]}, + "hooks": [1,105,6271,248,248,277,277,216,23,104,18,18,0,8073,0,19,81,81,1,23,0,0,0], + "events": {"atk":345,"deploy":24,"die":23,"dmg":277,"fx":46,"heal":216,"leak":81,"skill":36,"spawn":93,"status":109}, + "fx": {"shield":21,"zone":25}, + "snaps": "e988afb9 5ed9a694 a149b7d3 a5c6e631 9a22483b eb5160ce 3f4f3ea3 602b750a 9a93c48d f635c1e6 c42f0720 b8afa411 f7bc4161 b371af4b a0297df5 ad4f6316 4c232c72 b86f3d20 f296b6be 34dc3161 8c0fefbd" + }, + "diy-007": { + "about": "5_diy1_a=saga/S1 5_diy2_a=saga/S2 5_diy1_a=saga/S3 5_diy2_b=saga/S1 5_diy1_b=saga/S2 5_diy2_b=saga/S3 5_diy1_b=saga/S1/002_saga 5_diy2_b=saga/S2/002_saga 5_diy1_b=saga/S3/002_saga 5_diy2_b=saga/S1/003_saga 5_diy1_b=saga/S2/003_saga 5_diy2_b=saga/S3/003_saga", + "fast": false, + "kind": "normal", + "stageId": "act1autochess_m07", + "modeId": "mode_multi_normal", + "round": 12, + "seed": 1837403644, + "waveId": "act1autochess_h05", + "time": 197.3, + "ticks": 5919, + "reason": "cleared", + "killed": 2, + "total": 90, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 0, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":2,"total":90,"perfect":false,"leaks":88,"leaksUncounted":0,"coins":0,"dmg":86458,"bossDmg":0,"heal":4725,"deaths":27,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",0,null,0,0,119,0,2636,5103,276,14,1], + ["p1",2,"op","chess_char_5_diy2_a",1,null,0,0,74,0,9716,3269,51,11,2], + ["p1",3,"op","chess_char_5_diy1_a",2,null,0,0,70,0,6266,3433,215,14,1], + ["p1",4,"op","chess_char_5_diy2_b",0,"none",0,0,86,0,4528,4569,561,16,1], + ["p1",5,"op","chess_char_5_diy1_b",1,"none",0,0,116,0,15571,6713,701,19,2], + ["p1",6,"op","chess_char_5_diy2_b",2,"none",0,0,64,0,6202,4509,501,12,1], + ["p1",7,"op","chess_char_5_diy1_b",0,"uniequip_002_saga",0,0,109,0,4951,6809,572,17,0], + ["p1",8,"op","chess_char_5_diy2_b",1,"uniequip_002_saga",0,0,95,1,8918,4678,520,15,3], + ["p1",9,"op","chess_char_5_diy1_b",2,"uniequip_002_saga",0,0,101,0,9564,4234,76,14,1], + ["p1",10,"op","chess_char_5_diy2_b",0,"uniequip_003_saga",0,0,73,0,3611,4509,501,12,1], + ["p1",11,"op","chess_char_5_diy1_b",1,"uniequip_003_saga",0,0,69,0,9722,4258,251,10,2], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_003_saga",0,0,61,0,4774,4509,501,14,1], + ["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null], + ["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null] + ], + "enemies": {"enemy_1229_darmy":[27,2,25,14013,41919],"enemy_1229_darmy_2":[51,0,51,36324,37705],"enemy_9007_acelem":[12,0,12,6256,6834]}, + "hooks": [1,119,5919,287,287,342,436,1442,29,117,16,16,0,10928,0,55,90,88,1,30,0,0,0], + "events": {"atk":293,"deploy":27,"die":29,"dmg":436,"fx":55,"leak":88,"skill":32,"spawn":104,"status":64}, + "fx": {"aoe":9,"beam":5,"buff":27,"dp":12,"dying":2}, + "snaps": "f53a8c7e 8fb0d920 ba6bc02c 41e8910d af66066f cd444b9c 32863664 2269ebe2 81eea1bc 1aebec66 4afc288d bd186d8e fcc51d36 e1a5ef1e 57dacb53 f4f3d713 eed6247b b6e42bd9 81e2aad7 2de77e14" + }, + "diy-008": { + "about": "6_diy1_a=saga/S1 6_diy2_a=saga/S2 6_diy1_a=saga/S3 6_diy2_b=saga/S1 6_diy1_b=saga/S2 6_diy2_b=saga/S3 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", + "fast": false, + "kind": "normal", + "stageId": "act2autochess_m01", + "modeId": "mode_multi_hard", + "round": 13, + "seed": 3478524561, + "waveId": "act1autochess_h06", + "time": 230, + "ticks": 6900, + "reason": "timeout", + "killed": 1, + "total": 147, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 159, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":1,"total":147,"perfect":false,"leaks":146,"leaksUncounted":0,"coins":0,"dmg":75815,"bossDmg":0,"heal":24261,"deaths":29,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,174,0,2156,5213,386,12,1], + ["p1",2,"op","chess_char_6_diy2_a",1,null,0,0,176,0,10162,5792,965,26,4], + ["p1",3,"op","chess_char_6_diy1_a",2,null,654.96,1,177,0,1486,6162,1990,34,1], + ["p1",4,"op","chess_char_6_diy2_b",0,"none",2004,1,178,0,822,7007,2999,33,1], + ["p1",5,"op","chess_char_6_diy1_b",1,"none",0,0,97,0,13369,6109,2101,26,3], + ["p1",6,"op","chess_char_6_diy2_b",2,"none",0,0,135,0,14535,6710,2702,42,2], + ["p1",7,"op","chess_char_6_diy1_b",0,"uniequip_002_saga",0,0,166,0,6852,9021,2634,23,1], + ["p1",8,"op","chess_char_6_diy2_b",1,"uniequip_002_saga",0,0,143,0,12356,6964,2706,25,3], + ["p1",9,"op","chess_char_6_diy1_b",2,"uniequip_002_saga",0,0,110,0,5805,7302,3044,26,2], + ["p1",10,"op","chess_char_6_diy2_b",0,"uniequip_003_saga",0,0,106,0,1297,5675,1667,20,1], + ["p1",11,"op","chess_char_6_diy1_b",1,"uniequip_003_saga",0,0,161,0,2441,7057,1045,19,1], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_003_saga",0,0,158,0,4535,8033,2021,22,1] + ], + "enemies": {"enemy_1166_dusbr_2":[39,1,38,15107,50414],"enemy_1169_duphlx_2":[57,0,56,25614,11951],"enemy_1170_dushld_2":[51,0,51,40325,13450]}, + "hooks": [1,178,6900,538,538,593,491,6817,30,175,21,21,0,16462,0,59,147,145,1,30,0,0,102], + "events": {"atk":552,"deploy":31,"die":30,"dmg":491,"fx":159,"leak":145,"skill":42,"spawn":159,"status":207}, + "fx": {"aoe":11,"buff":30,"dodge":102,"dp":15,"dying":1}, + "snaps": "605c05b5 177fe0b9 17cf6a65 2fdd894e 3726e213 5b1220e1 2c05f9d1 f1e92317 c8fa3cc7 1fc6325e b1a6fa9c 2b096dbc fb56e9f6 d07184e5 32da3f96 4b0fdef2 05bbf5c1 9ff66b80 087c7137 77afe226 6b842d8d f636e80c 3b5beee4" + }, + "diy-009": { + "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_m02", + "modeId": "mode_single_normal", + "round": 12, + "seed": 2612428600, + "waveId": "act1autochess_h05", + "time": 230, + "ticks": 6900, + "reason": "timeout", + "killed": 18, + "total": 42, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 16, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":18,"total":42,"perfect":false,"leaks":24,"leaksUncounted":0,"coins":0,"dmg":44523,"bossDmg":0,"heal":13890,"deaths":27,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,3,0,0,2128,0,0,0], + ["p1",2,"op","chess_char_5_diy2_b",2,"none",0,0,5,0,0,2908,0,0,0], + ["p1",3,"op","chess_char_5_diy1_a",2,null,2011.59,1,72,0,0,6048,0,0,0], + ["p1",4,"op","chess_char_5_diy2_b",2,"none",0,0,69,0,0,15834,0,0,0], + ["p1",5,"op","chess_char_5_diy1_a",2,null,0,0,70,0,12861,3813,0,39,1], + ["p1",6,"op","chess_char_5_diy2_b",2,"none",0,0,71,2,18099,5499,0,37,1], + ["p1",7,"op","chess_char_5_diy1_a",2,null,0,0,41,0,3549,5150,0,8,0], + ["p1",8,"op","chess_char_5_diy2_b",2,"none",0,0,62,0,4172,2720,0,8,1], + ["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,52,0,0,3170,7114,17,1], + ["p1",10,"op","chess_char_5_diy2_b",2,"none",0,0,47,0,0,4724,6776,13,1], + ["p1",11,"op","chess_char_5_diy1_a",2,null,0,0,66,0,2686,3924,0,8,0], + ["p1",12,"op","chess_char_5_diy2_b",2,"none",0,0,68,0,3155,3393,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_2":[18,18,0,1068,5611],"enemy_1005_yokai_3":[12,0,11,29504,13404],"enemy_9009_acfort":[12,0,12,28738,25508]}, + "hooks": [1,72,6900,359,359,313,313,30,45,68,6,6,0,9424,15,0,42,23,1,29,0,0,0], + "events": {"atk":359,"deploy":28,"die":45,"dmg":313,"fx":48,"heal":30,"leak":23,"skill":12,"spawn":56,"status":58}, + "fx": {"beam":48}, + "snaps": "01ddaa21 40cc93bd 76fd1796 a556beec 5a491fff 42c19722 daae239a b1938432 613bbab5 6288c775 d2e7a34d 34d0429d a38fd313 74aaafe6 500df007 cff6af74 e4453931 0bcc0545 a01533fe a1b05a2f 1274a86d e320fbc6 49ce7e89" + }, + "diy-010": { + "about": "5_diy1_a=acfend 5_diy2_b=acfend 5_diy1_a=acpion 5_diy2_b=acpion 5_diy1_a=acguad 5_diy2_b=acguad 5_diy1_a=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": "act2autochess_m03", + "modeId": "mode_multi_abyss", + "round": 12, + "seed": 4252812069, + "waveId": "act1autochess_h05", + "time": 200.33, + "ticks": 6010, + "reason": "cleared", + "killed": 2, + "total": 114, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 172, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":2,"total":114,"perfect":false,"leaks":112,"leaksUncounted":0,"coins":0,"dmg":182635,"bossDmg":0,"heal":25725,"deaths":23,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,5,0,6997,5084,0,20,1], + ["p1",2,"op","chess_char_5_diy2_b",2,"uniequip_002_acfend",0,0,6,0,25454,7485,0,36,1], + ["p1",3,"op","chess_char_5_diy1_a",2,null,0,0,131,0,11917,5007,0,11,1], + ["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acpion",0,0,137,0,46700,7374,0,14,2], + ["p1",5,"op","chess_char_5_diy1_a",2,null,0,0,15,1,18796,9401,0,13,1], + ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acguad",0,0,9,1,27594,8718,0,13,1], + ["p1",7,"op","chess_char_5_diy1_a",2,null,0,0,140,0,2504,4496,0,8,0], + ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_acnipe",0,0,86,0,12411,3571,0,25,0], + ["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,84,0,17397,3199,0,9,0], + ["p1",10,"op","chess_char_5_diy2_b",2,"uniequip_002_accast",0,0,79,0,12865,3498,0,7,0], + ["p1",11,"op","chess_char_5_diy1_a",2,null,0,0,123,0,0,5480,16431,16,1], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acmedc",0,0,107,0,0,3242,9294,11,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_1019_jshoot_2":[51,0,51,18035,23732],"enemy_1381_winman":[27,2,25,5022,133945],"enemy_1389_winbab_2":[36,0,36,43500,24957]}, + "hooks": [1,140,6010,648,648,824,796,58,25,137,9,9,0,10146,0,25,114,112,1,111,0,0,28], + "events": {"atk":662,"deploy":23,"die":25,"dmg":796,"fx":115,"heal":55,"leak":112,"skill":18,"spawn":129,"status":6}, + "fx": {"aoe":45,"dodge":28,"dp":3,"slash":24,"spGain":15}, + "snaps": "92595b94 7470ea05 87f61dee 7f4ffe97 cbe8847a 3e038e5d 601b434b 71c68e3a dad94e04 e7555c5a a41da75a 6b9cae42 5b82fe3a a0b8a9a0 e4e6c8b0 d632d980 1421829f 131f874a c4fba1a0 2bf4f8c0" + }, + "diy-011": { + "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": "act2autochess_m04", + "modeId": "mode_multi_funny", + "round": 13, + "seed": 538212341, + "waveId": "act1autochess_h06", + "time": 229.37, + "ticks": 6881, + "reason": "cleared", + "killed": 77, + "total": 144, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 469, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":77,"total":144,"perfect":false,"leaks":67,"leaksUncounted":0,"coins":0,"dmg":570274,"bossDmg":0,"heal":0,"deaths":31,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_6_diy1_a",2,null,1962.4,1,179,6,15110,3246,0,55,1], + ["p1",2,"op","chess_char_6_diy2_b",2,"uniequip_002_acfend",0,0,8,5,17191,3431,0,29,1], + ["p1",3,"op","chess_char_5_diy1_a",0,null,0,0,5,10,123913,1865,0,93,2], + ["p1",4,"op","chess_char_5_diy2_b",0,"uniequip_002_sharp2",0,0,149,9,132299,4748,0,66,1], + ["p1",5,"op","chess_char_6_diy1_a",2,null,0,0,171,1,13760,4587,0,4,2], + ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acpion",728.2,1,175,14,81512,4984,0,22,4], + ["p1",7,"op","chess_char_5_diy1_a",2,null,1154,1,181,1,26372,9232,0,45,0], + ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_acspec",222,1,167,6,46260,11362,0,74,0], + ["p1",9,"op","chess_char_6_diy1_a",2,null,0,0,101,6,25034,5276,0,32,1], + ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_acguad",0,0,6,11,29529,3531,0,27,2], + ["p1",11,"op","chess_char_5_diy1_a",2,null,1160,1,182,3,28509,1160,0,81,2], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acsupo",0,0,180,3,30784,2860,0,77,2], + ["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null], + ["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null] + ], + "enemies": {"enemy_2021_syfish":[99,69,30,6570,284647],"enemy_2025_syufo":[45,8,37,49711,298229]}, + "hooks": [1,182,6881,1274,1274,1996,2399,0,108,175,18,33,0,21458,3856,81,144,67,1,120,0,38,23], + "events": {"atk":1352,"deploy":36,"die":108,"dmg":2368,"fx":233,"leak":67,"skill":36,"spawn":158,"status":598}, + "fx": {"aoe":59,"burst":38,"displace":17,"dodge":51,"dp":21,"slash":47}, + "snaps": "92d2c234 0d52cb20 064f965c 6fde5156 7063dc83 04520c78 055d8f89 e65ad5f1 940635c1 20e753e0 d4d7b60c 97445548 48eadeb1 07a129d8 4b4500d4 10523dc8 5bafda55 0f7f0ab4 12179026 e3d8ef3b f7bc13b0 b98593f9 cc1a0966" + }, + "diy-012": { + "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_m01", + "modeId": "mode_single_hard", + "round": 13, + "seed": 3192456040, + "waveId": "act1autochess_h06", + "time": 230, + "ticks": 6900, + "reason": "timeout", + "killed": 26, + "total": 117, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 1404, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":26,"total":117,"perfect":false,"leaks":91,"leaksUncounted":0,"coins":0,"dmg":962137,"bossDmg":0,"heal":16400,"deaths":24,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,114,2,45322,3730,0,44,1], + ["p1",2,"op","chess_char_6_diy2_b",0,"uniequip_002_sharp2",0,0,105,6,110907,4988,0,43,1], + ["p1",3,"op","chess_char_6_diy1_a",2,null,1154,1,153,0,13936,9232,0,61,0], + ["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acspec",1484,1,152,0,39893,11872,0,67,0], + ["p1",5,"op","chess_char_6_diy1_a",2,null,1272,1,4,5,39724,0,0,196,3], + ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acnipe",1643,1,5,4,110112,0,0,227,3], + ["p1",7,"op","chess_char_6_diy1_a",2,null,1372,1,11,4,249909,0,0,76,2], + ["p1",8,"op","chess_char_6_diy2_b",2,"uniequip_002_accast",1819,1,13,3,326032,0,0,83,3], + ["p1",9,"op","chess_char_6_diy1_a",2,null,1224,1,6,0,0,0,16400,29,2], + ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_acmedc",1464,1,14,0,0,0,0,0,0], + ["p1",11,"op","chess_char_6_diy1_a",2,null,0,0,142,0,3113,3480,0,25,0], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_002_acsupo",1450,1,151,2,23189,17850,0,97,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], + ["-","~3","device","trap_1105_accrate",null,null,100,1,3,0,0,0,0,0,null] + ], + "enemies": {"enemy_1166_dusbr_2":[39,19,20,899,217285],"enemy_1170_dushld_2":[39,4,34,10337,229211],"enemy_9011_acrefr":[39,3,34,39916,515641]}, + "hooks": [1,153,6900,1036,1036,3236,3305,48,50,138,18,29,0,25751,6274,38,117,88,1,50,0,0,0], + "events": {"atk":1484,"deploy":33,"die":50,"dmg":3209,"fx":48,"heal":43,"leak":88,"skill":31,"spawn":132,"status":800}, + "fx": {"aoe":31,"displace":9,"dodge":7,"spGain":1}, + "snaps": "dbedf148 8aaeafc9 e91fe348 7656034b 11d20308 dcb53a00 1dfb0941 7844b4e0 838cca12 2034629a 427882bf cea23c89 902f7cf1 921a0053 14816de6 43e8f115 21690d33 c819f453 69947925 0f257ccf 5b5fcef3 704e1345 b39541ea" } } }