```
feat(pet): 完善宠物异色功能和战斗逻辑 - 优化宠物异色生成逻辑,当Ext不为0时使用Ext值生成异色效果 - 修复战斗中我方放弃出手时的先后手判断逻辑 - 更新宠物融合和还原操作的调试日志输出 ```
This commit is contained in:
@@ -52,6 +52,7 @@ func (h Controller) UsePetItemOutOfFight(data *item.C2S_USE_PET_ITEM_OUT_OF_FIGH
|
||||
}
|
||||
oldPetCatchTime := currentPet.CatchTime
|
||||
oldPet := c.Service.Pet.PetInfo_One_Unscoped(currentPet.OldCatchTime)
|
||||
println(c.Info.UserID, "还原", len(c.Info.PetList), currentPet.ID, oldPet.Data.ID)
|
||||
currentPet = &oldPet.Data
|
||||
currentPet.CatchTime = oldPetCatchTime
|
||||
} else {
|
||||
|
||||
@@ -76,11 +76,10 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
|
||||
|
||||
}
|
||||
c.Service.Pet.PetAdd(r)
|
||||
println(len(c.Info.PetList), data.Mcatchtime, data.Auxcatchtime, Mcatchpetinfo.CatchTime, Auxpetinfo.CatchTime)
|
||||
println(c.Info.UserID, "进行融合", len(c.Info.PetList), Mcatchpetinfo.ID, Auxpetinfo.ID, r.ID)
|
||||
c.PetDel(data.Auxcatchtime)
|
||||
c.PetDel(data.Mcatchtime)
|
||||
//fmt.Println(len(c.Info.PetList))
|
||||
// g.Dump(c.Info.PetList)
|
||||
|
||||
//todo材料扣除
|
||||
return &pet.PetFusionInfo{
|
||||
ObtainTime: r.CatchTime,
|
||||
|
||||
@@ -204,6 +204,9 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
|
||||
canUse := canUseSkill && action.CanUse(currentSkill) && attacker.CurrentPet.Info.Hp > 0
|
||||
|
||||
if !canUse {
|
||||
if i == 0 { //增加我方放弃出手时变成后手放判断
|
||||
f.Second, f.First = f.First, f.Second
|
||||
}
|
||||
attacker.RecoverEffect()
|
||||
currentSkill = nil
|
||||
} else {
|
||||
|
||||
@@ -46,36 +46,17 @@ type OgrePetInfo struct {
|
||||
}
|
||||
|
||||
func (o *OgrePetInfo) RandSHiny() {
|
||||
// o.ShinyInfo = make([]data.GlowFilter, 1)
|
||||
// // 假设 t 是包含 ShinyInfo 字段的结构体,ShinyInfo 是 GlowFilter 类型的切片
|
||||
// o.ShinyInfo[0] = data.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%,无颜色偏移
|
||||
var co *data.GlowFilter
|
||||
if o.Ext != 0 {
|
||||
co = config.NewShinyService().RandShiny(o.Ext)
|
||||
} else {
|
||||
co = config.NewShinyService().RandShiny(o.Id)
|
||||
}
|
||||
|
||||
// }
|
||||
co := config.NewShinyService().RandShiny(o.Id)
|
||||
if co != nil {
|
||||
o.ShinyInfo = append(o.ShinyInfo, *co)
|
||||
}
|
||||
//o.ShinyInfo[0].ColorMatrixFilter = GenerateRandomOffspringMatrix().Get()
|
||||
//g.Dump(ttt.ShinyInfo)
|
||||
// ttt.Shiny = 0 //待确认是否刷新异色
|
||||
|
||||
}
|
||||
|
||||
type Player struct {
|
||||
|
||||
Reference in New Issue
Block a user