Skip to content

Commit 66c0ed8

Browse files
committed
更新
1 parent 72f37aa commit 66c0ed8

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/config/gameConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ export const MOON_CONFIG = {
13951395
maxChance: 20, // 最大20%概率(需要2M残骸)
13961396
chancePerDebris: 100000, // 每10万资源增加1%概率
13971397
baseFields: 1, // 月球初始空间(OGame规则:初始只有1格)
1398-
lunarBaseFieldsBonus: 3, // 每级月球基地增加的空间(每级+3格,占用1格,净增2格)
1398+
lunarBaseFieldsBonus: 30, // 每级月球基地增加的空间(每级+3格,占用1格,净增2格)
13991399
minDiameter: 3476, // 最小月球直径(km),1%概率时
14001400
maxDiameter: 8944, // 最大月球直径(km),20%概率时保证>8000km
14011401
baseDiameter: 3000, // 基础直径(km)

src/logic/planetLogic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export const createMoon = (
237237

238238
/**
239239
* 计算月球空间上限
240-
* OGame规则:月球初始1格,月球基地每级+3格(但月球基地本身占用1格,净增2格)
240+
* OGame规则:月球初始1格,月球基地每级+30格
241241
*/
242242
export const calculateMoonMaxSpace = (moon: Planet): number => {
243243
if (!moon.isMoon) return 0

src/views/SettingsView.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@
389389
import { saveAs } from 'file-saver'
390390
import { toast } from 'vue-sonner'
391391
import { Capacitor } from '@capacitor/core'
392+
import { decryptData, encryptData } from '@/utils/crypto'
392393
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem'
393394
import pkg from '../../package.json'
394395
import { checkLatestVersion, canCheckVersion } from '@/utils/versionCheck'
@@ -649,6 +650,15 @@
649650
if (typeof result === 'string') {
650651
const importData = JSON.parse(result)
651652
653+
if (importData.data) {
654+
const data = decryptData(importData.data)
655+
localStorage.setItem(pkg.name, encryptData(data.game))
656+
localStorage.setItem(`${pkg.name}-universe`, encryptData(data.universe))
657+
localStorage.setItem(`${pkg.name}-npcs`, encryptData(data.npcs))
658+
setTimeout(() => window.location.reload(), 1000)
659+
return
660+
}
661+
652662
// 兼容旧版本:如果是旧格式(直接是字符串),只导入游戏数据
653663
if (typeof importData === 'string' || !importData.game) {
654664
localStorage.setItem(pkg.name, result)

0 commit comments

Comments
 (0)