Commit 7ec0ca3d by BellCodeEditor

save project

parent abaf83ee
Showing with 25 additions and 14 deletions
b=['袁术','夏侯惇','曹操','关羽'] class ms:
b.pop(3) def _init_(self,name):
b.pop(-1) self.level = 1
b.remove('关羽') self.hp = 250
print(b) self.attack = 40
a=['华雄'] self.name = name
a.insert(1,'关羽') def combat(self, enemy):
a.append('关羽') info1 = self.name+"对"+enemy.name+"攻,"
print(a) info2 = "造成"+str(self,attack)+"伤"
a=['华雄'] enemy.hp -= self.attack
c=['颜良','文丑'] if enemy.hp > 0:
a.extend(c) info3 = enemy.name+"剩"+str(enemy.hp)+"血"
print(a) info = info1+info2+info3
\ No newline at end of file print(info)
else:
info3 = enemy.name+"死"
info = info1+info2+info3
print
exit()
class playre:
def _init_(self,name):
super()._init_(neme)
self.hp = 200
self.attact = 50
\ 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