Commit e435c718 by BellCodeEditor

save project

parent c06c074d
Showing with 4 additions and 3 deletions
...@@ -6,7 +6,7 @@ class Hero(object): ...@@ -6,7 +6,7 @@ class Hero(object):
self.attack = 40 self.attack = 40
self.name = name self.name = name
def combat(): # 攻击 def combat():
self.hp=self.attack self.hp=self.attack
info=self.name+"对"+enemy.name+"发起了攻击" info=self.name+"对"+enemy.name+"发起了攻击"
info2="造成了"+str (self.at+act)+"点伤害" info2="造成了"+str (self.at+act)+"点伤害"
...@@ -14,4 +14,5 @@ class Hero(object): ...@@ -14,4 +14,5 @@ class Hero(object):
info=(1+2+3) info=(1+2+3)
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi= Hero("后羿") houyi= Hero("后羿")
yase.combat(houyi) if enemy.hp >0:
\ No newline at end of file info="英雄阵亡,游戏结束"
\ 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