Commit d4a717f2 by BellCodeEditor

auto save

parent 78ad3816
Showing with 4 additions and 10 deletions
...@@ -5,14 +5,9 @@ class Hero: ...@@ -5,14 +5,9 @@ class Hero:
self.hp = hp self.hp = hp
self.attsck = attsck self.attsck = attsck
def upgrade(): def upgrade():
yase.leven =yase.leven+1 self.leven =yase.leven+1
yase.hp = yase.hp+50 self.hp = yase.hp+50
yase.attsck = yase.attsck+4 self.attsck = yase.attsck+4
yase = Hero("垭瑟",300,20) yase = Hero("垭瑟",300,20)
houyi = Hero("后裔",240,22)
print("垭瑟的初始生命值是:",yase.hp)
upgrade()
upgrade()
print("垭瑟的升级2次后生命值是:",yase.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