// .NET 8 C# - Random Sims 2 Personality Allocator // Clear, minimal, portable, with basic validation. using PersonaForge; Console.WriteLine("=== Welcome to The Sims 2 Personality Generator ==="); Console.Write("Enter Sim's name: "); string name = Console.ReadLine() ?? "Unndanmed Sim"; // Move the conversion logic to a separate method Console.WriteLine("\nAvailable Archetypes:"); var archetypeList = Archetypes.DefaultArchetypes(); var archetypeDict = new Dictionary>(); foreach (var archetype in archetypeList) { Console.WriteLine($"- {archetype.Name}"); archetypeDict.Add(archetype.Name, archetype.TraitBiases); } Console.Write("Enter archetype: "); string archetypeInput = Console.ReadLine() ?? "Random"; if (!archetypeDict.ContainsKey(archetypeInput)) { Console.WriteLine("Invalid archetype. Using Random."); archetypeInput = "Random"; } var qualities = PersonalityGen.GenerateRandom(archetypeDict[archetypeInput]); var profile = new PersonaProfile { Name = name, Qualities = qualities, Archetype = archetypeInput }; Console.WriteLine($"{name}'s Profile{Environment.NewLine}{PersonaProfile.ToJson(profile)}"); Console.Write("Save profile? (y/n): "); var saveInput = Console.ReadLine()?.Trim().ToLowerInvariant(); if (saveInput == "y") { var safeName = name.Replace(" ", "_").Replace("\"", ""); File.WriteAllText($"{safeName}.json", PersonaProfile.ToJson(profile)); Console.WriteLine($"Profile saved as {name}.json"); } Console.WriteLine($"Done. Forge on! 🔥{Environment.NewLine}Press any key to exit..."); Console.ReadKey();