From ee828af08466aa369edc7fbd8cd80e0a25d7acc2 Mon Sep 17 00:00:00 2001 From: Cameron Smart Date: Sun, 26 Apr 2020 02:21:09 -0700 Subject: [PATCH 1/3] Took armor into account when dealing damage. --- triple-dungeon/mobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/triple-dungeon/mobs.py b/triple-dungeon/mobs.py index 16a3477..bc1061a 100644 --- a/triple-dungeon/mobs.py +++ b/triple-dungeon/mobs.py @@ -70,7 +70,7 @@ class MobHandler: distance = self.get_distance(enemy) enemy.collisions.update() if distance < 100 : - self.player.health -= 1 + self.player.health -= (2 - self.player.armor) if (distance < 300): enemy.speed = Config.MONSTER_MOVEMENT_SPEED try: @@ -126,7 +126,7 @@ class Mob(arcade.Sprite): Represents a Mob. No defined behaviour, it has no intelligence. """ - def __init__(self, dungeon: Dungeon, max_health=100, max_armor=0, *args, **kwargs) -> None: + def __init__(self, dungeon: Dungeon, max_health=200, max_armor=0, *args, **kwargs) -> None: # Set up parent class super(Mob, self).__init__(*args, **kwargs) From d5effa54085e583f0ce38247a78831422fa532f0 Mon Sep 17 00:00:00 2001 From: Cameron Smart Date: Sun, 26 Apr 2020 02:22:30 -0700 Subject: [PATCH 2/3] Updated readme --- triple-dungeon/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/triple-dungeon/README.md b/triple-dungeon/README.md index d6bd49c..1916cc1 100644 --- a/triple-dungeon/README.md +++ b/triple-dungeon/README.md @@ -16,4 +16,4 @@ This game can be setup and run with: ## Instructions Use WASD to move and the mouse to aim and fire. -Use left shift to cycle through different monster combinations and try to shoot the monsters in that order to recieve a speed boost. Once all the monsters are gone you will move onto another level. +Use left shift to cycle through different monster combinations and try to shoot the monsters in that order to recieve a speed boost. Once all the monsters are gone you will move onto another level. If the monters get too close you will take damage. If your health geths to 0 the game will be restarted. From b3b5dc17900a4353f1256049c851dcaa15bd6e04 Mon Sep 17 00:00:00 2001 From: Lief9100 <63810266+Lief9100@users.noreply.github.com> Date: Sun, 26 Apr 2020 02:26:18 -0700 Subject: [PATCH 3/3] Reset starting health to be full --- triple-dungeon/mobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/triple-dungeon/mobs.py b/triple-dungeon/mobs.py index bc1061a..4afcb21 100644 --- a/triple-dungeon/mobs.py +++ b/triple-dungeon/mobs.py @@ -131,7 +131,7 @@ class Mob(arcade.Sprite): super(Mob, self).__init__(*args, **kwargs) self.max_health, self.max_armor = max_health, max_armor - self.health, self.armor = 60, max_armor + self.health, self.armor = max_health, max_armor self.idle_textures = [] self.walking_textures = [] self.up_textures = [] @@ -270,4 +270,4 @@ class Enemy(Mob): start, end = self.dungeon.grid.node(*start), self.dungeon.grid.node(*end) paths, runs = self.dungeon.finder.find_path(start, end, self.dungeon.grid) self.dungeon.grid.cleanup() - return paths \ No newline at end of file + return paths