Commit 3d83739f by BellCodeEditor

auto save

parent 92ee13a6
Showing with 11 additions and 4 deletions
...@@ -4,7 +4,14 @@ class Hore: ...@@ -4,7 +4,14 @@ class Hore:
self.name = name self.name = name
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
def upgrade(self):
self.level = self.level + 1
self.hp = self.hp + 35
self.attack = self.attack + 10
yase = Hore("垭瑟",300,20) yase = Hore("垭瑟",300,20)
houyi = Hore("后羿",250,23) yase.upgrade()
print(yase.attack) print("等级:",yase.level)
print(houyi.attack) print("能量:",yase.hp)
\ No newline at end of file print("攻击:",yase.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