|
|
@@ -8,8 +8,9 @@ import * as R from '/opt/data/git-repos/worldtree-escape/js/rift.js';
|
|
|
if (process.argv[1] && process.argv[1].endsWith('balance-sim.mjs')) {
|
|
|
const H = +(process.argv[2] || 6);
|
|
|
const CAP = +(process.argv[3] || 0);
|
|
|
+ let capHits = 0, lastCapT = -1e9;
|
|
|
let seed = 7; Math.random = () => { seed = (seed * 16807) % 2147483647; return seed / 2147483647; };
|
|
|
- const s = S.newState(); s.autoOn = true;
|
|
|
+ const s = S.newState(); s.autoOn = true; s.autoEvery = 60;
|
|
|
const dt = 0.2; let upgT = 0; const marks = []; let lastRift = -1e9;
|
|
|
for (let t = 0; t < H * 3600; t += dt) {
|
|
|
const o = S.tick(s, { run: s.planeRun }, dt);
|
|
|
@@ -26,8 +27,8 @@ if (process.argv[1] && process.argv[1].endsWith('balance-sim.mjs')) {
|
|
|
}
|
|
|
const bp = F.bestPerm(s); if (bp && bp.cost <= s.crystals) { if (bp.kind === 'stem') S.buyTree(s); else S.buyRelic(s); }
|
|
|
}
|
|
|
- if (CAP && s.layer >= CAP && !s.escaped) S.rebirth(s); // 模拟“卡层即回溯”的保守玩家
|
|
|
- if (s.escaped) { S.rebirth(s); marks.push(`★ 逃逸完成 t=${(t / 60) | 0}m 第 ${s.escapeCount} 次`); }
|
|
|
+ if (CAP && s.layer >= CAP && !s.escaped && t - lastCapT > 30) { lastCapT = t; capHits++; if (capHits % 50 === 1) marks.push(` · 卡 ${CAP} 层 → 回溯 #${s.rebirths} t=${(t / 60) | 0}m +${F.rebirthEstimate(s)} 树D${s.treeLv}`); S.rebirth(s); capHits = 0; continue; }
|
|
|
+ if (s.escaped) { S.rebirth(s); marks.push(`★ 逃逸完成 t=${(t / 60) | 0}m 第 ${s.escapeCount} 次(轮回 ${s.rebirths},树 D${s.treeLv})`); }
|
|
|
if (t > 300 && t - lastRift > 480 && !s.planeRun) {
|
|
|
lastRift = t;
|
|
|
for (let q = 3; q >= 0; q--) if (C.planeUnlocked(s, q)) { S.switchPlane(s, q); break; }
|