Commit 5d7891c5 by BellCodeEditor

save project

parent 3f62b6ea
Showing with 51 additions and 8 deletions
class hero:
def
\ No newline at end of file
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
#chenlong=hero("chenlong",999,99)
#print(chenlong.hp)
yase=hero("亚瑟",1800,200)
xitele=hero("xitele",1000,290)
geerdan=hero("geerdan",1600,199)
print(yase.hp)
def yase():
yase.level= yase.level+1
yase.hp= yase.hp+40
yase.attack= yase.attack+15
def xitele():
xitele.level= xitele.level+1
xitele.hp= xitele.hp+60
xitele.attack= xitele.attack+29
def geerdan():
geerdan.level= geerdan.level+1
geerdan.hp= geerdan.hp+51
geerdan.attack= geerdan.attack+20
\ No newline at end of file
......@@ -6,10 +6,25 @@ class hero:
self.attack=attack
chenlong=hero("chenlong",999,99)
#chenlong=hero("chenlong",999,99)
#print(chenlong.hp)
laoba=hero("laoba",500,130)
xitele=hero("xitele",300,70)
geerdan=hero("geerdan",300,70)
yase=hero("亚瑟",1800,200)
xitele=hero("xitele",1000,290)
geerdan=hero("geerdan",1600,199)
print(chenlong.hp)
\ No newline at end of file
print(yase.hp)
def yase():
yase.level= yase.level+1
yase.hp= yase.hp+40
yase.attack= yase.attack+15
def xitele():
xitele.level= xitele.level+1
xitele.hp= xitele.hp+60
xitele.attack= xitele.attack+29
def geerdan():
geerdan.level= geerdan.level+1
geerdan.hp= geerdan.hp+51
geerdan.attack= geerdan.attack+20
\ 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