Commit 447bd0ef by BellCodeEditor

save project

parent d6c81a0f
Showing with 32 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
罗尔夫=Hero('罗尔夫',1500,600)
伯纳德=Hero('伯纳德',650,1400)
科特=Hero('科特',3600,450)
特遣=Hero('特遣',1000,125)
print("罗尔夫的攻击为:",罗尔夫.attack)
print("罗尔夫的生命为:",罗尔夫.hp)
print("伯纳德的攻击为:",伯纳德.attack)
print("科特的攻击为:",科特.attack)
print("特遣的攻击为:",特遣.attack)
for i in range:
罗尔夫.level=level+1
罗尔夫.hp=hp+400
罗尔夫.attack=attack+125
for i in range:
伯纳德.level=level+1
伯纳德.hp=hp+100
伯纳德.attack=attack+200
for i in range:
科特.level=level+1
科特.hp=hp+400
科特.attack=attack+100
for i in range:
特遣.level=level+1
特遣.hp=hp+500
特遣.attack=attack+175
\ 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