def legendary_status(ga): status_list = ga.check_legendary() vision_and_strength = "Vision Orb: %s Strength Orb: %s" % ( status_list[0], status_list[1]) vitality_and_magic = "Vitality Orb: %s Magic Sword: %s" % ( status_list[2], status_list[3]) main_menu.print_in_the_middle(main_menu.GAME_WIDTH, vision_and_strength) main_menu.print_in_the_middle(main_menu.GAME_WIDTH, vitality_and_magic)
def enter_lair_confirmation(self) -> int: msg1 = "Are you sure you want to continue into the Lair?" msg2 = "Once you've entered, there's no going back!" clear_screen() dotted_line(GAME_WIDTH) empty_line(1) print_in_the_middle(GAME_WIDTH, msg1) print_in_the_middle(GAME_WIDTH, msg2) empty_line(1) dotted_line(GAME_WIDTH) selection = yes_no_selection(input("Yes/No >>> ")) return selection
def save_game_confirmation(slot_num: int): game_version = "1.0" msg1 = "Are you sure you want to overwrite GAME SLOT " + str( slot_num) + "?" dotted_line_length = GAME_WIDTH dotted_line(dotted_line_length) empty_line(1) print_in_the_middle(dotted_line_length, msg1) empty_line(1) dotted_line(dotted_line_length) selection = yes_no_selection(input("Yes/No >>> ")) return selection
def general_info(ga, map_arr): main_menu.empty_line(2) main_menu.print_in_the_middle(main_menu.GAME_WIDTH, ("Remaining Turns: %s" % ga.turns_remaining)) main_menu.print_in_the_middle( main_menu.GAME_WIDTH, ("Current Location: %s" % ga.current_location)) main_menu.empty_line(2) (nswe_districts, district_exits, this_district) = gametext_output(ga, map_arr) main_menu.empty_line(2) legendary_status(ga) main_menu.empty_line(2) narration.help_menu() main_menu.empty_line(1) return (nswe_districts, district_exits, this_district)
def load_save_success_screen(choice: SaveLoad): clear_screen() msg1 = "Game SUCCESSFULLY " if choice == SaveLoad.SAVE: msg1 += "saved." elif choice == SaveLoad.LOAD: msg1 += "loaded." dotted_line_length = GAME_WIDTH dotted_line(dotted_line_length) empty_line(1) print_in_the_middle(dotted_line_length, msg1) empty_line(1) dotted_line(dotted_line_length) input("Press [Enter] to continue...")
def load_game_confirmation(slot_num: int): game_version = "1.0" msg1 = "Are you sure you want to load GAME SLOT " + str(slot_num) + "?" msg2 = "Any unsaved progress in current game will be loss." dotted_line_length = GAME_WIDTH dotted_line(dotted_line_length) empty_line(1) print_in_the_middle(dotted_line_length, msg1) print_in_the_middle(dotted_line_length, msg2) empty_line(1) dotted_line(dotted_line_length) selection = yes_no_selection(input("Yes/No >>> ")) return selection
def load_menu(): game_version = "1.0" title = "Load Game" # Load Menu Options menu_options = [ "1. Game Slot 1", "2. Game Slot 2", "3. Game Slot 3", "4. Go back" ] slot_tracker = [False, False, False] dirname = os.path.join(os.path.realpath('.'), "savedgames") for num in range(3): game_slot = num + 1 filename = "savedgame_" + str(game_slot) fullpath = os.path.join(dirname, filename) if os.path.exists(fullpath): menu_options[num] += " -- " + str( time.ctime(os.path.getmtime(fullpath))) slot_tracker[num] = True else: menu_options[num] += " -- no file" dotted_line_length = GAME_WIDTH dotted_line(dotted_line_length) empty_line(1) print_in_the_middle(dotted_line_length, title) empty_line(1) for x in menu_options: print_left_indented(int(dotted_line_length / 3.5), x) empty_line(1) print("Ver. " + game_version) dotted_line(dotted_line_length) selection = load_selection(input("Make your selection >>> "), slot_tracker) return selection
def help_menu(): main_menu.print_in_the_middle(main_menu.GAME_WIDTH, "Type \"Help\" for game commands")
def inventory_open(width): main_menu.print_in_the_middle(width, "1. Clues ") main_menu.print_in_the_middle(width, "2. Items ") main_menu.print_in_the_middle(width, "3. Resume Game ")
def command_help(width): main_menu.print_in_the_middle(width, ("** Commands are case insensitive! **")) main_menu.print_in_the_middle(width, ("Try with natural language!")) print() main_menu.print_in_the_middle(width, ( "1. Navigate by relative directions (up, down, left right), cardinal " )) main_menu.print_in_the_middle(width, ( " directions (north, south, west, east), district names, or street " )) main_menu.print_in_the_middle(width, ( " names. Ex: 'go north', 'walk left', 'travel on summer ln', " )) main_menu.print_in_the_middle(width, ( " 'go to hawkins', 'journey to greenland'. " )) main_menu.print_in_the_middle(width, ( "2. Interact with items and characters using keywords: " )) main_menu.print_in_the_middle(width, ( " 'look at', 'take', 'use', 'talk to', 'enter', 'eat', 'hit', 'climb'," )) main_menu.print_in_the_middle(width, ( " 'move', 'lift', 'feed', 'swim'. " )) main_menu.print_in_the_middle(width, ( " Ex: 'look at statue', 'talk to hobo', 'move chest'. " )) main_menu.print_in_the_middle(width, ( " -- Common aliases also work, both for items and actions! " )) main_menu.print_in_the_middle(width, ( " Ex: 'view' for 'look at', 'pick up' for 'take', 'rock' " )) main_menu.print_in_the_middle(width, ( " for 'stone', and many more! " )) main_menu.print_in_the_middle(width, ( " -- With 'use', you can interact items with other items, i.e. " )) main_menu.print_in_the_middle(width, ( " 'use ____ on ____'. Also works with various prepositions! " )) main_menu.print_in_the_middle(width, ( "3. Get the long description of a district with a simple command: 'look' " )) main_menu.print_in_the_middle(width, ( "4. Type 'savegame' or 'save' to save your current progress. " )) main_menu.print_in_the_middle(width, ( "5. Type 'loadgame' or 'load' to load a saved game. " )) main_menu.print_in_the_middle(width, ( "6. Type 'inventory' or 'bag' to look at your inventory. " )) main_menu.print_in_the_middle(width, ( " -- Check out your items and clues! " )) main_menu.print_in_the_middle(width, ( "7. Type 'quit' or 'exit' to go back to main menu . " )) main_menu.print_in_the_middle(width, ( "8. And as you've already figured out, type 'help' for help. " )) print() main_menu.print_in_the_middle(width, ("Have fun!"))
def standard_title_display(string): main_menu.dotted_line(main_menu.GAME_WIDTH) main_menu.empty_line(2) main_menu.print_in_the_middle(main_menu.GAME_WIDTH, (string)) main_menu.empty_line(2)
def help_menu_screen(): back_to_game = False while back_to_game == False: standard_title_display("Help") main_menu.print_in_the_middle(main_menu.GAME_WIDTH, ("1. Game Story ")) main_menu.print_in_the_middle(main_menu.GAME_WIDTH, ("2. Characters ")) main_menu.print_in_the_middle(main_menu.GAME_WIDTH, ("3. Game Commands")) main_menu.print_in_the_middle(main_menu.GAME_WIDTH, ("4. Items ")) main_menu.print_in_the_middle(main_menu.GAME_WIDTH, ("5. Resume Game ")) main_menu.empty_line(3) main_menu.dotted_line(main_menu.GAME_WIDTH) list_game_story = [ "1", "game story", "story", "about game", "1. game story" ] list_characters = [ "2", "character", "characters", "char", "chars", "game characters", "2. characters" ] list_game_commands = [ "3", "game commands", "game command", "commands", "command", "3. game commands" ] list_items = ["4", "item", "items", "about items", "4. items"] list_back = [ "5", "exit", "return", "back", "resume", "resume game", "5. resume game" ] selection = input(">>> ") while True: if command_parsing(selection, list_game_story) == 1: #Help for game story gameNarrationHelp(start_narration1(), start_narration2()) break if command_parsing( selection, list_characters) == 1: #Help for game characters mainCharNarration(long_for_agt_dope(), long_for_dr_crime()) break if command_parsing( selection, list_game_commands) == 1: #Help for game commands clear_screen() main_menu.dotted_line(main_menu.GAME_WIDTH) main_menu.empty_line(2) command_help(main_menu.GAME_WIDTH) main_menu.empty_line(2) main_menu.dotted_line(main_menu.GAME_WIDTH) input("Press [Enter] to continue...") clear_screen() break if command_parsing(selection, list_items) == 1: #Help for game items itemHelp() break if command_parsing(selection, list_back) == 1: #Back to the game clear_screen() back_to_game = True break main_menu.write_over("Invalid Input. Try again.") sys.stdout.write("\033[F") # go up one line sys.stdout.write("\033[K") # clear line selection = str(input(">>> ")).lower()