Commit 9f4c88a9 by BellCodeEditor

save project

parent 6aab6e8f
Showing with 2 additions and 23 deletions
......@@ -6,7 +6,6 @@ class Hero(object):
self.attack = 40
self.max_hp = self.hp
def cure(self): # 治疗
if self.hp+60>self.max_hp:
print(self.name+"使用了治疗,血量增加:", 60,",目前的血量为:",self.max_hp)
......@@ -45,28 +44,7 @@ yase = Hero("垭瑟")
# yase.cure()
print('-'*30)
print(' 开始')
import random
while True:
print('-'*30)
a=input('用技能(攻击1,治疗2)')
if a=="1":
houyi.combat(yase)
elif a=="2":
houyi.cure()
elif a=="q":
print("结束")
break
else:
print("无效,重新输")
continue
num=random.randint(1,3)
if num==1:
yase.cure()
else:
yase.combat(houyi)
input('用技能(攻击1,治疗2)')
\ 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