JavaScript must be enabled to play.
Browser lacks capabilities required to play.
Upgrade or switch to another browser.
Loading…
## <<if $lang == "cn">>🌌 欧罗巴二号:中央终端<<else>>🌌 Europa II: Central Terminal<</if>> <<if $lang == "cn">> [系统提示] 外部电磁风暴已达到最高阈值。殖民地生命维持系统离线。 [系统提示] 正在寻找数字架构师... 请输入你的架构师代号: <<else>> [System Prompt] The external electromagnetic storm has reached its maximum threshold. Colony life support systems are offline. [System Prompt] Looking for a digital architect... Please enter your Architect ID: <</if>> <<textbox "$playerName" "X">> <hr> <<if $lang == "cn">> <<button "▶️ 进入任务终端">> <<goto "UI">> <</button>> <<else>> <<button "▶️ Enter Mission Terminal">> <<goto "UI">> <</button>> <</if>>
<<set $energy to 100>> <<set $playerName to "">> /* 记录游戏启动时的确切时间(毫秒时间戳) */ <<set $startTime to Date.now()>> /* 设置默认语言,"cn"代表中文,"en"代表英文 */ <<set $lang to "cn">>
<<if $lang == "cn">> # 代号:恒星重燃 --- ⚡ 飞船剩余能源:@@color:yellow;$energy%@@ ⏱️ 游玩时长:<<print Math.floor((Date.now() - $startTime) / 60000)>> 分 <<print Math.floor(((Date.now() - $startTime) % 60000) / 1000)>> 秒 <<else>> # Project: Stellar Reign --- ⚡ Energy Left: @@color:yellow;$energy%@@ ⏱️ Playtime: <<print Math.floor((Date.now() - $startTime) / 60000)>>m <<print Math.floor(((Date.now() - $startTime) % 60000) / 1000)>>s <</if>> <div id="lang-btns" style="margin-top: 15px; margin-bottom: 25px;"> <<button "🇨🇳 中文">> <<set $lang to "cn">> /* passage() 代表当前卡片,这句话的意思是:改完变量后原地刷新页面 */ <<goto `passage()`>> <</button>> <<button "🇬🇧 English">> <<set $lang to "en">> <<goto `passage()`>> <</button>> </div>
<<if $lang == "cn">> <h2>🛠️ 核心系统重启序列设定</h2> <<else>> <h2>🛠️ Core System Reboot Sequence</h2> <</if>> <hr> <<if $lang == "cn">> [系统提示] 欢迎您,<strong>$playerName</strong>。 [主控AI] “架构师,在正式深入各扇区前,我们必须规划出一条严谨的重启路径。由于备用电能极其有限,如果启动顺序颠倒,系统将陷入死锁,甚至导致管线大面积烧毁。请仔细分析当前基地的状况。” <<else>> [System Prompt] Welcome, <strong>$playerName</strong>. [Main AI] "Architect, before we proceed into the sectors, we must plan a strict reboot sequence. Backup power is extremely limited. If the startup order is reversed, the system will deadlock or cause massive pipeline meltdowns. Please analyze the current base conditions carefully." <</if>> <div style="background-color: #0d1117; padding: 15px; border-left: 4px solid #8957e5; margin-bottom: 20px; font-size: 0.95em; line-height: 1.6;"> <<if $lang == "cn">> <strong>【灾后系统联动分析报告】</strong> * 武器矩阵的雷达扫图和主炮充能需要极其庞大且稳定的能量支撑。如果在核心供电不稳的情况下强行唤醒它,会导致全站停电。 * 发电机和水泵等物理设备必须先被手动激活,这是所有操作的源头。 * 仅仅激活设备还不够,未经过滤和防冲突处理的电涌与冷却液,如果直接涌入主控区会引发爆炸。必须先通过安全阀门进行路由和分配。 <<else>> <strong>【Post-Disaster System Synergy Report】</strong> * The weapon matrix's radar sweeps and main cannon charging require massive and stable energy. Forcing them online with unstable core power will cause a station-wide blackout. * Physical equipment like generators and water pumps must be manually activated first. This is the source of all operations. * Activating the hardware isn't enough. Unfiltered power surges and coolant will cause an explosion if routed directly into the main control area. They must first be routed and allocated through safety valves. <</if>> </div> <div style="background-color: #1e1e1e; padding: 15px; border-radius: 8px; border: 1px solid #444;"> <<if $lang == "cn">> 请通过下拉菜单,设定符合工程逻辑的重启顺序: 第一顺位 (源头唤醒):<<listbox "$seq1" autoselect>> <<option "请选择..." "none">> <<option "物理机房 (硬件检修与设备激活)" "room">> <<option "核心防御塔 (雷达索敌与火控矩阵)" "tower">> <<option "逻辑大门 (能源调度与管线防冲突)" "logic">> <</listbox>> 第二顺位 (安全传输):<<listbox "$seq2" autoselect>> <<option "请选择..." "none">> <<option "物理机房 (硬件检修与设备激活)" "room">> <<option "核心防御塔 (雷达索敌与火控矩阵)" "tower">> <<option "逻辑大门 (能源调度与管线防冲突)" "logic">> <</listbox>> 第三顺位 (终端执行):<<listbox "$seq3" autoselect>> <<option "请选择..." "none">> <<option "物理机房 (硬件检修与设备激活)" "room">> <<option "核心防御塔 (雷达索敌与火控矩阵)" "tower">> <<option "逻辑大门 (能源调度与管线防冲突)" "logic">> <</listbox>> <<else>> Please set the logical reboot sequence via the dropdown menus: 1st Priority (Source Awakening): <<listbox "$seq1" autoselect>> <<option "Please select..." "none">> <<option "Physical Server Room (Hardware & Activation)" "room">> <<option "Core Defense Tower (Radar & Fire Control)" "tower">> <<option "Logic Gate (Energy Routing & Collision)" "logic">> <</listbox>> 2nd Priority (Safe Transmission): <<listbox "$seq2" autoselect>> <<option "Please select..." "none">> <<option "Physical Server Room (Hardware & Activation)" "room">> <<option "Core Defense Tower (Radar & Fire Control)" "tower">> <<option "Logic Gate (Energy Routing & Collision)" "logic">> <</listbox>> 3rd Priority (Terminal Execution): <<listbox "$seq3" autoselect>> <<option "Please select..." "none">> <<option "Physical Server Room (Hardware & Activation)" "room">> <<option "Core Defense Tower (Radar & Fire Control)" "tower">> <<option "Logic Gate (Energy Routing & Collision)" "logic">> <</listbox>> <</if>> </div> <div id="alert-box" style="margin-top: 20px; min-height: 60px; font-weight: bold;"></div> <div id="btn-container"> <<if $lang == "cn">> <<button "▶️ 验证并注入重启序列">> <<if $seq1 == "none" or $seq2 == "none" or $seq3 == "none">> <<replace "#alert-box">><span style="color:orange">⚠️ 警告:序列不完整!请明确指定三个扇区的绝对启动顺序!</span><</replace>> <<elseif $seq1 == "room" and $seq2 == "logic" and $seq3 == "tower">> <<replace "#alert-box">> <span style="color:#2ea043">✅ 序列验证通过!因果关系严密,未发现死锁隐患。</span><br><br> <<button "🚀 开启物理机房大门">> <<goto "机房漫步">> <</button>> <</replace>> <<run $("#btn-container").hide()>> <<else>> <<set $energy -= 15>> <<if $energy <= 0>> <<goto "能源耗尽">> <<else>> <<run try { $("#story-caption").empty().wiki(Story.get("StoryCaption").processText()) } catch(e){} >> <<replace "#alert-box">> <span style="color:#f85149">💥 致命错误:重启序列存在逻辑悖论!管线过载导致能源泄漏。</span><br> ⚡ 扣除 15% 备用能源。当前剩余: <span style="color:yellow">$energy%</span><br> <span style="color:orange; font-size: 0.9em"> ⚠️ AI工程诊断: <<if $seq1 == "tower">> 怎么能在没有电的情况下先开枪?源头硬件还未启动! <<elseif $seq1 == "logic">> 你试图调度能源,但发电机和水泵(物理层)还没被唤醒,管线里空空如也! <<elseif $seq2 == "tower">> 你启动了发电机,却直接把狂暴的原始电流接入了防御塔!缺少中间的安全路由防冲突处理,主板差点烧毁! <<else>> 请重新思考“源头制造 -> 过程梳理 -> 终端使用”的工程学基本步骤。 <</if>> </span> <</replace>> <</if>> <</if>> <</button>> <<else>> <<button "▶️ Verify and Inject Reboot Sequence">> <<if $seq1 == "none" or $seq2 == "none" or $seq3 == "none">> <<replace "#alert-box">><span style="color:orange">⚠️ WARNING: Incomplete sequence! Please specify the absolute startup order for all three sectors!</span><</replace>> <<elseif $seq1 == "room" and $seq2 == "logic" and $seq3 == "tower">> <<replace "#alert-box">> <span style="color:#2ea043">✅ Sequence Verified! The causal chain is strict. No deadlock risks detected.</span><br><br> <<button "🚀 Open Physical Server Room Door">> <<goto "机房漫步">> <</button>> <</replace>> <<run $("#btn-container").hide()>> <<else>> <<set $energy -= 15>> <<if $energy <= 0>> <<goto "能源耗尽">> <<else>> <<run try { $("#story-caption").empty().wiki(Story.get("StoryCaption").processText()) } catch(e){} >> <<replace "#alert-box">> <span style="color:#f85149">💥 FATAL ERROR: Logical paradox in the reboot sequence! Pipeline overload caused an energy leak.</span><br> ⚡ 15% backup energy deducted. Current remaining: <span style="color:yellow">$energy%</span><br> <span style="color:orange; font-size: 0.9em"> ⚠️ AI Engineering Diagnostic: <<if $seq1 == "tower">> How can you fire a weapon without power? The source hardware hasn't been activated! <<elseif $seq1 == "logic">> You tried to route energy, but the generators and pumps (physical layer) haven't been awakened. The pipelines are empty! <<elseif $seq2 == "tower">> You started the generators but connected the violent raw current directly to the defense tower! Without intermediate safety routing, the motherboard almost fried! <<else>> Please rethink the basic engineering steps: "Source Generation -> Process Routing -> Terminal Usage". <</if>> </span> <</replace>> <</if>> <</if>> <</button>> <</if>> </div>
<style> .grid-container { display: grid; grid-template-columns: repeat(4, 60px); grid-template-rows: repeat(4, 60px); gap: 3px; margin: 5px 0; background-color: #30363d; padding: 5px; width: fit-content; border-radius: 8px; } .grid-cell { background-color: #0d1117; border: 1px solid #58a6ff; display: flex; justify-content: center; align-items: center; font-size: 30px; transition: all 0.3s; } .obstacle { background-color: #440000; border-color: #ff0000; } .target { background-color: #004400; border-color: #00ff00; } .robot-box { position: relative; } .direction-indicator { position: absolute; bottom: -5px; right: -5px; font-size: 14px; background: #000; border-radius: 50%; } .ct-btn { padding: 10px 18px; margin: 4px; font-size: 16px; font-weight: bold; color: white; border: none; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,0.2); transition: all 0.1s; } .ct-btn:active { transform: translateY(4px); box-shadow: 0 0 0 rgba(0,0,0,0.2); } .btn-forward { background-color: #4CAF50; } .btn-turn { background-color: #FF9800; } .btn-run { background-color: #9C27B0; margin-left: 20px; } .input-box { padding: 10px; font-size: 18px; border: 2px solid #58a6ff; border-radius: 6px; width: 280px; margin-bottom: 15px; background-color: #0d1117; color: #58a6ff !important; outline: none; font-family: monospace; font-weight: bold; letter-spacing: 2px; } </style> <div class="game-panel"> <<if $lang == "cn">> <h3>⚡ 系统提示:机房网格导航</h3> <p>目标:控制维修机器人 (🤖) 抵达服务器核心 (🎯)。避开高压电网 (⚡)!</p> <p>初始状态:机器人位于左上角,<strong>面朝右侧 (东方)</strong>。</p> <p>指令字典:<br> <code>F</code> (前进一格), <code>L</code> (原地左转90度), <code>R</code> (原地右转90度)</p> <div class="grid-container" id="map-grid"></div> <label style="color:#79c0ff; font-size: 18px; font-weight: bold;"> <span style="font-size:20px;">🤖</span> 输入指令序列(英文逗号隔开): </label> <br> <input type="text" id="code-input" class="input-box" value="F,R,L" placeholder="例如: F,R,L"> <button onclick="clearInput()">清空输入</button> <br> <button class="ct-btn btn-forward" onclick="controlRobot('F')">⬆️ 向前 (F)</button> <button class="ct-btn btn-turn" onclick="controlRobot('L')">↩️ 向左 (L)</button> <button class="ct-btn btn-turn" onclick="controlRobot('R')">↪️ 向右 (R)</button> <button class="ct-btn btn-run" id="run-btn" onclick="runAnimation()">▶️ 编译并执行</button> <div id="output-log" style="margin-top:15px; font-weight:bold; min-height:50px;"> [等待输入指令...] </div> <<else>> <h3>⚡ System Prompt: Server Room Grid Navigation</h3> <p>Goal: Guide the maintenance robot (🤖) to the server core (🎯). Avoid the high-voltage grids (⚡)!</p> <p>Initial State: Robot is at the top-left, <strong>facing Right (East)</strong>.</p> <p>Command Dictionary:<br> <code>F</code> (Forward 1 step), <code>L</code> (Turn Left 90°), <code>R</code> (Turn Right 90°)</p> <div class="grid-container" id="map-grid"></div> <label style="color:#79c0ff; font-size: 18px; font-weight: bold;"> <span style="font-size:20px;">🤖</span> Enter Command Sequence (comma-separated): </label> <br> <input type="text" id="code-input" class="input-box" value="F,R,L" placeholder="e.g.: F,R,L"> <button onclick="clearInput()">Clear Input</button> <br> <button class="ct-btn btn-forward" onclick="controlRobot('F')">⬆️ Forward (F)</button> <button class="ct-btn btn-turn" onclick="controlRobot('L')">↩️ Left (L)</button> <button class="ct-btn btn-turn" onclick="controlRobot('R')">↪️ Right (R)</button> <button class="ct-btn btn-run" id="run-btn" onclick="runAnimation()">▶️ Compile & Run</button> <div id="output-log" style="margin-top:15px; font-weight:bold; min-height:50px;"> [Waiting for commands...] </div> <</if>> </div> <script> // 1. 解决 sleep 重复声明报错的问题 (防止重新加载时出错) if (typeof window.sleep === "undefined") { window.sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); } // 2. 解决作用域隔离问题:将地图数据挂载到 window 全局,确保所有函数都能读取 window.mapData = [ [0, 1, 0, 2], [0, 0, 0, 0], [1, 0, 1, 0], [0, 0, 0, 0] ]; window.icons = { robot: "🤖", obstacle: "⚡", target: "🎯", empty: "" }; window.dirArrows = ["⬆️", "➡️", "⬇️", "⬅️"]; window.drawMap = function(rx, ry, rDir) { const grid = document.getElementById("map-grid"); if (!grid) return; grid.innerHTML = ""; for(let y = 0; y < 4; y++) { for(let x = 0; x < 4; x++) { let cellClass = "grid-cell"; let content = window.icons.empty; if (window.mapData[y][x] === 1) { cellClass += " obstacle"; content = window.icons.obstacle; } if (window.mapData[y][x] === 2) { cellClass += " target"; content = window.icons.target; } if (x === rx && y === ry) { content = `<div class="robot-box">${window.icons.robot}<span class="direction-indicator">${window.dirArrows[rDir]}</span></div>`; } let cell = document.createElement("div"); cell.className = cellClass; cell.innerHTML = content; grid.appendChild(cell); } } }; // 确保地图在 DOM 渲染完成后绘制 setTimeout(() => { window.drawMap(0, 0, 1); }, 50); window.runAnimation = async function() { const lang = SugarCube.State.variables.lang || "cn"; const inputElement = document.getElementById('code-input'); let commands = inputElement.value.replace(/,/g, ',').toUpperCase().split(","); let log = document.getElementById("output-log"); let btn = document.getElementById("run-btn"); btn.disabled = true; btn.innerText = lang === "cn" ? "⏳ 程序运行中..." : "⏳ Running..."; btn.style.backgroundColor = "#555"; log.style.color = "#c9d1d9"; let x = 0; let y = 0; let dir = 1; window.drawMap(x, y, dir); await window.sleep(500); let crashed = false; let success = false; const dx = [0, 1, 0, -1]; const dy = [-1, 0, 1, 0]; for(let i = 0; i < commands.length; i++) { let cmd = commands[i].trim(); if (!cmd) continue; log.innerHTML = lang === "cn" ? `⚙️ 正在执行指令 [${i+1}/${commands.length}]: <strong>${cmd}</strong>` : `⚙️ Executing [${i+1}/${commands.length}]: <strong>${cmd}</strong>`; if (cmd === "L") { dir = (dir + 3) % 4; } else if (cmd === "R") { dir = (dir + 1) % 4; } else if (cmd === "F") { x += dx[dir]; y += dy[dir]; } else { log.innerHTML = lang === "cn" ? `❌ 语法错误:未知指令 "${cmd}"。` : `❌ Syntax Error: Unknown command "${cmd}".`; crashed = true; break; } if (x < 0 || x > 3 || y < 0 || y > 3) { log.style.color = "red"; log.innerHTML = lang === "cn" ? "❌ 警告:机器人脱离机房轨道!" : "❌ WARNING: Robot went off the grid!"; crashed = true; break; } window.drawMap(x, y, dir); await window.sleep(800); if (window.mapData[y][x] === 1) { log.style.color = "red"; log.innerHTML = lang === "cn" ? "💥 致命错误:触碰高压电网,芯片烧毁!" : "💥 FATAL ERROR: Hit high-voltage grid, chip fried!"; crashed = true; break; } if (window.mapData[y][x] === 2) { success = true; break; } } if (success) { log.style.color = "green"; log.innerHTML = lang === "cn" ? "✅ 算法执行完美!机器人成功抵达核心!正在开启下一区域..." : "✅ Algorithm executed perfectly! Robot reached the core! Opening next sector..."; btn.innerText = lang === "cn" ? "正在跳转..." : "Transitioning..."; setTimeout(() => { SugarCube.Engine.play("机房漫步2"); }, 2000); } else { if (!crashed) { log.style.color = "orange"; log.innerHTML = lang === "cn" ? "⚠️ 程序结束:机器人停留在中途,未到达目标点。" : "⚠️ Program Ended: Robot stopped halfway, target not reached."; } SugarCube.State.variables.energy -= 20; let currentEnergy = SugarCube.State.variables.energy; if (currentEnergy <= 0) { log.innerHTML += lang === "cn" ? `<br>🔴 备用能源耗尽。系统即将关闭。` : `<br>🔴 Backup energy depleted. System shutting down.`; setTimeout(() => { SugarCube.Engine.play("能源耗尽"); }, 1500); } else { log.innerHTML += lang === "cn" ? `<br>⚡ 重置消耗 20% 能源。当前剩余: <span style="color:yellow">${currentEnergy}%</span>` : `<br>⚡ Reset consumed 20% energy. Remaining: <span style="color:yellow">${currentEnergy}%</span>`; try { $("#story-caption").empty().wiki(SugarCube.Story.get("StoryCaption").processText()); } catch (e) {} setTimeout(() => { window.drawMap(0, 0, 1); btn.disabled = false; btn.innerText = lang === "cn" ? "▶️ 重新编译并执行" : "▶️ Recompile & Execute"; btn.style.backgroundColor = "#238636"; }, 1500); } } }; window.controlRobot = function(val) { const inputElement = document.getElementById('code-input'); let currentValue = inputElement.value.trim(); if (currentValue.length > 0 && !currentValue.endsWith(',')) { currentValue += ','; } currentValue += val; inputElement.value = currentValue; }; window.clearInput = function() { document.getElementById('code-input').value = ''; }; </script>
<<if $lang == "cn">> <h2>📋 任务面板</h2> <hr> 欢迎登入,<strong>$playerName</strong>。情况非常紧急。 <h4 style="color: #f85149;">⚠️ 警告:每次发送错误的指令或编译失败,都会消耗飞船备用能源。当能源归零,殖民地将彻底冻结。</h4> 你当前的能源为 <strong>$energy%</strong>。 <br><br> <<button "▶️ 进入任务简报">> <<goto "任务简报">> <</button>> <<else>> <h2>📋 Mission Panel</h2> <hr> Welcome aboard, <strong>$playerName</strong>. The situation is highly critical. <h4 style="color: #f85149;">⚠️ WARNING: Every incorrect command or compilation failure will consume the ship's backup energy. When the energy reaches zero, the colony will freeze completely.</h4> Your current energy level is <strong>$energy%</strong>. <br><br> <<button "▶️ Enter Mission Briefing">> <<goto "任务简报">> <</button>> <</if>>
<style> .grid-container { display: grid; grid-template-columns: repeat(6, 60px); grid-template-rows: repeat(6, 60px); gap: 3px; margin: 15px 0; background-color: #30363d; padding: 5px; width: fit-content; border-radius: 8px; } .grid-cell { background-color: #0d1117; border: 1px solid #58a6ff; display: flex; justify-content: center; align-items: center; font-size: 30px; transition: all 0.3s; } .obstacle { background-color: #440000; border-color: #ff0000; } .target { background-color: #004400; border-color: #00ff00; } .waypoint { background-color: #003366; border-color: #0088ff; } /* 给途径点加一点底色区分 */ .robot-box { position: relative; } .direction-indicator { position: absolute; bottom: -5px; right: -5px; font-size: 14px; background: #000; border-radius: 50%; } .ct-btn { padding: 10px 18px; margin: 4px; font-size: 16px; font-weight: bold; color: white; border: none; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,0.2); transition: all 0.1s; } .ct-btn:active { transform: translateY(4px); box-shadow: 0 0 0 rgba(0,0,0,0.2); } .btn-forward { background-color: #4CAF50; } .btn-turn { background-color: #FF9800; } .btn-run { background-color: #9C27B0; margin-left: 20px; } .input-box { padding: 10px; font-size: 18px; border: 2px solid #58a6ff; border-radius: 6px; width: 280px; margin-bottom: 15px; background-color: #0d1117; color: #58a6ff !important; outline: none; font-family: monospace; font-weight: bold; letter-spacing: 2px; } </style> <div class="game-panel"> <<if $lang == "cn">> <h3>⚡ 系统提示:机房网格导航</h3> <p>目标:控制维修机器人 (🤖) 抵达服务器核心 (🎯)。避开高压电网 (⚡)!不要忘记经过途径点 (🚩)。<br> <strong>⚠️ 注意:由于内存损坏,指令总数不得超过 20 条。</strong></p> <p>初始状态:机器人位于左上角,<strong>面朝右侧 (东方)</strong>。</p> <p>指令字典:<br> <code>F</code> (前进一格), <code>L</code> (原地左转90度), <code>R</code> (原地右转90度)</p> <div class="grid-container" id="map-grid"></div> <label style="color:#79c0ff; font-size: 18px; font-weight: bold;"> <span style="font-size:20px;">🤖</span> 输入指令序列(英文逗号隔开): </label> <br> <input type="text" id="code-input" class="input-box" value="F,R,L" placeholder="例如: F,R,L"> <button onclick="clearInput()">清空输入</button> <br> <button class="ct-btn btn-forward" onclick="controlRobot('F')">⬆️ 向前 (F)</button> <button class="ct-btn btn-turn" onclick="controlRobot('L')">↩️ 向左 (L)</button> <button class="ct-btn btn-turn" onclick="controlRobot('R')">↪️ 向右 (R)</button> <button class="ct-btn btn-run" id="run-btn" onclick="runAnimation()">▶️ 编译并执行</button> <div id="output-log" style="margin-top:15px; font-weight:bold; min-height:50px;"> [等待输入指令...] </div> <<else>> <h3>⚡ System Prompt: Server Room Grid Navigation</h3> <p>Goal: Guide the maintenance robot (🤖) to the server core (🎯). Avoid high-voltage grids (⚡)! Do not forget to pass through the waypoint (🚩).<br> <strong>⚠️ Note: Due to memory corruption, commands cannot exceed 20.</strong></p> <p>Initial State: Robot is at the top-left, <strong>facing Right (East)</strong>.</p> <p>Command Dictionary:<br> <code>F</code> (Forward 1 step), <code>L</code> (Turn Left 90°), <code>R</code> (Turn Right 90°)</p> <div class="grid-container" id="map-grid"></div> <label style="color:#79c0ff; font-size: 18px; font-weight: bold;"> <span style="font-size:20px;">🤖</span> Enter Command Sequence (comma-separated): </label> <br> <input type="text" id="code-input" class="input-box" value="F,R,L" placeholder="e.g.: F,R,L"> <button onclick="clearInput()">Clear Input</button> <br> <button class="ct-btn btn-forward" onclick="controlRobot('F')">⬆️ Forward (F)</button> <button class="ct-btn btn-turn" onclick="controlRobot('L')">↩️ Left (L)</button> <button class="ct-btn btn-turn" onclick="controlRobot('R')">↪️ Right (R)</button> <button class="ct-btn btn-run" id="run-btn" onclick="runAnimation()">▶️ Compile & Run</button> <div id="output-log" style="margin-top:15px; font-weight:bold; min-height:50px;"> [Waiting for commands...] </div> <</if>> </div> <script> setTimeout(() => { const mapData = [ [0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0], [1, 0, 1, 0, 0, 0], [0, 1, 0, 0, 1, 0], [0, 2, 0, 0, 0, 3], [0, 0, 0, 1, 0, 0] ]; const icons = { robot: "🤖", obstacle: "⚡", target: "🎯", waypoint: "🚩", empty: "" }; const dirArrows = ["⬆️", "➡️", "⬇️", "⬅️"]; // 0:上, 1:右, 2:下, 3:左 let requiredNum = 20; window.drawMap = function(rx, ry, rDir) { const grid = document.getElementById("map-grid"); if(!grid) return; grid.innerHTML = ""; for(let y = 0; y < 6; y++) { for(let x = 0; x < 6; x++) { let cell = document.createElement("div"); cell.className = "grid-cell"; if (mapData[y][x] === 1) cell.classList.add("obstacle"); if (mapData[y][x] === 2) cell.classList.add("target"); if (mapData[y][x] === 3) cell.classList.add("waypoint"); if (x === rx && y === ry) { cell.innerHTML = `<div class="robot-box">${icons.robot}<span class="direction-indicator">${dirArrows[rDir]}</span></div>`; } else if (mapData[y][x] === 1) { cell.innerHTML = icons.obstacle; } else if (mapData[y][x] === 2) { cell.innerHTML = icons.target; } else if (mapData[y][x] === 3) { cell.innerHTML = icons.waypoint; } grid.appendChild(cell); } } }; drawMap(0, 0, 1); const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); window.runAnimation = async function() { const lang = SugarCube.State.variables.lang || "cn"; let rawInput = document.getElementById("code-input").value; let commands = rawInput.replace(/,/g, ',').toUpperCase().split(","); // 过滤掉空白指令,让长度计算更精准 commands = commands.filter(cmd => cmd.trim() !== ""); let log = document.getElementById("output-log"); let btn = document.getElementById("run-btn"); btn.disabled = true; btn.innerText = lang === "cn" ? "⏳ 程序运行中..." : "⏳ Running..."; btn.style.backgroundColor = "#555"; log.style.color = "#c9d1d9"; let crashed = false; let success = false; let passed = false; let ended = false; // 指令数量超限判断 if (commands.length > requiredNum){ log.style.color = "red"; log.innerHTML = lang === "cn" ? `💥 内存溢出:检测到 ${commands.length} 条指令,已超过 ${requiredNum} 条上限!` : `💥 Memory Overflow: ${commands.length} commands detected, exceeding the limit of ${requiredNum}!`; document.getElementById('code-input').value = ''; commands = []; crashed = true; } let x = 0; let y = 0; let dir = 1; if(!crashed) { drawMap(x, y, dir); await sleep(500); } const dx = [0, 1, 0, -1]; const dy = [-1, 0, 1, 0]; for(let i = 0; i < commands.length; i++) { let cmd = commands[i].trim(); log.innerHTML = lang === "cn" ? `⚙️ 正在执行指令 [${i+1}/${commands.length}]: <strong>${cmd}</strong>` : `⚙️ Executing [${i+1}/${commands.length}]: <strong>${cmd}</strong>`; if (cmd === "L") { dir = (dir + 3) % 4; } else if (cmd === "R") { dir = (dir + 1) % 4; } else if (cmd === "F") { x += dx[dir]; y += dy[dir]; } else { log.style.color = "red"; log.innerHTML = lang === "cn" ? `❌ 语法错误:未知指令 "${cmd}"。` : `❌ Syntax Error: Unknown command "${cmd}".`; crashed = true; break; } if (x < 0 || x > 5 || y < 0 || y > 5) { log.style.color = "red"; log.innerHTML = lang === "cn" ? "❌ 警告:机器人脱离机房轨道!" : "❌ WARNING: Robot went off the grid!"; crashed = true; break; } drawMap(x, y, dir); await sleep(800); if (mapData[y][x] === 1) { log.style.color = "red"; log.innerHTML = lang === "cn" ? "💥 致命错误:触碰高压电网,芯片烧毁!" : "💥 FATAL ERROR: Hit high-voltage grid, chip fried!"; crashed = true; break; } if (mapData[y][x] === 3) { passed = true; } if (mapData[y][x] === 2) { if (passed) { success = true; ended = true; break; } else { log.style.color = "orange"; log.innerHTML = lang === "cn" ? "⚠️ 路径非法:未扫描途径点(🚩)的数据缓存!" : "⚠️ Invalid Path: Waypoint (🚩) cache not scanned!"; ended = true; break; } } } if (success) { log.style.color = "green"; log.innerHTML = lang === "cn" ? "✅ 算法执行完美!机器人成功抵达核心!正在开启下一区域..." : "✅ Algorithm executed perfectly! Robot reached the core! Opening next sector..."; btn.innerText = lang === "cn" ? "正在跳转..." : "Transitioning..."; setTimeout(() => { SugarCube.Engine.play("逻辑大门1"); }, 2000); } else { if (!crashed && !ended) { log.style.color = "orange"; log.innerHTML = lang === "cn" ? "⚠️ 程序结束:机器人停留在中途,未到达目标点。" : "⚠️ Program Ended: Robot stopped halfway, target not reached."; } SugarCube.State.variables.energy -= 20; let currentEnergy = SugarCube.State.variables.energy; if (currentEnergy <= 0) { log.innerHTML += lang === "cn" ? `<br>🔴 备用能源耗尽。系统即将关闭。` : `<br>🔴 Backup energy depleted. System shutting down.`; setTimeout(() => { SugarCube.Engine.play("能源耗尽"); }, 1500); setTimeout(() => { SugarCube.Engine.play("UI"); }, 1500); } else { log.innerHTML += lang === "cn" ? `<br>⚡ 重置消耗 20% 能源。当前剩余: <span style="color:yellow">${currentEnergy}%</span>` : `<br>⚡ Reset consumed 20% energy. Remaining: <span style="color:yellow">${currentEnergy}%</span>`; try { $("#story-caption").empty().wiki(SugarCube.Story.get("StoryCaption").processText()); } catch (e) {} setTimeout(() => { drawMap(0, 0, 1); btn.disabled = false; btn.innerText = lang === "cn" ? "▶️ 重新编译并执行" : "▶️ Recompile & Execute"; btn.style.backgroundColor = "#238636"; }, 1500); } } }; window.controlRobot = function(val) { const inputElement = document.getElementById('code-input'); let currentValue = inputElement.value.trim(); if (currentValue.length > 0 && !currentValue.endsWith(',')) { currentValue += ','; } currentValue += val; inputElement.value = currentValue; }; window.clearInput = function() { document.getElementById('code-input').value = ''; }; }, 50); </script>
<<if $lang == "cn">> <h2>🗼 最终扇区:防御塔前哨站</h2> <<else>> <h2>🗼 Final Sector: Defense Tower Outpost</h2> <</if>> <hr> <<if $lang == "cn">> <p>[系统提示] 能源汇聚完成!防御系统主板已点亮。<br> [主控AI] “干得漂亮 <strong>$playerName</strong>!底层逻辑已经打通,但由于之前的电磁脉冲干扰,自动索敌模块依然处于离线状态。屏幕上现在充斥着各种历史缓存和无关系统的报告。<br> 我们要重启下一层的火力矩阵,必须从下面这堆乱码日志中,提取两个核心参数:<br> 第一,用于锁定异星生物的<strong>【活跃的生物共振频率】</strong>;<br> 第二,用于强制启动武器系统的<strong>【矩阵重载码】</strong>。<br> 请忽略通信频道、普通登录口令和已过期的缓存数据。记住,这就是计算思维中的<strong>「抽象 (Abstraction)」</strong>——剥离干扰,直击本质。”</p> <<else>> <p>[System] Power convergence complete! Defense system motherboard illuminated.<br> [AI] "Great job, Architect <strong>$playerName</strong>! The underlying logic is clear, but due to earlier EMP interference, the auto-targeting module is still offline. The screen is now flooded with historical cache and irrelevant system reports.<br> To reboot the fire control matrix on the next level, we must extract two core parameters from this jumbled log:<br> First, the <strong>[Active Bio-Resonance Frequency]</strong> used to lock onto alien lifeforms;<br> Second, the <strong>[Matrix Override Code]</strong> to force-start the weapon systems.<br> Ignore communication channels, standard login passwords, and expired cache data. Remember, this is <strong>'Abstraction'</strong> in computational thinking—stripping away interference to hit the essence."</p> <</if>> <div style="background-color: #0d1117; color: #58a6ff; padding: 15px; border-left: 4px solid #30363d; font-family: monospace; margin-bottom: 20px; font-size: 0.9em; line-height: 1.6;"> <<if $lang == "cn">> <strong>【拦截到的受损原始数据流】</strong><br> [LOG_1011] SYSTEM_TEMP: -45°C - 冷却液循环速率 85%.<br> [LOG_1012] COMM_FREQ: 144.5 MHz - 频道静默,无生命信号.<br> [LOG_1013] AUTH_KEY: ADMIN-123 - 终端常规登录口令已验证.<br> [LOG_1014] SENSOR_SWARM_DETECTED: 发现多足节肢类异星生物.<br> [LOG_1015] RESONANCE_FREQ_CACHED: 88.2 Hz - (已过期/EXPIRED).<br> [LOG_1016] OXYGEN_LEVEL: 18% - 正在持续下降,请注意.<br> [LOG_1017] OVERRIDE_CODE_PREV: OMEGA-1 - (失效/INVALID).<br> [LOG_1018] ERROR_CODE: 0x88A1 - 炮塔转向齿轮卡顿.<br> [LOG_1019] BIO_RESONANCE_FREQ_ACTIVE: 104.7 Hz - (锁定/LOCKED).<br> [LOG_1020] CHAT_LOG: "谁把扳手落在三号发电机上了?"<br> [LOG_1021] MATRIX_OVERRIDE_CODE: NEBULA-7 - (待命/STANDBY).<br> [LOG_1022] THREAT_LEVEL: CRITICAL - 预计接触时间 45 秒.<br> <<else>> <strong>[Intercepted Damaged Raw Data Stream]</strong><br> [LOG_1011] SYSTEM_TEMP: -45°C - Coolant circulation rate 85%.<br> [LOG_1012] COMM_FREQ: 144.5 MHz - Channel silent, no life signals.<br> [LOG_1013] AUTH_KEY: ADMIN-123 - Terminal standard login verified.<br> [LOG_1014] SENSOR_SWARM_DETECTED: Multi-legged arthropod alien lifeform detected.<br> [LOG_1015] RESONANCE_FREQ_CACHED: 88.2 Hz - (Expired/EXPIRED).<br> [LOG_1016] OXYGEN_LEVEL: 18% - Continuing to drop, please note.<br> [LOG_1017] OVERRIDE_CODE_PREV: OMEGA-1 - (Invalid/INVALID).<br> [LOG_1018] ERROR_CODE: 0x88A1 - Turret turning gear stuck.<br> [LOG_1019] BIO_RESONANCE_FREQ_ACTIVE: 104.7 Hz - (Locked/LOCKED).<br> [LOG_1020] CHAT_LOG: "Who left the wrench on generator three?"<br> [LOG_1021] MATRIX_OVERRIDE_CODE: NEBULA-7 - (Standby/STANDBY).<br> [LOG_1022] THREAT_LEVEL: CRITICAL - Estimated contact time 45 seconds.<br> <</if>> </div> <<if $lang == "cn">> <p>请过滤干扰变量,输入正确的参数:</p> 1. 活跃的生物共振频率 (仅输入数值):<br> <<textbox "$freqInput" "">><br><br> 2. 矩阵重载码 (大写字母与数字):<br> <<textbox "$codeInput" "">><br> <<else>> <p>Filter the interference variables and enter the correct parameters:</p> 1. Active Bio-Resonance Frequency (numeric only):<br> <<textbox "$freqInput" "">><br><br> 2. Matrix Override Code (uppercase letters and numbers):<br> <<textbox "$codeInput" "">><br> <</if>> <div id="tower-alert" style="margin-top: 20px; min-height: 60px; font-weight: bold;"></div> <div id="btn-container"> <<if $lang == "cn">> <<set _btnText = "⚡ 编译模型并解锁内部火控">> <<else>> <<set _btnText = "⚡ Compile Model & Unlock Fire Control">> <</if>> <<button _btnText>> /* 数据清洗:去掉玩家可能不小心输入的空格或单位(Hz) */ <<set $freqInput = $freqInput.toUpperCase().replace("HZ", "").trim()>> <<set $codeInput = $codeInput.trim().toUpperCase()>> /* 核心校验逻辑 */ <<if $freqInput == "104.7" and $codeInput == "NEBULA-7">> <<if $lang == "cn">> <<replace "#tower-alert">> <span style="color:#2ea043">✅ 模型编译成功!完美过滤了缓存频率和普通密钥。前哨站已解锁!</span><br><br> <<button "🚀 突入内部:终极火控矩阵">> <<goto "核心防御塔-终极火控">> <</button>> <</replace>> <<else>> <<replace "#tower-alert">> <span style="color:#2ea043">✅ Compilation successful! Perfectly filtered cached frequencies and standard keys. Outpost unlocked!</span><br><br> <<button "🚀 Breach Interior: Ultimate Fire Control Matrix">> <<goto "核心防御塔-终极火控">> <</button>> <</replace>> <</if>> <<run $("#btn-container").hide()>> <<else>> /* 错误扣血逻辑 */ <<set $energy -= 15>> <<if $energy <= 0>> <<goto "能源耗尽">> <<else>> /* 刷新左侧边栏 */ <<run try { $("#story-caption").empty().wiki(Story.get("StoryCaption").processText()) } catch(e){} >> /* 针对常见错误的动态提示系统双语版 */ <<if $lang == "cn">> <<replace "#tower-alert">> <span style="color:#f85149">💥 致命错误:引入了错误的变量,防御塔发生死锁!</span><br> ⚡ 扣除 15% 备用能源。当前剩余: <span style="color:yellow">$energy%</span><br> <<if $freqInput == "144.5" or $freqInput == "88.2">> <span style="color:orange; font-size: 0.9em">⚠️ AI诊断:你提取了通讯频率或【已过期】的缓存频率,请寻找【活跃(ACTIVE)】的生物频率。</span> <<elseif $codeInput == "ADMIN-123" or $codeInput == "OMEGA-1">> <span style="color:orange; font-size: 0.9em">⚠️ AI诊断:你使用了普通终端密钥或【已失效】的代码。防御塔需要专属的【矩阵重载码】。</span> <<else>> <span style="color:gray; font-size: 0.9em">⚠️ AI诊断:请逐行审阅原始数据,区分变量的命名(如 CACHED 缓存 vs ACTIVE 活跃)。</span> <</if>> <</replace>> <<else>> <<replace "#tower-alert">> <span style="color:#f85149">💥 Fatal Error: Incorrect variables introduced, tower deadlocked!</span><br> ⚡ Deducted 15% backup energy. Remaining: <span style="color:yellow">$energy%</span><br> <<if $freqInput == "144.5" or $freqInput == "88.2">> <span style="color:orange; font-size: 0.9em">⚠️ AI Diagnosis: You extracted the comm freq or [EXPIRED] cache freq. Look for the [ACTIVE] bio-frequency.</span> <<elseif $codeInput == "ADMIN-123" or $codeInput == "OMEGA-1">> <span style="color:orange; font-size: 0.9em">⚠️ AI Diagnosis: You used a standard terminal key or [INVALID] code. The tower requires a dedicated [Matrix Override Code].</span> <<else>> <span style="color:gray; font-size: 0.9em">⚠️ AI Diagnosis: Review the raw data line by line. Note the variable naming (e.g., CACHED vs ACTIVE).</span> <</if>> <</replace>> <</if>> <</if>> <</if>> <</button>> </div>
<style> /* 必须显式声明电路板的尺寸和相对定位,否则内部的绝对定位会全部乱套 */ .circuit-board { position: relative; width: 100%; height: 400px; background-color: #0d1117; border-radius: 8px; margin: 15px 0; overflow: hidden; /* 防止连线溢出 */ box-shadow: inset 0 0 10px rgba(0,0,0,0.5); } .c-node { position: absolute; background-color: #161b22; color: #c9d1d9; padding: 8px 10px; border-radius: 6px; font-size: 13px; font-weight: bold; z-index: 2; box-shadow: 0 4px 6px rgba(0,0,0,0.3); width: 120px; /* 固定宽度,防止中英文长度不同导致节点中心偏移 */ box-sizing: border-box; line-height: 1.4; } .c-gate { position: absolute; padding: 6px; background: #21262d; color: #58a6ff; border: 1px solid #58a6ff; border-radius: 4px; font-weight: bold; z-index: 2; cursor: pointer; outline: none; } /* 修复 SVG 黑块问题的关键:显式声明 fill: none */ .anim-pipe { stroke-width: 6; fill: none; stroke-dasharray: 10; opacity: 0; } .anim-pipe.flow { opacity: 1; animation: pipeFlow 1s linear infinite; } @keyframes pipeFlow { to { stroke-dashoffset: -20; } } </style> <div class="game-panel"> <<if $lang == "cn">> <h2>🔐 第三扇区:反应堆底层逻辑枢纽</h2> <hr> <p>[系统提示] 警告:您已抵达反应堆主控总线。<br> [主控AI] “由于增加了冷却水泵网络,这里被分为了【物理层】和【总控层】。请注意新增的防冲突协议。”</p> <div style="background-color: #1e1e1e; padding: 10px 15px; border-left: 4px solid #d2a8ff; margin-bottom: 20px; font-size: 0.9em; line-height: 1.6;"> <strong>⚙️ 高级组件库补充:</strong><br> ▪ <strong>AND (与门):</strong>所有输入必须都为真 (1),输出才为真。用于总控层合并两路关键信号。<br> ▪ <strong>XOR (异或门):</strong>输入必须【互斥】(一个真一个假),输出才为真。<strong>专门用于防止两个设备同时启动引发事故。</strong><br> <span style="color:#f85149">⚠️ 核心协议:总控门 (Gate 4) 必须严格验证【能源】与【冷却】都已到位!</span> </div> <<else>> <h2>🔐 Sector 3: Reactor Logic Hub</h2> <hr> <p>[System] Warning: You have arrived at the Reactor Main Bus.<br> [AI] "With the addition of the coolant pumps, this network is split into [Physical] and [Master] layers. Beware of the conflict-prevention protocols."</p> <div style="background-color: #1e1e1e; padding: 10px 15px; border-left: 4px solid #d2a8ff; margin-bottom: 20px; font-size: 0.9em; line-height: 1.6;"> <strong>⚙️ Advanced Components:</strong><br> ▪ <strong>AND Gate:</strong> ALL inputs must be True (1). Used in the master layer to enforce mandatory dual signals.<br> ▪ <strong>XOR Gate:</strong> Inputs must be MUTUALLY EXCLUSIVE (One True, One False). <strong>Prevents critical equipment collision.</strong><br> <span style="color:#f85149">⚠️ Protocol: Gate 4 MUST verify BOTH Power AND Coolant are active!</span> </div> <</if>> <div class="circuit-board"> <svg width="100%" height="100%" style="position:absolute; top:0; left:0; z-index:1;"> <path d="M 100 40 L 140 40 L 140 55 L 180 55" stroke="#333" stroke-width="8" fill="none" /> <path d="M 100 100 L 140 100 L 140 75 L 180 75" stroke="#333" stroke-width="8" fill="none" /> <path d="M 100 180 L 140 180 L 140 195 L 180 195" stroke="#333" stroke-width="8" fill="none" /> <path d="M 100 240 L 140 240 L 140 215 L 180 215" stroke="#333" stroke-width="8" fill="none" /> <path d="M 100 340 L 180 340" stroke="#333" stroke-width="8" fill="none" /> <path d="M 245 60 L 320 60 L 320 125 L 360 125" stroke="#333" stroke-width="8" fill="none" /> <path d="M 245 200 L 320 200 L 320 145 L 360 145" stroke="#333" stroke-width="8" fill="none" /> <path d="M 425 135 L 480 135" stroke="#333" stroke-width="8" fill="none" /> <path d="M 245 340 L 480 340" stroke="#333" stroke-width="8" fill="none" /> <path id="p-in-1a" d="M 100 40 L 140 40 L 140 55 L 180 55" class="anim-pipe" fill="none"/> <path id="p-in-1b" d="M 100 100 L 140 100 L 140 75 L 180 75" class="anim-pipe" fill="none"/> <path id="p-in-2a" d="M 100 180 L 140 180 L 140 195 L 180 195" class="anim-pipe" fill="none"/> <path id="p-in-2b" d="M 100 240 L 140 240 L 140 215 L 180 215" class="anim-pipe" fill="none"/> <path id="p-in-3" d="M 100 340 L 180 340" class="anim-pipe" fill="none"/> <path id="p-out-1" d="M 245 60 L 320 60 L 320 125 L 360 125" class="anim-pipe" fill="none"/> <path id="p-out-2" d="M 245 200 L 320 200 L 320 145 L 360 145" class="anim-pipe" fill="none"/> <path id="p-out-4" d="M 425 135 L 480 135" class="anim-pipe" fill="none"/> <path id="p-out-3" d="M 245 340 L 480 340" class="anim-pipe" fill="none"/> </svg> <div class="c-node" style="top:20px; left:20px; border-left: 4px solid #f85149;"> <<if $lang == "cn">>主供电<br><span style="color:#f85149; font-size:0.85em;">(离线 / 0)</span><<else>>Main Pwr<br><span style="color:#f85149; font-size:0.85em;">(Offline/0)</span><</if>> </div> <div class="c-node" style="top:80px; left:20px; border-left: 4px solid #e3b341;"> <<if $lang == "cn">>备用电池<br><span style="color:#e3b341; font-size:0.85em;">(在线 / 1)</span><<else>>Battery<br><span style="color:#e3b341; font-size:0.85em;">(Online/1)</span><</if>> </div> <div class="c-node" style="top:160px; left:20px; border-left: 4px solid #58a6ff;"> <<if $lang == "cn">>主水泵<br><span style="color:#58a6ff; font-size:0.85em;">(启动 / 1)</span><<else>>Main Pump<br><span style="color:#58a6ff; font-size:0.85em;">(Online/1)</span><</if>> </div> <div class="c-node" style="top:220px; left:20px; border-left: 4px solid #f85149;"> <<if $lang == "cn">>副水泵<br><span style="color:#f85149; font-size:0.85em;">(停机 / 0)</span><<else>>Sub Pump<br><span style="color:#f85149; font-size:0.85em;">(Offline/0)</span><</if>> </div> <div class="c-node" style="top:320px; left:20px; border-left: 4px solid #f85149;"> <<if $lang == "cn">>系统封锁<br><span style="color:#f85149; font-size:0.85em;">(封锁 / 0)</span><<else>>Sys Lock<br><span style="color:#f85149; font-size:0.85em;">(Locked/0)</span><</if>> </div> <div class="c-node" style="top:100px; left:480px; height: 260px; width: 80px; border: 2px solid #2ea043; background:#0f1a11; display:flex; align-items:center; justify-content:center; text-align:center;"> <<if $lang == "cn">>总控<br>核心<br>防线<<else>>Master<br>Core<br>Defense<</if>> </div> <select id="select-g1" class="c-gate" style="top:45px; left:180px;"> <option value="none" selected="selected">Gate 1</option><option value="AND">AND</option><option value="OR">OR</option><option value="XOR">XOR</option><option value="NOT">NOT</option> </select> <select id="select-g2" class="c-gate" style="top:185px; left:180px;"> <option value="none" selected="selected">Gate 2</option><option value="AND">AND</option><option value="OR">OR</option><option value="XOR">XOR</option><option value="NOT">NOT</option> </select> <select id="select-g3" class="c-gate" style="top:325px; left:180px;"> <option value="none" selected="selected">Gate 3</option><option value="AND">AND</option><option value="OR">OR</option><option value="XOR">XOR</option><option value="NOT">NOT</option> </select> <select id="select-g4" class="c-gate" style="top:120px; left:360px;"> <option value="none" selected="selected">Gate 4</option><option value="AND">AND</option><option value="OR">OR</option><option value="XOR">XOR</option><option value="NOT">NOT</option> </select> <div style="position:absolute; top:5px; left:185px; color:#666; font-size:12px; font-weight:bold;"><<if $lang=="cn">>物理层<<else>>Physical Layer<</if>></div> <div style="position:absolute; top:80px; left:365px; color:#666; font-size:12px; font-weight:bold;"><<if $lang=="cn">>总控层<<else>>Master Layer<</if>></div> </div> <div id="logic-alert" style="margin-top: 10px; min-height: 80px; font-weight: bold;"></div> <div id="btn-container"> <<if $lang=="cn">> <<button "▶️ 编译双层网络并激活总线">><<run window.runGateAnimation()>><</button>> <<else>> <<button "▶️ Compile Network & Activate Bus">><<run window.runGateAnimation()>><</button>> <</if>> </div> </div> <script> { window.runGateAnimation = function() { const lang = SugarCube.State.variables.lang || "cn"; let g1 = $("#select-g1").val(); let g2 = $("#select-g2").val(); let g3 = $("#select-g3").val(); let g4 = $("#select-g4").val(); if (g1 === "none" || g2 === "none" || g3 === "none" || g4 === "none") { $("#logic-alert").html(lang === "cn" ? '<span style="color:orange">⚠️ 警告:请完成所有 4 个逻辑门的配置!</span>' : '<span style="color:orange">⚠️ Warning: Configure all 4 gates!</span>'); return; } $("#btn-container").hide(); $("#logic-alert").html(lang === "cn" ? '<span style="color:#58a6ff">🔄 物理层信号注入中...</span>' : '<span style="color:#58a6ff">🔄 Injecting physical layer...</span>'); $(".anim-pipe").removeClass("flow"); void document.getElementById("p-in-1a").offsetWidth; setTimeout(() => { $("#p-in-1a").css("stroke", "#f85149").addClass("flow"); $("#p-in-1b").css("stroke", "#e3b341").addClass("flow"); $("#p-in-2a").css("stroke", "#58a6ff").addClass("flow"); $("#p-in-2b").css("stroke", "#f85149").addClass("flow"); $("#p-in-3").css("stroke", "#f85149").addClass("flow"); }, 100); setTimeout(() => { $("#logic-alert").html(lang === "cn" ? '<span style="color:#e3b341">🔄 总控层信号汇聚中...</span>' : '<span style="color:#e3b341">🔄 Merging master layer...</span>'); let out1 = false, out2 = false, out3 = false; let errorMsg = ""; if (g1 === "OR" || g1 === "XOR") { out1 = true; $("#p-out-1").css("stroke", "#e3b341").addClass("flow"); } else { errorMsg += lang === "cn" ? "⚡ 供电层(G1):主电已挂断,需用 OR/XOR 切换备用电源。<br>" : "⚡ Power (G1): Use OR/XOR for backup power transition.<br>"; $("#p-out-1").css("stroke", "#f85149").addClass("flow"); } if (g2 === "XOR") { out2 = true; $("#p-out-2").css("stroke", "#58a6ff").addClass("flow"); } else if (g2 === "OR") { errorMsg += lang === "cn" ? "🚨 冷却层(G2):禁止使用 OR 门!若双泵同时开启会导致管线爆裂,必须用 XOR 防冲突。<br>" : "🚨 Coolant (G2): OR gate forbidden! Dual pump activation causes burst. Use XOR.<br>"; $("#p-out-2").css("stroke", "#f85149").addClass("flow"); } else { errorMsg += lang === "cn" ? "💧 冷却层(G2):配置错误,未能启动冷却循环。<br>" : "💧 Coolant (G2): Configuration error.<br>"; $("#p-out-2").css("stroke", "#f85149").addClass("flow"); } if (g3 === "NOT") { out3 = true; $("#p-out-3").css("stroke", "#2ea043").addClass("flow"); } else { errorMsg += lang === "cn" ? "🛑 封锁线(G3):必须用 NOT 门反转单路封锁信号!<br>" : "🛑 Lock (G3): Must use NOT to invert the single block signal!<br>"; $("#p-out-3").css("stroke", "#f85149").addClass("flow"); } setTimeout(() => { let out4 = false; if (g4 === "AND") { if (out1 && out2) { out4 = true; $("#p-out-4").css("stroke", "#2ea043").addClass("flow"); } else { $("#p-out-4").css("stroke", "#f85149").addClass("flow"); } } else if (g4 === "OR" || g4 === "XOR") { errorMsg += lang === "cn" ? "💥 总控层(G4):使用了 OR/XOR 导致安全机制绕过!必须用 AND 强绑定供电和冷却!<br>" : "💥 Master (G4): OR/XOR bypasses safety! MUST use AND to bind power and coolant!<br>"; if (out1 || out2) { $("#p-out-4").css("stroke", "#f85149").addClass("flow"); } } else { errorMsg += lang === "cn" ? "🔌 总控层(G4):逻辑门短路。<br>" : "🔌 Master (G4): Short circuit.<br>"; $("#p-out-4").css("stroke", "#f85149").addClass("flow"); } setTimeout(() => { if (out3 && out4 && errorMsg === "") { let btnText = lang === "cn" ? "前往:核心防御塔" : "Proceed: Core Defense Tower"; let successText = `<<replace "#logic-alert">><span style="color:#2ea043">${lang === "cn" ? '✅ 编译完美!两层控制网完全畅通,核心防线已解锁!' : '✅ Compiled perfectly! Dual-layer net online, defense unlocked!'}</span><br><br><<button "⚔️ ${btnText}">><<goto "核心防御塔">><</button>><</replace>>`; $.wiki(successText); } else { let current = SugarCube.State.variables.energy || 100; current -= 20; SugarCube.State.variables.energy = current; let sidebarUpdate = `<<run try { $("#story-caption").empty().wiki(Story.get("StoryCaption").processText()) } catch(e){} >>`; if (current <= 0) { $.wiki(sidebarUpdate + '<<goto "能源耗尽">>'); } else { let retryText = lang === "cn" ? "重新梳理管线" : "Reroute Pipes"; // 修复了错误回跳到“逻辑大门1”的Bug,改为自动重新加载当前页面 let failHTML = `<span style="color:#f85149">${lang === "cn" ? '❌ 激活失败:架构存在缺陷!' : '❌ Failed: Architecture defect!'}</span><br>⚡ ${lang === "cn" ? '扣除 20% 能源。剩余:' : 'Energy -20%. Remaining:'} <span style="color:yellow">${current}%</span><br><span style="color:orange; font-size: 0.9em">${errorMsg}</span><br><br><<button "🔄 ${retryText}">><<run Engine.play(passage())>><</button>>`; $.wiki(sidebarUpdate + `<<replace "#logic-alert">>${failHTML}<</replace>>`); } } }, 1200); }, 1000); }, 1000); }; } </script>
<<if $lang == "cn">> <h2>🚨 最终扇区:终极火控矩阵</h2> <<else>> <h2>🚨 Final Sector: Ultimate Fire Control Matrix</h2> <</if>> <hr> <<if $lang == "cn">> <p>[系统提示] 警告!多足异星生物已突破外墙,距离中枢仅剩 15 秒!<br> [主控AI] “<strong>$playerName</strong>,这是最后的防线!主炮已经充能,但坐标输入口被海量的雷达回波和受损日志堵死了。<br> 立刻执行最高级别的【数据抽象】!我需要你从这堆错乱的瀑布流中,精准提取三个参数来开火:<br> <strong>1. 目标的【真实方位角 (Azimuth)】</strong><br> <strong>2. 目标的【真实仰角 (Elevation)】</strong><br> <strong>3. 终极【开火授权哈希值 (Fire Auth Hash)】</strong><br> 千万别被诱饵坐标和失效密码骗了!”</p> <<else>> <p>[System] Warning! Multi-legged alien lifeforms have breached the outer wall. Only 15 seconds to core contact!<br> [AI] "<strong>$playerName</strong>, this is the final line of defense! The main gun is charged, but the coordinate input port is jammed by massive radar echoes and damaged logs.<br> Execute highest-level [Data Abstraction] immediately! I need you to precisely extract three parameters from this chaotic waterfall of data to fire:<br> <strong>1. Target's [True Azimuth]</strong><br> <strong>2. Target's [True Elevation]</strong><br> <strong>3. Ultimate [Fire Auth Hash]</strong><br> Do not be fooled by decoy coordinates and invalid passwords!"</p> <</if>> <div style="background-color: #050505; color: #ff7b72; padding: 15px; border-left: 4px solid #b31d28; font-family: 'Courier New', Courier, monospace; margin-bottom: 20px; font-size: 0.85em; line-height: 1.5; overflow-y: auto; max-height: 300px;"> <<if $lang == "cn">> <strong>【🔥🔥 严重污染的高速数据流 🔥🔥】</strong><br> [SYS_23:14:00] INFO: 矩阵核心运转正常.<br> [SYS_23:14:01] WARN: RADAR_GHOST_ECHO - 发现残影假目标, 方位角(AZIMUTH): 180 (标记: 忽略/IGNORE).<br> [SYS_23:14:01] SENSOR: 外部舱门完整度跌至 12%.<br> [SYS_23:14:02] CHAT_LOG: "快点!门要撑不住了!快开炮!"<br> [SYS_23:14:03] FIRE_AUTH_OLD: BRAVO-2 (状态: 已撤销/REVOKED).<br> [SYS_23:14:03] LOG_ERR: 水管破裂,区域 4 正在进水.<br> [SYS_23:14:04] TARGET_AZIMUTH_LOCKED: 275 (状态: 真实目标锁定).<br> [SYS_23:14:04] COMM: 接收到未知求救信号 - 坐标 X:99, Y:99.<br> [SYS_23:14:05] SENSOR_TEMP: 炮管预热温度 850°C.<br> [SYS_23:14:06] TARGET_ELEVATION_ESTIMATE: 30 (状态: 估算中,精度低).<br> [SYS_23:14:07] FIRE_AUTH_ACTIVE: X-RAY-99 (状态: 可用/AVAILABLE).<br> [SYS_23:14:08] SYS_MSG: 请记得周五的服务器例行维护.<br> [SYS_23:14:09] TARGET_ELEVATION_LOCKED: 15 (状态: 绝对精确).<br> [SYS_23:14:10] CRITICAL: 接触倒计时 5... 4...<br> <<else>> <strong>[🔥🔥 SEVERELY POLLUTED HIGH-SPEED DATA STREAM 🔥🔥]</strong><br> [SYS_23:14:00] INFO: Matrix core operating normally.<br> [SYS_23:14:01] WARN: RADAR_GHOST_ECHO - Ghost decoy detected, AZIMUTH: 180 (Status: IGNORE).<br> [SYS_23:14:01] SENSOR: Outer hatch integrity dropped to 12%.<br> [SYS_23:14:02] CHAT_LOG: "Hurry! The door won't hold! Fire the gun!"<br> [SYS_23:14:03] FIRE_AUTH_OLD: BRAVO-2 (Status: REVOKED).<br> [SYS_23:14:03] LOG_ERR: Water pipe burst, Sector 4 is flooding.<br> [SYS_23:14:04] TARGET_AZIMUTH_LOCKED: 275 (Status: True target locked).<br> [SYS_23:14:04] COMM: Unknown SOS received - Coordinates X:99, Y:99.<br> [SYS_23:14:05] SENSOR_TEMP: Gun barrel preheat temp 850°C.<br> [SYS_23:14:06] TARGET_ELEVATION_ESTIMATE: 30 (Status: Estimating, low precision).<br> [SYS_23:14:07] FIRE_AUTH_ACTIVE: X-RAY-99 (Status: AVAILABLE).<br> [SYS_23:14:08] SYS_MSG: Remember routine server maintenance on Friday.<br> [SYS_23:14:09] TARGET_ELEVATION_LOCKED: 15 (Status: Absolute precision).<br> [SYS_23:14:10] CRITICAL: Contact countdown 5... 4...<br> <</if>> </div> <<if $lang == "cn">> <p>紧急输入火控参数(仅输入数值或指定代码):</p> 1. 真实方位角 (AZIMUTH):<br> <<textbox "$aziInput" "">><br><br> 2. 真实仰角 (ELEVATION):<br> <<textbox "$eleInput" "">><br><br> 3. 开火授权哈希值 (FIRE_AUTH):<br> <<textbox "$hashInput" "">><br> <<else>> <p>Emergency input of fire control parameters (numeric or specified code only):</p> 1. True Azimuth (AZIMUTH):<br> <<textbox "$aziInput" "">><br><br> 2. True Elevation (ELEVATION):<br> <<textbox "$eleInput" "">><br><br> 3. Fire Auth Hash (FIRE_AUTH):<br> <<textbox "$hashInput" "">><br> <</if>> <div id="final-alert" style="margin-top: 20px; min-height: 80px; font-weight: bold;"></div> <div id="btn-final-container"> <<if $lang == "cn">> <<set _btnText = "💥 授权开火!清扫目标!">> <<else>> <<set _btnText = "💥 Authorize Fire! Clear Targets!">> <</if>> <<button _btnText>> /* 清洗数据:去除首尾空格并将哈希值转为大写 */ <<set $aziInput = $aziInput.trim()>> <<set $eleInput = $eleInput.trim()>> <<set $hashInput = $hashInput.trim().toUpperCase()>> /* 核心校验逻辑 (双语通用) */ <<if $aziInput == "275" and $eleInput == "15" and $hashInput == "X-RAY-99">> <<if $lang == "cn">> <<replace "#final-alert">> <div style="background-color: #0f1a11; border: 2px solid #2ea043; padding: 15px; text-align: center; border-radius: 8px;"> <span style="color:#3fb950; font-size: 1.2em;">★★★ 目标摧毁!欧罗巴二号警报解除! ★★★</span><br><br> <span style="color:#c9d1d9;">完美的数据抽象!你不仅在错综复杂的管线中理清了逻辑,还在致命的乱码中抓住了真理。<br>系统正在生成你的架构师通关报告...</span><br><br> <<button "🏆 查看通关结算">> <<goto "游戏通关结算">> <</button>> </div> <</replace>> <<else>> <<replace "#final-alert">> <div style="background-color: #0f1a11; border: 2px solid #2ea043; padding: 15px; text-align: center; border-radius: 8px;"> <span style="color:#3fb950; font-size: 1.2em;">★★★ Target Destroyed! Europa II Alert Cleared! ★★★</span><br><br> <span style="color:#c9d1d9;">Perfect data abstraction! You untangled the logic in complex pipelines and grasped the truth amidst deadly garbled code.<br>The system is generating your Architect clearance report...</span><br><br> <<button "🏆 View Clearance Report">> <<goto "游戏通关结算">> <</button>> </div> <</replace>> <</if>> <<run $("#btn-final-container").hide()>> <<else>> /* 错误扣血逻辑 */ <<set $energy -= 20>> <<if $energy <= 0>> <<goto "能源耗尽">> <<else>> /* 刷新左侧边栏 */ <<run try { $("#story-caption").empty().wiki(Story.get("StoryCaption").processText()) } catch(e){} >> /* 动态错误反馈系统 (双语版) */ <<if $lang == "cn">> <<replace "#final-alert">> <span style="color:#f85149">💥 开火失败:主炮射向了虚无,或者授权遭到拒绝!虫群逼近!</span><br> ⚡ 炮管冷却耗电,扣除 20% 备用能源。当前剩余: <span style="color:yellow">$energy%</span><br> <<if $aziInput == "180">> <span style="color:orange; font-size: 0.9em">⚠️ AI诊断:方位角错误!你锁定了雷达残影(GHOST_ECHO),那是诱饵!</span> <<elseif $eleInput == "30">> <span style="color:orange; font-size: 0.9em">⚠️ AI诊断:仰角错误!不要使用低精度的估算值(ESTIMATE),寻找绝对锁定的数值!</span> <<elseif $hashInput == "BRAVO-2">> <span style="color:orange; font-size: 0.9em">⚠️ AI诊断:授权失败!BRAVO-2 已经被撤销(REVOKED),请找当前激活的授权码。</span> <<else>> <span style="color:gray; font-size: 0.9em">⚠️ AI诊断:信息太多了!请保持冷静,严格比对后缀为 LOCKED 或 ACTIVE 的词条。</span> <</if>> <</replace>> <<else>> <<replace "#final-alert">> <span style="color:#f85149">💥 Firing Failed: The main gun fired into the void, or authorization was denied! The swarm approaches!</span><br> ⚡ Gun barrel cooling consumed power, deducted 20% energy. Remaining: <span style="color:yellow">$energy%</span><br> <<if $aziInput == "180">> <span style="color:orange; font-size: 0.9em">⚠️ AI Diagnosis: Azimuth error! You locked onto the radar ghost (GHOST_ECHO), it's a decoy!</span> <<elseif $eleInput == "30">> <span style="color:orange; font-size: 0.9em">⚠️ AI Diagnosis: Elevation error! Do not use low-precision estimates (ESTIMATE), look for absolutely locked values!</span> <<elseif $hashInput == "BRAVO-2">> <span style="color:orange; font-size: 0.9em">⚠️ AI Diagnosis: Auth failed! BRAVO-2 has been revoked (REVOKED), find the currently active code.</span> <<else>> <span style="color:gray; font-size: 0.9em">⚠️ AI Diagnosis: Too much information! Stay calm, strictly match entries with suffixes LOCKED or ACTIVE.</span> <</if>> <</replace>> <</if>> <</if>> <</if>> <</button>> </div>
<<if $lang == "cn">> <h2>🏆 欧罗巴二号:架构师评估报告</h2> <<else>> <h2>🏆 Europa II: Architect Evaluation Report</h2> <</if>> <hr> <<if $lang == "cn">> <p>[系统提示] 警报解除。多足异星生物已被全面清扫。设施受损率 4.2%,核心反应堆稳定。<br> [主控AI] “干得漂亮,<strong>$playerName</strong>!你不仅拯救了这颗星球上的科研基地,更向我证明了你具备一名顶尖计算机架构师的潜质。看看你的最终成绩单吧!”</p> <<else>> <p>[System] Alert cleared. Multi-legged alien lifeforms have been completely eradicated. Facility damage rate 4.2%, core reactor stable.<br> [AI] "Excellent work, <strong>$playerName</strong>! You not only saved the research base on this planet but also proved to me that you have the potential of a top-tier computer architect. Let's look at your final report card!"</p> <</if>> <div style="background-color: #0d1117; padding: 20px; border: 2px solid #30363d; border-radius: 8px; margin-bottom: 20px; line-height: 1.6;"> <<if $lang == "cn">> <h3 style="color: #58a6ff; margin-top: 0; border-bottom: 1px solid #333; padding-bottom: 10px;">📊 最终结算数据</h3> <strong>⚡ 剩余备用能源:</strong> <<else>> <h3 style="color: #58a6ff; margin-top: 0; border-bottom: 1px solid #333; padding-bottom: 10px;">📊 Final Results</h3> <strong>⚡ Remaining Backup Energy:</strong> <</if>> <<if $energy >= 80>> <span style="color:#2ea043; font-weight:bold; font-size:1.2em;"><<print $energy>>%</span> <<elseif $energy >= 50>> <span style="color:#e3b341; font-weight:bold; font-size:1.2em;"><<print $energy>>%</span> <<else>> <span style="color:#f85149; font-weight:bold; font-size:1.2em;"><<print $energy>>%</span> <</if>> <br><br> <<if $lang == "cn">> <strong>🎖️ 综合评级:</strong><br> <<if $energy == 100>> <span style="color:#d2a8ff; font-weight:bold; font-size:1.3em;">【S 级】传奇架构师</span><br> <span style="color:#c9d1d9;">评价:你的逻辑无懈可击,一次失误都没有!你可以直接去星际联邦科学院入职了。</span> <<elseif $energy >= 70>> <span style="color:#2ea043; font-weight:bold; font-size:1.3em;">【A 级】高级工程师</span><br> <span style="color:#c9d1d9;">评价:表现优异!虽然偶有小错,但你能迅速调整逻辑,是个非常可靠的伙伴。</span> <<elseif $energy >= 40>> <span style="color:#e3b341; font-weight:bold; font-size:1.3em;">【B 级】合格操作员</span><br> <span style="color:#c9d1d9;">评价:惊险过关!基地保住了,但在工程健壮性和抗干扰能力上,还有优化的空间。</span> <<else>> <span style="color:#f85149; font-weight:bold; font-size:1.3em;">【C 级】幸运幸存者</span><br> <span style="color:#c9d1d9;">评价:冷汗直流!差点就把核心反应堆给炸了,建议去模拟舱重新复习一下基础课程。</span> <</if>> <<else>> <strong>🎖️ Overall Rating:</strong><br> <<if $energy == 100>> <span style="color:#d2a8ff; font-weight:bold; font-size:1.3em;">[Rank S] Legendary Architect</span><br> <span style="color:#c9d1d9;">Evaluation: Your logic is flawless, not a single mistake! You can report directly to the Intergalactic Federation Academy of Sciences for duty.</span> <<elseif $energy >= 70>> <span style="color:#2ea043; font-weight:bold; font-size:1.3em;">[Rank A] Senior Engineer</span><br> <span style="color:#c9d1d9;">Evaluation: Outstanding performance! Despite occasional minor errors, you quickly adjusted your logic. A very reliable partner.</span> <<elseif $energy >= 40>> <span style="color:#e3b341; font-weight:bold; font-size:1.3em;">[Rank B] Qualified Operator</span><br> <span style="color:#c9d1d9;">Evaluation: A narrow escape! The base is secured, but there is room for optimization in engineering robustness and anti-interference capabilities.</span> <<else>> <span style="color:#f85149; font-weight:bold; font-size:1.3em;">[Rank C] Lucky Survivor</span><br> <span style="color:#c9d1d9;">Evaluation: A close shave! Almost blew up the core reactor. It is highly recommended to return to the simulation cabin and review the basic courses.</span> <</if>> <</if>> </div> <div style="background-color: #161b22; padding: 15px; border-left: 4px solid #8957e5; margin-bottom: 20px; font-size: 0.9em;"> <<if $lang == "cn">> <h3 style="color: #c9d1d9; margin-top: 0;">🧠 本次任务技能复盘</h3> 在这场危机中,你成功运用了计算思维的四大支柱: <ul> <li><strong>分解 (Decomposition):</strong> 将庞大的基地修复任务,拆解成了门禁、反应堆、防御塔三个可执行的独立模块。</li> <li><strong>模式识别 (Pattern Recognition):</strong> 在寻找密码时,发现了数字序列背后隐藏的规律。</li> <li><strong>算法设计 (Algorithms):</strong> 在反应堆中,利用双层布尔逻辑(AND/OR/XOR/NOT)规划了严密的信号防冲突管线。</li> <li><strong>抽象 (Abstraction):</strong> 在最终火控矩阵中,无视了海量聊天记录和报错乱码,精准提取了唯一有用的坐标数据。</li> </ul> <<else>> <h3 style="color: #c9d1d9; margin-top: 0;">🧠 Mission Skill Review</h3> In this crisis, you successfully applied the four pillars of computational thinking: <ul> <li><strong>Decomposition:</strong> Broke down the massive base repair task into three executable independent modules: access control, reactor, and defense tower.</li> <li><strong>Pattern Recognition:</strong> Discovered the hidden rules behind the numerical sequences when searching for the password.</li> <li><strong>Algorithms:</strong> Designed strict signal anti-collision pipelines in the reactor using dual-layer Boolean logic (AND/OR/XOR/NOT).</li> <li><strong>Abstraction:</strong> Ignored massive chat logs and error gibberish in the final fire control matrix, precisely extracting the only useful coordinate data.</li> </ul> <</if>> </div> <div style="text-align: center; margin-top: 30px;"> <<if $lang == "cn">> <<set _btnText = "🔄 重新开始模拟 (返回主菜单)">> <<else>> <<set _btnText = "🔄 Restart Simulation (Return to Main Menu)">> <</if>> <<button _btnText>> /* 重置核心变量以防二次游玩出现 Bug */ <<set $energy = 100>> <<set $playerName = "">> <<set $freqInput = "">> <<set $codeInput = "">> <<set $aziInput = "">> <<set $eleInput = "">> <<set $hashInput = "">> /* 刷新左侧边栏状态 */ <<run try { $("#story-caption").empty().wiki(Story.get("StoryCaption").processText()) } catch(e){} >> /* 跳转到你的起始 UI 页面 */ <<goto "Start">> <</button>> </div>
<style> .circuit-board { position: relative; width: 100%; max-width: 600px; height: 300px; margin: 20px 0; border-radius: 8px; border: 2px solid #444; background-color: #0d1117; background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 20px 20px; overflow: hidden; } .c-node { position: absolute; width: 80px; height: 42px; background: #161b22; border: 2px solid #555; border-radius: 4px; color: #c9d1d9; font-size: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10; box-shadow: 0 4px 6px rgba(0,0,0,0.5); line-height: 1.2; } .c-gate { position: absolute; width: 65px; height: 30px; background: #21262d; color: #58a6ff; border: 1px solid #58a6ff; border-radius: 4px; font-weight: bold; z-index: 10; text-align: center; cursor: pointer; font-size: 12px; } .anim-pipe { stroke-width: 5; fill: none; stroke-dasharray: 400; stroke-dashoffset: 400; } .flow { transition: stroke-dashoffset 1s linear; stroke-dashoffset: 0 !important; } </style> <div class="game-panel"> <<if $lang == "cn">> <h2>🔐 第三扇区:初级逻辑网</h2> <hr> <p>[系统提示] 您已抵达外围配电室。<br> [主控AI] “架构师 <strong>$playerName</strong>,我们需要先恢复基础供电并解除物理门锁,才能进入反应堆总线。请配置这 2 个基础逻辑门。”</p> <div style="background-color: #1e1e1e; padding: 10px 15px; border-left: 4px solid #d2a8ff; margin-bottom: 20px; font-size: 0.9em; line-height: 1.6;"> <strong>⚙️ 基础组件说明:</strong><br> ▪ <strong>OR (或门):</strong>只要有一个输入为真 (1),输出即为真。非常适合备用电源切换。<br> ▪ <strong>NOT (非门):</strong>反转信号。假(0)变真(1),真(1)变假(0)。注意:它只能接收一根输入线。<br> </div> <<else>> <h2>🔐 Sector 3: Primary Logic Net</h2> <hr> <p>[System] You have reached the peripheral power room.<br> [AI] "Architect <strong>$playerName</strong>, we must restore basic power and bypass the physical lock before entering the reactor bus. Configure these 2 basic gates."</p> <div style="background-color: #1e1e1e; padding: 10px 15px; border-left: 4px solid #d2a8ff; margin-bottom: 20px; font-size: 0.9em; line-height: 1.6;"> <strong>⚙️ Basic Components:</strong><br> ▪ <strong>OR Gate:</strong> If at least one input is True (1), output is True. Perfect for backup power.<br> ▪ <strong>NOT Gate:</strong> Inverts the signal. 0 becomes 1, 1 becomes 0. Note: It accepts exactly ONE input.<br> </div> <</if>> <div class="circuit-board"> <svg width="100%" height="100%" style="position:absolute; top:0; left:0; z-index:1;"> <path d="M 100 60 L 140 60 L 140 75 L 180 75" stroke="#333" stroke-width="8" fill="none" /> <path d="M 100 120 L 140 120 L 140 95 L 180 95" stroke="#333" stroke-width="8" fill="none" /> <path d="M 100 220 L 180 220" stroke="#333" stroke-width="8" fill="none" /> <path d="M 245 85 L 420 85" stroke="#333" stroke-width="8" fill="none" /> <path d="M 245 220 L 420 220" stroke="#333" stroke-width="8" fill="none" /> <path id="p-in-1a" d="M 100 60 L 140 60 L 140 75 L 180 75" class="anim-pipe" /> <path id="p-in-1b" d="M 100 120 L 140 120 L 140 95 L 180 95" class="anim-pipe" /> <path id="p-in-2" d="M 100 220 L 180 220" class="anim-pipe" /> <path id="p-out-1" d="M 245 85 L 420 85" class="anim-pipe" /> <path id="p-out-2" d="M 245 220 L 420 220" class="anim-pipe" /> </svg> <div class="c-node" style="top:40px; left:20px; border-left: 4px solid #f85149;"> <<if $lang == "cn">>主供电<br><span style="color:#f85149; transform:scale(0.85);">(离线 / 0)</span><<else>>Main Pwr<br><span style="color:#f85149; transform:scale(0.85);">(Offline/0)</span><</if>> </div> <div class="c-node" style="top:100px; left:20px; border-left: 4px solid #e3b341;"> <<if $lang == "cn">>备用电池<br><span style="color:#e3b341; transform:scale(0.85);">(在线 / 1)</span><<else>>Battery<br><span style="color:#e3b341; transform:scale(0.85);">(Online/1)</span><</if>> </div> <div class="c-node" style="top:200px; left:20px; border-left: 4px solid #f85149;"> <<if $lang == "cn">>系统封锁<br><span style="color:#f85149; transform:scale(0.85);">(封锁 / 0)</span><<else>>Sys Lock<br><span style="color:#f85149; transform:scale(0.85);">(Locked/0)</span><</if>> </div> <div class="c-node" style="top:60px; left:420px; height: 200px; border: 2px solid #2ea043; background:#0f1a11;"> <<if $lang == "cn">>进入<br>下一层<<else>>Proceed<br>to Next<</if>> </div> <select id="select-g1" class="c-gate" style="top:70px; left:180px;"> <option value="none" selected="selected">Gate 1</option><option value="AND">AND</option><option value="OR">OR</option><option value="NOT">NOT</option> </select> <select id="select-g2" class="c-gate" style="top:205px; left:180px;"> <option value="none" selected="selected">Gate 2</option><option value="AND">AND</option><option value="OR">OR</option><option value="NOT">NOT</option> </select> </div> <div id="logic-alert" style="margin-top: 10px; min-height: 80px; font-weight: bold;"></div> <div id="btn-container"> <<button "▶️ 编译并测试逻辑">><<run window.runBasicAnimation()>><</button>> </div> </div> <script> { window.runBasicAnimation = function() { const lang = SugarCube.State.variables.lang || "cn"; let g1 = $("#select-g1").val(); let g2 = $("#select-g2").val(); if (g1 === "none" || g2 === "none") { $("#logic-alert").html(lang === "cn" ? '<span style="color:orange">⚠️ 警告:请完成所有逻辑门的配置!</span>' : '<span style="color:orange">⚠️ Warning: Configure all logic gates!</span>'); return; } $("#btn-container").hide(); $("#logic-alert").html(lang === "cn" ? '<span style="color:#58a6ff">🔄 信号注入中...</span>' : '<span style="color:#58a6ff">🔄 Injecting signals...</span>'); $(".anim-pipe").removeClass("flow"); void document.getElementById("p-in-1a").offsetWidth; // 注入动画 setTimeout(() => { $("#p-in-1a").css("stroke", "#f85149").addClass("flow"); // 0 $("#p-in-1b").css("stroke", "#e3b341").addClass("flow"); // 1 $("#p-in-2").css("stroke", "#f85149").addClass("flow"); // 0 }, 100); setTimeout(() => { let out1 = false, out2 = false; let errorMsg = ""; if (g1 === "OR") { out1 = true; $("#p-out-1").css("stroke", "#e3b341").addClass("flow"); } else { errorMsg += lang === "cn" ? "⚡ 供电层:一侧断电时,AND门无法通电;NOT门无法处理两条输入。<br>" : "⚡ Power: AND fails if one is offline. NOT cannot take two inputs.<br>"; $("#p-out-1").css("stroke", "#f85149").addClass("flow"); } if (g2 === "NOT") { out2 = true; $("#p-out-2").css("stroke", "#2ea043").addClass("flow"); } else { errorMsg += lang === "cn" ? "🛑 封锁层:单根线无法使用AND/OR计算,必须用NOT将其反转(0变1)。<br>" : "🛑 Lock: Single input requires NOT to invert (0 to 1).<br>"; $("#p-out-2").css("stroke", "#f85149").addClass("flow"); } setTimeout(() => { if (out1 && out2) { let btnText = lang === "cn" ? "进入:反应堆主控总线" : "Enter: Reactor Main Bus"; let successText = `<<replace "#logic-alert">><span style="color:#2ea043">${lang === "cn" ? '✅ 基础网络已通,大门解锁!' : '✅ Basic net online, doors unlocked!'}</span><br><br><<button "⚔️ ${btnText}">><<goto "逻辑大门">><</button>><</replace>>`; $.wiki(successText); } else { let current = SugarCube.State.variables.energy || 100; current -= 10; SugarCube.State.variables.energy = current; let sidebarUpdate = `<<run try { $("#story-caption").empty().wiki(Story.get("StoryCaption").processText()) } catch(e){} >>`; if (current <= 0) { $.wiki(sidebarUpdate + '<<goto "能源耗尽">>'); } else { let retryText = lang === "cn" ? "重新配置" : "Reconfigure"; let failHTML = `<span style="color:#f85149">${lang === "cn" ? '❌ 测试失败' : '❌ Test Failed'}</span><br>⚡ ${lang === "cn" ? '扣除 10% 能源。剩余:' : 'Energy -10%. Remaining:'} <span style="color:yellow">${current}%</span><br><span style="color:orange; font-size: 0.9em">${errorMsg}</span><br><br><<button "🔄 ${retryText}">><<goto "逻辑大门1">><</button>>`; $.wiki(sidebarUpdate + `<<replace "#logic-alert">>${failHTML}<</replace>>`); } } }, 1000); }, 1000); }; } </script>