Commit 191fd46e by BellCodeEditor

save project

parent 5caacba3
Showing with 17 additions and 8 deletions
class cat:
def __init__(self):
self.footnum=4
self.eyenum=2
self.head=1
self.earsnum=2
self.skin="black"
def run(self)
print()
def
\ No newline at end of file
...@@ -7,17 +7,15 @@ class Hero(object): ...@@ -7,17 +7,15 @@ class Hero(object):
self.name = name self.name = name
def combat(self,enemy): # 攻击 def combat(self,enemy): # 攻击
info1 = self.name+"对"+enemy.name+"进行铁山靠" info1 = f"self.name对enemy.name进行铁山靠"
info2 = "造成"+str(self.attack)+"kun点伤害" info2 = f"造成{str(self.attack)}"kun点伤"
enemy.hp -= self.attack enemy.hp -= self.attack
if enemy.hp>0: if enemy.hp>0:
info3 = enemy.name+"还能活"+str(enemy.hp)+"坤年" info3 = f"{enemy.name}还能活{str(enemy.hp)}坤年"
info = info1+info2+info3 print(f"{info1}{info}{info3}")
print(info)
else: else:
info3 = enemy.name+"j了,小黑子没树枝了" info3 = f"(enemy.name)j了,小黑子没树枝了"
info = info1+info2+info3 print(f"{info1}{info}{info3}")
print(info)
exit() exit()
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi= Hero("后羿") houyi= Hero("后羿")
......
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