Commit e25f0fd4 by BellCodeEditor

auto save

parent ab87b09c
Showing with 23 additions and 3 deletions
a = 1
b = 1
for i in range(81):
x = a*b
print(x)
a += 1
if a == 9:
b += 1
a = 1
...@@ -8,10 +8,10 @@ class Hero(object): ...@@ -8,10 +8,10 @@ class Hero(object):
self.max_hp = self.hp self.max_hp = self.hp
def cure(self): # 治疗 def cure(self): # 治疗
self.hp += 60 blood = random.randint(30,50)
self.hp += blood
if self.hp > self.max_hp: if self.hp > self.max_hp:
self.hp = self.max_hp self.hp = self.max_hp
print(self.name+"使用了治疗,血量增加:", 60,",目前的血量为:",self.hp) print(self.name+"使用了治疗,血量增加:", 60,",目前的血量为:",self.hp)
def combat(self, enemy): # 普通攻击 def combat(self, enemy): # 普通攻击
...@@ -50,8 +50,9 @@ while True: ...@@ -50,8 +50,9 @@ while True:
break break
elif choice == '1': elif choice == '1':
houyi.combat(yase) houyi.combat(yase)
elif choice == '2' : elif choice == '2' :
houyi.cure() houyi.cure()
else: else:
print('SB') print('SB')
continue continue
......
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