feat(pet): 新增宠物功能和相关数据结构

- 新增宠物配置和自然属性配置的 XML 解析
- 实现宠物信息生成和属性计算逻辑
- 添加宠物数据库模型和相关服务
- 更新登录和任务完成逻辑,支持宠物相关操作
This commit is contained in:
2025-08-31 00:27:07 +08:00
parent 75e428f62e
commit 3668f3c5b9
11 changed files with 307 additions and 28 deletions

View File

@@ -30,7 +30,9 @@ var (
//Monster MonsterRoot //野怪配置
MonsterMap map[int]TMapConfig
//Skill MovesTbl //技能配置
SkillMap map[int]Move
SkillMap map[int]Move
PetMAP map[int]PetMM //宠物配置
NatureRootMap map[int]NatureItem
)
func initfile() {
@@ -51,7 +53,17 @@ func initfile() {
return m.ID
})
pet := getXml[Monsters](path + "226.xml")
PetMAP = utils.ToMap[PetMM, int](pet.Monsters, func(m PetMM) int {
return m.ID
})
NatureRootMap1 := getXml[NatureRoot](path + "nature.xml")
NatureRootMap = utils.ToMap[NatureItem, int](NatureRootMap1.Items, func(m NatureItem) int {
return m.ID
})
}
func init() {