Beispiel #1
0
 public override void StartDialog(Character character)
 {
     if (_dialog != null)
     {
         _dialog.UseDialogNode((PlayerCharacter)character, this);
         Console.ReadKey(false);
     }
     else
     {
         Console.WriteLine("This character cannot talk");
     }
 }
Beispiel #2
0
        private void InputAnswer(PlayerCharacter player, NPC talkPartner)
        {
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write("Type in a number for your answer: ");
            string input = Console.ReadLine();

            try
            {
                DialogNode nextDialog = _dialogChildren[Convert.ToInt32(input) - 1];
                nextDialog.UseDialogNode(player, talkPartner);
            }
            catch
            {
                Console.WriteLine("ERROR: Not a valid Answer - try again");
                UseDialogNode(player, talkPartner);
            }
        }