Commit 1a3cc5ba by BellCodeEditor

save project

parent ba65bef9
Showing with 16 additions and 0 deletions
import random
class Hero(object): class Hero(object):
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
...@@ -41,3 +43,17 @@ yase = Hero("垭瑟") ...@@ -41,3 +43,17 @@ yase = Hero("垭瑟")
print("战斗开始") print("战斗开始")
while True: while True:
cho=input("请选择释放英雄技能(1攻击/2治疗)") cho=input("请选择释放英雄技能(1攻击/2治疗)")
if cho=="q":
print("游戏结束")
break
elif cho=="2":
houyi.cure()
elif cho=="1":
houyi.combat(yase)
else:
print("输入正确文字!")
de=random.randint(1,3)
if de==1:
yase.cure()
else:
houyi.combat(yase)
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