Merge branch 'stats' into 'master'
The strength of the player is now increased when he levels up See merge request ynerant/squirrel-battle!19
This commit is contained in:
commit
e56f8fbe88
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue