Commit f85c13a5 by BellCodeEditor

save project

parent 8e8cd32a
Showing with 5 additions and 4 deletions
...@@ -4,11 +4,12 @@ class Heor: ...@@ -4,11 +4,12 @@ class Heor:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def deji(): def deji():
self.level=self.level+1 self.level=self.level+1
self.hp=self.hp*1.25 self.hp=self.hp*1.25
self.attack=self.attack*1.05 self.attack=self.attack*1.05
yase=Heor('亚瑟',300,20) yase=Heor('亚瑟',300,20)
houyi=Heor('后羿',240,23) yase.deji()
print('亚瑟血量为'+str(yase.hp)) print('等级为'+str(yase.level))
\ No newline at end of file print('血量为'+str(yase.hp))
print('攻击力为'+str(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