Commit 1dcb1bc5 by BellCodeEditor

save project

parent ad7c4e6b
Showing with 4 additions and 4 deletions
...@@ -32,13 +32,13 @@ class Player(Hero): ...@@ -32,13 +32,13 @@ class Player(Hero):
def __init__(self,hero_type,name): def __init__(self,hero_type,name):
super().__init__(name) super().__init__(name)
self.hp = 500 self.hp = 500
self.attack = 80 self.attack = 90
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)
print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack) print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack)
print('-'*30) print('-'*30)
print(' 战斗开始,你是:无畏战士,hp:500,attack:80') print(' 战斗开始')
def cure(self): def cure(self):
c=random.randint(35,50) c=random.randint(35,50)
self.hp+=c self.hp+=c
...@@ -46,7 +46,7 @@ class Player(Hero): ...@@ -46,7 +46,7 @@ class Player(Hero):
self.hp=self.max_hp self.hp=self.max_hp
print(self.name+"使用了治疗,血量增加:",str(c),",目前的血量为:",self.hp) print(self.name+"使用了治疗,血量增加:",str(c),",目前的血量为:",self.hp)
houyi = Player("特种", "无畏战士") houyi = Player("重装甲", "无畏战士")
yase = Hero("狙击手何嘉昕") yase = Hero("狙击手何嘉昕")
while True: while True:
print('-'*30) print('-'*30)
......
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