Commit 3c00fbea by BellCodeEditor

save project

parent 89e2a8a2
Showing with 5 additions and 23 deletions
import random
class Hero(object): class Hero(object):
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
...@@ -39,24 +38,7 @@ class Player(Hero): ...@@ -39,24 +38,7 @@ class Player(Hero):
houyi = Player("射手", "后羿") houyi = Player("射手", "后羿")
yase = Hero("垭瑟") yase = Hero("垭瑟")
print("-"*30) houyi.combat(yase)
print(" 战斗开始") yase.combat(houyi)
houyi.cure()
while True: yase.cure()
print("-"*30) \ No newline at end of file
p_skill=int(input("请选择技能(1攻击/2治疗):"))
if p_skill==1:
houyi.combat(yase)
c_skill=random.randint(0,1)
elif p_skill==2:
houyi.cure()
c_skill=random.randint(0,1)
else:
print("必须输入1或2")
print("-"*30)
if c_skill==0:
yase.combat(houyi)
elif yase.hp<yase.max_hp:
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