Commit 691cc308 by BellCodeEditor

auto save

parent ac2ea1e8
Showing with 19 additions and 7 deletions
class yingxiong: class yingxiong(object):
def __init__(self,name): def __init__(self,name):
self.exp=1 self.exp=1
self.name=name self.name=name
self.hp=300 self.hp=300
self.kun=50 self.kun=50
self.hp_max=self.hp
def xue(self):
self.hp+self.hp+70
if self.hp>self.hp
def ji(self,fyb): def ji(self,fyb):
j=self.kun j=self.kun
fyb.hp=fyb.hp-j fyb.hp=fyb.hp-self.kun
if fyb.hp>0: if fyb.hp>0:
f=fyb.name+'扣'+str(j)+'血,剩'+str(fyb.hp)+'血' f=fyb.name+'扣'+str(j)+'血,剩'+str(fyb.hp)+'血'
else: else:
f=fyb.name+'嗝屁' f=fyb.name+'嗝屁'
print(f) print(f)
yase=yingxiong('亚瑟') exit()
fianyibo=yingxiong('范家鸡') class shishi(yingxiong):
yase.ji(fianyibo) def __init__(self,name,hero_su):
\ No newline at end of file super(shishi,self).__init__(name)
self.hp=200
self.kun=60
self.hero_su=hero_su
print('当前角色姓名、血量、等级、攻击力为',self.name,self.hp,self.exp,self.kun)
fianyibo=shishi('范家鸡','鸡')
yase=yingxiong('亚瑟')
\ 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