Advertisement
Guest User

Untitled

a guest
May 26th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.60 KB | None | 0 0
  1. import math, random, sys
  2. # this should be the only thing I need to call
  3. def intro():
  4.     print('This will be a dungeon style game where you fight bosses. Only the lucky survive.')
  5.     print('Do you wish to continue? y/n')
  6.     answer1 = input()
  7.     if (answer == 'y'):
  8.         print('Very well. Enter at your own risk...')
  9.         print('On to the first dungeon!')
  10.         dungeon1() # calls the next function
  11.     else:
  12.         print('*You walk away, confused as to what just happened...*')
  13.         sys.exit() # ends the game as they do not want to play
  14. # for the first boss (number guessing game)
  15. def dungeon1():
  16.     print('*A booming voice calls to you* "What are you doing in here?!"')
  17.     print('"Down here, you win by the numbers. If you can guess my number, I will let you live..."')
  18.     print('Guess between 1 and 5.')
  19.     boss = random.randint(1, 6) # what the boss guesses
  20.     guess = int(input()) # what the user guesses
  21.     if (guess == boss):
  22.         print('Lady Luck seems to be on your side today. Count your blessings, traveler.')
  23.         dungeon2() # calls the next function
  24.     else:
  25.         print('You lose, kiddo. My number was ' + str(boss1) + '.')
  26.         intro() # restarts the game
  27. # for the second boss
  28. def dungeon2():
  29.     print('A sign appears in front of you... it reads, "Those who know, are ones who fail."')
  30.     print('Say either 1, 2, or 3.')
  31.     boss = random.randint(1,4) # numbers between 1 and 3
  32.     guess = int(input()) # what the user guesses
  33.     if (guess != boss):
  34.         print('You were wrong... So you were right! On to the next challenge.')
  35.         dungeon3() # calls the final dungeon
  36.     else:
  37.         print('You were correct!... which is technically incorrect.')
  38.         intro() # restarts the game
  39. def dungeon3pt1():
  40.     print('You\'ve reached the end! You just have to finish off the last puzzle to exit the perilous cave.')
  41.     print('You need to find BOTH pieces of the key to the exit.')
  42.     key1 = random.randint(2, 9, 2)
  43.     print('Hint: The first group is between 2-8 with even numbers, and the second is 11-19, odds only... good luck.')
  44.     guess1 = int(input())
  45.     if (guess1 == key1):
  46.         print('You have the first part down. Let\'s see if you have the second part correct.')
  47.     else:
  48.         print('You lose.')
  49.         intro()
  50. def dungeon3pt2():
  51.     print('Now, let\'s see if you have completed the second part correctly.')
  52.     key2 = random.randint(11, 20, 2)
  53.     guess2 = int(input())
  54.     if (guess2 == key2):
  55.         print('You have traveled through all of the dungeon! Take this ring as a reward!')
  56.         print('*You have been given a ring made of Tellurium, an extremely rare metal.*')
  57.     else:
  58.         print('You have come this far, only to lose like the rest.')
  59.         intro()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement