Commit 82bf6a86 by BellCodeEditor

save project

parent 1675f7c7
Showing with 5 additions and 12 deletions
......@@ -3,7 +3,7 @@ class Hero(object):
def __init__(self, name):
self.name = name
self.level = 1
self.hp = 360
self.hp = 250
self.attack = 40
self.max_hp = self.hp
......@@ -35,8 +35,8 @@ class Hero(object):
class Player(Hero):
def __init__(self,hero_type,name):
super().__init__(name)
self.hp = 300
self.attack = 50
self.hp = 210
self.attack = 60
self.max_hp = self.hp
self.hero_type = hero_type
print("角色"+self.name+"创建成功,英雄类型为:", self.hero_type)
......@@ -52,8 +52,6 @@ houyi = Player("射手", "后羿")#yase = Player("战士","垭瑟")
yase = Hero("垭瑟")#houyi = Hero("射手", "后羿")
print(" !!战斗开始!!")
print("-"*50)
c = 290
d = 250
while True:
a = input("你要使用什么技能?(1攻击/2治疗/q退出)")
if a=='1':
......@@ -67,10 +65,8 @@ while True:
print("请重新输入")
continue
#b = random.randint(1,2)
if yase.hp<=c:
if yase.hp==150:
houyi.shengji()
print("你升级了!")
c -= 45
b = input("你要使用什么技能?(1攻击/2治疗/q退出)")
if b=='1':
yase.combat(houyi)
......@@ -82,10 +78,7 @@ while True:
else:
print("请重新输入")
continue
if houyi.hp<=d:
yase.shengji()
print("你升级了!")
d -= 35
# houyi.combat(yase)
# yase.combat(houyi)
# houyi.cure()
......
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