Commit 1f8026d4 by BellCodeEditor

save project

parent 2f63ea27
Showing with 4 additions and 12 deletions
import random
class Hero(object):
def __init__(self, name):
self.name = name
......@@ -39,7 +38,7 @@ class Player(Hero):
print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack)
houyi = Player("射手", "后羿")
yase = Hero("垭瑟")
#yase = Hero("垭瑟")
#houyi.combat(yase)
#yase.combat(houyi)
#houyi.cure()
......@@ -49,15 +48,7 @@ print(" 战斗开始")
while True:
print('-'*30)
a=input("1攻击,2治疗:")
if a=='q':
exit()
if a=='1':
houyi.combat(yase)
if a=="2":
houyi.cure()
b=random.randint(1,3)
if b=="1":
yase.cure()
elif b=="2":
yase.combat(yase)
else:
houyi.cure()
\ 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