// ==UserScript== // @name Beyond the limits丨极限之上 汉化脚本 // @namespace http://tampermonkey.net/ // @version 1.0.1 // @description 汉化脚本,安装即可用,支持汉化开关、后台挂机 // @author 技术:麦子、JAR、小蓝、好阳光的小锅巴 汉化:林雷丨LinLei_Baruch // @match https://eulernumbersquared.github.io/Beyond-the-limits/ // @icon https://files.seeusercontent.com/2026/07/02/f6kI/femmylogo.png // @grant GM_info // @grant GM_registerMenuCommand // @grant GM_setValue // @grant GM_getValue // @grant GM_xmlhttpRequest // @connect scriptcat.org // ==/UserScript== (function() { 'use strict'; // ================= 更新检测 ================= const CURRENT_VERSION = GM_info.script.version; const SCRIPT_NAME = GM_info.script.name; // 也可以自动获取脚本名称 const UPDATE_URL = 'https://www.tampermonkey.net/script_installation.php#url=https://scriptcat.org/scripts/code/6893/Beyond%20the%20limits%E4%B8%A8%E6%9E%81%E9%99%90%E4%B9%8B%E4%B8%8A%20%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC.user.js'; const CHECK_INTERVAL = 60 * 60 * 1000; function compareVersions(v1, v2) { const parts1 = v1.split('.').map(Number); const parts2 = v2.split('.').map(Number); const maxLen = Math.max(parts1.length, parts2.length); for (let i = 0; i < maxLen; i++) { const a = parts1[i] || 0; const b = parts2[i] || 0; if (a < b) return -1; if (a > b) return 1; } return 0; } function checkForUpdate(manual = false) { const lastCheck = GM_getValue('last_update_check', 0); const now = Date.now(); if (!manual && (now - lastCheck < CHECK_INTERVAL)) return; GM_setValue('last_update_check', now); GM_xmlhttpRequest({ method: 'GET', url: UPDATE_URL, headers: { 'Cache-Control': 'no-cache' }, onload: function(response) { if (response.status === 200) { const text = response.responseText; const versionMatch = text.match(/@version\s+([^\s\n]+)/); if (versionMatch) { const remoteVersion = versionMatch[1].trim(); GM_setValue('remote_version', remoteVersion); if (compareVersions(CURRENT_VERSION, remoteVersion) < 0) { showUpdateNotification(remoteVersion); } else if (manual) { showToast('✅ 当前已是最新版本 v' + CURRENT_VERSION); } } } else if (manual) { showToast('❌ 检查更新失败,HTTP状态:' + response.status); } }, onerror: function() { if (manual) { showToast('❌ 检查更新失败,网络错误'); } } }); } function showUpdateNotification(remoteVersion) { const skippedVersion = GM_getValue('skipped_version', ''); if (skippedVersion === remoteVersion) return; // 注入动画关键帧 const styleEl = document.createElement('style'); styleEl.textContent = ` @keyframes guoba-overlay-in { from { opacity: 0; } to { opacity: 1; } } @keyframes guoba-dialog-in { from { opacity: 0; transform: translateY(30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } } @keyframes guoba-shimmer { 0% { background-position: -200% center; } 100% { background-position: 200% center; } } @keyframes guoba-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } } `; document.head.appendChild(styleEl); // 遮罩层 const overlay = document.createElement('div'); overlay.style.cssText = ` position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 2147483647; display: flex; align-items: center; justify-content: center; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif; animation: guoba-overlay-in 0.3s ease; `; // 主对话框容器 const dialog = document.createElement('div'); dialog.style.cssText = ` background: #1a1a2e; border-radius: 16px; max-width: 440px; width: 92%; box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.15), inset 0 1px 0 rgba(255,255,255,0.05); overflow: hidden; animation: guoba-dialog-in 0.4s cubic-bezier(0.16, 1, 0.3, 1); border: 1px solid rgba(255, 255, 255, 0.06); `; // ========== 标题栏 ========== const titleBar = document.createElement('div'); titleBar.style.cssText = ` background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%); padding: 18px 24px; position: relative; overflow: hidden; `; // 标题栏装饰光效 const titleShimmer = document.createElement('div'); titleShimmer.style.cssText = ` position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%); background-size: 200% 100%; animation: guoba-shimmer 3s ease-in-out infinite; pointer-events: none; `; titleBar.appendChild(titleShimmer); const titleIcon = document.createElement('div'); titleIcon.style.cssText = ` display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; `; titleIcon.innerHTML = ` ⚠️
${SCRIPT_NAME}
锅巴汉化 · 汉化注入器
`; titleBar.appendChild(titleIcon); // 关闭按钮 const closeBtn = document.createElement('div'); closeBtn.style.cssText = ` position: absolute; top: 14px; right: 16px; z-index: 2; width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; color: rgba(255,255,255,0.7); font-size: 16px; line-height: 1; `; closeBtn.textContent = '✕'; closeBtn.addEventListener('mouseenter', () => { closeBtn.style.background = 'rgba(255,255,255,0.2)'; closeBtn.style.color = '#fff'; }); closeBtn.addEventListener('mouseleave', () => { closeBtn.style.background = 'rgba(255,255,255,0.1)'; closeBtn.style.color = 'rgba(255,255,255,0.7)'; }); closeBtn.addEventListener('click', () => { overlay.style.opacity = '0'; setTimeout(() => { overlay.remove(); styleEl.remove(); }, 300); }); titleBar.appendChild(closeBtn); dialog.appendChild(titleBar); // ========== 内容区域 ========== const body = document.createElement('div'); body.style.cssText = `padding: 28px 28px 8px;`; // 更新图标与标题 const header = document.createElement('div'); header.style.cssText = `text-align: center; margin-bottom: 22px;`; header.innerHTML = `
🎉

发现新版本

更新以获取最新的汉化内容

`; body.appendChild(header); // 版本信息卡片 const versionCard = document.createElement('div'); versionCard.style.cssText = ` background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 24px; `; versionCard.innerHTML = `
当前版本
v${CURRENT_VERSION}
最新版本
v${remoteVersion}
`; body.appendChild(versionCard); // 按钮区域 const actions = document.createElement('div'); actions.style.cssText = `display: flex; gap: 10px; margin-bottom: 16px;`; // 前往更新按钮 const updateBtn = document.createElement('button'); updateBtn.textContent = '🚀 前往更新'; updateBtn.style.cssText = ` flex: 1; padding: 12px 20px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.25s; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3); letter-spacing: 0.3px; `; updateBtn.addEventListener('mouseenter', () => { updateBtn.style.transform = 'translateY(-1px)'; updateBtn.style.boxShadow = '0 6px 25px rgba(99, 102, 241, 0.45)'; }); updateBtn.addEventListener('mouseleave', () => { updateBtn.style.transform = 'translateY(0)'; updateBtn.style.boxShadow = '0 4px 15px rgba(99, 102, 241, 0.3)'; }); updateBtn.addEventListener('click', () => { window.open(UPDATE_URL, '_blank'); overlay.style.opacity = '0'; setTimeout(() => { overlay.remove(); styleEl.remove(); }, 300); }); // 暂不更新按钮 const skipBtn = document.createElement('button'); skipBtn.textContent = '稍后再说'; skipBtn.style.cssText = ` flex: 1; padding: 12px 20px; background: rgba(255, 255, 255, 0.04); color: #94a3b8; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.25s; `; skipBtn.addEventListener('mouseenter', () => { skipBtn.style.background = 'rgba(255, 255, 255, 0.08)'; skipBtn.style.color = '#cbd5e1'; }); skipBtn.addEventListener('mouseleave', () => { skipBtn.style.background = 'rgba(255, 255, 255, 0.04)'; skipBtn.style.color = '#94a3b8'; }); skipBtn.addEventListener('click', () => { const skipCheckbox = document.getElementById('guoba-skip-version'); if (skipCheckbox && skipCheckbox.checked) { GM_setValue('skipped_version', remoteVersion); } overlay.style.opacity = '0'; setTimeout(() => { overlay.remove(); styleEl.remove(); }, 300); }); actions.appendChild(updateBtn); actions.appendChild(skipBtn); body.appendChild(actions); // 跳过此版本复选框 const skipLabel = document.createElement('label'); skipLabel.style.cssText = ` display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 0 6px; font-size: 12px; color: #475569; cursor: pointer; transition: color 0.2s; user-select: none; `; skipLabel.addEventListener('mouseenter', () => skipLabel.style.color = '#64748b'); skipLabel.addEventListener('mouseleave', () => skipLabel.style.color = '#475569'); skipLabel.innerHTML = ` 不再提醒此版本 `; body.appendChild(skipLabel); dialog.appendChild(body); overlay.appendChild(dialog); // 点击遮罩关闭 overlay.addEventListener('click', (e) => { if (e.target === overlay) { overlay.style.opacity = '0'; setTimeout(() => { overlay.remove(); styleEl.remove(); }, 300); } }); document.body.appendChild(overlay); } function showToast(message) { const toast = document.createElement('div'); toast.textContent = message; toast.style.cssText = ` position: fixed; top: 24px; right: 24px; background: linear-gradient(135deg, #1e1e2e, #2a2a3e); color: #e2e8f0; padding: 14px 22px; border-radius: 12px; font-size: 14px; font-weight: 500; z-index: 2147483647; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.05); border: 1px solid rgba(255, 255, 255, 0.06); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); transform: translateX(0); backdrop-filter: blur(10px); `; document.body.appendChild(toast); setTimeout(() => { toast.style.opacity = '0'; toast.style.transform = 'translateX(30px)'; setTimeout(() => toast.remove(), 400); }, 3000); } // 注册手动检查更新菜单 GM_registerMenuCommand("🔄 检查更新", () => checkForUpdate(true)); // 页面加载时自动检查更新 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => setTimeout(() => checkForUpdate(false), 3000)); } else { setTimeout(() => checkForUpdate(false), 3000); } // ================= 开关控制 ================= const isEnabled = GM_getValue('translation_enabled', true); GM_registerMenuCommand(isEnabled ? "🟢 汉化已开启 (点击关闭)" : "🔴 汉化已关闭 (点击开启)", () => { GM_setValue('translation_enabled', !isEnabled); location.reload(); }); const isBgRunEnabled = GM_getValue('background_run_enabled', false); GM_registerMenuCommand(isBgRunEnabled ? "🟢 后台挂机已开启 (点击关闭)" : "🔴 后台挂机已关闭 (点击开启)", () => { GM_setValue('background_run_enabled', !isBgRunEnabled); location.reload(); }); // ================= 后台挂机注入 ================= if (isBgRunEnabled) { const startBackgroundAudio = () => { if (window.__bgAudioStarted) return; const audio = new Audio('https://download.samplelib.com/mp3/sample-9s.mp3'); audio.loop = true; audio.volume = 0.01; audio.play().then(() => { window.__bgAudioStarted = true; console.log("🟢 锅巴汉化:后台挂机音频已启动,浏览器防休眠已激活!"); }).catch(() => {}); }; startBackgroundAudio(); const initAudioOnInteract = () => { startBackgroundAudio(); if (window.__bgAudioStarted) { document.removeEventListener('click', initAudioOnInteract); document.removeEventListener('keydown', initAudioOnInteract); } }; document.addEventListener('click', initAudioOnInteract); document.addEventListener('keydown', initAudioOnInteract); const bgScript = document.createElement('script'); bgScript.textContent = ` (function() { try { Object.defineProperty(document, 'hidden', { get: () => false }); Object.defineProperty(document, 'webkitHidden', { get: () => false }); Object.defineProperty(document, 'visibilityState', { get: () => 'visible' }); const events = ['visibilitychange', 'webkitvisibilitychange', 'blur', 'focus', 'pagehide']; for (let ev of events) { document.addEventListener(ev, e => e.stopImmediatePropagation(), true); window.addEventListener(ev, e => e.stopImmediatePropagation(), true); } console.log("🟢 锅巴汉化:游戏防暂停劫持已激活!"); } catch (e) {} })(); `; if (document.head || document.documentElement) { (document.head || document.documentElement).appendChild(bgScript); bgScript.remove(); } } if (!isEnabled) { console.log("汉化注入器已关闭。"); return; } // ================= 字典数据 ================= const cnItems = { //Settings 设置 'Beyond the limits': '极限之上', 'Automation': '自动化', 'Export Save': '导出存档', 'Hard Reset': '硬重置', 'Load Save': '读取存档', 'Save Game': '保存游戏', 'Continue': '继续', 'Close': '关闭', 'Load': '加载', 'Cancel': '取消', 'Paste your save code here': '在此粘贴你的存档代码', //Automation 自动化 'Disable Matterion Automation': '禁用物质子自动化 ', 'Disabled': '已禁用', 'Enable Matterion Automation': '启用物质子自动化 ', 'Enabled': '已启用', 'Matterion Automation:': '物质子自动化:', 'Points and repeatables autobuyer:': '点数与重复升级自动购买器:', 'Enable Point + Repeatable Autobuy': '启用点数 + 重复升级自动购买', 'Disable Point + Repeatable Autobuy': '禁用点数 + 重复升级自动购买', //Banner 'Upgrades': '升级', 'Matterions': '物质子', 'Finity': '有限', 'Settings': '设置', 'Infinity': '无限', //Upgrades 点数升级 'Purchased': '已购买', 'Buy upgrade': '购买升级', 'Welcome!': '欢迎!', 'Multiply points by 2': '点数 x2', 'Gaming':'游戏', 'x3 more points': '点数 x3', 'New feature already?': '又有新功能了?', 'Unlock matterions': '解锁物质子', 'Damn': '靠', 'x5 mono-matterion. Unlock \'Matterion-Focus\'': 'x5 单体物质子。解锁“物质子聚焦”', 'It matters!': '物质关天!', 'Boost mono\'s generation from duo by x10.': '将双体对单体的产出加成提升 x10。', 'Let them grow.': '让它们成长。', 'Duo now boosts points at a reduced rate.': '双体现在以降低的速率加成点数。', 'Reversal': '反转', 'Points boost mono\'s generation at a reduced rate.': '点数以降低的速率加成单体的产出。', 'Self-respect': '自尊', 'Points boost themselves': '点数自身加成', 'Change of pace': '换换节奏', 'Increase mono\'s effect by x5': '单体的效果提升 x5', 'Tri-forcal boost': '三体聚焦加成', 'Tri boosts points': '三体点数加成', 'Tri\'s comeback': '三体归来', 'Focusing on tri generates more tri based on levels': '聚焦三体时,三体产出量随等级提升', 'Monochromatic': '单体聚焦', 'Boost mono\'s boost to points based on its own levels': '根据单体自身等级提升其对点数的加成', 'Fast.': '急速。', '^1.1 points': '点数 ^1.1', 'Eternal.': '永恒不朽。', 'Duo\'s effect of generating mono is increased based on points': '双体对单体的产出加成随点数提升', 'Finite.': '有限。', 'Unlock the finity.': '解锁“有限领域”。', 'The new era': '新时代', 'x1.5 FP (finity points)': 'x1.5 有限点数', 'Corrupted finity': '腐化有限领域', 'Based on best points in corruption, gain more FP': '根据腐化中的最高积分获得更多有限点数', 'Pushing the limits.': '突破极限。', 'x5 points': 'x5 点数', 'Converging to corruption': '汇聚于腐化', 'Further boost points based on corruption points': '根据腐化点数进一步提升点数', 'Infinite nature.': '无限本质。', 'Unlock the infinite buyables.': '解锁无限可购升级。', 'Ascension': '飞升', 'Based on repeatables bought, boost points': '根据重复升级购买数量加成点数', 'The final push.': '最终冲刺。', 'Welcome back.': '欢迎回来。', 'Hi! x1e20 points!!': '嗨!x1e20 点数!!', 'Ascension to infinity': '飞升无限', 'Hope the automation is nice!': '希望自动化能让你满意!', 'It\'s nice isn\'t it? ^1.2 points': '很不错,对吧?^1.2 点数', 'x1e65 points... you wont be seeing new upgrades in points for a while': 'x1e65 点数……你暂时不会看到新的点数升级了', //Repeatables 重复升级 'Repeatables': '重复升级', 'Purchase': '购买', 'Finite points': '有限点数', 'Gain x1.2 points per upgrade bought': '每购买一次升级,获得 x1.2 点数', 'Eternal corruption': '永恒腐化', 'Boost corruption point gain by x1.2 per upgrade bought': '每购买一次升级,腐化点数获取提升 x1.2', 'Below infinity': '无限之下', 'Gain x1.1 FP per upgrade bought': '每购买一次升级,获得 x1.1 有限点数', //Matterions 物质子 'Mono-matterion': '单体物质子', 'Duo-matterion': '双体物质子', 'Tri-matterion': '三体物质子', 'Buy Mono-matterion': '购买单体物质子', 'Buy Duo-matterion': '购买双体物质子', 'Buy Tri-matterion': '购买三体物质子', 'Matterion Focus': '物质子聚焦', 'Focus on certain matterions to gain unique effects': '聚焦特定物质子以获得独特效果', 'Focus Mono': '聚焦单体', 'Focus Duo': '聚焦双体', 'Focus Tri': '聚焦三体', 'Boosts Tri\'s and Duo\'s effect by x1.5 and x2 the point boost': '三体和双体的效果提升 x1.5,点数加成提升 x2', 'Boost Duo\'s effect by x2': '双体的效果提升 x2', //Finity 有限 'Finitely':'有限', 'You need point upgrade 15 to finity!': '你需要点数升级 15 才能进入有限领域!', 'x2 point gain and all matterions gain ASWELL as mono\'s boost to points.': '点数获取 x2,所有物质子均获得加成,且单体物质子的点数加成同样适用。', 'Corruption': '腐化', 'Unlock corruption. Autobuy matterion upgrades': '解锁腐化,自动购买物质子升级', 'Expansive.': '膨胀。', '^1.1 mono\'s generation': '^1.1 单体的产出', 'Sense of presence': '存在感', 'He observes you. ^1.1 and x10 points': '他在注视着你。 点数 ^1.1 且 ×10', 'Loss of words': '无言', 'Basically another way of saying i have no idea what to name these upgrades. Tri\'s generation when focused is boosted by x10': '基本上就是另一种说法:我真不知道该怎么给这些升级起名。聚焦时三体的产生提升 x10', 'Overcoming corruption': '克服腐化', 'x10 corruption point gain, x10 points': 'x10 腐化点数,x10 点数', 'THE GREATEST PUSH': '终极冲击', 'UNLOCK THE CITADEL OF CORRUPTION. (Requires heavy grinding!)': '解锁腐化堡垒。(需要大量刷取!)', 'Some help': '一些帮助', 'Based on FP, boost points': '根据有限点数加成点数', //Corruption 腐化 'Based on best points in the corruption. Gain corruption points!': '基于腐化中的最高点数。获得腐化点数!', 'Corruption Penalties': '腐化惩罚', 'Corruption\'s boost to points is disabled!': '腐化对积分的加成已禁用!', 'CorruptionAura': '腐化光环', 'Enter Corruption (Does a finity reset!)': '进入腐化(会进行有限重置!)', 'Gain Rate:': '获取速率:', 'Matterions disabled': '物质子已禁用', 'Point gain ^0.5': '点数获取 ^0.5', 'The corruption': '腐化', 'Corruption Points:':'腐化点数:', 'Best Points in Corruption:':'腐化中的最高点数:', 'Boosting Points:': '点数加成:', 'Exit Corruption': '退出腐化', 'You are currently inside the corruption!': '你当前正处于腐化之中!', //Final Corruption 终极腐化 'Final Corruption': '终极腐化', 'However, repeatable upgrades are unlocked immediately AND their costs are decreased as compensation BUT only the 1st one is actived.': '不过,重复升级会立即解锁,且其价格会作为补偿而降低,但只有第一个会生效。', 'The main resting point for the God of corruption. When entering, it will cause a finity reset AND reset your repeatables, as well as do the following:': '腐化之神的主要据点。进入时,将会触发有限重置并重置你的重复升级,同时还会产生以下效果:', 'Citadel of Corruption': '腐化堡垒', 'Corruption\'s boost to points is disabled': '腐化对积分的加成已禁用', 'ENTER THE FINAL CORRUPTION': '进入终极腐化', 'Further more, your points are divided by x10': '此外,你的积分将会除以 x10', 'Goal: Defeat the god of corruptions.': '目标:击败腐化之神。', 'You\'re permanently stuck in the corruption': '你将永久被困于腐化之中', 'YOU CANT TURN BACK': '你无法回头', 'You are currently in the FINAL CORRUPTION.': '你当前正处于终极腐化之中。', 'Autobuy repeatable upgrades and point upgrades': '自动购买重复升级和点数升级', 'Congratulations....': '恭喜……', 'Enable Point + Repeatable Autobuy ': '启用点数 + 重复升级自动购买 ', 'Good luck with the new era! It will be very, very long': '祝你在新时代好运!那将会非常非常漫长', 'Outside of corruption, BPiC updates automatiaclly without you having to enter corruption at a greater rate': '在腐化之外,腐化中的最高点数会自动更新,无需你进入腐化即可更快地更新', 'Since you\'ve finished the 1st god, here are the rewards!': '既然你已经击败了第一位神,以下是奖励!', 'Unlock the next reset layer.': '解锁下一重置层。', '^1.5 and x10 points': '^1.5 和 x10 点数', //终极腐化后的点数升级 'Since matterions are corrupted, gain ^1.5 points!': '由于物质子已被腐化,获得 ^1.5 点数!', 'I\'m so nice am i? ^1.2 points.': '我真是太好了不是吗? ^1.2 点数。', 'x5 mon-matterion. Unlock \'Matterion-Focus\'': 'x5 单体物质子。解锁“物质子聚焦”', 'Im too lazy to do that cross-out effect. Uhh, i guess x100 points?': '我懒得做那个划掉效果了。呃,就 x100 点数吧?', 'Apparently, many things are boosted by matterions. Too bad matterions are disabled! Points boost themselves.': '显然,很多东西都受物质子加成。可惜物质子已被禁用!点数将进行自身加成。', 'Oh yea! Finity is disabled while your in the final corruption, based on amount of repeatable upgrade 1 bought, gain EVEN more points.': '哦对了!在终极腐化中有限领域会被禁用,根据重复升级 1 的购买次数,获得更多点数。', 'Finally! An upgrade which i dont have to change! Points boost themselves again.': '总算!一个不用我改的升级!点数又可以自我加成了。', 'Can we just get to 1e308 points already? I\'m getting tired of making these upgrades... ^1.1 points': '能不能直接到 1e308 点数啊?做这些升级做累了…… ^1.1 点数', 'Unlock corrupted matter. (Finally amirite?)': '解锁腐化物质。(终于,我说得对吧?)', 'Because it can, repeatable upgrade 1 boosts corrupted matter at a reduced rate.': '没什么理由,就是重复升级 1 能以削弱后的倍率加成腐化物质。', 'This one does NOTHING! That\'s right, NOTHING!': '这个屁用没有!没错,一丁点用都没有!', 'Plain x100 points.': '就 x100 点数。', 'Reminder that finity is disabled. x10 corrupted matter for your troubles!': '提醒一下,有限领域已经没了。给你 x10 腐化物质,就当补偿吧!', 'Really? The new era? Seems like a corrupted one. Anyways x5 points.': '真的?新时代?看着像个腐化版。不管了,x5 点数。', 'De-corruptionizer': '“去腐化器”', 'I think its time we finally end this. Unlock the': '我想是时候彻底结束这一切了。解锁', 'Unlock the De-corruptionizer': '解锁“去腐化器”', 'You can buy this upgrade if you wanna but': '你想买就买吧,', 'it basically has no use at this point.': '反正到这阶段基本没啥用了。', 'Sorry! I\'m not allowing you to buy this upgrade! It\'s way too broken, so the cost has been': '抱歉!我不允许你购买这个升级!它实在太超模了,所以价格已被', 'nullified': '取消', //CMM 腐化物质 'CMM': '腐化物质', 'Its gain is based on your current points. It\'s a very simple feature, but can be powerful against the god of corruption.': '其获取量基于你当前的点数。这是一个非常简单的机制,但对付腐化之神时可能会很强大。', //Decorruptionizer 去腐化器 'Decorruptionizer': '去腐化器', 'Now all we do is wait....': '现在我们能做的只有等待……', 'THE DECORRUPTIONIZER': '去腐化器', 'Welcome to the final stretch of the final corruption! If you want to escape, you\'ll have to gain more corrupted matter to eventually defeat the god of corruption.': '欢迎来到终极腐化的最后阶段!如果你想逃离,就必须积累更多腐化物质,最终击败腐化之神。', //Infinity 无限 'This will reset everything before this except god of corruption\'s completion! Good luck with the new era.': '这会重置此前的所有东西,但腐化之神的进度会保留!祝你在新时代好运。', //无限升级 'Buy': '购买', 'Owned': '已拥有', 'Solarity':'太阳之神', 'Unlock the solarity. This is when you\'ll have to do a bit of micro-ing.': '解锁太阳之神。这时你就需要做一些微操了。', 'Gain 1% of FP/s. I\'ll be suprised if you actually get this': '每秒获得 1% 的有限点数。你真能拿到的话我服你', //Solarity 太阳之神 'Currently solarity level 0': '当前太阳之神等级 0', 'Currently using: Base solarity': '当前使用:基础太阳之神', 'Invest All Solar Energy': '投入所有太阳能', 'Level Circle': '等级环', 'S.E (solar energy) boosts points by x1.0000': 'S.E(太阳能)加成点数 x1.0000', 'Solarity levels are used to unlock certain features': '太阳之神等级用于解锁特定功能', 'THE SOLARITY': '太阳之神', 'They are boosting solars and lunars by x2.00': '它们正以 x2.00 加成太阳之力和月亮之力', 'Unlock calamity tiers at solarity level 2': '在太阳之神等级 2 解锁灾厄层级', 'XP: 0.0000 / 1.0000': '经验值:0.0000 / 1.0000', 'You have 0.0000 (0.0000/s) solar energy based on the product of solars and lunars': '你拥有 0.0000(0.0000/s)太阳能,基于太阳之力与月亮之力的乘积', 'You have 0.0000 (0.0002/s) lunars': '你拥有 0.0000(0.0002/s)月亮之力', 'You have 0.0000 (0.0002/s) solars': '你拥有 0.0000(0.0002/s)太阳之力', 'Switch to Lunar Generation': '切换至月亮之力产出', 'Switch to Solar Generation': '切换至太阳之力产出', //Calamity Tier 灾厄层级 'Calamity tier': '灾厄层级', '(Does nothing..... for now.)': '(目前什么用都没有……)', 'Reset for a Calamity Tier': '重置以获取灾厄层级', '"The greatest hell that shall be unleashed upon thee."': '“降临于汝身的最强地狱。”', 'Calamity Tier': '灾厄层级', 'However, i haven\'t added this yet! So, for now, solarity level 2 is endgame. You can try and push for more solarity levels however.': '不过,我还没实装这个!所以目前太阳之神等级 2 就是终局内容了。但你可以尝试冲击更高的太阳之神等级。', //游戏开始剧情 'Uh, hello? Who is this?': '呃,喂?你是谁?', 'What is this thinge?': '这是什么玩意儿?', 'Where am i.....': '我在哪里……', 'You must defeat him': '你必须击败他', 'You wake up in an unknown land': '你在一片未知之地醒来(汉化:LinLei_Baruch丨林雷)', 'Go on, i believe in you, dont let anything get in your way!': '去吧,我相信你,别让任何事物阻挡你的路!', 'Gods? Which ones?': '神?哪些神?', 'Hello? Anyone there??': '喂?有人在吗??', 'Hi, im e squared. Im stuck in the hands of the gods..': '嗨,我是 e 的平方。我被困在众神的手中了……', 'Huh?': '嗯?', 'Many of them.. i see alot, but the main one is the god of fundamentals': '很多……我看到了很多,但最主要的是基础之神', 'Save me... Save us......': '救救我……救救我们……', 'The strange machine stops producing sound. You know what you have to do.': '那台奇怪的机器停止了发出声音。你知道自己该做什么。', //购买首个单体物质子剧情 'Good luck! You\'ll need to get 1e15 points': '祝你好运!你需要获得 1e15 点数 (完成首次有限重置)', 'Hi. I\'ve seen you unlocked something called matterions': '嗨。我看到你已经解锁了所谓的“物质子”', 'Hmmmm...': '嗯……', 'I wonder if they aid me in my progress': '我在想它们是否能帮助我推进进度', 'Just then, e squared\'s voice comes back': '就在这时,e 的平方的声音又响起了', 'Oh! I\'ve been gaining points this entire time?': '哦!我这段时间一直在获得点数吗?', 'Oh! Ok, thanks for the information! I\'ll make sure to use them effectively.': '哦!好的,感谢告知!我会确保有效利用它们的。', 'They are a key part on beating the several gods': '它们是击败众神的关键部分', 'They are very powerful. They can generate their previous tier and aid you in your progress!': '它们非常强大。它们可以生成前一层级的资源,并帮助你推进进度!', 'What could this be?': '这会是什么呢?', 'You see 3 types of strange floating objects': '你看到三种奇特的漂浮物体', //点数升级4剧情 'Hmmm. My matterions seem to be generating a bit slow': '嗯……我的物质子生成速度好像有点慢', 'They do seem to be out of order, what if i could gain more buffs like this?': '它们确实好像有点失常,如果我还能获得更多类似这样的增益呢?', 'What if i try concentrating all of them at once?': '如果我试着一次性集中它们全部呢?', //首次有限剧情 'The finity.... i can see the power in this.......': '有限领域……我能感受到其中的力量……', 'What could this mean?': '这可能意味着什么?', 'You approach it and you see all your progress fade away.....': '你靠近它,看到你所有的进度逐渐消逝……', 'You see half of an infinity in front of you': '你看到半个无限在眼前', //有限升级2剧情 'As you explore the finity, strange errors of the reality are appearing': '当你探索有限领域时,现实的奇异错误正在出现', 'God of what now?': '什么神来着?', 'Good luck however, the corruption can be aggressive sometimes....': '祝你好运,不过腐化有时候会很凶猛……', 'Hey! Be careful! The god of corruption is nearby!': '嘿!小心!腐化之神就在附近!', 'One of the gods of this place. He is the creator of all this corruption. He was born from the mistakes of the god of fundamentals, you will meet him at the citadel': '这是此地的众神之一。他是这一切腐化的创造者。他诞生于基础之神的错误之中,你将在堡垒中遇见他', 'This is strange... what could be the cause of this': '这很奇怪……这可能是由什么造成的呢', 'You\'ll need to prove yourself to summon the citadel': '你需要证明自己才能召唤堡垒', //有限升级4剧情 'I swear i feel like im getting watched.....': '我发誓我感觉自己被监视着……', 'If you dare want to challenge me. Enter my domain and prove me wrong': '若你敢挑战我。进入我的领域,证明我是错的', 'Oh, that explains alot i guess': '哦,我想这能解释很多', 'YOU': '你', 'You feel a strange presence': '你感到一股奇异的存在', 'You realize that e squared was talking about him, the god of corruption': '你意识到“e 的平方”说的正是他——腐化之神', 'You think you can get past me? The god of corruption? No... You will never end the reign of corruption.': '你觉得你能越过我?腐化之神?不……你永远无法终结腐化的统治。', //点数升级20剧情 'Huh.....': '哈……', 'I\'m feeling the presence of corruption as i near them': '靠近它们时,我感到了腐化的存在', 'These should help me summon the citadel of corruption': '这些应该能帮我召唤腐化堡垒', 'Three upgrades.... that can be bought forever and ever..?': '三个升级……可以永远不停地购买……?', //有限升级7剧情 'If you really think your worthy enough.....': '如果你真的觉得自己够格……', 'Lets see how you\'ll do against the final corruption': '让我看看你在终极腐化面前表现如何', 'Wow..... You seriously think you can beat me?': '哇……你真觉得你能打败我?', 'Your really underestimating the power of a god, a god based on the mistakes of the god of fundamentals': '你真是低估了一位神的力量,一位诞生于基础之神错误之中的神', //进入腐化堡垒剧情 'Welcome... to my domain': '欢迎……来到我的领域', 'Where am i......': '我在哪里……', 'You will perish to the ultimate powers of the corruption!': '你将在腐化的终极力量面前陨落!', 'You wont be able to survive here': '你无法在这里存活', //解锁去腐化器剧情 'He sounds very worried... maybe this is the key to escape!': '他听起来很担心……也许这就是逃离的关键!', 'Hey!': '嘿!', 'Trying to destroy me with the de-corruptionizer?': '想用去腐化器消灭我?', 'What do you think your doing?': '你以为你在做什么?', 'You know, your effort will have NO use against me!': '你知道吗,你的努力对我毫无用处!', //去腐化50%进度剧情 'Do you seriously think that your terrifying me?': '你真以为你吓到我了吗?', 'He seems like he is weak, this is your chance to defeat him!': '他看起来很虚弱,这是你击败他的机会!', 'No....! You\'ll never defeat me!': '不……!你永远也打不败我!', //去腐化100%进度剧情(打败腐化之神) 'And he dissappears into the dust of the void, just like that.': '他就那样消失在了虚空的尘埃之中。', 'NO': '不', 'THE GOD OF SOLARITY WILL DEAL WITH YOU': '太阳之神会来收拾你的', 'WHAT HAVE YOU DONE': '你都做了什么', 'Wow, the thing he sought to be destroyed him.': '哇,他所追求之物反而毁灭了他。', 'YOU\'LL PAY FOR THIS....': '你会为此付出代价的……', 'You see him starting to fall to his own corruption...': '你看着他开始被自己的腐化所吞噬……', //解锁无限 'And a haven in a wild flower': '野花中的庇护所', 'And eternity in an hour': '刹那即永恒', 'For you shall not stop due to a small hindrance': '因为你不会因小小的阻碍而止步', 'Good luck with the next era': '祝你在下一时代好运', 'Hold infinity in the palms of your hand': '无限掌中握', 'It will be very brutal....': '那将会非常残酷……', 'Oooo! What is this? What does this pedstal say?': '哦哦!这是什么?这个基座上写着什么?', 'To see a world in a grain of sand': '一沙一世界', 'You feel much better after reading that....': '读完那句话后,你感觉好多了……', 'You must keep on going, even if the reality seems harsh': '你必须继续前进,即使现实看似严酷', 'You read the pedesteal and it says the following': '你阅读基座,上面写着以下内容', 'You see a pedestal rise and the full infinity': '你看到一个基座升起,以及完整的无限', //无需汉化 'I': 'I', 'II': 'II', 'III': 'III', 'IV': 'IV', 'V': 'V', 'VI': 'VI', 'VII': 'VII', 'VIII': 'VIII', 'X': 'X', 'XI': 'XI', 'XII': 'XII', 'XIII': 'XIII', 'XIV': 'XIV', 'XV': 'XV', 'XVI': 'XVI', 'A': 'A', 'B': 'B', 'C': 'C', 'D': 'D', 'E': 'E', 'F': 'F', 'G': 'G', 'H': 'H', 'I': 'I', 'J': 'J', 'K': 'K', 'L': 'L', 'M': 'M', 'N': 'N', 'O': 'O', 'P': 'P', 'Q': 'Q', 'R': 'R', 'S': 'S', 'T': 'T', 'U': 'U', 'V': 'V', 'W': 'W', 'X': 'X', 'Y': 'Y', 'Z': 'Z', }; const cnPrefix = { "\n": "\n", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": " ", " ": " ", "\t\t\t": "\t\t\t", "\n\n\t\t": "\n\n\t\t", "\n\t\t": "\n\t\t", "\t": "\t", "Show Milestones: ": "显示里程碑:", "Autosave: ": "自动保存: ", "Offline Prod: ": "离线生产: ", "Completed Challenges: ": "完成的挑战: ", "High-Quality Tree: ": "高质量树贴图: ", "Offline Time: ": "离线时间: ", "Theme: ": "主题: ", "Anti-Epilepsy Mode: ": "抗癫痫模式:", "In-line Exponent: ": "直列指数:", "Single-Tab Mode: ": "单标签模式:", "Time Played: ": "已玩时长:", "Shift-Click to Toggle Tooltips: ": "Shift-单击以切换工具提示:", }; const cnPostfix = { " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": "", " ": " ", " ": " ", "\n": "\n", "\n\t\t\t": "\n\t\t\t", "\t\t\n\t\t": "\t\t\n\t\t", "\t\t\t\t": "\t\t\t\t", "\n\t\t": "\n\t\t", "\t": "\t", }; const cnExcludeWhole = [ /^(\d+)$/, /^\s*$/, /^([\d\.]+):([\d\.]+)$/, /^([\d\.]+):([\d\.]+):([\d\.]+)$/, /^([\d\.]+):([\d\.]+):([\d\.]+):([\d\.]+):([\d\.]+)$/, /^([\d\.]+)h ([\d\.]+)m ([\d\.]+)s$/, /^([\d\.]+)y ([\d\.]+)d ([\d\.]+)h$/, /^([\d\.]+)\-([\d\.]+)\-([\d\.]+)$/, /^([\d\.]+)e(\d+)$/, /^([\d\.]+)$/, /^\(([\d\.]+)\)$/, /^([\d\.]+)\%$/, /^([\d\.]+)\/([\d\.]+)$/, /^\(([\d\.]+)\/([\d\.]+)\)$/, /^成本(.+)$/, /^\(([\d\.]+)\%\)$/, /^([\d\.]+)K$/, /^([\d\.]+)M$/, /^([\d\.]+)B$/, /^([\d\.]+) K$/, /^([\d\.]+) M$/, /^([\d\.]+) B$/, /^([\d\.]+)s$/, /^([\d\.]+)x$/, /^x([\d\.]+)$/, /^([\d\.,]+)$/, /^\+([\d\.,]+)$/, /^\-([\d\.,]+)$/, /^([\d\.,]+)x$/, /^x([\d\.,]+)$/, /^([\d\.,]+) \/ ([\d\.,]+)$/, /^([\d\.]+)e([\d\.,]+)$/, /^([\d\.,]+)\/([\d\.]+)e([\d\.,]+)$/, /^([\d\.]+)e([\d\.,]+)\/([\d\.]+)e([\d\.,]+)$/, /^([\d\.]+)e\+([\d\.,]+)$/, /^e([\d\.]+)e([\d\.,]+)$/, /^x([\d\.]+)e([\d\.,]+)$/, /^([\d\.]+)e([\d\.,]+)x$/, /^[\u4E00-\u9FA5]+$/ ]; const cnExcludePostfix = []; const cnRegReplace = new Map([ [/Mono-matterion is currently boosting points by/,'单体物质子当前正在将点数提升'], [/^Currently x([\d.eE+-]+) FP gain$/, '当前有限点数获取 x$1'], [/^Currently x([\d.eE+-]+) to points$/, '当前点数 x$1'], [/^Endorse the infinity for ([\d.eE+-]+) IP$/, '认可无限,获得 $1 无限点数'], [/^You currently have ([\d.eE+-]+) IP \(Gain \+([\d.eE+-]+) after ([\d.eE+-]+) points!\)$/, '你当前有 $1 无限点数(在 $3 点数后获得 +$2)'], [/^You have ([\d.eE+-]+[KMBT]?) \(([\d.eE+-]+[KMBT]?)\/s\) solars$/, '你拥有 $1 太阳之力($2/秒)'], [/^You have ([\d.eE+-]+[KMBT]?) \(([\d.eE+-]+[KMBT]?)\/s\) lunars$/, '你拥有 $1 月亮之力($2/秒)'], [/^You have ([\d.eE+-]+[KMBT]?) \(([\d.eE+-]+[KMBT]?)\/秒\) solar energy based on the product of solars and lunars$/, '你拥有 $1($2/秒) 太阳能,基于太阳之力和月亮之力的乘积'], [/^S\.E \(solar energy\) boosts points by x([\d.eE+-]+[KMBT]?)$/, 'S.E(太阳能)加成点数 x$1'], [/^They are boosting solars and lunars by x([\d.eE+-]+[KMBT]?)$/, '它们正以 x$1 加成太阳之力和月亮之力'], [/^Currently solarity level ([\d.eE+-]+[KMBT]?)$/, '当前太阳之神等级 $1'], [/Points:/,'点数:'], [/Cost:/,'费用:'], [/Amount:/,'数量:'], [/Levels:/,'等级:'], [/Generation/,'产出'], [/Effect: Currently/, '效果:当前'], [/Points/,'点数'], [/Enter the Finity and gain/,'进入有限,获得'], [/Boosting points by/,'点数加成'], [/Mono\/s/,'单体/秒'], [/Duo\/s/,'双体/秒'], [/FP/,'有限点数'], [/IP/,'无限点数'], [/\/s/,'/秒'], [/^Gain \+([\d.eE+-]+[KMBT]?) Tri per second and multiply its effect by x2$/, '每秒获得 +$1 三体,且其效果提升 x2'], [/^Currently x([\d.]+) points$/, '当前 x$1 点数'], [/^Currently x([\d.]+) to points$/, '当前 x$1 点数'], [/^Currently x([\d.]+) to mono's production$/, '当前单体产出 x$1'], [/^Currently x([\d.]+) to mono's effect$/, '当前单体效果 x$1'], [/^Currently x([\d.]+) to duo's effect$/, '当前双体效果 x$1'], [/^Purchased: ([\d.]+)$/, '已购买:$1'], [/^Currently x([\d.]+) to corrupted matter$/, '当前腐化物质 x$1'], [/^It is currently boosting corrupted matter by x([\d.]+)$/, '当前腐化物质加成 x$1'], [/^Current progress: ([\d.]+)%$/, '当前进度:$1%'], ]); // ================= 核心翻译逻辑 ================= function cnItem(text, node) { if (typeof (text) != "string" || !text) return text; let textori = text; let text_prefix = ""; for (let prefix in cnPrefix) { if (text.startsWith(prefix)) { text_prefix += cnPrefix[prefix]; text = text.substr(prefix.length); } } let text_postfix = ""; for (let postfix in cnPostfix) { if (text.endsWith(postfix)) { text_postfix = cnPostfix[postfix] + text_postfix; text = text.substr(0, text.length - postfix.length); } } for (let reg of cnExcludeWhole) { if (reg.test(text.trim())) return textori; } if (cnItems[text]) return text_prefix + cnItems[text] + text_postfix; for (let [key, value] of cnRegReplace.entries()) { if (key.test(text)) return text_prefix + text.replace(key, value) + text_postfix; } return textori; } function translateAttribute(el, attrName) { const original = el.getAttribute(attrName); if (!original) return; const translated = cnItem(original, el); if (translated !== original) el.setAttribute(attrName, translated); } function translateNode(rootNode) { if (!rootNode) return; let walker = document.createTreeWalker(rootNode, NodeFilter.SHOW_TEXT, null, false); let textNode; while (textNode = walker.nextNode()) { let parent = textNode.parentNode; if (parent && ['SCRIPT', 'STYLE', 'CODE'].includes(parent.nodeName)) continue; let translated = cnItem(textNode.nodeValue, textNode); if (textNode.nodeValue !== translated) textNode.nodeValue = translated; } const elements = rootNode.nodeType === Node.ELEMENT_NODE ? [rootNode, ...rootNode.querySelectorAll('*')] : rootNode.querySelectorAll?.('*') || []; for (let el of elements) { if (['SCRIPT', 'STYLE'].includes(el.tagName)) continue; translateAttribute(el, 'placeholder'); translateAttribute(el, 'title'); translateAttribute(el, 'alt'); translateAttribute(el, 'aria-label'); translateAttribute(el, 'data-tooltip'); if (el.tagName === 'INPUT' && ['button', 'submit', 'reset'].includes(el.type)) { const val = el.value; const tVal = cnItem(val, el); if (val !== tVal) el.value = tVal; } if (el.shadowRoot) translateNode(el.shadowRoot); } } // ================= 翻译页面标题 ================= function translateTitle() { const titleEl = document.querySelector('title'); if (!titleEl) return; const original = titleEl.textContent; if (!original) return; const translated = cnItem(original, titleEl); if (translated !== original) { titleEl.textContent = translated; console.log(`📝 标题翻译: "${original}" → "${translated}"`); } } // ================= 启动与监听 ================= console.log("锅巴汉化:正在注入汉化..."); translateNode(document.body); translateTitle(); // 监听 body 变化 const observer = new MutationObserver(function (mutations) { for (let mutation of mutations) { if (mutation.type === 'childList') { mutation.addedNodes.forEach(node => { if (node.nodeType === Node.TEXT_NODE) { let t = cnItem(node.nodeValue, node); if (node.nodeValue !== t) node.nodeValue = t; } else if (node.nodeType === Node.ELEMENT_NODE) { translateNode(node); } }); } else if (mutation.type === 'characterData') { let t = cnItem(mutation.target.nodeValue, mutation.target); if (mutation.target.nodeValue !== t) mutation.target.nodeValue = t; } else if (mutation.type === 'attributes') { const attr = mutation.attributeName; const target = mutation.target; if (['placeholder', 'title', 'alt', 'aria-label', 'data-tooltip'].includes(attr)) { translateAttribute(target, attr); } else if (attr === 'value' && target.tagName === 'INPUT') { const tVal = cnItem(target.value, target); if (target.value !== tVal) target.value = tVal; } } } }); observer.observe(document.body, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: ['placeholder', 'value', 'title', 'alt', 'aria-label', 'data-tooltip'] }); // ================= 监听标题变化 ================= // 1. 通过 MutationObserver 监听 元素变化 const titleObserver = new MutationObserver(() => { translateTitle(); }); const titleEl = document.querySelector('title'); if (titleEl) { titleObserver.observe(titleEl, { childList: true, characterData: true, subtree: true }); } // 2. 劫持 document.title 的 setter(用于 SPA 动态修改标题) const originalTitleDescriptor = Object.getOwnPropertyDescriptor(Document.prototype, 'title'); if (originalTitleDescriptor && originalTitleDescriptor.set) { Object.defineProperty(document, 'title', { get: originalTitleDescriptor.get, set: function(value) { const translated = cnItem(value, this); originalTitleDescriptor.set.call(this, translated); }, configurable: true }); } })();