Commit 68a8e625 by BellCodeEditor

save project

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