Commit 84e23d2f by BellCodeEditor

save project

parent 3118aa2b
Showing with 18 additions and 4 deletions
......@@ -10,7 +10,14 @@ class Hero(object):
self.hp=self.hp+60
if self.hp>self.max_hp:
self.hp=self.max_hp
print(self.name+"使用了治疗,血量增加:", 60,",目前的血量为:",self.hp)
print(self.name+"使用了治疗,血量增加:", 60,",目前",self.hp):
def combat(self.enermy)
self.hp=self.hp+60
if self.hp>self.max_hp:
self.hp=self.max_hp
print(self.name+"使用了治疗,血量增加:", 60,",目前",self.hp):
class Player(Hero):
def __init__(self,hero_type,name):
......@@ -24,5 +31,13 @@ class Player(Hero):
houyi = Player("射手", "后羿")
yase = Hero("垭瑟")
houyi.cure()
yase.cure()
\ No newline at end of file
print("_"*30)
input(" 战斗开使")
print("_"*30)
while True:
satute=int(input("请输录指令:1.攻击/2.治疗"))
if satute==1:
houyi.combat(yase)
else:
houyi.cure()
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