linting
This commit is contained in:
parent
de3aba396d
commit
7cd4721daa
|
@ -48,7 +48,7 @@ class CreditsDisplay(Display):
|
||||||
self.height + self.y - 2,
|
self.height + self.y - 2,
|
||||||
self.width + self.x - 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"))\
|
with open(ResourceManager.get_asset_path("ascii-art-ecureuil.txt"))\
|
||||||
as f:
|
as f:
|
||||||
ascii_art = f.read().split("\n")
|
ascii_art = f.read().split("\n")
|
||||||
|
|
|
@ -64,12 +64,12 @@ class Familiar(FightingEntity):
|
||||||
super().__init__(maxhealth=maxhealth, *args, **kwargs)
|
super().__init__(maxhealth=maxhealth, *args, **kwargs)
|
||||||
self.target = None
|
self.target = None
|
||||||
|
|
||||||
## @property
|
# @property
|
||||||
## def dialogue_option(self) -> list:
|
# def dialogue_option(self) -> list:
|
||||||
## """
|
# """
|
||||||
## Debug function (to see if used in the real game)
|
# Debug function (to see if used in the real game)
|
||||||
## """
|
# """
|
||||||
## return [_("My target is"+str(self.target))]
|
# return [_("My target is"+str(self.target))]
|
||||||
|
|
||||||
def act(self, p: Player, m: Map) -> None:
|
def act(self, p: Player, m: Map) -> None:
|
||||||
"""
|
"""
|
||||||
|
@ -78,14 +78,14 @@ class Familiar(FightingEntity):
|
||||||
and attacks it.
|
and attacks it.
|
||||||
"""
|
"""
|
||||||
if self.target is None:
|
if self.target is None:
|
||||||
#If the previous target is dead(or if there was no previous target)
|
# If the previous target is dead(or if there was no previous target)
|
||||||
#the familiar tries to get closer to the player.
|
# the familiar tries to get closer to the player.
|
||||||
self.target = p
|
self.target = p
|
||||||
elif self.target.dead:
|
elif self.target.dead:
|
||||||
self.target = p
|
self.target = p
|
||||||
if self.target == p:
|
if self.target == p:
|
||||||
#Look for monsters around the player to kill TOFIX : if monster is out
|
# Look for monsters around the player to kill TOFIX : if monster is
|
||||||
#of range, continue targetting player.
|
# out of range, continue targetting player.
|
||||||
for entity in m.entities:
|
for entity in m.entities:
|
||||||
if (p.y - entity.y) ** 2 + (p.x - entity.x) ** 2 <= 9 and\
|
if (p.y - entity.y) ** 2 + (p.x - entity.x) ** 2 <= 9 and\
|
||||||
isinstance(entity, Monster):
|
isinstance(entity, Monster):
|
||||||
|
|
|
@ -25,5 +25,5 @@ class FakePad:
|
||||||
def getmaxyx(self) -> Tuple[int, int]:
|
def getmaxyx(self) -> Tuple[int, int]:
|
||||||
return 42, 42
|
return 42, 42
|
||||||
|
|
||||||
def inch(self, y, x) -> str:
|
def inch(self, y: int, x: int) -> str:
|
||||||
return "i"
|
return "i"
|
||||||
|
|
Loading…
Reference in New Issue