Commit 9d6b619a by BellCodeEditor

save project

parent c6cd058b
Showing with 7 additions and 0 deletions
...@@ -6,6 +6,13 @@ class Hero(object): ...@@ -6,6 +6,13 @@ class Hero(object):
self.attack = 40 self.attack = 40
self.max_hp = self.hp self.max_hp = self.hp
def cure(self):
self.hp=self.hp=60
if self.hp > self.max_hp:
self.hp = self.max_hp
print(self.name+"加血",60,"現血"+self.hp)
def combat(self,enemy): # 攻击 def combat(self,enemy): # 攻击
enemy.hp -= self.attack enemy.hp -= self.attack
info1=self.name+"對"+enemy.name info1=self.name+"對"+enemy.name
......
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