Skip to content

Commit

Permalink
Added dummy for tests, fixed monsters not dying if they have less tha…
Browse files Browse the repository at this point in the history
…n 0 hp
  • Loading branch information
Zegis committed Feb 10, 2022
1 parent 2f8a044 commit bf5d19f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Kaeshi/Entity/Character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void Injure(int damage)
{
Console.Write("Direct hit!");
_life -= damage;
if (_life == 0)
if (_life <= 0)
{
Console.Write("Death");
_isAlive = false;
Expand Down
4 changes: 4 additions & 0 deletions Kaeshi/Entity/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ public Map()
current = locations["root"];
current.SetLink(Direction.North, locations["north1"]);

var dummy = new Character(1, 1, 1);
dummy.PutInBackpack(new Item("Dummy pieces", "Pieces of wooden dummy"));

locations["north1"].SetLink(Direction.South, locations["root"]);
locations["north1"].AddNpc("MiB", CharacterFactory.Generate());
locations["north1"].AddNpc("MiB2", CharacterFactory.Generate());

locations["root"].AddItem("Token", new Item("Token", "Round token of some kind"));
locations["root"].AddItem("AidKit", new UsableItem("AidKit","First aid kit, heals small amount of health",2, EffectsLibrary.Get("heal")));
locations["root"].AddItem("Armor", new EquippableItem("Armor", "Standard buletproof vest", 2, EquippableType.Armor));
locations["root"].AddNpc("Dummy", dummy);

return locations;
}
Expand Down

0 comments on commit bf5d19f

Please sign in to comment.