From b86ab8d5a923e882ebbdc42e6325a4f3f4a96f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <1@72wo.cn> Date: Wed, 31 Dec 2025 00:57:28 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(pet):=20=E5=AE=8C=E5=96=84=E5=AE=A0?= =?UTF-8?q?=E7=89=A9=E5=BC=82=E8=89=B2=E5=8A=9F=E8=83=BD=E5=92=8C=E6=88=98?= =?UTF-8?q?=E6=96=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优化宠物异色生成逻辑,当Ext不为0时使用Ext值生成异色效果 - 修复战斗中我方放弃出手时的先后手判断逻辑 - 更新宠物融合和还原操作的调试日志输出 ``` --- logic/controller/item_use.go | 1 + logic/controller/pet_fusion.go | 5 ++--- logic/service/fight/fightc.go | 3 +++ logic/service/player/player.go | 33 +++++++-------------------------- 4 files changed, 13 insertions(+), 29 deletions(-) diff --git a/logic/controller/item_use.go b/logic/controller/item_use.go index 4650243c..2e094f7e 100644 --- a/logic/controller/item_use.go +++ b/logic/controller/item_use.go @@ -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 { diff --git a/logic/controller/pet_fusion.go b/logic/controller/pet_fusion.go index ee5f9f26..6c771e18 100644 --- a/logic/controller/pet_fusion.go +++ b/logic/controller/pet_fusion.go @@ -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, diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index f0bc5646..bfe010c6 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -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 { diff --git a/logic/service/player/player.go b/logic/service/player/player.go index 753cd74e..7225443d 100644 --- a/logic/service/player/player.go +++ b/logic/service/player/player.go @@ -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 {