refactor(item): 统一物品操作接口并优化金币处理逻辑

This commit is contained in:
1
2025-12-16 06:54:27 +00:00
parent 39dc79f706
commit 49b4c8cf2a
10 changed files with 47 additions and 28 deletions

View File

@@ -163,17 +163,22 @@ func (f *FightC) initplayer(c common.PlayerI) (*input.Input, errorcode.ErrorCode
}
in.SortPet()
if len(in.AllPet) == 0 {
return nil, errorcode.ErrorCodes.ErrNoEligiblePokemon
}
switch f.Info.Mode {
case info.BattleMode.SINGLE_MODE:
in.AllPet = in.AllPet[:1]
case info.BattleMode.PET_MELEE:
in.AllPet = make([]*info.BattlePetEntity, 0)
if len(meetpet) == 0 {
initmeetpet()
}
// if len(meetpet) == 0 {
// initmeetpet()
// }
r := service.NewMELEEService().Def()
if len(r) == 0 {
return nil, errorcode.ErrorCodes.ErrNoEligiblePokemon
}
for i, v := range r {
if v.Lv == 0 {