From 5542acc443370f4ac39419e73ca275743a34d6f1 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Mon, 6 Apr 2020 11:03:01 +0200 Subject: [PATCH] Player may now self regenerate stamina --- src/entities/Player.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/entities/Player.py b/src/entities/Player.py index 266e474..1df3c3d 100644 --- a/src/entities/Player.py +++ b/src/entities/Player.py @@ -1,4 +1,5 @@ from enum import Enum +import random from src.entities.Entity import Entity from src.entities.Statistics import Statistics @@ -49,6 +50,9 @@ class Player(Entity): if self.fatigueTimeout >= 700: self.statistics.set_thirst(5) self.statistics.set_hunger(3) + # A player can randomly regenerate stamina + if random.randrange(5) == 0: + self.statistics.set_stamina(2) self.fatigueTimeout = 0