Commit fc72bde8 by BellCodeEditor

save project

parent f2b8c4bd
Showing with 15 additions and 14 deletions
class a: class hero:
def __init__(delf,name,hp,attack): def __init__(self,name):
delf.level=1 self.name=name
delf.name=name self.level=1
delf.hp=hp self.hp=300
delf.attack=attack self.ak=40
def up(delf): def pk(self,b):
delf.level=delf.level+1 b.hp=b.hp-self.ak
delf.hp=delf.hp+50 ee1=self.name+'对'+b.name+'点伤害'
delf.attack=delf.attack+4 ee2='造成'+b.name+'的'+str(self.ak)+'点伤害'
q=a("jj",30,20) ee3=b.name+'剩余'+str(b.hp)+'血量'
q.up() print(ee1+ee2+ee3)
print("jrjk",q.level) yase=hero('亚瑟')
\ No newline at end of file houyi=hero('后裔')
yase.pk(houyi)
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