From 54a4876beb2c97b660b23776c81f0cc8c0142a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Sat, 7 Mar 2026 22:49:20 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(fight):=20=E6=B7=BB=E5=8A=A0XML?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A7=A3=E6=9E=90=E5=8A=9F=E8=83=BD=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E6=8A=80=E8=83=BD=E6=95=88=E6=9E=9C=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 引入xml和gfile包用于XML文件解析 - 添加utils工具包用于数据转换 - 实现XML配置文件读取和解析逻辑 - 建立技能ID与效果描述的映射关系 - 添加调试输出显示技能效果对应关系 ``` --- logic/service/fight/init.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/logic/service/fight/init.go b/logic/service/fight/init.go index b290f69c..a591c68d 100644 --- a/logic/service/fight/init.go +++ b/logic/service/fight/init.go @@ -2,10 +2,12 @@ package fight import ( "blazing/common/data/xmlres" + "blazing/common/utils" "blazing/logic/service/fight/input" + "encoding/xml" "fmt" - "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gfile" ) func TestSKill() { @@ -39,6 +41,19 @@ func TestSKill() { } } + var root xmlres.MovesTbl + err := xml.Unmarshal(gfile.GetBytes("public/config/227.xml"), &root) + if err != nil { + panic(err) + } + ttt := utils.ToMap(root.EFF, func(t xmlres.SideEffect) int { + return t.ID + }) + + for k, v := range skimap { + fmt.Println(k, v, ttt[1000000+k].Des) + } + fmt.Println("实现效果数量", len(input.NodeM), "技能效果不存在数量", len(skimap)) - g.Dump(skimap) + // g.Dump(skimap) }