refactor: 重构战斗初始化传递宠物列表
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-22 23:41:51 +08:00
committed by cnb
parent 61b0d6093f
commit 4fb5653c28
9 changed files with 65 additions and 68 deletions

View File

@@ -39,6 +39,19 @@ func (p *baseplayer) GetInfo() *model.PlayerInfo {
return p.Info
}
func (p *baseplayer) GetPetInfo(limitlevel uint32) []model.PetInfo {
var ret []model.PetInfo
for _, pet := range p.Info.PetList {
if limitlevel > 0 {
pet.Level = utils.Min(pet.Level, limitlevel)
ret = append(ret, pet)
}
}
return ret
}
func (f *baseplayer) InvitePlayer(ff common.PlayerI) {
}
@@ -82,10 +95,6 @@ func (f *baseplayer) SendPackCmd(_ uint32, _ any) {
}
func (p *baseplayer) GetPetInfo() []model.PetInfo {
return p.Info.PetList
}
func (p *baseplayer) ItemAdd(ItemId, ItemCnt int64) (result bool) {
return true
}