コード例 #1
0
        public Celda(short _id, bool esta_activa, TipoCelda _tipo, bool _es_linea_vision, byte _nivel, byte _slope, short _objeto_interactivo_id, short _layer_object_1_num, short _layer_object_2_num, Mapa _mapa)
        {
            id     = _id;
            activa = esta_activa;
            tipo   = _tipo;

            layer_object_1_num = _layer_object_1_num;
            layer_object_2_num = _layer_object_2_num;

            es_linea_vision       = _es_linea_vision;
            layer_ground_nivel    = _nivel;
            layer_ground_slope    = _slope;
            objeto_interactivo_id = _objeto_interactivo_id;
            mapa = _mapa;

            if (objeto_interactivo_id != -1)
            {
                objeto_interactivo = new ObjetoInteractivo(objeto_interactivo_id, this);
            }

            byte mapa_anchura = mapa.anchura;
            int  _loc5        = id / ((mapa_anchura * 2) - 1);
            int  _loc6        = id - (_loc5 * ((mapa_anchura * 2) - 1));
            int  _loc7        = _loc6 % mapa_anchura;

            y = _loc5 - _loc7;
            x = (id - ((mapa_anchura - 1) * y)) / mapa_anchura;
        }
コード例 #2
0
        public Celda(short _id, TipoCelda _tipo, bool _es_linea_vision, byte _nivel, byte _slope, short _objeto_interactivo_id, short layer_object_1_num, short layer_object_2_num, Mapa _mapa)
        {
            id = _id;

            if (texturas_teleport.Contains(layer_object_1_num) || texturas_teleport.Contains(layer_object_2_num))
            {
                tipo = TipoCelda.CELDA_TELEPORT;
            }
            else if (_tipo == TipoCelda.CELDA_TELEPORT)
            {
                tipo = TipoCelda.CELDA_CAMINABLE;
            }
            else
            {
                tipo = _tipo;
            }

            es_linea_vision       = _es_linea_vision;
            layer_ground_nivel    = _nivel;
            layer_ground_slope    = _slope;
            objeto_interactivo_id = _objeto_interactivo_id;
            mapa = _mapa;

            if (objeto_interactivo_id != -1)
            {
                objeto_interactivo = new ObjetoInteractivo(objeto_interactivo_id, id);
            }

            byte mapa_anchura = mapa.anchura;
            int  _loc5        = id / ((mapa_anchura * 2) - 1);
            int  _loc6        = id - (_loc5 * ((mapa_anchura * 2) - 1));
            int  _loc7        = _loc6 % mapa_anchura;

            y = _loc5 - _loc7;
            x = (id - ((mapa_anchura - 1) * y)) / mapa_anchura;
        }