修复大乱斗问题
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-20 09:40:22 +08:00
parent 58440d5993
commit 53b18cfd0c
6 changed files with 37 additions and 17 deletions

View File

@@ -4,9 +4,8 @@ import (
"blazing/common/data"
"blazing/common/socket/errorcode"
"blazing/common/utils"
"blazing/modules/config/service"
config "blazing/modules/config/model"
"blazing/modules/player/model"
"encoding/json"
"blazing/logic/service/common"
@@ -34,6 +33,7 @@ type FightC struct {
Our *input.Input //始终等于房主ID
Opp *input.Input //对手ID
Switch map[uint32]*action.ActiveSwitchAction
Melee []config.PetBaseConfig
startl sync.Once
rand *rand.Rand
StartTime time.Time
@@ -159,23 +159,19 @@ func (f *FightC) initplayer(c common.PlayerI) (*input.Input, errorcode.ErrorCode
in.AllPet = in.AllPet[:1]
case info.BattleMode.PET_MELEE:
in.AllPet = make([]*info.BattlePetEntity, 0)
// if len(meetpet) == 0 {
// initmeetpet()
// }
r := service.NewMELEEService().Def()
if len(r) == 0 {
return nil, errorcode.ErrorCodes.ErrNoEligiblePokemon
var meetpet []config.PetBaseConfig
if c.GetInfo().UserID == f.ownerID {
meetpet = f.Melee[:3]
} else {
meetpet = f.Melee[3:]
}
for i, v := range r {
for i, v := range meetpet {
if v.Lv == 0 {
v.Lv = 100
}
// var effect int
// if len(v.Effect) > 0 {
// effect = int(v.Effect[0])
// }
pet := model.GenPetInfo(int(v.MonID), 24, int(v.Nature), int(v.Effect[0]), int(v.Lv), nil, 0)
var color data.GlowFilter