Commit 0197eade by BellCodeEditor

save project

parent fe2bd26c
Showing with 24 additions and 0 deletions
class Hero:
def __init__(self,n):
self.leve = 1
self.name = n
self.hp = 250
self.act = 40
def gongji(self,e):
e.hp -= self.act
info1 = self.name + "对" + e.name
info2 = "造成" + str(self.act) + "点伤害。"
info3 = e.name + "剩下" + str(e.hp) + "点HP"
info = info1 + info2 + info3
print(info)
class pleyer(Hero):
def __init__(self):
self.leve = 1
self.name = n
self.Hp = h
self.act = a
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