Commit f51c3bc0 by BellCodeEditor

save project

parent efbc4846
Showing with 13 additions and 18 deletions
...@@ -5,25 +5,21 @@ class Hero: ...@@ -5,25 +5,21 @@ class Hero:
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
def shengji(): def shengji(self):
Yao.level = Yao.level+1 self.level = self.level+1
Yao.hp = Yao.hp+700 self.hp = self.hp+700
Yao.attack = Yao.attack+1 self.attack = self.attack+150
def shengji1():
Lan.level = Lan.level+1
Lan.hp = Lan.hp+700
Lan.attack = Lan.attack+1
def shengji2():
LiBai.level = LiBai.level+1
LiBai.hp = LiBai.hp+700
LiBai.attack = LiBai.attack+1
Yao = Hero("耀",2700,200) Yao = Hero("耀",2700,200)
Lan = Hero("澜",2800,200) Lan = Hero("澜",2800,200)
LiBai = Hero("李白",3000,270) LiBai = Hero("李白",3000,270)
shengji()
print('耀的血量是',Yao.hp) print('耀的攻击是',Yao.attack)
\ No newline at end of file Yao.shengji()
print('耀的攻击是',Yao.attack)
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