Commit 693f5d17 by BellCodeEditor

save project

parent 5d7891c5
Showing with 118 additions and 44 deletions
#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)class hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
def jjjb(self):
self.level= self.level+1
self.hp= self.hp+40
self.attack= self.attack+15
yase=hero("yase",1800,200)
yase.jjjb()
print("等级为:",yase.level)
print("血量为:",yase.hp)
print("攻击力为:",yase.attack)
ab=hero("ab",1400,288)
ab.jjjb()
print("等级为:",ab.level)
print("血量为:",ab.hp)
print("攻击力为:",ab.attack)
#print(yase.hp)
#xtl=hero("xtl",2000,170)
#laoba=hero("laoba",1200,280)
#erbi=hero("erbi",1200,280)
class hero:
def __init__(self):
def __init__(self,name,hp,attack):
self.level=1
self.hp=300
self.attack=2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
laoden=hero
print(laoden)
\ No newline at end of file
self.name=name
self.hp=hp
self.attack=attack
def jjjb(self):
self.level= self.level+1
self.hp= self.hp+40
self.attack= self.attack+15
yase=hero("yase",1800,200)
yase.jjjb()
print("-------------------------")
print("yase等级为:",yase.level)
print("yase血量为:",yase.hp)
print("yase攻击力为:",yase.attack)
ab=hero("ab",1400,288)
ab.jjjb()
print("-------------------------")
print("ab等级为:",ab.level)
print("ab血量为:",ab.hp)
print("ab攻击力为:",ab.attack)
a=hero("a",1600,228)
a.jjjb()
print("-------------------------")
print("a等级为:",a.level)
print("a血量为:",a.hp)
print("a攻击力为:",a.attack)
......@@ -10,21 +10,8 @@ class hero:
#print(chenlong.hp)
yase=hero("亚瑟",1800,200)
xitele=hero("xitele",1000,290)
geerdan=hero("geerdan",1600,199)
geerdan=hero("geerdan",1500,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
......@@ -5,26 +5,45 @@ class hero:
self.hp=hp
self.attack=attack
def jjjb(self):
self.level= self.level+1
self.hp= self.hp+40
self.attack= self.attack+15
yase=hero("yase",1800,200)
yase.jjjb()
print("-------------------------")
print("yase等级为:",yase.level)
print("yase血量为:",yase.hp)
print("yase攻击力为:",yase.attack)
ab=hero("ab",1400,288)
ab.jjjb()
print("-------------------------")
print("ab等级为:",ab.level)
print("ab血量为:",ab.hp)
print("ab攻击力为:",ab.attack)
a=hero("a",1600,228)
a.jjjb()
print("-------------------------")
print("a等级为:",a.level)
print("a血量为:",a.hp)
print("a攻击力为:",a.attack)
#print(yase.hp)
#xtl=hero("xtl",2000,170)
#laoba=hero("laoba",1200,280)
#erbi=hero("erbi",1200,280)
#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
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