Commit a9fff9f5 by BellCodeEditor

save project

parent 70613bea
Showing with 16 additions and 1 deletions
...@@ -39,10 +39,25 @@ class Player(Hero): ...@@ -39,10 +39,25 @@ class Player(Hero):
print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack) print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack)
houyi = Player("射手", "后羿") houyi = Player("射手", "后羿")
yase = Hero("瑟") yase = Hero("瑟")
print(" "*30) print(" "*30)
print(" "*4,"战斗开始") print(" "*4,"战斗开始")
while True: while True:
print(" "*30) print(" "*30)
chose=input("请选择(1/攻击 2/治疗)") chose=input("请选择(1/攻击 2/治疗)")
print(" "*30) print(" "*30)
if chose=="q":
print("游戏结束")
break
elif chose=="1":
houyi.combat(yase)
elif chose=="2":
houyi.cure()
else:
print("无效,请重新输入,(1/攻击 2/治疗)")
a=random.randint(1,3)
if a==1:
yase.cure()
else:
yase.combat(houyi)
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