Commit 510b875a by BellCodeEditor

save project

parent c276a68d
Showing with 16 additions and 8 deletions
...@@ -4,12 +4,20 @@ class Hero: ...@@ -4,12 +4,20 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade1():
self.level+=1
self.hp+=277
self.attack+=22
def upgrade2():
self.level+=1
self.hp+=96
self.attack+=26
yase=Hero("亚瑟",3853,193) yase=Hero("亚瑟",3853,193)
houyi=Hero("后羿",3206,177) houyi=Hero("后羿",3206,177)
def upgrade(self): for i in range(14):
self.level+=1 yase.upgrade1()
self.hp+=388 houyi.upgrade2()
self.attack+=13 print("亚瑟的血量为"+str(yase.hp)+"亚瑟的伤害为"+str(yase.attack))
yase.upgrade() print("后羿的血量为"+str(houyi.hp)+"后羿的伤害为"+str(houyi.attack))
print("亚瑟的血量为"+str(yase.hp)) \ No newline at end of file
print("后羿的血量为"+str(houyi.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