Commit f7f27aaa by BellCodeEditor

auto save

parent 333e05c0
Showing with 3 additions and 23 deletions
import random
class Hero(object):
def __init__(self, name):
self.name = name
......@@ -14,10 +13,8 @@ class Hero(object):
print(self.name+"使用了治疗,血量增加:", 60,",目前的血量为:",self.hp)
def combat(self, enemy): # 普通攻击
info1 = self.name+"+++++666666666+
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*--+++++++++++++++++/--------------------------------------------------------------------------------------------------------------------------------------------------------------------------对"+enemy.name+"发起进攻,"
info2 = "造成"+str(+++++666666666+
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*--+++++++++++++++++/--------------------------------------------------------------------------------------------------------------------------------------------------------------------------self.attack)+"点伤害,"
info1 = self.name+"对"+enemy.name+"发起进攻,"
info2 = "造成"+str(self.attack)+"点伤害,"
enemy.hp -= self.attack
if enemy.hp > 0:
info3 = enemy.name+"还剩下"+str(enemy.hp)+"血量"
......@@ -56,24 +53,7 @@ print(" 开始游戏")
print("-"*50)
while True:
a=input("请使用攻击技能1,回复技能2")
if a=="1":
houyi.combat(yase)
print("发动攻击")
elif a=="2":
houyi.cure()
print("使用回复")
elif a=="q":
exit()
else:
print("输入有误再来一遍")
continue
com=random.randint(1,3)
if com==1:
yase.combat(houyi)
print("")
else:
yase.cure()
input("请使用攻击技能1,回复技能2")
......
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