Advertisement
Mizraim

Setting variables on a 'character' for a textConsoleGame

Dec 14th, 2019
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.71 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4. namespace src
  5. {
  6.     public class YourInfo
  7.     {
  8.         public static string name;
  9.         public static bool nameCorrect = false;
  10.         public static string sex;
  11.         public static bool sexCorrect = false;
  12.         public static string gender;
  13.         public static bool male = true;
  14.         public static string subjective = "he";
  15.         public static string objective = "him";
  16.         public static string possessive = "his";
  17.         public static string reflexive = "himself";
  18.         public static string hair;
  19.         public static bool hairCorrect = false;
  20.         public static string eyes;
  21.         public static bool eyesCorrect = false;
  22.         public static string confirm;
  23.  
  24.         public static void Check()
  25.         {
  26.             //   switch (confirm)
  27.             //   {
  28.             //       case "2" && nameCorrect:
  29.             if (confirm == "2" && nameCorrect)
  30.             {
  31.                 Console.WriteLine("Maybe I didn't hear you correctly. Let's try again.");
  32.                 Console.ReadLine();
  33.                 Console.WriteLine(confirm, nameCorrect);
  34.              //   break;
  35.             }
  36.             //        case "2" && sexCorrect:
  37.             else if (confirm == "2" && sexCorrect)
  38.             {
  39.                 CreateSex();
  40.              //   break;
  41.             }
  42.             //       case "2" && (hairCorrect):
  43.             else if (confirm == "2" && hairCorrect)
  44.             {
  45.                 CreateHair();
  46.              //   break;
  47.             }
  48.             //        case "2" && (eyesCorrect):
  49.             else if (confirm == "2" && eyesCorrect)
  50.             {
  51.                 CreateEyes();
  52.              //   break;
  53.             }
  54.             /*       default:
  55.                        {
  56.                            break;
  57.                        } */
  58.         }
  59.  
  60.  
  61.         public static void Pronouns()
  62.         {
  63.             if (!male)
  64.             {
  65.                 subjective = "she";
  66.                 objective = "her";
  67.                 possessive = "hers";
  68.                 reflexive = "herself";
  69.             }
  70.         }
  71.  
  72.         public static void CreateName()
  73.         {
  74.             Console.Clear();
  75.             Console.WriteLine("Please enter your FIRST name, then press 'Enter'.");
  76.             name = Console.ReadLine();
  77.             Console.WriteLine("");
  78.             Console.WriteLine($"So your name is {name}?");
  79.             Console.WriteLine($"1. That's right. 2. Oh, did I say, {name}...");
  80.             Console.WriteLine("");
  81.             confirm = Console.ReadLine();
  82.             Check();
  83.             nameCorrect = true;
  84.             CreateSex();
  85.         }
  86.  
  87.         public static void CreateSex()
  88.         {
  89.             Console.WriteLine("");
  90.             Console.WriteLine($"Now, {name}, I'm going to ask you a few questions about yourself.");
  91.             Console.WriteLine("Please tell me if you are male, or female.");
  92.             Console.WriteLine("1. Male 2. Female");
  93.             sex = Console.ReadLine();
  94.  
  95.             switch (sex)
  96.             {
  97.                 case "1":
  98.                     {
  99.                         sex = "male";
  100.                         gender = "boy";
  101.                         Pronouns();
  102.                         break;
  103.                     }
  104.                 default:
  105.                     {
  106.                         sex = "female";
  107.                         gender = "girl";
  108.                         //Pronous();
  109.                         break;
  110.                     }
  111.             }
  112.  
  113.             Console.WriteLine("");
  114.             Console.WriteLine($"I see, {name}, you are {sex}.");
  115.             Console.WriteLine($"1. Yes, I'm a {gender}. 2. Are you even listening?");
  116.             confirm = Console.ReadLine();
  117.             Check();
  118.             sexCorrect = true;
  119.             CreateHair();
  120.         }
  121.  
  122.         public static void CreateHair()
  123.         {
  124.             Console.WriteLine("");
  125.             Console.WriteLine("Now, I'd like to know what color your hair and eyes are.");
  126.             Console.ReadLine();
  127.             Console.WriteLine($"Tell me first about your hair color, {name}.");
  128.             Console.WriteLine("Please enter your HAIR color, then press 'Enter' to continue.");
  129.             hair = Console.ReadLine();
  130.             Console.WriteLine("");
  131.             Console.WriteLine($"Oh, I really enjoy, {hair} hair.");
  132.             Console.WriteLine($"1. Thanks! 2. I didn't say my hair was {hair}.");
  133.             confirm = Console.ReadLine();
  134.             Check();
  135.             hairCorrect = true;
  136.             CreateEyes();
  137.         }
  138.  
  139.         public static void CreateEyes()
  140.         {
  141.             Console.WriteLine("");
  142.             Console.WriteLine("We're almost done.");
  143.             Console.WriteLine("Now, please tell me about your eyes.");
  144.             Console.WriteLine("Please enter your EYE color, then press 'Enter' to continue");
  145.             eyes = Console.ReadLine();
  146.             Console.WriteLine("");
  147.             Console.WriteLine($"And such beautiful {eyes} eyes they are, {name}.");
  148.             Console.WriteLine($"1. I agree. 2. Who said they were {eyes}?");
  149.             confirm = Console.ReadLine();
  150.             Check();
  151.             hairCorrect = true;
  152.         }
  153.  
  154.         public static void ConfirmCreate()
  155.         {
  156.             Console.Clear();
  157.             Console.WriteLine($"Alright, {name}, does it look like I got all of this right?");
  158.             Console.WriteLine($@"Your name is {name} and you are {sex}.
  159.            You have {hair} hair, and lovely {eyes} eyes.");
  160.             Console.WriteLine("1. You are too kind. 2. Almost...");
  161.             confirm = Console.ReadLine();
  162.             Check();
  163.             eyesCorrect = true;
  164.             Console.Clear();
  165.         }
  166.     }
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement