Commit 5cb5a9c2 by BellCodeEditor

save project

parent 7ec0ca3d
Showing with 4 additions and 25 deletions
class ms: b=['袁术','夏侯惇','曹操','关羽']
def _init_(self,name): b.remove('关羽')
self.level = 1 print(b)
self.hp = 250 \ No newline at end of file
self.attack = 40
self.name = name
def combat(self, enemy):
info1 = self.name+"对"+enemy.name+"攻,"
info2 = "造成"+str(self,attack)+"伤"
enemy.hp -= self.attack
if enemy.hp > 0:
info3 = enemy.name+"剩"+str(enemy.hp)+"血"
info = info1+info2+info3
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