From 53d4fafe731a7f3e88c86b03b9ac2c80ab3c58f2 Mon Sep 17 00:00:00 2001 From: 1 <1@72wo.cn> Date: Tue, 23 Sep 2025 16:48:40 +0000 Subject: [PATCH] =?UTF-8?q?refactor(fight/item/ai):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E4=BD=93=E5=88=9D=E5=A7=8B=E5=8C=96=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E7=A7=BB=E9=99=A4=E5=86=97=E4=BD=99End?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=B9=B6=E6=B8=85=E7=90=86AI=5Fplayer?= =?UTF-8?q?=E6=88=98=E6=96=97=E7=BB=93=E6=9D=9F=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/controller/fight.go | 2 +- logic/controller/item.go | 2 +- logic/service/player/ai.go | 7 +------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/logic/controller/fight.go b/logic/controller/fight.go index d2887052..c721a3e7 100644 --- a/logic/controller/fight.go +++ b/logic/controller/fight.go @@ -92,7 +92,7 @@ func (h Controller) OnPlayerHandleFightInvite(data *fight.HandleFightInviteInbou // 邀请其他人进行战斗 func (h Controller) OnPlayerInviteOtherFight(data *fight.InviteToFightInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) { - c.InvitePlayerToBattle(&info.PVPinfo{data.UserID, data.Mode}) + c.InvitePlayerToBattle(&info.PVPinfo{PlayerID: data.UserID, Mode: data.Mode}) return nil, 0 } diff --git a/logic/controller/item.go b/logic/controller/item.go index d08e2461..14312268 100644 --- a/logic/controller/item.go +++ b/logic/controller/item.go @@ -28,6 +28,6 @@ func (h Controller) PlayerGoldCount(data *item.GoldOnlineRemainInboundInfo, c *p return &item.GoldOnlineRemainOutboundInfo{ - uint32(c.Info.GoldBean) * 100, + GoldNumber: uint32(c.Info.GoldBean) * 100, }, 0 } diff --git a/logic/service/player/ai.go b/logic/service/player/ai.go index 14b24eb5..5f8086cc 100644 --- a/logic/service/player/ai.go +++ b/logic/service/player/ai.go @@ -13,7 +13,6 @@ type AI_player struct { CanCapture bool } - func (f *AI_player) SendPack(b []byte) error { return nil @@ -31,6 +30,7 @@ func (f *AI_player) SendNoteReadyToFightInfo(fs info.NoteReadyToFightInfo) { } func (f *AI_player) SendFightEndInfo(_ info.FightOverInfo) { + f.FightC = nil //fmt.Println("战斗结束") } @@ -38,11 +38,6 @@ func (f *AI_player) GetAction() { //使用1#技能,实际上要按照四个技能权重去使用 f.FightC.UseSkill(f, int32(f.FightC.GetCurrPET(f).Skills[0].ID)) } -func (p *AI_player) End() { - p.FightC = nil - - return -} func (p *AI_player) GetPetInfo() []model.PetInfo {