Ejemplo n.º 1
0
        public void Draw(RLConsole console, IMap map)
        {
            if (!map.GetCell(X, Y).IsExplored)
            {
                return;
            }

            Symbol = IsUp ? '<' : '>';

            if (map.IsInFov(X, Y))
            {
                Color = Colors.Player;
            }
            else
            {
                Color = Colors.Floor;
            }

            console.Set(X, Y, Color, null, Symbol);
        }
Ejemplo n.º 2
0
        public void Draw(RLConsole console, IMap map)
        {
            if (!map.GetCell(X, Y).IsExplored)
            {
                return;
            }

            Symbol = IsOpen ? opened : closed;
            if (map.IsInFov(X, Y))
            {
                Color           = Colors.DoorFov;
                BackgroundColor = Colors.DoorBackgroundFov;
            }
            else
            {
                Color           = Colors.Door;
                BackgroundColor = Colors.DoorBackground;
            }
            console.Set(X, Y, Color, BackgroundColor, Symbol);
        }
Ejemplo n.º 3
0
        public void Draw(RLConsole console, IMap map)
        {
            if (!map.GetCell(X, Y).IsExplored)
            {
                return;
            }

            //Symbol = IsTriggered ? '1' : '1';
            if (map.IsInFov(X, Y))
            {
                Color           = Colors.BuildingEntranceFov;
                BackgroundColor = Colors.BuildingEntranceBackgroundFov;
            }
            else
            {
                Color           = Colors.BuildingEntrance;
                BackgroundColor = Colors.BuildingEntranceBackground;
            }

            console.Set(X, Y, Color, BackgroundColor, Symbol);
        }
Ejemplo n.º 4
0
        public void Draw(RLConsole console, IMap map)
        {
            //if the door has been seen
            if (!map.GetCell(X, Y).IsExplored)
            {
                return;
            }

            //change the stairs symbol from less than too greater than
            Symbol = IsUp ? '<' : '>';

            //if the door has been seen
            if (map.IsInFov(X, Y))
            {
                Color = RLColor.Brown;
            }
            //if the door has not been found
            else
            {
                Color = Colors.Floor;
            }

            console.Set(X, Y, Color, null, Symbol);
        }
Ejemplo n.º 5
0
        public void Draw(RLConsole mapConsole, IMap map)
        {
            if (!map.GetCell(X, Y).IsExplored)
            {
                return;
            }

            // Taken from DungeonMap.cs
            if (map.IsInFov(X, Y))
            {
                mapConsole.Set(X, Y, Color, Colors.FloorBackgroundFov, Symbol);
            }
            else if (Game.MapLevel == 1)
            {
                mapConsole.Set(X, Y, Colors.LowLevelFloor, Colors.Background, ',');
            }
            else if (Game.MapLevel == 2)
            {
                mapConsole.Set(X, Y, Colors.LowLevelFloor, Colors.Background, '.');
            }
            else if (Game.MapLevel < 5)
            {
                mapConsole.Set(X, Y, Colors.Floor, Colors.Background, '.');
            }
            else if (Game.MapLevel < 7)
            {
                mapConsole.Set(X, Y, Colors.IceFloor, Colors.Background, '.');
            }
            else if (Game.MapLevel < 9)
            {
                mapConsole.Set(X, Y, Colors.CaveFloor, Colors.Background, '.');
            }
            else
            {
                mapConsole.Set(X, Y, Colors.HellFloor, Colors.Background, '.');
            }
        }
Ejemplo n.º 6
0
        public void renderMap()
        {
            var game_map = map.grid.Game_map;

            foreach (var kvp in game_map)
            {
                var pos  = kvp.Key;
                var tile = kvp.Value;
                switch (tile.type)
                {
                case TileType.Floor:
                    if (tile.lit)
                    {
                        MapConsole.Set(pos.X, pos.Y, Colours.floor_lit, RLColor.Black, tile.symbol);
                    }
                    else
                    {
                        MapConsole.Set(pos.X, pos.Y, Colours.floor, RLColor.Black, tile.symbol);
                    }
                    break;

                case TileType.Wall:
                    if (tile.lit)
                    {
                        MapConsole.Set(pos.X, pos.Y, Colours.wall_lit, RLColor.Black, tile.symbol);
                    }
                    else
                    {
                        MapConsole.Set(pos.X, pos.Y, Colours.wall, RLColor.Black, tile.symbol);
                    }
                    break;

                case TileType.Empty:
                    MapConsole.Set(pos.X, pos.Y, RLColor.Black, RLColor.Black, tile.symbol);
                    break;

                case TileType.PathTest:
                    MapConsole.Set(pos.X, pos.Y, RLColor.Yellow, RLColor.Yellow, tile.symbol);
                    break;
                }
            }
        }
Ejemplo n.º 7
0
 public void Draw(RLConsole console, IMap map)
 {
     console.Set(Cell.X, Cell.Y, ForegroundColor, BackgroundColor, (int)Symbol);
     WasUpdated = false;
 }
Ejemplo n.º 8
0
 public void clear(RLConsole console)
 {
     console.Set(pos.X, pos.Y, null, null, ' ');
 }
Ejemplo n.º 9
0
 public void draw(RLConsole console)
 {
     console.Set(pos.X, pos.Y, RLColor.White, null, symbol);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Draw the object on given console
 /// </summary>
 /// <param name="console"></param>
 public void Draw(RLConsole console)
 {
     console.Set(x, y, col, null, shape);
 }
Ejemplo n.º 11
0
        //Sets the symbol based on what the cell's properties are
        private void SetSymbolForCell(RLConsole console, Cell cell)
        {
            //If the cell hasn't been explored/seen,
            //      don't draw it to the screen
            if (!cell.IsExplored)
            {
                return;
            }

            //If the cell/tile is in the field of view,
            //      draw it to the screen using lighter
            //      colors than an explored, non-FOV tile
            if (IsInFov(cell.X, cell.Y))
            {
                //Floor
                if (cell.IsWalkable)
                {
                    //First set of levels
                    if (Game.mapLevel <= 5)
                    {
                        console.Set(cell.X, cell.Y, Colors.FloorFov, Colors.FloorBackgroundFov, (char)177);
                    }
                    //Second set of levels
                    else if (Game.mapLevel <= 10)
                    {
                        //Colors.FloorFov = ;
                        //Colors.FloorBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.FloorFov, Colors.FloorBackgroundFov, (char)177);
                    }
                    //This set of levels
                    else if (Game.mapLevel <= 15)
                    {
                        //Colors.FloorFov = ;
                        //Colors.FloorBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.FloorFov, Colors.FloorBackgroundFov, (char)177);
                    }
                    //Fourth set of levels
                    else if (Game.mapLevel <= 20)
                    {
                        //Colors.FloorFov = ;
                        //Colors.FloorBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.FloorFov, Colors.FloorBackgroundFov, (char)177);
                    }
                    //Fifth and final set of levels
                    else if (Game.mapLevel <= 25)
                    {
                        //Colors.FloorFov = ;
                        //Colors.FloorBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.FloorFov, Colors.FloorBackgroundFov, (char)177);
                    }
                }
                //Walls
                else
                {
                    //First set of levels
                    if (Game.mapLevel <= 5)
                    {
                        console.Set(cell.X, cell.Y, Colors.WallFov, Colors.WallBackgroundFov, '#');
                    }
                    //Second set of levels
                    else if (Game.mapLevel <= 10)
                    {
                        //Colors.WallFov = ;
                        //Colors.WallBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.WallFov, Colors.WallBackgroundFov, '#');
                    }
                    //Third set of levels
                    else if (Game.mapLevel <= 15)
                    {
                        //Colors.WallFov = ;
                        //Colors.WallBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.WallFov, Colors.WallBackgroundFov, '#');
                    }
                    //Fourth set of levels
                    else if (Game.mapLevel <= 20)
                    {
                        //Colors.WallFov = ;
                        //Colors.WallBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.WallFov, Colors.WallBackgroundFov, '#');
                    }
                    //Fifth and final set of levels
                    else if (Game.mapLevel <= 25)
                    {
                        //Colors.WallFov = ;
                        //Colors.WallBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.WallFov, Colors.WallBackgroundFov, '#');
                    }
                }
            }
            //If the cell is not in the field of view,
            //      draw it to the screen using darker
            //      colors
            else
            {
                //Floor
                if (cell.IsWalkable)
                {
                    //First set of levels
                    if (Game.mapLevel <= 5)
                    {
                        console.Set(cell.X, cell.Y, Colors.Floor, Colors.FloorBackground, (char)177);
                    }
                    //Second set of levels
                    else if (Game.mapLevel <= 10)
                    {
                        //Colors.FloorFov = ;
                        //Colors.FloorBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.Floor, Colors.FloorBackground, (char)177);
                    }
                    //This set of levels
                    else if (Game.mapLevel <= 15)
                    {
                        //Colors.FloorFov = ;
                        //Colors.FloorBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.Floor, Colors.FloorBackground, (char)177);
                    }
                    //Fourth set of levels
                    else if (Game.mapLevel <= 20)
                    {
                        //Colors.FloorFov = ;
                        //Colors.FloorBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.Floor, Colors.FloorBackground, (char)177);
                    }
                    //Fifth and final set of levels
                    else if (Game.mapLevel <= 25)
                    {
                        //Colors.FloorFov = ;
                        //Colors.FloorBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.Floor, Colors.FloorBackground, (char)177);
                    }
                }
                //Walls
                else
                {
                    //First set of levels
                    if (Game.mapLevel <= 5)
                    {
                        console.Set(cell.X, cell.Y, Colors.Wall, Colors.WallBackground, '#');
                    }
                    //Second set of levels
                    else if (Game.mapLevel <= 10)
                    {
                        //Colors.WallFov = ;
                        //Colors.WallBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.Wall, Colors.WallBackground, '#');
                    }
                    //Third set of levels
                    else if (Game.mapLevel <= 15)
                    {
                        //Colors.WallFov = ;
                        //Colors.WallBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.Wall, Colors.WallBackground, '#');
                    }
                    //Fourth set of levels
                    else if (Game.mapLevel <= 20)
                    {
                        //Colors.WallFov = ;
                        //Colors.WallBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.Wall, Colors.WallBackground, '#');
                    }
                    //Fifth and final set of levels
                    else if (Game.mapLevel <= 25)
                    {
                        //Colors.WallFov = ;
                        //Colors.WallBackgroundFov = ;
                        console.Set(cell.X, cell.Y, Colors.Wall, Colors.WallBackground, '#');
                    }
                }
            }
        }
Ejemplo n.º 12
0
 public void Draw(RLConsole mapConsole)
 {
     mapConsole.Set(X, Y, Color, null, Symbol);
 }
Ejemplo n.º 13
0
        public void DrawArena(RLConsole console)
        {
            // Use RogueSharp to calculate the current field-of-view for the player
            var position = Floor.Player.TryGetPosition();

            Floor.FloorMap.ComputeFov(position.X, position.Y, 50, true);

            foreach (var cell in Floor.FloorMap.GetAllCells())
            {
                // When a Cell is in the field-of-view set it to a brighter color
                if (cell.IsInFov)
                {
                    Floor.FloorMap.SetCellProperties(cell.X, cell.Y, cell.IsTransparent, cell.IsWalkable, true);
                    if (cell.IsWalkable)
                    {
                        console.Set(cell.X, cell.Y, RLColor.Gray, null, '.');
                    }
                    else
                    {
                        console.Set(cell.X, cell.Y, RLColor.LightGray, null, '#');
                    }
                }
                // If the Cell is not in the field-of-view but has been explored set it darker
                else
                {
                    if (cell.IsWalkable)
                    {
                        console.Set(cell.X, cell.Y, new RLColor(30, 30, 30), null, '.');
                    }
                    else
                    {
                        console.Set(cell.X, cell.Y, RLColor.Gray, null, '#');
                    }
                }
            }

            // Draw enemies, alert + scan radii
            List <RogueSharp.Cell> alertCells = new List <RogueSharp.Cell>();
            List <RogueSharp.Cell> scanCells  = new List <RogueSharp.Cell>();

            foreach (var e in Floor.InspectMapEntities().Where(e => e != Floor.Player))
            {
                var entityPosition = e.TryGetPosition();
                if (e.TryGetDestroyed())
                {
                    console.Set(entityPosition.X, entityPosition.Y, RLColor.Gray, null, 'D');
                }
                else
                {
                    console.Set(entityPosition.X, entityPosition.Y, RLColor.Red, null, 'E');

                    var componentAI = e.GetComponentOfType <Component_AI>();
                    if (componentAI != null)
                    {
                        var infoCells = componentAI.AlertCells(this.Floor);
                        scanCells.AddRange(infoCells.ScanCells);
                        alertCells.AddRange(infoCells.AlertCells);
                    }
                }
            }
            foreach (var cell in scanCells)
            {
                console.SetBackColor(cell.X, cell.Y, RLColor.LightBlue);
            }
            foreach (var cell in alertCells)
            {
                console.SetBackColor(cell.X, cell.Y, RLColor.LightRed);
            }

            // Draw player
            console.Set(position.X, position.Y, RLColor.Green, null, '@');

            // Highlight examined
            if (this.examineMenu.Examining)
            {
                var examinedPostion = this.examineMenu.ExaminedEntity.TryGetPosition();
                console.SetBackColor(examinedPostion.X, examinedPostion.Y, RLColor.Yellow);
            }

            // Highlight targeting
            if (this.targetMenu.Targeting)
            {
                var playerPosition = Floor.Player.TryGetPosition();
                // TODO: Artemis is crying
                var cellsInRange = Floor.CellsInRadius(playerPosition.X, playerPosition.Y,
                                                       this.inventoryMenu.SelectedItem.GetComponentOfType <Component_Usable>().TargetRange);
                foreach (RogueSharp.Cell cell in cellsInRange)
                {
                    if (cell.IsInFov && cell.IsWalkable)
                    {
                        console.SetBackColor(cell.X, cell.Y, RLColor.LightGreen);
                    }
                }

                console.SetBackColor(this.targetMenu.X, this.targetMenu.Y, RLColor.Green);
            }

            // Draw commands
            foreach (var command in dungeon.ExecutedCommands)
            {
                if (command is GameEvent_PrepareAttack)
                {
                    var cmd         = (GameEvent_PrepareAttack)command;
                    var attackerPos = cmd.CommandEntity.TryGetPosition();
                    var targetPos   = cmd.Target.TryGetPosition();
                    var lineCells   = this.Floor.FloorMap.GetCellsAlongLine(attackerPos.X, attackerPos.Y, targetPos.X,
                                                                            targetPos.Y);
                    foreach (var cell in lineCells)
                    {
                        console.SetBackColor(cell.X, cell.Y, RLColor.LightRed);
                    }
                }
            }
            dungeon.ClearExecutedCommands();
        }
Ejemplo n.º 14
0
 public override void Draw(RLConsole console, int x, int y)
 {
     console.Set(x, y, Color, null, Symbols[0]);
     console.Print(x + 1, y, $" - {EffectCode}", Colors.Text);
 }
Ejemplo n.º 15
0
        private void SetConsoleSymbolForCell(RLConsole console, ICell cell)
        {
            if (!cell.IsExplored)
            {
                return;
            }

            double distance    = Game.DistanceBetween(Game.Player.X, Game.Player.Y, cell.X, cell.Y);
            float  blendRatio  = .5f / Game.Player.Awareness;
            float  blendAmount = (float)(blendRatio * distance);

            // Floor values used in Actor.cs
            if (Game.MapLevel < 3)
            {
                if (IsInFov(cell.X, cell.Y))
                {
                    if (cell.IsWalkable)
                    {
                        console.Set(cell.X, cell.Y, RLColor.Blend(Colors.LowLevelFloorFov, Colors.LowLevelFloor, .5f - blendAmount), RLColor.Blend(Colors.BackgroundFov1, Colors.BackgroundFov2, .5f - blendAmount), '.');
                    }
                    else
                    {
                        console.Set(cell.X, cell.Y, RLColor.Blend(Colors.LowLevelWallFov, Colors.LowLevelWall, .5f - blendAmount), RLColor.Blend(Colors.BackgroundFov1, Colors.BackgroundFov2, .5f - blendAmount), '#');
                    }
                }
                else
                {
                    if (cell.IsWalkable)
                    {
                        console.Set(cell.X, cell.Y, Colors.LowLevelFloor, Colors.Background, '.');
                    }
                    else
                    {
                        console.Set(cell.X, cell.Y, Colors.LowLevelWall, Colors.Background, '#');
                    }
                }
            }
            else if (Game.MapLevel < 5)
            {
                if (IsInFov(cell.X, cell.Y))
                {
                    if (cell.IsWalkable)
                    {
                        console.Set(cell.X, cell.Y, RLColor.Blend(Colors.FloorFov, Colors.Floor, .5f - blendAmount), RLColor.Blend(Colors.BackgroundFov1, Colors.BackgroundFov2, .5f - blendAmount), '.');
                    }
                    else
                    {
                        console.Set(cell.X, cell.Y, RLColor.Blend(Colors.WallFov, Colors.Wall, .5f - blendAmount), RLColor.Blend(Colors.BackgroundFov1, Colors.BackgroundFov2, .5f - blendAmount), '#');
                    }
                }
                else
                {
                    if (cell.IsWalkable)
                    {
                        console.Set(cell.X, cell.Y, Colors.Floor, Colors.Background, '.');
                    }
                    else
                    {
                        console.Set(cell.X, cell.Y, Colors.Wall, Colors.Background, '#');
                    }
                }
            }
            else if (Game.MapLevel < 7)
            {
                if (IsInFov(cell.X, cell.Y))
                {
                    if (cell.IsWalkable)
                    {
                        console.Set(cell.X, cell.Y, RLColor.Blend(Colors.IceFloorFov, Colors.IceFloor, .5f - blendAmount), RLColor.Blend(Colors.BackgroundFov1, Colors.BackgroundFov2, .5f - blendAmount), '.');
                    }
                    else
                    {
                        console.Set(cell.X, cell.Y, RLColor.Blend(Colors.IceWallFov, Colors.IceWall, .5f - blendAmount), RLColor.Blend(Colors.BackgroundFov1, Colors.BackgroundFov2, .5f - blendAmount), '#');
                    }
                }
                else
                {
                    if (cell.IsWalkable)
                    {
                        console.Set(cell.X, cell.Y, Colors.IceFloor, Colors.Background, '.');
                    }
                    else
                    {
                        console.Set(cell.X, cell.Y, Colors.IceWall, Colors.Background, '#');
                    }
                }
            }
            else if (Game.MapLevel < 9)
            {
                if (IsInFov(cell.X, cell.Y))
                {
                    if (cell.IsWalkable)
                    {
                        console.Set(cell.X, cell.Y, RLColor.Blend(Colors.CaveFloorFov, Colors.CaveFloor, .5f - blendAmount), RLColor.Blend(Colors.BackgroundFov1, Colors.BackgroundFov2, .5f - blendAmount), '.');
                    }
                    else
                    {
                        console.Set(cell.X, cell.Y, RLColor.Blend(Colors.CaveWallFov, Colors.CaveWall, .5f - blendAmount), RLColor.Blend(Colors.BackgroundFov1, Colors.BackgroundFov2, .5f - blendAmount), '#');
                    }
                }

                else
                {
                    if (cell.IsWalkable)
                    {
                        console.Set(cell.X, cell.Y, Colors.CaveFloor, Colors.Background, '.');
                    }
                    else
                    {
                        console.Set(cell.X, cell.Y, Colors.CaveWall, Colors.Background, '#');
                    }
                }
            }
            else
            {
                if (IsInFov(cell.X, cell.Y))
                {
                    if (cell.IsWalkable)
                    {
                        console.Set(cell.X, cell.Y, RLColor.Blend(Colors.HellFloorFov, Colors.HellFloor, .5f - blendAmount), RLColor.Blend(Colors.BackgroundFov1, Colors.BackgroundFov2, .5f - blendAmount), '.');
                    }
                    else
                    {
                        console.Set(cell.X, cell.Y, RLColor.Blend(Colors.HellWallFov, Colors.HellWall, .5f - blendAmount), RLColor.Blend(Colors.BackgroundFov1, Colors.BackgroundFov2, .5f - blendAmount), '#');
                    }
                }
                else
                {
                    if (cell.IsWalkable)
                    {
                        console.Set(cell.X, cell.Y, Colors.HellFloor, Colors.Background, '.');
                    }
                    else
                    {
                        console.Set(cell.X, cell.Y, Colors.HellWall, Colors.Background, '#');
                    }
                }
            }
        }
Ejemplo n.º 16
0
 public void draw(RLConsole console)
 {
     console.Set(pos.x, pos.y, RLColor.White, null, character);
 }
Ejemplo n.º 17
0
 private void AddSides(RLConsole console, int y)
 {
     console.Set(0, y, RLColor.White, null, (int)GUIParts.DownLeft);
     console.Set(console.Width - 1, y, RLColor.White, null, (int)GUIParts.DownRight);
 }
Ejemplo n.º 18
0
        public void Update(RLConsole console, RLConsole statsConsole)
        {
            var posBit     = (int)Core.ComponentTypes.Position;
            var rendBit    = (int)Core.ComponentTypes.Render;
            int statBit    = (int)Core.ComponentTypes.Health;
            int detailsBit = (int)Core.ComponentTypes.CreatureDetails;
            int yPos       = 16;
            int xPos       = 2;

            Dictionary <int, int> ents = EntityManager.EntityBitLookUp;

            foreach (KeyValuePair <int, int> pair in ents)
            {
                int eid          = pair.Key;
                int furnitureRes = (int)Core.ComponentTypes.Furniture & pair.Value;
                if (furnitureRes > 0)
                {
                    Components.RenderComp   rc = (Components.RenderComp)EntityManager.GetSingleComponentByID(eid, Core.ComponentTypes.Render);
                    Components.PositionComp pc = (Components.PositionComp)EntityManager.GetSingleComponentByID(eid, Core.ComponentTypes.Position);
                    console.Set(pc.X, pc.Y, rc.Colour, Core.Colours.FloorBackground, rc.Glyph);
                }
            }

            foreach (KeyValuePair <int, int> pair in ents)
            {
                int res    = posBit & pair.Value;
                int res2   = rendBit & pair.Value;
                int actRes = (int)Core.ComponentTypes.Actor & pair.Value;

                char    renderChar = 'X';
                RLColor c          = RLColor.White;

                List <Components.Component> comps = EntityManager.GetCompsByID(pair.Key);

                if ((res > 0 && res2 > 0) && (actRes == 0))
                {
                    Components.RenderComp rendComp
                        = (Components.RenderComp)comps.Find(s => s.CompType == Core.ComponentTypes.Render);

                    Components.PositionComp posComp =
                        (Components.PositionComp)comps.Find(s => s.CompType == Core.ComponentTypes.Position);

                    if (rendComp != null && posComp != null)
                    {
                        console.Set(posComp.X, posComp.Y, rendComp.Colour,
                                    Core.Colours.FloorBackground, rendComp.Glyph);
                    }
                    if (rendComp != null)
                    {
                        renderChar = rendComp.Glyph;
                        c          = rendComp.Colour;
                    }
                }

                //draw stats
            }
            foreach (KeyValuePair <int, int> pair in ents)
            {
                // draw only actors on top
                if ((pair.Value & (int)Core.ComponentTypes.Actor) > 0)
                {
                    List <Components.Component> comps = EntityManager.GetCompsByID(pair.Key);

                    Components.RenderComp rendComp = (Components.RenderComp)comps.Find(s => s.CompType == Core.ComponentTypes.Render);

                    Components.PositionComp posComp =
                        (Components.PositionComp)comps.Find(s => s.CompType == Core.ComponentTypes.Position);
                    Components.AIComp aiComp = (Components.AIComp)comps.Find(x => x.CompType == Core.ComponentTypes.AI);

                    RLColor rColor;

                    if (aiComp.Fleeing)
                    {
                        rColor = RLColor.Red;
                    }
                    else
                    {
                        rColor = rendComp.Colour;
                    }

                    if (rendComp != null && posComp != null)
                    {
                        console.Set(posComp.X, posComp.Y, rColor,
                                    Core.Colours.FloorBackground, rendComp.Glyph);
                    }

                    int res3 = statBit & pair.Value;
                    if (res3 > 0)
                    {
                        Components.HealthComp healthStat =
                            (Components.HealthComp)comps.Find(s => s.CompType == Core.ComponentTypes.Health);

                        Components.CreatureDetailsComp detailsComp =
                            (Components.CreatureDetailsComp)comps.Find(x => x.CompType == Core.ComponentTypes.CreatureDetails);

                        Components.InventoryComp invComp = (Components.InventoryComp)comps.Find(x => x.CompType == Core.ComponentTypes.Inventory);

                        if (healthStat != null && detailsComp != null)
                        {
                            statsConsole.Print(xPos, yPos, detailsComp.PersonalName + " the " + detailsComp.Name, rendComp.Colour);
                            yPos++;
                            statsConsole.Print(xPos, yPos, rendComp.Glyph.ToString(), rendComp.Colour);
                            int width
                                = Convert.ToInt32(((double)healthStat.Health / (double)healthStat.MaxHealth) * 16);
                            int remainingWidth = 16 - width;
                            statsConsole.SetBackColor(xPos + 2, yPos, width, 1, Core.Swatch.Primary);
                            statsConsole.SetBackColor(xPos + 2 + width, yPos, remainingWidth, 1, Core.Swatch.PrimaryDarkest);
                            statsConsole.Print(xPos + 2, yPos, $": {healthStat.Health.ToString()}", Core.Swatch.DbLight);
                            yPos++;
                            if (invComp != null)
                            {
                                statsConsole.Print(xPos, yPos, $"Carrying {invComp.Treasure.Count.ToString()} Gold", rendComp.Colour);
                            }
                            yPos = yPos + 2;
                        }
                    }
                }
            }
            // stats console
            int count = 0;

            for (int yp = 0; yp < EntityManager.GetHeight(); yp++)
            {
                for (int xp = 0; xp < EntityManager.GetWidth(); xp++)
                {
                    if (EntityManager.Positions[yp, xp].Count > 0)
                    {
                        HashSet <int> ent = EntityManager.Positions[yp, xp];

                        foreach (int indvID in ent)
                        {
                            List <Components.Component> inner = EntityManager.Entities[indvID];
                            foreach (Components.Component ec in inner)
                            {
                                if (ec.CompType == Core.ComponentTypes.Collectable)
                                {
                                    count++;
                                }
                            }
                        }
                    }
                }
            }

            statsConsole.Print(1, 1, $"collectables=: {count.ToString()}", Core.Colours.TextHeading);
        }
Ejemplo n.º 19
0
 public virtual void Draw(RLConsole console, int x, int y)
 {
     console.Set(x, y, Color, null, Symbols[0]);
     console.Print(x + 1, y, $" - {Quantity}", Colors.Text);
 }
Ejemplo n.º 20
0
 public override void Draw(RLConsole console, int x, int y)
 {
     console.Set(x, y, Color, null, Symbols[0]);
     console.Print(x + 3, y, _effect, Colors.Text, Colors.ComplimentDarkest);
     console.Print(x + 2, y + 1, Quantity.ToString(), Colors.Text, Colors.ComplimentDarkest);
 }