diff --git a/logic/controller/fight_pvp_king.go b/logic/controller/fight_pvp_king.go index c1941df4e..76350ef69 100644 --- a/logic/controller/fight_pvp_king.go +++ b/logic/controller/fight_pvp_king.go @@ -59,10 +59,15 @@ func (h Controller) PetKing(data *fight.PetKingJoinInboundInfo, c *player.Player case 6: c.Fightinfo.Mode = info.BattleMode.MULTI_MODE case 11: - c.Fightinfo.Mode = info.BattleMode.SINGLE_MODE - if c.GetPetInfo()[0].Type() != int(data.FightType) { + //草","水","火","电","战斗","飞行","机械","地面","冰" + // 按顺序:草、水、火、电、战斗、飞行、机械、地面、冰 + var ElementTypeNumbers = []int{1, 2, 3, 5, 11, 4, 6, 7, 9} + + println("11", c.GetPetInfo()[0].Type(), ElementTypeNumbers[data.FightType-1]) + if c.GetPetInfo()[0].Type() != int(ElementTypeNumbers[data.FightType-1]) { return nil, errorcode.ErrorCode(errorcode.ErrorCodes.ErrVictoryConditionNotMet) } + c.Fightinfo.Mode = info.BattleMode.SINGLE_MODE c.Fightinfo.FightType = data.FightType } err = c.JoinFight(func(p common.PlayerI) bool {