Commit 184a1ba5 by BellCodeEditor

save project

parent 5a82f3bf
Showing with 6 additions and 1 deletions
...@@ -7,9 +7,14 @@ class Hero(object): ...@@ -7,9 +7,14 @@ class Hero(object):
self.hp = 250 self.hp = 250
self.attack = 40 self.attack = 40
self.max_hp = self.hp self.max_hp = self.hp
self.critical_hit = 20
#self.cure = 35
def cure(self): # 治疗 def cure(self): # 治疗
cure = random.randint(30,50) if random.randint(1,100/self.critical_hit) == 1:
cure = 70 #self.cure*2
else:
cure = 35 #self.cure
if self.hp + cure > self.max_hp: if self.hp + cure > self.max_hp:
self.hp = self.max_hp self.hp = self.max_hp
else: else:
......
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