Commit 71261e45 by BellCodeEditor

save project

parent 0fb50f79
Showing with 8 additions and 3 deletions
......@@ -7,7 +7,10 @@ class Hero(object):
self.max_hp = self.hp
def cure(self):
c=randm
self.hp=self.hp+60
if self.hp>self.max_hp:
self.hp==self.max_hp
print(self.name+'使用了治疗术,血量增加',)
def combat(self,a): # 攻击
a.hp=a.hp-self.attack
......@@ -27,4 +30,7 @@ class Player(Hero):
super().__init__(name)
self.hp = 200
self.attack = 50
self.max_hp = self.hp
\ No newline at end of file
self.max_hp = self.hp
self.type = type
print('角色'+self.name+'创建成功,英雄类型为:'+self.type)
print('角色属性是:'+self.attack+','self.type)
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