Skip to content

Commit

Permalink
added middle names to namingsystem for dwarves
Browse files Browse the repository at this point in the history
  • Loading branch information
widgetbeck authored Sep 10, 2024
1 parent 73637af commit 68b2985
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Content.Shared/Humanoid/NamingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public string GetName(string species, Gender? gender = null)
case SpeciesNaming.FirstDashFirst:
return Loc.GetString("namepreset-firstdashfirst",
("first1", GetFirstName(speciesProto, gender)), ("first2", GetFirstName(speciesProto, gender)));
case SpeciesNaming.FirstMiddleLast:
return Loc.GetString("namepreset-firstmiddlelast",
("first", GetFirstName(speciesProto, gender)), ("middle", GetMiddleName(speciesProto)), ("last", GetLastName(speciesProto)));
case SpeciesNaming.FirstLast:
default:
return Loc.GetString("namepreset-firstlast",
Expand All @@ -58,6 +61,11 @@ public string GetFirstName(SpeciesPrototype speciesProto, Gender? gender = null)
}
}

public string GetMiddleName(SpeciesPrototype speciesProto)
{
return _random.Pick(_prototypeManager.Index<DatasetPrototype>(speciesProto.MiddleNames).Values);
}

public string GetLastName(SpeciesPrototype speciesProto)
{
return _random.Pick(_prototypeManager.Index<DatasetPrototype>(speciesProto.LastNames).Values);
Expand Down

0 comments on commit 68b2985

Please sign in to comment.