Commit b3fab5f4 by BellCodeEditor

save project

parent aa89a72e
Showing with 15 additions and 15 deletions
class yingxiong: class yingxiong:
def __init__(self,name,exp,hp,kun): def __init__(self,name):
self.exp=1 self.exp=1
self.name=name self.name=name
self.hp=hp self.hp=300
self.kun=kun self.kun=50
def s1(self): def ji(self,fyb):
self.exp=self.exp+1 j=self.kun
self.hp=self.hp+30 fyb.hp=fyb.hp-j
self.kun=self.kun+5 if fyb.hp>0:
yase=yingxiong('亚瑟',1,200,30 ) f=fyb.name+'扣'+str(j)+'血,剩'+str(fyb.hp)+'血'
houyi=yingxiong('后羿',1,160,35) else:
yase.s1() f=fyb.name+'嗝屁'
houyi.s1() print(f)
print('亚瑟血量=',yase.hp) yase=yingxiong('亚瑟')
print('后羿血量=',houyi.hp) fianyibo=yingxiong('范家鸡')
print('亚瑟攻击=',yase.kun) yase.ji(fianyibo)
print('后羿攻击=',houyi.kun) \ 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