Commit ba977d23 by BellCodeEditor

save project

parent 7c59d904
Showing with 8 additions and 2 deletions
...@@ -17,8 +17,8 @@ class Hero(object): ...@@ -17,8 +17,8 @@ class Hero(object):
info1 = self.name+"对"+enemy.name+"发起进攻," info1 = self.name+"对"+enemy.name+"发起进攻,"
info2 = "造成"+str(self.attack)+"点伤害," info2 = "造成"+str(self.attack)+"点伤害,"
enemy.hp -= self.attack enemy.hp -= self.attack
print(info1+info2) info3 = enemy.name+'剩余血量'+str(enemy.hp)
print(info1+info2+info3)
class Player(Hero): class Player(Hero):
def __init__(self,hero_type,name): def __init__(self,hero_type,name):
...@@ -46,3 +46,8 @@ while True: ...@@ -46,3 +46,8 @@ while True:
else: else:
print("无效的指令与语法") print("无效的指令与语法")
continue continue
num=random.randint(1,3)
if num==1:
yase.cure()
else:
yase.combat(houyi)
\ 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