Example #1
0
        private void CreateFemaleName(LineageScreen screen)
        {
            var text = Game.FemaleNameArray[CDGMath.RandomInt(0, Game.FemaleNameArray.Count - 1)];

            if (screen != null)
            {
                var num = 0;
                while (screen.CurrentBranchNameCopyFound(text))
                {
                    text = Game.FemaleNameArray[CDGMath.RandomInt(0, Game.FemaleNameArray.Count - 1)];
                    num++;
                    if (num > 20)
                    {
                        break;
                    }
                }
            }
            if (text != null)
            {
                if (text.Length > 10)
                {
                    text = text.Substring(0, 9) + ".";
                }
                var num2  = 0;
                var text2 = "";
                if (screen != null)
                {
                    num2 = screen.NameCopies(text);
                }
                if (num2 > 0)
                {
                    text2 = CDGMath.ToRoman(num2 + 1);
                }
                m_playerName.Text = "Lady " + text;
                if (text2 != "")
                {
                    var expr_BD = m_playerName;
                    expr_BD.Text = expr_BD.Text + " " + text2;
                }
            }
            else
            {
                m_playerName.Text = "Lady Heroine";
            }
        }
Example #2
0
        public LineageObj(LineageScreen screen, bool createEmpty = false)
        {
            Name                                      = "";
            m_frameSprite                             = new SpriteObj("LineageScreenFrame_Sprite");
            m_frameSprite.Scale                       = new Vector2(2.8f, 2.8f);
            m_frameSprite.DropShadow                  = new Vector2(4f, 6f);
            m_plaqueSprite                            = new SpriteObj("LineageScreenPlaque1Long_Sprite");
            m_plaqueSprite.Scale                      = new Vector2(1.8f, 2f);
            m_playerSprite                            = new ObjContainer("PlayerIdle_Character");
            m_playerSprite.AnimationDelay             = 0.1f;
            m_playerSprite.Scale                      = new Vector2(2f, 2f);
            m_playerSprite.OutlineWidth               = 2;
            m_playerSprite.GetChildAt(10).Visible     = false;
            m_playerSprite.GetChildAt(11).Visible     = false;
            m_playerSprite.GetChildAt(1).TextureColor = Color.Red;
            m_playerSprite.GetChildAt(7).TextureColor = Color.Red;
            m_playerSprite.GetChildAt(14).Visible     = false;
            m_playerSprite.GetChildAt(16).Visible     = false;
            var textureColor = new Color(251, 156, 172);

            m_playerSprite.GetChildAt(13).TextureColor = textureColor;
            m_playerName               = new TextObj(Game.JunicodeFont);
            m_playerName.FontSize      = 10f;
            m_playerName.Text          = "Sir Skunky IV";
            m_playerName.Align         = Types.TextAlign.Centre;
            m_playerName.OutlineColour = new Color(181, 142, 39);
            m_playerName.OutlineWidth  = 2;
            m_playerName.Y             = m_textYPos;
            m_playerName.LimitCorners  = true;
            AddChild(m_playerName);
            m_classTextObj               = new TextObj(Game.JunicodeFont);
            m_classTextObj.FontSize      = 8f;
            m_classTextObj.Align         = Types.TextAlign.Centre;
            m_classTextObj.OutlineColour = new Color(181, 142, 39);
            m_classTextObj.OutlineWidth  = 2;
            m_classTextObj.Text          = "the Knight";
            m_classTextObj.Y             = m_playerName.Y + m_playerName.Height - 8f;
            m_classTextObj.LimitCorners  = true;
            AddChild(m_classTextObj);
            m_trait1Title               = new TextObj(Game.JunicodeFont);
            m_trait1Title.FontSize      = 8f;
            m_trait1Title.Align         = Types.TextAlign.Centre;
            m_trait1Title.OutlineColour = new Color(181, 142, 39);
            m_trait1Title.OutlineWidth  = 2;
            m_trait1Title.Y             = m_classTextObj.Y + m_classTextObj.Height + 5f;
            m_trait1Title.Text          = "";
            m_trait1Title.LimitCorners  = true;
            AddChild(m_trait1Title);
            m_trait2Title              = (m_trait1Title.Clone() as TextObj);
            m_trait2Title.Y           += 20f;
            m_trait2Title.Text         = "";
            m_trait2Title.LimitCorners = true;
            AddChild(m_trait2Title);
            m_ageText              = (m_trait1Title.Clone() as TextObj);
            m_ageText.Text         = "xxx - xxx";
            m_ageText.Visible      = false;
            m_ageText.LimitCorners = true;
            AddChild(m_ageText);
            m_spellIcon = new SpriteObj("Blank_Sprite");
            m_spellIcon.OutlineWidth = 1;
            m_spellIconHolder        = new SpriteObj("BlacksmithUI_IconBG_Sprite");
            if (!createEmpty)
            {
                IsFemale = false;
                if (CDGMath.RandomInt(0, 1) > 0)
                {
                    IsFemale = true;
                }
                if (IsFemale)
                {
                    CreateFemaleName(screen);
                }
                else
                {
                    CreateMaleName(screen);
                }
                Traits = TraitType.CreateRandomTraits();
                Class  = ClassType.GetRandomClass();
                m_classTextObj.Text = "the " + ClassType.ToString(Class, IsFemale);
                while (Class == 7 || Class == 15)
                {
                    if (Traits.X != 12f && Traits.Y != 12f)
                    {
                        break;
                    }
                    Traits = TraitType.CreateRandomTraits();
                }
                while ((Class == 1 || Class == 9 || Class == 16) && (Traits.X == 31f || Traits.Y == 31f))
                {
                    Traits = TraitType.CreateRandomTraits();
                }
                var spellList = ClassType.GetSpellList(Class);
                do
                {
                    Spell = spellList[CDGMath.RandomInt(0, spellList.Length - 1)];
                } while ((Spell == 11 || Spell == 4 || Spell == 6) && (Traits.X == 31f || Traits.Y == 31f));
                Array.Clear(spellList, 0, spellList.Length);
                Age      = (byte)CDGMath.RandomInt(18, 30);
                ChildAge = (byte)CDGMath.RandomInt(2, 5);
                UpdateData();
            }
        }
Example #3
0
 private void CreateMaleName(LineageScreen screen)
 {
     string text = Game.NameArray[CDGMath.RandomInt(0, Game.NameArray.Count - 1)];
     if (screen != null)
     {
         int num = 0;
         while (screen.CurrentBranchNameCopyFound(text))
         {
             text = Game.NameArray[CDGMath.RandomInt(0, Game.NameArray.Count - 1)];
             num++;
             if (num > 20)
             {
                 break;
             }
         }
     }
     if (text != null)
     {
         if (text.Length > 10)
         {
             text = text.Substring(0, 9) + ".";
         }
         int num2 = 0;
         string text2 = "";
         if (screen != null)
         {
             num2 = screen.NameCopies(text);
         }
         if (num2 > 0)
         {
             text2 = CDGMath.ToRoman(num2 + 1);
         }
         this.m_playerName.Text = "Sir " + text;
         if (text2 != "")
         {
             TextObj expr_BD = this.m_playerName;
             expr_BD.Text = expr_BD.Text + " " + text2;
             return;
         }
     }
     else
     {
         this.m_playerName.Text = "Sir Hero";
     }
 }
Example #4
0
 public LineageObj(LineageScreen screen, bool createEmpty = false)
 {
     base.Name = "";
     this.m_frameSprite = new SpriteObj("LineageScreenFrame_Sprite");
     this.m_frameSprite.Scale = new Vector2(2.8f, 2.8f);
     this.m_frameSprite.DropShadow = new Vector2(4f, 6f);
     this.m_plaqueSprite = new SpriteObj("LineageScreenPlaque1Long_Sprite");
     this.m_plaqueSprite.Scale = new Vector2(1.8f, 2f);
     this.m_playerSprite = new ObjContainer("PlayerIdle_Character");
     this.m_playerSprite.AnimationDelay = 0.1f;
     this.m_playerSprite.Scale = new Vector2(2f, 2f);
     this.m_playerSprite.OutlineWidth = 2;
     this.m_playerSprite.GetChildAt(10).Visible = false;
     this.m_playerSprite.GetChildAt(11).Visible = false;
     this.m_playerSprite.GetChildAt(1).TextureColor = Color.Red;
     this.m_playerSprite.GetChildAt(7).TextureColor = Color.Red;
     this.m_playerSprite.GetChildAt(14).Visible = false;
     this.m_playerSprite.GetChildAt(16).Visible = false;
     Color textureColor = new Color(251, 156, 172);
     this.m_playerSprite.GetChildAt(13).TextureColor = textureColor;
     this.m_playerName = new TextObj(Game.JunicodeFont);
     this.m_playerName.FontSize = 10f;
     this.m_playerName.Text = "Sir Skunky IV";
     this.m_playerName.Align = Types.TextAlign.Centre;
     this.m_playerName.OutlineColour = new Color(181, 142, 39);
     this.m_playerName.OutlineWidth = 2;
     this.m_playerName.Y = (float)this.m_textYPos;
     this.m_playerName.LimitCorners = true;
     this.AddChild(this.m_playerName);
     this.m_classTextObj = new TextObj(Game.JunicodeFont);
     this.m_classTextObj.FontSize = 8f;
     this.m_classTextObj.Align = Types.TextAlign.Centre;
     this.m_classTextObj.OutlineColour = new Color(181, 142, 39);
     this.m_classTextObj.OutlineWidth = 2;
     this.m_classTextObj.Text = "the Knight";
     this.m_classTextObj.Y = this.m_playerName.Y + (float)this.m_playerName.Height - 8f;
     this.m_classTextObj.LimitCorners = true;
     this.AddChild(this.m_classTextObj);
     this.m_trait1Title = new TextObj(Game.JunicodeFont);
     this.m_trait1Title.FontSize = 8f;
     this.m_trait1Title.Align = Types.TextAlign.Centre;
     this.m_trait1Title.OutlineColour = new Color(181, 142, 39);
     this.m_trait1Title.OutlineWidth = 2;
     this.m_trait1Title.Y = this.m_classTextObj.Y + (float)this.m_classTextObj.Height + 5f;
     this.m_trait1Title.Text = "";
     this.m_trait1Title.LimitCorners = true;
     this.AddChild(this.m_trait1Title);
     this.m_trait2Title = (this.m_trait1Title.Clone() as TextObj);
     this.m_trait2Title.Y += 20f;
     this.m_trait2Title.Text = "";
     this.m_trait2Title.LimitCorners = true;
     this.AddChild(this.m_trait2Title);
     this.m_ageText = (this.m_trait1Title.Clone() as TextObj);
     this.m_ageText.Text = "xxx - xxx";
     this.m_ageText.Visible = false;
     this.m_ageText.LimitCorners = true;
     this.AddChild(this.m_ageText);
     this.m_spellIcon = new SpriteObj("Blank_Sprite");
     this.m_spellIcon.OutlineWidth = 1;
     this.m_spellIconHolder = new SpriteObj("BlacksmithUI_IconBG_Sprite");
     if (!createEmpty)
     {
         this.IsFemale = false;
         if (CDGMath.RandomInt(0, 1) > 0)
         {
             this.IsFemale = true;
         }
         if (this.IsFemale)
         {
             this.CreateFemaleName(screen);
         }
         else
         {
             this.CreateMaleName(screen);
         }
         this.Traits = TraitType.CreateRandomTraits();
         this.Class = ClassType.GetRandomClass();
         this.m_classTextObj.Text = "the " + ClassType.ToString(this.Class, this.IsFemale);
         while (this.Class == 7 || this.Class == 15)
         {
             if (this.Traits.X != 12f && this.Traits.Y != 12f)
             {
                 break;
             }
             this.Traits = TraitType.CreateRandomTraits();
         }
         while ((this.Class == 1 || this.Class == 9 || this.Class == 16) && (this.Traits.X == 31f || this.Traits.Y == 31f))
         {
             this.Traits = TraitType.CreateRandomTraits();
         }
         byte[] spellList = ClassType.GetSpellList(this.Class);
         do
         {
             this.Spell = spellList[CDGMath.RandomInt(0, spellList.Length - 1)];
         }
         while ((this.Spell == 11 || this.Spell == 4 || this.Spell == 6) && (this.Traits.X == 31f || this.Traits.Y == 31f));
         Array.Clear(spellList, 0, spellList.Length);
         this.Age = (byte)CDGMath.RandomInt(18, 30);
         this.ChildAge = (byte)CDGMath.RandomInt(2, 5);
         this.UpdateData();
     }
 }