Commit ab9cd5de by BellCodeEditor

save project

parent 63824017
Showing with 9 additions and 6 deletions
......@@ -5,14 +5,17 @@ class Hore:
self.HP=HP
self.attack=attack
def upgrade():
yase.level=yase.level+1
yase.HP=yase.HP+50
yase.attack=yase.attack+4
def upgrade(self):
self.level=self.level+1
self.HP=self.HP+50
self.attack=self.attack+4
yase = Hore("亚瑟",300,20)
houyi=Hore("后羿",250,25)
print("亚瑟初始血量为:",yase.HP)
upgrade()
upgrade()
upgrade(yase)
print("亚瑟升级后血量为:",yase.HP)
print("后羿初始血量为:",houyi.HP)
upgrade(houyi)
print("后羿升级后血量为:",houyi.HP)
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