Commit 0b0cd8f9 by BellCodeEditor

save project

parent 31ce6733
Showing with 10 additions and 9 deletions
......@@ -4,12 +4,13 @@ class hero:
self.hp = hp
self.level = 1
self.attack = attack
def yase_upgrage():
yase.level = yase.level + 1
yase.hp = yase.hp + 500
yase.attack = yase.attack + 60
print('亚瑟的血量为:',yase.hp)
print('亚瑟的等级为:',yase.level)
print('亚瑟的攻击力为:',yase.attack)
def upgrage(self):
self.level = self.level + 1
self.hp = self.hp + 500
self.attack = self.attack + 60
print('亚瑟的血量为:',self.hp)
print('亚瑟的等级为:',self.level)
print('亚瑟的攻击力为:',self.attack)
yase = hero('亚瑟',3000,200)
yase_upgrage()
\ No newline at end of file
yase.upgrage()
yase.upgrage()
\ 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