From aafc684435f40c1e0742e7c97a4b7d97c96aab42 Mon Sep 17 00:00:00 2001 From: sthrisha18 <113710121+sthrisha18@users.noreply.github.com> Date: Wed, 17 Jul 2024 00:39:28 +0530 Subject: [PATCH] Update sports.py --- sports.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sports.py b/sports.py index c099cc3..aeba8a6 100644 --- a/sports.py +++ b/sports.py @@ -37,6 +37,12 @@ def nutrition(self, meal_type): self.stamina = 50 print(f"{self.myplayer} had a {meal_type} meal. Current stamina: {self.stamina}") + def rest(self): + self.stamina += 30 + if self.stamina > 50: + self.stamina = 50 + print(f"{self.myplayer} took a rest. Current stamina: {self.stamina}") + def event_summary(self): print(f"Player: {self.myplayer}") print(f"Current Stamina: {self.stamina}")