Commit 89486f60 by BellCodeEditor

save project

parent 2653470e
Showing with 13 additions and 11 deletions
......@@ -2,14 +2,16 @@ class hero:
def __init__(self,name,hp,attack):
self.name = name
self.level = 1
self.hp = hp
self.attack = attack
def uop(self):
self.level+=1
self.hp+=50
self.attack+=4
yase = hero("垭瑟",300,20)
houyi = hero("后裔",250,23)
houyi.uop()
yase.uop()
print(yase.name,yase.hp,yase.attack)
self.hp = 250
self.attack = 40
def combat(self,enmy):
enmy.hp-=self.attack
if enmy.hp >0:
print("1")
else:
print("11")
exit()
yase = hero("垭瑟")
houyi = hero("后裔")
yase.combat(houyi)
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