now they have species! 0u0

This commit is contained in:
Lynne Megido 2020-09-10 03:13:18 +10:00
parent 2ee8bf73ec
commit 5a8d87b908
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90
2 changed files with 23 additions and 12 deletions

View file

@ -19,15 +19,19 @@ namespace wikicreachia {
} }
class Creacher { class Creacher {
public string name { get; set; } private string _name;
public string name { get { return this._name[0].ToString().ToUpper() + this._name.Substring(1); } set { this._name = value; } }
public string species { get; set; }
public string biome { get; set; } public string biome { get; set; }
public int footsies { get; set; } public int footsies { get; set; }
public Locomotion locomotion { get; set; } public Locomotion locomotion { get; set; }
public RelativeElevation elevation { get; set; } public RelativeElevation elevation { get; set; }
public Creacher(string name, int footsies, string biome, Locomotion locomotion, RelativeElevation elevation) { public Creacher(string name, string species, int footsies, string biome, Locomotion locomotion, RelativeElevation elevation) {
this.name = name; this.name = name;
this.species = species;
this.footsies = footsies; this.footsies = footsies;
this.biome = biome;
this.locomotion = locomotion; this.locomotion = locomotion;
this.elevation = elevation; this.elevation = elevation;
} }
@ -41,10 +45,10 @@ namespace wikicreachia {
return list[rng.Next(list.Count)]; return list[rng.Next(list.Count)];
} }
string RandomCompliment() { string RandomCompliment() {
return RandomItem(new List<string> { "wonderful", "gorgeous", "spectacular", "iconic", "precious", "amazing", "incredible", "wondrous", "fantastic", "impeccable", "admirable", "long" }); return RandomItem(new List<string> { "wonderful", "gorgeous", "spectacular", "iconic", "precious", "amazing", "incredible", "wondrous", "fantastic", "impeccable", "admirable", "long", "precious" });
} }
string output = RandomItem(new List<string> { "Coming up next, we have", "And here we have", "Oh look, it's", "Here comes that", "Look out! It's" }); string output = RandomItem(new List<string> { "Coming up next, we have", "And here we have", "Oh look, it's", "Here comes", "Look out! It's" });
output += $" {this.name}! With "; output += $" {this.name}! With ";
if (this.footsies > 5) { if (this.footsies > 5) {
output += $"a whopping {this.footsies} footsies"; output += $"a whopping {this.footsies} footsies";
@ -55,9 +59,9 @@ namespace wikicreachia {
else { else {
output += "not one footsy in sight"; output += "not one footsy in sight";
} }
output += $", this {RandomCompliment()} creacher "; output += $", this {RandomCompliment()} {this.species} ";
output += RandomItem(new List<string> { "usually finds itself in the", "makes its home in the", "truly rules the", "will often be found in the", "loves the", "can't get enough of the", "finds itself most comfortable in the" }); output += RandomItem(new List<string> { "usually finds itself in the", "makes its home in the", "truly rules the", "will often be found in the", "loves the", "can't get enough of the", "finds itself most comfortable in the" });
output += $" {this.biome}. The {this.name} is a {RandomCompliment()} {this.locomotion}, usually found {this.elevation.ToString().ToLower()} sea level. "; output += $" {this.biome}. {this.name} is a {RandomCompliment()} {this.locomotion}, usually found {this.elevation.ToString().ToLower()} sea level. ";
output += RandomItem(new List<string> { "Isn't it", "Truly", "Simply", "Absolutely", "Definitively", "Inspiringly", "Indescribably" }); output += RandomItem(new List<string> { "Isn't it", "Truly", "Simply", "Absolutely", "Definitively", "Inspiringly", "Indescribably" });
output += $" {RandomCompliment()}."; output += $" {RandomCompliment()}.";
return output; return output;

View file

@ -30,16 +30,17 @@ namespace wikicreachia {
break; break;
case "add": case "add":
if (status.minor <= 2) { if (status.minor <= 3) {
string[] prompts = { string[] prompts = {
"Input the name of your creacher, or 'c' to cancel.", "Input the name of your creacher, or 'c' to cancel.",
"Input the species of your creacher.",
"Input the desired number of footsies (number).", "Input the desired number of footsies (number).",
"Input the biome your creacher inhabits most often (freeform text).", "Input the biome your creacher inhabits most often (freeform text).",
}; };
prompt = prompts[status.minor]; prompt = prompts[status.minor];
} }
else if (status.minor == 3) { else if (status.minor == 4) {
prompt = "Press the number corresponding to your creacher's primary method of locomotion:"; prompt = "Press the number corresponding to your creacher's primary method of locomotion:";
foreach (Locomotion option in Enum.GetValues(typeof(Locomotion))) { foreach (Locomotion option in Enum.GetValues(typeof(Locomotion))) {
prompt += $"\n{(int)option + 1}. {option}"; prompt += $"\n{(int)option + 1}. {option}";
@ -47,7 +48,7 @@ namespace wikicreachia {
readKey = true; readKey = true;
} }
else if (status.minor == 4) { else if (status.minor == 5) {
prompt = "Press the number corresponding to the elevation level your creacher is usually found at:\n1. Below sea level\n2. At sea level\n3. Above sea level"; prompt = "Press the number corresponding to the elevation level your creacher is usually found at:\n1. Below sea level\n2. At sea level\n3. Above sea level";
readKey = true; readKey = true;
} }
@ -141,6 +142,11 @@ namespace wikicreachia {
} }
else if (status.minor == 1) { else if (status.minor == 1) {
userCreacher["species"] = input;
status.minor++;
}
else if (status.minor == 2) {
if (int.TryParse(input, out int footsies) && footsies >= 0) { if (int.TryParse(input, out int footsies) && footsies >= 0) {
userCreacher["footsies"] = footsies; userCreacher["footsies"] = footsies;
status.minor++; status.minor++;
@ -150,12 +156,12 @@ namespace wikicreachia {
} }
} }
else if (status.minor == 2) { else if (status.minor == 3) {
userCreacher["biome"] = input; userCreacher["biome"] = input;
status.minor++; status.minor++;
} }
else if (status.minor == 3) { else if (status.minor == 4) {
if (int.TryParse(input, out int choice) && Enum.IsDefined(typeof(Locomotion), choice - 1)) { if (int.TryParse(input, out int choice) && Enum.IsDefined(typeof(Locomotion), choice - 1)) {
userCreacher["locomotion"] = (Locomotion)choice - 1; userCreacher["locomotion"] = (Locomotion)choice - 1;
status.minor++; status.minor++;
@ -165,7 +171,7 @@ namespace wikicreachia {
} }
} }
else if (status.minor == 4) { else if (status.minor == 5) {
if (int.TryParse(input, out int choice) && Enum.IsDefined(typeof(RelativeElevation), choice - 1)) { if (int.TryParse(input, out int choice) && Enum.IsDefined(typeof(RelativeElevation), choice - 1)) {
userCreacher["elevation"] = (RelativeElevation)choice - 1; userCreacher["elevation"] = (RelativeElevation)choice - 1;
@ -173,6 +179,7 @@ namespace wikicreachia {
creachers.Add( creachers.Add(
(string)userCreacher["name"], new Creacher( (string)userCreacher["name"], new Creacher(
(string)userCreacher["name"], (string)userCreacher["name"],
(string)userCreacher["species"],
(int)userCreacher["footsies"], (int)userCreacher["footsies"],
(string)userCreacher["biome"], (string)userCreacher["biome"],
(Locomotion)userCreacher["locomotion"], (Locomotion)userCreacher["locomotion"],