private static void ChooseRace(Player player) { CharacterStats characterStats = player.getCharacterStats(); PlayerRace[] playerRaces = PlayerRace.GetPlayerRaces(); SlowText("What is your race?", 5, ConsoleColor.DarkGray); for (int i = 0; i < playerRaces.Length; i++) { SlowText((i + 1) + " - " + playerRaces[i].name, 5, ConsoleColor.DarkGray); } int choice; if (DEBUG_MODE) { choice = 5; } else { choice = int.Parse(Console.ReadLine()); } if (choice > playerRaces.Length) { SlowText("Uh, I don't think that's an option. Try again.", 15, ConsoleColor.DarkGray); ChooseRace(player); } else { PlayerRace chosenPlayerRace = playerRaces[choice - 1]; player.InitPlayerRace(chosenPlayerRace); } Console.WriteLine(); }
public void InitPlayerRace(PlayerRace playerRace) { characterStats.race = playerRace.name; characterStats.str += playerRace.str; characterStats.dex += playerRace.dex; characterStats.con += playerRace.con; characterStats.wis += playerRace.wis; characterStats.intel += playerRace.intel; characterStats.cha += playerRace.cha; characterStats.speed = playerRace.speed; }