This commit is contained in:
eichhornchen
2020-12-31 15:00:20 +01:00
parent de3aba396d
commit 7cd4721daa
3 changed files with 12 additions and 12 deletions

View File

@ -64,12 +64,12 @@ class Familiar(FightingEntity):
super().__init__(maxhealth=maxhealth, *args, **kwargs)
self.target = None
## @property
## def dialogue_option(self) -> list:
## """
## Debug function (to see if used in the real game)
## """
## return [_("My target is"+str(self.target))]
# @property
# def dialogue_option(self) -> list:
# """
# Debug function (to see if used in the real game)
# """
# return [_("My target is"+str(self.target))]
def act(self, p: Player, m: Map) -> None:
"""
@ -78,14 +78,14 @@ class Familiar(FightingEntity):
and attacks it.
"""
if self.target is None:
#If the previous target is dead(or if there was no previous target)
#the familiar tries to get closer to the player.
# If the previous target is dead(or if there was no previous target)
# the familiar tries to get closer to the player.
self.target = p
elif self.target.dead:
self.target = p
if self.target == p:
#Look for monsters around the player to kill TOFIX : if monster is out
#of range, continue targetting player.
# Look for monsters around the player to kill TOFIX : if monster is
# out of range, continue targetting player.
for entity in m.entities:
if (p.y - entity.y) ** 2 + (p.x - entity.x) ** 2 <= 9 and\
isinstance(entity, Monster):