From bd09013d853f4c1856040fac9ffef9ec2d027164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Wed, 11 Mar 2026 23:38:51 +0800 Subject: [PATCH] =?UTF-8?q?```=20fix(fight):=20=E4=BF=AE=E5=A4=8D=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E6=95=88=E6=9E=9CID=E9=85=8D=E7=BD=AE=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复NewSeIdx_66.go中空指针检查,避免程序崩溃 - 修正effect/407.go中技能ID从138改为407 - 修正effect/440.go中技能ID从138改为440,并修复类型引用错误 - 修正effect/523.go中属性设置对象错误,从Ctx().Opp改为Ctx().Our - 修正effect_517.go中技能ID从452改为517 ``` --- logic/service/fight/boss/NewSeIdx_66.go | 3 ++ logic/service/fight/boss/NewSeIdx_67.go | 3 ++ logic/service/fight/effect/407.go | 2 +- logic/service/fight/effect/440.go | 2 +- logic/service/fight/effect/523.go | 2 +- logic/service/fight/effect/effect_517.go | 2 +- modules/player/controller/admin/pvp.go | 43 ++++++++++++++++++++++++ 7 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 modules/player/controller/admin/pvp.go diff --git a/logic/service/fight/boss/NewSeIdx_66.go b/logic/service/fight/boss/NewSeIdx_66.go index d6954164..5abdb4b5 100644 --- a/logic/service/fight/boss/NewSeIdx_66.go +++ b/logic/service/fight/boss/NewSeIdx_66.go @@ -15,6 +15,9 @@ func (e *NewSel66) Skill_Use() bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } + if e.Ctx().SkillEntity == nil { + return true + } if e.Ctx().SkillEntity.Category() != info.Category.PHYSICAL { return true } diff --git a/logic/service/fight/boss/NewSeIdx_67.go b/logic/service/fight/boss/NewSeIdx_67.go index 634cb49e..579f7a40 100644 --- a/logic/service/fight/boss/NewSeIdx_67.go +++ b/logic/service/fight/boss/NewSeIdx_67.go @@ -15,6 +15,9 @@ func (e *NewSel67) Skill_Use() bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } + if e.Ctx().SkillEntity == nil { + return true + } if e.Ctx().SkillEntity.Category() != info.Category.SPECIAL { return true } diff --git a/logic/service/fight/effect/407.go b/logic/service/fight/effect/407.go index 1487a648..ab6a828e 100644 --- a/logic/service/fight/effect/407.go +++ b/logic/service/fight/effect/407.go @@ -37,6 +37,6 @@ func (e *Effect407_sub) ActionStart(fattack *action.SelectSkillAction, sattack * } func init() { - input.InitEffect(input.EffectType.Skill, 138, &Effect407{}) + input.InitEffect(input.EffectType.Skill, 407, &Effect407{}) } diff --git a/logic/service/fight/effect/440.go b/logic/service/fight/effect/440.go index 70c17d8e..c275cc38 100644 --- a/logic/service/fight/effect/440.go +++ b/logic/service/fight/effect/440.go @@ -30,6 +30,6 @@ func (e *Effect440_sub) HookPP(count *int) bool { } func init() { - input.InitEffect(input.EffectType.Skill, 138, &Effect407{}) + input.InitEffect(input.EffectType.Skill, 440, &Effect440{}) } diff --git a/logic/service/fight/effect/523.go b/logic/service/fight/effect/523.go index 150620a7..e8dab837 100644 --- a/logic/service/fight/effect/523.go +++ b/logic/service/fight/effect/523.go @@ -15,7 +15,7 @@ func (e *Effect523) Action_end() bool { if e.Ctx().Opp.CurrentPet.Info.Hp > 0 { // 提升自身的全部能力等级 for i := 0; i < 6; i++ { - e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(e.SideEffectArgs[i])) + e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.SideEffectArgs[i])) } diff --git a/logic/service/fight/effect/effect_517.go b/logic/service/fight/effect/effect_517.go index ff81c78b..75e51cae 100644 --- a/logic/service/fight/effect/effect_517.go +++ b/logic/service/fight/effect/effect_517.go @@ -35,5 +35,5 @@ func (e *Effect517) OnSkill() bool { } func init() { - input.InitEffect(input.EffectType.Skill, 452, &Effect517{}) + input.InitEffect(input.EffectType.Skill, 517, &Effect517{}) } diff --git a/modules/player/controller/admin/pvp.go b/modules/player/controller/admin/pvp.go new file mode 100644 index 00000000..303c5493 --- /dev/null +++ b/modules/player/controller/admin/pvp.go @@ -0,0 +1,43 @@ +package admin + +import ( + "blazing/cool" + "blazing/modules/player/service" + "context" + + "github.com/gogf/gf/v2/frame/g" +) + +type PVPController struct { + *cool.Controller +} + +func init() { + var task_info_controller = &PVPController{ + &cool.Controller{ + Prefix: "/admin/game/pvp", + Api: []string{"Delete", "Update", "Info", "List", "Page"}, + Service: service.NewPVPService(0), //因为page已经过滤,所以这里需要改成0 + }, + } + // 注册路由 + cool.RegisterController(task_info_controller) +} + +type GetPVPReq struct { + g.Meta `path:"/get" method:"POST"` +} + +func (c *PVPController) Get(ctx context.Context, req *GetPVPReq) (res *cool.BaseRes, err error) { + res = &cool.BaseRes{} + //var ret []TitleRes + var ( + admin = cool.GetAdmin(ctx) + //r = g.RequestFromCtx(ctx) + ) + alltitile := service.NewPVPService(uint32(admin.UserId)).Get(uint32(admin.UserId)) + + res.Data = alltitile + return + +}