Commit 12b5b87a by BellCodeEditor

save project

parent 894fb6ab
Showing with 6 additions and 1 deletions
......@@ -6,7 +6,11 @@ class Hero: # 英雄类
self.attack = 40
self.max_hp = self.hp
def cure(self,name):
def cure(self):
self.hp+=60
if self.hp>self.max_hp:
self.hp=self.max_hp
print()
def combat(self, enemy): # 攻击功能
info1 = self.name+"对"+enemy.name+"发起进攻,"
......@@ -25,6 +29,7 @@ class Hero: # 英雄类
class Player(): # 玩家英雄
def __init__(self,name):
super
print("玩家"+player.name+"创建成功")
print("玩家"+player.name+"的攻击力,生命值为:",self.attack,self.hp)
......
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