From 6e455bbc974996d2c7301887052f9a710ba6bd7c Mon Sep 17 00:00:00 2001 From: Tony Bark Date: Sun, 2 Feb 2025 02:00:36 -0500 Subject: [PATCH] Readme - Fix missing traits --- README.md | 14 ++++++++++++++ Sim.cs | 19 ++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..53850c6 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# Sims Personality Generator + +As the name suggets, this will generate a persoanlity for The Sims 1 and 2. If you set one trait higher than other, it will automatically adjust itself to compensate for the difference. + +## Background + +I wanted to play The Sims 2 with my characters. Problem was I've been spoiled by traits. How do I create an ideal personality within these limitations? What if I have a random generator that gives me some options but also is smart enough to let me set some bias towards Playfulness or Nice? + +The code itself was initially generated using the Qwen Coder model because I wouldn't know to begin. While it is easy to generate random numbers, I also had to have it to account for one being higher than the other. How? That was the point in asking the AI for a template, with that taken into consideration. + + +## License + +I license this project under the GPL-3.0 license - see [LICENSE](LICENSE) for details. \ No newline at end of file diff --git a/Sim.cs b/Sim.cs index 16f5e8b..3b20aa0 100644 --- a/Sim.cs +++ b/Sim.cs @@ -1,11 +1,15 @@ namespace SimsPersonalityGenerator; +public enum Traits { Nice, Neat, Outgoing, Active, Playful } + public class Sim { + public int Niceness { get; private set; } public int Neatness { get; private set; } public int Outgoingness { get; private set; } public int Activeness { get; private set; } + public int Laziness { get; private set; } public int Playfulness { get; private set; } public Sim() @@ -13,35 +17,36 @@ public class Sim GenerateRandomPersonality(); } - public void SetTraitHigher(string trait, bool isHigh) + // TODO: Fix trait mix up + public void SetTraitHigher(Traits trait, bool isHigh) { - switch (trait.ToLower()) + switch (trait) { - case "niceness": + case Traits.Nice: if (isHigh) Niceness = Math.Min(10, Neatness + 5); else Neatness = Math.Min(10, Niceness + 5); break; - case "neatness": + case Traits.Neat: if (isHigh) Neatness = Math.Min(10, Activeness + 5); else Activeness = Math.Min(10, Neatness + 5); break; - case "outgoingness": + case Traits.Outgoing: if (isHigh) Outgoingness = Math.Min(10, Playfulness + 5); else Playfulness = Math.Min(10, Outgoingness + 5); break; - case "activeness": + case Traits.Active: if (isHigh) Activeness = Math.Min(10, Niceness + 5); else Niceness = Math.Min(10, Activeness + 5); break; - case "playfulness": + case Traits.Playful: if (isHigh) Playfulness = Math.Min(10, Outgoingness + 5); else