From 898ef70c9695316ffcb555ac623f7ecffd19e7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jos=C3=A9?= Date: Wed, 16 Aug 2023 10:51:32 -0300 Subject: [PATCH] added more mobs --- ColorConverter.cs | 30 +++++++++++++++++++++++ Entity.cs | 4 ++-- LilRogue.csproj | 1 + Player.cs | 15 ++++++++---- Program.cs | 28 +++++++++++++++++++--- bin/Debug/net7.0/LilRogue.dll | Bin 22528 -> 26112 bytes data/monsters.json | 44 ++++++++++++++++++++++++++++++++++ mob.cs | 42 +++++++++++++++++++++++++------- 8 files changed, 146 insertions(+), 18 deletions(-) create mode 100644 ColorConverter.cs create mode 100644 data/monsters.json diff --git a/ColorConverter.cs b/ColorConverter.cs new file mode 100644 index 0000000..71fd1e4 --- /dev/null +++ b/ColorConverter.cs @@ -0,0 +1,30 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using SFML.Graphics; + +public class ColorConverter : JsonConverter +{ + public override Color ReadJson(JsonReader reader, Type objectType, Color existingValue, bool hasExistingValue, JsonSerializer serializer) + { + var token = JToken.Load(reader); + var array = (JArray)token; + + if (array.Count != 3) + throw new JsonSerializationException("Invalid color format. RGB values must be provided as an array of three integers."); + + var r = array[0].Value(); + var g = array[1].Value(); + var b = array[2].Value(); + + return new Color(r, g, b); + } + + public override void WriteJson(JsonWriter writer, Color value, JsonSerializer serializer) + { + writer.WriteStartArray(); + writer.WriteValue(value.R); + writer.WriteValue(value.G); + writer.WriteValue(value.B); + writer.WriteEndArray(); + } +} diff --git a/Entity.cs b/Entity.cs index 8e8dbb9..602ae85 100644 --- a/Entity.cs +++ b/Entity.cs @@ -13,7 +13,7 @@ public class Entity public Color OutlineColor { get; set; } public float OutlineThickness { get; set; } - private readonly Grid grid; + public Grid grid; private SchedulingSystem schedulingSystem; public Entity(Grid grid, char symbol, Vector2i position, Color fillColor, Color backgroundColor, Color outlineColor, float outlineThickness = 0, Map? map = null) { @@ -26,7 +26,7 @@ public Entity(Grid grid, char symbol, Vector2i position, Color fillColor, OutlineThickness = outlineThickness; } - public void draw() + public virtual void draw() { grid.SetCell(Position.X, Position.Y, Symbol, FillColor, BackgroundColor, OutlineColor, OutlineThickness); } diff --git a/LilRogue.csproj b/LilRogue.csproj index 437c7f6..4bb14dd 100644 --- a/LilRogue.csproj +++ b/LilRogue.csproj @@ -8,6 +8,7 @@ + diff --git a/Player.cs b/Player.cs index 978e32e..e22f698 100644 --- a/Player.cs +++ b/Player.cs @@ -129,7 +129,7 @@ public void tryToMove(int x, int y, Map map, List mobs) } else { - return; + } } } @@ -182,9 +182,6 @@ public void Update() if (HP <= 0) { isDead = true; - this.Symbol = '&'; - this.BackgroundColor = Color.Black; - this.FillColor = Color.Red; //wait a bit deathwindowTimer.Start(); if (deathwindowTimer.ElapsedMilliseconds >= 1000) @@ -194,5 +191,15 @@ public void Update() } } + public override void draw() + { + //if dead + if (HP <= 0) + { + return; + } + + grid.SetCell(Position.X, Position.Y, Symbol, FillColor, BackgroundColor, OutlineColor, OutlineThickness); + } } } diff --git a/Program.cs b/Program.cs index 0b7ac06..6dba7db 100644 --- a/Program.cs +++ b/Program.cs @@ -5,6 +5,7 @@ using SFML.Window; using RogueSharp; using RogueSharp.MapCreation; +using Newtonsoft.Json; namespace LilRogue { @@ -21,6 +22,7 @@ static void Main(string[] args) var window = new RenderWindow(new VideoMode((uint)screenWidth, (uint)screenHeight, 32), "Lil Rogue"); + var RNG = new Random(); //set limit FPS window.SetFramerateLimit(60); @@ -44,12 +46,28 @@ static void Main(string[] args) //mob array var Mobs = new List(); - // add mobs - for (int i = 0; i < 2; i++) + string monstersjson = File.ReadAllText("data/monsters.json"); + var settings = new JsonSerializerSettings(); + settings.Converters.Add(new ColorConverter()); + var monsters = JsonConvert.DeserializeObject>(monstersjson, settings); + + for (int i = 0; i < 5; i++) { - var mob = new Mob(grid, 'M', FindWalkableCell(gameMap), Color.Black, Color.Red, Color.Black, 35 , 1); + //get a random monster + var monster = monsters[RNG.Next(0, monsters.Count)]; + var pos = FindWalkableCell(gameMap); + var color = monster.color; + var BackgroundColor = monster.BackgroundColor; + + Mob mob = new Mob(grid, monster.Symbol, pos, ConvertColor(BackgroundColor), ConvertColor(color), Color.Black, monster.HP, 0, monster.Type, monster.speed, monster.attack, monster.armor, schedulingSystem, gameMap); Mobs.Add(mob); } + + + + + + var upStairs = new Entity(grid, '<', new Vector2i(upStairsPosition.X, upStairsPosition.Y), Color.Black, Color.Yellow, Color.White, 1, gameMap); var downStairs = new Entity(grid, '>', new Vector2i(downStairsPosition.X, downStairsPosition.Y), Color.Black, Color.Yellow, Color.White, 1, gameMap); @@ -145,6 +163,10 @@ static Vector2i FindWalkableCell(Map gameMap) } } } + static Color ConvertColor(int[] ints) + { + return new Color((byte)ints[0], (byte)ints[1], (byte)ints[2]); + } } } } diff --git a/bin/Debug/net7.0/LilRogue.dll b/bin/Debug/net7.0/LilRogue.dll index 1d08421e285fcf681a849243b5a5fe318e1dcfc5..28583e4210960919be41202ebd98d26ca0b7a87d 100644 GIT binary patch literal 26112 zcmeHvdw5*cb?-WlIdkTr(VQ7eGJa_+%P_WN`3<)5OSWWN#t&i1ST-j1STmLfkLJiT zBiq8*kz*j35JD1YFyR?ULQ=woT-r+>O>k)-wBZ(L)6n*YLdi!UUul|Kz9i&f?r*Jq zMjH7+xL@x-yD-zRzsPyVbF_`zTp#gY1N zM(D}F3saxcHoP#kdtbJg7$~@Xg;al{HJFurVE0uNo;4NUCkCq0cX`1~a6^zRN6byxEL5S|z@U258(*HyG>DP<0q zKqq$qpiKJe*$qlQ38LLCg<_!>l-M>5#KQL@_*Q&Y!XYh%OwL6`wv`^hmu02#t@x}Y zT2(;`YOr7NVcT@_(f3=47F zE-x1t=g_cuOgSc|Ig=8uEiysTNX0eiy?Vyy%Qpdq#`<9A9&&fLa4Z z2i)uYwQda0BsfiBf88iiB17+*FMY=DE8G&cSW$G=JEAMuf{I62OK5CcKg7#i z<@Ol%4{XoI{YTn!pFXHPX4wboXAhjey-i18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dh8lZwQlXeZqIE;M?aoyWf(*YQgO{Ks{j)C0H?S!pNUfbGD4kJp3ycDxhYAvM2d z{^pEY6H1o9K4_gU$Hcu_;jd|A~?<+wLXT3P(MGo1IJd>|^#I3qe%9%Bu0&%bA zhf;waGE>l1gH9FH%A?l6c_jTSI@a)>uljcxa%n7cyzS#Ri*4wQ^HT0(6eGf$4Cuj^ z%EW8(aPU@1o2s_$sEJ2T>6ge$dU{A;|sr!LECNUV?bK*D2FjVw$cDH?+WUq@Yx`J?C|+)LGGif zBU8#6Z`PNx<4(x%puq_2QK`}L{B~S|cfT4uy0*=^7MZXI@_w;hE9}M3R73JKG>Q>i zxDDHqX#dSb|6JpEzj^HItJfVFDx?mnBfT|q5b5Wna>YI`i<62qbM|y?TC`$L3eUjB zY^LB9b8F^|=E`%{t&IdD!PR)TDaYU`h$xoV%)ybvDn3*k%9IxkRgW+h;TURFraaVg zXz833UW?`X@km|WsH8s#OQptzZO!889FMJM>BL*noKz9J*P1yUquA;Sd3EmCk{KSJ zvsg)}lt#)GK1F|<`Yf9x?a(()cSiU>-@m59G>kQ|j`n)D*4> zIf%f0BYY^iEq5qaNEH~anUld`0l(}i%}I^qTl;WM1T*&IkSFI4N`x#vk2Y1+7oVm3 l>c!(mK!w$dt1~3uRD}cl-*)X+zr)J%52615_5Yj&{x`Rl7Z?Bl diff --git a/data/monsters.json b/data/monsters.json new file mode 100644 index 0000000..c3956a2 --- /dev/null +++ b/data/monsters.json @@ -0,0 +1,44 @@ +[ + { + "id": 0, + "name": "Rat", + "description": "A small, brown, rat. its eyes are red, and its appearance is is ugly. also, it is very fast and wants to kill you.", + "HP": 25, + "speed": 3, + "armor": 1, + "attack": 1, + "symbol": "r", + "color": [ + 153, + 77, + 51 + ], + "backgroundColor": [ + 0, + 0, + 0 + ], + "type": "animal" + }, + { + "id": 1, + "name": "Zombie", + "description": "A undead (by some force) human body. unstoppable rage and hunger for human flesh is visible in its yellowish eyes. its skin is pale green and full of cuts and bruises.", + "HP": 50, + "speed": 2, + "armor": 2, + "attack": 2, + "symbol": "Z", + "color": [ + 100, + 155, + 100 + ], + "backgroundColor": [ + 0, + 0, + 0 + ], + "type": "undead" + } +] diff --git a/mob.cs b/mob.cs index 1d1a983..c44d83e 100644 --- a/mob.cs +++ b/mob.cs @@ -10,13 +10,32 @@ public class Mob : Entity public int HP { get; set; } public int MaxHP { get; set; } public int armor { get; set; } + public int speed { get; set; } + + public int attack { get; set; } + + public char Symbol { get; set; } + public int[] color { get; set; } + public Color TrueColor { get; set; } + public int[] BackgroundColor { get; set; } + public Color TrueBackgroundColor { get; set; } + public string Type { get; set; } public Grid grid1 { get; set; } - public Mob(Grid grid, char symbol, Vector2i position, Color fillColor, Color backgroundColor, Color outlineColor, int maxHP = 100, float outlineThickness = 0) + public Mob(Grid grid, char symbol, Vector2i position, Color fillColor, Color backgroundColor, Color outlineColor, int maxHP = 100, float outlineThickness = 0, string type = "null", int Speed = 1, int Attack = 0, int Armor = 0, SchedulingSystem schedulingSystem = null, Map map = null) : base(grid, symbol, position, fillColor, backgroundColor, outlineColor, outlineThickness) { MaxHP = maxHP; HP = MaxHP; grid1 = grid; + armor = Armor; + speed = Speed; + attack = Attack; + Type = type; + Symbol = symbol; + color = new int[] { fillColor.R, fillColor.G, fillColor.B }; + TrueColor = new Color((byte)color[0], (byte)color[1], (byte)color[2]); + BackgroundColor = new int[] { backgroundColor.R, backgroundColor.G, backgroundColor.B }; + TrueBackgroundColor = new Color((byte)BackgroundColor[0], (byte)BackgroundColor[1], (byte)BackgroundColor[2]); } public Vector2i GoToLocation(int x, int y, Map map) @@ -58,10 +77,6 @@ public void Update(Map map, Player player, SchedulingSystem schedulingSystem, Li var lastSeenPlayerPosition = new Vector2i(-1, -1); if (HP <= 0 || HP > MaxHP) { - // set char to a bloody red "&" - this.Symbol = '&'; - this.BackgroundColor = Color.Black; - this.FillColor = Color.Red; return; } @@ -79,7 +94,7 @@ public void Update(Map map, Player player, SchedulingSystem schedulingSystem, Li if (state == "chase"){ - for (int i = 0; i < schedulingSystem.calculateTimeSteps(schedulingSystem.time, schedulingSystem.time + 1, 2); i++) + for (int i = 0; i < schedulingSystem.calculateTimeSteps(schedulingSystem.time, schedulingSystem.time + 6, speed * 2); i++) { if (CanbeSeen(map)) { @@ -91,8 +106,7 @@ public void Update(Map map, Player player, SchedulingSystem schedulingSystem, Li foreach (var mob in mobs) if (ToGoalPosition.X == player.Position.X && ToGoalPosition.Y == player.Position.Y) { - - player.TakeDamage(4.25); + player.TakeDamage(attack); break; } else if (ToGoalPosition.X == mob.Position.X && ToGoalPosition.Y == mob.Position.Y) //blocked by another mob @@ -119,7 +133,7 @@ public void Update(Map map, Player player, SchedulingSystem schedulingSystem, Li wanderpos = map.GetRandomCell(); } - for (int i = 0; i < schedulingSystem.calculateTimeSteps(schedulingSystem.time, schedulingSystem.time + 1, 1); i++) + for (int i = 0; i < schedulingSystem.calculateTimeSteps(schedulingSystem.time, schedulingSystem.time + 6, speed); i++) { ToGoalPosition = GoToLocation(wanderpos.X, wanderpos.Y, map); @@ -152,6 +166,16 @@ public void TakeDamage(double damage) this.HP -= (int) Math.Round(Math.Clamp(finalDMG * 1.25, 0, 999999), 1); } + public override void draw() + { + //if dead + if (HP <= 0) + { + return; + } + + grid1.SetCell(Position.X, Position.Y, Symbol, TrueColor, TrueBackgroundColor, Color.Black, 1); + } } }