Commit ad5dee88 by BellCodeEditor

save project

parent 02a6741f
Showing with 16 additions and 7 deletions
...@@ -6,6 +6,8 @@ class Hero: ...@@ -6,6 +6,8 @@ class Hero:
self.attack = 40 self.attack = 40
self.max_hp = self.hp self.max_hp = self.hp
self.herotype = herotype self.herotype = herotype
def cure(self): def cure(self):
self.max_hp = self.max_hp + 60 self.max_hp = self.max_hp + 60
if self.hp>250: if self.hp>250:
...@@ -25,14 +27,21 @@ class Hero: ...@@ -25,14 +27,21 @@ class Hero:
info = info1+info2+info3 info = info1+info2+info3
print(info) print(info)
exit() exit()
class Player(Hero):
def __init__()
yase = Hero("亚瑟","坦克") yase = Hero("亚瑟","坦克")
houyi = Hero("后羿","射手") houyi = Hero("后羿","射手")
houyi.combat(yase) print("-"*30)
yase.cure() print(" 战斗开始")
houyi.combat(yase) print("-"*30)
yase.cure() while True:
houyi.combat(yase) satute = int(input("请选择英雄技能(1攻击/2治疗):"))
yase.cure() if satute == 1:
if satute == 2:
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