Commit 69b55c19 by BellCodeEditor

save project

parent fa0da134
Showing with 11 additions and 1 deletions
......@@ -15,6 +15,13 @@ class Hero(object):
self.max_gp = self.level*100
self.attack *= 1.2
self.max_hp *= 1.2
print(self.name+'升级了')
time.sleep(0.2)
print('当前等级:'+str(self.level))
time.sleep(0.2)
print('当前血量:'+str(self.max_hp))
time.sleep(0.2)
print('当前攻击:'+str(self.attack))
def cure(self): # 治疗
if self.hp + 60 > self.max_hp:
self.hp = self.max_hp
......@@ -35,7 +42,10 @@ class Hero(object):
info = info1+info2+info3
print(info)
exit()
self.gp += 20
print('经验:'+str(self.gp),'/',str(self.max_gp))
if self.gp >= self.max_gp:
self.upgrate()
class Player(Hero):
def __init__(self,hero_type,name):
super().__init__(name)
......
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