Linting
This commit is contained in:
parent
b9b776b7ad
commit
98b5dd64a8
|
@ -3,7 +3,7 @@ from ..translations import gettext as _
|
|||
from .player import Player
|
||||
from .items import Item
|
||||
from random import choice
|
||||
from typing import Dict, Tuple, Any
|
||||
from typing import Any
|
||||
|
||||
|
||||
class Merchant(FriendlyEntity):
|
||||
|
|
|
@ -17,8 +17,8 @@ class Item(Entity):
|
|||
held_by: Optional[Player]
|
||||
price: int
|
||||
|
||||
def __init__(self, held: bool = False, held_by: Optional[Player] = None, price : int=2,
|
||||
*args, **kwargs):
|
||||
def __init__(self, held: bool = False, held_by: Optional[Player] = None,
|
||||
price: int = 2, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.held = held
|
||||
self.held_by = held_by
|
||||
|
@ -69,7 +69,8 @@ class Item(Entity):
|
|||
def be_sold(self, buyer: Entity, seller: Entity, game: Any) -> bool:
|
||||
"""
|
||||
Does all necessary actions when an object is to be sold.
|
||||
Is overwritten by some classes that cannot exist in the player's inventory
|
||||
Is overwritten by some classes that cannot exist in the player's
|
||||
inventory
|
||||
"""
|
||||
if buyer.hazel >= self.price:
|
||||
buyer.add_to_inventory(self)
|
||||
|
@ -80,13 +81,15 @@ class Item(Entity):
|
|||
else:
|
||||
return False
|
||||
|
||||
|
||||
class Heart(Item):
|
||||
"""
|
||||
A heart item to return health to the player
|
||||
"""
|
||||
healing: int
|
||||
|
||||
def __init__(self, name: str = "heart", healing: int = 5, price: int = 3, *args, **kwargs):
|
||||
def __init__(self, name: str = "heart", healing: int = 5, price: int = 3,
|
||||
*args, **kwargs):
|
||||
super().__init__(name=name, price=price, *args, **kwargs)
|
||||
self.healing = healing
|
||||
|
||||
|
@ -105,10 +108,11 @@ class Heart(Item):
|
|||
d["healing"] = self.healing
|
||||
return d
|
||||
|
||||
def be_sold(self, buyer: Entity, seller: Entity, game: Any) -> str:
|
||||
def be_sold(self, buyer: Entity, seller: Entity, game: Any) -> bool:
|
||||
"""
|
||||
Does all necessary actions when an object is to be sold.
|
||||
Is overwritten by some classes that cannot exist in the player's inventory
|
||||
Is overwritten by some classes that cannot exist in the player's
|
||||
inventory
|
||||
"""
|
||||
if buyer.hazel >= self.price:
|
||||
self.hold(buyer)
|
||||
|
@ -212,7 +216,8 @@ class BodySnatchPotion(Item):
|
|||
other entity.
|
||||
"""
|
||||
|
||||
def __init__(self, name: str = "body_snatch_potion", price: int = 14, *args, **kwargs):
|
||||
def __init__(self, name: str = "body_snatch_potion", price: int = 14,
|
||||
*args, **kwargs):
|
||||
super().__init__(name=name, price=price, *args, **kwargs)
|
||||
|
||||
def use(self) -> None:
|
||||
|
|
Loading…
Reference in New Issue