feat(fight): 完善战斗系统中道具使用逻辑与血量恢复机制

- 修改 item.go 中 Item 结构体,将 Bonus 字段类型由 string
This commit is contained in:
2025-11-08 16:38:41 +08:00
parent ca005bdb56
commit c916440033
21 changed files with 437 additions and 71 deletions

View File

@@ -11,27 +11,42 @@ type Items struct {
}
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"` // 装备等级(星星)
ID int `xml:"ID,attr"` // 物品ID与items.xml一致
Name string `xml:"Name,attr"` // 物品名称
Rarity int `xml:"Rarity,attr,omitempty"` // 稀有度
ItemType int `xml:"ItemType,attr"` // 物品类型0胶囊 1体力药剂 2活力药剂
Max int `xml:"Max,attr"` // 最大堆叠数量
Price int `xml:"Price,attr"` // 价格
Bonus float64 `xml:"Bonus,attr,omitempty"` // 倍率(如捕捉胶囊的加成倍数,修正为浮点型
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,omitempty"` // 物品用途XML中无该属性保留字段供自定义
Color string `xml:"color,attr,omitempty"` // 装备名字颜色
Level int `xml:"level,attr,omitempty"` // 装备等级(星星)
VipOnly int `xml:"VipOnly,attr,omitempty"` // VIP专属标识0/1如超能胶囊
HP int `xml:"HP,attr,omitempty"` // 体力恢复量(体力药剂专属)
PP int `xml:"PP,attr,omitempty"` // 活力恢复量(活力药剂专属)
MaxHPUp int `xml:"MaxHPUp,attr,omitempty"` // 体力上限提升值(如初级体力上限提升药剂Ω)
MonAttrReset int `xml:"MonAttrReset,attr,omitempty"` // 精灵属性重置标识(精灵还原药剂)
MonNatureReset int `xml:"MonNatureReset,attr,omitempty"` // 精灵性格重置标识(性格重塑胶囊)
DecreMonLv int `xml:"DecreMonLv,attr,omitempty"` // 精灵降级数值(降级秘药)
DualEffectTimes int `xml:"DualEffectTimes,attr,omitempty"` // 双倍效果次数(双倍经验加速器)
AutoBtlTimes int `xml:"AutoBtlTimes,attr,omitempty"` // 自动战斗次数自动战斗器S型
EnergyAbsorbTimes int `xml:"EnergyAbsorbTimes,attr,omitempty"` // 能量吸收次数(能量吸收器)
NewSeIdx int `xml:"NewSeIdx,attr,omitempty"` // 能量珠索引(各类能量珠)
DualEvTimes int `xml:"DualEvTimes,attr,omitempty"` // 双倍学习力次数(学习力双倍仪)
YuanshenDegrade int `xml:"YuanshenDegrade,attr,omitempty"` // 融合精灵还原标识(融合精灵还原药剂)
EvRemove int `xml:"EvRemove,attr,omitempty"` // 学习力遗忘类型(各类学习力遗忘剂)
bShowPetBag int `xml:"bShowPetBag,attr,omitempty"` // 宠物背包显示标识(副融合精灵保留药剂等)
Pet *Pet `xml:"pet,omitempty"` // 精灵属性子节点
TeamPK *TeamPK `xml:"teamPK,omitempty"` // 要塞保卫战子节点