feat(xmlres): 添加任务数据加载与初始化逻辑

在 xmlres 包中新增 TaskMap 用于存储任务数据,并在 initfile 函数中
加载 task.xml 文件内容。同时调整 login 控制器中的任务重置逻辑,根据
任务类型每日重置任务状态。修复 pet 控制器释放宠物时的数据更新问题。
战斗系统中增加 Effect 的 OnMiss 回调处理,并修正状态效果映射关系。
修复 PVP 邀
This commit is contained in:
2025-10-20 23:59:49 +08:00
parent f53028d1fc
commit b90bceafd9
10 changed files with 83 additions and 25 deletions

View File

@@ -48,6 +48,7 @@ var (
EffectMAP map[int]NewSeIdx
PlayerEffectMAP map[int]NewSeIdx
ItemsMAP map[int]Item
TaskMap map[int]Task
)
func initfile() {
@@ -67,6 +68,7 @@ func initfile() {
})
TalkConfig = getXml[TalkCount](path + "talk.xml")
Monster := getXml[MonsterRoot](path + "地图配置野怪.xml")
MonsterMap = utils.ToMap(Monster.Maps, func(m TMapConfig) int {
@@ -82,7 +84,11 @@ func initfile() {
v.SideEffectArgS = ParseSideEffectArgs(v.SideEffectArg)
SkillMap[v.ID] = v
}
task := getXml[Tasks](path + "task.xml")
TaskMap = utils.ToMap[Task, int](task.Tasks, func(m Task) int {
return m.ID
})
pet := getXml[Monsters](path + "226.xml")
PetMAP = utils.ToMap[PetInfo, int](pet.Monsters, func(m PetInfo) int {
return m.ID