Commit b115bb47 by BellCodeEditor

save project

parent 0e2dcce1
Showing with 23 additions and 16 deletions
...@@ -4,23 +4,30 @@ class Hero: ...@@ -4,23 +4,30 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
self.maxhp=self.hp
def e(): def e(self):
a.level=a.level+1 self.level=self.level+1
a.hp=a.hp+20 self.hp=self.hp+20
a.attack=a.attack+5 self.attack=self.attack+5
def s(self):
self.hp=self.hp+60
if self.hp>self.maxhp:
self.hp=self.maxhp
print('加60血')
a=Hero('yase',300,20) a=Hero('yase',300,20)
print(a.attack) print(a.attack)
e() a.e()
e() a.e()
print(a.attack)
a=Hero('hy',250,23)
print(a.attack)
e()
e()
print(a.attack)
a=Hero('K',5600,199)
print(a.attack)
e()
e()
print(a.attack) print(a.attack)
d=Hero('hy',250,23)
print(d.attack)
d.e()
d.e()
print(d.attack)
c=Hero('K',5600,199)
print(c.attack)
c.e()
c.e()
print(c.attack)
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