feat: 新增多语言README并优化文档结构

新增德语、俄语、韩语、繁体中文多语言README,英文与简体中文README同步优化,统一下载链接与徽章样式,完善多语言入口。提升国际化支持与文档可读性。
This commit is contained in:
谦君
2025-12-24 01:45:17 +08:00
parent a475b1b554
commit 5e3557e2da
105 changed files with 12459 additions and 1690 deletions

View File

@@ -1,6 +1,7 @@
import type { Planet, Resources } from '@/types/game'
import { ShipType, DefenseType, BuildingType } from '@/types/game'
import { MOON_CONFIG, PLANET_CONFIG, FLEET_STORAGE_CONFIG } from '@/config/gameConfig'
import * as oreDepositLogic from './oreDepositLogic'
/**
* 创建初始星球
@@ -50,6 +51,7 @@ export const createInitialPlanet = (playerId: string, planetName: string = 'Home
[DefenseType.PlanetaryShield]: 0
},
buildQueue: [],
waitingBuildQueue: [], // 等待队列
lastUpdate: Date.now(),
maxSpace: 200,
maxFleetStorage: FLEET_STORAGE_CONFIG.baseStorage,
@@ -61,6 +63,12 @@ export const createInitialPlanet = (playerId: string, planetName: string = 'Home
initialPlanet.buildings[building] = 0
})
// 初始化矿脉储量
initialPlanet.oreDeposits = oreDepositLogic.generateOreDeposits(initialPlanet.position)
// 初始化温度
initialPlanet.temperature = generatePlanetTemperature(initialPlanet.position.position)
return initialPlanet
}
@@ -116,6 +124,7 @@ export const createNPCPlanet = (
[DefenseType.PlanetaryShield]: 0
},
buildQueue: [],
waitingBuildQueue: [], // 等待队列
lastUpdate: Date.now(),
maxSpace: 200,
maxFleetStorage: FLEET_STORAGE_CONFIG.baseStorage,
@@ -127,6 +136,12 @@ export const createNPCPlanet = (
npcPlanet.buildings[building] = Math.floor(Math.random() * 10)
})
// 初始化矿脉储量
npcPlanet.oreDeposits = oreDepositLogic.generateOreDeposits(npcPlanet.position)
// 初始化温度
npcPlanet.temperature = generatePlanetTemperature(npcPlanet.position.position)
return npcPlanet
}
@@ -201,6 +216,7 @@ export const createMoon = (
[DefenseType.PlanetaryShield]: 0
},
buildQueue: [],
waitingBuildQueue: [], // 等待队列
lastUpdate: Date.now(),
maxSpace: MOON_CONFIG.baseFields, // OGame规则月球初始只有1格空间
maxFleetStorage: FLEET_STORAGE_CONFIG.baseStorage,
@@ -245,3 +261,60 @@ export const calculatePlanetMaxSpace = (planet: Planet, terraformingTechLevel: n
return maxSpace
}
/**
* 根据星球位置生成温度范围
* OGame 原版规则位置1-3靠近恒星高温位置13-15远离恒星低温
* 温度影响太阳能卫星产能和重氢合成器产量
*
* 位置1: +220°C ~ +260°C (极热)
* 位置2: +180°C ~ +220°C
* 位置3: +100°C ~ +140°C
* 位置4: +60°C ~ +100°C
* 位置5: +30°C ~ +70°C
* 位置6: +10°C ~ +50°C
* 位置7: -10°C ~ +30°C
* 位置8: -30°C ~ +10°C (温和)
* 位置9: -50°C ~ -10°C
* 位置10: -70°C ~ -30°C
* 位置11: -100°C ~ -60°C
* 位置12: -130°C ~ -90°C
* 位置13: -160°C ~ -120°C
* 位置14: -190°C ~ -150°C
* 位置15: -220°C ~ -180°C (极冷)
*/
export const generatePlanetTemperature = (position: number): { min: number; max: number } => {
// 基础温度曲线位置1最热位置15最冷
// 使用线性插值从位置1的240°C到位置15的-200°C
const baseTemp = 240 - (position - 1) * 31.4 // 每个位置降低约31.4°C
// 温度范围通常在40°C左右波动
const variation = 20
const randomOffset = Math.floor(Math.random() * variation * 2) - variation // -20 to +20
const maxTemp = Math.round(baseTemp + randomOffset)
const minTemp = maxTemp - 40 // 最低温比最高温低40°C
return { min: minTemp, max: maxTemp }
}
/**
* 计算太阳能卫星基于温度的能量产出
* OGame 原版公式:(maxTemp + 160) / 6 (向下取整)
* 温度越高,太阳能卫星产能越高
*/
export const calculateSolarSatelliteOutput = (maxTemperature: number): number => {
// 确保最小产出为0避免极冷星球产生负能量
return Math.max(0, Math.floor((maxTemperature + 160) / 6))
}
/**
* 计算重氢合成器基于温度的产量修正系数
* OGame 原版规则:温度越低,重氢产量越高
* 公式1.36 - 0.004 * maxTemp (转换为百分比系数)
* 在温度-40°C时产量最高约156%),温度高时产量低
*/
export const calculateDeuteriumTemperatureBonus = (maxTemperature: number): number => {
// 返回乘数,例如:-40°C时返回1.52+100°C时返回0.96
return 1.36 - 0.004 * maxTemperature
}