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

@@ -0,0 +1,21 @@
package xmlres
import "github.com/ECUST-XX/xml"
// NatureItem 表示单个性格修正项
type NatureItem struct {
ID int `xml:"id,attr"`
Name string `xml:"name,attr"`
AttackCorrect float64 `xml:"m_attack,attr"` // 攻击修正
DefenseCorrect float64 `xml:"m_defence,attr"` // 防御修正
SaCorrect float64 `xml:"m_SA,attr"` // 特攻修正
SdCorrect float64 `xml:"m_SD,attr"` // 特防修正
SpeedCorrect float64 `xml:"m_speed,attr"` // 速度修正
Desc string `xml:"desc,attr"` // 描述
}
// NatureRoot 表示XML根节点
type NatureRoot struct {
XMLName xml.Name `xml:"root"`
Items []NatureItem `xml:"item"`
}