diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index e5a6cc6ea..a2c95dc6d 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -314,14 +314,16 @@ func (f *FightC) enterturn(fattack, sattack *action.SelectSkillAction) { f.closefight = true // break - } - if f.Info.Status == info.BattleMode.FIGHT_WITH_NPC { - if _, ok := defender.Player.(*player.AI_player); ok { - defender.GetAction(f.Our) - //panic("AI自动技能") - } + } else { + if f.Info.Status == info.BattleMode.FIGHT_WITH_NPC { + if _, ok := defender.Player.(*player.AI_player); ok { + defender.GetAction(f.Our) + //panic("AI自动技能") + } + } } + attacker.CanChange = true break } diff --git a/logic/service/fight/input.go b/logic/service/fight/input.go index 6614c2c7d..cbc2a80b1 100644 --- a/logic/service/fight/input.go +++ b/logic/service/fight/input.go @@ -162,12 +162,13 @@ func (f *FightC) initplayer(c common.PlayerI) (*input.Input, errorcode.ErrorCode initmeetpet() } for i, v := range meetpet { + v1 := v if len(in.AllPet) > 2 { break } - v.CatchTime = uint32(i) - in.AllPet = append(in.AllPet, info.CreateBattlePetEntity(v, f.rand)) + v1.CatchTime = c.GetInfo().UserID + uint32(i)*1000000 + in.AllPet = append(in.AllPet, info.CreateBattlePetEntity(v1, f.rand)) } //in.AllPet = in.AllPet[:3] @@ -276,7 +277,7 @@ func NewFight(p1, p2 common.PlayerI, fn func(*info.FightOverInfo)) (*FightC, err } f.Broadcast(func(ff *input.Input) { - //ff.InitEFFect(&f.FightStartOutboundInfo) + fmt.Println("战斗开始信息", ff.UserID) ff.Player.SendPackCmd(2503, &f.ReadyInfo) }) diff --git a/logic/service/fight/loop.go b/logic/service/fight/loop.go index d22925a8f..8dcced1d8 100644 --- a/logic/service/fight/loop.go +++ b/logic/service/fight/loop.go @@ -67,10 +67,6 @@ func (f *FightC) battleLoop() { } } - } else { - - //大乱斗,给个延迟 - <-time.After(500) } }) @@ -79,7 +75,11 @@ func (f *FightC) battleLoop() { f.callback(&f.FightOverInfo) //先执行回调,再执行返回信息,在回调内修改战斗判断 } + //大乱斗,给个延迟 + //<-time.After(1000) f.Broadcast(func(ff *input.Input) { + + fmt.Println("战斗结束信息", ff.UserID) ff.Player.SendPackCmd(2506, &f.FightOverInfo) ff.Player.QuitFight()