``` refactor(fight): 重构精灵切换逻辑,将切换效果处理移至回合收集阶段并优化闪光字段结构
This commit is contained in:
@@ -108,8 +108,12 @@ type PetInfo struct {
|
||||
SkinID uint32 `fieldDesc:"皮肤id默认为0" `
|
||||
|
||||
// 是否闪光(@UInt long → uint32,0=否,1=是)
|
||||
Shiny uint32 `fieldDesc:"是不是闪" `
|
||||
// AbilityType uint32 `struc:"skip"` //特性
|
||||
ShinyLen uint32 `struc:"sizeof=Shiny"`
|
||||
Shiny []GlowFilter
|
||||
|
||||
//时间轮转,然后effect根据type同时只共存一个,特性是1 特质是1,柱子是两种,魂印是一个,然后异色字段,然后特训技能字段
|
||||
ExtSKill []uint32 `struc:"skip"` //特训技能
|
||||
|
||||
}
|
||||
|
||||
// 定义常量,提升可维护性(避免魔法数字)
|
||||
@@ -237,6 +241,7 @@ func (pet *PetInfo) RnadAN() {
|
||||
}
|
||||
}
|
||||
|
||||
// 1是特性特质,<!-- Stat: 精灵特效Stat: 0: 无效(默认值), 1: 永久, 2: 有`有效次数'的特效 3: 爆发特效 4: 异能精灵特质,5特训,6魂印-->
|
||||
func (pet *PetInfo) GetEffect(ptype int) (int, *PetEffectInfo, bool) {
|
||||
|
||||
return utils.FindWithIndex(pet.EffectInfo, func(item PetEffectInfo) bool {
|
||||
@@ -411,7 +416,8 @@ func GenPetInfo(
|
||||
|
||||
// ---- 处理闪光 ----
|
||||
if shinyid != -1 {
|
||||
p.Shiny = uint32(shinyid)
|
||||
//todo 待实现异色字段
|
||||
// p.Shiny = uint32(shinyid)
|
||||
}
|
||||
|
||||
// ---- 性格 ----
|
||||
@@ -565,14 +571,6 @@ type GlowFilter struct {
|
||||
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"`
|
||||
Knockout bool `json:"knockout,omitempty"`
|
||||
ColorMatrixFilter [20]uint8 `json:"matrix,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user