From 2633402b52ddcf598b4b3cfc349bad52338e9d01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <1@72wo.cn> Date: Tue, 9 Dec 2025 11:19:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(fight=5Fboss):=20=E4=BF=AE=E5=A4=8D=20boss?= =?UTF-8?q?=20=E6=88=98=E6=96=97=E4=B8=AD=E7=B4=A2=E5=BC=95=E4=B8=BA=200?= =?UTF-8?q?=20=E7=9A=84=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当 effect 索引为 0 时,跳过无效处理以避免潜在错误。 feat(task): 更新任务奖励与注册参数配置 - 移除任务 37 中的注释项并保留有效奖励 - 修改任务 91 注册参数为 246 - 清空任务 300 的物品奖励列表,并设置类型为 30 refactor(fight_input): 优化 meetpet 初始化条件判断 将多个判断条件拆分为独立 if 判断语句,提高代码可读性。 refactor(effect_service): 移除 Scan 错误检查冗余逻辑 简化数据库查询后的错误处理流程,提升 --- logic/controller/fight_boss.go | 3 +++ logic/service/fight/input.go | 16 +++++++++++++--- logic/service/fight/input/input.go | 3 +++ logic/service/task/list.go | 6 +++--- modules/blazing/service/effect.go | 6 ++---- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/logic/controller/fight_boss.go b/logic/controller/fight_boss.go index aa3108d8..0b082b29 100644 --- a/logic/controller/fight_boss.go +++ b/logic/controller/fight_boss.go @@ -91,6 +91,9 @@ func (h Controller) PlayerFightBoss(data *fight.ChallengeBossInboundInfo, c *pla idx := gconv.Uint16(v) // eff := xmlres.EffectMAP[int(idx)] // args := strings.Split(eff.Args, " ") + if idx == 0 { + continue + } EID, args := service.Effects.Args(uint32(idx)) mo.EffectInfo = append(mo.EffectInfo, model.PetEffectInfo{ diff --git a/logic/service/fight/input.go b/logic/service/fight/input.go index 54adf9f0..e4f78b70 100644 --- a/logic/service/fight/input.go +++ b/logic/service/fight/input.go @@ -130,10 +130,20 @@ var meetpet = make(map[int]model.PetInfo) func initmeetpet() { meetpet = make(map[int]model.PetInfo) for i, v := range xmlres.PetMAP { - if v.EvolvesTo == 0 && v.EvolvFlag == 0 && v.ID < 2000 { - r := model.GenPetInfo(int(v.ID), 24, -1, -1, -1, 100) - meetpet[i] = *r + + if v.EvolvesTo != 0 { + continue } + if v.EvolvFlag != 0 { + continue + } + if v.ID > 2000 { + continue + } + + r := model.GenPetInfo(int(v.ID), 24, -1, -1, -1, 100) + + meetpet[i] = *r } } diff --git a/logic/service/fight/input/input.go b/logic/service/fight/input/input.go index 1d7b4583..bdf0f050 100644 --- a/logic/service/fight/input/input.go +++ b/logic/service/fight/input/input.go @@ -227,6 +227,9 @@ func (our *Input) Parseskill(skill *action.SelectSkillAction) { // t.Alive() //先让效果保持存活 our.EffectCache = append(our.EffectCache, t) // i.NewEffects = append(i.NewEffects, t) + } else { + println("技能效果不存在", v) + } temparg = temparg[args:] diff --git a/logic/service/task/list.go b/logic/service/task/list.go index 0ebfc53f..e3270ae3 100644 --- a/logic/service/task/list.go +++ b/logic/service/task/list.go @@ -59,7 +59,7 @@ func init() { RegisterTask(37, 0, []model.ItemInfo{ // 帕诺星系星球测绘 {1, 3000}, // 赛尔豆x3000 - // {700452, 1}, // 中型智慧芯片x1 + {100178, 1}, // 勘察头盔x1 {100179, 1}, // 勘察护腕x1 {100180, 1}, // 勘察腰带x1 @@ -187,7 +187,7 @@ func init() { RegisterTask(91, 0, []model.ItemInfo{ // 月光下的约定 {3, 2000}, // 累积经验x2000 {1, 2000}, // 赛尔豆x2000 - }, 0) + }, 246) RegisterTask(93, 0, []model.ItemInfo{ // 云霄星的新来客 {3, 1000}, // 累积经验x1000 @@ -215,7 +215,7 @@ func init() { }, 0) RegisterTask(201, 0, []model.ItemInfo{{100062, 1}}, 0) // 教官考核(教官指挥棒x1) - RegisterTask(300, 0, []model.ItemInfo{{400150, 1}}, 0) // 领取谱尼真身(谱尼的精元x1) + RegisterTask(300, 0, []model.ItemInfo{}, 300) // 领取谱尼真身(谱尼的精元x1) // -------------------------- 带精灵奖励的任务 -------------------------- RegisterTask(28, 0, []model.ItemInfo{}, 102) // 遗迹中的精灵信号(奇塔,类型102) diff --git a/modules/blazing/service/effect.go b/modules/blazing/service/effect.go index 9ca74f59..c453b6d1 100644 --- a/modules/blazing/service/effect.go +++ b/modules/blazing/service/effect.go @@ -17,10 +17,8 @@ func (s *EffectService) Args(id uint32) (int, []int) { m := cool.DBM(s.Model).Where("se_idx", id) var tt model.PlayerPetSpecialEffect - err := m.Scan(&tt) - if err != nil { - return 0, nil - } + m.Scan(&tt) + return tt, nil }, 0) tt := ret.Interface().(model.PlayerPetSpecialEffect)