Files
bl/common/data/xmlres/item.go

56 lines
2.8 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package xmlres
import (
"github.com/ECUST-XX/xml" // 保持与之前一致的XML库
)
// Items 根节点,对应<Items>标签
type Items struct {
XMLName xml.Name `xml:"Items"`
Items []Item `xml:"Item"` // 包含所有物品配置
}
type Item struct {
ID int `xml:"ID,attr"` // 物品ID与items.xml一致
Name string `xml:"Name,attr"` // 物品名称
Rarity int `xml:"Rarity,attr,omitempty"` // 稀有度
ItemType int `xml:"ItemType,attr"` // 物品类型
Max int `xml:"Max,attr"` // 最大堆叠数量
Price int `xml:"Price,attr"` // 价格
Bonus string `xml:"Bonus,attr"` // 倍率(如捕捉胶囊的加成倍数)
Tradability int `xml:"Tradability,attr"` // 可交易性0/1
VipTradability int `xml:"VipTradability,attr"` // VIP可交易性0/1
DailyKey int `xml:"DailyKey,attr,omitempty"` // 每日限制键值
DailyOutMax int `xml:"DailyOutMax,attr,omitempty"` // 每日最大产出
Wd int `xml:"wd,attr"` // 未知属性
UseMax int `xml:"UseMax,attr"` // 最大使用次数
LifeTime int `xml:"LifeTime,attr"` // 生命周期0为永久
Purpose int `xml:"purpose,attr"` // 用途标识
Bean int `xml:"Bean,attr,omitempty"` // 豆子数量
Hide int `xml:"Hide,attr"` // 是否隐藏0/1
Sort int `xml:"Sort,attr,omitempty"` // 排序序号
Des string `xml:"des,attr"` // 物品用途
Color string `xml:"color,attr,omitempty"` // 装备名字颜色
Level int `xml:"level,attr,omitempty"` // 装备等级(星星)
Pet *Pet `xml:"pet,omitempty"` // 精灵属性子节点
TeamPK *TeamPK `xml:"teamPK,omitempty"` // 要塞保卫战子节点
}
// Pet 精灵属性子节点,对应<pet>标签
// 注:根据实际需求补充字段,这里以常见属性为例
type Pet struct {
Attack int `xml:"attack,attr,omitempty"` // 攻击加成
Defense int `xml:"defense,attr,omitempty"` // 防御加成
HP int `xml:"hp,attr,omitempty"` // 生命值加成
Speed int `xml:"speed,attr,omitempty"` // 速度加成
}
// TeamPK 要塞保卫战子节点,对应<teamPK>标签
// 注:根据实际需求补充字段,这里以常见属性为例
type TeamPK struct {
FortBonus int `xml:"fortBonus,attr,omitempty"` // 要塞加成
DefenseBonus int `xml:"defenseBonus,attr,omitempty"` // 防御加成
AttackBonus int `xml:"attackBonus,attr,omitempty"` // 攻击加成
}