feat(pet): 新增宠物功能和相关数据结构
- 新增宠物配置和自然属性配置的 XML 解析 - 实现宠物信息生成和属性计算逻辑 - 添加宠物数据库模型和相关服务 - 更新登录和任务完成逻辑,支持宠物相关操作
This commit is contained in:
21
common/data/xmlres/nature.go
Normal file
21
common/data/xmlres/nature.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user