Commit a2179eac by BellCodeEditor

auto save

parent 22354288
Showing with 37 additions and 0 deletions
class HO:
class HO:
def __init__(self,bodys,LV,ATT,HP):
self.LV=LV
self.ATT=ATT
self.HP=HP
def upgrade(self,LVup,ATTup,HPup):
self.LV=self.LV+LVup
self.ATT=self.ATT+ATTup
self.HP=self.HP+HPup
def printIT(bodyaa,hmm):
print("hmm-LV:"+str(bodyaa.LV)+"\nhmm-ATT:"+str(bodyaa.ATT)+"\nhmm-HP:"+str(bodyaa.HP)+"\n"*2)
a=HO('a',233,114,3)
B=HO('B',1919,810,22)
a.upgrade(2,90,180)
#print("a-LV:"+str(a.LV)+"\na-ATT:"+str(a.ATT)+"\na-HP:"+str(a.HP)+"\n"*2)
#print("B-LV:"+str(B.LV)+"\nB-ATT:"+str(B.ATT)+"\nB-HP:"+str(B.HP)+"\n"*2)
printIT(a,'a')
printIT(B,'B')
\ No newline at end of file
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
yase=Hero('yase',300,20)
hy=Hero('hy',250,23)
k=Hero('K',5600,199)
print(yase.attack)
print(hy.attack)
print(k.attack)
\ 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