refactor(item): 统一物品操作接口并优化金币处理逻辑
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user