Commit d8e5ce1f by BellCodeEditor

save project

parent d151dcd0
Showing with 8 additions and 4 deletions
import random
class Hero(object):
def __init__(self, name):
self.name = name
......@@ -17,11 +18,11 @@ class Hero(object):
info2 = "造成"+str(self.attack)+"点伤害,"
enemy.hp -= self.attack
if enemy.hp > 0:
info3 = enemy.name+"还剩下"+str(enemy.hp)+"血量"
info3 = enemy.name+"阵亡,游戏结束"
info = info1+info2+info3
print(info)
else:
info3 = enemy.name+"阵亡,游戏结束"
info3 = enemy.name+"还剩下"+str(enemy.hp)+"血量"
info = info1+info2+info3
print(info)
exit()
......@@ -43,4 +44,7 @@ print(' 战斗开始')
while True:
print("-" * 30)
choice = input("请选择释放英雄技能(1攻击/2治疗):")
\ No newline at end of file
choice = input("请选择释放英雄技能(1攻击/2治疗):")
if choice == "q":
print("")
\ 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