Commit 7ee5b191 by BellCodeEditor

save project

parent 3cbc94c5
Showing with 4 additions and 4 deletions
...@@ -8,16 +8,16 @@ class Hero(object): ...@@ -8,16 +8,16 @@ class Hero(object):
def combat(self,enemy): # 攻击 def combat(self,enemy): # 攻击
enemy.hp-=self.attack enemy.hp-=self.attack
i1=self.name+'对'+enemy.name+'发起进攻' i1=self.name+'对'+enemy.name+'发起进攻,'
i2='造成'+str(self.attack)+'点伤害' i2='造成'+str(self.attack)+'点伤害,'
i3=enemy.name+'还剩下'+str(enemy.hp)+'点血量' i3=enemy.name+'还剩下'+str(enemy.hp)+'点血量'
i=i1+i2+i3 i=i1+i2+i3
print(i) print(i)
if enemy.hp>0: if enemy.hp>0:
print(i) print(i)
else: else:
info1=self.name+'对'+enemy.name+'发起进攻' info1=self.name+'对'+enemy.name+'发起进攻,'
info2=enemy.name+'已阵亡' info2=enemy.name+'已阵亡,游戏结束'
imfo=info1+info2 imfo=info1+info2
print(info) print(info)
exit() exit()
......
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