def main(): os.system('cls') screen.set_title("ELEVEN") pygame.mixer.init() sound = pygame.mixer.Sound("Sounds/Lava_Dome_8bit.wav") sound.set_volume(.10) sound.play(loops=100) #pygame.mixer.fadeout(100000) if os.listdir("Saved_Files"): file_name = prompt_save() game = Game(file_name, sound) else: game = Game("Q2API_XML/creepy.xml", sound) screen.clear() # Slow text via sleep for intro #for line in game.intro.split(" "): # sys.stdout.write(line), # sleep(1.0) # # sys.stdout.write(game.intro) # sleep(3) screen.cprint(3, 0, " "*55 + game.state.title[0].value) print("\n") ascii_img = ascii_art.get_ascii_image() screen.cprint(15, 0, " ") ascii_img.get_image("eleven.png") print("\n") for lines in game.state.intro[0].value.split("\n"): screen.cprint(15, 0, lines+"\n") sleep(1) print("\n") #print game.state.intro[0].value sleep(0.8) screen.cprint(15, 0, " ") print "\n" + game.state.tip[0].value screen.cprint(3, 0, "") print " " * 50 + game.room.attrs["name"].upper() + "\n" screen.cprint(15, 0, "") print game.room.desc[0].value while 1: run_command(game)
def computer(self, player_inv): keyword = "salt" password = "******" self.screen.clear() # self.sound.fadeout(500) # sleep(.5) pygame.mixer.init() sound = pygame.mixer.Sound("Sounds/iMac_Startup.wav") sound.set_volume(0.10) sound.play() ascii_img = ascii_art.get_ascii_image() ascii_img.get_image("computer.png") print "You can type quit, leave, or stop to stop trying the password.\nThe only thing you can access while" " using the computer is your memories.\n" while 1: enter_pass = raw_input("Enter password: "******"quit" or enter_pass == "leave" or enter_pass == "stop": # print "Shutting down computer." break elif enter_pass == "memories": self.display_memories() elif enter_pass != password: print "Password incorrect.\n" "[Hint: Irrational Date (mmddyy) + Favorite Color. No spaces or capitals.]\n " elif enter_pass == password: # self.machine_used = True enter_keyword = raw_input("Enter the keyword: ") if enter_keyword.lower() != keyword: print "Sorry, keyword incorrect. Cannot decrypt message. Shutting down for security " "measures. Try again later when you know the correct keyword.\n" # break else: if "journal" not in player_inv: print "The encryption is not detected in your inventory." "\nTry again later when you have the encryption.\n" # break elif "journal" in player_inv: print "Detected encryption..." sleep(1) # Case 1 = Both False (0, 0) -> Fail if "decryption table" not in player_inv and "recipe" not in player_inv: print "Sorry, you do not have the decryption table or recipe needed to translate " "message. Try again later when you have the decryption table and recipe.\n" # break # Case 2 = One False, One True (0, 1) -> Fail elif "decryption table" not in player_inv and "recipe" in player_inv: print "Sorry, you do not have the decryption table needed to translate message. " "Try again later when you have the decryption table.\n" # break # Case 3 = One False, One True (1, 0) -> Fail elif "decryption table" in player_inv and "recipe" not in player_inv: print "Sorry, you do not have the recipe needed to translate message. Try again " "later when you have the recipe.\n" # break # Case 4 = Both True (1, 1) -> Win elif "decryption table" in player_inv and "recipe" in player_inv: self.computer_used = "True" self.state.player[0].computer[0].attrs["used"] = "True" print "Detected decryption table..." sleep(1) print "Detected recipe..." sleep(1) print "Decrypting message..." sleep(1) print "Decryption successful.\nLatch no. 1 has been released.\nYou hear a loud noise " "coming from the other room.\n\nTHE MACHINE UNLOCKED A LATCH ON THE METAL DOOR.\n"