|
|
@@ -4,6 +4,25 @@ import * as C from './config.js';
|
|
|
|
|
|
const nowSec = () => Date.now() / 1000;
|
|
|
|
|
|
+/** 当前所在的“地质环境”(按本轮深度 D 分段,每 18 层一换;循环取用) */
|
|
|
+export function envOf(layer, start) {
|
|
|
+ const D = Math.max(0, (layer || 0) - (start || 0));
|
|
|
+ return C.ENVS[Math.floor(D / 18) % C.ENVS.length];
|
|
|
+}
|
|
|
+/** 环境对产出 / 速度 / 跳关的影响 */
|
|
|
+export function envFactors(at) {
|
|
|
+ const id = at && at.id;
|
|
|
+ return {
|
|
|
+ prod: id === 'env1' ? 0.8 : id === 'env5' ? 1.6 : id === 'env7' ? 1.4 : 1,
|
|
|
+ speed: id === 'env0' ? 0.85 : id === 'env7' ? 1.1 : 1,
|
|
|
+ skipBonus: id === 'env2' ? 0.2 : 0,
|
|
|
+ echo: id === 'env6' ? 0.3 : 0,
|
|
|
+ drain: id === 'env4' ? 0.02 : 0,
|
|
|
+ fire: id === 'env3',
|
|
|
+ entropy: id === 'env7',
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
/** 本轮起始层 F */
|
|
|
export function F0(state) { return C.earlyLayer(state.maxLayerRound || 0, C.PLANE_RULES[state.currentPlane || 0]); }
|
|
|
|
|
|
@@ -108,13 +127,16 @@ export function computeStats(state) {
|
|
|
const rootP = C.rootProdMul(state.upgrades?.root || 0);
|
|
|
const base = C.essenceBase(L, rootP);
|
|
|
// 兜底:从“零层起步”(新存档 / 离线后回到初始轮回)时,至少给 本源产出 1/秒,避免 F=L 导致产出恒为 0
|
|
|
- const prodRaw = (L - start < 1e-9 && L < 1) ? 1 : base * Mprod;
|
|
|
+ const env = envOf(L, start);
|
|
|
+ const ef = envFactors(env);
|
|
|
+ const prodRaw = (L - start < 1e-9 && L < 1) ? 1 : base * Mprod * ef.prod * ((state._fireBoost || 0) > now ? 2.5 : 1);
|
|
|
|
|
|
const gm = marchBase(L, start);
|
|
|
const Mspd = speedMulOf(state) * (crisisPenalty ? 1 - C.CRISIS.penalty : 1);
|
|
|
- const layerSec = C.visitTime(L) * gm / Mspd;
|
|
|
- const layersPerSec = Mspd / (C.visitTime(L) * gm);
|
|
|
- const skipP = skipProbOf(state, sk);
|
|
|
+ const MspdEnv = Mspd * ef.speed;
|
|
|
+ const layerSec = C.visitTime(L) * gm / MspdEnv;
|
|
|
+ const layersPerSec = MspdEnv / (C.visitTime(L) * gm);
|
|
|
+ const skipP = Math.min(C.SKIP.cap - 1e-6, skipProbOf(state, sk) + ef.skipBonus + ((state._skipBoostUntil || 0) > now ? 0.2 : 0));
|
|
|
const skipExp = C.skipExpectation(skipP);
|
|
|
const timeMul = 1 + skipExp;
|
|
|
const rebirthM = rebirthMOf(state, sk);
|
|
|
@@ -123,7 +145,7 @@ export function computeStats(state) {
|
|
|
plane: p, rule, start, base, rootP, prodMul: Mprod, mults, frozen,
|
|
|
prodRaw, prod: frozen ? 0 : prodRaw,
|
|
|
creatureLv: sk.total, skills: sk, tier, explore,
|
|
|
- gm, speedMul: Mspd, layerSec, layersPerSec, minutesPerLayer: (layerSec * timeMul) / 60,
|
|
|
+ env, envFactors: ef, gm, speedMul: MspdEnv, layerSec, layersPerSec, minutesPerLayer: (layerSec * timeMul) / 60,
|
|
|
skipP, skipExp, timeMul,
|
|
|
rebirthM, reward, rebirthCost: C.rebirthCost(state.maxLayerRound || 0),
|
|
|
crisisBuff, crisisPenalty, crisisMult, narrate, narrSig, anchored: explore >= C.EXPLORE_FULL,
|