feat(player): 重构怪物闪光效果生成逻辑并优化颜色矩阵随机算法
- 移除了 Monster.go 中对 `model.GlowFilter` 的直接构造逻辑,改用统一的 `RandSHiny()` 方法处理异色光晕配置 - 新增 `RandomMatrixNoSingleColorBright` 和 `RandomMatrixNoSingleColorBrightDefault` 函数,增强颜色矩阵生成的灵活性和亮度控制能力 - 修复可能因全拷贝模式导致图像单一色彩的问题,确保至少有一行使用偏移量 - 增加 redBias 和 brightnessScale 参数支持,提升颜色多样性和视觉表现力 - 使用
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/space"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"blazing/modules/base/service"
|
||||
|
||||
@@ -46,6 +47,36 @@ type OgrePetInfo struct {
|
||||
Ext uint32 `struc:"skip"` //是否变尼尔尼奥
|
||||
}
|
||||
|
||||
func (o *OgrePetInfo) RandSHiny() {
|
||||
o.ShinyInfo = make([]model.GlowFilter, 1)
|
||||
// 假设 t 是包含 ShinyInfo 字段的结构体,ShinyInfo 是 GlowFilter 类型的切片
|
||||
o.ShinyInfo[0] = model.GlowFilter{
|
||||
// 光晕颜色:白色(十六进制 0xFFFFFF),符合 uint32 类型
|
||||
Color: 65535,
|
||||
// 透明度:0.8(0.0~1.0 范围内的合理值,float64 类型)
|
||||
Alpha: 0.3,
|
||||
// 水平模糊量:10(0~255 范围内,uint8 类型,略高于默认值6)
|
||||
BlurX: 20,
|
||||
// 垂直模糊量:10(与 BlurX 对称,uint8 类型)
|
||||
BlurY: 20,
|
||||
// 发光强度:8(0~255 范围内,uint8 类型,略高于默认值2)
|
||||
Strength: 1,
|
||||
// 滤镜应用次数:2(1~3 范围内,int 类型,非默认值1)
|
||||
Quality: 2,
|
||||
// 内侧发光:true(bool 类型,模拟开启内侧发光)
|
||||
Inner: true,
|
||||
// 挖空:false(bool 类型,保持默认逻辑)
|
||||
Knockout: false,
|
||||
// 颜色矩阵:标准 RGBA 矩阵(20个uint8,符合 [20]uint8 数组类型)
|
||||
// 矩阵含义:R=100%、G=100%、B=100%、A=100%,无颜色偏移
|
||||
|
||||
}
|
||||
|
||||
o.ShinyInfo[0].ColorMatrixFilter = RandomMatrixNoSingleColorBrightDefault(time.Now().Unix(), [5]uint8{0, 0, 0, 1, 0}, 0.6)
|
||||
//g.Dump(ttt.ShinyInfo)
|
||||
// ttt.Shiny = 0 //待确认是否刷新异色
|
||||
}
|
||||
|
||||
type Player struct {
|
||||
MainConn gnet.Conn
|
||||
baseplayer
|
||||
|
||||
Reference in New Issue
Block a user