Commit 59894f74 by BellCodeEditor

auto save

parent 40589209
Showing with 4 additions and 1 deletions
...@@ -8,8 +8,10 @@ class Hero: ...@@ -8,8 +8,10 @@ class Hero:
self.level=yase.level+1 self.level=yase.level+1
self.hp=yase.hp+1 self.hp=yase.hp+1
self.attack=yase.attack+1 self.attack=yase.attack+1
print("角色"+self.name+"创建成功,英雄类型为",self_herotype)
print("当前的角色,等级,血量,攻击力为",self.level,self.hp,self.attack)
yase=Hero("亚瑟",200,20) yase=Hero("亚瑟",200,20)
houyi=Hero("后裔",300,25) houyi=Hero("ikun",300,25)
yase.upgrade() yase.upgrade()
print("yase的血量为",yase.hp) print("yase的血量为",yase.hp)
print("houyi的血量为",houyi.hp) print("houyi的血量为",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