Exemplo n.º 1
0
    private IEnumerator OnRootConsoleRender()
    {
        while (Application.isPlaying)
        {
            if (_renderRequired)
            {
                for (int i = 0; i < MonsterStat.transform.childCount; i++)
                {
                    var go = MonsterStat.transform.GetChild(i).gameObject;
                    Destroy(go);
                }
//             _mapConsole.Clear();
//             _messageConsole.Clear();
//             _statConsole.Clear();
//             _inventoryConsole.Clear();
                DungeonMap.Draw();
                MessageLog.Draw();
                TargetingSystem.Draw();

                //_rootConsole.Draw();

                _renderRequired = false;
            }
            yield return(null);
        }
    }
Exemplo n.º 2
0
 private void Draw()
 {
     World.Draw();
     Player.Draw(World);
     Player.DrawStats();
     MessageLog.Draw();
 }
Exemplo n.º 3
0
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();

                DungeonMap.Draw(_mapConsole, _statConsole);
                Player.Draw(_mapConsole, DungeonMap);
                MessageLog.Draw(_messageConsole);

                Player.DrawStats(_statConsole);

                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight);

                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);

                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);

                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);

                _rootConsole.Draw();

                _renderRequired = false;
            }
        }
Exemplo n.º 4
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();

                DungeonMap.Draw(_mapConsole, _statConsole);
                Player.Draw(_mapConsole, DungeonMap);
                Player.DrawStats(_statConsole);
                MessageLog.Draw(_messageConsole);

                // Blit the sub consoles to the root console in the correct locations
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
                               _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight,
                               _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight,
                               _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight,
                               _rootConsole, 0, 0);

                // Tell RLNET to draw the console that we set
                _rootConsole.Draw();

                // Don't bother redrawing all of the consoles if nothing has changed.
                _renderRequired = false;
            }
        }
Exemplo n.º 5
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            //don't redraw consoles if nothing changes
            if (_renderRequired)
            {
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();
                _inventoryConsole.Clear();
                DungeonMap.Draw(_mapConsole, _statConsole);
                //draw the player
                Player.Draw(_mapConsole, DungeonMap);
                //draw the status console
                Player.DrawStats(_statConsole);
                //draw the MessageLog
                MessageLog.Draw(_messageConsole);

                //Blit the sub consoles to the root console in the correct locations
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);

                //tell RLNet to draw the console
                _rootConsole.Draw();

                _renderRequired = false;
            }
        }
Exemplo n.º 6
0
        // Event handler for Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            //dont want to redraw all the time for no reason
            if (_renderRequired)
            {
                //clear all
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();

                // draw the map, this has to be first i think
                DungeonMap.Draw(_mapConsole, _statConsole);
                Player.Draw(_mapConsole, DungeonMap);
                Player.DrawStats(_statConsole);
                MessageLog.Draw(_messageConsole);

                //combine all the smaller consoles to the main one
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
                               _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight,
                               _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight,
                               _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight,
                               _rootConsole, 0, 0);
                _rootConsole.Draw();
            }
        }
Exemplo n.º 7
0
        private static void RootConsole_Render(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                mazmorraConsole.Clear();
                estadisticaConsole.Clear();
                mensajeConsole.Clear();

                DungeonMap.Draw(mazmorraConsole, estadisticaConsole);
                Player.Draw(mazmorraConsole, DungeonMap);
                Player.DrawStats(estadisticaConsole);
                MessageLog.Draw(mensajeConsole);

                RLConsole.Blit(mazmorraConsole, 0, 0, mazmorraWidth, mazmorraHeight, rootConsole, 0, inventarioHeight);

                RLConsole.Blit(estadisticaConsole, 0, 0, estadisticasWidth, estadisticasHeight, rootConsole, mazmorraWidth, 0);

                RLConsole.Blit(mensajeConsole, 0, 0, mensajeWidth, mensajeHeight, rootConsole, 0, screenHeight - mensajeHeight);

                RLConsole.Blit(inventarioConsole, 0, 0, inventarioWidth, inventarioHeight, rootConsole, 0, 0);

                rootConsole.Draw();

                _renderRequired = false;
            }
        }
Exemplo n.º 8
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();

                DungeonMap.Draw(_mapConsole, _statConsole);
                Player.Draw(_mapConsole);
                Player.DrawStats(_statConsole);
                MessageLog.Draw(_messageConsole);


                if (!Globals.BuildingEntranceIsTriggered && !Globals.IsPlayerDead && !Globals.IsBossDead)
                {
                    // Blit the sub consoles to the root console in the correct locations
                    RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
                                   _rootConsole, 0, 0);
                    RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight,
                                   _rootConsole, _mapWidth, 0);
                    RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight,
                                   _rootConsole, 0, _screenHeight - _messageHeight);
                }
                else if (Globals.BuildingEntranceIsTriggered)
                {
                    if (Globals.SheriffTriggered)
                    {
                        QuestMenu.CreateQuestMenu(_rootConsole);
                    }
                    else if (Globals.GenericMenuTriggered)
                    {
                        Menu.CreateMenu(_rootConsole);
                    }
                    else
                    {
                        Globals.BuildingEntranceIsTriggered = false;
                    }
                }
                else if (Globals.IsBossDead)
                {
                    WinMenu.CreateWinScreen(_rootConsole);
                }
                else if (Globals.IsPlayerDead)
                {
                    if (Player.Health <= 0)
                    {
                        DeathScreen.CreateDeathScreen(_rootConsole);
                    }
                    else
                    {
                        Globals.IsPlayerDead = false;
                    }
                }
                // Tell RLNET to draw the console that we set
                _rootConsole.Draw();
                _renderRequired = false;
            }
        }
Exemplo n.º 9
0
 private static void DrawConsoles()
 {
     DungeonMap.Draw(mapConsole, Stats);
     Player.Draw(mapConsole, DungeonMap);
     Player.DrawStats(Stats, 1);
     MessageLog.Draw(Messages);
     Player.Inventory.Draw(QuickBar);
 }
Exemplo n.º 10
0
    public void Update()
    {
        if (!gameOver)
        {
            CheckKeyboard();
        }

        MessageLog.Draw();
        CheckWin();
    }
Exemplo n.º 11
0
        public void Draw(RLConsole mapConsole, RLConsole statConsole, RLConsole messageConsole)
        {
            var mapDto    = this.mappingService.GetDungeonDtoById(1);
            var playerDto = this.mappingService.GetPlayerDtoById(1);

            mapDto.Initialize();
            mapDto.UpdatePlayerFieldOfView(playerDto);
            mapDto.Draw(mapConsole, statConsole);

            playerDto.Draw(mapConsole, mapDto);
            playerDto.DrawStats(statConsole);

            MessageLog.Draw(messageConsole);
        }
Exemplo n.º 12
0
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            if (_renderRequired)
            {
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();
                _inventoryConsole.Clear();

                DungeonMap.Draw(_mapConsole, _statConsole);

                Player.Draw(_mapConsole, DungeonMap);
                Player.DrawStats(_statConsole);
                Player.DrawInventory(_inventoryConsole);

                MessageLog.Draw(_messageConsole);
                _messageConsole.SetBackColor(0, 0, _messageWidth, _messageHeight, Swatch.DbDark);
                TargetingSystem.Draw(_mapConsole);

                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);

                if (IsInventoryScreenShowing)
                {
                    InventoryScreen.Draw(_rootConsole, Player.Inventory);
                }
                if (IsDialogScreenShowing)
                {
                    DialogScreen.Draw(_rootConsole);
                }
                if (IsShopSelectionScreenShowing)
                {
                    ShopSelectionScreen.Draw(_rootConsole);
                }
                if (IsBuyScreenShowing)
                {
                    BuyScreen.Draw(_rootConsole);
                }
                if (IsSellScreenShowing)
                {
                    SellScreen.Draw(_rootConsole, Player.Inventory);
                }

                _rootConsole.Draw();
                _renderRequired = false;
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// Event handler for RLNET Render event
        /// </summary>
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            //Blit other console sections to the root console
            //Blit: Bit BLock Transfer
            RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _invHeight);
            RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);
            RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);
            RLConsole.Blit(_invConsole, 0, 0, _invWidth, _invHeight, _rootConsole, 0, 0);

            DungeonMap.Draw(_mapConsole);
            MessageLog.Draw(_messageConsole);
            InventoryLog.Draw(_invConsole);
            player.Draw(_mapConsole, DungeonMap);
            _rootConsole.Draw();
        }
Exemplo n.º 14
0
    private void LateUpdate()
    {
        if (_renderRequired)
        {
            for (int i = 0; i < MonsterStat.transform.childCount; i++)
            {
                var go = MonsterStat.transform.GetChild(i).gameObject;
                Destroy(go);
            }

            DungeonMap.Draw();
            MessageLog.Draw();
            TargetingSystem.Draw();

            _renderRequired = false;
        }
    }
Exemplo n.º 15
0
        protected override void Draw(GameTime gameTime)
        {
            if (_renderRequired)
            {
                GraphicsDevice.Clear(Color.Black);

                _mapConsole.CellData.Clear();
                _messageConsole.CellData.Clear();
                _statConsole.CellData.Clear();
                _inventoryConsole.CellData.Clear();

                MessageLog.Draw(_messageConsole);
                DungeonMap.Draw(_mapConsole, _statConsole, _inventoryConsole);
                MessageLog.Draw(_messageConsole);
                TargetingSystem.Draw(_mapConsole);

                base.Draw(gameTime);
            }
        }
Exemplo n.º 16
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            // Don't bother redrawing all of the consoles if nothing has changed.
            if (_renderRequired)
            {
                //Clear the consoles
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();
                _inventoryConsole.Clear();

                //Draw the dungeon map.
                DungeonMap.Draw(_mapConsole, _statConsole, _inventoryConsole);

                //draw the message log
                MessageLog.Draw(_messageConsole);

                TargetingSystem.Draw(_mapConsole);

                // Blit the sub consoles to the root console in the correct locations

                /* params
                 * - source console
                 * - x_pos
                 * - y_pos
                 * - width
                 * - height
                 * - destination console
                 * - x+y position of top left corner to blit in destination console */
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);

                // Tell RLNET to draw the console that we set
                _rootConsole.Draw();

                _renderRequired = false;
            }
        }
Exemplo n.º 17
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            // Blit the sub consoles to the root console in the correct locations
            // if (_renderRequired)
            //{
            RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight,
                           _rootConsole, 0, _inventoryHeight);
            RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight,
                           _rootConsole, _mapWidth, 0);
            RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight,
                           _rootConsole, 0, _screenHeight - _messageHeight);
            RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight,
                           _rootConsole, 0, 0);

            DungeonMap.Draw(_mapConsole);
            MessageLog.Draw(_messageConsole);
            Player.Draw(_mapConsole, DungeonMap);
            // Tell RLNET to draw the console that we set
            _rootConsole.Draw();
            // _renderRequired = false;
            // }
        }
Exemplo n.º 18
0
        private static void OnGameRender(object sender, UpdateEventArgs e)
        {
            if (renderRequired)
            {
                mapConsole.Clear();
                statConsole.Clear();
                messageConsole.Clear();

                MessageLog.Draw(messageConsole);
                DungeonMap.Draw(mapConsole, statConsole);
                Player.Draw(mapConsole, DungeonMap);
                Player.DrawStats(statConsole);
                Player.DrawItems(inventoryConsole);

                RLConsole.Blit(mapConsole, 0, 0, mapWidth, mapHeight, rootConsole, 0, inventoryHeight);
                RLConsole.Blit(statConsole, 0, 0, statWidth, statHeight, rootConsole, mapWidth, 0);
                RLConsole.Blit(messageConsole, 0, 0, messageWidth, messageHeight, rootConsole, 0, screenHeight - messageHeight);
                RLConsole.Blit(inventoryConsole, 0, 0, inventoryWidth, inventoryHeight, rootConsole, 0, 0);

                rootConsole.Draw();
            }
            renderRequired = false;
        }
Exemplo n.º 19
0
 public override void DrawState(GameTime time)
 {
     camera.Draw(spriteBatch);
     msgLog.Draw(spriteBatch);
 }
Exemplo n.º 20
0
        private static void OnRootConsoleUpdate(object sender, UpdateEventArgs e)
        {
            bool       didUnitAct    = false;
            bool       didPlayerAct  = false;
            bool       didMenuUpdate = false;
            RLKeyPress keyPress      = _rootConsole.Keyboard.GetKeyPress();

            if (_currentState == _gameStates.MainMenu)
            {
                _mapConsole.SetBackColor(0, 0, _mapWidth, _mapHeight, RLColor.Black);
                _mapConsole.Print(1, 1, "Press G to start a new game", Colors.TextHeading);
                renderRequired = true;

                if (keyPress != null)
                {
                    if (keyPress.Key == RLKey.G)
                    {
                        _currentState = _gameStates.InGame;
                        //on a state change we need to redraw the interface
                        guiRedraw = true;
                    }
                }

                //draw menu
            }
            else if (_currentState == _gameStates.InGame)
            {
                //handle player input when we're ingame

                if (CommandSystem.isPlayerTurn)
                {
                    if (keyPress != null)
                    {
                        switch (keyPress.Key)
                        {
                        case RLKey.Up:
                            didPlayerAct = CommandSystem.MovePlayer(Directions.Up);
                            break;

                        case RLKey.Down:
                            didPlayerAct = CommandSystem.MovePlayer(Directions.Down);
                            break;

                        case RLKey.Left:
                            didPlayerAct = CommandSystem.MovePlayer(Directions.Left);
                            break;

                        case RLKey.Right:
                            didPlayerAct = CommandSystem.MovePlayer(Directions.Right);
                            break;

                        case RLKey.Escape:
                            _rootConsole.Close();
                            break;
                        }

                        if (didPlayerAct)
                        {
                            renderRequired = true;
                            mapRedraw      = true;
                            CommandSystem.EndPlayerTurn();
                        }
                    }
                }
                else if (!CommandSystem.isPlayerTurn)
                {
                    CommandSystem.ActivateMonsters();
                    renderRequired = true;
                }

                //draw gui if not drawn
                if (guiRedraw)
                {
                    _mapConsole.Clear();
                    _mapConsole.SetBackColor(0, 0, _mapWidth, _mapHeight, Colors.FloorBackground);
                    mapRedraw = true;

                    _messageConsole.Clear();
                    _messageConsole.SetBackColor(0, 0, _messageWidth, _messageHeight, Swatch.DbDeepWater);


                    _statConsole.Clear();
                    _statConsole.SetBackColor(0, 0, _statWidth, _statHeight, Swatch.DbOldStone);

                    _inventoryConsole.Clear();
                    _inventoryConsole.SetBackColor(0, 0, _inventoryWidth, _inventoryHeight, Swatch.DbWood);
                    _inventoryConsole.Print(1, 1, "Inventory", Colors.TextHeading);

                    renderRequired = true;
                    guiRedraw      = false;
                }

                if (mapRedraw)
                {
                    MessageLog.Draw(_messageConsole);
                    DungeonMap.Draw(_mapConsole, _statConsole);
                    Player.Draw(_mapConsole, DungeonMap);
                    Player.DrawStats(_statConsole);
                    renderRequired = true;
                    mapRedraw      = false;
                }
            }
        }
Exemplo n.º 21
0
        // Event handler for RLNET's Render event
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            DateTime _currentTime = DateTime.Now;

            if (!_gameOver && _time.AddMilliseconds(160) < _currentTime)
            {
                _renderRequired = true;
                _nextAnimation  = true;
                _time           = _currentTime;
            }
            if (_renderRequired && !_gameOver)
            {
                _rootConsole.Clear();
                _mapConsole.Clear();
                _statConsole.Clear();
                _messageConsole.Clear();
                _inventoryConsole.Clear();

                Point mapBlitOrigin = GetMapBlitOrigin();

                _statConsole.SetBackColor(0, 0, _statWidth, _statHeight, Colors.Alternate);
                _messageConsole.SetBackColor(0, 0, _messageWidth, _messageHeight, Colors.Secondary);
                if (_mapLevel == 1)
                {
                    _mapConsole.SetBackColor(mapBlitOrigin.X, mapBlitOrigin.Y, _onConsoleMapWidth, _onConsoleMapHeight, RLColor.Black);
                }
                else
                {
                    for (int i = 0; i < _onConsoleMapHeight; i++)
                    {
                        _mapConsole.SetBackColor(mapBlitOrigin.X, mapBlitOrigin.Y + i, _onConsoleMapWidth, 1, RLColor.Blend(Colors.gradient1, Colors.gradient2, 1f - i / (_onConsoleMapHeight - 1f)));
                    }
                }
                _inventoryConsole.SetBackColor(0, 0, _inventoryWidth, _inventoryHeight, Colors.Compliment);
                _inventoryConsole.Print(1, 1, "Inventaire", RLColor.White);

                Map.Draw(_mapConsole, _statConsole, _nextAnimation);
                Player.Draw(_mapConsole, Map, _nextAnimation);
                MessageLog.Draw(_messageConsole);
                Player.DrawStats(_statConsole);
                Inventory.DrawWithEffect(_inventoryConsole, _mapConsole);

                ICell cell = Map.GetCell(Player.X, Player.Y);

                Point mousePos = GetMousePosOnMap();
                if (Map.IsInFov(mousePos.X, mousePos.Y) && Map.GetMonsterAt(mousePos.X, mousePos.Y) != null)
                {
                    CellSelection.DrawPath(Player.Coord, mousePos, _mapConsole);
                    _mapConsole.SetBackColor(mousePos.X, mousePos.Y, Colors.AlternateDarker);
                }

                _renderRequired = CellSelection.ShockWaveEffect(_mapConsole);
                _nextAnimation  = false;

                if (Map is InvertedMap invertedMap)
                {
                    _mapConsole   = invertedMap.InvertMap(_mapConsole);
                    mapBlitOrigin = new Point(_mapWidth - mapBlitOrigin.X - _onConsoleMapWidth, _mapHeight - mapBlitOrigin.Y - _onConsoleMapHeight);
                }

                // Blit the sub consoles to the root console in the correct locations
                RLConsole.Blit(_mapConsole, mapBlitOrigin.X, mapBlitOrigin.Y, _onConsoleMapWidth, _onConsoleMapHeight, _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _onConsoleMapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);

                // Tell RLNET to draw the console that we set
                _rootConsole.Draw();
            }
            else if (_gameOver)
            {
                _UIConsole.Clear();
                _UIConsole.SetBackColor(0, 0, _screenWidth, _screenHeight, Colors.ComplimentLighter);
                menu.Draw(_UIConsole, GetMousePos());
                RLConsole.Blit(_UIConsole, 0, 0, _UIWidth, _UIHeight, _rootConsole, 0, 0);
                _rootConsole.Draw();
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// The rendering engine for the overworld.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnOverworldRender(object sender, UpdateEventArgs e)
        {
            // Don't bother redrawing all of the consoles if nothing has changed.
            if (_renderRequired)
            {
                mapConsole.Clear();
                statConsole.Clear();
                messageConsole.Clear();
                inventoryConsole.Clear();

                // Draw the map
                DungeonMap.Draw(mapConsole, statConsole);
                // Draw our player on the map subconsole
                Player.Draw(mapConsole, DungeonMap);
                // After we draw our player, draw our player's stats in the stats subconsole
                Player.DrawStats(statConsole);
                // Draw the player's inventory
                Player.DrawInventory(inventoryConsole);
                // Draw our message log
                MessageLog.Draw(messageConsole);
                // Refocus the camera
                CameraSystem.RefocusCamera();

                // Blit the sub consoles to the root console in the correct locations
                RLConsole.Blit(
                    statConsole,
                    0,
                    0,
                    Dimensions.StatWidth,
                    Dimensions.StatHeight,
                    console,
                    0,
                    0
                    );
                RLConsole.Blit(
                    messageConsole,
                    0,
                    0,
                    Dimensions.MessageWidth,
                    Dimensions.MessageHeight,
                    console,
                    0,
                    Dimensions.ScreenHeight - Dimensions.MessageHeight
                    );
                RLConsole.Blit(
                    inventoryConsole,
                    0,
                    0,
                    Dimensions.InventoryWidth,
                    Dimensions.InventoryHeight,
                    console,
                    Dimensions.MapWidth,
                    0
                    );
                RLConsole.Blit(
                    mapConsole,
                    CameraSystem.ViewportStartX,
                    CameraSystem.ViewportStartY,
                    Dimensions.MapWidth,
                    Dimensions.MapHeight,
                    console,
                    0,
                    Dimensions.StatHeight
                    );
                // Tell RLNET to draw the console that we set
                console.Draw();
            }
        }
Exemplo n.º 23
0
        protected override void Draw(GameTime gameTime)
        {
            if (_renderRequired)
            {
                GraphicsDevice.Clear(Color.Black);

                _mapConsole.CellData.Clear();
                _messageConsole.CellData.Clear();
                _statConsole.CellData.Clear();
                _inventoryConsole.CellData.Clear();

                MessageLog.Draw(_messageConsole);

                DungeonMap.Draw(_mapConsole, _statConsole, _inventoryConsole);
                MapMessageLog.Draw(_mapConsole);
                MessageLog.Draw(_messageConsole);
                TargetingSystem.Draw(_mapConsole);


                _inventoryConsole.CellData.Print(0, 10, "________________________________________________________________________________", Color.Green);

                _messageConsole.CellData.Print(0, 0, "--------------------------------------------------------------------------------", Color.Green);

                _statConsole.CellData.Print(0, 0, "|", Color.Green);
                _statConsole.CellData.Print(0, 1, "|", Color.Green);
                _statConsole.CellData.Print(0, 2, "|", Color.Green);
                _statConsole.CellData.Print(0, 3, "|", Color.Green);
                _statConsole.CellData.Print(0, 4, "|", Color.Green);
                _statConsole.CellData.Print(0, 5, "|", Color.Green);
                _statConsole.CellData.Print(0, 6, "|", Color.Green);
                _statConsole.CellData.Print(0, 7, "|", Color.Green);
                _statConsole.CellData.Print(0, 8, "|", Color.Green);
                _statConsole.CellData.Print(0, 9, "|", Color.Green);
                _statConsole.CellData.Print(0, 10, "|", Color.Green);
                _statConsole.CellData.Print(0, 11, "|", Color.Green);
                _statConsole.CellData.Print(0, 12, "|", Color.Green);
                _statConsole.CellData.Print(0, 13, "|", Color.Green);
                _statConsole.CellData.Print(0, 14, "|", Color.Green);
                _statConsole.CellData.Print(0, 15, "|", Color.Green);
                _statConsole.CellData.Print(0, 16, "|", Color.Green);
                _statConsole.CellData.Print(0, 17, "|", Color.Green);
                _statConsole.CellData.Print(0, 18, "|", Color.Green);
                _statConsole.CellData.Print(0, 19, "|", Color.Green);
                _statConsole.CellData.Print(0, 20, "|", Color.Green);
                _statConsole.CellData.Print(0, 21, "|", Color.Green);
                _statConsole.CellData.Print(0, 22, "|", Color.Green);
                _statConsole.CellData.Print(0, 23, "|", Color.Green);
                _statConsole.CellData.Print(0, 24, "|", Color.Green);
                _statConsole.CellData.Print(0, 25, "|", Color.Green);
                _statConsole.CellData.Print(0, 26, "|", Color.Green);
                _statConsole.CellData.Print(0, 27, "|", Color.Green);
                _statConsole.CellData.Print(0, 28, "|", Color.Green);
                _statConsole.CellData.Print(0, 29, "|", Color.Green);
                _statConsole.CellData.Print(0, 30, "|", Color.Green);
                _statConsole.CellData.Print(0, 31, "|", Color.Green);
                _statConsole.CellData.Print(0, 32, "|", Color.Green);
                _statConsole.CellData.Print(0, 33, "|", Color.Green);
                _statConsole.CellData.Print(0, 34, "|", Color.Green);
                _statConsole.CellData.Print(0, 35, "|", Color.Green);
                _statConsole.CellData.Print(0, 36, "|", Color.Green);
                _statConsole.CellData.Print(0, 37, "|", Color.Green);
                _statConsole.CellData.Print(0, 38, "|", Color.Green);
                _statConsole.CellData.Print(0, 39, "|", Color.Green);
                _statConsole.CellData.Print(0, 40, "|", Color.Green);
                _statConsole.CellData.Print(0, 41, "|", Color.Green);
                _statConsole.CellData.Print(0, 42, "|", Color.Green);
                _statConsole.CellData.Print(0, 43, "|", Color.Green);
                _statConsole.CellData.Print(0, 44, "|", Color.Green);
                _statConsole.CellData.Print(0, 45, "|", Color.Green);
                _statConsole.CellData.Print(0, 46, "|", Color.Green);
                _statConsole.CellData.Print(0, 47, "|", Color.Green);
                _statConsole.CellData.Print(0, 48, "|", Color.Green);
                _statConsole.CellData.Print(0, 49, "|", Color.Green);
                _statConsole.CellData.Print(0, 50, "|", Color.Green);
                _statConsole.CellData.Print(0, 51, "|", Color.Green);
                _statConsole.CellData.Print(0, 52, "|", Color.Green);
                _statConsole.CellData.Print(0, 53, "|", Color.Green);
                _statConsole.CellData.Print(0, 54, "|", Color.Green);
                _statConsole.CellData.Print(0, 55, "|", Color.Green);
                _statConsole.CellData.Print(0, 56, "|", Color.Green);
                _statConsole.CellData.Print(0, 57, "|", Color.Green);
                _statConsole.CellData.Print(0, 58, "|", Color.Green);
                _statConsole.CellData.Print(0, 59, "|", Color.Green);

                _statConsole.CellData.Print(0, 1, "|", Color.Green);

                if (RogueGame._mapLevel == 1)
                {
                    _statConsole.CellData.Print(1, 60, "Location:", Color.Green);
                    _statConsole.CellData.Print(1, 62, "Desert Pass", Color.Tan);
                }
                else if (RogueGame._mapLevel == 2)
                {
                    _statConsole.CellData.Print(1, 60, "Location:", Color.Green);
                    _statConsole.CellData.Print(1, 62, "Cavern Base Level 1", Color.Red);
                }
                else if (RogueGame._mapLevel == 3)
                {
                    _statConsole.CellData.Print(1, 60, "Location:", Color.Green);
                    _statConsole.CellData.Print(1, 62, "Cavern Base Level 2", Color.Red);
                }
                else if (RogueGame._mapLevel == 4)
                {
                    _statConsole.CellData.Print(1, 60, "Location:", Color.Green);
                    _statConsole.CellData.Print(1, 62, "Cavern Base Level 3", Color.Red);
                }
                else if (RogueGame._mapLevel == 5)
                {
                    _statConsole.CellData.Print(1, 60, "Location:", Color.Green);
                    _statConsole.CellData.Print(1, 62, "Summoning Chambers", Color.Red);
                }



                base.Draw(gameTime);
            }
        }