diff --git a/diy1.py b/diy1.py index 877f3a4..f3a15a3 100644 --- a/diy1.py +++ b/diy1.py @@ -2,12 +2,14 @@ class Hero(object): def __init__(self, name): self.name = name self.level = 1 - self.hp = 250 + self.hp = 300 self.attack = 40 self.max_hp = self.hp def cure(self): # 治疗 - ??? + self.hp += 60 + if self.hp > self.max_hp: + self.hp = self.max_hp print(self.name+"使用了治疗,血量增加:", 60,",目前的血量为:",self.hp) def combat(self, enemy): # 普通攻击