Commit 08710374 by BellCodeEditor

save project

parent fae6e395
Showing with 22 additions and 3 deletions
......@@ -30,10 +30,29 @@ class Player(Hero): # 玩家英雄
self.hero_type=hero_type
print("角色"+self.name+"创建成功,英雄类型为:",self.hero_type)
print("当前等级、血量、攻击力为:",self.level,self.hp,self.attack)
houyi = player("射手","后羿")
yase = hero("垭瑟")
print("-" * 30)
print(" 战斗开始")
while True:
print("-"*30)
choice = input("请选择释放英雄技能(1攻击/2治疗):")
if choice == "q":
print("游戏结束")
break
elif choice == "1":
houyi.combat(yase)
elif choice == "2":
houyi.cure()
else:
print("请重新输入1者或2")
continue
num = random.randint(1,3)
if num == 1:
yase.cure()
else:
yase.combat(houyi)
player = Player("后羿","土豆")
print("玩家的血量值为:",player.hp)
print("玩家的攻击力为:",player.attack)
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