Merge pull request #42 from n0remac/armor

Armor
This commit is contained in:
Lief9100
2020-04-26 02:27:22 -07:00
committed by GitHub
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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.
+4 -4
View File
@@ -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,12 +126,12 @@ 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)
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
return paths