Commit fdb60e8d by BellCodeEditor

save project

parent 74457de2
Showing with 3 additions and 3 deletions
...@@ -9,10 +9,10 @@ class Hero(object): ...@@ -9,10 +9,10 @@ class Hero(object):
def combat(self,enemy): # 攻击 def combat(self,enemy): # 攻击
enemy.hp-=enemy.hp-self.attack enemy.hp-=enemy.hp-self.attack
if enemy.hp>0: if enemy.hp>0:
print(self.name+'对',+enemy.name+'发起攻击,造成'+str(self.attack)+'伤害'+enemy.name+'还剩下',+str(enemy.hp)+'点血量') print(self.name+'对'+enemy.name+'发起攻击,造成'+str(self.attack)+'伤害'+enemy.name+'还剩下'+str(enemy.hp)+'点血量')
else: else:
print(self.name+'对',+enemy.name+'发起攻击,造成'+str(self.attack)+'伤害'+enemy.name+'阵亡,游戏结束') print(self.name+'对'+enemy.name+'发起攻击,造成'+str(self.attack)+'伤害'+enemy.name+'阵亡,游戏结束')
exit()
yase = Hero("垭瑟") yase = Hero("垭瑟")
......
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