Exemple #1
0
    public void SetLightMin(coord coord)
    {
        depthCheck = 1;     //Maximum Number of Blocks in a row

        // Shoot Raycasts in all four directions
        RaycastHit[] hitsRightMin = Physics.RaycastAll(this.transform.position, this.transform.right, depthCheck);
        RaycastHit[] hitsLeftMin  = Physics.RaycastAll(this.transform.position, -this.transform.right, depthCheck);
        RaycastHit[] hitsFrontMin = Physics.RaycastAll(this.transform.position, this.transform.forward, depthCheck);
        RaycastHit[] hitsBackMin  = Physics.RaycastAll(this.transform.position, -this.transform.forward, depthCheck);
        RaycastHit[] hitsUpMin    = Physics.RaycastAll(this.transform.position, this.transform.up, depthCheck);
        RaycastHit[] hitsDownMin  = Physics.RaycastAll(this.transform.position, -this.transform.up, depthCheck);

        //Check hits list length
        hitsRightLengthMin = hitsRightMin.Length;
        hitsLeftLengthMin  = hitsLeftMin.Length;
        hitsFrontLengthMin = hitsFrontMin.Length;
        hitsBackLengthMin  = hitsBackMin.Length;
        hitsUpLengthMin    = hitsUpMin.Length;
        hitsDownLengthMin  = hitsDownMin.Length;
        //Debug.Log(hits.Length);
        if ((hitsRightLengthMin == 0 & hitsLeftLengthMin == 0) | (hitsFrontLengthMin == 0 & hitsBackLengthMin == 0))
        {
            //this.transform.localScale = new Vector3(1.4f,1.4f,1.4f);
            this.Light = true;
            this.rend.material.color = new Color(1.0f, 0.0f, 0.0f, 0.5f);
            this.rend.enabled        = true;
        }
    }
Exemple #2
0
    //why changes no push

    // Use this for initialization
    void Start()
    {
        map    = transform.parent.GetComponent <GenerateDungeon>().isFloor;
        exists = true;
        do
        {
            x = Random.Range(0, map.GetLength(0));
            y = Random.Range(0, map.GetLength(1));
        } while (!map[x, y]);
        patrolRoute[0] = new coord(x, y);
        do
        {
            x = Random.Range(0, map.GetLength(0));
            y = Random.Range(0, map.GetLength(1));
        } while (!map[x, y]);
        patrolRoute[1] = new coord(x, y);
        do
        {
            x = Random.Range(0, map.GetLength(0));
            y = Random.Range(0, map.GetLength(1));
        } while (!map[x, y]);
        patrolRoute[2] = new coord(x, y);
        do
        {
            x = Random.Range(0, map.GetLength(0));
            y = Random.Range(0, map.GetLength(1));
        } while (!map[x, y]);
        patrolRoute[3] = new coord(x, y);
        print("Patrol is |" + patrolRoute[0].x + "," + patrolRoute[0].y + "| -> |"
              + patrolRoute[1].x + "," + patrolRoute[1].y + "| -> |"
              + patrolRoute[2].x + "," + patrolRoute[2].y + "| -> |"
              + patrolRoute[3].x + "," + patrolRoute[3].y + "| -> |" + patrolRoute[0].x + "," + patrolRoute[0].y + "|");
    }
Exemple #3
0
    public void Initialize(int setX, int setY, int setZ, float setElementHeight)
    {
        int width  = levelGenerator.instance.width;
        int height = levelGenerator.instance.height;

        coord                     = new coord(setX, setY, setZ);
        this.name                 = "GE_" + this.coord.x + "_" + this.coord.y + "_" + this.coord.z;
        this.elementHeight        = setElementHeight;
        this.transform.localScale = new Vector3(1.0f, elementHeight, 1.0f);
        this.col                  = this.GetComponent <Collider>();
        this.rend                 = this.GetComponent <Renderer>();

        //setting corner elements
        corners[0] = levelGenerator.instance.cornerElements[coord.x + (width + 1) * (coord.z + (width + 1) * coord.y)];
        corners[1] = levelGenerator.instance.cornerElements[coord.x + 1 + (width + 1) * (coord.z + (width + 1) * coord.y)];
        corners[2] = levelGenerator.instance.cornerElements[coord.x + (width + 1) * (coord.z + 1 + (width + 1) * coord.y)];
        corners[3] = levelGenerator.instance.cornerElements[coord.x + 1 + (width + 1) * (coord.z + 1 + (width + 1) * coord.y)];
        corners[4] = levelGenerator.instance.cornerElements[coord.x + (width + 1) * (coord.z + (width + 1) * (coord.y + 1))];
        corners[5] = levelGenerator.instance.cornerElements[coord.x + 1 + (width + 1) * (coord.z + (width + 1) * (coord.y + 1))];
        corners[6] = levelGenerator.instance.cornerElements[coord.x + (width + 1) * (coord.z + 1 + (width + 1) * (coord.y + 1))];
        corners[7] = levelGenerator.instance.cornerElements[coord.x + 1 + (width + 1) * (coord.z + 1 + (width + 1) * (coord.y + 1))];

        //positioning corner elements
        corners[0].SetPosition(col.bounds.min.x, col.bounds.min.y, col.bounds.min.z);
        corners[1].SetPosition(col.bounds.max.x, col.bounds.min.y, col.bounds.min.z);
        corners[2].SetPosition(col.bounds.min.x, col.bounds.min.y, col.bounds.max.z);
        corners[3].SetPosition(col.bounds.max.x, col.bounds.min.y, col.bounds.max.z);
        corners[4].SetPosition(col.bounds.min.x, col.bounds.max.y, col.bounds.min.z);
        corners[5].SetPosition(col.bounds.max.x, col.bounds.max.y, col.bounds.min.z);
        corners[6].SetPosition(col.bounds.min.x, col.bounds.max.y, col.bounds.max.z);
        corners[7].SetPosition(col.bounds.max.x, col.bounds.max.y, col.bounds.max.z);
    }
 public void Initialize(int setX, int setY, int setZ)
 {
     coord     = new coord(setX, setY, setZ);
     this.name = "CE_" + coord.x + "_" + coord.y + "_" + coord.z;
     mesh      = this.GetComponent <MeshFilter>();
     rend      = this.GetComponent <Renderer>();
 }
Exemple #5
0
        int score  = 0; // набранные очки в игре

        Program()
        {
            this.Text            = "Snake";                              // заголовок формы
            this.FormBorderStyle = FormBorderStyle.FixedDialog;          // мышкой нельзя растягивать форму
            this.MaximizeBox     = false;                                // делаем недоступной кнопку "развернуть во весь экран"
            this.StartPosition   = FormStartPosition.CenterScreen;       // форма отображается по центру экрана
            this.DoubleBuffered  = true;                                 // для прорисовки

            int caption_size = SystemInformation.CaptionHeight;          // высота шапки формы
            int frame_size   = SystemInformation.FrameBorderSize.Height; // ширина границы формы

            // устанавливаем размер внутренней области формы W * H с учетом высоты шапки и ширины границ
            this.Size = new Size(W * S + 2 * frame_size, H * S + caption_size + 2 * frame_size);

            this.Paint   += new PaintEventHandler(Program_Paint); // привязываем обработчик прорисовки формы
            this.KeyDown += new KeyEventHandler(Program_KeyDown); // привязываем обработчик нажатий на кнопки

            timer.Interval = 200;                                 // таймер срабатывает раз в 200 милисекунд
            timer.Tick    += new EventHandler(timer_Tick);        // привязываем обработчик таймера
            timer.Start();                                        // запускаем таймер

            // делаем змею из трех сегментов, с начальными координатами внизу и по-центру формы
            snake.Add(new coord(W / 2, H - 3));
            snake.Add(new coord(W / 2, H - 2));
            snake.Add(new coord(W / 2, H - 1));

            apple = new coord(rand.Next(W), rand.Next(H)); // координаты яблока
        }
Exemple #6
0
    // Conventions:
    // top row = color 1
    // bottom row = color 2
    // (p1 wins iff a stone has neighbors with color 1 and 2)
    // left col = color -1
    // right col = color -2
    // (p2 wins iff a stone has neighbors with color 1 and 2)
    void Paint(coord start, sbyte oldcolor, sbyte newcolor)
    {
        Queue <coord> process = new Queue <coord> ();

        process.Enqueue(start);
        board [start.row, start.col] = newcolor;
        while (!(process.Count == 0))
        {
            coord current = process.Dequeue();
            for (int i = 0; i < 6; i++)
            {
                int nbrow = nbs [i, 0] + current.row;
                int nbcol = nbs [i, 1] + current.col;
                if (nbrow >= 0 && nbrow < _height && nbcol >= 0 && nbcol < _width)
                {
                    if (board [nbrow, nbcol] == oldcolor)
                    {
                        //Console.WriteLine ("Recoloring {0},{1} from color {2} to {3}", nbrow, nbcol, oldcolor, newcolor);
                        board [nbrow, nbcol] = newcolor;
                        process.Enqueue(new coord(nbrow, nbcol));
                    }
                }
            }
        }
    }
Exemple #7
0
        public void move(Tablero t)
        {
            //Actualitzacio dels sensors
            updateSensors(t);

            //Obtencio de les coordenades relatives al robot
            int W = ((int)direccio + 3) % 4;
            int N = (int)direccio;

            if (sensors[N] != 0 && (sensors[W] != 0 || memoria[W] == 0))
            {
                direccio = (coord)(((int)direccio + 1) % 4);
            }
            else if (sensors[W] == 0 && memoria[W] != 0)
            {
                direccio = (coord)(((int)direccio + 3) % 4);
            }
            else
            {
                //Avançam
                t.setCell(x, y, 0);
                calculaAvance(ref x, ref y);
                t.setCell(x, y, 2);
            }
            //Actualitzacio dels sensors i la memoria
            update(t);
        }
Exemple #8
0
    // Dig a maze
    void do_maze(room rp)
    {
        SPOT  sp;
        int   starty, startx;
        coord pos = new coord();

        for (int i = 0; i < NUMLINES / 3; i++)
        {
            for (int j = 0; j < NUMCOLS / 3; j++)
            {
                maze[i, j] = new SPOT();
            }
        }

        Maxy   = rp.r_max.y;
        Maxx   = rp.r_max.x;
        Starty = rp.r_pos.y;
        Startx = rp.r_pos.x;
        starty = (rnd(rp.r_max.y) / 2) * 2;
        startx = (rnd(rp.r_max.x) / 2) * 2;
        pos.y  = starty + Starty;
        pos.x  = startx + Startx;
        putpass(pos);
        dig(starty, startx);
    }
Exemple #9
0
    public coord getRandomCoord()
    {
        coord random = mixedCoords.Dequeue();

        mixedCoords.Enqueue(random);
        return(random);
    }
Exemple #10
0
    public Transform getRandomOpenTile()
    {
        coord random = mixedTileCoords.Dequeue();

        mixedTileCoords.Enqueue(random);
        return(tileMap[random.x, random.y]);
    }
Exemple #11
0
 public coord(int xP, int yP)
 {
     x         = xP;
     y         = yP;
     parent    = null;
     hasParent = false;
 }
Exemple #12
0
 public coord(int xP, int yP, coord myParent)
 {
     x         = xP;
     y         = yP;
     parent    = myParent;
     hasParent = true;
 }
 public state_e(coord speed, coord accel, float traveledDist, UInt32[] spare)
 {
     this.speed        = speed;
     this.accel        = accel;
     this.traveledDist = traveledDist;
     this.spare        = spare;
 }
    public void removeRowAbove()
    {
        if (level.rows <= 3)
        {
            return;
        }
        cacheLevel       = new Level();
        cacheLevel.rows  = level.rows - 1;
        cacheLevel.cols  = level.cols;
        cacheLevel.board = new int[cacheLevel.rows, cacheLevel.cols];
        fillOutline(cacheLevel);
        for (int r = 1; r < level.rows - 2; r++)
        {
            for (int c = 1; c < level.cols; c++)
            {
                int i = level.board[r, c];
                cacheLevel.board[r, c] = i;
            }
        }
        int j = 0; while (j < portalList.Count)

        {
            if (portalList[j].row >= level.rows)
            {
                coord vec = portalList[j];
                portalList.Remove(vec);
                coord vecOther = portalMapping[vec];
                portalMapping.Remove(vec);
                portalMapping.Remove(vecOther);
            }
        }
        level = cacheLevel;
        this.createAndPositionSquares(cacheLevel);
    }
Exemple #15
0
    public void SetLightMax(coord coord)
    {
        depthCheck = 2;     //Maximum Number of Blocks in a row

        // Shoot Raycasts in all four directions
        RaycastHit[] hitsRight = Physics.RaycastAll(this.transform.position, this.transform.right, depthCheck);
        RaycastHit[] hitsLeft  = Physics.RaycastAll(this.transform.position, -this.transform.right, depthCheck);
        RaycastHit[] hitsFront = Physics.RaycastAll(this.transform.position, this.transform.forward, depthCheck);
        RaycastHit[] hitsBack  = Physics.RaycastAll(this.transform.position, -this.transform.forward, depthCheck);

        //Check hits list length
        hitsRightLength = hitsRight.Length;
        hitsLeftLength  = hitsLeft.Length;
        hitsFrontLength = hitsFront.Length;
        hitsBackLength  = hitsBack.Length;
        //Debug.Log(hits.Length);
        if (hitsRightLength > (depthCheck - 1) & hitsLeftLength > (depthCheck - 1) & hitsFrontLength > (depthCheck - 1) & hitsBackLength > (depthCheck - 1))
        {
            //this.transform.localScale = new Vector3(1.4f,1.4f,1.4f);
            this.Light = false;
            this.rend.material.color = new Color(1.0f, 0.0f, 0.0f, 0.5f);
            this.rend.enabled        = true;
        }

        else
        {
            //this.transform.localScale = new Vector3(1,1,1);
            this.Light        = true;
            this.rend.enabled = false;
            //this.rend.material.color = Color.green;
        }
    }
Exemple #16
0
    // Bamf the hero someplace else
    void teleport()
    {
        coord c = new coord();

        mvaddch(hero.y, hero.x, floor_at());
        find_floor(null, out c, 0, true);
        if (roomin(c) != proom)
        {
            leave_room(hero);
            hero.CopyFrom(c);
            enter_room(hero);
        }
        else
        {
            hero.CopyFrom(c);
            look(true);
        }
        mvaddch(hero.y, hero.x, PLAYER);
        /*
         * turn off ISHELD in case teleportation was done while fighting
         * a Flytrap
         */
        if (on(player, ISHELD))
        {
            player.t_flags &= ~ISHELD;
            vf_hit = 0;
            monsters['F' - 'A'].m_stats.s_dmg = "000x0";
        }
        no_move = 0;
        count = 0;
        running = false;
        //flush_type();
    }
Exemple #17
0
    // Drop an item someplace around here.
    void fall(THING obj, bool pr)
    {
        PLACE pp;
        coord fpos = new coord();

        if (fallpos(obj.o_pos, fpos))
        {
            pp = INDEX(fpos.y, fpos.x);
            pp.p_ch = (char)obj.o_type;
            obj.o_pos.CopyFrom(fpos);
            if (cansee(fpos.y, fpos.x))
            {
                if (pp.p_monst != null)
                    pp.p_monst.t_oldch = (char)obj.o_type;
                else
                    mvaddch(fpos.y, fpos.x, obj.o_type);
            }
            attach(ref lvl_obj, obj);
            return;
        }
        if (pr)
        {
            if (has_hit)
            {
                endmsg();
                has_hit = false;
            }
            msg("the {0} vanishes as it hits the ground",
            weap_info[obj.o_which].oi_name);
        }
        discard(obj);
    }
Exemple #18
0
    // Erase the area shown by a lamp in a dark room.
    void erase_lamp(coord pos, room rp)
    {
        int y, x, ey, sy, ex;

        if (!(see_floor && (rp.r_flags & (ISGONE | ISDARK)) == ISDARK &&
              !on(player, ISBLIND)))
        {
            return;
        }

        ey = pos.y + 1;
        ex = pos.x + 1;
        sy = pos.y - 1;
        for (x = pos.x - 1; x <= ex; x++)
        {
            for (y = sy; y <= ey; y++)
            {
                if (y == hero.y && x == hero.x)
                {
                    continue;
                }
                move(y, x);
                if (inch() == FLOOR)
                {
                    addch(' ');
                }
            }
        }
    }
Exemple #19
0
    // Add a door or possibly a secret door.  Also enters the door in
    // the exits array of the room.
    void door(room rm, coord cp)
    {
        PLACE pp;

        rm.r_exit[rm.r_nexits++].CopyFrom(cp);

        if ((rm.r_flags & ISMAZE) == ISMAZE)
        {
            return;
        }

        pp = INDEX(cp.y, cp.x);
        if (rnd(10) + 1 < level && rnd(5) == 0)
        {
            if (cp.y == rm.r_pos.y || cp.y == rm.r_pos.y + rm.r_max.y - 1)
            {
                pp.p_ch = '-';
            }
            else
            {
                pp.p_ch = '|';
            }
            pp.p_flags &= ~F_REAL;
        }
        else
        {
            pp.p_ch = DOOR;
        }
    }
Exemple #20
0
    // Remove a monster from the screen
    void remove_mon(coord mp, THING tp, bool waskill)
    {
        THING obj, nexti;

        for (obj = tp.t_pack; obj != null; obj = nexti)
        {
            nexti = next(obj);
            obj.o_pos.CopyFrom(tp.t_pos);
            detach(ref tp.t_pack, obj);
            if (waskill)
            {
                fall(obj, false);
            }
            else
            {
                discard(obj);
            }
        }
        moat(mp.y, mp.x, null);
        mvaddch(mp.y, mp.x, tp.t_oldch);
        detach(ref mlist, tp);
        if (on(tp, ISTARGET))
        {
            kamikaze = false;
            to_death = false;
            if (fight_flush)
            {
                //flush_type()
                ;
            }
        }
        discard(tp);
    }
Exemple #21
0
    // Create a new wandering monster and aim it at the player
    void wanderer()
    {
        THING tp;
        coord cp = new coord();

        tp = new_item();
        do
        {
            find_floor(null, out cp, 0, true);
        }while (roomin(cp) == proom);
        new_monster(tp, randmonster(true), cp);
        if (on(player, SEEMONST))
        {
            standout();
            if (!on(player, ISHALU))
            {
                addch(tp.t_type);
            }
            else
            {
                addch(rnd(26) + 'A');
            }
            standend();
        }
        runto(tp.t_pos);
        if (wizard)
        {
            msg("started a wandering {0}", monsters[tp.t_type - 'A'].m_name);
        }
    }
Exemple #22
0
    // Returns true if the hero can see a certain coordinate.
    bool cansee(int y, int x)
    {
        room  rer;
        coord tp = new coord();

        if (on(player, ISBLIND))
        {
            return(false);
        }
        if (dist(y, x, hero.y, hero.x) < LAMPDIST)
        {
            if ((flat(y, x) & F_PASS) != 0)
            {
                if (y != hero.y && x != hero.x && !step_ok(chat(y, hero.x)) && !step_ok(chat(hero.y, x)))
                {
                    return(false);
                }
            }
            return(true);
        }

        /*
         * We can only see if the hero in the same room as
         * the coordinate and the room is lit or if it is close.
         */
        tp.y = y;
        tp.x = x;
        return((bool)((rer = roomin(tp)) == proom && !((rer.r_flags & ISDARK) != 0)));
    }
Exemple #23
0
        int way = 0; // направление движения змеи: 0 - вверх, 1 - вправо, 2 - вниз, 3 - влево

        #endregion Fields

        #region Constructors

        Program()
        {
            this.Text = "Snake"; // заголовок формы
            this.FormBorderStyle = FormBorderStyle.FixedDialog; // мышкой нельзя растягивать форму
            this.MaximizeBox = false; // делаем недоступной кнопку "развернуть во весь экран"
            this.StartPosition = FormStartPosition.CenterScreen; // форма отображается по центру экрана
            this.DoubleBuffered = true; // для прорисовки

            int caption_size = SystemInformation.CaptionHeight; // высота шапки формы
            int frame_size = SystemInformation.FrameBorderSize.Height; // ширина границы формы
            // устанавливаем размер внутренней области формы W * H с учетом высоты шапки и ширины границ
            this.Size = new Size(W * S + 2 * frame_size, H * S + caption_size + 2 * frame_size);

            this.Paint += new PaintEventHandler(Program_Paint); // привязываем обработчик прорисовки формы
            this.KeyDown += new KeyEventHandler(Program_KeyDown); // привязываем обработчик нажатий на кнопки

            timer.Interval = 200; // таймер срабатывает раз в 200 милисекунд
            timer.Tick += new EventHandler(timer_Tick); // привязываем обработчик таймера
            timer.Start(); // запускаем таймер

            // делаем змею из трех сегментов, с начальными координатами внизу и по-центру формы
            snake.Add(new coord(W / 2, H - 3));
            snake.Add(new coord(W / 2, H - 2));
            snake.Add(new coord(W / 2, H - 1));

            apple = new coord(rand.Next(W), rand.Next(H)); // координаты яблока
        }
Exemple #24
0
    // Bamf the hero someplace else
    void teleport()
    {
        coord c = new coord();

        mvaddch(hero.y, hero.x, floor_at());
        find_floor(null, out c, 0, true);
        if (roomin(c) != proom)
        {
            leave_room(hero);
            hero.CopyFrom(c);
            enter_room(hero);
        }
        else
        {
            hero.CopyFrom(c);
            look(true);
        }
        mvaddch(hero.y, hero.x, PLAYER);

        /*
         * turn off ISHELD in case teleportation was done while fighting
         * a Flytrap
         */
        if (on(player, ISHELD))
        {
            player.t_flags &= ~ISHELD;
            vf_hit          = 0;
            monsters['F' - 'A'].m_stats.s_dmg = "000x0";
        }
        no_move = 0;
        count   = 0;
        running = false;
        //flush_type();
    }
Exemple #25
0
        public coord[] r_exit = new coord[12];  /* Where the exits are */

        public room()
        {
            for (int i = 0; i < r_exit.Length; i++)
            {
                r_exit[i] = new coord();
            }
        }
Exemple #26
0
    // Pick a random position around the give (y, x) coordinates
    bool fallpos(coord pos, coord newpos)
    {
        int y, x, cnt, ch;

        cnt = 0;
        for (y = pos.y - 1; y <= pos.y + 1; y++)
        {
            for (x = pos.x - 1; x <= pos.x + 1; x++)
            {
                /*
                 * check to make certain the spot is empty, if it is,
                 * put the object there, set it in the level list
                 * and re-draw the room if he can see it
                 */
                if (y == hero.y && x == hero.x)
                {
                    continue;
                }
                if (((ch = chat(y, x)) == FLOOR || ch == PASSAGE) &&
                    rnd(++cnt) == 0)
                {
                    newpos.y = y;
                    newpos.x = x;
                }
            }
        }
        return((bool)(cnt != 0));
    }
Exemple #27
0
    // Does the missile hit the monster?
    bool hit_monster(int y, int x, THING obj)
    {
        coord mp = new coord();

        mp.y = y;
        mp.x = x;
        return(fight(mp, obj, true));
    }
    public void SetCurserButton(int input)
    {
        this.transform.localScale = new Vector3(0, 0, 0);
        coord coord  = lastHit.GetCoord();
        int   width  = levelGenerator.instance.width;
        int   height = levelGenerator.instance.height;

        switch (input)
        {
        case 0:
            //remove gridElement
            if (coord.y > 0)
            {
                lastHit.SetDisable();
            }
            break;

        case 1:
            //add X+
            if (coord.x < width - 1)
            {
                levelGenerator.instance.gridElements[coord.x + width * (coord.z + width * coord.y) + 1].SetEnable();
            }
            break;

        case 2:
            //add X-
            if (coord.x > 0)
            {
                levelGenerator.instance.gridElements[coord.x + width * (coord.z + width * coord.y) - 1].SetEnable();
            }
            break;

        case 3:
            //add Z+
            if (coord.z < width - 1)
            {
                levelGenerator.instance.gridElements[coord.x + width * (coord.z + 1 + width * coord.y)].SetEnable();
            }
            break;

        case 4:
            //add Z-
            if (coord.z > 0)
            {
                levelGenerator.instance.gridElements[coord.x + width * (coord.z - 1 + width * coord.y)].SetEnable();
            }
            break;

        case 5:
            //add Y+
            if (coord.y < height - 1)
            {
                levelGenerator.instance.gridElements[coord.x + width * (coord.z + width * (coord.y + 1))].SetEnable();
            }
            break;
        }
    }
Exemple #29
0
    public void SetCurserButton(int input)
    {
        coord coord  = lastHit.GetCoord();
        int   width  = constructor.instance.width;
        int   height = constructor.instance.height;

        switch (input)
        {
        case 0:
            //remove gridElement
            if (coord.y > 0)
            {
                //not that setDisable or enable will influence gridElement's cornerElements.
                lastHit.SetDisable();
            }
            break;

        case 1:
            //add X+
            if (coord.x < width - 1)
            {
                constructor.instance.gridElements[coord.x + width * (coord.z + width * coord.y) + 1].SetEnable();
            }
            break;

        case 2:
            //add X-
            if (coord.x > 0)
            {
                constructor.instance.gridElements[coord.x + width * (coord.z + width * coord.y) - 1].SetEnable();
            }
            break;

        case 3:
            //add Z+
            if (coord.z < width - 1)
            {
                constructor.instance.gridElements[coord.x + width * (coord.z + 1 + width * coord.y)].SetEnable();
            }
            break;

        case 4:
            //add Z-
            if (coord.z > 0)
            {
                constructor.instance.gridElements[coord.x + width * (coord.z - 1 + width * coord.y)].SetEnable();
            }
            break;

        case 5:
            //add Y+
            if (coord.y < height - 1)
            {
                constructor.instance.gridElements[coord.x + width * (coord.z + width * (coord.y + 1))].SetEnable();
            }
            break;
        }
    }
Exemple #30
0
    public bool Equals(coord otherCoord)
    {
        if ((System.Object)otherCoord == null)
        {
            return(false);
        }

        return(row == otherCoord.row && col == otherCoord.col);
    }
Exemple #31
0
 // The main loop of the program.  Loop until the game is over,
 // refreshing things and looking at the proper times.
 void playit()
 {
     oldpos = new coord();
     oldpos.CopyFrom(hero);
     oldrp = roomin(hero);
     while (playing)
         command();			/* Command execution */
     endit(0);
 }
Exemple #32
0
 public void Initialize(int setX, int setY, int setZ)
 {
     trans     = false;
     coord     = new coord(setX, setY, setZ);
     this.name = "CE_" + coord.x + "_" + coord.y + "_" + coord.z;
     mesh      = this.GetComponent <MeshFilter>();
     rend      = this.GetComponent <Renderer>();
     matTrans  = levelGenerator.instance.matTrans;
     matOpaq   = levelGenerator.instance.matOpaq;
 }
Exemple #33
0
    internal virtual int main2()
    {
        coord point = new coord();

        point.x = 10;
        point.y = 10;
        Console.WriteLine("X axis coord value is  " + point.x);
        Console.WriteLine("Y axis coord value is  " + point.y);
        return(0);
    }
Exemple #34
0
 // The main loop of the program.  Loop until the game is over,
 // refreshing things and looking at the proper times.
 void playit()
 {
     oldpos = new coord();
     oldpos.CopyFrom(hero);
     oldrp = roomin(hero);
     while (playing)
     {
         command();                  /* Command execution */
     }
     endit(0);
 }
Exemple #35
0
    int DRAGONSHOT = 5; // one chance in DRAGONSHOT that a dragon will flame

    #endregion Fields

    #region Methods

    // Returns true if the hero can see a certain coordinate.
    bool cansee(int y, int x)
    {
        room rer;
        coord tp = new coord();

        if (on(player, ISBLIND))
        return false;
        if (dist(y, x, hero.y, hero.x) < LAMPDIST)
        {
            if ((flat(y, x) & F_PASS) != 0)
                if (y != hero.y && x != hero.x && !step_ok(chat(y, hero.x)) && !step_ok(chat(hero.y, x)))
                    return false;
            return true;
        }
        /*
         * We can only see if the hero in the same room as
         * the coordinate and the room is lit or if it is close.
         */
        tp.y = y;
        tp.x = x;
        return (bool)((rer = roomin(tp)) == proom && !((rer.r_flags & ISDARK) != 0));
    }
Exemple #36
0
        // TODO: Perhaps some refactoring here.
        static bool hasTraveled(coord[] curr_path, List<coord[]> traveled_paths)
        {
            for (int j = 0; j < curr_path.Length; j++)
            {
                foreach (coord[] path in traveled_paths)
                {
                    bool path_traveled = true;

                    for (int i = 0; i < path.Length; i++)
                    {
                        if (path[i].x != curr_path[j].x && path[i].y != curr_path[j].y)
                        {
                            path_traveled = false;
                            break;
                        }
                    }
                    if (path_traveled)
                        return true;
                }
            }
            return false;   // if we got here we didn't find any paths traveled
        }
Exemple #37
0
 public void add(coord c)
 {
     size++;
     c.setHeapIndex(size);
     theHeap.Insert(size, c);
     coords[c.x][c.y] = c;
     int index = size;
     while (true)
     {
         coord current = theHeap[index];
         if (index / 2 < 1) break; // index is the head of the heap
         coord parent = theHeap[index / 2];
         if (current.compareTo(parent) > 0) break;
         swap(index / 2, index); //swap with parent
         index /= 2;
     }
 }
Exemple #38
0
 public void resetCosts()
 {
     for (int j = 0; j < width; j++)
     {
         for (int i = 0; i < length; i++)
         {
             double grad = coords[i][j].grad;
             char val = '.';
             if (coords[i][j].c == 'O')
                 val = 'O';
             if (i == startX && j == startY)
                 val = 'S';
             if (i == endX && j == endY)
                 val = 'F';
             coords[i][j] = new coord(i, j, grad);
             coords[i][j] = coords[i][j].setChar(val);
         }
     }
     clearHeap();
 }
 bool Chain_IsHighPriority(ArrayList ChainOfInfluences, coord coo)
 {
     if (coo.pos == (int)CONST.ROBBER || coo.pos == (int)CONST.ROBBER_NO || coo.pos == (int)CONST.ROBBER_NO__REAL || coo.pos == (int)CONST.ROBBER_TOTAL_SCORE)
         return true;
     else
         return false;
 }
Exemple #40
0
    public void solve()
    {
        if (!validStartEnd) return;
        heap.setHCosts();
        coord end = new coord(endX, endY, 0);
        heap.coords[startX][startY] = heap.coords[startX][startY].setParent(startX, startY);
        heap.coords[startX][startY] = heap.coords[startX][startY].setGCost(0);
        heap.add(heap.coords[startX][startY]);
        coord current;// = new coord(-1, -1, 0);
        while (!heap.empty())
        {
            current = heap.removeMin();

            if (current.equals(end)) break;
            heap.coords[current.x][current.y] = heap.coords[current.x][current.y].makeKnown();
            closed.Add(current);
            setCost(current, current.x - 1, current.y);
            setCost(current, current.x + 1, current.y);
            setCost(current, current.x, current.y - 1);
            setCost(current, current.x, current.y + 1);
            setCost(current, current.x - 1, current.y - 1);
            setCost(current, current.x + 1, current.y - 1);
            setCost(current, current.x - 1, current.y + 1);
            setCost(current, current.x + 1, current.y + 1);
        }
        Console.WriteLine("Open: " + heap.size);
        Console.WriteLine("Closed: " + closed.Count);
    }
Exemple #41
0
 void timer_Tick(object sender, EventArgs e)
 {
     // запоминаем координаты головы змеи
     int x = snake[0].X, y = snake[0].Y;
     // в зависимости от направления вычисляем где будет голова на следующем шаге
     // сделал чтобы при достижении края формы голова появлялась с противоположной стороны
     // и змея продолжала движение
     switch (way)
     {
         case 0:
             y--;
             if (y < 0)
                 y = H - 1;
             break;
         case 1:
             x++;
             if (x >= W)
                 x = 0;
             break;
         case 2:
             y++;
             if (y >= H)
                 y = 0;
             break;
         case 3:
             x--;
             if (x < 0)
                 x = W - 1;
             break;
     }
     coord c = new coord(x, y); // сегмент с новыми координатами головы
     snake.Insert(0, c); // вставляем его в начало списка сегментов змеи(змея выросла на один сегмент)
     if (snake[0].X == apple.X && snake[0].Y == apple.Y) // если координаты головы и яблока совпали
     {
         apple = new coord(rand.Next(W), rand.Next(H)); // располагаем яблоко в новых случайных координатах
         apples++; // увеличиваем счетчик собранных яблок
         score += stage; // увеличиваем набранные очки в игре: за каждое яблоко прибавляем количество равное номеру уровня
         if (apples % 10 == 0) // после каждого десятого яблока
         {
             stage++; // повышаем уровень
             timer.Interval -= 10; // и уменьшаем интервал срабатывания яблока
         }
     }
     else // если координаты головы и яблока не совпали - убираем последний сегмент змеи(т.к. ранее добавляли новую голову)
         snake.RemoveAt(snake.Count - 1);
     Invalidate(); // перерисовываем, т.е. идет вызов Program_Paint
 }
Exemple #42
0
        static void ProblemFifteen()
        {
            int x_len = 2, y_len = 2;
            int routes = 0;
            List<coord[]> traveled_paths = new List<coord[]>();
            bool more_paths = true;

            coord[] curr_path = new coord[x_len*y_len];
            coord pos = new coord();

            do
            {
                if (!hasTraveled(curr_path, traveled_paths))
                {

                }
            }
            while (pos.x != x_len && pos.y != y_len);
        }
Exemple #43
0
    // Set a monster running after the hero.
    void runto(coord runner)
    {
        THING tp;

        /*
         * If we couldn't find him, something is funny
         */
        tp = moat(runner.y, runner.x);
        /*
         * Start the beastie running
         */
        tp.t_flags |= ISRUN;
        tp.t_flags &= ~ISHELD;
        tp.t_dest = find_dest(tp);
    }
Exemple #44
0
    // Find what room some coordinates are in. NULL means they aren't
    // in any room.
    room roomin(coord cp)
    {
        int fp;

        fp = flat(cp.y, cp.x);
        if ((fp & F_PASS) != 0)
            return passages[fp & F_PNUM];

        foreach (var rp in rooms)
            if (cp.x <= rp.r_pos.x + rp.r_max.x && rp.r_pos.x <= cp.x
                && cp.y <= rp.r_pos.y + rp.r_max.y && rp.r_pos.y <= cp.y)
                return rp;

        msg("in some bizarre place ({0}, {1})", cp.y, cp.x);
        return null;
    }
Exemple #45
0
    // Make the monster's new location be the specified one, updating
    // all the relevant state.
    void relocate(THING th, coord new_loc)
    {
        room oroom;

        char symbol = th.t_disguise;

        if (!ce(new_loc, th.t_pos))
        {
            Debug.WriteLine(string.Format("{0} moved to {1}.", symbol, new_loc));

            mvaddch(th.t_pos.y, th.t_pos.x, th.t_oldch);
            th.t_room = roomin(new_loc);
            set_oldch(th, new_loc);
            oroom = th.t_room;
            moat(th.t_pos.y, th.t_pos.x, null);

            if (oroom != th.t_room)
            {
                Debug.WriteLine(string.Format("{0} moved into room {1}.", symbol, oroom));
                th.t_dest = find_dest(th);
            }

            th.t_pos.CopyFrom(new_loc);
            moat(new_loc.y, new_loc.x, th);
        }

        move(new_loc.y, new_loc.x);

        if (see_monst(th))
            addch(th.t_disguise);
        else if (on(player, SEEMONST))
        {
            standout();
            addch(th.t_type);
            standend();
        }
    }
Exemple #46
0
 // Call dist() with appropriate arguments for coord pointers
 int dist_cp(coord c1, coord c2)
 {
     return dist(c1.y, c1.x, c2.y, c2.x);
 }
Exemple #47
0
 // Check to see if the move is legal if it is diagonal
 bool diag_ok(coord sp, coord ep)
 {
     if (ep.x < 0 || ep.x >= NUMCOLS || ep.y <= 0 || ep.y >= NUMLINES - 1)
         return false;
     if (ep.x == sp.x || ep.y == sp.y)
         return true;
     return (bool)(step_ok(chat(ep.y, sp.x)) && step_ok(chat(sp.y, ep.x)));
 }
Exemple #48
0
 public bool equals(coord other)
 {
     if (x == other.x && y == other.y)
         return true;
     return false;
 }
Exemple #49
0
    // Set the oldch character for the monster
    void set_oldch(THING tp, coord cp)
    {
        char sch;

        if (ce(tp.t_pos, cp))
            return;

        sch = tp.t_oldch;
        tp.t_oldch = CCHAR(mvinch(cp.y, cp.x));
        if (!on(player, ISBLIND))
        {
            if ((sch == FLOOR || tp.t_oldch == FLOOR) && ((tp.t_room.r_flags & ISDARK) != 0))
                tp.t_oldch = ' ';
            else if (dist_cp(cp, hero) <= LAMPDIST && see_floor)
                tp.t_oldch = chat(cp.y, cp.x);
        }
    }
Exemple #50
0
    // Find the spot for the chaser(er) to move closer to the
    // chasee(ee).  Returns TRUE if we want to keep on chasing later
    // FALSE if we reach the goal.
    bool chase(THING tp, coord ee)
    {
        THING obj;
        int x, y;
        int curdist, thisdist;
        coord er = tp.t_pos;
        char ch;
        int plcnt = 1;

        /*
         * If the thing is confused, let it move randomly. Invisible
         * Stalkers are slightly confused all of the time, and bats are
         * quite confused all the time
         */
        if ((on(tp, ISHUH) && rnd(5) != 0) || (tp.t_type == 'P' && rnd(5) == 0) || (tp.t_type == 'B' && rnd(2) == 0))
        {
            /*
             * get a valid random move
             */
            ch_ret.CopyFrom(rndmove(tp));
            curdist = dist_cp(ch_ret, ee);
            /*
             * Small chance that it will become un-confused
             */
            if (rnd(20) == 0)
                tp.t_flags &= ~ISHUH;
        }
        /*
         * Otherwise, find the empty spot next to the chaser that is
         * closest to the chasee.
         */
        else
        {
            int ey, ex;
            /*
             * This will eventually hold where we move to get closer
             * If we can't find an empty spot, we stay where we are.
             */
            curdist = dist_cp(er, ee);
            ch_ret.CopyFrom(er);

            ey = er.y + 1;
            if (ey >= NUMLINES - 1)
                ey = NUMLINES - 2;
            ex = er.x + 1;
            if (ex >= NUMCOLS)
                ex = NUMCOLS - 1;

            for (x = er.x - 1; x <= ex; x++)
            {
                if (x < 0)
                    continue;
                tryp.x = x;
                for (y = er.y - 1; y <= ey; y++)
                {
                    tryp.y = y;
                    if (!diag_ok(er, tryp))
                        continue;
                    ch = winat(y, x);
                    if (step_ok(ch))
                    {
                        /*
                         * If it is a scroll, it might be a scare monster scroll
                         * so we need to look it up to see what type it is.
                         */
                        if (ch == SCROLL)
                        {
                            for (obj = lvl_obj; obj != null; obj = next(obj))
                            {
                                if (y == obj.o_pos.y && x == obj.o_pos.x)
                                    break;
                            }
                            if (obj != null && obj.o_which == S_SCARE)
                                continue;
                        }
                        /*
                         * It can also be a Xeroc, which we shouldn't step on
                         */
                        if ((obj = moat(y, x)) != null && obj.t_type == 'X')
                            continue;
                        /*
                         * If we didn't find any scrolls at this place or it
                         * wasn't a scare scroll, then this place counts
                         */
                        thisdist = dist(y, x, ee.y, ee.x);
                        if (thisdist < curdist)
                        {
                            plcnt = 1;
                            ch_ret.CopyFrom(tryp);
                            curdist = thisdist;
                        }
                        else if (thisdist == curdist && rnd(++plcnt) == 0)
                        {
                            ch_ret.CopyFrom(tryp);
                            curdist = thisdist;
                        }
                    }
                }
            }
        }
        return (bool)(curdist != 0 && !ce(ch_ret, hero));
    }
Exemple #51
0
 public double compareTo(coord other)
 {
     return cost - other.cost;
 }
Exemple #52
0
    // Pick a random position around the give (y, x) coordinates
    bool fallpos(coord pos, coord newpos)
    {
        int y, x, cnt, ch;

        cnt = 0;
        for (y = pos.y - 1; y <= pos.y + 1; y++)
            for (x = pos.x - 1; x <= pos.x + 1; x++)
            {
                /*
                 * check to make certain the spot is empty, if it is,
                 * put the object there, set it in the level list
                 * and re-draw the room if he can see it
                 */
                if (y == hero.y && x == hero.x)
                    continue;
                if (((ch = chat(y, x)) == FLOOR || ch == PASSAGE)
                            && rnd(++cnt) == 0)
                {
                    newpos.y = y;
                    newpos.x = x;
                }
            }
        return (bool)(cnt != 0);
    }
Exemple #53
0
    void setCost(coord parent, int x, int y)
    {
        if (!isSpace(x, y)) return;

        if (!cutCorners && (heap.coords[x][parent.y].c == 'O' || heap.coords[parent.x][y].c == 'O')) return;

        double grad = heap.coords[x][y].grad;

        double newGCost; //use gradient at (x,y) to determine cost

        if (x == parent.x || y == parent.y)
            newGCost = parent.gcost + 1;
        else
            newGCost = parent.gcost + (r2);

        /*
        if (x==parent.x || y==parent.y)
            newGCost=parent.gcost + (pow(2.,grad));
        else
            newGCost = parent.gcost + (r2 * pow(2.,grad));
            */

        //change in direction scales up cost--to avoid extraneous turns
        /*if ((x - parent.x != parent.x - heap.coords[parent.parentX][parent.parentY].x ||
            y - parent.y != parent.y - heap.coords[parent.parentX][parent.parentY].y) &&
            !parent.equals(new coord(startX, startY, 0)))
            newGCost *= changeDirectionFactor;
         */

        //mistakenly marked the coord as known due to hueristic
        if (heap.coords[x][y].isKnown && heap.coords[x][y].gcost > newGCost)
        {
            heap.coords[x][y] = heap.coords[x][y].makeUnknown();
            heap.coords[x][y] = heap.coords[x][y].setGCost(newGCost);
            heap.coords[x][y] = heap.coords[x][y].setParent(parent.x, parent.y);
            heap.add(heap.coords[x][y]);
        }

        else if (heap.coords[x][y].isKnown) return;

        //never seen the coord before, so add it
        if (!heap.coords[x][y].isOpen())
        {
            heap.coords[x][y] = heap.coords[x][y].setGCost(newGCost);
            heap.coords[x][y] = heap.coords[x][y].setParent(parent.x, parent.y);
            heap.add(heap.coords[x][y]);
        }

        //found a better path to the coord
        else if (heap.coords[x][y].gcost > newGCost)
        {
            heap.removeIndex(heap.coords[x][y].heapIndex);
            heap.coords[x][y] = heap.coords[x][y].setGCost(newGCost);
            heap.coords[x][y] = heap.coords[x][y].setParent(parent.x, parent.y);
            heap.add(heap.coords[x][y]);
        }
    }
Exemple #54
0
    void SetVals(HeapPriorityQueue<MapNode> openQ, int x, int y, int g, int g_inc, int count, coord prev, int end_x, int end_y)
    {
        if(!m_Map[x,y].closed && m_Map[x,y].g > g+g_inc)
        {
            m_Map[x,y].g = g+g_inc;
            m_Map[x,y].h = Heuristic(x, y, end_x, end_y);
            m_Map[x,y].f = m_Map[x,y].g + m_Map[x,y].h;
            m_Map[x,y].count = count+1;
            m_Map[x,y].previous = prev;

            /*if(Heuristic(prev.x, prev.y, x, y) > 1)
            {
                Debug.Log("Err: H: " + Heuristic(prev.x, prev.y, x, y).ToString() + ": prev (" + prev.x.ToString() +", " + prev.y.ToString() + ") to current (" + x.ToString() + ", " + y.ToString() + ")");
            }*/

            if(openQ.Contains(m_Map[x,y]))
            {
                openQ.UpdatePriority(m_Map[x,y], m_Map[x,y].f);
            }
            else
            {
                openQ.Enqueue(m_Map[x,y], m_Map[x,y].f);
            }
        }
    }
Exemple #55
0
    // Add a treasure room
    void treas_room()
    {
        int nm;
        THING tp;
        room rp;
        int spots, num_monst;
        coord mp = new coord();

        rp = rooms[rnd_room()];
        spots = (rp.r_max.y - 2) * (rp.r_max.x - 2) - MINTREAS;
        if (spots > (MAXTREAS - MINTREAS))
            spots = (MAXTREAS - MINTREAS);
        num_monst = nm = rnd(spots) + MINTREAS;
        while (nm-- != 0)
        {
            find_floor(rp, out mp, 2 * MAXTRIES, false);
            tp = new_thing();
            tp.o_pos = mp;
            attach(ref lvl_obj, tp);
            chat(mp.y, mp.x, (char)tp.o_type);
        }

        /*
         * fill up room with monsters from the next level down
         */

        if ((nm = rnd(spots) + MINTREAS) < num_monst + 2)
            nm = num_monst + 2;
        spots = (rp.r_max.y - 2) * (rp.r_max.x - 2);
        if (nm > spots)
            nm = spots;
        level++;
        while (nm-- != 0)
        {
            spots = 0;
            if (find_floor(rp, out mp, MAXTRIES, true))
            {
                tp = new_item();
                new_monster(tp, randmonster(false), mp);
                tp.t_flags |= ISMEAN;	/* no sloughers in THIS room */
                give_pack(tp);
            }
        }
        level--;
    }
        void LinkAfterLink(ArrayList ChainOfInfluences, coord coo1, coord coo2)
        {
            // Робберные элементы имеют в качестве line номер !ПЕРВОЙ! линии роббера:
            if (coo1.pos == (int)CONST.ROBBER || coo1.pos == (int)CONST.ROBBER_NO || coo1.pos == (int)CONST.ROBBER_NO__REAL || coo1.pos == (int)CONST.ROBBER_TOTAL_SCORE)
                coo1.line = ROBBERS.GetFirstLineOfRobber(ROBBERS.GetRobberNo(coo1.line));
            if (coo2.pos == (int)CONST.ROBBER || coo2.pos == (int)CONST.ROBBER_NO || coo2.pos == (int)CONST.ROBBER_NO__REAL || coo2.pos == (int)CONST.ROBBER_TOTAL_SCORE)
                coo2.line = ROBBERS.GetFirstLineOfRobber(ROBBERS.GetRobberNo(coo2.line));

            if (ChainOfInfluences.Contains(coo2))
            {
                //передвинуть coo2 после coo1 (можно в конец)
                if (ChainOfInfluences.Contains(coo1) && ChainOfInfluences.IndexOf(coo2) < ChainOfInfluences.IndexOf(coo1))
                {
                    ChainOfInfluences.RemoveAt(ChainOfInfluences.IndexOf(coo2));
                    if (Chain_IsHighPriority(ChainOfInfluences, coo2))
                        ChainOfInfluences.Add(coo2);
                    else
                        ChainOfInfluences.Insert(ChainOfInfluences.IndexOf(coo1) + 1, coo2);
                }
            }
            else
            {
                if (ChainOfInfluences.Contains(coo1))  //вставить coo2 сразу после coo1 (можно в конец)
                {
                    if (Chain_IsHighPriority(ChainOfInfluences, coo2))
                        ChainOfInfluences.Add(coo2);
                    else
                        ChainOfInfluences.Insert(ChainOfInfluences.IndexOf(coo1) + 1, coo2);
                }
                else  //вставить coo2 куда-нибудь (лучше в начало)
                {
                    if (Chain_IsHighPriority(ChainOfInfluences, coo2))
                        ChainOfInfluences.Add(coo2);
                    else
                        ChainOfInfluences.Insert(0, coo2);
                }
            }
        }
Exemple #57
0
    // Does the missile hit the monster?
    bool hit_monster(int y, int x, THING obj)
    {
        coord mp = new coord();

        mp.y = y;
        mp.x = x;
        return fight(mp, obj, true);
    }
 void BuildChainForLink(ArrayList ChainOfInfluences, coord coo1)
 {
     for (int i = 0; i < REFLECT_Depends.Keys.Count; i++)
     {
         if (REFLECT_Depends[REFLECT_Depends.Keys.ElementAt(i)].Contains(coo1.pos))
         {
             coord coo2 = new coord(coo1.line, REFLECT_Depends.Keys.ElementAt(i));
             LinkAfterLink(ChainOfInfluences, coo1, coo2);
             if(coo1 != coo2)
                 BuildChainForLink(ChainOfInfluences, coo2);  // recurcy
         }
     }
 }
Exemple #59
0
    // Erase the area shown by a lamp in a dark room.
    void erase_lamp(coord pos, room rp)
    {
        int y, x, ey, sy, ex;

        if (!(see_floor && (rp.r_flags & (ISGONE|ISDARK)) == ISDARK
                && !on(player,ISBLIND)))
            return;

        ey = pos.y + 1;
        ex = pos.x + 1;
        sy = pos.y - 1;
        for (x = pos.x - 1; x <= ex; x++)
            for (y = sy; y <= ey; y++)
            {
                if (y == hero.y && x == hero.x)
                    continue;
                move(y, x);
                if (inch() == FLOOR)
                    addch(' ');
            }
    }
        void BuildChainInVertical(ArrayList ChainOfInfluences, int line)
        {
            if (!isRobber)
                return;

            bool v_re = false;
            int v_re_after_line = line; //линия, после которой надо пересчитать
            int v_re_pos = 0; //позиция роббера - 1000
            for (int i = 0; i < ChainOfInfluences.Count; i++)
            {
                if (REFLECT_Recounts.ContainsKey(((coord)ChainOfInfluences[i]).pos) && REFLECT_Recounts[((coord)ChainOfInfluences[i]).pos] != null && REFLECT_Recounts[((coord)ChainOfInfluences[i]).pos].Length != 0)
                {
                    v_re = true;
                    v_re_pos = ((coord)ChainOfInfluences[i]).pos;
                    break;
                }
            }

            if (v_re)
            {
                int robNo = ROBBERS.GetRobberNo(v_re_after_line);
                int robdealNo = ROBBERS.GetRobDealNo(v_re_after_line);
                for (int i = robdealNo + 1; i < ROBBERS[robNo].ScoreArray.Count; i++)
                {
                    int nextline = v_re_after_line + (i - robdealNo);
                    for (int j = 0; j < REFLECT_Recounts[v_re_pos].Length; j++)
                    {
                        coord coo2 = new coord(/*!!!*/ nextline /*!!!*/, (REFLECT_Recounts[v_re_pos])[j]);
                        LinkAfterLink(ChainOfInfluences, new coord(v_re_after_line, v_re_pos), coo2);
                        BuildChainForLink(ChainOfInfluences, coo2);
                    }
                }
            }
        }