示例#1
0
        public static string jediTrainPath(Jedi chosen1, string nombre)
        {
            JediKnight Toby = new JediKnight("Toby", 21, "Chagrian", 72);

            Toby.Intro();
            Console.WriteLine($"\n\tIt's {nombre}'s turn to learn the ways of the force!");
            return(destiny());
        }
示例#2
0
        public static string JediPath()
        {
            Jedi chosen1 = new Jedi(aName: Console.ReadLine(), 18, "Human", 70);
            Jedi Master  = new JediMaster(aName: "Bixby", 22, "Utapuan", 94);

            Master.NameYourself();
            string aName  = Console.ReadLine();
            string nombre = aName;

            if ((aName == " ") || (aName == ""))
            {
                return(JediPath());
            }
            Console.WriteLine($"\n\tWelcome to the alliance {aName}!");
            Console.WriteLine($"\n\tWhat color lightsaber do you want {aName}?\n\tRed\n\tOrange\n\tYellow\n\tGreen\n\tBlue\n\tIndigo\n\tViolet\n\tWhite");
            string choice = Console.ReadLine().ToLower();

            if ((choice == "") || (choice == " "))
            {
                return(JediPath());
            }
            Random r    = new Random(); //random variable
            var    list = new List <string> {
                "red", "orange", "yellow", "green", "blue", "indigo", "violet", " white"
            };
            int        color   = r.Next(list.Count); // Random index
            string     lucky   = (list[color]);      // String of random index
            Lightsaber mystery = new Lightsaber(1, "slicer", "Whoosh", 4, lucky);

            Console.WriteLine($"\n\tLooks like you got {lucky}!"); // Maybe you got lucky??
            if (choice == lucky)
            {
                if (choice == "red")
                {
                    return(mystery.RedSaber() + jediTrainPath(chosen1, nombre));
                }
                if (choice == "orange")
                {
                    return(mystery.OrangeSaber() + jediTrainPath(chosen1, nombre));
                }
                if (choice == "yellow")
                {
                    return(mystery.YellowSaber() + jediTrainPath(chosen1, nombre));
                }
                if (choice == "green")
                {
                    return(mystery.GreenSaber() + jediTrainPath(chosen1, nombre));
                }
                if (choice == "blue")
                {
                    return(mystery.BlueSaber() + jediTrainPath(chosen1, nombre));
                }
                if (choice == "indigo")
                {
                    return(mystery.Indigo() + jediTrainPath(chosen1, nombre));
                }
                if (choice == "violet")
                {
                    return(mystery.VioletSaber() + jediTrainPath(chosen1, nombre));
                }
                if (choice == "white")
                {
                    return(mystery.VioletSaber() + jediTrainPath(chosen1, nombre));
                }
            }
            else if (choice != lucky)
            {
                return(DutyPath(chosen1, nombre));
            }
            return("The Force"); //Not meant to display
        }
示例#3
0
 public static string DutyPath(Jedi chosen1, string nombre)
 {
     chosen1.Post();
     Console.WriteLine($"\n\t{nombre} is going to have a lot of fun...");
     return("The force");
 }