This commit is contained in:
Yohann D'ANELLO
2021-01-06 18:02:58 +01:00
parent ae505166b7
commit a8c0c197ed
5 changed files with 32 additions and 22 deletions

View File

@@ -28,9 +28,9 @@ class Player(InventoryHolder, FightingEntity):
dexterity: int = 1, constitution: int = 1, level: int = 1,
current_xp: int = 0, max_xp: int = 10, inventory: list = None,
hazel: int = 42, equipped_main: Optional[Item] = None,
equipped_armor: Optional[Item] = None, critical: int = 5,\
equipped_secondary: Optional[Item] = None, \
equipped_helmet: Optional[Item] = None, xp_buff: float = 1,\
equipped_armor: Optional[Item] = None, critical: int = 5,
equipped_secondary: Optional[Item] = None,
equipped_helmet: Optional[Item] = None, xp_buff: float = 1,
*args, **kwargs) -> None:
super().__init__(name=name, maxhealth=maxhealth, strength=strength,
intelligence=intelligence, charisma=charisma,
@@ -84,7 +84,7 @@ class Player(InventoryHolder, FightingEntity):
Add some experience to the player.
If the required amount is reached, level up.
"""
self.current_xp += int(xp*self.xp_buff)
self.current_xp += int(xp * self.xp_buff)
self.level_up()
def remove_from_inventory(self, obj: Item) -> None: