//Overall char creation method returns PlayerChar class static PlayerChar CharacterCreator() { Console.Clear(); //Place Holders Console.WriteLine(" You open your eyes and are welcomed by the sight of empty," + "\ndarkening skies. The air around is getting colder, but its chilliness isn’t" + "\nwhat woke you up. A song reaches your ears – soft, gentle tune, with a sort" + "\nof grim undertone hidden within the lyrics. The voice behind the melody is" + "\nmelancholic and evokes a fleeting sense of nostalgia within you. Maybe you’ve" + "\nheard this one before, in another time and place."); WriteColor($" \nYou get up to find that the other people from the" + $"\ncaravan are nowhere to be seen. Only the remains of a long dead" + $"\nfire scar the ground nearby in charcoal black. The road is but" + $"\na faint trace in the dying crimson dusk. Everything else is" + $"\nobscured by the shadows of [the forest], with its tremendous" + $"\ntrees like an army of colossi over your head. ", ConsoleColor.Yellow); Console.WriteLine(); WriteColor("\n Everything else is obscured…" + "\nExcept the [songstress]. She lifts a head of black hair and lets" + "\nthe lyre’s strings ring out and fall silent. A pair of light" + "\neyes meets yours. The features of her pale faces remain calm. ", ConsoleColor.Yellow); Console.WriteLine(); WriteColor($"\n “I wondered when you’d wake up,” the woman says," + $"\nher voice the only sound in the clearing, echoing beyond into" + $"\nthe rows of trees. “The others left long ago. But fear not," + $"\nthere’s still plenty of time to reach your destination." + $"\nAlthough that cannot happen if you don’t listen and answer to me.”", ConsoleColor.Yellow); Console.WriteLine("\nYou nod, strangely content with the weirdness of the situation. She clears her throat. "); WriteColor("\n“What is your [name], lone traveler?”", ConsoleColor.Yellow); //Adding skills and abilities based on the class and atributes //returns the player char for easier use in the Main method string name = NameGen(); string background = BackGround(); PlayerChar player = AtributeDist(name, background); player = SkillDist(player); // return(player); }
static void Main(string[] args) { Console.WriteLine(" _______ __ _________ _______ _________ ________ "); Console.WriteLine(" //EEEEEEE\\ //LL\\ ||DDDDDDDDD\\ //EEEEEEE\\ ||RRRRRRRR\\ //EEEEEEE\\"); Console.WriteLine("||EE||^^^^^ ||LL|| ||DD||^^||DD|| ||EE||^^^^ ||RR|^^^\\RR\\ ||EE||^^^^^"); Console.WriteLine("||EE||____ ||LL|| ||DD|| ||DD|| ||EE||___ ||RR|___||RR| ||EE||____"); Console.WriteLine("||EEEEEEEE\\ ||LL|| ||DD|| ||DD|| ||EEEEEEE\\ ||RRRRRRRRR/ ||EEEEEEEE\\"); Console.WriteLine("||EE||^^^^^ ||LL|| ||DD|| ||DD|| ||EE||^^^ ||RR|^^\\R\\ ||EE||^^^^^"); Console.WriteLine("||EE||______ ||LL \\____ ||DD||__||DD|| ||EE||_______ ||RR| \\R\\ ||EE||______"); Console.WriteLine("\\EEEEEEEEE// \\LLLLLLLLL\\ \\DDDDDDDDD// \\EEEEEEEEEE// ||RR| \\R\\ \\EEEEEEEEE//"); Console.WriteLine(" ^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^ ^^^^^ ^^^ ^^^^^^^^^^"); Console.WriteLine(" Eldere's Labyrinth"); Console.WriteLine(); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); //This will be the player character for later on PlayerChar player = CharacterCreator(); Console.WriteLine(player.ToString()); }
static PlayerChar SkillDist(PlayerChar player) { //Skill addition Dictionary <string, Dictionary <string, int> > skillsMele = new Dictionary <string, Dictionary <string, int> >(); skillsMele.Add("Active", new Dictionary <string, int>()); skillsMele["Active"].Add("Lunge", 0); //Passive skills skillsMele.Add("Passive", new Dictionary <string, int>()); skillsMele["Passive"].Add("Long Blade", 0); skillsMele["Passive"].Add("Short Blade", 0); skillsMele["Passive"].Add("Bow", 0); skillsMele["Passive"].Add("Blunt", 0); skillsMele["Passive"].Add("Light Armor", 0); skillsMele["Passive"].Add("Medium Armor", 0); skillsMele["Passive"].Add("Heavy Armor", 0); //Spells //End //Points to spend int points = 5; int n = 1; while (points > 0) { //Introduction Console.Clear(); Console.WriteLine(" Place Holder "); WriteColor($"\n[{player.Name}]'s Class: [{player.Klass}]", ConsoleColor.Green); WriteColor($"\nAtributes: " + $"\n[Health - {player.Atributes["health"]}]" + $"\n[Strenght - {player.Atributes["strenght"]}]" + $"\n[Agility - {player.Atributes["agility"]}]" + $"\n[Intellect - {player.Atributes["intellect"]}]", ConsoleColor.Cyan); Console.WriteLine(); Console.WriteLine("Skills:"); foreach (var category in skillsMele) { Console.WriteLine(); Console.WriteLine($"{category.Key}:"); foreach (var skill in category.Value) { Console.WriteLine($"{n}) {skill.Key} -> {skill.Value}lv"); n++; } n = 1; } Console.WriteLine(); Console.WriteLine($"Points to add: {points}"); Console.WriteLine(); Console.WriteLine("Command: add/remove"); string[] input = Console.ReadLine() .Split(", ", StringSplitOptions.RemoveEmptyEntries); if (input[0] == "add") { Console.WriteLine("Command: Type(Active/Passive), Skillname, amount"); input = Console.ReadLine() .Split(", ", StringSplitOptions.RemoveEmptyEntries); if (skillsMele.ContainsKey(input[0])) { if (skillsMele[input[0]].ContainsKey(input[1])) { skillsMele[input[0]][input[1]] += int.Parse(input[2]); points -= int.Parse(input[2]); } else { Console.WriteLine("Invalid skillname"); } } else { Console.WriteLine("Invalid type"); } } else if (input[0] == "remove") { Console.WriteLine("Command: Type(Active/Passive), Skillname, amount"); if (skillsMele.ContainsKey(input[0])) { if (skillsMele[input[0]].ContainsKey(input[1])) { skillsMele[input[0]][input[1]] -= int.Parse(input[2]); points += int.Parse(input[2]); } else { Console.WriteLine("Invalid skillname"); } } else { Console.WriteLine("Invalid type"); } } else if (input[0] == "back") { player = AtributeDist(player.Name, player.Background); } } foreach (var item in skillsMele) { foreach (var skill in item.Value) { if (skill.Value > 0) { player.Skills.Add(skill.Key, skill.Value); } } } return(player); }
static PlayerChar AtributeDist(string name1, string background) { //Invoking classselect List <string> details = ClassSelect(background); string klass = details[0]; //Default attributes for playerChar some might be augmented because of the way the calcs work double health = 10; double str = 10; double agi = 10; double intellect = 10; double magika = 10; //Dictionary for the atributes for easier use and augmentation of stats Dictionary <string, double> atributes = new Dictionary <string, double>(); atributes.Add("health", health + Math.Round(str / 10)); atributes.Add("strenght", str); atributes.Add("agility", agi); atributes.Add("intellect", intellect); atributes.Add("magika", magika + Math.Round(intellect / 10)); atributes.Add("dogde", 1 + Math.Round(agi / 10)); atributes.Add("armor", 8 + atributes["dogde"]); //Taking all atributes for the creator leaving the person to add some more later on int pointsToAdd = 10; PlayerChar player = new PlayerChar(name1, klass, atributes); player.Background = background; //Adding class specific bonuses to stats if (player.Background.ToLower() == "commoner") { player.Atributes["strenght"] += 2; player.Atributes["agility"] += 2; player.Atributes["intellect"] -= 2; } else if (player.Background.ToLower() == "soldier") { player.Atributes["intellect"] -= 3; player.Atributes["strenght"] += 3; player.Atributes["agility"] += 3; } else if (player.Background.ToLower() == "monastic disciple") { player.Atributes["strenght"] += 2; player.Atributes["intellect"] += 1; } else if (player.Background.ToLower() == "grandson of the old lord") { player.Atributes["health"] += 4; player.Atributes["intellect"] += 3; player.Abilities = new Dictionary <string, List <string> >(); player.Abilities.Add("passive", new List <string>()); player.Abilities["passive"].Add("blood rage"); } //The character creator UI element and wizard //Assigning atributes while (pointsToAdd != 0) { //Help for the creator wizard Console.Clear(); Console.WriteLine($"Type back to return to previous step."); Console.WriteLine(); Console.WriteLine($"Very well. So you were a {klass} not suprising considering the way you look."); Console.WriteLine(); Console.WriteLine("What were you good at exactly."); Console.WriteLine(); WriteColor($"{player.Name} the [{player.Background}] Class: [{player.Klass}]\nStats:", ConsoleColor.Green); WriteColor($"\n[Strenght] -> [{atributes["strenght"]}]", ConsoleColor.Red); WriteColor($"\n[Agility] -> [{atributes["agility"]}]", ConsoleColor.DarkGreen); WriteColor($"\n[Intellect] -> [{atributes["intellect"]}]", ConsoleColor.Cyan); if (player.Klass.ToLower() == "sorcerer") { WriteColor($"\n[Magika] -> [{atributes["magika"] + Math.Round(atributes["intellect"] / 10)}]", ConsoleColor.Magenta); } Console.WriteLine(); Console.WriteLine("Unaugmentable stats:"); WriteColor($"[Health] -> [{atributes["health"] + Math.Round(atributes["strenght"] / 10)}] -> [health] = 10 + str / 10 rounded", ConsoleColor.Red); WriteColor($"\n[Dogde] -> [{atributes["dogde"]}] -> [dogde] = 1 + agi / 10 rounded", ConsoleColor.DarkGreen); WriteColor($"\n[Armor] -> [{atributes["armor"] + atributes["dogde"]}] -> [armor] = AV(Armor value from items) + dodge / (armor type eg. Light /1 medium /2 heavy / 4)", ConsoleColor.White); Console.WriteLine(); Console.WriteLine($"Left augment points: {pointsToAdd}"); Console.WriteLine(); Console.WriteLine($"How many do you want to add or remove from an atribute"); Console.WriteLine("Atribute: Add\\Remove: Points:"); Console.WriteLine("eg. intellect add 2"); //Saving the input in two vars for easier use later on string[] input2 = Console.ReadLine() .Split(" ", StringSplitOptions.RemoveEmptyEntries) .ToArray(); string atribute = String.Empty; int pointsToAddToAtrb = 0; string operation = String.Empty; //Returning to the previous state of the game which in this case is Class Select and player name if (input2[0].ToLower() == "back") { Console.Clear(); List <string> klasses = ClassSelect(player.Background); player.Klass = klasses[0]; } else if (input2.Length != 3) { Console.WriteLine("Error Invalid Command"); } else { if (!atributes.ContainsKey(input2[0])) { Console.WriteLine("Invalid atribute"); } else { atribute = input2[0]; } pointsToAddToAtrb = int.Parse(input2[2]); if (input2[1] != "add") { if (input2[1] != "remove") { Console.WriteLine("Invalid command"); } else { operation = input2[1]; } } else { operation = input2[1]; } //Actual code for the wizard if (operation.ToLower() == "add") { if (atributes.ContainsKey(atribute.ToLower()) && atribute.ToLower() != "dodge" && atribute.ToLower() != "health") { if (atributes[atribute] + pointsToAddToAtrb > 20) { Console.WriteLine("Atributes cannot be higher than 20."); Console.WriteLine(); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); } else { atributes[atribute] += pointsToAddToAtrb; pointsToAdd -= pointsToAddToAtrb; } } else { Console.WriteLine("Invalid atribute"); Console.WriteLine(); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); } } else if (operation.ToLower() == "remove") { if (atributes.ContainsKey(atribute.ToLower()) && atribute.ToLower() != "dodge" && atribute.ToLower() != "health") { if (atributes[atribute] - pointsToAddToAtrb <= 0) { Console.WriteLine("Atributes cannot be less than 1."); Console.WriteLine(); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); } else { atributes[atribute] -= pointsToAddToAtrb; pointsToAdd += pointsToAddToAtrb; } } else { Console.WriteLine("Invalid atribute"); Console.WriteLine(); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); } } else { Console.WriteLine("Invalid Operator"); Console.WriteLine(); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); } if (pointsToAdd < 0) { Console.WriteLine($"You have spend too many atribute points. Remove {Math.Abs(pointsToAdd)}"); Console.WriteLine(); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); } else if (pointsToAdd == 0) { break; } } } player.Atributes = atributes; return(player); }