// 《世界树 · 逃离空洞》数值配置与纯公式(无副作用,可被测试直接 import)。 // 所有常量与 GDD.md「数值表」逐节对应:修改时两边同步。 // 署名:FmodeCode export const SAVE_KEY = 'worldtree_escape_save_v1'; export const SAVE_VERSION = 1; // ── 主线:逃离室女座空洞(连续空间) ───────────────────────── // 逃逸进度 = 本轮回“抵达层数 / TOTAL_LAYERS”,连续流动;六章每 500 层一段,章内没有结算弹窗。 // 每章 500 层。这个常数同时是“能量谷”的深度标尺:GM(L) 的线性段在 L/Gm 处平滑衔接(Gm = TOTAL×(ENV_STEP−1)/(GM_END−1) ≈ 1.71×TOTAL), // 调大 TOTAL 会让回跑段变得更“浅”,因此主曲线参数要跟着一起调(见 tests/balance-sim.mjs)。 export const TOTAL_LAYERS = 2500; export const CHAPTERS = [ { idx: 0, short: '地球', title: '保护地球', desc: '空洞前沿已越过柯伊伯带,地球是最后一处有生命的声音。' }, { idx: 1, short: '太阳系', title: '脱离太阳系', desc: '把整颗星球托进世界树的根系,太阳系成为空洞中的第一枚灯塔。' }, { idx: 2, short: '猎户旋臂', title: '脱离猎户旋臂', desc: '根系铺满旋臂,星云在树冠下重新聚合为航路。' }, { idx: 3, short: '银河系', title: '脱离银河系', desc: '银河的旋涡在身后合拢,世界树第一次长到了星系之外。' }, { idx: 4, short: '本星系群', title: '脱离本星系群', desc: '本星系群的引力潮被抵消,空洞的边界第一次出现在视野里。' }, { idx: 5, short: '空洞外', title: '冲出空洞', desc: '室女座空洞之外,还有一片未被规则侵蚀的星空。' }, ]; for (const ch of CHAPTERS) ch.at = ch.idx * 500; // 每章 500 层 /** 当前层数对应的章序号(0..5) */ export function chapterOf(layer) { let c = 0; for (const ch of CHAPTERS) if (layer >= ch.at) c = ch.idx; return c; } // ── 连续推进时序 ───────────────────────────────────── // 单层基础推进时间 T(L) = 4 + 10L 秒(层中匀速),由推进速度乘区 M_spd 加速。 export const MARCH = { visitBase: 4, visitPerLayer: 10 }; export function visitTime(L) { return MARCH.visitBase + MARCH.visitPerLayer * L; } // ── 跳关(时间维度乘区) ───────────────────────────── // 触发率 p(封顶 45%):每次触发跳 k 层,P(k)/p ∝ 0.5^(k−1),k ∈ [1,4]。 // 命中时 k 的分布 P(k|命中) ∝ 0.5^(k−1)(k=1..4,权重 8:4:2:1),命中期望 E[k|命中] = 26/15 // E[k] = p × 26/15;时间乘区 = 1 + E[k];跳关后期望层耗时 = T / (1 + E[k])。 export const SKIP = { minK: 1, maxK: 4, factor: 5.7, cap: 0.45 }; // 触发率封顶 45% → 时间乘区上限 1+16×0.45/15 = 1.48 export function skipPlan(pEff) { const ps = Math.max(0, Math.min(SKIP.cap, Number(pEff) || 0)); const ks = [], probs = []; let sum = 0; for (let k = SKIP.minK; k <= SKIP.maxK; k++) sum += Math.pow(0.5, k - SKIP.minK); for (let k = SKIP.minK; k <= SKIP.maxK; k++) { ks.push(k); probs.push(ps * Math.pow(0.5, k - SKIP.minK) / sum); } return { p: ps, ks, probs }; } export function skipExpectation(pEff) { const { ks, probs } = skipPlan(pEff); // 显式循环(曾误用同名参数导致结果偏差) let e = 0; for (let i = 0; i < ks.length; i++) e += ks[i] * probs[i]; return e; } export function timeMul(pEff) { return 1 + skipExpectation(pEff); } // 地质环境(按本轮深度每 18 层轮换;floor(D/18) mod 8 取用;extra 字段对应 formulas.envFactors) export const ENVS = [ { id: 'env0', name: '气态尘埃带', color: '#8B93A7', depth: 1.3, desc: '初入空洞边缘,尘屑拖慢世界树', eff: '慢:推进速度 ×0.85' }, { id: 'env1', name: '引力乱流', color: '#6C8EBF', depth: 1.5, desc: '混乱的引力让根系难以吸收本源,但勘探更有价值', eff: '本源产出 ×0.8' }, { id: 'env2', name: '规则回廊', color: '#C77DFF', depth: 2.2, desc: '残破的规则在此排列,跳关变得容易', eff: '每 10 秒跳关触发率 +20%' }, { id: 'env3', name: '星火苗床', color: '#FFB86B', depth: 2.0, desc: '在星尘中收集火种,等待点燃', eff: '火种子:攒 10 枚,一次性本源 ×2.5', fire: true }, { id: 'env4', name: '虚空潮汐', color: '#3B475C', depth: 2.6, desc: '虚空会吞掉暂存的本源——及时花掉,或尽快回溯', eff: '持有本源每秒流失 2%(侵蚀)', drain: 0.02 }, { id: 'env5', name: '金枝回廊', color: '#E3B341', depth: 2.2, desc: '金色树汁涌出,产出暴增但推进不变', eff: '本源产出 ×1.6' }, { id: 'env6', name: '镜像残响', color: '#9FE7D2', depth: 2.8, desc: '世界树的残影在前方替你开路', eff: '每层 30% 概率额外 +1 层(跳关加速)', echo: 0.3 }, { id: 'env7', name: '熵之温室', color: '#C08BFF', depth: 3.0, desc: '高熵环境加速一切,也加速敌人的侵蚀(危机间隔 ×0.7)', eff: '本源产出 ×1.4,推进速度 ×1.1', entropy: true }, ]; // ── 本源产出(连续空间:产出 = 对已抵达层求和的“本源密度”) ────────── // 第 L 层的本源密度 β(L) = 1.05^(L−F) × P_root(R),F = 本轮起始层,R = 根须等级。 // 新一轮产出/秒 = ∫_F^L β = P_root(R) × (1.05^L − 1)/(1.05·ln1.05)(GDD §6.5 式 9;GDD 符号 B(L) 即此值)。 export const ESSENCE_GROWTH = 1.05; export function essenceDensity(L, F) { return Math.pow(ESSENCE_GROWTH, Math.max(0, L - F)); } export const PROD_BASE_DIV = 1.05 * Math.log(1.05); export const PROD_DECAY = 0.0015; // 软上限:每层指数的衰减(有效增长率 = e^(ln1.05 − PROD_DECAY·L);L=1000 时每层仅 ×1.0006) /** 产出基线:∫_0^L e^{ln1.05·x − 0.5·DECAY·x²} dx 的数值近似(软上限:32 层内指数衰减 12.8%) */ export const EARLY_BOOST = 2; // 低层起步加速:前 30 层的本源密度额外 ×2(避免“前 10 分钟几乎不动”) export function essenceBase(L, rootP) { if (L < 30) { // 低层直接解析式(软上限效果可忽略) const gl = Math.log(1.05); return rootP * EARLY_BOOST * (Math.exp(gl * L) - 1) / gl; } const g = Math.log(1.05); let acc = 0; const n = Math.max(1, Math.ceil(Math.max(0, L) / 2)); const h = Math.max(0, L) / n; for (let i = 0; i < n; i++) { const x = (i + 0.5) * h; acc += Math.exp(g * x - 0.5 * PROD_DECAY * x * x) * h; } return rootP * acc; } /** 指数增长率 π:1.05^(L−F) = e^(π(L−F));π = ln1.05 / (1 − e^(−ln1.05(L−F)))(L=F 时 = 0.4879) */ export function piOf(L, F) { const d = Math.exp(-Math.log(ESSENCE_GROWTH) * Math.max(0, (L || 0) - (F || 0))); return Math.log(ESSENCE_GROWTH) / Math.max(1e-9, 1 - Math.min(0.999, d)); } // ── 本轮升级(消耗本源)几何成本 C = base × ratio^level ─────── export const COST = { root: { base: 10, ratio: 1.4, per: 0.10, name: '根须', desc: '每级 本源产出 ×1.059、推进速度 ×1.10(价格 ×1.4/级)' }, canopy: { base: 40, ratio: 2.2, per: 0.005, name: '树冠', desc: '每级 跳关触发率 +0.5%(封顶 60%);每级额外推进速度 ×1.08' }, }; export const UPGRADE_KINDS = ['root', 'canopy']; export const PURCHASE_CAP = 4; // 单次批量购买上限(每次点击最多升 4 级) export const ROOT_EXP = 0.6; // 根须产出层段压缩指数 export const KAPPA = 3; // 本轮价格系数 κ:价格 ×(κ·(π − π₀))(GDD §6.5 式 3/4,与本源产出指数 π 挂钩) export const ETA = 10; // 等待系数:只有 价格 ≤ ETA × 当前产出/秒 的项才会被购买(GDD §7.2) export const LIFE_ETA = 10; // 兵种同用 ETA(保留独立常量便于单独调参) /** 本轮价格系数 κ(π):π 越接近 1(低层指数极高),价格越极端,避免“低层扫货” * 价格乘区 = e^{κ·max(0, π − π_ref)},π_ref = 0.15 */ export const KEXP = 6; export const PI_REF = 0.15; export const PI_CLAMP = 0.6; // 低层(π 极高)时的价格钳制:最多 ×e^(κ·(0.6−π_ref)) ≈ ×15 export function piPrice(pi) { return Math.pow(PI_BASE, Math.max(0, Math.min(PI_CLAMP, (pi || 0)) - PI_REF)); } export const PI_BASE = 2; // 钳制后每高出 π_ref 0.1,价格 ×2^(0.1·κ/ln2)…(见 GDD §5.6.1) /** 本轮升级的真实价格 = 基础几何成本 × Π(π):π 越大(产出指数越高),价格越贵,从而抵消 R2 */ export function piCostMul(pi) { return piPrice(pi); } export function costOf(kind, level) { const c = COST[kind]; return c.base * Math.pow(c.ratio, level); } export function batchCost(kind, level, n) { const c = COST[kind]; return Math.ceil(c.base * Math.pow(c.ratio, level) * (Math.pow(c.ratio, n) - 1) / (c.ratio - 1)); } export function maxAffordable(kind, level, essence) { const c = COST[kind]; const first = c.base * Math.pow(c.ratio, level); if (!(essence >= first)) return 0; const n = Math.floor(Math.log(essence * (c.ratio - 1) / first + 1) / Math.log(c.ratio)); return Math.min(PURCHASE_CAP, Math.max(0, n)); } export function rootProdMul(level) { return Math.pow(Math.pow(1 + COST.root.per, level || 0), ROOT_EXP); } export function rootSpeedMul(level) { return Math.pow(1 + COST.root.per, level || 0); } export function canopySkip(level) { return Math.min(SKIP.cap, COST.canopy.per * (level || 0)); } /** 树冠的速度乘区(跳关是时间乘区;速度部分单独给,保证跳关封顶后仍有成长) */ export function canopySpeedMul(level) { return Math.pow(1.08, level || 0); } // 永久乘区(除世界树/遗物外的简单加乘) export function multCreature(totalLevel) { return Math.max(1e-6, 1 + 0.08 * Math.max(0, (totalLevel || 0) - 30)); } export function multRelic(count) { return Math.pow(1.25, count || 0); } export function multRebirth(count) { return Math.max(1e-6, 1 + 0.10 * (count || 0)); } export function multExploration(explore) { return Math.max(1e-6, 1 + 2 * Math.max(0, explore || 0) / 100); } // ── 兵种(常驻推进跑道,持续生效) ────────────────────────── // 等级 n:升级成本 cost × 1.15^(n−1);技能强度 = 1 + per × n。解锁:上一兵种 ≥3 级。 export const LIVES = [ { id: 'sprout', race: '生命', name: '萌芽苔', cost: 25, eff: { kind: 'prod', per: 0.05 }, skill: '根系扎入跑道,本源产出 +5%/级', icon: 'sprout' }, { id: 'firefly', race: '生命', name: '萤火虫', cost: 120, eff: { kind: 'speed', per: 0.04 }, skill: '沿根系迁徙,推进速度 +4%/级', icon: 'firefly' }, { id: 'rootwalker', race: '生命', name: '根行者', cost: 900, eff: { kind: 'skip', per: 0.008 }, skill: '在层间挖掘捷径,跳关 +0.8%/级', icon: 'root' }, { id: 'arbor', race: '星穹', name: '星穹古树', cost: 3e3, eff: { kind: 'prod', per: 0.10 }, skill: '庇护之树,本源产出 +10%/级', icon: 'tree' }, { id: 'cometmoth', race: '星穹', name: '彗星蛾', cost: 1.2e4, eff: { kind: 'speed', per: 0.06 }, skill: '驮着树冠跨越星云,推进速度 +6%/级', icon: 'moth' }, { id: 'constsign', race: '星穹', name: '星座使', cost: 8e4, eff: { kind: 'crystal', per: 0.05 }, skill: '记录星象:炼化收益 +5%、跳关加成 +1%/级', icon: 'sign' }, { id: 'voideye', race: '虚空', name: '虚空之眼', cost: 5e5, eff: { kind: 'skip', per: 0.015 }, skill: '看穿壁垒,跳关 +1.5%/级', icon: 'eye' }, { id: 'entropymaw', race: '虚空', name: '熵噬之喉', cost: 4e6, eff: { kind: 'prod', per: 0.20 }, skill: '吞吐侵蚀的本源,产出 +20%/级', icon: 'maw' }, { id: 'lightstrider', race: '虚空', name: '光行者', cost: 3e7, eff: { kind: 'awake', per: 0.15 }, skill: '以光速掠过每一层,推进速度 +15%/级(长期成长)', icon: 'strider' }, ]; export const PI0 = Math.log(1.05) / (1 - Math.exp(-Math.log(1.05) * 10)); // π₀(=0.114):本轮前 10 层的参考指数 export const LIFE_RATIO = 1.10; /** 兵种基础成本(永久基线):25 × 3^(序号) */ export function lifeBase(idx) { return 25 * Math.pow(3, idx || 0); } export function lifeCostOf(baseCost, n, pi) { return baseCost * Math.pow(LIFE_RATIO, n - 1) * Math.max(1, KAPPA * Math.max(0, (pi || 0) - PI0)); } /** 兵种第 n 级的收益/成本比(产出类、速度类各自按 1.0/0.5 权重,跳关另算) */ export function lifeEff(life, level) { const k = life.eff.kind === 'prod' ? 1.0 : life.eff.kind === 'speed' ? 0.5 : life.eff.kind === 'crystal' ? 1.0 : 0.6; return (life.eff.per * k) / lifeCostOf(life.cost, level + 1); } export const RACES = { 生命: { color: '#5FD68A', need: 2, bond: '共生:同种族达到 2 个兵种,本源产出 ×1.3(每多 1 个 ×1.3)' }, 星穹: { color: '#7FB2FF', need: 2, bond: '观星:同种族达到 2 个兵种,炼化收益 ×1.3(每多 1 个 ×1.3)' }, 虚空: { color: '#C08BFF', need: 2, bond: '凝视:同种族达到 2 个兵种,跳关触发率 +5%(每人 +5%,最多 +10%)' }, }; export const RACE_BOND_STEP = 2; export const RACE_BOND_MULT = 1.3; export const RACE_SKIP_BONUS = 0.05; export function raceStacks(race, count) { return Math.max(0, count - (RACES[race].need - 1)); } // ── 永久乘区(时间结晶,跨轮回) ─────────────────────────── // 世界树等级 D:成本 30 × 1.9^D;每级 本源产出 ×1.05、推进速度 ×1.08(几何乘区) // 世界树等级 D:成本 30×1.9^D × max(1, κ(π−π₀))^0.5(与本源产出指数挂钩的“规则税”);每级 产出 ×1.05、速度 ×1.08 export const TREE = { costBase: 30, costRatio: 1.9, prodPer: 0.05, speedPer: 0.08 }; export function treeCostPI(level, pi) { return Math.ceil(treeCost(level) * Math.sqrt(Math.max(1, KAPPA * Math.max(0, (pi || 0) - PI0)))); } export function treeCost(level) { return Math.ceil(TREE.costBase * Math.pow(TREE.costRatio, level || 0)); } export function treeProdMul(level) { return Math.pow(1 + TREE.prodPer, level || 0); } export function treeSpeedMul(level) { return Math.pow(1 + TREE.speedPer, level || 0); } /** 世界树下一级的产出/成本收益比 */ export function treeEff(level) { return TREE.prodPer / (1 + TREE.prodPer * level) / treeCost(level); } // 遗物(8 件):成本 50 × 2.6^i,每件 本源产出 ×1.25 export const PERM = { relicBase: 50, relicRatio: 2.6, relicPer: 0.25, relicCount: 8 }; export function relicCost(idx) { return Math.ceil(PERM.relicBase * Math.pow(PERM.relicRatio, idx)); } export function relicEff(idx) { return Math.log(1 + PERM.relicPer) / relicCost(idx); } export function relicMul(count) { return Math.pow(1 + PERM.relicPer, count || 0); } // 自由轮回(首次逃逸后永久解锁):每完成一次完整的 1000 层轮回,自由轮回加成 +10% export const FREEDOM = { per: 0.1 }; export function freedomMul(state) { return Math.max(1e-6, 1 + FREEDOM.per * (state.freeCycles || 0)); } /** 残响(被动):炼化乘区 ×(1+0.02×已回溯次数) */ export function resonanceMul(state) { return Math.max(1e-6, 1 + 0.02 * (state.rebirths || 0)); } export const RELICS = [ { id: 'seed', name: '初生之种', desc: '本源产出 ×1.25', icon: 'seed' }, { id: 'star', name: '坠星残片', desc: '本源产出 ×1.25', icon: 'star' }, { id: 'gear', name: '古齿轮', desc: '本源产出 ×1.25', icon: 'gear' }, { id: 'rune', name: '符文页', desc: '本源产出 ×1.25', icon: 'rune' }, { id: 'hour', name: '沙漏', desc: '本源产出 ×1.25', icon: 'hourglass' }, { id: 'leaf', name: '金叶', desc: '本源产出 ×1.25', icon: 'leaf' }, { id: 'orbit', name: '环轨道', desc: '本源产出 ×1.25', icon: 'orbit' }, { id: 'void', name: '空洞切片', desc: '本源产出 ×1.25', icon: 'void' }, ]; // ── 转生(时间回溯) ───────────────────────────────────── // 单次收益 R = ⌊0.5 × T^1.6 × E × M × ruleMod⌋(保底 1,T = 本轮最深;指数 1.6 > 回溯的 1.0,深度的收益超线性) // E 计入见闻;同一轮回内重复回溯收益 ×0.5^n。 // E = 1 + 所有位面探索度之和/100(见闻) // M = 炼化乘区 = 兵种炼化技能 × 星穹羁绊 × 探索阶梯 × 跳关加成(1+min(0.3,0.5p)) × 见闻 × 自由轮回 × 残响 // 本轮回溯成本 C(T) = 1 + (T/40)²;效率 = R/C。同一轮回内再次炼化收益 ×0.5^n。 export const REBIRTH = { k: 0.5, power: 1.6, exploreDiv: 100, min: 1, costDiv: 40, decay: 0.5, skipNoteCap: 0.3 }; export function rebirthCost(T) { return 1 + Math.pow(Math.max(0, T) / REBIRTH.costDiv, 2); } export function rebirthReward({ maxLayer = 0, exploreSum = 0, incomeMul = 1, ruleMod = 1 }) { const T = Math.max(0, maxLayer); const E = 1 + exploreSum / REBIRTH.exploreDiv; return Math.max(REBIRTH.min, Math.floor(REBIRTH.k * Math.pow(T, REBIRTH.power) * E * incomeMul * ruleMod)); } // 回溯起始层:F = ⌊L − 16√L⌋(向下对齐 2 的倍数,且不超过 L/2)+ 位面起始加成(修仙 +100) export const RETURN_K = 16; // 回冲深度系数:L=1000 → F≈936(16√1000≈506 → 偶层对齐 936) /** 终局后(自由轮回)的起点:TOTAL − 16√TOTAL */ export function earlyAfterEscape(rule, depth) { const d = Math.max(0, depth || TOTAL_LAYERS); return Math.min(d, Math.floor((d - RETURN_K * Math.sqrt(d)) / 2) * 2) + ((rule && rule.startBonus) || 0); } export function earlyLayer(maxLayerRound, rule, alreadyEscaped) { // 终局后的自由轮回:从终点往回“回填”(F = 本轮最深 − 16√本轮最深),不再从 0 起飞 if (alreadyEscaped) return earlyAfterEscape(rule, TOTAL_LAYERS); // 回冲段:F = ⌊L − 16√L⌋(L = 本轮最深,偶层对齐,且不超过 0.75L);浅层回合的前半段不必重走 const L = Math.max(0, maxLayerRound); const back = Math.floor((L - RETURN_K * Math.sqrt(Math.max(0, L))) / 2) * 2; // 回填后的层数(可能为负) return Math.min(Math.max(0, back), Math.floor(L * 0.75) * 2) + ((rule && rule.startBonus) || 0); } // ── 危机:侵蚀前沿 ───────────────────────────────────── export const CRISIS = { firstAt: 90, interval: 180, countdown: 120, // 首次 90 秒,此后每 180 秒一次;响应窗口 120 秒 penalty: 0.5, penaltySec: 60, reward: 0.3, rewardSec: 90, braceSec: 45, bracePer: 0.5, relaxSkip: 5, holdLayers: 5, expireLayers: 3, relieveCost: 0.25, }; // ── 位面(4 阶,规则松绑梯度) ───────────────────────────── export const PLANES = [ { id: 0, key: 'real', img: 'assets/realm-reality.png', tier: '一阶', name: '现实位面', metric: '文明等级', essence: '认知本源', color: '#5FA8D3', accent: '#9BD1F5', lore: '一切规则最严密的地方。这里没有魔法,只有因果、工程与不肯放弃的人。', rule: '坚固因果:全参数基准 ×1.00', bonus: '文明演进:文明事件链驱动主线' }, { id: 1, key: 'tech', img: 'assets/realm-tech.png', tier: '二阶', name: '科技位面', metric: '自动化覆盖率', essence: '信息本源', color: '#6C5CE7', accent: '#B7A8FF', lore: '无人值守的城市里,机器替人类继续演算。自动化是这个世界唯一的信仰。', rule: '自动化闭环:每秒为已解锁兵种免费 +1 级(上限 5 级)', bonus: '时间压缩:推进速度 ×1.25;锚定采集 ×1.25' }, { id: 2, key: 'magic', img: 'assets/realm-magic.png', tier: '三阶', name: '魔幻位面', metric: '魔力浓度', essence: '精神本源', color: '#C77DFF', accent: '#F0B2FF', lore: '故事在这里是真实的燃料。只要还有人在讲述,世界就不会熄灭。', rule: '叙事即魔法:每次跳关本源产出 ×1.3,持续 12 秒(叠乘,最多 10 层)', bonus: '故事共鸣:跳关触发率 +10%' }, { id: 3, key: 'xiuxian', img: 'assets/realm-xiuxian.png', tier: '四阶', name: '修仙位面', metric: '灵气浓度', essence: '道之本源', color: '#2DD4BF', accent: '#FFD27A', lore: '大道无情,天道有功。修士以百年为一步,而你有世界树。', rule: '大道预算:转生结晶 ×1.5', bonus: '道基:转生返还本轮 50% 本源、起始层 +100、兵种保留 ×2' }, ]; export const PLANE_RULES = [ { prodMult: 1.0, speedMult: 1.0, autoLives: false, narrateBoost: 0, skipMult: 1.0, rebirthMod: 1.0, rebirthKeep: 0, startBonus: 0, costMult: 1.0 }, { prodMult: 1.0, speedMult: 1.25, autoLives: true, narrateBoost: 0, skipMult: 1.0, rebirthMod: 1.0, rebirthKeep: 0, startBonus: 0, costMult: 1.0, autoCap: 5 }, { prodMult: 1.0, speedMult: 1.0, autoLives: false, narrateBoost: 1.3, skipMult: 1.1, rebirthMod: 1.0, rebirthKeep: 0, startBonus: 0, costMult: 1.0 }, { prodMult: 1.0, speedMult: 1.0, autoLives: false, narrateBoost: 0, skipMult: 1.0, rebirthMod: 1.5, rebirthKeep: 0.5, startBonus: 100, costMult: 1.0 }, ]; export const PLANE_REBIRTH_MOD = PLANE_RULES.map((r) => r.rebirthMod); export const NARRATE_STACK_CAP = 10; export const NARRATE_SEC = 12; // 解锁:现实位面锚定 → 二阶;二阶锚定 → 三阶;三阶锚定 → 四阶 export const PLANE_UNLOCK_AT = [{ plane: 1, from: 0 }, { plane: 2, from: 1 }, { plane: 3, from: 2 }]; export const EXPLORE_FULL = 100; export const EXPLORE_TIERS = [ { at: 20, prod: 0.25, crystal: 1.0, label: '本源产出 +25%' }, { at: 50, prod: 0.60, crystal: 1.0, label: '本源产出 +60%' }, { at: 80, prod: 1.00, crystal: 1.15, label: '本源产出 +100%,炼化收益 +15%' }, { at: 100, prod: 1.50, crystal: 1.30, label: '本源产出 +150%,炼化 +30%,位面锚定:后台自动采集', anchor: true }, ]; export function exploreTierOf(explore) { let t = { at: 0, prod: 0, crystal: 1, label: '未勘探' }; for (const x of EXPLORE_TIERS) if (explore >= x.at) t = x; return t; } export function planeUnlocked(state, p) { if (p === 0) return true; const rule = PLANE_UNLOCK_AT.find((u) => u.plane === p); return !!rule && (state.planes?.[rule.from]?.explore || 0) >= EXPLORE_FULL; } // ── 里世界肉鸽 ──────────────────────────────────────── export const LIFE_ECHO_CAP = 40; // 溯时回响:兵种等级先封顶 40,再按 20% 保留 export const RIFT = { cooldownSec: 20, energy: 12 }; export const RIFT_ENVS = [ { name: '灰烬回廊', desc: '灾变后的城市废墟,路灯仍在为不存在的人亮着。', color: '#5FA8D3' }, { name: '演算之海', desc: '无人的服务器阵列深处,数据像潮水一样涨落。', color: '#6C5CE7' }, { name: '镜灰王庭', desc: '碎镜拼成的王座,每个倒影都在讲述不同的故事。', color: '#C77DFF' }, { name: '九霄残山', desc: '漂浮的山峰残片,灵气稀薄如将灭的烛火。', color: '#2DD4BF' }, ]; export const RULE_IDS = ['knowledge', 'oath', 'belief', 'judge']; export const RULE_NAMES = { knowledge: '知识', oath: '誓约', belief: '信念', judge: '裁决' }; export const RULE_COLORS = { knowledge: '#5FA8D3', oath: '#7FB2FF', belief: '#5FD68A', judge: '#F0C060' }; // 探索度增量:通关 ⌊6 + 分/50⌋、失败 ⌊6 + 分/100⌋(失败也有价值,且随分数变好) // 探索度按阶缩放:阶越高,同样一局带回的探索越多(高阶位面难,但回报值得) export function riftExploreDelta(steps, score, cleared, plane = 0) { const sc = Math.max(0, score); const base = cleared ? 6 + sc / 50 : 6 + sc / 100; return Math.floor(base * (1 + 0.35 * plane)); } // ── 挂机支线(锚定位面后台采集) ───────────────────────── export const ANCHOR_COLLECT_SEC = 60; export const ANCHOR_RATE = 0.02; // ── 离线 / 事件节奏 ────────────────────────────────── export const OFFLINE = { capSec: 8 * 3600, eff: 0.6 }; export const EVENT = { lifeKeep: 0.2, // 溯时回响:转生后兵种等级保留 20%(上限 LIFE_ECHO_CAP;修仙 ×2) civSec: 75, autoRebirthDefault: 120, // 禅定默认每 120 秒回溯一次(但只在离最优回溯点足够近时执行) }; // ── 文明氛围小事件(轻量被动事件:每 36~54 秒按当前章节播放一条叙事并给一点小 bonus) ── export const AMBIENT_EVENTS = [ { text: '无线电里传来断断续续的童谣,根须跟着节奏轻轻摇摆。', bonus: '本源 +6 秒产出' }, { text: '旧城区的路灯依次点亮,像一条向北的航标。', bonus: '推进速度 ×1.2(20 秒)' }, { text: '有人在树根下种了一株野花。它开出了不属于地球的颜色。', bonus: '探索度 +1(当前位面)' }, { text: '一台无人探测器传回最后一张星图:空洞的边缘比想象中更近。', bonus: '本源 +8 秒产出' }, { text: '孩子们用粉笔在地上画出世界树的根,一直画出了城市。', bonus: '跳关触发率 +10%(30 秒)' }, { text: '图书馆里最厚的书被翻开在第一页:一切都从一颗种子开始。', bonus: '本源产出 ×1.25(30 秒)' }, { text: '月面上亮起一排灯,像是在向地球招手。', bonus: '推进速度 ×1.3(20 秒)' }, { text: '一艘运输舰从旋臂边缘归来,货舱里装满了陌生的星尘。', bonus: '本源 +12 秒产出' }, { text: '星系中心的黑洞喷流改变了方向,像一支指向空洞之外的箭头。', bonus: '跳关触发率 +10%(30 秒)' }, { text: '本星系群的邻居发来了同样的回声:我们也在逃。', bonus: '本源产出 ×1.3(30 秒)' }, ]; export const AMBIENT = { everyMin: 36, everyMax: 54 };