refactor(blazing): 重构任务系统并优化相关功能

- 重构了任务系统的数据结构和执行逻辑
- 优化了地图加载和怪物刷新机制
- 改进了宠物系统的基础架构
- 调整了玩家信息和背包的处理方式
- 统一了数据访问层的接口和实现
This commit is contained in:
2025-08-30 21:59:52 +08:00
parent 2ed5c2db27
commit 75e428f62e
23 changed files with 326 additions and 230 deletions

View File

@@ -1,6 +1,7 @@
package xmlres
import (
"blazing/common/utils"
"os"
"github.com/ECUST-XX/xml"
@@ -23,11 +24,13 @@ func getXml[T any](path string) T {
}
var (
MapConfig Maps //地图配置
ItemsConfig Items //物品配置
TalkConfig TalkCount //任务配置
Monster MonsterRoot //野怪配置
Skill MovesTbl //技能配置
MapConfig Maps //地图配置
ItemsConfig Items //物品配置
TalkConfig TalkCount //任务配置
//Monster MonsterRoot //野怪配置
MonsterMap map[int]TMapConfig
//Skill MovesTbl //技能配置
SkillMap map[int]Move
)
func initfile() {
@@ -36,8 +39,18 @@ func initfile() {
MapConfig = getXml[Maps](path + "210.xml")
ItemsConfig = getXml[Items](path + "43.xml")
TalkConfig = getXml[TalkCount](path + "talk.xml")
Monster = getXml[MonsterRoot](path + "地图配置野怪.xml")
Skill = getXml[MovesTbl](path + "227.xml")
Monster := getXml[MonsterRoot](path + "地图配置野怪.xml")
MonsterMap = utils.ToMap(Monster.Maps, func(m TMapConfig) int {
return m.ID
})
Skill := getXml[MovesTbl](path + "227.xml")
SkillMap = utils.ToMap[Move, int](Skill.Moves, func(m Move) int {
return m.ID
})
}