public TitleParser CreateBaronyScriptScope(ProvinceParser capital, CultureParser culture) { var place = culture.dna.GetPlaceName(); var text = place; place = StarNames.SafeName(text); if (TitleManager.instance.TieredTitles.ContainsKey("b_" + place)) { return(CreateBaronyScriptScope(capital, culture)); } var rand = Rand.Get(); Color col = Color.FromArgb(255, rand.Next(200) + 55, rand.Next(200) + 55, rand.Next(200) + 55); ScriptScope scope = new ScriptScope(); scope.Parent = capital.Title.Scope; scope.Name = "b_" + place; LanguageManager.instance.Add("b_" + place, text); // scope.Kids.Add(new ScriptCommand() { Name = "rebel", Value = false }); TitleParser title = new TitleParser(scope); TieredTitles[title.Name] = title; capital.Title.Scope.Add(title.Scope); // if (culture.dna.horde) // title.Scope.Do("historical_nomad = yes"); // AddTitle(title); return(title); }
public TitleParser CreateKingScriptScope(ProvinceParser capital, CharacterParser chr) { var rand = Rand.Get(); Color col = Color.FromArgb(255, rand.Next(200) + 55, rand.Next(200) + 55, rand.Next(200) + 55); ScriptScope scope = new ScriptScope(); scope.Parent = LandedTitlesScript.Root; { String place = chr.Culture.dna.GetPlaceName(); String text = place; place = StarNames.SafeName(place); if (TitleManager.instance.TitleMap.ContainsKey("k_" + place)) { return(CreateKingScriptScope(capital, chr.culture)); } LanguageManager.instance.Add(place, text); scope.Name = "k_" + place; LanguageManager.instance.Add(scope.Name, text); } //scope.Kids.Add(new ScriptCommand() { Name = "rebel", Value = false }); scope.Add(new ScriptCommand() { Name = "color", Value = col }); scope.Add(new ScriptCommand() { Name = "color2", Value = col }); scope.Add(new ScriptCommand() { Name = "capital", Value = capital.id }); TitleParser title = new TitleParser(scope); AddTitle(title); // now place the counties into it... if (title.capital != 0) { title.CapitalProvince = MapManager.instance.ProvinceIDMap[title.capital]; } return(title); }
public TitleParser CreateDukeScriptScope(ProvinceParser capital, String name = null) { var rand = Rand.Get(); Color col = Color.FromArgb(255, rand.Next(200) + 55, rand.Next(200) + 55, rand.Next(200) + 55); ScriptScope scope = new ScriptScope(); scope.Parent = LandedTitlesScript.Root; if (name == null) { String place = capital.Title.Holder.Culture.dna.GetPlaceName(); String text = place; place = StarNames.SafeName(place); LanguageManager.instance.Add(place, text); scope.Name = "d_" + place; LanguageManager.instance.Add(scope.Name, text); } else { scope.Name = "d_" + name; } // scope.Kids.Add(new ScriptCommand() { Name = "rebel", Value = false }); scope.Add(new ScriptCommand() { Name = "color", Value = col }); scope.Add(new ScriptCommand() { Name = "color2", Value = col }); scope.Add(new ScriptCommand() { Name = "capital", Value = capital.id }); TitleParser title = new TitleParser(scope); // if (capital.Title.Culture.dna.horde) // title.Scope.Do("historical_nomad = yes"); AddTitle(title); if (title.capital != 0) { title.CapitalProvince = MapManager.instance.ProvinceIDMap[title.capital]; } // now place the counties into it... return(title); }
public TitleParser CreateKingScriptScope(ProvinceParser capital, String name = null) { var rand = Rand.Get(); Color col = Color.FromArgb(255, rand.Next(200) + 55, rand.Next(200) + 55, rand.Next(200) + 55); ScriptScope scope = new ScriptScope(); scope.Parent = LandedTitlesScript.Root; if (name == null) { scope.Name = "k_" + capital.Title.Name.Substring(2); } else { scope.Name = "k_" + name; } //scope.Kids.Add(new ScriptCommand() { Name = "rebel", Value = false }); scope.Add(new ScriptCommand() { Name = "color", Value = col }); scope.Add(new ScriptCommand() { Name = "color2", Value = col }); scope.Add(new ScriptCommand() { Name = "capital", Value = capital.id }); TitleParser title = new TitleParser(scope); AddTitle(title); // now place the counties into it... if (title.capital != 0) { title.CapitalProvince = MapManager.instance.ProvinceIDMap[title.capital]; } return(title); }
public static string Generate(int seed) { string name = ""; var rand = Rand.Get(); int syllabuls = rand.Next(2) + 1; for (int n = 0; n < syllabuls; n++) { string wordPart = namePartsStart[rand.Next(namePartsStart.Length)]; foreach (char c in wordPart) { if (c == 'a') { string v = vowels[rand.Next(vowels.Length)]; if (v == "y") { v = vowels[rand.Next(vowels.Length)]; } name += vowels[rand.Next(vowels.Length)]; } else { name += c; } } } name += namePartsEnd[rand.Next(namePartsEnd.Length)]; char firstLetter = Char.ToUpper(name[0]); name = firstLetter + name.Substring(1); return(name); }