Commit dd9332c0 by BellCodeEditor

save project

parent 32593a5e
Showing with 8 additions and 7 deletions
......@@ -5,10 +5,16 @@ class Hero(object):
self.hp = 250
self.attack = 40
self.max_hp = self.hp
player("射手" "后羿" )
print(' 开始战斗)
print("-"*30)
while True:
print("-"*30)
choice=input("请选择出招方式:1/攻击,2/治疗")
def cure(self): # 治疗
self.hp+60=self.hp
if self.hp>self.max_hp
self.hp+=60
if self.hp>self.max_hp:
self.hp=self.max_hp
print(self.name+"使用了治疗,血量增加:", 60,",目前的血量为:",self.hp)
......@@ -38,7 +44,3 @@ class Player(Hero):
houyi = Player("射手", "后羿")
yase = Hero("垭瑟")
houyi.combat(yase)
yase.combat(houyi)
houyi.cure()
yase.cure()
\ 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