Player may now self regenerate stamina

This commit is contained in:
Marcin Kostrzewski 2020-04-06 11:03:01 +02:00
parent 6994f39864
commit 5542acc443

View File

@ -1,4 +1,5 @@
from enum import Enum from enum import Enum
import random
from src.entities.Entity import Entity from src.entities.Entity import Entity
from src.entities.Statistics import Statistics from src.entities.Statistics import Statistics
@ -49,6 +50,9 @@ class Player(Entity):
if self.fatigueTimeout >= 700: if self.fatigueTimeout >= 700:
self.statistics.set_thirst(5) self.statistics.set_thirst(5)
self.statistics.set_hunger(3) self.statistics.set_hunger(3)
# A player can randomly regenerate stamina
if random.randrange(5) == 0:
self.statistics.set_stamina(2)
self.fatigueTimeout = 0 self.fatigueTimeout = 0