Nemo048

Untitled

Jun 23rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.32 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _2412
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             bool youLikesMe = true;
  14.  
  15.             DialogBranch[] dialog = new DialogBranch[3]
  16.             {
  17.                 new DialogBranch("Кто вы?", new string[] { "Человек", "Брандлмуха", "Кхаджит" }),
  18.                 new DialogBranch("Что вы хотите?", new string[] { "Победить Аразота", "Стать богатым", "Найти боевых товарищей" }),
  19.                 new DialogBranch("Чем вы можете помочь ордену?", new string[] { "Я отличный воин", "Я добротный маг", "Я могу работать в кузнице" })
  20.             };
  21.  
  22.  
  23.             Console.WriteLine("Совершенно очевидно, что мы не берём в наш орден кого попало. По этому заполни вот эту анкету, " +
  24.                               "и мы примем решение, брать тебя или нет");
  25.  
  26.             foreach (DialogBranch dialogBranch in dialog)
  27.             {
  28.                 Console.WriteLine(dialogBranch.Question);
  29.                 for (int i = 0; i < dialogBranch.Answers.Length; i++)
  30.                 {
  31.                     Console.WriteLine("[{0}]>{1}", i, dialogBranch.Answers[i]);
  32.                 }
  33.  
  34.                 int playerAnswer = int.Parse(Console.ReadLine());
  35.                 if (    dialogBranch.Answers[playerAnswer] == "Человек" ||
  36.                         dialogBranch.Answers[playerAnswer] == "Найти боевых товарищей" ||
  37.                         dialogBranch.Answers[playerAnswer] == "Я отличный воин")
  38.                 {
  39.                     dialogBranch.IsDoorOpen = true;
  40.                 }
  41.             }
  42.  
  43.             foreach(DialogBranch dialogBranch in dialog)
  44.             {
  45.                 if(dialogBranch.IsDoorOpen == false)
  46.                 {
  47.                     break;
  48.                 }
  49.             }
  50.  
  51.             if(youLikesMe)
  52.             {
  53.                 Console.WriteLine(  "Человек, который хочет найти боевых товарищей, и который является отличным воином, нам подходит. " +
  54.                                     "Поздравляем, ты принят в орден!");
  55.             }
  56.         }
  57.     }
  58.  
  59.     class DialogBranch
  60.     {
  61.         public bool IsDoorOpen;
  62.         public string Question;
  63.         public string[] Answers;
  64.  
  65.         public DialogBranch(string Question, string[] Answers)
  66.         {
  67.             this.Question = Question;
  68.             this.Answers = Answers;
  69.         }
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment