def check_hit_wall(self): if self.__chosen_room is None: printer.g_print(messages.wall_msg) self.__is_same_room = True else: self.__current_room = self.__chosen_room printer.print_room(self.__current_room, self.__line_wait) self.__is_same_room = False
def quit(self): printer.g_print(messages.quit_msg) sys.exit()
def help(self): printer.g_print(messages.help_tips_msg)
def examine_here(self): printer.g_print(self.__current_room.description)
def examine(self): printer.g_print(self.__current_room.description, self.__line_wait)
def use(self): printer.g_print(messages.nothing_use_msg, self.__line_wait)
def talk(self): printer.g_print(messages.none_talk_msg, self.__line_wait)
def check_needs_help(self): if self.__wrong_count >= 3: self.__wrong_count = 0 # reset the counter and print the HELP hint printer.g_print(messages.help_hint_msg)
def new_turn(self): self.check_needs_help() if not self.__is_same_room: printer.g_print(messages.new_turn_msg, self.__line_wait)
def confused(self): printer.g_print(messages.wrong_msg, 0) self.__wrong_count += 1
def __init__(self, music_on=True, line_wait=0.05): self.__music_player = music.Music(music_on) self.__line_wait = line_wait printer.g_print(messages.intro_msg, self.__line_wait)