Commit 68a8e625 by BellCodeEditor

save project

parent 14e09110
Showing with 13 additions and 6 deletions
......@@ -30,7 +30,7 @@ class Player(Hero):
def __init__(self,hero_type,name):
super().__init__(name)
self.hp = 200
self.attack = 50+
self.attack = 50
self.max_hp = self.hp
self.hero_type = hero_type
print("角色"+self.name+"创建成功,英雄类型为:", self.hero_type)
......@@ -38,7 +38,14 @@ class Player(Hero):
houyi = Player("射手", "后羿")
yase = Hero("垭瑟")
houyi.combat(yase)
yase.combat(houyi)
houyi.cure()
yase.cure()
\ No newline at end of file
print("-"*30)
print(" 战斗开始")
while True:
a=input("1/攻击,2/治疗")
if a=="1":
houyi.combat(yase)
print("-"*30)
if a=="2":
houyi.cure()
print("-"*30)
a=0
\ 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