Commit 9a2b99a6 by BellCodeEditor

auto save

parent 00478fce
Showing with 22 additions and 6 deletions
...@@ -30,7 +30,7 @@ class Player(Hero): ...@@ -30,7 +30,7 @@ class Player(Hero):
def __init__(self,hero_type,name): def __init__(self,hero_type,name):
super().__init__(name) super().__init__(name)
self.hp = 200 self.hp = 200
self.attack = 50 self.attack = 404
self.max_hp = self.hp self.max_hp = self.hp
self.hero_type = hero_type self.hero_type = hero_type
print("角色"+self.name+"创建成功,英雄类型为:", self.hero_type) print("角色"+self.name+"创建成功,英雄类型为:", self.hero_type)
...@@ -38,7 +38,23 @@ class Player(Hero): ...@@ -38,7 +38,23 @@ class Player(Hero):
houyi = Player("射手", "后羿") houyi = Player("射手", "后羿")
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi.combat(yase) print("yee"*30)
yase.combat(houyi) print('占戈斗开女台')
houyi.cure() import random
yase.cure() while True:
\ No newline at end of file print("yee"*30)
chice=input('1占戈斗 2治疗')
if chice == '1':
houyi.combat(yase)
elif chice== '2':
houyi.cure()
elif chice== 'q':
print(' 404 NOT FOUND ')
break
else:
print("输入1/2")
num=random.randint(1,3)
if num==1:
yase.combat(houyi)
else:
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