```
feat(xml): 添加进化配置映射并更新错误码提示 - 在 `common/data/xmlres/file.go` 中添加 EVOLVMAP 用于加载进化配置 - 更新多个控制器中的金币不足错误码,统一使用骄阳余额不足错误码 `ErrSunDouInsufficient10016` - 修改战斗逻辑中 AI 动作触发机制,并优化战斗流程 - 增加对融合材料合法性的校验 - 调整战斗动作通道缓冲区大小以提升并发处理能力 - 更新 XML 配置
This commit is contained in:
22
common/data/xmlres/evllve.go
Normal file
22
common/data/xmlres/evllve.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package xmlres
|
||||
|
||||
import "github.com/ECUST-XX/xml"
|
||||
|
||||
// CondEvolves 根节点结构体
|
||||
type CondEvolves struct {
|
||||
XMLName xml.Name `xml:"CondEvolves"`
|
||||
Evolves []Evolve `xml:"Evolve"`
|
||||
}
|
||||
|
||||
// Evolve 进化配置结构体
|
||||
type Evolve struct {
|
||||
ID int `xml:"ID,attr"` // 进化ID(属性)
|
||||
Branches []Branch `xml:"Branch"` // 进化分支列表
|
||||
}
|
||||
|
||||
// Branch 进化分支结构体
|
||||
type Branch struct {
|
||||
MonTo int `xml:"MonTo,attr"` // 进化目标精灵ID
|
||||
EvolvItem int `xml:"EvolvItem,attr,omitempty"` // 进化道具ID(可选)
|
||||
EvolvItemCount int `xml:"EvolvItemCount,attr,omitempty"` // 进化道具数量(可选)
|
||||
}
|
||||
@@ -54,6 +54,7 @@ var (
|
||||
SkillTypeMap map[int]SkillType
|
||||
RelationsMap map[int]Relation
|
||||
GoldProductMap = make(map[int]GoldProductItem, 0)
|
||||
EVOLVMAP map[int]Evolve
|
||||
)
|
||||
|
||||
func Initfile() {
|
||||
@@ -70,7 +71,10 @@ func Initfile() {
|
||||
return m.ID
|
||||
|
||||
})
|
||||
EVOLVMAP = utils.ToMap[Evolve, int](getXml[CondEvolves](path+"进化仓.xml").Evolves, func(m Evolve) int {
|
||||
return m.ID
|
||||
|
||||
})
|
||||
//TalkConfig = getXml[TalkRoot](path + "talk.xml")
|
||||
|
||||
MonsterMap = utils.ToMap(getXml[MonsterRoot](path+"地图配置野怪.xml").Maps, func(m TMapConfig) int {
|
||||
|
||||
Reference in New Issue
Block a user