1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-04-15 00:07:36 +08:00
parent de755f8fd0
commit 6f51a2e349
11 changed files with 242 additions and 125 deletions

View File

@@ -72,7 +72,7 @@ func startMapBossFight(
ai *player.AI_player,
fn func(model.FightOverInfo),
) (*fight.FightC, errorcode.ErrorCode) {
ourPets := p.GetPetInfo(100)
ourPets := p.GetPetInfo(p.CurrentMapPetLevelLimit())
oppPets := ai.GetPetInfo(0)
if mapNode != nil && mapNode.IsGroupBoss != 0 {
if len(ourPets) > 0 && len(oppPets) > 0 {
@@ -98,8 +98,8 @@ func (Controller) OnPlayerFightNpcMonster(req *FightNpcMonsterInboundInfo, p *pl
if err = p.CanFight(); err != 0 {
return nil, err
}
if req.Number > 9 {
return nil, errorcode.ErrorCodes.ErrSystemError
if int(req.Number) >= len(p.Data) {
return nil, errorcode.ErrorCodes.ErrPokemonNotHere
}
refPet := p.Data[req.Number]
@@ -114,7 +114,7 @@ func (Controller) OnPlayerFightNpcMonster(req *FightNpcMonsterInboundInfo, p *pl
p.Fightinfo.Status = fightinfo.BattleMode.FIGHT_WITH_NPC
p.Fightinfo.Mode = fightinfo.BattleMode.MULTI_MODE
_, err = fight.NewFight(p, ai, p.GetPetInfo(100), ai.GetPetInfo(0), func(foi model.FightOverInfo) {
_, err = fight.NewFight(p, ai, p.GetPetInfo(p.CurrentMapPetLevelLimit()), ai.GetPetInfo(0), func(foi model.FightOverInfo) {
handleNpcFightRewards(p, foi, monster)
})
if err != 0 {
@@ -236,7 +236,7 @@ func shouldGrantBossWinBonus(fightC *fight.FightC, playerID uint32, bossConfig c
func buildNpcMonsterInfo(refPet player.OgrePetInfo, mapID uint32) (*model.PetInfo, *model.PlayerInfo, errorcode.ErrorCode) {
if refPet.ID == 0 {
return nil, nil, errorcode.ErrorCodes.ErrPokemonNotExists
return nil, nil, errorcode.ErrorCodes.ErrPokemonNotHere
}
monster := model.GenPetInfo(