|
@@ -232,6 +232,22 @@ export function tick(s, rift, dt) {
|
|
|
if (c.popUntil <= 0) { c.active = false; out.crisisExpire = true; }
|
|
if (c.popUntil <= 0) { c.active = false; out.crisisExpire = true; }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 文明氛围小事件:按章节播放一条叙事,并给予一点小加成(低干预的“世界仍在呼吸”)
|
|
|
|
|
+ s.ambient = s.ambient || { t: 0, idx: 0 };
|
|
|
|
|
+ s.ambient.t = (s.ambient.t || 0) - dt;
|
|
|
|
|
+ if (s.ambient.t <= 0) {
|
|
|
|
|
+ s.ambient.t = C.AMBIENT.everyMin + Math.random() * (C.AMBIENT.everyMax - C.AMBIENT.everyMin);
|
|
|
|
|
+ const chIdx = Math.max(0, Math.min(5, C.chapterOf(Math.min(C.TOTAL_LAYERS, s.layer)) - 1));
|
|
|
|
|
+ const pool = C.AMBIENT_EVENTS.slice(chIdx * 2, chIdx * 2 + 2);
|
|
|
|
|
+ const ev = pool[Math.floor(Math.random() * pool.length)] || C.AMBIENT_EVENTS[0];
|
|
|
|
|
+ if (/本源 \+/.test(ev.bonus)) s.essence += st.prodRaw * (parseFloat(ev.bonus.match(/\+(\d+)/)[1]) || 6);
|
|
|
|
|
+ else if (ev.bonus.startsWith('推进速度')) s._spdBoostUntil = now + 20;
|
|
|
|
|
+ else if (ev.bonus.startsWith('跳关')) s._skipBoostUntil = now + 30;
|
|
|
|
|
+ else if (ev.bonus.startsWith('本源产出')) s.crisis.buffUntil = Math.max(s.crisis.buffUntil || 0, now + 30);
|
|
|
|
|
+ else if (ev.bonus.startsWith('探索度')) { s.planes[s.currentPlane].explore = Math.min(C.EXPLORE_FULL, s.planes[s.currentPlane].explore + 1); syncExplore(s); }
|
|
|
|
|
+ out.events.push({ type: 'ambient', text: ev.text, bonus: ev.bonus });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 文明事件(现实位面)
|
|
// 文明事件(现实位面)
|
|
|
if (s.currentPlane === 0 && s.civ.idx < CIV_EVENTS.length) {
|
|
if (s.currentPlane === 0 && s.civ.idx < CIV_EVENTS.length) {
|
|
|
s.nextCivSec -= dt;
|
|
s.nextCivSec -= dt;
|
|
@@ -342,6 +358,7 @@ export function rebirth(s) {
|
|
|
s.crisis = { next: C.CRISIS.firstAt, active: false, buffUntil: 0, penaltyUntil: 0 };
|
|
s.crisis = { next: C.CRISIS.firstAt, active: false, buffUntil: 0, penaltyUntil: 0 };
|
|
|
s.magic = { sig: 0, sigUntil: 0 };
|
|
s.magic = { sig: 0, sigUntil: 0 };
|
|
|
s._skipAcc = 0; s._autoT = 0; s._lastFlash = undefined;
|
|
s._skipAcc = 0; s._autoT = 0; s._lastFlash = undefined;
|
|
|
|
|
+ s.ambient = { t: 0, idx: 0 }; // 文明氛围小事件计时(回溯重置)
|
|
|
s.chapterSeen = Math.min(5, C.chapterOf(Math.min(C.TOTAL_LAYERS, floor)));
|
|
s.chapterSeen = Math.min(5, C.chapterOf(Math.min(C.TOTAL_LAYERS, floor)));
|
|
|
const evt = s.rebirths === 1
|
|
const evt = s.rebirths === 1
|
|
|
? { type: 'milestone', key: 'firstRebirth', ...MILESTONES.firstRebirth }
|
|
? { type: 'milestone', key: 'firstRebirth', ...MILESTONES.firstRebirth }
|