Files
bl/common/data/color.go
昔念 c9bc4be244 ```
feat: 添加ItemInfo结构体并重构抽蛋和任务系统

- 在common/data/color.go中添加ItemInfo结构体用于表示发放物品的信息
- 在common/utils/tomap.go中添加RandomSlice泛型函数用于从切片中随机选取元素
- 重构action_egg.go中的EggGamePlay功能,实现抽蛋逻辑和物品发放
- 更新fight_boss.go中使用新的ItemInfo结构体替换旧的model.ItemInfo
- 修改user_talk.go中获取物品数量的逻辑
- 更新user_task.go中任务完成逻辑使用新的ItemInfo结构体
- 在egg.go中更新抽蛋结果结构体使用ItemInfo
- 更新战斗奖励结构体使用ItemInfo
- 在player.go中添加学习力道具处理逻辑
- 重构任务系统使用新的ItemInfo结构体
- 移除旧的model.ItemInfo定义
- 更新宠物奖励配置模型添加成长值等字段
- 实现GetEgg方法用于获取扭蛋奖励
- 修复宠物融合材料服务中的道具验证逻辑
```
2025-12-26 20:38:08 +08:00

58 lines
2.0 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 data
// 1. 质量枚举常量(保持不变)
const (
BitmapFilterQualityLow = 1 // LOW应用1次滤镜
BitmapFilterQualityMedium = 2 // MEDIUM应用2次滤镜
BitmapFilterQualityHigh = 3 // HIGH应用3次滤镜最大值
)
// 2. 调整取值范围常量为 uint8 类型(贴合 0-255 范围)
const (
alphaMin = 0.0
alphaMax = 1.0
blurMin uint8 = 0 // BlurX/BlurY 最小值
blurMax uint8 = 255 // BlurX/BlurY 最大值uint8上限
strengthMin uint8 = 0 // Strength 最小值
strengthMax uint8 = 255 // Strength 最大值uint8上限
qualityMin = BitmapFilterQualityLow
qualityMax = BitmapFilterQualityHigh
colorMax = 0xFFFFFF // 颜色值最大值0xRRGGBB
)
// 精灵加shinylen字段
// 3. 核心结构体BlurX/BlurY/Strength 改为 uint8
type GlowFilter struct {
// Color 光晕颜色,十六进制格式 0xRRGGBB默认值 0xFF0000红色
Color uint32 `json:"color,omitempty"`
// Alpha 透明度0.0~1.0浮点型无法用uint8保留float64
Alpha float32 `json:"alpha,omitempty"`
// BlurX 水平模糊量0~255uint8默认值 6
BlurX uint8 `json:"blurX,omitempty"`
// BlurY 垂直模糊量0~255uint8默认值 6
BlurY uint8 `json:"blurY,omitempty"`
// Strength 发光强度0~255uint8默认值 2
Strength uint8 `json:"strength,omitempty"`
// Quality 滤镜应用次数1~3默认值 1
Quality int `json:"quality,omitempty"`
// Inner 是否内侧发光,默认 false
Inner bool `json:"inner,omitempty"`
// Knockout 是否挖空,默认 false
Knockout bool `json:"knockout,omitempty"`
ColorMatrixFilter [20]float32 `json:"matrix,omitempty"`
}
// ItemInfo
// 用于表示发放物品的信息
type ItemInfo struct {
ItemId uint32 `json:"itemId" description:"发放物品ID"` // 发放物品ID
ItemCnt uint32 `json:"itemCount" description:"发放物品的数量"` // 发放物品的数量,
}