``` feat(fight): 添加尼尔尼奥变身逻辑并重构怪物生成模块
This commit is contained in:
@@ -517,3 +517,60 @@ func CalculateIndividualValue() int {
|
||||
a := grand.Intn(40001)
|
||||
return CalculateIndividual(a)
|
||||
}
|
||||
|
||||
// 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 float64 `json:"alpha,omitempty"`
|
||||
|
||||
// BlurX 水平模糊量,0~255(uint8),默认值 6
|
||||
BlurX uint8 `json:"blurX,omitempty"`
|
||||
|
||||
// BlurY 垂直模糊量,0~255(uint8),默认值 6
|
||||
BlurY uint8 `json:"blurY,omitempty"`
|
||||
|
||||
// Strength 发光强度,0~255(uint8),默认值 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"`
|
||||
}
|
||||
type ColorMatrixFilter struct {
|
||||
// Matrix 4×5 颜色变换矩阵,固定长度20的int8数组(不可变长度,避免越界)
|
||||
// 矩阵格式(行优先):
|
||||
// [ Rr, Rg, Rb, Ra, Ro, // 输出R = Rr*输入R + Rg*输入G + Rb*输入B + Ra*输入A + Ro
|
||||
// Gr, Gg, Gb, Ga, Go, // 输出G = Gr*输入R + Gg*输入G + Gb*输入B + Ga*输入A + Go
|
||||
// Br, Bg, Bb, Ba, Bo, // 输出B = Br*输入R + Bg*输入G + Bb*输入B + Ba*输入A + Bo
|
||||
// Ar, Ag, Ab, Aa, Ao ] // 输出A = Ar*输入R + Ag*输入G + Ab*输入B + Aa*输入A + Ao
|
||||
Matrix [20]uint8 `json:"matrix,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user