added boon functions and returns from kill funcitons

This commit is contained in:
Lief9100
2020-04-24 16:47:58 -07:00
parent 9de313f440
commit 9da3faac8f
2 changed files with 17 additions and 12 deletions

View File

@@ -130,7 +130,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 = max_health, max_armor
self.health, self.armor = 60, max_armor
self.idle_textures = []
self.walking_textures = []
self.up_textures = []
@@ -168,16 +168,24 @@ class Player(Mob):
self.cur_recipe = None
self.speed = 14
def add_kill(self, creature):
def add_kill(self, creature) -> int:
# Adds a kill to kill_list. If 3 or more check the recipe then give a power up if it matches.
self.kill_list.append(creature)
print(self.kill_list)
print(self.cur_recipe)
if self.cur_recipe == self.kill_list:
print("+++++++++++++++++++++++++++++++++++++++++++++++++++++++")
self.kill_list = []
elif len(self.kill_list) >= 3:
if len(self.kill_list) >= 3:
if self.cur_recipe == self.kill_list:
print("+++++++++++++++++++++++++++++++++++++++++++++++++++++++")
self.kill_list = []
return 1
self.kill_list = []
return 0
def heal(self):
self.health+=Config.HEAL_AMOUNT
def harden(self):
self.armor+=Config.ARMOR_AMOUNT
def update_animation(self, delta_time: float = 1 / 60) -> None:
"""
@@ -258,8 +266,6 @@ class Enemy(Mob):
else:
self.change_y = 0
def get_path(self, end: Tuple[int, int] = None) -> List[Tuple[int, int]]:
"""
Returns the path to get to the Mob's target in absolute integer positions.