コード例 #1
0
        private void LoadFrontCardStats(PlayerObj player)
        {
            m_frontTrait1.Visible = false;
            m_frontTrait2.Visible = false;
            var b = (byte)Game.PlayerStats.Traits.X;

            if (b != 0)
            {
                m_frontTrait1.Text    = TraitType.ToString(b) + ": " + TraitType.ProfileCardDescription(b);
                m_frontTrait1.Visible = true;
            }
            var b2 = (byte)Game.PlayerStats.Traits.Y;

            if (b2 != 0)
            {
                m_frontTrait2.Y = m_frontTrait1.Y;
                if (b != 0)
                {
                    m_frontTrait2.Y -= 20f;
                }
                m_frontTrait2.Text    = TraitType.ToString(b2) + ": " + TraitType.ProfileCardDescription(b2);
                m_frontTrait2.Visible = true;
            }
            m_playerName.Text  = Game.PlayerStats.PlayerName;
            m_playerStats.Text = (int)(player.Damage / 20f) + "/" + (int)(player.MaxHealth / 50f);
            m_levelClass.Text  = string.Concat("Lv. ", Game.PlayerStats.CurrentLevel, " - ",
                                               ClassType.ToString(Game.PlayerStats.Class, Game.PlayerStats.IsFemale));
            m_money.Text            = Game.PlayerStats.Gold.ToString();
            m_classDescription.Text = ClassType.ProfileCardDescription(Game.PlayerStats.Class);
        }
コード例 #2
0
        public void SetTraits(Vector2 traits)
        {
            Traits = traits;
            var text = "";

            if (Traits.X != 0f)
            {
                text += TraitType.ToString((byte)Traits.X);
            }
            else
            {
                m_trait1Title.Text = "";
            }
            if (Traits.Y != 0f)
            {
                text = text + ", " + TraitType.ToString((byte)Traits.Y);
            }
            m_trait1Title.Text = text;
        }
コード例 #3
0
        private void UpdateDescriptionPlate()
        {
            var lineageObj = m_currentBranchArray[m_selectedLineageIndex];
            var textObj    = m_descriptionPlate.GetChildAt(1) as TextObj;

            textObj.Text = lineageObj.PlayerName;
            var textObj2 = m_descriptionPlate.GetChildAt(2) as TextObj;

            textObj2.Text = "Class - " + ClassType.ToString(lineageObj.Class, lineageObj.IsFemale);
            var keyIconTextObj = m_descriptionPlate.GetChildAt(3) as KeyIconTextObj;

            keyIconTextObj.Text = ClassType.Description(lineageObj.Class);
            keyIconTextObj.WordWrap(340);
            var textObj3 = m_descriptionPlate.GetChildAt(4) as TextObj;

            textObj3.Y = keyIconTextObj.Y + keyIconTextObj.Height + 5f;
            var textObj4 = m_descriptionPlate.GetChildAt(5) as TextObj;

            textObj4.Y = textObj3.Y + 30f;
            var num = (int)textObj3.Y;

            if (lineageObj.Traits.X > 0f)
            {
                textObj3.Text = "Trait - " + TraitType.ToString((byte)lineageObj.Traits.X);
                textObj4.Text = TraitType.Description((byte)lineageObj.Traits.X, lineageObj.IsFemale);
                textObj4.WordWrap(340);
                num = (int)textObj4.Y + textObj4.Height + 5;
            }
            else
            {
                num           = (int)textObj3.Y + textObj3.Height + 5;
                textObj3.Text = "Traits - None";
                textObj4.Text = "";
            }
            var textObj5 = m_descriptionPlate.GetChildAt(6) as TextObj;

            textObj5.Y = textObj4.Y + textObj4.Height + 5f;
            var textObj6 = m_descriptionPlate.GetChildAt(7) as TextObj;

            textObj6.Y = textObj5.Y + 30f;
            if (lineageObj.Traits.Y > 0f)
            {
                textObj5.Text = "Trait - " + TraitType.ToString((byte)lineageObj.Traits.Y);
                textObj6.Text = TraitType.Description((byte)lineageObj.Traits.Y, lineageObj.IsFemale);
                textObj6.WordWrap(340);
                num = (int)textObj6.Y + textObj6.Height + 5;
            }
            else
            {
                textObj5.Text = "";
                textObj6.Text = "";
            }
            var textObj7 = m_descriptionPlate.GetChildAt(8) as TextObj;

            textObj7.Text = "Spell - " + SpellType.ToString(lineageObj.Spell);
            textObj7.Y    = num;
            var keyIconTextObj2 = m_descriptionPlate.GetChildAt(9) as KeyIconTextObj;

            keyIconTextObj2.Text = SpellType.Description(lineageObj.Spell);
            keyIconTextObj2.Y    = textObj7.Y + 30f;
            keyIconTextObj2.WordWrap(340);
        }
コード例 #4
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();
            }
        }