Commit 0c062487 by BellCodeEditor

save project

parent 831adf9c
Showing with 24 additions and 4 deletions
import random
def __init__ Hero(self):
self.hp = 250
self.max_hp = self.hp
houyi = Player('射手','后羿')
Yase = Hero
def cure(self):
blood = random.randint(30,61)
self.hp += blood
if self.hp > self.max_hp:
self.hp = self.max_hp
print(self.name + '恢复了'+ blood + "点血量,当前血量为" + self.hp)
print ('-' *30) print ('-' *30)
print (' 战斗开始' ) print (' 战斗开始' )
while True: while True:
print ('-' *30) print ('-' *30)
choise = input('请选择释放英雄的技能:(1.攻击 2.治疗):') choise = input('请选择释放英雄的技能:(1.攻击 2.治疗):')
if choise == 'q': if choise == 'q':
...@@ -17,4 +30,9 @@ while True: ...@@ -17,4 +30,9 @@ while True:
houyi.cure() houyi.cure()
else: else:
print("输入错误,请重新输入!") print("输入错误,请重新输入!")
continue continue
\ No newline at end of file status = random.randint(1,3)
if status == 1:
yase.combat(houyi)
else:
yase.cure()
\ No newline at end of file
import turtle
\ 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