Commit 06a3ad68 by BellCodeEditor

save project

parent 8533eee3
Showing with 11 additions and 10 deletions
...@@ -5,14 +5,15 @@ class hero: ...@@ -5,14 +5,15 @@ class hero:
self.name=name self.name=name
self.HP=HP self.HP=HP
self.ADC=ADC self.ADC=ADC
def Upgrade(self):
self.LV=self.LV+1
self.HP=self.HP+150
self.ADC=self.ADC+5
yase=hero("亚瑟",300,20,1) yase=hero("亚瑟",300,20,1)
houyi=hero("后羿",250,23,1) houyi=hero("后羿",250,23,1)
print("亚瑟的等级为"+str(yase.LV)+"级"+"\n"+"亚瑟的攻击力为"+str(yase.ADC)+"点"+"\n"+"亚瑟的血量为"+str(yase.HP)+"点"+"\n")
def YaseUpgrade(): print("后羿的等级为"+str(houyi.LV)+"级"+"\n"+"后羿的攻击力为"+str(houyi.ADC)+"点"+"\n"+"后羿的血量为"+str(houyi.HP)+"点"+"\n")
yase.LV=yase.LV+1 yase.Upgrade()
yase.HP=yase.HP+150 houyi.Upgrade()
yase.ADC=yase.ADC+5 print("亚瑟的等级为"+str(yase.LV)+"级"+"\n"+"亚瑟的攻击力为"+str(yase.ADC)+"点"+"\n"+"亚瑟的血量为"+str(yase.HP)+"点"+"\n")
YaseUpgrade() print("后羿的等级为"+str(houyi.LV)+"级"+"\n"+"后羿的攻击力为"+str(houyi.ADC)+"点"+"\n"+"后羿的血量为"+str(houyi.HP)+"点"+"\n")
YaseUpgrade() \ No newline at end of file
print("亚瑟的等级为"+str(yase.LV)+"级")
\ 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