Commit 97690f8c by BellCodeEditor

save project

parent 05d69368
Showing with 8 additions and 12 deletions
......@@ -17,16 +17,18 @@ class Hero:
self.speed=self.speed+10
def combat(self,enemy):
print("*"*104)
info1=self.name+"对"+enemy.name+"发起攻击,"
info2="造成"+str(self.attack)+"点伤害,"
enemy.hp -= self.attack
info3=enemy.name+"防下了,"+str(enemy.defense)+"点攻击力,"
enemy.hp = enemy.hp-self.attack+enemy.defense
if enemy.hp>0:
info3=enemy.name+"还剩下"+str(enemy.hp)+"血量."
info=info1+info2+info3
info4=enemy.name+"还剩下"+str(enemy.hp)+"血量."
info=info1+info2+info3+info4
print(info)
else:
info3=enemy.name+"阵亡,游戏结束."
info=info1+info2+info3
info4=enemy.name+"阵亡,游戏结束."
info=info1+info2+info3+info4
print(info)
exit()
......@@ -67,14 +69,8 @@ def printhero():
def upgradeprinthero():
time.sleep(1)
print("*"*104)
print("英雄属性有升级,正在重新打印!")
print("英雄属性有更新,正在重新打印!")
count=1
print("英雄属性列表,正在查找中.")
time.sleep(1)
print("英雄属性列表,正在查找中..")
time.sleep(1)
print("英雄属性列表,正在查找中...")
time.sleep(1)
print("*"*104)
time.sleep(1)
print("英雄"+str(count)+"属性列表,正在打印中...")
......
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