Exemplo n.º 1
0
        private void Exit(P_BattleMap battlemap)
        {
            _MoveLights.DismissP_Render(battlemap.Renderer);
            _MoveLights.DismissUpdater(battlemap.Updater);
            _MoveLights = null;

            _Cursor.DismissP_Render(battlemap.Renderer);
            _Cursor = null;
        }
Exemplo n.º 2
0
        public P_BMSChose_Movement(P_BattleMap map, IEntityActor actor)
        {
            _Actor  = actor;
            _Cursor = new P_SelectionCursor(actor.MyLocation);
            _Cursor.AcceptP_Render(map.Renderer);
            _CursorIndex    = actor.MyTileIndex;
            _ValidMoveIndex = MovementRange(map, actor);

            _MoveLights = new P_MovementRangeLight(map, _ValidMoveIndex, actor);
            _MoveLights.AcceptP_Render(map.Renderer);
            _MoveLights.AcceptUpdater(map.Updater);

            map.MyState = this;
        }
Exemplo n.º 3
0
        private static char[] IndexToTileGraphics(P_BattleMap battlemap, List <int> ringindex, P_MovementRangeLight lightobj)
        {
            int SizeX = lightobj.Render.SizeX;             // +1 on map width
            int SizeY = lightobj.Render.SizeY;             // map height

            char[] ReturnValue = new char[SizeX * SizeY];
            for (int i = 0; i < ReturnValue.Length; i++)
            {
                ReturnValue[i] = P_Const.NULL_CHAR;
            }

            int woffset = 0;

            for (int i = 0; i < ringindex.Count; i++)
            {
                int RingIndexX = ringindex[i] % battlemap.TheMap.Width;               //THE TILE INDEX
                int RingIndexY = ringindex[i] / battlemap.TheMap.Width;               //ALSO THE TILE INDEX

                RingIndexX = RingIndexX * 2;

                //RingIndexX = RingIndexX + RingIndexY;
                if ((RingIndexY & 1) == 0)
                {
                    woffset = 0;
                }
                else
                {
                    woffset = 1;
                }
                int asshole = RingIndexX + woffset + (RingIndexY * (battlemap.TheMap.Width * 2 + 1));
                ReturnValue[asshole]     = ' ';
                ReturnValue[asshole + 1] = ' ';
            }

            /*
             * for(int i=0; i<battlemap.TheMap.Length;i++)
             * {
             *      if(i%2 == 0)
             *      {
             *              int fartX = i%battlemap.TheMap.Width;
             *              int fartY = i/battlemap.TheMap.Width;
             *
             *              fartX = fartX*2;
             *              //fartX = fartX+fartY;
             *
             *              if ((fartY%2) == 0) {woffset = 0;}
             *              else {woffset = 1;}
             *              int fart = (fartX+woffset)+((battlemap.TheMap.Width*2+1)*fartY);
             *              ReturnValue[fart] = 'X';
             *              ReturnValue[fart+1] = 'X';
             *      }
             * }
             */
            return(ReturnValue);
        }