Commit f1e0dc93 by BellCodeEditor

save project

parent 72e54395
Showing with 3 additions and 20 deletions
import random
class Hero(object): class Hero(object):
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
...@@ -39,23 +38,7 @@ class Player(Hero): ...@@ -39,23 +38,7 @@ class Player(Hero):
houyi = Player("两百多斤的瑞典大力士", "Steve") houyi = Player("两百多斤的瑞典大力士", "Steve")
yase = Hero("Herobine") yase = Hero("Herobine")
print(' 战斗开始!')
while True: while True:
print('='*40) print('='*40)
x=input('请选择角色的技能(1:攻击/2:治疗)') print(' 战斗开始!')
if x == 'q': x=input('请选择角色的技能(1:攻击/2:治疗)')
print('游戏结束') \ No newline at end of file
print('感谢您的游玩\n欢迎下次再来!')
exit()
elif x == '1':
houyi.combat(yase)
elif x == '2':
houyi.cure()
else:
print('请重新输入 1 或 2!')
continue
y=random.randint(1,3)
if y == 1:
yase.combat(houyi)
else:
yase.cure()
\ 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