Je veux vous dire que les boissons énergisantes sont un lourd fardeau pour le corps ... Je l'ai fait juste pour ça. (Veuillez me pardonner de ne pas avoir écrit le cours et appeler des fichiers séparés)
import sys
class Monena:
def __init__(self):
self.physical = 50
self.mental = 50
self.destruction = False
self.physical_recovery = 0
self.mental_recovery = 0
def status_check(self):
print('Force physique' + str(self.physical))
print('Ki' + str(self.mental))
if self.physical < 0 or self.mental < 0:
self.destruction = True
print('En dehors!!!')
sys.exit()
def work(self, physical_damage, mental_damage):
print('Voulez-vous travailler aujourd'hui ...')
self.physical = self.physical - physical_damage
self.mental = self.mental - mental_damage
self.physical_recovery = physical_damage
self.mental_recovery = mental_damage
if self.physical + self.mental < 50:
self.monena()
print('J'ai enfin fini mon travail ...')
self.status_check()
self.sleep()
def monena(self):
boost = 100 - (self.physical + self.mental)
self.mental = self.mental + boost
self.physical_recovery = self.physical_recovery - int(boost / 2)
self.mental_recovery = self.mental_recovery - int(boost / 2)
print('Haha!')
self.status_check()
def sleep(self):
print('Fatigué ... dormons ...')
if self.physical + self.physical_recovery > 50:
self.physical = 50
else:
self.physical = self.physical + self.physical_recovery
if self.mental + self.mental_recovery > 50:
self.mental = 50
else:
self.mental = self.mental + self.mental_recovery
self.get_up()
def get_up(self):
print('Bonjour ... Est-ce déjà le matin ...')
self.status_check()
monena = Monena()
monena.work(20, 20)
monena.work(30, 30)
monena.work(20, 20)
monena.work(30, 30)
Recommended Posts