Exemplo n.º 1
0
        public bool playerPortal(Player player, LioInfo.Portal portal)
        {
            _arena.sendArenaMessage("Portal ID: " + portal.GeneralData.Id);

            Vector2 SpawnLocation =
                caverns.GetNextWarp(player._team._id, portal.GeneralData.Id);

            if (SpawnLocation != null)
            {
                //Just warp them there and ignore everything else
                //   player.warp(SpawnLocation.x, SpawnLocation.y);
                return(false);
            }

            List <Arena.FlagState> carried = _arena._flags.Values.Where(flag => flag.carrier == player).ToList();

            foreach (Arena.FlagState carry in carried)
            {   //If the terrain number is 0-15
                int terrainNum = player._arena.getTerrainID(player._state.positionX, player._state.positionY);
                if (terrainNum >= 0 && terrainNum <= 15)
                {   //Check the FlagDroppableTerrains for that specific terrain id
                    if (carry.flag.FlagData.FlagDroppableTerrains[terrainNum] == 0)
                    {
                        _arena.flagResetPlayer(player);
                    }
                }
            }

            return(true);
        }