# 主代码 shuoming() time.sleep(1) print("野生的喷火龙出现了!") time.sleep(1) print("去吧,耿鬼!!!") hp = 300 # 己方hp hpe = 300 # 对方hp med1 = 3 # 第一种药的数量 med2 = 3 # 第二种药的数量 try: while hpe > 0 and hp > 0: time.sleep(1) sy() x = input("准备做什么:\r\n战斗请输入1\r\n使用药物请输入2\r\n使用大师球请输入3\r\n逃跑请输入4\r\n") x = eval(x) if x == 1: jineng = input("请输入编号使用技能:\r\n1.无影拳(必中,70伤害)\r\n2.暗影冲击(90%命中率,100伤害)\r\n3.超级新星(70%命中率,130伤害)\r\n4.返回上一级\r\n") jineng = int(jineng) if jineng == 1: time.sleep(1) print("耿鬼使用了无影拳!") time.sleep(2) print("对喷火龙造成了70点伤害!\r\n") hpe -= 70 if hpe > 0: hp = ea(hp) continue if jineng == 2: if random.uniform(0, 1) >= 0.1: time.sleep(1) print("耿鬼使用了暗影冲击!") time.sleep(2) print("对喷火龙造成了100点伤害!\r\n") hpe -= 100 else: time.sleep(1) print("耿鬼是用了暗影冲击!") time.sleep(2) print("但是没有命中......\r\n") if hpe > 0: hp = ea(hp) continue if jineng == 3: if random.uniform(0, 1) <= 0.3: time.sleep(1) print("耿鬼使用了超级新星!") time.sleep(2) print("但是没有命中.....\r\n") else: time.sleep(1) print("耿鬼使用了超级新星!") time.sleep(2) print("造成了130点伤害!\r\n") hpe -= 130 if hpe > 0: time.sleep(1) hp = ea(hp) continue if jineng == 4: continue else: mess() continue if x == 2: y = input("请选择使用什么物品\r\n1.回复药膏(回复50点hp)(剩余{0})\r\n2.大回复药(回复100点hp)(剩余{1})\r\n3.返回上一级\r\n".format(med1, med2)) y = int(y) if y == 1: if med1 > 0: hp += 50 if hp > 300: hp = 300 med1 -= 1 print("你使用了回复药膏!") time.sleep(1) print("耿鬼的生命恢复了!\r\n") hp = ea(hp) continue else: time.sleep(1) print("你没有这个药了!\r\n") time.sleep(1) continue if y == 2: if med2 > 0: hp += 100 if hp > 300: hp = 300 med2 -= 1 print("你使用了大回复药膏!") time.sleep(1) print("耿鬼的生命恢复了!\r\n") hp = ea(hp) continue else: time.sleep(1) print("你没有这个药了!\r\n") time.sleep(1) continue if y == 3: continue else: mess() continue if x == 3: time.sleep(1) print("dbq你没有大师球hhhh\r\n") time.sleep(1) hp = ea(hp) continue if x == 4: time.sleep(1) print("别逃跑了,就这一个敌人,打完了我还要结束程序呢,弟弟\r\n") time.sleep(1) hp = ea(hp) continue else: mess() continue except: mess() print("让你别输入英文嘛,非不听") time.sleep(2) print("这下好了,重新开始吧")
if hp <= 0 and hpe <= 0: time.sleep(1) print("dbq,平局算你输哦") time.sleep(1) else: if hpe <= 0: time.sleep(1) print("野生的喷火龙不行了!!") time.sleep(1) print("你获得了胜利!!!") time.sleep(1) if hp <= 0: time.sleep(1) print("彩笔,这都打不赢吗???") time.sleep(1)