标题
增加 1 行删除 1 行
1oj运维模拟器(资源可以一次性转化)1oj运维模拟器(修改版)
正文
增加 343 行删除 231 行
1234567821 行未改动30313233343536373821 行未改动60616263646566676810 行未改动79808182838485868788899091929394959697989910010110210310410510610710810911011111211333 行未改动1471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781799 行未改动1891901911921931941951961971981992002012022032042052062072082092106 行未改动2172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532544 行未改动25926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633710 行未改动34834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738819 行未改动40840941041141241341441541617 行未改动43443543643743843944044144244314 行未改动4584594604614624634644654662 行未改动4694704714724734744754764774784794804814824834844854864874884894904914924934944954966 行未改动5035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525538 行未改动56256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564627 行未改动6746756766776786796806816826836846853 行未改动6896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537546 行未改动7617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218226 行未改动8298308318328338348358368378388398408418428438448458468478488498508518528538548558568578583 行未改动8628638648658668678688698708718728738748758768778783 行未改动8828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042```<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">21 行未改动}::-webkit-scrollbar { width: 8px; }::-webkit-scrollbar-track { background: var(--bg-color); }::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }#sidebar {width: 350px;background-color: var(--panel-bg);padding: 20px;21 行未改动}.stat-row { display: flex; justify-content: space-between; margin-bottom: 4px; align-items: center; }.stat-val { font-weight: bold; color: #4fc3f7; font-family: monospace; font-size: 1.1em; }.sub-text { font-size: 0.8em; color: #888; }.forecast-row { display: flex; justify-content: space-between; font-size: 0.85em; color: #aaa; border-bottom: 1px dashed #333; padding: 2px 0; }.forecast-val { font-family: monospace; }.income { color: #69f0ae; }.expense { color: #ff5252; }10 行未改动font-size: 0.9em;}button:hover { background-color: var(--text); transform: translateY(-1px); }button:disabled { background-color: #333; cursor: not-allowed; opacity: 0.6; transform: none; }.btn-group { display: flex; align-items: center; margin-bottom: 6px; }.btn-group label { width: 80px; font-size: 0.9em; color: #ccc; }.btn-small { padding: 4px 8px; font-size: 0.8em; background-color: #444; }.tabs { display: flex; border-bottom: 2px solid #333; margin-bottom: 15px; }.tab {padding: 10px 20px;cursor: pointer;background: rgba(0,0,0,0.2);border-radius: 8px 8px 0 0;margin-right: 4px;}.tab.active { background: var(--text); color: white; font-weight: bold; }.panel { display: none; animation: fadeIn 0.3s; }.panel.active { display: block; }@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }.action-card {background: var(--panel-bg);border: 1px solid var(--border);padding: 15px;margin-bottom: 15px;border-radius: 8px;}#log-area {height: 200px;background: #111;font-family: 'Consolas', monospace;33 行未改动margin-bottom: 10px;border-radius: 8px;}#next-month-btn:hover { background-color: #43a047; }.progress-container { width: 100%; background-color: #333; height: 6px; border-radius: 3px; margin-top: 8px; overflow: hidden; }.progress-bar { height: 100%; background-color: var(--success); width: 0%; transition: width 0.5s ease-out; }.edu-card {background: #222;padding: 12px;margin-bottom: 10px;border-radius: 6px;border-left: 4px solid var(--text);}.edu-header { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 8px; }.edu-cost { font-size: 0.85em; color: #aaa; margin-bottom: 8px; line-height: 1.4; }.edu-actions { display: flex; gap: 8px; }.btn-run { background-color: #2e7d32; flex: 1; }.btn-up { background-color: #1565c0; flex: 1; }/* 新增:资源转化按钮组样式优化 */.convert-btn-group {display: flex;align-items: center;margin: 4px 0;}.convert-btn-group button {margin-right: 6px;}.btn-all {background-color: #2e7d32;font-size: 0.8em;9 行未改动<div style="font-size:0.8em; opacity:0.7;">目标: 存活至 2026-01</div></div><div class="stat-box"><div class="stat-row"><span>📅 日期</span> <span id="disp-date" class="stat-val">2013-01</span></div><div class="stat-row"><span>💰 资金</span> <span id="disp-money" class="stat-val">2000</span></div><div class="stat-row"><span>⭐ 声誉</span> <span id="disp-rep" class="stat-val">0.000</span></div><div class="progress-container"><div id="rep-bar" class="progress-bar" style="width: 50%;"></div></div></div><!-- 故障监控 --><div class="stat-box" style="border: 1px solid #555;"><div class="stat-row"><span>⚠️ 连续故障月数</span> <span id="disp-fail-months" style="color:#aaa; font-weight:bold">0 / 6</span></div><div style="font-size:0.75em; color:#888;">若连续6个月硬盘满或服务器/评测机过载,游戏强制结束。</div></div><!-- 预测模块 --><h3>🔮 下月预测</h3><div class="stat-box"><div class="forecast-row"><span>预计收入(低保+API)</span> <span id="fc-income" class="forecast-val income">+0</span></div><div class="forecast-row"><span>预计工资支出</span> <span id="fc-salary" class="forecast-val expense">-0</span></div><div class="forecast-row"><span>预计维护支出</span> <span id="fc-maint" class="forecast-val expense">-0</span></div>6 行未改动社区需求: <span id="fc-comm-cost">0</span>/月</div></div><h3>⚡ 资源池</h3><div class="stat-box"><div class="stat-row"><span>行动力 (AP)</span> <span id="disp-ap" class="stat-val" style="color: #ffca28;">100</span></div><div class="stat-row"><span>研发点</span> <span id="disp-rd" class="stat-val">0</span></div><div class="stat-row"><span>学术点</span> <span id="disp-acad" class="stat-val">0</span></div><div class="stat-row"><span>社区点</span> <span id="disp-comm" class="stat-val">0</span></div></div><h3>📊 运营数据</h3><div class="stat-box"><div class="stat-row"><span>总用户</span> <span id="disp-users-total" class="stat-val">50</span></div><div class="stat-row"><span class="sub-text">上月新增提交</span> <span id="disp-last-subs" style="color:#fff">0</span></div><div class="stat-row"><span class="sub-text">上月新增题解</span> <span id="disp-last-sols" style="color:#fff">0</span></div><hr style="border-color:#444; margin: 8px 0;"><div class="stat-row"><span>题库 (高/中/低)</span> <span><span id="disp-prob-high">0</span>/<span id="disp-prob-mid">0</span>/<span id="disp-prob-low">0</span></span></div><div class="stat-row"><span class="sub-text">硬盘占用</span> <span id="disp-disk">0 GB</span></div></div><h3>🖥️ 服务器</h3><div class="stat-box"><div class="stat-row"><span>Web核心</span> <span><span id="disp-server-core" class="stat-val">2</span> 核 (Lv.<span id="disp-server-arch">1</span>)</span></div><div class="stat-row"><span>评测核心</span> <span><span id="disp-judge-core" class="stat-val">1</span> 核 (Lv.<span id="disp-judge-arch">1</span>)</span></div><div class="stat-row" style="justify-content: flex-end; font-size: 0.8em; color: #888;">Web负载: <span id="disp-server-load">0</span> / <span id="disp-server-cap">0</span></div><div class="stat-row" style="justify-content: flex-end; font-size: 0.8em; color: #888;">评测负载: <span id="disp-judge-load">0</span> / <span id="disp-judge-cap">0</span></div></div></div><div id="main"><div id="warning-banner">⚠️ 警告:预计下个月将破产!请立即筹集资金!</div><button id="next-month-btn" onclick="game.nextMonth()">进入下个月</button><div class="tabs"><div class="tab active" onclick="ui.switchTab('ops')">日常运营</div>4 行未改动<!-- Operations Tab --><div id="tab-ops" class="panel active"><div class="action-card"><h3>📢 资源转化 (每次 10 行动力)</h3><!-- 改造资源转化按钮区域 --><div class="convert-btn-group"><button onclick="game.convertAP('rd')">转研发 (+10)</button><button onclick="game.convertAPAll('rd')" class="btn-all">研发(剩余全部)</button></div><div class="convert-btn-group"><button onclick="game.convertAP('acad')">转学术 (+10)</button><button onclick="game.convertAPAll('acad')" class="btn-all">学术(剩余全部)</button></div><div class="convert-btn-group"><button onclick="game.convertAP('comm')">转社区 (+10)</button><button onclick="game.convertAPAll('comm')" class="btn-all">社区(剩余全部)</button></div><button onclick="game.fundraising()" style="float:right; background:#5d4037">号召募捐 (50 行动力, 降声誉)</button><div style="clear:both; margin-top:5px; font-size:0.8em; color:#aaa;">募捐获得金钱数: 用户数 × (声誉+1) × 5</div></div><div class="action-card"><h3>🏆 赛事运营</h3><div class="card-desc">举办比赛可提升下月用户增长速度。</div><button onclick="game.organizeContest('old')">原题赛 (需要$500, 学术40)<br><span style="font-size:0.8em">普通题目+4, 增长x1.05</span></button><button onclick="game.organizeContest('water')">水赛 (需要$1000, 学术40)<br><span style="font-size:0.8em">低质题目+6, 增长x1.15</span></button><button onclick="game.organizeContest('normal')">普通赛 (需要$3000, 学术80)<br><span style="font-size:0.8em">普通题目+4, 增长x1.1</span></button><button onclick="game.organizeContest('grand')">优秀赛 (需要$8000, 学术200)<br><span style="font-size:0.8em">高质题目+3, 增长x1.1, 升声誉</span></button></div><div class="action-card"><h3>📝 题库扩充</h3><div class="card-desc" style="font-size:0.85em; color:#aaa; margin-bottom:5px;">搬运普通/低质试题可吸引 10~50 名新用户。</div><button onclick="game.addProblem('high')">高质量 (+3题, -20学术)</button><button onclick="game.addProblem('mid')">普通 (+10题, -20学术)</button><button onclick="game.addProblem('low')">低质量 (+20题, -20学术)</button></div></div><!-- R&D Tab --><div id="tab-rd" class="panel"><div class="action-card"><h3>💻 基础设施</h3><div style="color:#ff5252; font-size:0.85em; margin-bottom:10px; font-weight:bold;">⚠️ 注意:当核心数达到架构上限(32或64 × 架构等级)时,必须先升级架构才能继续购买。</div><div class="btn-group"><label>Web核心:</label><button onclick="game.expandHardware('server', 1)">+1</button><button onclick="game.expandHardware('server', 10)" class="btn-small">+10</button><button onclick="game.expandHardware('server', 'max')" class="btn-small" style="background:#555">填满</button></div><div class="btn-group"><label>评测核心:</label><button onclick="game.expandHardware('judge', 1)">+1</button><button onclick="game.expandHardware('judge', 10)" class="btn-small">+10</button><button onclick="game.expandHardware('judge', 'max')" class="btn-small" style="background:#555">填满</button></div><div class="btn-group" style="margin-top:10px"><button onclick="game.expandHardware('disk', 1)">加硬盘 (+40GB)</button><button onclick="game.expandHardware('disk', 25)">加硬盘 (+1000GB)</button></div></div><div class="action-card"><h3>🚀 功能研发</h3><div id="rd-list"></div></div><div class="action-card"><h3>🏗️ 架构升级</h3><div class="card-desc">架构升级后,每个核心可额外容纳 100 活跃用户。</div><div style="font-size:0.85em; color:#aaa; margin-bottom:8px; line-height:1.5;">Web下级需求: <span id="disp-up-server-cost" style="color:#ffb74d"></span><br>评测下级需求: <span id="disp-up-judge-cost" style="color:#ffb74d"></span>10 行未改动<h4 style="margin-top:0">研发团队 (产出: <span id="out-rd">0</span>/月)</h4><button onclick="game.hire('rd_student')">高中生 ($1500, +20 研发)</button><button onclick="game.hire('rd_uni')">大学生 ($5000, +75 研发)</button><button onclick="game.hire('rd_full')">全职大牛 ($12000, +120 研发)</button><h4 style="margin-top:10px">学术团队 (产出: <span id="out-acad">0</span>/月)</h4><button onclick="game.hire('acad_part')">现役选手 ($500, +50 学术)</button><button onclick="game.hire('acad_full')">全职教练 ($15000, +400 学术)</button><h4 style="margin-top:10px">社区团队 (产出: <span id="out-comm">0</span>/月)</h4><button onclick="game.hire('comm_part')">兼职版主 ($500, +50 社区)</button><button onclick="game.hire('comm_full')">全职运营 ($7500, +400 社区)</button></div></div><!-- Edu Tab --><div id="tab-edu" class="panel"><div class="action-card"><h3>🏫 网校管理</h3><p style="font-size:0.85em; color:#aaa">研发[网校功能]后解锁。课程升级后带来更多收入,但升级成本也会增加。开课后有 3 个月冷却期。</p><div id="edu-list"></div></div></div><div id="log-area"><div class="log-entry" style="color:#4fc3f7">💡 欢迎来到 OJ 运维模拟器!</div><div class="log-entry">请密切关注左侧的【下月预测】面板,避免破产。</div></div></div><script>const GAME_PARAMS = {INITIAL: { YEAR: 2013, MONTH: 1, MONEY: 2000, AP: 100, USERS: 50, SERVER_CORES: 2, JUDGE_CORES: 1, DISK_MB: 20480 },INCOME: { MONTHLY_GRANT: 500 },COSTS: {SERVER_CORE_RENT: 200, JUDGE_CORE_RENT: 200, DISK_BLOCK_RENT: 100, DISK_BLOCK_SIZE_GB: 40,ADD_PROBLEM_ACAD: 20, HIRE_AP: 10},HIRING: {rd_student: { name: "高中兼职", cost: 1500, gain: 20, limit: 5, type: 'rd' },rd_uni: { name: "大学兼职", cost: 5000, gain: 75, limit: 5, type: 'rd' },19 行未改动},USER_BEHAVIOR: {SUBMISSIONS: { normal: 15, active: 65, core: 300 },SOLUTIONS: { normal: 0.01, active: 1, core: 5 },GROWTH_FACTOR: 0.25,UPGRADE_N_A_BASE: 4, UPGRADE_N_A_MULT: 10, UPGRADE_A_C_MULT: 5},DISK_USAGE: { PROBLEM: 50, USER_DATA: 0.05, SUBMISSION: 0.002, SOLUTION: 0.005 },CLASSES: {17 行未改动total_solutions: 0,reputation: 0,last_month: { subs: 0, sols: 0 },consecutive_failure_months: 0,comm_fail_months: 0, // 新增:累计社区违规月数pending_user_bonus: 0 // 新增:下月用户奖励},hardware: {server_cores: GAME_PARAMS.INITIAL.SERVER_CORES, judge_cores: GAME_PARAMS.INITIAL.JUDGE_CORES,disk_extra_blocks: 0, disk_used: 0, server_arch: 1, judge_arch: 114 行未改动nextMonth: function() {this.date.month++;if (this.date.month > 12) { this.date.month = 1; this.date.year++; }const isFreeEra = (this.date.year === 2013 && this.date.month < 7);ui.log(`=== ${this.date.year}年 ${this.date.month}月 ===`, 'log-warn');if (this.date.year >= 2026) { this.endGame(); return; }this.ap = 100;2 行未改动for (let k in this.staff) {let count = this.staff[k], conf = GAME_PARAMS.HIRING[k];if (count > 0) { salary += count * conf.cost; gain[conf.type] += count * conf.gain; }}this.money += GAME_PARAMS.INCOME.MONTHLY_GRANT;this.money -= salary;this.resources.rd += gain.rd; this.resources.acad += gain.acad; this.resources.comm += gain.comm;if(salary > 0) ui.log(`财务: 发放工资 ${salary}, 产出 R:${gain.rd} A:${gain.acad} C:${gain.comm}`);// Maintenancelet maintain_rd = 0;for (let k in GAME_PARAMS.FEATURES) if (this.features_unlocked[k]) maintain_rd += GAME_PARAMS.FEATURES[k].maintain;maintain_rd += 20 * (this.hardware.server_arch - 1);maintain_rd += 20 * (this.hardware.judge_arch - 1);this.resources.rd = Math.max(this.resources.rd - maintain_rd, 0);// Hardware Costslet hw_cost = this.hardware.disk_extra_blocks * GAME_PARAMS.COSTS.DISK_BLOCK_RENT;if (!isFreeEra) {hw_cost += this.hardware.server_cores * GAME_PARAMS.COSTS.SERVER_CORE_RENT;hw_cost += this.hardware.judge_cores * GAME_PARAMS.COSTS.JUDGE_CORE_RENT;}this.money -= hw_cost;if(hw_cost > 0) ui.log(`财务: 硬件租金 ${hw_cost}`);// --- Load & API ---6 行未改动let server_cap = this.hardware.server_cores * server_cap_unit;let judge_cap = this.hardware.judge_cores * judge_cap_unit;let u = this.stats.users;let load = u.active + (u.normal / 3) + (u.core * 3);if ([7,8,9,10].includes(this.date.month)) load *= 1.3;if (this.features_unlocked.api) {let total_u = u.normal + u.active + u.core;this.money += Math.floor(total_u * 1.0);}// --- Growth Logic ---let rep = this.stats.reputation;let total_users = u.normal + u.active + u.core;let pct_rate = (rep * 8 + 4) / 100;if (pct_rate < 0) pct_rate = 0;let growth_from_pct = total_users * pct_rate;let growth_from_fixed = (rep + 1) * 50;if (growth_from_fixed < 0) growth_from_fixed = 0;let new_users = Math.floor(growth_from_pct + growth_from_fixed);if (this.flags.contest_growth_mult !== 1.0) {new_users = Math.floor(new_users * this.flags.contest_growth_mult);this.flags.contest_growth_mult = 1.0;}// 新增:搬题奖励发放if (this.stats.pending_user_bonus > 0) {new_users += this.stats.pending_user_bonus;ui.log(`推广: 试题扩充吸引了额外 ${this.stats.pending_user_bonus} 名用户`);this.stats.pending_user_bonus = 0;}u.normal += new_users;if (new_users > 0) ui.log(`用户: 新增 ${new_users} 人`);// Flowlet prob_n2a = (rep * GAME_PARAMS.USER_BEHAVIOR.UPGRADE_N_A_MULT + GAME_PARAMS.USER_BEHAVIOR.UPGRADE_N_A_BASE) / 100;if (this.features_unlocked.difficulty) prob_n2a *= 1.1;if (this.features_unlocked.solution) prob_n2a *= 1.25;if (this.features_unlocked.discuss) prob_n2a *= 1.1;if (this.features_unlocked.team) prob_n2a *= 1.1;let delta_n2a = Math.floor(u.normal * prob_n2a);if (delta_n2a > 0) { u.normal -= delta_n2a; u.active += delta_n2a; }else { let delta_a2n = Math.floor(u.active * Math.abs(prob_n2a)); u.active -= delta_a2n; u.normal += delta_a2n; }let prob_a2c = (rep * GAME_PARAMS.USER_BEHAVIOR.UPGRADE_A_C_MULT) / 100;let delta_a2c = Math.floor(u.active * prob_a2c);8 行未改动(u.active * GAME_PARAMS.USER_BEHAVIOR.SUBMISSIONS.active) +(u.core * GAME_PARAMS.USER_BEHAVIOR.SUBMISSIONS.core);let subs_int = Math.floor(subs);this.stats.total_submissions += subs_int;this.stats.last_month.subs = subs_int;let sols = 0;if (this.features_unlocked.solution) {sols = (u.normal * GAME_PARAMS.USER_BEHAVIOR.SOLUTIONS.normal) +(u.active * GAME_PARAMS.USER_BEHAVIOR.SOLUTIONS.active) +(u.core * GAME_PARAMS.USER_BEHAVIOR.SOLUTIONS.core);}let sols_int = Math.floor(sols);this.stats.total_solutions += sols_int;this.stats.last_month.sols = sols_int;let p = this.stats.problems;let total_prob = p.high + p.mid + p.low;let disk = (total_prob * GAME_PARAMS.DISK_USAGE.PROBLEM) +(total_users * GAME_PARAMS.DISK_USAGE.USER_DATA) +(this.stats.total_submissions * GAME_PARAMS.DISK_USAGE.SUBMISSION) +(this.stats.total_solutions * GAME_PARAMS.DISK_USAGE.SOLUTION);this.hardware.disk_used = disk;let disk_cap = GAME_PARAMS.INITIAL.DISK_MB + (this.hardware.disk_extra_blocks * GAME_PARAMS.COSTS.DISK_BLOCK_SIZE_GB * 1024);// System Failure Checklet is_disk_full = disk > disk_cap;let is_server_overload = load > server_cap;let is_judge_overload = load > judge_cap;if (is_disk_full) ui.log("❌ 硬盘已满!数据写入失败!", "log-bad");if (is_server_overload) ui.log("❌ Web服务器过载!", "log-bad");if (is_judge_overload) ui.log("❌ 评测机过载!", "log-bad");if (is_disk_full || is_server_overload || is_judge_overload) {this.stats.consecutive_failure_months++;ui.log(`⚠️ 系统故障!连续故障月数: ${this.stats.consecutive_failure_months}/6`, "log-bad");if (this.stats.consecutive_failure_months >= 6) {alert("由于长期维护不善(连续6个月故障),您的 OJ 被视作关停。游戏结束。");document.getElementById('next-month-btn').disabled = true;return;}} else {if (this.stats.consecutive_failure_months > 0) {ui.log("✅ 系统状态已恢复正常,故障计数重置。", "log-good");}this.stats.consecutive_failure_months = 0;}// Needs & Replet acad_need = 0;if (this.features_unlocked.difficulty) acad_need += total_prob * 0.05;if (this.features_unlocked.solution) acad_need += total_prob * 0.1;let comm_need = 0;if (this.features_unlocked.discuss) comm_need += total_users * 0.01;this.resources.acad -= acad_need;this.resources.comm -= comm_need;let acad_gap = (this.resources.acad < 0) ? Math.abs(this.resources.acad) : 0;let comm_gap = (this.resources.comm < 0) ? Math.abs(this.resources.comm) : 0;// 新增:社区缺口统计if (comm_gap > 0) this.stats.comm_fail_months++;// 新增:每年1月罚款逻辑if (this.date.month === 1 && this.stats.comm_fail_months >= 12 && total_users >= 10000) {let fine = total_users;this.money -= fine;ui.log(`⚖️ 监管通知: 因长期社区维护不善,罚款 ${fine} 元!`, "log-bad");this.stats.comm_fail_months = 0; // 罚款后重置计数}let server_gap = Math.max(0, load - server_cap);let judge_gap = Math.max(0, load - judge_cap);this.calculateReputation(acad_gap, comm_gap, server_gap, judge_gap, total_prob);// Cooldownsfor(let k in this.class_state) if (this.class_state[k].cooldown > 0) this.class_state[k].cooldown--;if (this.flags.fundraising_penalty_val > 0) {this.flags.fundraising_penalty_val -= (0.2 / 12);if (this.flags.fundraising_penalty_val < 0) this.flags.fundraising_penalty_val = 0;}27 行未改动if (acad_gap > 0) r_stable -= Math.log10(acad_gap) / 20;if (comm_gap > 0) r_stable -= Math.log10(comm_gap) / 20;if (server_gap > 0) r_stable -= Math.log10(server_gap) / 10;if (judge_gap > 0) r_stable -= Math.log10(judge_gap) / 10;r_stable -= this.flags.fundraising_penalty_val;r_stable -= this.flags.temp_rep_penalty;let total = r_acad + r_users + r_edu + r_stable;if (total > 1) total = 1;this.stats.reputation = total;},3 行未改动this.ap -= 10; this.resources[target] += 10;ui.log(`行动: 10 AP -> 10 ${target}点`); ui.update();},// 新增:批量转化剩余所有AP的函数convertAPAll: function(target) {if (this.ap < 10) {ui.log("AP不足(至少需要10点)", "log-bad");return;}// 计算可转化的次数(每次消耗10AP)const convertTimes = Math.floor(this.ap / 10);const apCost = convertTimes * 10;const resourceGain = convertTimes * 10;this.ap -= apCost;this.resources[target] += resourceGain;ui.log(`行动: ${apCost} AP -> ${resourceGain} ${target}点(剩余AP: ${this.ap})`, "log-good");ui.update();},addProblem: function(type) {if (this.resources.acad < GAME_PARAMS.COSTS.ADD_PROBLEM_ACAD) { ui.log("学术不足", "log-bad"); return; }this.resources.acad -= GAME_PARAMS.COSTS.ADD_PROBLEM_ACAD;// 新增:搬题奖励记录if (type === 'mid' || type === 'low') {let bonus = Math.floor(Math.random() * 41) + 10; // 10-50this.stats.pending_user_bonus = (this.stats.pending_user_bonus || 0) + bonus;}if (type === 'high') this.stats.problems.high += 3;if (type === 'mid') this.stats.problems.mid += 10;if (type === 'low') { this.stats.problems.low += 20; this.stats.reputation -= 0.001; }ui.log(`题库: 增加 ${type} 试题`); ui.update();},organizeContest: function(key) {let conf = GAME_PARAMS.CONTESTS[key];if (this.money < conf.cost || this.resources.acad < conf.acad) { ui.log("资源不足", "log-bad"); return; }this.money -= conf.cost; this.resources.acad -= conf.acad;if (conf.prob_mid) this.stats.problems.mid += conf.prob_mid;if (conf.prob_low) this.stats.problems.low += conf.prob_low;if (conf.prob_high) this.stats.problems.high += conf.prob_high;if (conf.rep_pen) this.flags.temp_rep_penalty += conf.rep_pen;if (conf.rep_gain) this.stats.reputation += conf.rep_gain;if (conf.growth_mult) this.flags.contest_growth_mult = conf.growth_mult;ui.log(`比赛: ${conf.name} (下月增长 x${conf.growth_mult})`); ui.update();},fundraising: function() {if (this.ap < 50) return;this.ap -= 50;let u = this.stats.users;let total_users = u.normal + u.active + u.core;let gain = Math.floor(total_users * (this.stats.reputation + 1) * 5);if (gain < 0) gain = 0;this.money += gain;this.flags.fundraising_penalty_val += 0.2;ui.log(`募捐: 获得 ${gain} 元,声誉受损`, "log-bad"); ui.update();},6 行未改动ui.log(`招聘: ${conf.name}`); ui.update();},expandHardware: function(type, mode) {// mode: 1 (default), 10, 'max'mode = mode || 1;if (type === 'disk') {let count = (typeof mode === 'number') ? mode : 1;this.hardware.disk_extra_blocks += count;ui.log(`硬件: 硬盘扩容 (+${count * 40}GB)`);ui.update();return;}let isServer = (type === 'server');let arch = isServer ? this.hardware.server_arch : this.hardware.judge_arch;let current = isServer ? this.hardware.server_cores : this.hardware.judge_cores;let limit_base = isServer ? 32 : 64;let limit = limit_base * arch;let count = 0;if (mode === 'max') {count = limit - current;} else {count = mode;}if (count <= 0) {ui.log("已达到架构上限,无法添加", "log-bad");return;}if (current + count > limit) {count = limit - current;if (count <= 0) {ui.log("核心数已达架构上限,请先升级架构", "log-bad");return;}}if (isServer) this.hardware.server_cores += count;else this.hardware.judge_cores += count;ui.log(`硬件: ${isServer?'Web':'评测'}核心 +${count}`);ui.update();},upgradeArch: function(type) {let level = (type === 'server') ? this.hardware.server_arch : this.hardware.judge_arch;let cost_m = 10000 * level, cost_r = 100 * level;if (this.money < cost_m || this.resources.rd < cost_r) { ui.log("资源不足", "log-bad"); return; }this.money -= cost_m; this.resources.rd -= cost_r;if (type === 'server') this.hardware.server_arch++; else this.hardware.judge_arch++;ui.log(`研发: 架构升级成功`, "log-good"); ui.update();},unlockFeature: function(id) {let f = GAME_PARAMS.FEATURES[id];if (this.money < f.cost || this.resources.rd < f.rd) { ui.log("资源不足", "log-bad"); return; }this.money -= f.cost; this.resources.rd -= f.rd;6 行未改动let conf = GAME_PARAMS.CLASSES[id], st = this.class_state[id];if (conf.season && !conf.season.includes(this.date.month)) { ui.log("季节不符 (需7-10月)", "log-bad"); return; }if (st.cooldown > 0) return;if (this.money < conf.req_money || this.resources.acad < conf.req_acad) { ui.log("无法开课 (资源不足)", "log-bad"); return; }this.money -= conf.req_money; this.resources.acad -= conf.req_acad;this.money += conf.inc_base * st.level; st.cooldown = 3;ui.log(`网校: ${conf.name} 开课`, "log-good"); ui.update();},upgradeClass: function(id) {let conf = GAME_PARAMS.CLASSES[id], st = this.class_state[id];if (st.level >= conf.max) return;let cm = conf.cost_base * st.level;let ca = conf.acad_base * st.level;if (this.money < cm || this.resources.acad < ca) { ui.log("升级资源不足", "log-bad"); return; }this.money -= cm; this.resources.acad -= ca; st.level++;ui.log(`网校: 升级 ${conf.name}`, "log-good"); ui.renderClasses(); ui.update();},endGame: function() {let u = this.stats.users, p = this.stats.problems;let score = (u.core/3) + (u.active/10) + (u.normal/100) + (3*p.high + p.mid - p.low) + (0.01 * this.stats.total_solutions);score *= (this.stats.reputation + 1);alert(`游戏结束!最终得分: ${score.toFixed(2)}`);document.getElementById('next-month-btn').disabled = true;}};3 行未改动document.getElementById('disp-date').innerText = `${game.date.year}-${String(game.date.month).padStart(2,'0')}`;document.getElementById('disp-money').innerText = game.money;document.getElementById('disp-rep').innerText = game.stats.reputation.toFixed(3);document.getElementById('rep-bar').style.width = Math.max(0, Math.min(100, (game.stats.reputation + 1)/2*100)) + '%';document.getElementById('disp-ap').innerText = game.ap;document.getElementById('disp-rd').innerText = Math.floor(game.resources.rd);document.getElementById('disp-acad').innerText = Math.floor(game.resources.acad);document.getElementById('disp-comm').innerText = Math.floor(game.resources.comm);let u = game.stats.users;document.getElementById('disp-users-total').innerText = u.normal + u.active + u.core;let failSpan = document.getElementById('disp-fail-months');failSpan.innerText = `${game.stats.consecutive_failure_months} / 6`;failSpan.style.color = game.stats.consecutive_failure_months > 0 ? '#ff5252' : '#aaa';3 行未改动let p = game.stats.problems;document.getElementById('disp-prob-high').innerText = p.high;document.getElementById('disp-prob-mid').innerText = p.mid;document.getElementById('disp-prob-low').innerText = p.low;let disk_cap = GAME_PARAMS.INITIAL.DISK_MB + (game.hardware.disk_extra_blocks * GAME_PARAMS.COSTS.DISK_BLOCK_SIZE_GB * 1024);document.getElementById('disp-disk').innerText = `${(game.hardware.disk_used/1024).toFixed(1)} / ${(disk_cap/1024).toFixed(1)} GB`;document.getElementById('disp-server-core').innerText = game.hardware.server_cores;document.getElementById('disp-server-arch').innerText = game.hardware.server_arch;document.getElementById('disp-judge-core').innerText = game.hardware.judge_cores;document.getElementById('disp-judge-arch').innerText = game.hardware.judge_arch;// Load Calculationlet server_arch_bonus = (game.hardware.server_arch - 1) * 100;let server_cap_unit = 500 - (game.features_unlocked.team?50:0) - (game.features_unlocked.api?50:0) + server_arch_bonus;let s_cap = game.hardware.server_cores * server_cap_unit;// --- 新增开始 ---let judge_arch_bonus = (game.hardware.judge_arch - 1) * 100;let judge_cap_unit = 500 + judge_arch_bonus;let j_cap = game.hardware.judge_cores * judge_cap_unit;// --- 新增结束 ---let load = Math.floor(u.active + (u.normal/3) + (u.core*3));if ([7,8,9,10].includes(game.date.month)) load = Math.floor(load * 1.3);document.getElementById('disp-server-load').innerText = load;document.getElementById('disp-server-cap').innerText = s_cap;document.getElementById('disp-server-load').style.color = (load > s_cap) ? '#ff5252' : '#888'; // 简单的红字警告// --- 新增开始 ---document.getElementById('disp-judge-load').innerText = load;document.getElementById('disp-judge-cap').innerText = j_cap;document.getElementById('disp-judge-load').style.color = (load > j_cap) ? '#ff5252' : '#888'; // 简单的红字警告// --- 新增结束 ---// Forecastlet salary = 0;for (let k in game.staff) salary += game.staff[k] * GAME_PARAMS.HIRING[k].cost;let hw_cost = game.hardware.disk_extra_blocks * GAME_PARAMS.COSTS.DISK_BLOCK_RENT;let next_month = game.date.month + 1, next_year = game.date.year;if (next_month > 12) { next_month = 1; next_year++; }let will_charge_hw = (next_year > 2013) || (next_year === 2013 && next_month >= 7);if (will_charge_hw) {hw_cost += game.hardware.server_cores * GAME_PARAMS.COSTS.SERVER_CORE_RENT;hw_cost += game.hardware.judge_cores * GAME_PARAMS.COSTS.JUDGE_CORE_RENT;}let total_expense = salary + hw_cost;let api_income = 0;if (game.features_unlocked.api) api_income = Math.floor((u.normal+u.active+u.core) * 1.0); // Now 1.0let total_income = GAME_PARAMS.INCOME.MONTHLY_GRANT + api_income;let m_rd = 0, m_acad = 0, m_comm = 0;for (let k in GAME_PARAMS.FEATURES) if (game.features_unlocked[k]) m_rd += GAME_PARAMS.FEATURES[k].maintain;m_rd += 20 * (game.hardware.server_arch - 1) + 20 * (game.hardware.judge_arch - 1);let total_prob = p.high + p.mid + p.low;if (game.features_unlocked.difficulty) m_acad += total_prob * 0.05;if (game.features_unlocked.solution) m_acad += total_prob * 0.1;if (game.features_unlocked.discuss) m_comm += (u.normal+u.active+u.core) * 0.01;document.getElementById('fc-income').innerText = `+${total_income}`;document.getElementById('fc-salary').innerText = `-${salary}`;document.getElementById('fc-maint').innerText = `-${hw_cost}`;let net = total_income - total_expense;let netEl = document.getElementById('fc-net');netEl.innerText = (net >= 0 ? '+' : '') + net;netEl.style.color = (net >= 0 ? '#69f0ae' : '#ff5252');document.getElementById('fc-rd-cost').innerText = m_rd;document.getElementById('fc-acad-cost').innerText = Math.floor(m_acad);document.getElementById('fc-comm-cost').innerText = Math.floor(m_comm);let banner = document.getElementById('warning-banner');banner.style.display = (game.money + net < 0) ? 'block' : 'none';if (game.money + net < 0) banner.innerText = `⚠️ 严重警告:按当前收支,下个月将破产 (预计余额 ${game.money + net})!`;let staff = game.staff, h = GAME_PARAMS.HIRING;document.getElementById('out-rd').innerText = staff.rd_student*h.rd_student.gain + staff.rd_uni*h.rd_uni.gain + staff.rd_full*h.rd_full.gain;document.getElementById('out-acad').innerText = staff.acad_part*h.acad_part.gain + staff.acad_full*h.acad_full.gain;document.getElementById('out-comm').innerText = staff.comm_part*h.comm_part.gain + staff.comm_full*h.comm_full.gain;// 更新架构升级费用显示let s_lvl = game.hardware.server_arch;let j_lvl = game.hardware.judge_arch;document.getElementById('disp-up-server-cost').innerText = `$${10000*s_lvl} + ${100*s_lvl} 研发`;document.getElementById('disp-up-judge-cost').innerText = `$${10000*j_lvl} + ${100*j_lvl} 研发`;ui.renderClasses(); // Refresh edu tab for cooldown/level text},log: function(msg, cls) {let div = document.createElement('div');div.className = 'log-entry ' + (cls||'');div.innerText = `[${game.date.year}-${game.date.month}] ` + msg;let area = document.getElementById('log-area');area.appendChild(div);area.scrollTop = area.scrollHeight;},switchTab: function(id) {document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));event.target.classList.add('active');document.querySelectorAll('.panel').forEach(p => p.classList.remove('active'));document.getElementById('tab-'+id).classList.add('active');},renderRD: function() {let html = '';for (let k in GAME_PARAMS.FEATURES) {let f = GAME_PARAMS.FEATURES[k], isUn = game.features_unlocked[k];let btn = isUn ? `<button disabled>✅ 已完成</button>` : `<button onclick="game.unlockFeature('${k}')">研发 ($${f.cost}, 研发点 ${f.rd})</button>`;html += `<div style="background:#222; padding:10px; margin-bottom:8px; border-radius:4px; border-left: 3px solid ${isUn?'#4caf50':'#ff9800'}"><div style="display:flex; justify-content:space-between; align-items:center"><span style="font-weight:bold">${f.name}</span>${btn}</div><div style="font-size:0.8em; color:#888; margin-top:4px">${f.desc} (维护: ${f.maintain}/月)</div></div>`;}document.getElementById('rd-list').innerHTML = html;},renderClasses: function() {if (!game.features_unlocked.school) { document.getElementById('edu-list').innerHTML = `<div style="color:#888;text-align:center">请先解锁网校功能</div>`; return; }let html = '';for(let k in GAME_PARAMS.CLASSES) {let c = GAME_PARAMS.CLASSES[k], st = game.class_state[k], isMax = st.level >= c.max;// Run Cost textlet runCostText = `$${c.req_money} + ${c.req_acad} 学术`;// Upgrade Cost textlet upCostText = isMax ? "MAX" : `$${c.cost_base*st.level} + ${c.acad_base*st.level} 学术`;let runBtn = (st.cooldown > 0) ? `<button class="btn-run" disabled>冷却 (${st.cooldown}月)</button>` : `<button class="btn-run" onclick="game.runClass('${k}')">开课 (+${c.inc_base*st.level}元)</button>`;let upBtn = isMax ? `<button class="btn-up" disabled>已满级</button>` : `<button class="btn-up" onclick="game.upgradeClass('${k}')">升级</button>`;html += `<div class="edu-card"><div class="edu-header"><span>${c.name} <span style="color:#ffb74d">Lv.${st.level}</span></span><span style="font-size:0.8em; color:#888">Max: Lv.${c.max}</span></div><div class="edu-cost"><div>开课成本: ${runCostText}</div><div>升级成本: ${upCostText}</div></div><div class="edu-actions">${runBtn}${upBtn}</div></div>`;}document.getElementById('edu-list').innerHTML = html;}};game.init();</script></body></html>```12345621 行未改动28293031323334353621 行未改动58596061626364656610 行未改动777879808182838485868788899091929394959697989910010110210310410510610710810911011133 行未改动1451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771789 行未改动1881891901911921931941951961971981992002012022032042052062072082096 行未改动2162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522534 行未改动25825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234310 行未改动35435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439519 行未改动41541641741841942042142242317 行未改动44144244344444544644744844945014 行未改动4654664674684694704714722 行未改动4754764774784794804814824834844854864874884894904914924934944954964974984995006 行未改动5075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675688 行未改动57757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766827 行未改动6966976986997007017027037047057067073 行未改动7117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098106 行未改动8178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958966 行未改动9039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329333 行未改动9379389399409419429439449459469479489499509519529533 行未改动95795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154```<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">21 行未改动}::-webkit-scrollbar { width: 8px; }::-webkit-scrollbar-track { background: var(--bg-color); }::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }#sidebar {width: 350px;background-color: var(--panel-bg);padding: 20px;21 行未改动}.stat-row { display: flex; justify-content: space-between; margin-bottom: 4px; align-items: center; }.stat-val { font-weight: bold; color: #4fc3f7; font-family: monospace; font-size: 1.1em; }.sub-text { font-size: 0.8em; color: #888; }.forecast-row { display: flex; justify-content: space-between; font-size: 0.85em; color: #aaa; border-bottom: 1px dashed #333; padding: 2px 0; }.forecast-val { font-family: monospace; }.income { color: #69f0ae; }.expense { color: #ff5252; }10 行未改动font-size: 0.9em;}button:hover { background-color: var(--text); transform: translateY(-1px); }button:disabled { background-color: #333; cursor: not-allowed; opacity: 0.6; transform: none; }.btn-group { display: flex; align-items: center; margin-bottom: 6px; }.btn-group label { width: 80px; font-size: 0.9em; color: #ccc; }.btn-small { padding: 4px 8px; font-size: 0.8em; background-color: #444; }.tabs { display: flex; border-bottom: 2px solid #333; margin-bottom: 15px; }.tab {padding: 10px 20px;cursor: pointer;background: rgba(0,0,0,0.2);border-radius: 8px 8px 0 0;margin-right: 4px;}.tab.active { background: var(--text); color: white; font-weight: bold; }.panel { display: none; animation: fadeIn 0.3s; }.panel.active { display: block; }@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }.action-card {background: var(--panel-bg);border: 1px solid var(--border);padding: 15px;margin-bottom: 15px;border-radius: 8px;}#log-area {height: 200px;background: #111;font-family: 'Consolas', monospace;33 行未改动margin-bottom: 10px;border-radius: 8px;}#next-month-btn:hover { background-color: #43a047; }.progress-container { width: 100%; background-color: #333; height: 6px; border-radius: 3px; margin-top: 8px; overflow: hidden; }.progress-bar { height: 100%; background-color: var(--success); width: 0%; transition: width 0.5s ease-out; }.edu-card {background: #222;padding: 12px;margin-bottom: 10px;border-radius: 6px;border-left: 4px solid var(--text);}.edu-header { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 8px; }.edu-cost { font-size: 0.85em; color: #aaa; margin-bottom: 8px; line-height: 1.4; }.edu-actions { display: flex; gap: 8px; }.btn-run { background-color: #2e7d32; flex: 1; }.btn-up { background-color: #1565c0; flex: 1; }/* 新增:资源转化按钮组样式优化 */.convert-btn-group {display: flex;align-items: center;margin: 4px 0;gap: 8px; /* 增加按钮间距 */}.convert-btn-group button {flex: 1; /* 按钮均分宽度 */}.btn-all {background-color: #2e7d32;font-size: 0.8em;9 行未改动<div style="font-size:0.8em; opacity:0.7;">目标: 存活至 2026-01</div></div><div class="stat-box"><div class="stat-row"><span>日期</span> <span id="disp-date" class="stat-val">2013-01</span></div><div class="stat-row"><span>资金</span> <span id="disp-money" class="stat-val">5000</span></div><div class="stat-row"><span>声誉</span> <span id="disp-rep" class="stat-val">0.000</span></div><div class="progress-container"><div id="rep-bar" class="progress-bar" style="width: 50%;"></div></div></div><!-- 故障监控 --><div class="stat-box" style="border: 1px solid #555;"><div class="stat-row"><span>连续故障月数</span> <span id="disp-fail-months" style="color:#aaa; font-weight:bold">0 / 6</span></div><div style="font-size:0.75em; color:#888;">若连续6个月硬盘满或服务器/评测机过载,游戏强制结束。</div></div><!-- 预测模块 --><h3>下月预测</h3><div class="stat-box"><div class="forecast-row"><span>预计收入(低保+API)</span> <span id="fc-income" class="forecast-val income">+0</span></div><div class="forecast-row"><span>预计工资支出</span> <span id="fc-salary" class="forecast-val expense">-0</span></div><div class="forecast-row"><span>预计维护支出</span> <span id="fc-maint" class="forecast-val expense">-0</span></div>6 行未改动社区需求: <span id="fc-comm-cost">0</span>/月</div></div><h3>资源池</h3><div class="stat-box"><div class="stat-row"><span>行动力 (AP)</span> <span id="disp-ap" class="stat-val" style="color: #ffca28;">100</span></div><div class="stat-row"><span>研发点</span> <span id="disp-rd" class="stat-val">0</span></div><div class="stat-row"><span>学术点</span> <span id="disp-acad" class="stat-val">0</span></div><div class="stat-row"><span>社区点</span> <span id="disp-comm" class="stat-val">0</span></div></div><h3>运营数据</h3><div class="stat-box"><div class="stat-row"><span>总用户</span> <span id="disp-users-total" class="stat-val">50</span></div><div class="stat-row"><span class="sub-text">上月新增提交</span> <span id="disp-last-subs" style="color:#fff">0</span></div><div class="stat-row"><span class="sub-text">上月新增题解</span> <span id="disp-last-sols" style="color:#fff">0</span></div><hr style="border-color:#444; margin: 8px 0;"><div class="stat-row"><span>题库 (高/中/低)</span> <span><span id="disp-prob-high">0</span>/<span id="disp-prob-mid">0</span>/<span id="disp-prob-low">0</span></span></div><div class="stat-row"><span class="sub-text">硬盘占用</span> <span id="disp-disk">0 GB</span></div></div><h3>服务器</h3><div class="stat-box"><div class="stat-row"><span>Web核心</span> <span><span id="disp-server-core" class="stat-val">2</span> 核 (Lv.<span id="disp-server-arch">1</span>)</span></div><div class="stat-row"><span>评测核心</span> <span><span id="disp-judge-core" class="stat-val">1</span> 核 (Lv.<span id="disp-judge-arch">1</span>)</span></div><div class="stat-row" style="justify-content: flex-end; font-size: 0.8em; color: #888;">Web负载: <span id="disp-server-load">0</span> / <span id="disp-server-cap">0</span></div><div class="stat-row" style="justify-content: flex-end; font-size: 0.8em; color: #888;">评测负载: <span id="disp-judge-load">0</span> / <span id="disp-judge-cap">0</span></div></div></div><div id="main"><div id="warning-banner">警告:预计下个月将破产!请立即筹集资金!</div><button id="next-month-btn" onclick="game.nextMonth()">进入下个月</button><div class="tabs"><div class="tab active" onclick="ui.switchTab('ops')">日常运营</div>4 行未改动<!-- Operations Tab --><div id="tab-ops" class="panel active"><div class="action-card"><h3>资源转化 (每次 10 行动力)</h3><!-- 改造:资源转化按钮改为2行布局 --><div class="convert-btn-group"><button onclick="game.convertAP('rd')">转研发 (+10)</button><button onclick="game.convertAP('acad')">转学术 (+10)</button><button onclick="game.convertAP('comm')">转社区 (+10)</button></div><div class="convert-btn-group"><button onclick="game.convertAPAll('rd')" class="btn-all">研发(剩余全部)</button><button onclick="game.convertAPAll('acad')" class="btn-all">学术(剩余全部)</button><button onclick="game.convertAPAll('comm')" class="btn-all">社区(剩余全部)</button></div><button onclick="game.fundraising()" style="float:right; background:#5d4037; margin-top:8px;">号召募捐 (50 行动力, 降声誉)</button><div style="clear:both; margin-top:5px; font-size:0.8em; color:#aaa;">募捐获得金钱数: 用户数 × (声誉+1) × 5</div></div><div class="action-card"><h3>赛事运营</h3><div class="card-desc">举办比赛可提升下月用户增长速度。</div><button onclick="game.organizeContest('old')">原题赛 (需要$500, 学术40)<br><span style="font-size:0.8em">普通题目+4, 增长x1.05</span></button><button onclick="game.organizeContest('water')">水赛 (需要$1000, 学术40)<br><span style="font-size:0.8em">低质题目+6, 增长x1.15</span></button><button onclick="game.organizeContest('normal')">普通赛 (需要$3000, 学术80)<br><span style="font-size:0.8em">普通题目+4, 增长x1.1</span></button><button onclick="game.organizeContest('grand')">优秀赛 (需要$8000, 学术200)<br><span style="font-size:0.8em">高质题目+3, 增长x1.1, 升声誉</span></button></div><div class="action-card"><h3>题库扩充</h3><div class="card-desc" style="font-size:0.85em; color:#aaa; margin-bottom:5px;">搬运普通/低质试题可吸引 10~50 名新用户。</div><!-- 基础题库扩充 --><div style="margin-bottom:10px;"><button onclick="game.addProblem('high')">高质量 (+3题, -20学术)</button><button onclick="game.addProblem('mid')">普通 (+10题, -20学术)</button><button onclick="game.addProblem('low')">低质量 (+20题, -20学术)</button></div><!-- 新增批量题库扩充 --><div><button onclick="game.addProblem('high_batch')">高质量批量 (+30题, -200学术)</button><button onclick="game.addProblem('mid_batch')">普通批量 (+100题, -200学术)</button><button onclick="game.addProblem('low_batch')">低质量批量 (+200题, -200学术)</button></div></div></div><!-- R&D Tab --><div id="tab-rd" class="panel"><div class="action-card"><h3>基础设施</h3><div style="color:#ff5252; font-size:0.85em; margin-bottom:10px; font-weight:bold;">注意:当核心数达到架构上限(32或64 × 架构等级)时,必须先升级架构才能继续购买。</div><div class="btn-group"><label>Web核心:</label><button onclick="game.expandHardware('server', 1)">+1</button><button onclick="game.expandHardware('server', 10)" class="btn-small">+10</button><button onclick="game.expandHardware('server', 'max')" class="btn-small" style="background:#555">填满</button></div><div class="btn-group"><label>评测核心:</label><button onclick="game.expandHardware('judge', 1)">+1</button><button onclick="game.expandHardware('judge', 10)" class="btn-small">+10</button><button onclick="game.expandHardware('judge', 'max')" class="btn-small" style="background:#555">填满</button></div><div class="btn-group" style="margin-top:10px"><button onclick="game.expandHardware('disk', 1)">加硬盘 (+40GB)</button><button onclick="game.expandHardware('disk', 25)">加硬盘 (+1000GB)</button></div></div><div class="action-card"><h3>功能研发</h3><div id="rd-list"></div></div><div class="action-card"><h3>架构升级</h3><div class="card-desc">架构升级后,每个核心可额外容纳 100 活跃用户。</div><div style="font-size:0.85em; color:#aaa; margin-bottom:8px; line-height:1.5;">Web下级需求: <span id="disp-up-server-cost" style="color:#ffb74d"></span><br>评测下级需求: <span id="disp-up-judge-cost" style="color:#ffb74d"></span>10 行未改动<h4 style="margin-top:0">研发团队 (产出: <span id="out-rd">0</span>/月)</h4><button onclick="game.hire('rd_student')">高中生 ($1500, +20 研发)</button><button onclick="game.hire('rd_uni')">大学生 ($5000, +75 研发)</button><button onclick="game.hire('rd_full')">全职大牛 ($12000, +120 研发)</button><h4 style="margin-top:10px">学术团队 (产出: <span id="out-acad">0</span>/月)</h4><button onclick="game.hire('acad_part')">现役选手 ($500, +50 学术)</button><button onclick="game.hire('acad_full')">全职教练 ($15000, +400 学术)</button><h4 style="margin-top:10px">社区团队 (产出: <span id="out-comm">0</span>/月)</h4><button onclick="game.hire('comm_part')">兼职版主 ($500, +50 社区)</button><button onclick="game.hire('comm_full')">全职运营 ($7500, +400 社区)</button></div></div><!-- Edu Tab --><div id="tab-edu" class="panel"><div class="action-card"><h3>网校管理</h3><p style="font-size:0.85em; color:#aaa">研发[网校功能]后解锁。课程升级后带来更多收入,但升级成本也会增加。开课后有 3 个月冷却期。</p><div id="edu-list"></div></div></div><div id="log-area"><div class="log-entry" style="color:#4fc3f7">欢迎来到 OJ 运维模拟器!</div><div class="log-entry">请密切关注左侧的【下月预测】面板,避免破产。</div></div></div><script>const GAME_PARAMS = {INITIAL: { YEAR: 2013, MONTH: 1, MONEY: 5000, AP: 100, USERS: 50, SERVER_CORES: 2, JUDGE_CORES: 1, DISK_MB: 20480 },INCOME: { MONTHLY_GRANT: 500 },COSTS: {SERVER_CORE_RENT: 200, JUDGE_CORE_RENT: 200, DISK_BLOCK_RENT: 100, DISK_BLOCK_SIZE_GB: 40,ADD_PROBLEM_ACAD: 20, ADD_PROBLEM_BATCH_ACAD: 200,HIRE_AP: 10},HIRING: {rd_student: { name: "高中兼职", cost: 1500, gain: 20, limit: 5, type: 'rd' },rd_uni: { name: "大学兼职", cost: 5000, gain: 75, limit: 5, type: 'rd' },19 行未改动},USER_BEHAVIOR: {SUBMISSIONS: { normal: 15, active: 65, core: 300 },SOLUTIONS: { normal: 0.01, active: 1, core: 5 },GROWTH_FACTOR: 0.25,UPGRADE_N_A_BASE: 4, UPGRADE_N_A_MULT: 10, UPGRADE_A_C_MULT: 5},DISK_USAGE: { PROBLEM: 50, USER_DATA: 0.05, SUBMISSION: 0.002, SOLUTION: 0.005 },CLASSES: {17 行未改动total_solutions: 0,reputation: 0,last_month: { subs: 0, sols: 0 },consecutive_failure_months: 0,comm_fail_months: 0,pending_user_bonus: 0},hardware: {server_cores: GAME_PARAMS.INITIAL.SERVER_CORES, judge_cores: GAME_PARAMS.INITIAL.JUDGE_CORES,disk_extra_blocks: 0, disk_used: 0, server_arch: 1, judge_arch: 114 行未改动nextMonth: function() {this.date.month++;if (this.date.month > 12) { this.date.month = 1; this.date.year++; }ui.log(`=== ${this.date.year}年 ${this.date.month}月 ===`, 'log-warn');if (this.date.year >= 2026) { this.endGame(); return; }this.ap = 100;2 行未改动for (let k in this.staff) {let count = this.staff[k], conf = GAME_PARAMS.HIRING[k];if (count > 0) { salary += count * conf.cost; gain[conf.type] += count * conf.gain; }}this.money += GAME_PARAMS.INCOME.MONTHLY_GRANT;this.money -= salary;this.resources.rd += gain.rd; this.resources.acad += gain.acad; this.resources.comm += gain.comm;if(salary > 0) ui.log(`财务: 发放工资 ${salary}, 产出 R:${gain.rd} A:${gain.acad} C:${gain.comm}`);// Maintenancelet maintain_rd = 0;for (let k in GAME_PARAMS.FEATURES) if (this.features_unlocked[k]) maintain_rd += GAME_PARAMS.FEATURES[k].maintain;maintain_rd += 20 * (this.hardware.server_arch - 1);maintain_rd += 20 * (this.hardware.judge_arch - 1);this.resources.rd = Math.max(this.resources.rd - maintain_rd, 0);// 硬件租金计算let hw_cost = this.hardware.disk_extra_blocks * GAME_PARAMS.COSTS.DISK_BLOCK_RENT;hw_cost += this.hardware.server_cores * GAME_PARAMS.COSTS.SERVER_CORE_RENT;hw_cost += this.hardware.judge_cores * GAME_PARAMS.COSTS.JUDGE_CORE_RENT;this.money -= hw_cost;if(hw_cost > 0) ui.log(`财务: 硬件租金 ${hw_cost}`);// --- Load & API ---6 行未改动let server_cap = this.hardware.server_cores * server_cap_unit;let judge_cap = this.hardware.judge_cores * judge_cap_unit;let u = this.stats.users;// 负载倍率计算逻辑let load_multiplier = 0.8; // 默认0.8if ([2,7,8,10,11].includes(this.date.month)) {load_multiplier = 1.3;} else if ([1,9].includes(this.date.month)) {load_multiplier = 1.0;}let load = u.active + (u.normal / 3) + (u.core * 3);load *= load_multiplier;if (this.features_unlocked.api) {let total_u = u.normal + u.active + u.core;this.money += Math.floor(total_u * 1.0);}// --- Growth Logic ---let rep = this.stats.reputation;let total_users = u.normal + u.active + u.core;let pct_rate = (rep * 8 + 4) / 100;if (pct_rate < 0) pct_rate = 0;let growth_from_pct = total_users * pct_rate;let growth_from_fixed = (rep + 1) * 50;if (growth_from_fixed < 0) growth_from_fixed = 0;let new_users = Math.floor(growth_from_pct + growth_from_fixed);if (this.flags.contest_growth_mult !== 1.0) {new_users = Math.floor(new_users * this.flags.contest_growth_mult);this.flags.contest_growth_mult = 1.0;}// 讨论区新增1.1倍用户增长加成if (this.features_unlocked.discuss) {new_users = Math.floor(new_users * 1.05);}// 搬题奖励发放if (this.stats.pending_user_bonus > 0) {new_users += this.stats.pending_user_bonus;ui.log(`推广: 试题扩充吸引了额外 ${this.stats.pending_user_bonus} 名用户`);this.stats.pending_user_bonus = 0;}u.normal += new_users;if (new_users > 0) ui.log(`用户: 新增 ${new_users} 人`);// Flowlet prob_n2a = (rep * GAME_PARAMS.USER_BEHAVIOR.UPGRADE_N_A_MULT + GAME_PARAMS.USER_BEHAVIOR.UPGRADE_N_A_BASE) / 100;if (this.features_unlocked.difficulty) prob_n2a *= 1.1;if (this.features_unlocked.solution) prob_n2a *= 1.25;if (this.features_unlocked.discuss) prob_n2a *= 1.1;if (this.features_unlocked.team) prob_n2a *= 1.1;let delta_n2a = Math.floor(u.normal * prob_n2a);if (delta_n2a > 0) { u.normal -= delta_n2a; u.active += delta_n2a; }else { let delta_a2n = Math.floor(u.active * Math.abs(prob_n2a)); u.active -= delta_a2n; u.normal += delta_a2n; }let prob_a2c = (rep * GAME_PARAMS.USER_BEHAVIOR.UPGRADE_A_C_MULT) / 100;let delta_a2c = Math.floor(u.active * prob_a2c);8 行未改动(u.active * GAME_PARAMS.USER_BEHAVIOR.SUBMISSIONS.active) +(u.core * GAME_PARAMS.USER_BEHAVIOR.SUBMISSIONS.core);let subs_int = Math.floor(subs);this.stats.total_submissions += subs_int;this.stats.last_month.subs = subs_int;let sols = 0;// 修改点2:总题数为0时题解数强制为0let total_prob = this.stats.problems.high + this.stats.problems.mid + this.stats.problems.low;if (total_prob > 0 && this.features_unlocked.solution) {sols = (u.normal * GAME_PARAMS.USER_BEHAVIOR.SOLUTIONS.normal) +(u.active * GAME_PARAMS.USER_BEHAVIOR.SOLUTIONS.active) +(u.core * GAME_PARAMS.USER_BEHAVIOR.SOLUTIONS.core);}let sols_int = Math.floor(sols);this.stats.total_solutions += sols_int;this.stats.last_month.sols = sols_int;let p = this.stats.problems;total_prob = p.high + p.mid + p.low;let disk = (total_prob * GAME_PARAMS.DISK_USAGE.PROBLEM) +(total_users * GAME_PARAMS.DISK_USAGE.USER_DATA) +(this.stats.total_submissions * GAME_PARAMS.DISK_USAGE.SUBMISSION) +(this.stats.total_solutions * GAME_PARAMS.DISK_USAGE.SOLUTION);this.hardware.disk_used = disk;let disk_cap = GAME_PARAMS.INITIAL.DISK_MB + (this.hardware.disk_extra_blocks * GAME_PARAMS.COSTS.DISK_BLOCK_SIZE_GB * 1024);// System Failure Checklet is_disk_full = disk > disk_cap;let is_server_overload = load > server_cap;let is_judge_overload = load > judge_cap;if (is_disk_full) ui.log("? 硬盘已满!数据写入失败!", "log-bad");if (is_server_overload) ui.log("? Web服务器过载!", "log-bad");if (is_judge_overload) ui.log("? 评测机过载!", "log-bad");if (is_disk_full || is_server_overload || is_judge_overload) {this.stats.consecutive_failure_months++;ui.log(`?? 系统故障!连续故障月数: ${this.stats.consecutive_failure_months}/6`, "log-bad");if (this.stats.consecutive_failure_months >= 6) {alert("由于长期维护不善(连续6个月故障),您的 OJ 被视作关停。游戏结束。");document.getElementById('next-month-btn').disabled = true;return;}} else {if (this.stats.consecutive_failure_months > 0) {ui.log("? 系统状态已恢复正常,故障计数重置。", "log-good");}this.stats.consecutive_failure_months = 0;}// Needs & Replet acad_need = 0;if (this.features_unlocked.difficulty) acad_need += total_prob * 0.05;if (this.features_unlocked.solution) acad_need += total_prob * 0.1;// 社区维护需求公式调整let comm_need = 0;if (this.features_unlocked.discuss) {comm_need = (this.stats.users.core * 0.02) +(this.stats.users.active * 0.01) +(this.stats.users.normal * 0.003);}this.resources.acad -= acad_need;this.resources.comm -= comm_need;let acad_gap = (this.resources.acad < 0) ? Math.abs(this.resources.acad) : 0;let comm_gap = (this.resources.comm < 0) ? Math.abs(this.resources.comm) : 0;// 社区缺口统计if (comm_gap > 0) this.stats.comm_fail_months++;// 每年1月罚款逻辑if (this.date.month === 1 && this.stats.comm_fail_months >= 12 && total_users >= 10000) {let fine = total_users;this.money -= fine;ui.log(`?? 监管通知: 因长期社区维护不善,罚款 ${fine} 元!`, "log-bad");this.stats.comm_fail_months = 0;}let server_gap = Math.max(0, load - server_cap);let judge_gap = Math.max(0, load - judge_cap);this.calculateReputation(acad_gap, comm_gap, server_gap, judge_gap, total_prob);// Cooldownsfor(let k in this.class_state) if (this.class_state[k].cooldown > 0) this.class_state[k].cooldown--;if (this.flags.fundraising_penalty_val > 0) {this.flags.fundraising_penalty_val -= (0.2 / 12);if (this.flags.fundraising_penalty_val < 0) this.flags.fundraising_penalty_val = 0;}27 行未改动if (acad_gap > 0) r_stable -= Math.log10(acad_gap) / 20;if (comm_gap > 0) r_stable -= Math.log10(comm_gap) / 20;if (server_gap > 0) r_stable -= Math.log10(server_gap) / 10;if (judge_gap > 0) r_stable -= Math.log10(judge_gap) / 10;r_stable -= this.flags.fundraising_penalty_val;r_stable -= this.flags.temp_rep_penalty;let total = r_acad + r_users + r_edu + r_stable;if (total > 1) total = 1;this.stats.reputation = total;},3 行未改动this.ap -= 10; this.resources[target] += 10;ui.log(`行动: 10 AP -> 10 ${target}点`); ui.update();},convertAPAll: function(target) {if (this.ap < 10) {ui.log("AP不足(至少需要10点)", "log-bad");return;}const convertTimes = Math.floor(this.ap / 10);const apCost = convertTimes * 10;const resourceGain = convertTimes * 10;this.ap -= apCost;this.resources[target] += resourceGain;ui.log(`行动: ${apCost} AP -> ${resourceGain} ${target}点(剩余AP: ${this.ap})`, "log-good");ui.update();},addProblem: function(type) {// 基础加题if (type === 'high' || type === 'mid' || type === 'low') {if (this.resources.acad < GAME_PARAMS.COSTS.ADD_PROBLEM_ACAD) {ui.log("学术不足", "log-bad");return;}this.resources.acad -= GAME_PARAMS.COSTS.ADD_PROBLEM_ACAD;if (type === 'mid' || type === 'low') {let bonus = Math.floor(Math.random() * 41) + 10;this.stats.pending_user_bonus = (this.stats.pending_user_bonus || 0) + bonus;}if (type === 'high') this.stats.problems.high += 3;if (type === 'mid') this.stats.problems.mid += 10;if (type === 'low') { this.stats.problems.low += 20; this.stats.reputation -= 0.001; }ui.log(`题库: 增加 ${type} 试题`);}// 批量加题else if (type === 'high_batch' || type === 'mid_batch' || type === 'low_batch') {if (this.resources.acad < GAME_PARAMS.COSTS.ADD_PROBLEM_BATCH_ACAD) {ui.log("学术不足(需要200点)", "log-bad");return;}this.resources.acad -= GAME_PARAMS.COSTS.ADD_PROBLEM_BATCH_ACAD;// 批量题也有用户奖励if (type === 'mid_batch' || type === 'low_batch') {let bonus = Math.floor(Math.random() * 201) + 50;this.stats.pending_user_bonus = (this.stats.pending_user_bonus || 0) + bonus;}if (type === 'high_batch') {this.stats.problems.high += 30;ui.log(`题库: 批量增加高质量试题 (+30题)`);}if (type === 'mid_batch') {this.stats.problems.mid += 100;ui.log(`题库: 批量增加普通试题 (+100题)`);}if (type === 'low_batch') {this.stats.problems.low += 200;this.stats.reputation -= 0.01;ui.log(`题库: 批量增加低质量试题 (+200题),声誉小幅下降`, "log-warn");}}ui.update();},organizeContest: function(key) {let conf = GAME_PARAMS.CONTESTS[key];if (this.money < conf.cost || this.resources.acad < conf.acad) { ui.log("资源不足", "log-bad"); return; }this.money -= conf.cost; this.resources.acad -= conf.acad;if (conf.prob_mid) this.stats.problems.mid += conf.prob_mid;if (conf.prob_low) this.stats.problems.low += conf.prob_low;if (conf.prob_high) this.stats.problems.high += conf.prob_high;if (conf.rep_pen) this.flags.temp_rep_penalty += conf.rep_pen;if (conf.rep_gain) this.stats.reputation += conf.rep_gain;if (conf.growth_mult) this.flags.contest_growth_mult = conf.growth_mult;ui.log(`比赛: ${conf.name} (下月增长 x${conf.growth_mult})`); ui.update();},fundraising: function() {if (this.ap < 50) return;this.ap -= 50;let u = this.stats.users;let total_users = u.normal + u.active + u.core;// 修改点:新增随机数因子,范围 0.1 ~ 2let random_factor = Math.random() * 1.9 + 0.1; // 生成 0.1 到 2 之间的随机数let gain = Math.floor((this.stats.reputation + 1) * total_users * random_factor);if (gain < 0) gain = 0;this.money += gain;this.flags.fundraising_penalty_val += 0.2;ui.log(`募捐: 获得 ${gain} 元,声誉受损`, "log-bad"); ui.update();},6 行未改动ui.log(`招聘: ${conf.name}`); ui.update();},expandHardware: function(type, mode) {mode = mode || 1;if (type === 'disk') {let count = (typeof mode === 'number') ? mode : 1;this.hardware.disk_extra_blocks += count;ui.log(`硬件: 硬盘扩容 (+${count * 40}GB)`);ui.update();return;}let isServer = (type === 'server');let arch = isServer ? this.hardware.server_arch : this.hardware.judge_arch;let current = isServer ? this.hardware.server_cores : this.hardware.judge_cores;let limit_base = isServer ? 32 : 64;let limit = limit_base * arch;let count = 0;if (mode === 'max') {count = limit - current;} else {count = mode;}if (count <= 0) {ui.log("已达到架构上限,无法添加", "log-bad");return;}if (current + count > limit) {count = limit - current;if (count <= 0) {ui.log("核心数已达架构上限,请先升级架构", "log-bad");return;}}if (isServer) this.hardware.server_cores += count;else this.hardware.judge_cores += count;ui.log(`硬件: ${isServer?'Web':'评测'}核心 +${count}`);ui.update();},// 修改点1:升级架构耗费改为200研发+$500*核心数upgradeArch: function(type) {let isServer = (type === 'server');let currentCores = isServer ? this.hardware.server_cores : this.hardware.judge_cores;let costMoney = 500 * currentCores;// 新规则:研发点 = 200 + 50 × (当前架构等级 - 1)let currentArch = isServer ? this.hardware.server_arch : this.hardware.judge_arch;let costRD = 200 + 50 * (currentArch - 1);if (this.money < costMoney || this.resources.rd < costRD) {ui.log(`资源不足(需要$${costMoney} + ${costRD} 研发点)`, "log-bad");return;}this.money -= costMoney;this.resources.rd -= costRD;if (isServer) {this.hardware.server_arch++;ui.log(`研发: Web架构升级至Lv.${this.hardware.server_arch}`, "log-good");} else {this.hardware.judge_arch++;ui.log(`研发: 评测架构升级至Lv.${this.hardware.judge_arch}`, "log-good");}ui.update();},unlockFeature: function(id) {let f = GAME_PARAMS.FEATURES[id];if (this.money < f.cost || this.resources.rd < f.rd) { ui.log("资源不足", "log-bad"); return; }this.money -= f.cost; this.resources.rd -= f.rd;6 行未改动let conf = GAME_PARAMS.CLASSES[id], st = this.class_state[id];if (conf.season && !conf.season.includes(this.date.month)) { ui.log("季节不符 (需7-10月)", "log-bad"); return; }if (st.cooldown > 0) return;if (this.money < conf.req_money || this.resources.acad < conf.req_acad) { ui.log("无法开课 (资源不足)", "log-bad"); return; }this.money -= conf.req_money; this.resources.acad -= conf.req_acad;this.money += conf.inc_base * st.level; st.cooldown = 3;ui.log(`网校: ${conf.name} 开课`, "log-good"); ui.update();},upgradeClass: function(id) {let conf = GAME_PARAMS.CLASSES[id], st = this.class_state[id];if (st.level >= conf.max) return;let cm = conf.cost_base * st.level;let ca = conf.acad_base * st.level;if (this.money < cm || this.resources.acad < ca) { ui.log("升级资源不足", "log-bad"); return; }this.money -= cm; this.resources.acad -= ca; st.level++;ui.log(`网校: 升级 ${conf.name}`, "log-good"); ui.renderClasses(); ui.update();},endGame: function() {let u = this.stats.users, p = this.stats.problems;let base_score = (u.core/3) + (u.active/10) + (u.normal/100) + (3*p.high + p.mid - p.low) + (0.01 * this.stats.total_solutions);let final_score = base_score * (2 + this.stats.reputation) + (this.money / 20);score = final_score;alert(`游戏结束!最终得分: ${score.toFixed(2)}`);document.getElementById('next-month-btn').disabled = true;}};3 行未改动document.getElementById('disp-date').innerText = `${game.date.year}-${String(game.date.month).padStart(2,'0')}`;document.getElementById('disp-money').innerText = game.money;document.getElementById('disp-rep').innerText = game.stats.reputation.toFixed(3);document.getElementById('rep-bar').style.width = Math.max(0, Math.min(100, (game.stats.reputation + 1)/2*100)) + '%';document.getElementById('disp-ap').innerText = game.ap;document.getElementById('disp-rd').innerText = Math.floor(game.resources.rd);document.getElementById('disp-acad').innerText = Math.floor(game.resources.acad);document.getElementById('disp-comm').innerText = Math.floor(game.resources.comm);let u = game.stats.users;document.getElementById('disp-users-total').innerText = u.normal + u.active + u.core;let failSpan = document.getElementById('disp-fail-months');failSpan.innerText = `${game.stats.consecutive_failure_months} / 6`;failSpan.style.color = game.stats.consecutive_failure_months > 0 ? '#ff5252' : '#aaa';3 行未改动let p = game.stats.problems;document.getElementById('disp-prob-high').innerText = p.high;document.getElementById('disp-prob-mid').innerText = p.mid;document.getElementById('disp-prob-low').innerText = p.low;let disk_cap = GAME_PARAMS.INITIAL.DISK_MB + (game.hardware.disk_extra_blocks * GAME_PARAMS.COSTS.DISK_BLOCK_SIZE_GB * 1024);document.getElementById('disp-disk').innerText = `${(game.hardware.disk_used/1024).toFixed(1)} / ${(disk_cap/1024).toFixed(1)} GB`;document.getElementById('disp-server-core').innerText = game.hardware.server_cores;document.getElementById('disp-server-arch').innerText = game.hardware.server_arch;document.getElementById('disp-judge-core').innerText = game.hardware.judge_cores;document.getElementById('disp-judge-arch').innerText = game.hardware.judge_arch;// Load Calculationlet server_arch_bonus = (game.hardware.server_arch - 1) * 100;let server_cap_unit = 500 - (game.features_unlocked.team?50:0) - (game.features_unlocked.api?50:0) + server_arch_bonus;let s_cap = game.hardware.server_cores * server_cap_unit;let judge_arch_bonus = (game.hardware.judge_arch - 1) * 100;let judge_cap_unit = 500 + judge_arch_bonus;let j_cap = game.hardware.judge_cores * judge_cap_unit;let load_multiplier = 0.8;if ([2,7,8,10,11].includes(game.date.month)) {load_multiplier = 1.3;} else if ([1,9].includes(game.date.month)) {load_multiplier = 1.0;}let load = u.active + (u.normal/3) + (u.core*3);load *= load_multiplier;load = Math.floor(load);document.getElementById('disp-server-load').innerText = load;document.getElementById('disp-server-cap').innerText = s_cap;document.getElementById('disp-server-load').style.color = (load > s_cap) ? '#ff5252' : '#888';document.getElementById('disp-judge-load').innerText = load;document.getElementById('disp-judge-cap').innerText = j_cap;document.getElementById('disp-judge-load').style.color = (load > j_cap) ? '#ff5252' : '#888';// Forecastlet salary = 0;for (let k in game.staff) salary += game.staff[k] * GAME_PARAMS.HIRING[k].cost;let hw_cost = game.hardware.disk_extra_blocks * GAME_PARAMS.COSTS.DISK_BLOCK_RENT;hw_cost += game.hardware.server_cores * GAME_PARAMS.COSTS.SERVER_CORE_RENT;hw_cost += game.hardware.judge_cores * GAME_PARAMS.COSTS.JUDGE_CORE_RENT;let total_expense = salary + hw_cost;let api_income = 0;if (game.features_unlocked.api) api_income = Math.floor((u.normal+u.active+u.core) * 1.0);let total_income = GAME_PARAMS.INCOME.MONTHLY_GRANT + api_income;let m_rd = 0, m_acad = 0, m_comm = 0;for (let k in GAME_PARAMS.FEATURES) if (game.features_unlocked[k]) m_rd += GAME_PARAMS.FEATURES[k].maintain;m_rd += 20 * (game.hardware.server_arch - 1) + 20 * (game.hardware.judge_arch - 1);let total_prob = p.high + p.mid + p.low;if (game.features_unlocked.difficulty) m_acad += total_prob * 0.05;if (game.features_unlocked.solution) m_acad += total_prob * 0.1;if (game.features_unlocked.discuss) {m_comm = (game.stats.users.core * 0.02) +(game.stats.users.active * 0.01) +(game.stats.users.normal * 0.003);}document.getElementById('fc-income').innerText = `+${total_income}`;document.getElementById('fc-salary').innerText = `-${salary}`;document.getElementById('fc-maint').innerText = `-${hw_cost}`;let net = total_income - total_expense;let netEl = document.getElementById('fc-net');netEl.innerText = (net >= 0 ? '+' : '') + net;netEl.style.color = (net >= 0 ? '#69f0ae' : '#ff5252');document.getElementById('fc-rd-cost').innerText = m_rd;document.getElementById('fc-acad-cost').innerText = Math.floor(m_acad);document.getElementById('fc-comm-cost').innerText = Math.floor(m_comm);let banner = document.getElementById('warning-banner');banner.style.display = (game.money + net < 0) ? 'block' : 'none';if (game.money + net < 0) banner.innerText = `?? 严重警告:按当前收支,下个月将破产 (预计余额 ${game.money + net})!`;let staff = game.staff, h = GAME_PARAMS.HIRING;document.getElementById('out-rd').innerText = staff.rd_student*h.rd_student.gain + staff.rd_uni*h.rd_uni.gain + staff.rd_full*h.rd_full.gain;document.getElementById('out-acad').innerText = staff.acad_part*h.acad_part.gain + staff.acad_full*h.acad_full.gain;document.getElementById('out-comm').innerText = staff.comm_part*h.comm_part.gain + staff.comm_full*h.comm_full.gain;// 更新架构升级成本显示let s_cores = game.hardware.server_cores;let j_cores = game.hardware.judge_cores;let s_rd_cost = 200 + 50 * (game.hardware.server_arch - 1);let j_rd_cost = 200 + 50 * (game.hardware.judge_arch - 1);document.getElementById('disp-up-server-cost').innerText = `$${500 * s_cores} + ${s_rd_cost} 研发`;document.getElementById('disp-up-judge-cost').innerText = `$${500 * j_cores} + ${j_rd_cost} 研发`;ui.renderClasses();},log: function(msg, cls) {let div = document.createElement('div');div.className = 'log-entry ' + (cls||'');div.innerText = `[${game.date.year}-${game.date.month}] ` + msg;let area = document.getElementById('log-area');area.appendChild(div);area.scrollTop = area.scrollHeight;},switchTab: function(id) {document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));document.querySelectorAll('.panel').forEach(p => p.classList.remove('active'));document.querySelector(`.tab[onclick="ui.switchTab('${id}')"]`).classList.add('active');document.getElementById(`tab-${id}`).classList.add('active');},renderRD: function() {let list = document.getElementById('rd-list');list.innerHTML = '';for(let k in GAME_PARAMS.FEATURES) {let f = GAME_PARAMS.FEATURES[k];let div = document.createElement('div');div.className = 'edu-card';let header = document.createElement('div');header.className = 'edu-header';header.innerHTML = `${f.name} <span style="color:#ffb74d">$${f.cost} / ${f.rd} 研发</span>`;let desc = document.createElement('div');desc.style.fontSize = '0.85em';desc.style.margin = '8px 0';desc.innerText = f.desc;let btn = document.createElement('button');btn.innerText = game.features_unlocked[k] ? '已解锁' : '研发';btn.disabled = game.features_unlocked[k];if (!game.features_unlocked[k]) btn.onclick = () => game.unlockFeature(k);div.appendChild(header);div.appendChild(desc);div.appendChild(btn);list.appendChild(div);}},renderClasses: function() {let list = document.getElementById('edu-list');list.innerHTML = '';if (!game.features_unlocked.school) {list.innerHTML = '<div style="padding:10px; color:#aaa;">需先研发【网校功能】解锁</div>';return;}for(let k in GAME_PARAMS.CLASSES) {let conf = GAME_PARAMS.CLASSES[k], st = game.class_state[k];let div = document.createElement('div');div.className = 'edu-card';let header = document.createElement('div');header.className = 'edu-header';header.innerHTML = `${conf.name} Lv.${st.level} <span style="color:#ffb74d">收入: ${conf.inc_base * st.level}</span>`;let cost = document.createElement('div');cost.className = 'edu-cost';cost.innerHTML = `开课: $${conf.req_money} / ${conf.req_acad} 学术 | 升级: $${conf.cost_base * st.level} / ${conf.acad_base * st.level} 学术`;let actions = document.createElement('div');actions.className = 'edu-actions';let btnRun = document.createElement('button');btnRun.className = 'btn-run';btnRun.innerText = st.cooldown > 0 ? `冷却(${st.cooldown})` : '开课';btnRun.disabled = st.cooldown > 0;btnRun.onclick = () => game.runClass(k);let btnUp = document.createElement('button');btnUp.className = 'btn-up';btnUp.innerText = `升级 (max:${conf.max})`;btnUp.disabled = st.level >= conf.max;btnUp.onclick = () => game.upgradeClass(k);actions.appendChild(btnRun);actions.appendChild(btnUp);div.appendChild(header);div.appendChild(cost);div.appendChild(actions);list.appendChild(div);}}};// 初始化游戏game.init();</script></body></html>```