Commit 0f488b4f by BellCodeEditor

save project

parent f3052865
Showing with 3 additions and 42 deletions
...@@ -53,9 +53,7 @@ while True: ...@@ -53,9 +53,7 @@ while True:
a=input("请选择技能:1攻击/2治疗") a=input("请选择技能:1攻击/2治疗")
if int(a)==1: if int(a)==1:
houyi.combat(yase) houyi.combat(yase)
if int(a)==3:
houyi.combat(yase)
houyi.cure()
elif int(a)==2: elif int(a)==2:
houyi.cure() houyi.cure()
elif a=="q": elif a=="q":
......
import random import random
s=0
class Hero(object): class Hero(object):
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
self.level = 1 self.level = 1
self.hp = 5000 self.hp = 250
self.attack = 40 self.attack = 40
self.max_hp = self.hp self.max_hp = self.hp
...@@ -49,50 +48,14 @@ class Player(Hero): ...@@ -49,50 +48,14 @@ class Player(Hero):
houyi = Player("射手", "后羿") houyi = Player("射手", "后羿")
yase = Hero("垭瑟") yase = Hero("垭瑟")
self.hp = 200
self.attack = 50
while True: while True:
print('-'*30) print('-'*30)
a=input("请选择技能:1攻击/2治疗/3反人类/4反人类*10/5赚钱/6升级") a=input("请选择技能:1攻击/2治疗")
if int(a)==1: if int(a)==1:
houyi.combat(yase) houyi.combat(yase)
s=s+0.5
print(s)
if int(a)==3:
if s>=1:
houyi.combat(yase)
houyi.cure()
s=s-1
print(s)
if int(a)==4:
if s>=5:
for i in range(10):
houyi.combat(yase)
houyi.cure()
s=s-5
print(s)
else:
print("没钱了")
print(s)
if int(a)==5:
s=s+3
print(s)
if int(a)==6:
if s>=5:
self.hp = self.hp+50
self.attack = self.attack+10
s=s-5
print(s)
else:
print("没钱了")
print(s)
elif int(a)==2: elif int(a)==2:
houyi.cure() houyi.cure()
s=s+0.5
print(s)
elif a=="q": elif a=="q":
print('游戏结束') print('游戏结束')
break break
......
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