From 7cd4721daa14a2a66c4bac02d8c6ee99c539c2d6 Mon Sep 17 00:00:00 2001 From: eichhornchen Date: Thu, 31 Dec 2020 15:00:20 +0100 Subject: [PATCH] linting --- squirrelbattle/display/creditsdisplay.py | 2 +- squirrelbattle/entities/friendly.py | 20 ++++++++++---------- squirrelbattle/tests/screen.py | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/squirrelbattle/display/creditsdisplay.py b/squirrelbattle/display/creditsdisplay.py index c3bbe10..af8d879 100644 --- a/squirrelbattle/display/creditsdisplay.py +++ b/squirrelbattle/display/creditsdisplay.py @@ -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") diff --git a/squirrelbattle/entities/friendly.py b/squirrelbattle/entities/friendly.py index fb33a3f..974fe1f 100644 --- a/squirrelbattle/entities/friendly.py +++ b/squirrelbattle/entities/friendly.py @@ -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): diff --git a/squirrelbattle/tests/screen.py b/squirrelbattle/tests/screen.py index 549fdc1..386b3d3 100644 --- a/squirrelbattle/tests/screen.py +++ b/squirrelbattle/tests/screen.py @@ -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"