Changed a lot of Actions.cs and a few other things to be more easily

extendable.
This commit is contained in:
2025-09-03 23:32:20 -05:00
parent 69e6699e26
commit e4b230a0ad
21 changed files with 834 additions and 314 deletions

View File

@@ -1,62 +1,56 @@
string? input;
Console.Clear();
Console.WriteLine("Welcome True Programmer, to the final battle for the realms of C#.");
Console.WriteLine("------------------------------------------------------------------");
ColoredConsole.WriteLine("------------------------------------------------------------------", ConsoleColor.Cyan);
ColoredConsole.WriteLine("Welcome True Programmer, to the final battle for the realms of C#.", ConsoleColor.Cyan);
Thread.Sleep(1000);
Console.WriteLine("\nThis will be the final battle against the Uncoded One..."
+ "\nAre you ready?");
Console.WriteLine("--------------------------------------------------------"
+ "--------------");
ColoredConsole.WriteLine("\nThis will be the final battle against the Uncoded One..."
+ "\nAre you ready?", ConsoleColor.Cyan);
ColoredConsole.WriteLine("--------------------------------------------------------"
+ "----------", ConsoleColor.Cyan);
Console.ReadLine();
while (true)
{
Console.Clear();
Console.Write("\nWould you like the heroes party to be controlled by AI? (yes/no): ");
input = Console.ReadLine().ToLower();
if (input == "yes" || input == "no")
try
{
if (input == "yes")
{
GameState.Instance.herosAIControl = true;
}
if (input == "no")
Console.Clear();
ColoredConsole.WriteLine("Game mode:", ConsoleColor.Green);
Console.WriteLine("\n1. Player vs Computer\n2. Player vs Player\n3. Computer vs Computer");
ColoredConsole.WriteLine("-----------------------", ConsoleColor.Cyan);
input = ColoredConsole.Prompt("Enter a game mode");
if (input == "1")
{
GameState.Instance.herosAIControl = false;
}
}
else
{
Console.WriteLine("Please answer yes or no.");
Thread.Sleep(1000);
continue;
}
break;
}
while (true)
{
Console.Clear();
Console.Write("\nWould you like the monsters party to be controlled by AI? (yes/no): ");
input = Console.ReadLine().ToLower();
if (input == "yes" || input == "no")
{
if (input == "yes")
{
GameState.Instance.monstersAIControl = true;
break;
}
if (input == "no")
if (input == "2")
{
GameState.Instance.herosAIControl = false;
GameState.Instance.monstersAIControl = false;
break;
}
if (input == "3")
{
GameState.Instance.herosAIControl = true;
GameState.Instance.monstersAIControl = true;
break;
}
else
{
ColoredConsole.WriteLine("Sorry. That isn't a valid input...", ConsoleColor.Red);
Thread.Sleep(1000);
continue;
}
}
else
catch (FormatException)
{
Console.WriteLine("Please answer yes or no.");
ColoredConsole.WriteLine("Sorry. That isn't a valid input...", ConsoleColor.Red);
Thread.Sleep(1000);
continue;
}
break;
}
Player player = new Player();