예제 #1
0
        private static string name(bool male)
        {
            string str = "";

            switch (Session.Random.Next(8))
            {
            case 0:
            {
                str = string.Concat(DwarfName.prefix(), (male ? DwarfName.suffix_male() : DwarfName.suffix_female()));
                break;
            }

            case 1:
            case 2:
            case 3:
            case 4:
            {
                string[] strArrays = new string[] { DwarfName.prefix(), null, null, null, null };
                strArrays[1] = (male ? DwarfName.suffix_male() : DwarfName.suffix_female());
                strArrays[2] = " ";
                strArrays[3] = DwarfName.thing(true);
                strArrays[4] = DwarfName.thing(false);
                str          = string.Concat(strArrays);
                break;
            }

            case 5:
            case 6:
            {
                string[] strArrays1 = new string[] { DwarfName.prefix(), null, null, null, null };
                strArrays1[1] = (male ? DwarfName.suffix_male() : DwarfName.suffix_female());
                strArrays1[2] = " ";
                strArrays1[3] = DwarfName.prefix();
                strArrays1[4] = (male ? DwarfName.suffix_male() : DwarfName.suffix_female());
                str           = string.Concat(strArrays1);
                break;
            }

            case 7:
            {
                string[] strArrays2 = new string[] { DwarfName.prefix(), null, null, null, null, null, null, null, null, null };
                strArrays2[1] = (male ? DwarfName.suffix_male() : DwarfName.suffix_female());
                strArrays2[2] = " ";
                strArrays2[3] = DwarfName.prefix();
                strArrays2[4] = (male ? DwarfName.suffix_male() : DwarfName.suffix_female());
                strArrays2[5] = " '";
                strArrays2[6] = DwarfName.thing(true);
                strArrays2[7] = "-";
                strArrays2[8] = DwarfName.thing(false);
                strArrays2[9] = "'";
                str           = string.Concat(strArrays2);
                break;
            }
            }
            return(TextHelper.Capitalise(str, true));
        }
예제 #2
0
        public static string Sentence()
        {
            string str = "";
            int    num = Session.Dice(4, 8);

            for (int i = 0; i != num; i++)
            {
                string lower = "";
                int    num1  = 0;
                switch (Session.Random.Next(4))
                {
                case 0:
                {
                    num1 = 1;
                    break;
                }

                case 1:
                case 2:
                {
                    num1 = 2;
                    break;
                }

                case 3:
                {
                    num1 = 3;
                    break;
                }
                }
                for (int j = 0; j != num1; j++)
                {
                    switch (Session.Random.Next(2))
                    {
                    case 0:
                    {
                        lower = string.Concat(lower, DwarfName.prefix());
                        break;
                    }

                    case 1:
                    {
                        lower = string.Concat(lower, DwarfName.suffix_male());
                        break;
                    }
                    }
                    if (j != num1 && Session.Random.Next(10) == 0)
                    {
                        List <string> strs = new List <string>()
                        {
                            "k",
                            "z",
                            "g",
                            "-",
                            "'"
                        };
                        int num2 = Session.Random.Next(strs.Count);
                        lower = string.Concat(lower, strs[num2]);
                    }
                }
                lower = lower.ToLower();
                if (str != "")
                {
                    str = string.Concat(str, " ");
                    if (Session.Random.Next(20) == 0)
                    {
                        lower = TextHelper.Capitalise(lower, false);
                    }
                }
                else
                {
                    lower = TextHelper.Capitalise(lower, false);
                }
                str = string.Concat(str, lower);
            }
            str = string.Concat(str, ".");
            return(str);
        }
예제 #3
0
 public static string MaleName()
 {
     return(DwarfName.name(true));
 }
예제 #4
0
 public static string FemaleName()
 {
     return(DwarfName.name(false));
 }