Пример #1
0
 def get_speaker_name(self, Player, Key, Scene, Scene_num): #self, Class, "Key", Class, [Scene_num0, Scene_num1, Scene_num2]
     self.screen = Scene.screen
     self.Scene = Scene
     loop = True
     repeat1 = False
     while loop == True:
         Scene.clear_screen()
         if repeat1 == True:
             self.screen.addstr(Scene.line, 1, Scene.make_line(Scene_num[2], "Story", {})) #Sorry, I don't understand...
             Scene.line += 1
         X = Scene.find_keyword("name", Scene.make_line(Scene_num[0], "Story", {}))
         self.screen.addstr(Scene.line, 1, Scene.print_message(Scene_num[0], False, "Story", {})) #What was their name?
         Scene.pin_line(Scene.line, X, "name", "Cyan")
         Scene.line += 1
         response = self.get_response(Player, False, Scene)
         response = response.title()
         loop2 = True
         repeat2 = False
         while loop2 == True:
             if len(response) > 0:
                 Scene.clear_screen()
                 Scene.help_text(103, {})
                 if repeat2 == True:
                     self.screen.addstr(Scene.line, 1, Scene.make_line(Scene_num[2], "Story", {})) #Sorry, I don't understand...
                     Scene.line += 1
                 self.screen.addstr(Scene.line, 1, Scene.make_line(Scene_num[1], "Story", {"{Name}": response})) #"{Name}". Did I hear that correctly?
                 self.screen.refresh()
                 Scene.line += 1
                 confirmation = self.get_response(Player, False, Scene)
                 confirmation = confirmation.title()
                 if confirmation in self.yes:
                     loop = False
                     loop2 = False
                     if Key != "Player":
                         Player.Speakers[Key] = response
                     else:
                         Player.Name["Value"] = response
                 elif confirmation in self.no:
                     loop2 = False
                 else:
                     repeat2 = True
             else:
                 repeat1 = True
                 loop2 = False