Ich möchte Ihnen sagen, dass Energy Drinks eine schwere Belastung für den Körper darstellen ... Ich habe es nur dafür gemacht. (Bitte verzeihen Sie mir, dass ich die Klasse nicht geschrieben habe und rufen Sie separate Dateien an.)
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('Körperliche Stärke' + str(self.physical))
print('Ki' + str(self.mental))
if self.physical < 0 or self.mental < 0:
self.destruction = True
print('aus!!!')
sys.exit()
def work(self, physical_damage, mental_damage):
print('Wollen Sie heute arbeiten ...')
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('Ich habe endlich meine Arbeit beendet ...')
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('Müde ... lass uns schlafen ...')
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('Guten Morgen ... Ist es schon Morgen ...')
self.status_check()
monena = Monena()
monena.work(20, 20)
monena.work(30, 30)
monena.work(20, 20)
monena.work(30, 30)
Recommended Posts