mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-11 23:45:11 +08:00
更新
This commit is contained in:
@@ -1395,7 +1395,7 @@ export const MOON_CONFIG = {
|
||||
maxChance: 20, // 最大20%概率(需要2M残骸)
|
||||
chancePerDebris: 100000, // 每10万资源增加1%概率
|
||||
baseFields: 1, // 月球初始空间(OGame规则:初始只有1格)
|
||||
lunarBaseFieldsBonus: 3, // 每级月球基地增加的空间(每级+3格,占用1格,净增2格)
|
||||
lunarBaseFieldsBonus: 30, // 每级月球基地增加的空间(每级+3格,占用1格,净增2格)
|
||||
minDiameter: 3476, // 最小月球直径(km),1%概率时
|
||||
maxDiameter: 8944, // 最大月球直径(km),20%概率时保证>8000km
|
||||
baseDiameter: 3000, // 基础直径(km)
|
||||
|
||||
@@ -237,7 +237,7 @@ export const createMoon = (
|
||||
|
||||
/**
|
||||
* 计算月球空间上限
|
||||
* OGame规则:月球初始1格,月球基地每级+3格(但月球基地本身占用1格,净增2格)
|
||||
* OGame规则:月球初始1格,月球基地每级+30格
|
||||
*/
|
||||
export const calculateMoonMaxSpace = (moon: Planet): number => {
|
||||
if (!moon.isMoon) return 0
|
||||
|
||||
@@ -389,6 +389,7 @@
|
||||
import { saveAs } from 'file-saver'
|
||||
import { toast } from 'vue-sonner'
|
||||
import { Capacitor } from '@capacitor/core'
|
||||
import { decryptData, encryptData } from '@/utils/crypto'
|
||||
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem'
|
||||
import pkg from '../../package.json'
|
||||
import { checkLatestVersion, canCheckVersion } from '@/utils/versionCheck'
|
||||
@@ -649,6 +650,15 @@
|
||||
if (typeof result === 'string') {
|
||||
const importData = JSON.parse(result)
|
||||
|
||||
if (importData.data) {
|
||||
const data = decryptData(importData.data)
|
||||
localStorage.setItem(pkg.name, encryptData(data.game))
|
||||
localStorage.setItem(`${pkg.name}-universe`, encryptData(data.universe))
|
||||
localStorage.setItem(`${pkg.name}-npcs`, encryptData(data.npcs))
|
||||
setTimeout(() => window.location.reload(), 1000)
|
||||
return
|
||||
}
|
||||
|
||||
// 兼容旧版本:如果是旧格式(直接是字符串),只导入游戏数据
|
||||
if (typeof importData === 'string' || !importData.game) {
|
||||
localStorage.setItem(pkg.name, result)
|
||||
|
||||
Reference in New Issue
Block a user