Commit 24b8429a by BellCodeEditor

save project

parent 3b207d2a
Showing with 12 additions and 11 deletions
......@@ -25,13 +25,13 @@ class Hero(object):
info3 = enemy.name+"阵亡,游戏结束"
info = info1+info2+info3
print(info)
print('你干嘛啊~~')
print('你才是恐怖份子')
exit()
class Player(Hero):
def __init__(self,hero_type,name):
super().__init__(name)
self.hp = 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
self.hp = 9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
self.attack = 50000000000000000
self.max_hp = self.hp
self.hero_type = hero_type
......@@ -46,15 +46,15 @@ class Player(Hero):
self.hp=self.max_hp
print(self.name+"使用了治疗,血量增加:",str(c),",目前的血量为:",self.hp)
houyi = Player("射手", "后羿")
yase = Hero("垭瑟")
apiao = Player("恐怖", "阿飘")
abiao = Hero("阿膘")
while True:
print('-'*30)
a=input("请选择技能:1攻击/2治疗")
if int(a)==1:
houyi.combat(yase)
elif int(a)==2:
houyi.cure()
a=input("请选择技能:11攻击/22治疗")
if int(a)==11:
apiao.combat(abiao)
elif int(a)==22:
apiao.cure()
elif a=="q":
print('游戏结束')
break
......@@ -63,9 +63,9 @@ while True:
continue
b=random.randint(1,3)
if b==3:
yase.cure()
abiao.cure()
else:
yase.combat(houyi)
abiao.combat(apiao)
\ 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