diff --git a/Main.cs b/Main.cs index 18a9cac..7bb1f7a 100644 --- a/Main.cs +++ b/Main.cs @@ -23,7 +23,7 @@ class Program if (input == "Y") { - user.UseHealingItem((HealingItem)user.Inventory.FirstOrDefault(m => m.Name == "Super Potion")); + user.UseHealingItem((HealingItem)user.Inventory.FirstOrDefault(m => m.Name == "Potion")); } user.DisplayStats(); diff --git a/bin/Debug/net8.0/MiniRPG.dll b/bin/Debug/net8.0/MiniRPG.dll index 0692fe2..0a2a0f2 100644 Binary files a/bin/Debug/net8.0/MiniRPG.dll and b/bin/Debug/net8.0/MiniRPG.dll differ diff --git a/bin/Debug/net8.0/MiniRPG.pdb b/bin/Debug/net8.0/MiniRPG.pdb index faf1bf1..6e22914 100644 Binary files a/bin/Debug/net8.0/MiniRPG.pdb and b/bin/Debug/net8.0/MiniRPG.pdb differ diff --git a/obj/Debug/net8.0/MiniRPG.AssemblyInfo.cs b/obj/Debug/net8.0/MiniRPG.AssemblyInfo.cs index 159243c..ac59532 100644 --- a/obj/Debug/net8.0/MiniRPG.AssemblyInfo.cs +++ b/obj/Debug/net8.0/MiniRPG.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("MiniRPG")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0d65f1e71f6545910b66ab67a8d835b4d1e2c5f9")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4b4b59b9a31bfc76fb1db2b6e61846e0e23362d0")] [assembly: System.Reflection.AssemblyProductAttribute("MiniRPG")] [assembly: System.Reflection.AssemblyTitleAttribute("MiniRPG")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net8.0/MiniRPG.AssemblyInfoInputs.cache b/obj/Debug/net8.0/MiniRPG.AssemblyInfoInputs.cache index 8e5b23a..05fc7b9 100644 --- a/obj/Debug/net8.0/MiniRPG.AssemblyInfoInputs.cache +++ b/obj/Debug/net8.0/MiniRPG.AssemblyInfoInputs.cache @@ -1 +1 @@ -0dc65c6434da51f383575019fc82ae4b29b68e54caebc8f898b0bbe37447dce3 +2f9f95c4d52ac0c3165163d219ccd0cd9cb08d53b12c9beccc5292d27ab9163e diff --git a/obj/Debug/net8.0/MiniRPG.dll b/obj/Debug/net8.0/MiniRPG.dll index 0692fe2..0a2a0f2 100644 Binary files a/obj/Debug/net8.0/MiniRPG.dll and b/obj/Debug/net8.0/MiniRPG.dll differ diff --git a/obj/Debug/net8.0/MiniRPG.pdb b/obj/Debug/net8.0/MiniRPG.pdb index faf1bf1..6e22914 100644 Binary files a/obj/Debug/net8.0/MiniRPG.pdb and b/obj/Debug/net8.0/MiniRPG.pdb differ diff --git a/obj/Debug/net8.0/ref/MiniRPG.dll b/obj/Debug/net8.0/ref/MiniRPG.dll index 2cdd2e3..4b4bf62 100644 Binary files a/obj/Debug/net8.0/ref/MiniRPG.dll and b/obj/Debug/net8.0/ref/MiniRPG.dll differ diff --git a/obj/Debug/net8.0/refint/MiniRPG.dll b/obj/Debug/net8.0/refint/MiniRPG.dll index 2cdd2e3..4b4bf62 100644 Binary files a/obj/Debug/net8.0/refint/MiniRPG.dll and b/obj/Debug/net8.0/refint/MiniRPG.dll differ diff --git a/scripts/objects/characters/Character.cs b/scripts/objects/characters/Character.cs new file mode 100644 index 0000000..9cdf4aa --- /dev/null +++ b/scripts/objects/characters/Character.cs @@ -0,0 +1,15 @@ +public class Character{ + public string Name { get; set; } + public int MaxHealth { get; set; } + public int CurrentHealth { get; set; } + public int MaxMPoints { get; set; } + public int CurrentMPoints { get; set; } + + public Character(string name, int maxhealth, int currenthealth, int maxmpoints, int currentmpoints){ + Name = name; + MaxHealth = maxhealth; + CurrentHealth = currenthealth; + MaxMPoints = maxmpoints; + CurrentMPoints = currentmpoints; + } +} \ No newline at end of file diff --git a/scripts/objects/characters/Enemy.cs b/scripts/objects/characters/Enemy.cs new file mode 100644 index 0000000..0bf7b0e --- /dev/null +++ b/scripts/objects/characters/Enemy.cs @@ -0,0 +1,8 @@ +public class Enemy : Character { + + public List moves { get; set; } + public Enemy(string name, int maxhealth, int currenthealth, int maxmpoints, int currentmpoints) : base(name, maxhealth, currenthealth, maxmpoints, currentmpoints) + { + + } +} \ No newline at end of file diff --git a/scripts/Player.cs b/scripts/objects/characters/Player.cs similarity index 55% rename from scripts/Player.cs rename to scripts/objects/characters/Player.cs index 2b8aa3d..8ca1c26 100644 --- a/scripts/Player.cs +++ b/scripts/objects/characters/Player.cs @@ -1,20 +1,12 @@ -public class Player +public class Player : Character { - public string Name { get; set; } public List Inventory { get; set; } - public int MaxHealth { get; set; } - public int CurrentHealth { get; set; } - public int MaxMPoints { get; set; } - public int CurrentMPoints { get; set; } + public List moves { get; set; } - public Player(string name, List inventory, int maxhealth, int currenthealth, int maxmpoints, int currentmpoints) + public Player(string name, int maxhealth, int currenthealth, int maxmpoints, int currentmpoints, List inventory) : base(name, maxhealth, currenthealth, maxmpoints, currentmpoints) { - Name = name; Inventory = inventory; - MaxHealth = maxhealth; - CurrentHealth = currenthealth; - MaxMPoints = maxmpoints; - CurrentMPoints = currentmpoints; + } //Returns the players inventory in a Dictionary. @@ -33,14 +25,25 @@ public class Player //For using a healing item. Doesn't allow you to overheal. public void UseHealingItem(HealingItem item) { - if ((CurrentHealth + item.HealingAmount) > MaxHealth) + if (Inventory.FirstOrDefault(m => m.Name == item?.Name) != null){ + Inventory.Remove(Inventory.FirstOrDefault(m => m.Name == item.Name)); + if ((CurrentHealth + item.HealingAmount) > MaxHealth) + { + CurrentHealth = MaxHealth; + } + else + { + CurrentHealth += item.HealingAmount; + } + Console.WriteLine($"Used one {item.Name}. Regained {item.HealingAmount} Health.\n"); + } + else { - CurrentHealth = MaxHealth; - } else { - CurrentHealth += item.HealingAmount; + Console.WriteLine($"{Name} does not have any of that in their inventory."); } - Inventory.Remove(Inventory.FirstOrDefault(m => m.Name == item.Name)); - Console.WriteLine($"Used one {item.Name}. Regained {item.HealingAmount} Health.\n"); + + + } //#####DEBUG METHODS#####// diff --git a/scripts/objects/moves/MagicMove.cs b/scripts/objects/moves/MagicMove.cs new file mode 100644 index 0000000..e69de29 diff --git a/scripts/objects/Move.cs b/scripts/objects/moves/Move.cs similarity index 68% rename from scripts/objects/Move.cs rename to scripts/objects/moves/Move.cs index 6e404b2..cb15763 100644 --- a/scripts/objects/Move.cs +++ b/scripts/objects/moves/Move.cs @@ -4,19 +4,12 @@ public class Move public string Description { get; set; } public int Power { get; set; } public int MPCost { get; set; } - public MoveType Type { get; set; } + public virtual string Type { get; set; } - public enum MoveType { - Attack, - Heal, - Buff - } - - public Move(string name, string description, int power, int mpcost, MoveType type){ + public Move(string name, string description, int power, int mpcost){ Name = name; Description = description; Power = power; MPCost = mpcost; - Type = type; } } diff --git a/scripts/objects/moves/PhysicalMove.cs b/scripts/objects/moves/PhysicalMove.cs new file mode 100644 index 0000000..e69de29