Commit 655801a4 by BellCodeEditor

save project

parent 5bc0590f
Showing with 10 additions and 12 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.hp=250
self.attack=40
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
hoyi.level=yase.level+1
hoyi.hp=yase.hp+50
hoyi.attack=yase.attack+4
yase=Hero("垭瑟",300,20)
upgrade()
upgrade()
print("yase血量值为:",yase.hp)
self.max_hp=self.hp
def cure(self):
self.hp=self.hp+60
if self.hp.max_hp:
self.hp=self.max_hp
print(self.name+"使用了治疗,血量增加",60",目前的血量为",self.hp)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment