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

@ -48,7 +48,7 @@ class CreditsDisplay(Display):
self.height + self.y - 2,
self.width + self.x - 2)
def display_ascii_art(self):
def display_ascii_art(self) -> None:
with open(ResourceManager.get_asset_path("ascii-art-ecureuil.txt"))\
as f:
ascii_art = f.read().split("\n")

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):

View File

@ -25,5 +25,5 @@ class FakePad:
def getmaxyx(self) -> Tuple[int, int]:
return 42, 42
def inch(self, y, x) -> str:
def inch(self, y: int, x: int) -> str:
return "i"