Commit 994e29b9 by BellCodeEditor

save project

parent 4d1a0077
Showing with 9 additions and 9 deletions
......@@ -43,13 +43,13 @@ class Player(Hero):
print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack)
print('-'*30)
print(' 战斗开始')
def cure(self):
c=random.randint(35,50)
self.hp+=c
if self.hp>self.max_hp:
self.hp=self.max_hp
print(self.name+"使用了治疗,血量增加:",str(c),",目前的血量为:",self.hp)
def curt(self):
blood=random.randint(30,50)
self.hp=self.hp+blood
if self.hp > self.max.max_hp:
self.hp = self.max_hp
print(self.name+"使用了治疗数,血量增加:"blood",目前血量为:
houyi = Player("射手", "后羿")
yase = Hero("垭瑟")
houyi = player("射手"后羿")
......@@ -73,4 +73,5 @@ while true:
if num == 1:
yase.cure()
else:
yase.combat(houyi)
\ No newline at end of file
yase.combat(houyi)
print(self.name+"使用了治疗数,血量增加:"60",目前血量为:",5)
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