51 lines
1.7 KiB
C#
51 lines
1.7 KiB
C#
// .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<string, Dictionary<string, double>>();
|
|
foreach (var archetype in archetypeList)
|
|
{
|
|
Console.WriteLine($"- {archetype.Name}");
|
|
archetypeDict.Add(archetype.Name, archetype.TraitBiases);
|
|
}
|
|
|
|
Console.Write("Choose an Archetype (or 'Random'): ");
|
|
string archetypeInput = Console.ReadLine() ?? "Random";
|
|
if (!archetypeDict.ContainsKey(archetypeInput))
|
|
{
|
|
Console.WriteLine("Invalid archetype. Using Random.");
|
|
archetypeInput = "Random";
|
|
}
|
|
|
|
Console.WriteLine($"{Environment.NewLine}Generating {archetypeInput} profile...");
|
|
var qualities = PersonalityGen.GenerateRandom(archetypeDict[archetypeInput]);
|
|
var profile = new PersonaProfile
|
|
{
|
|
Name = name,
|
|
Qualities = qualities,
|
|
Archetype = archetypeInput
|
|
};
|
|
|
|
Console.WriteLine($"{Environment.NewLine}--- Generated 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();
|