package controller import ( "blazing/common/socket/errorcode" "blazing/logic/service/fight" "blazing/logic/service/fight/info" "blazing/logic/service/player" ) //大乱斗 func (h Controller) PET_MELEE(data *fight.StartPetWarInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) { if !c.CanFight() { return nil, errorcode.ErrorCodes.ErrPokemonNotEligible } c.PVPinfo = &info.PVPinfo{ Mode: info.BattleMode.PET_MELEE, Status: info.BattleStatus.FIGHT_WITH_PLAYER} g := c.Pet_joinFight() if g != nil { fight.NewFight(info.BattleMode.PET_MELEE, info.BattleStatus.FIGHT_WITH_PLAYER, g, c, func(foi *info.FightOverInfo) { }) ///开始对战,房主方以及被邀请方 } return } func (h Controller) PET_King(data *fight.PetKingJoinInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) { if !c.CanFight() { return nil, errorcode.ErrorCodes.ErrPokemonNotEligible } c.PVPinfo = &info.PVPinfo{ Status: info.BattleStatus.FIGHT_WITH_PLAYER} switch data.Type { case 5: c.PVPinfo.Mode = info.BattleMode.SINGLE_MODE case 6: c.PVPinfo.Mode = info.BattleMode.MULTI_MODE } g := c.Pet_joinFight() if g != nil { switch data.Type { case 5: fight.NewFight(info.BattleMode.SINGLE_MODE, info.BattleStatus.FIGHT_WITH_PLAYER, g, c, func(foi *info.FightOverInfo) { }) ///开始对战,房主方以及被邀请方 case 6: fight.NewFight(info.BattleMode.MULTI_MODE, info.BattleStatus.FIGHT_WITH_PLAYER, g, c, func(foi *info.FightOverInfo) { }) ///开始对战,房主方以及被邀请方 } } return }