Commit 510b875a by BellCodeEditor

save project

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