Exemplo n.º 1
0
        public void Save()
        {
            Script s = new Script();

            s.Name = Globals.GameDir + "map\\geographical_region.txt";
            s.Root = new ScriptScope();
            foreach (var region in regions)
            {
                ScriptScope ss = new ScriptScope();

                String duchieList = "";

                foreach (var titleParser in region.duchies)
                {
                    duchieList = duchieList + " " + titleParser.Name;
                }
                ss.Name = StarNames.SafeName(region.name);
                ss.Do(@"
                    duchies = {
                        " + duchieList + @"
                    }
");
                s.Root.Add(ss);
            }

            s.Save();
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public void Init()
        {
            LanguageManager.instance.Add("norse", StarNames.Generate(Rand.Next(1000000)));
            LanguageManager.instance.Add("pagan", StarNames.Generate(Rand.Next(1000000)));

            Script s = new Script();

            script = s;
            s.Name = Globals.ModDir + "common\\cultures\\00_cultures.txt";
            s.Root = new ScriptScope();
            CultureGroupParser r = AddCultureGroup("barbarian");

            //  r.Init();
            AllCultureGroups.Add(r);

            var cul = r.AddCulture("norse");

            cul.dna       = CulturalDnaManager.instance.GetNewFromVanillaCulture();
            cul.dna.horde = false;
            //   cul.dna.horde = false;
            cul.DoDetailsForCulture();

            //    cul.Init();
            cul.Name = cul.Scope.Name;
            CultureMap[cul.Scope.Name] = cul;
            AllCultures.Add(cul);
            s.Save();
        }
Exemplo n.º 4
0
        public Government BranchGovernment(Government gov, CultureParser culture)
        {
            var newGov = gov.Mutate(10);

            {
                if (newGov.type == "nomadic")
                {
                    newGov.type = "tribal";
                    newGov.SetType(newGov.type);
                }
            }

            do
            {
                newGov.name = culture.dna.GetMaleName();
            } while (LanguageManager.instance.Get(StarNames.SafeName(newGov.name) + "_government") != null);

            string s = newGov.name;

            newGov.name = StarNames.SafeName(newGov.name) + "_government";
            LanguageManager.instance.Add(newGov.name, s);
            culture.Governments.Add(newGov);
            if (!newGov.cultureAllow.Contains(culture.Name))
            {
                newGov.cultureAllow.Add(culture.Name);
            }
            return(newGov);
        }
Exemplo n.º 5
0
        public string AddSafe(string name)
        {
            String safe = StarNames.SafeName(name);

            Add(safe, name);
            return(safe);
        }
Exemplo n.º 6
0
        public ReligionParser BranchReligion(string religion, ProvinceParser capital = null)
        {
            var rel   = this.ReligionMap[religion];
            var group = rel.Group;

            if (rel.Group.Religions.Count > 3 && Rand.Next(2) == 0)
            {
                String name = StarNames.Generate(capital.Title.culture);
                String safe = StarNames.SafeName(name);
                LanguageManager.instance.Add(safe, name);
                group = AddReligionGroup(safe);
                var rel2 = group.AddReligion(StarNames.Generate(capital.Title.culture));
                rel2.RandomReligionProperties();
                //rel2.Init(Rand.Next(255), Rand.Next(255), Rand.Next(255));
                rel2.CreateRandomReligion(group);
                return(rel2);
            }
            else
            {
                var rel2 = group.AddReligion(StarNames.Generate(capital.Title.culture));
                //rel2.Init(Rand.Next(255), Rand.Next(255), Rand.Next(255));
                rel2.RandomReligionProperties();
                rel2.CreateRandomReligion(group);
                rel2.Mutate(rel, capital.Title.Culture, 6);
                return(rel2);
            }
        }
Exemplo n.º 7
0
        public ReligionParser AddReligion(String name, String orig = null)
        {
            if (name != "pagan")
            {
                String oname = name;
                name = StarNames.SafeName(name);
                LanguageManager.instance.Add(name, oname);
                orig = oname;
            }



            ScriptScope scope = new ScriptScope();

            scope.Name = name;
            Scope.Add(scope);
            ReligionParser r = new ReligionParser(scope);

            ReligionManager.instance.AllReligions.Add(r);
            if (orig != null)
            {
                r.LanguageName = orig;
            }
            Religions.Add(r);
            ReligionManager.instance.ReligionMap[name] = r;
            return(r);
        }
Exemplo n.º 8
0
        public CultureParser AddCulture(String name)
        {
            if (name != "norse")
            {
                String oname = name;
                name = StarNames.SafeName(name);

                LanguageManager.instance.Add(name, oname);
            }


            ScriptScope scope = new ScriptScope();

            scope.Name = name;
            Name       = name;

            Scope.Add(scope);
            CultureParser r = new CultureParser(scope);

            CultureManager.instance.AllCultures.Add(r);
            Cultures.Add(r);
            CultureManager.instance.CultureMap[name] = r;
            r.Name = Name;
            r.Init();

            Scope.SetChild(r.Scope);
            return(r);
        }
Exemplo n.º 9
0
        public ReligionParser BranchReligion(string religion, String culture)
        {
            var rel      = ReligionMap[religion];
            var group    = rel.Group;
            int totCount = 0;

            foreach (var religionParser in rel.Group.Religions)
            {
                totCount += religionParser.Provinces.Count;
            }

            if (CultureManager.instance.allowMultiCultureGroups)
            {
                var rell = StarNames.Generate(culture);

                while (instance.ReligionMap.ContainsKey(StarNames.SafeName(rell)))
                {
                    rell = StarNames.Generate(culture);
                }

                var rel2 = group.AddReligion(rell);

                rel2.CreateNewReligion();

                rel2.Mutate(rel, CultureManager.instance.CultureMap[culture], 6);

                return(rel2);
            }

            else
            {
                String name = StarNames.Generate(culture);
                String safe = StarNames.SafeName(name);

                while (instance.GroupMap.ContainsKey(safe))
                {
                    name = StarNames.Generate(culture);
                    safe = StarNames.Generate(culture);
                }

                LanguageManager.instance.Add(safe, name);

                group = AddReligionGroup(safe);

                name = StarNames.Generate(culture);

                while (instance.ReligionMap.ContainsKey(safe))
                {
                    name = StarNames.Generate(culture);
                    safe = StarNames.SafeName(name);
                }

                var rel2 = group.AddReligion(name);

                rel2.CreateNewReligion();

                return(rel2);
            }
        }
Exemplo n.º 10
0
        public void Rename(string name)
        {
            String oldName = Name;

            Name = "c_" + StarNames.SafeName(name);
            LanguageManager.instance.Add(Name, name);
            LanguageManager.instance.Add("PROV" + id, name);
            MapManager.instance.ProvinceMap.Remove(oldName);
            MapManager.instance.ProvinceMap[Name] = this;
        }
Exemplo n.º 11
0
        public string GetUniqueMaleName()
        {
            var name = ConstructWord(3 * wordLengthBias, 8 * wordLengthBias);

            name = stripVowelsFromEnd(name);
            if (LanguageManager.instance.Get(StarNames.SafeName(name)) != null)
            {
                return(GetUniqueMaleName());
            }
            return(name);
        }
Exemplo n.º 12
0
        public String Add(String key, String english)
        {
            if (english == null || english.Length == 1)
            {
                english = StarNames.Generate(Rand.Next(45645546));
            }

            this.english[key]           = english;
            this.english[key + "_adj"]  = english;
            this.english[key + "_desc"] = english;
            return(english);
        }
Exemplo n.º 13
0
        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);
        }
Exemplo n.º 14
0
        public CultureParser BranchCulture(string Culture)
        {
            var rel = CultureMap[Culture];

            var group = rel.Group;

            var cultureName = rel.dna.GetPlaceName();

            while (GroupMap.ContainsKey(StarNames.SafeName(cultureName)))
            {
                cultureName = rel.dna.GetPlaceName();
            }

            CultureParser rel2 = null;

            if (allowMultiCultureGroups)
            {
                rel2 = group.AddCulture(cultureName);
                rel2.Init();
                rel2.dna = rel.dna.MutateSmall(4);
            }

            else
            {
                // need to make a new group for the culture

                var newGroupName = rel.dna.GetPlaceName();

                while (GroupMap.ContainsKey(StarNames.SafeName(newGroupName)))
                {
                    newGroupName = rel.dna.GetPlaceName();
                }

                LanguageManager.instance.Add(StarNames.SafeName(newGroupName), newGroupName);

                var newCultureGroup = AddCultureGroup(StarNames.SafeName(newGroupName), group);

                newCultureGroup.Name = StarNames.SafeName(newGroupName);
                rel2 = newCultureGroup.AddCulture(cultureName);
                newCultureGroup.AddCulture(rel2);

                rel2.Init();
                rel2.dna = rel.dna.Mutate(16, rel);
                rel2.dna.DoRandom();

                CultureGroupMap[newCultureGroup.Name] = newCultureGroup;
            }

            rel2.DoDetailsForCulture();

            return(rel2);
        }
Exemplo n.º 15
0
        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);
        }
Exemplo n.º 16
0
        public void CreateMercs()
        {
            // do mercs...
            foreach (var cultureParser in CultureManager.instance.AllCultures)
            {
                String name     = "";
                String namesafe = null;

                do
                {
                    name     = cultureParser.dna.GetMaleName();
                    namesafe = "d_" + StarNames.SafeName(name);
                } while (TitleMap.ContainsKey(namesafe) || LanguageManager.instance.Get(namesafe) != "");

                LanguageManager.instance.Add(namesafe, name);
                String composition = compositions[Rand.Next(compositions.Length)];
                LandedTitlesScript.Root.Do(@"

                    " + namesafe + @" = {

	                    color = { 135 170 60 }
	                    color2 = { 255 255 255 }

	                    capital = "     + MapManager.instance.GetInhabited().id + @" 
	
	                    # Parent Religion 
	                    culture =  "     + cultureParser.Name + @" 
	
	                    mercenary = yes

	                    title = ""CAPTAIN""
	                    foa = ""CAPTAIN_FOA""

	                    # Always exists
	                    landless = yes
	
	                    # Cannot be held as a secondary title
	                    primary = yes
	
	                    # Cannot be vassalized
	                    independent = yes
	
	                    strength_growth_per_century = 1.00
	
	                    mercenary_type = "     + composition + @"
                    }


                ");
            }
        }
Exemplo n.º 17
0
        public void RenameForCulture(CultureParser culture)
        {
            LanguageManager.instance.Remove(Name);

            String namem = null;

            do
            {
                var name = culture.dna.GetPlaceName();
                namem = name;
            } while (MapManager.instance.ProvinceMap.ContainsKey(StarNames.SafeName(namem)));

            Rename(namem);
        }
Exemplo n.º 18
0
        public void Rename(String name)
        {
            String oldName = Name;

            LanguageManager.instance.Remove(Name);
            this.Name = StarNames.SafeName(name);
            if (Rank == 0)
            {
                Name = "b_" + Name;
            }
            if (Rank == 1)
            {
                Name = "c_" + Name;
            }
            if (Rank == 2)
            {
                Name = "d_" + Name;
            }
            if (Rank == 3)
            {
                Name = "k_" + Name;
            }
            if (Rank == 4)
            {
                Name = "e_" + Name;
            }

            LanguageManager.instance.Add(Name, name);
            TitleManager.instance.TitleMap.Remove(oldName);
            TitleManager.instance.TitleMap[name] = this;
            if (TitleManager.instance.TieredTitles.ContainsKey(oldName))
            {
                TitleManager.instance.TieredTitles.Remove(oldName);
                TitleManager.instance.TieredTitles[name] = this;

                if (Liege != null)
                {
                    Liege.SubTitles.Remove(oldName);
                    Liege.SubTitles[name] = this;
                }
            }

            Scope.Parent.ChildrenMap.Remove(oldName);
            Scope.Parent.ChildrenMap[name] = this;
        }
Exemplo n.º 19
0
        public CultureParser BranchCulture(string Culture)
        {
            var rel   = this.CultureMap[Culture];
            var group = rel.Group;

            var naa = rel.dna.GetPlaceName();

            while (GroupMap.ContainsKey(StarNames.SafeName(naa)))
            {
                naa = rel.dna.GetPlaceName();
            }

            CultureParser rel2 = null;

            if (!allowMultiCultureGroups)
            {
                var na = rel.dna.GetPlaceName();
                while (GroupMap.ContainsKey(StarNames.SafeName(na)))
                {
                    na = rel.dna.GetPlaceName();
                }

                LanguageManager.instance.Add(StarNames.SafeName(na), na);

                var group2 = AddCultureGroup(StarNames.SafeName(na), group);
                group2.Name = StarNames.SafeName(na);
                rel2        = group2.AddCulture(naa);
                group2.AddCulture(rel2);

                rel2.Init();
                rel2.dna = rel.dna.Mutate(16, rel);
                rel2.dna.DoRandom();
                CultureGroupMap[group2.Name] = group2;
            }
            else
            {
                rel2 = group.AddCulture(naa);
                rel2.Init();
                rel2.dna = rel.dna.MutateSmall(4);
            }

            rel2.DoDetailsForCulture();

            return(rel2);
        }
Exemplo n.º 20
0
        public void RenameForCulture(CultureParser culture)
        {
            LanguageManager.instance.Remove(Name);
            var name = culture.dna.GetPlaceName();

            if (MapManager.instance.ProvinceMap.ContainsKey("c_" + StarNames.SafeName(name)))
            {
                RenameForCulture(culture);
                return;
            }

            if (Title != null)
            {
                Title.Rename(name);
            }

            Rename(name);
        }
Exemplo n.º 21
0
        public ReligionParser AddReligion(String name, String orig = null)
        {
            if (name != "urtru")
            {
                String oname = name;
                name = StarNames.SafeName(name);

                LanguageManager.instance.Add(name, oname);
                orig = oname;
            }

            ScriptScope scope = new ScriptScope
            {
                Name = name
            };

            Scope.Add(scope);

            ReligionParser r = new ReligionParser(scope);

            ReligionManager.instance.AllReligions.Add(r);

            if (orig != null)
            {
                r.LanguageName = orig;
            }

            r.Name  = r.Scope.Name;
            r.Group = this;

            var col = Col();

            r.r = col.R;
            r.g = col.G;
            r.b = col.B;

            Religions.Add(r);
            ReligionManager.instance.ReligionMap[name] = r;

            Console.Out.WriteLine(r.Name + " added");

            return(r);
        }
Exemplo n.º 22
0
        public void Rename(string name)
        {
            if (StarNames.SafeName(name) == "selj")
            {
            }
            String oldName = Name;

            Name = StarNames.SafeName(name);
            LanguageManager.instance.Remove(Name);
            LanguageManager.instance.Add(StarNames.SafeName(name), name);
            LanguageManager.instance.Add("c_" + StarNames.SafeName(name), name);
            LanguageManager.instance.Add("PROV" + id, name);
            MapManager.instance.ProvinceMap.Remove(oldName);
            MapManager.instance.ProvinceMap[Name] = this;

            if (Title != null)
            {
                Title.Rename(name, true);
            }
        }
Exemplo n.º 23
0
        public void Init()
        {
            LanguageManager.instance.Add("urtru", StarNames.Generate(Rand.Next(1000000)));

            Script s = new Script();

            script = s;
            s.Name = Globals.ModDir + "common\\religions\\00_religions.txt";
            s.Root = new ScriptScope();

            ReligionGroupParser r = AddReligionGroup("urtru");

            r.Init();

            var firstReligion = r.AddReligion("urtru");

            firstReligion.CreateNewReligion();

            AllReligionGroups.Add(r);
        }
Exemplo n.º 24
0
        public Government CreateNewGovernment(CultureParser culture)
        {
            Government g = new Government();

            g.type = "tribal";
            Government r = g.Mutate(8);

            r.name = culture.dna.GetMaleName();
            string s = r.name;

            r.name = StarNames.SafeName(r.name) + "_government";
            LanguageManager.instance.Add(r.name, s);
            culture.Governments.Add(r);
            r.SetType(r.type);
            if (!r.cultureAllow.Contains(culture.Name))
            {
                r.cultureAllow.Add(culture.Name);   //    governments.Add(r);
            }
            return(r);
        }
Exemplo n.º 25
0
        public void Init()
        {
            LanguageManager.instance.Add("norse", StarNames.Generate(Rand.Next(1000000)));
            LanguageManager.instance.Add("pagan", StarNames.Generate(Rand.Next(1000000)));
            LanguageManager.instance.Add("christian", StarNames.Generate(Rand.Next(1000000)));

            Script s = new Script();

            script = s;
            s.Name = Globals.ModDir + "common\\religions\\00_religions.txt";
            s.Root = new ScriptScope();
            ReligionGroupParser r = AddReligionGroup("pagan");

            r.Init();
            var pagan = r.AddReligion("pagan");

            pagan.CreateRandomReligion(null);

            AllReligionGroups.Add(r);
        }
Exemplo n.º 26
0
        public void CreateSocietyForReligion(ReligionParser r, string c, ScriptScope scope, Template template)
        {
            var lang = StarNames.Generate(c);

            switch (Rand.Next(5))
            {
            case 0:
                lang = "The " + lang + " Order";
                break;

            case 1:
                lang = "Children of " + lang;
                break;

            case 2:
                lang = "Way of " + lang;
                break;

            case 3:
                lang = "Society of " + lang;
                break;

            case 4:
                lang = "Sons of " + lang;
                break;
            }

            var         name       = lang.AddSafe();
            ScriptScope newSociety = new ScriptScope(name);
            var         temp       = Societies[template.ToString()];

            Societies[name] = newSociety;
            contextName     = name;
            contextReligion = r;

            CreateAssassinTemplate(Scripts[0].Root, ScripterTriggerManager.instance.script.Root, name, r);

            (Scripts[0].Root.Children[Scripts[0].Root.Children.Count - 1] as ScriptScope).Tag1 = r;

            //   newSociety.FillFrom(temp, new ScriptScope.CopyDelegate(SocietyModify));
        }
Exemplo n.º 27
0
        public void AddRegion(String name, List <TitleParser> duchies)
        {
            String safeName = StarNames.SafeName(name);

            LanguageManager.instance.Add(safeName, name);
            Region r = new Region();

            for (int index = 0; index < duchies.Count; index++)
            {
                var titleParser = duchies[index];
                if (duchiesAssigned.Contains(titleParser))
                {
                    duchies.Remove(titleParser);
                    index--;
                }
            }
            r.name = name;
            r.duchies.AddRange(duchies);
            duchiesAssigned.AddRange(duchies);
            regions.Add(r);
        }
Exemplo n.º 28
0
        public CultureParser BranchCulture(string Culture)
        {
            var rel   = this.CultureMap[Culture];
            var group = rel.Group;

            var rel2 = group.AddCulture(rel.dna.GetPlaceName());

            if (Rand.Next(10) == 0 || rel.Group.Cultures.Count > 5)
            {
                var group2 = AddCultureGroup(StarNames.SafeName(rel.dna.GetPlaceName()), group);
                group2.AddCulture(rel2);
                rel2.Init();
                rel2.dna = rel.dna.Mutate(6);
                rel2.dna.DoRandom();
            }
            else
            {
                rel2.Init();
                rel2.dna = rel.dna.MutateSmall(5);
            }

            rel2.DoDetailsForCulture();
            return(rel2);
        }
Exemplo n.º 29
0
        public CultureParser AddCulture(String name)
        {
            string langName = "";

            if (name != "norse")
            {
                String oname = name;
                name = StarNames.SafeName(name);

                LanguageManager.instance.Add(name, oname);
                langName = oname;
            }


            ScriptScope scope = new ScriptScope();

            scope.Name = name;

            Scope.Add(scope);
            CultureParser r = new CultureParser(scope, this);

            CultureManager.instance.AllCultures.Add(r);
            r.LanguageName = langName;
            Cultures.Add(r);
            CultureManager.instance.CultureMap[name] = r;
            r.Name = name;
            r.Init();
            r.group = this;
            var col = Col();

            r.r = col.R;
            r.g = col.G;
            r.b = col.B;
            Scope.SetChild(r.Scope);
            return(r);
        }
Exemplo n.º 30
0
        public String GetPlaceName()
        {
            if (Rand.Next(3) != 0)
            {
                return(ConstructWord(5, 8));
            }
            if (WordFormats.Count == 0)
            {
                for (int n = 0; n < 1; n++)
                {
                    WordFormats.Add(CommonWordFormats[Rand.Next(CommonWordFormats.Count)]);
                }
            }
            if (wordsForLand.Count == 0)
            {
                string s = ConstructWord(2 * wordLengthBias, 4 * wordLengthBias);
                wordsForLand.Add(s);
            }

            if (placeFormat == null)
            {
                placeFormat = placeFormatOptions[Rand.Next(placeFormatOptions.Count())];
            }

            string format = this.WordFormats[Rand.Next(WordFormats.Count)];

            int nWords = 1;

            if (Rand.Next(3) == 0)
            {
                nWords++;
            }

            if (Rand.Next(3) == 0)
            {
                nWords++;
            }
            if (Rand.Next(3) != 0)
            {
                format = "{0}";
                nWords = 1;
            }

            int index = 0;

            if (nWords == 1)
            {
                index  = format.IndexOf("{0}") + 3;
                format = format.Substring(0, index);
            }
            if (nWords == 2)
            {
                index  = format.IndexOf("{1}") + 3;
                format = format.Substring(0, index);
            }
            String[] strs = new String[nWords];
            for (int n = 0; n < nWords; n++)
            {
                if (nWords == 1)
                {
                    strs[n] = ConstructWord(5 * wordLengthBias, 8 * wordLengthBias);
                }
                else if (nWords == 2)
                {
                    strs[n] = ConstructWord(3 * wordLengthBias, 5 * wordLengthBias);
                }
                else if (nWords == 3)
                {
                    strs[n] = ConstructWord(3 * wordLengthBias, 4 * wordLengthBias);
                }
            }
            if (nWords == 1)
            {
                var s = Capitalize(String.Format(format, strs[0]));
                if (LanguageManager.instance.Get(StarNames.SafeName(s)) != null)
                {
                    return(GetPlaceName());
                }
                return(s);
            }
            else if (nWords == 2)
            {
                var s = Capitalize(String.Format(format, strs[0], strs[1]));
                if (LanguageManager.instance.Get(StarNames.SafeName(s)) != null)
                {
                    return(GetPlaceName());
                }
                return(s);
            }
            else
            {
                var s = Capitalize(String.Format(format, strs[0], strs[1], strs[2]));
                if (LanguageManager.instance.Get(StarNames.SafeName(s)) != null)
                {
                    return(GetPlaceName());
                }
                return(s);
            }
        }