The strength of the player is now increased when he levels up

This commit is contained in:
eichhornchen 2020-11-19 16:17:02 +01:00
parent 9b00863891
commit a3821676f4
1 changed files with 4 additions and 2 deletions

View File

@ -28,7 +28,8 @@ class Player(FightingEntity):
def move(self, y: int, x: int) -> None:
"""
When the player moves, move the camera of the map.
Moves the view of the map (the point on which the camera is centered)
according to the moves of the player.
"""
super().move(y, x)
self.map.currenty = y
@ -44,6 +45,7 @@ class Player(FightingEntity):
self.current_xp -= self.max_xp
self.max_xp = self.level * 10
self.health = self.maxhealth
self.strength = self.strength + 1
# TODO Remove it, that's only fun
self.map.spawn_random_entities(randint(3 * self.level,
10 * self.level))
@ -62,7 +64,7 @@ class Player(FightingEntity):
"""
If the player tries to move but a fighting entity is there,
the player fights this entity.
It rewards some XP if it is dead.
If the entity dies, the player is rewarded with some XP
"""
# Don't move if we are dead
if self.dead: