Example #1
0
 public override void LoadContent()
 {
     m_frontCard           = new ObjContainer("CardFront_Character");
     m_frontCard.ForceDraw = true;
     m_frontCard.Position  = new Vector2(145f, 30f);
     m_frontCard.GetChildAt(0).TextureColor = Color.Red;
     m_frontCard.GetChildAt(2).TextureColor = Color.Red;
     LoadFrontCard();
     m_backCard           = new ObjContainer("CardBack_Character");
     m_backCard.ForceDraw = true;
     m_backCard.Position  = new Vector2(m_frontCard.X + m_backCard.Width + 100f, m_frontCard.Y);
     m_backCard.AddChild(m_playerName.Clone() as GameObj);
     m_backCard.GetChildAt(0).TextureColor = Color.Red;
     m_backCard.GetChildAt(2).TextureColor = Color.Red;
     LoadBackCard();
     m_playerSprite                 = new ObjContainer("PlayerIdle_Character");
     m_playerSprite.ForceDraw       = true;
     m_playerSprite.Scale           = new Vector2(2f, 2f);
     m_playerSprite.OutlineWidth    = 2;
     m_tombStoneSprite              = new SpriteObj("Tombstone_Sprite");
     m_tombStoneSprite.ForceDraw    = true;
     m_tombStoneSprite.Scale        = new Vector2(3f, 3f);
     m_tombStoneSprite.OutlineWidth = 2;
     m_spellIcon              = new SpriteObj(SpellType.Icon(12));
     m_spellIcon.Position     = new Vector2(350f, 295f);
     m_spellIcon.OutlineWidth = 2;
     m_spellIcon.ForceDraw    = true;
     m_cancelText             = new KeyIconTextObj(Game.JunicodeFont);
     m_cancelText.Text        = "to exit options";
     m_cancelText.Align       = Types.TextAlign.Right;
     m_cancelText.DropShadow  = new Vector2(2f, 2f);
     m_cancelText.FontSize    = 12f;
     m_cancelText.Position    = new Vector2(1290f, 650f);
     m_cancelText.ForceDraw   = true;
     base.LoadContent();
 }
Example #2
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);
        }
Example #3
0
        public override void OnEnter()
        {
            m_tripStat1.Visible = false;
            m_tripStat2.Visible = false;
            m_tripStat1.Scale   = Vector2.One;
            m_tripStat2.Scale   = Vector2.One;
            if (m_itemType != 7)
            {
                (ScreenManager.Game as Game).SaveManager.SaveFiles(SaveType.PlayerData, SaveType.UpgradeData);
            }
            m_itemSprite.Rotation         = 0f;
            m_itemSprite.Scale            = Vector2.One;
            m_itemStartPos.X              = m_itemStartPos.X - Camera.TopLeftCorner.X;
            m_itemStartPos.Y              = m_itemStartPos.Y - Camera.TopLeftCorner.Y;
            m_storedMusicVolume           = SoundManager.GlobalMusicVolume;
            m_songName                    = SoundManager.GetCurrentMusicName();
            m_lockControls                = true;
            m_continueText.Opacity        = 0f;
            m_continueText.Text           = "[Input:" + 0 + "]  to continue";
            m_itemFoundText.Position      = m_itemEndPos;
            m_itemFoundText.Y            += 70f;
            m_itemFoundText.Scale         = Vector2.Zero;
            m_tripStat1FoundText.Position = m_itemFoundText.Position;
            m_tripStat2FoundText.Position = m_itemFoundText.Position;
            m_tripStat1FoundText.Scale    = Vector2.Zero;
            m_tripStat2FoundText.Scale    = Vector2.Zero;
            m_tripStat1FoundText.Visible  = false;
            m_tripStat2FoundText.Visible  = false;
            switch (m_itemType)
            {
            case 1:
                m_itemSpinning = true;
                m_itemSprite.ChangeSprite("BlueprintIcon_Sprite");
                m_itemFoundSprite.ChangeSprite("BlueprintFoundText_Sprite");
                m_itemFoundText.Text = EquipmentBaseType.ToString((int)m_itemInfo.Y) + " " +
                                       EquipmentCategoryType.ToString2((int)m_itemInfo.X);
                break;

            case 2:
                m_itemSpinning = true;
                m_itemSprite.ChangeSprite("RuneIcon_Sprite");
                m_itemFoundSprite.ChangeSprite("RuneFoundText_Sprite");
                m_itemFoundText.Text = EquipmentAbilityType.ToString((int)m_itemInfo.Y) + " Rune (" +
                                       EquipmentCategoryType.ToString2((int)m_itemInfo.X) + ")";
                m_itemSprite.AnimationDelay = 0.05f;
                GameUtil.UnlockAchievement("LOVE_OF_MAGIC");
                break;

            case 3:
            case 6:
                m_itemSprite.ChangeSprite(GetStatSpriteName((int)m_itemInfo.X));
                m_itemFoundText.Text        = GetStatText((int)m_itemInfo.X);
                m_itemSprite.AnimationDelay = 0.05f;
                m_itemFoundSprite.ChangeSprite("StatFoundText_Sprite");
                if (m_itemType == 6)
                {
                    m_tripStat1FoundText.Visible = true;
                    m_tripStat2FoundText.Visible = true;
                    m_tripStat1.ChangeSprite(GetStatSpriteName((int)m_tripStatData.X));
                    m_tripStat2.ChangeSprite(GetStatSpriteName((int)m_tripStatData.Y));
                    m_tripStat1.Visible        = true;
                    m_tripStat2.Visible        = true;
                    m_tripStat1.AnimationDelay = 0.05f;
                    m_tripStat2.AnimationDelay = 0.05f;
                    Tween.RunFunction(0.1f, m_tripStat1, "PlayAnimation", true);
                    Tween.RunFunction(0.2f, m_tripStat2, "PlayAnimation", true);
                    m_tripStat1FoundText.Text = GetStatText((int)m_tripStatData.X);
                    m_tripStat2FoundText.Text = GetStatText((int)m_tripStatData.Y);
                    m_itemFoundText.Y        += 50f;
                    m_tripStat1FoundText.Y    = m_itemFoundText.Y + 50f;
                }
                break;

            case 4:
                m_itemSprite.ChangeSprite(SpellType.Icon((byte)m_itemInfo.X));
                m_itemFoundSprite.ChangeSprite("SpellFoundText_Sprite");
                m_itemFoundText.Text = SpellType.ToString((byte)m_itemInfo.X);
                break;

            case 5:
                m_itemSprite.ChangeSprite(SpecialItemType.SpriteName((byte)m_itemInfo.X));
                m_itemFoundSprite.ChangeSprite("ItemFoundText_Sprite");
                m_itemFoundText.Text = SpecialItemType.ToString((byte)m_itemInfo.X);
                break;

            case 7:
                m_itemSprite.ChangeSprite(GetMedallionImage((int)m_itemInfo.X));
                m_itemFoundSprite.ChangeSprite("ItemFoundText_Sprite");
                if (m_itemInfo.X == 19f)
                {
                    m_itemFoundText.Text = "Medallion completed!";
                }
                else
                {
                    m_itemFoundText.Text = "You've collected a medallion piece!";
                }
                break;
            }
            m_itemSprite.PlayAnimation();
            ItemSpinAnimation();
            base.OnEnter();
        }
Example #4
0
 public void UpdateData()
 {
     SetTraits(Traits);
     if (Traits.X == 8f || Traits.Y == 8f)
     {
         m_playerSprite.GetChildAt(7).Visible = false;
     }
     if (Traits.X == 20f || Traits.Y == 20f)
     {
         FlipPortrait = true;
     }
     m_classTextObj.Text = "the " + ClassType.ToString(Class, IsFemale);
     m_spellIcon.ChangeSprite(SpellType.Icon(Spell));
     if (Class == 0 || Class == 8)
     {
         m_playerSprite.GetChildAt(15).Visible = true;
         m_playerSprite.GetChildAt(15).ChangeSprite("PlayerIdleShield_Sprite");
     }
     else if (Class == 5 || Class == 13)
     {
         m_playerSprite.GetChildAt(15).Visible = true;
         m_playerSprite.GetChildAt(15).ChangeSprite("PlayerIdleLamp_Sprite");
     }
     else if (Class == 1 || Class == 9)
     {
         m_playerSprite.GetChildAt(15).Visible = true;
         m_playerSprite.GetChildAt(15).ChangeSprite("PlayerIdleBeard_Sprite");
     }
     else if (Class == 4 || Class == 12)
     {
         m_playerSprite.GetChildAt(15).Visible = true;
         m_playerSprite.GetChildAt(15).ChangeSprite("PlayerIdleHeadband_Sprite");
     }
     else if (Class == 2 || Class == 10)
     {
         m_playerSprite.GetChildAt(15).Visible = true;
         m_playerSprite.GetChildAt(15).ChangeSprite("PlayerIdleHorns_Sprite");
     }
     else
     {
         m_playerSprite.GetChildAt(15).Visible = false;
     }
     m_playerSprite.GetChildAt(0).Visible = false;
     if (Class == 16)
     {
         m_playerSprite.GetChildAt(0).Visible = true;
         m_playerSprite.GetChildAt(12).ChangeSprite("PlayerIdleHead" + 6 + "_Sprite");
     }
     if (Class == 17)
     {
         m_playerSprite.GetChildAt(12).ChangeSprite("PlayerIdleHead" + 7 + "_Sprite");
     }
     if (!IsFemale)
     {
         m_playerSprite.GetChildAt(5).Visible  = false;
         m_playerSprite.GetChildAt(13).Visible = false;
     }
     else
     {
         m_playerSprite.GetChildAt(5).Visible  = true;
         m_playerSprite.GetChildAt(13).Visible = true;
     }
     if (Traits.X == 6f || Traits.Y == 6f)
     {
         m_playerSprite.Scale = new Vector2(3f, 3f);
     }
     if (Traits.X == 7f || Traits.Y == 7f)
     {
         m_playerSprite.Scale = new Vector2(1.35f, 1.35f);
     }
     if (Traits.X == 10f || Traits.Y == 10f)
     {
         m_playerSprite.ScaleX *= 0.825f;
         m_playerSprite.ScaleY *= 1.25f;
     }
     if (Traits.X == 9f || Traits.Y == 9f)
     {
         m_playerSprite.ScaleX *= 1.25f;
         m_playerSprite.ScaleY *= 1.175f;
     }
     if (Class == 6 || Class == 14)
     {
         m_playerSprite.OutlineColour = Color.White;
         return;
     }
     m_playerSprite.OutlineColour = Color.Black;
 }
Example #5
0
        public PlayerHUDObj() : base("PlayerHUDLvlText_Sprite")
        {
            ForceDraw              = true;
            m_playerLevelText      = new TextObj();
            m_playerLevelText.Text = Game.PlayerStats.CurrentLevel.ToString();
            m_playerLevelText.Font = Game.PlayerLevelFont;
            m_coin                 = new SpriteObj("PlayerUICoin_Sprite");
            m_coin.ForceDraw       = true;
            m_goldText             = new TextObj();
            m_goldText.Text        = "0";
            m_goldText.Font        = Game.GoldFont;
            m_goldText.FontSize    = 25f;
            m_hpBar                = new SpriteObj("HPBar_Sprite");
            m_hpBar.ForceDraw      = true;
            m_mpBar                = new SpriteObj("MPBar_Sprite");
            m_mpBar.ForceDraw      = true;
            m_hpText               = new TextObj(Game.JunicodeFont);
            m_hpText.FontSize      = 7f;
            m_hpText.DropShadow    = new Vector2(1f, 1f);
            m_hpText.ForceDraw     = true;
            m_mpText               = new TextObj(Game.JunicodeFont);
            m_mpText.FontSize      = 7f;
            m_mpText.DropShadow    = new Vector2(1f, 1f);
            m_mpText.ForceDraw     = true;
            m_abilitiesSpriteArray = new SpriteObj[5];
            var position = new Vector2(130f, 690f);
            var num      = 35;

            for (var i = 0; i < m_abilitiesSpriteArray.Length; i++)
            {
                m_abilitiesSpriteArray[i]           = new SpriteObj("Blank_Sprite");
                m_abilitiesSpriteArray[i].ForceDraw = true;
                m_abilitiesSpriteArray[i].Position  = position;
                m_abilitiesSpriteArray[i].Scale     = new Vector2(0.5f, 0.5f);
                position.X += num;
            }
            m_hpBarContainer               = new ObjContainer("PlayerHUDHPBar_Character");
            m_hpBarContainer.ForceDraw     = true;
            m_mpBarContainer               = new ObjContainer("PlayerHUDMPBar_Character");
            m_mpBarContainer.ForceDraw     = true;
            m_specialItemIcon              = new SpriteObj("Blank_Sprite");
            m_specialItemIcon.ForceDraw    = true;
            m_specialItemIcon.OutlineWidth = 1;
            m_specialItemIcon.Scale        = new Vector2(1.7f, 1.7f);
            m_specialItemIcon.Visible      = false;
            m_spellIcon              = new SpriteObj(SpellType.Icon(0));
            m_spellIcon.ForceDraw    = true;
            m_spellIcon.OutlineWidth = 1;
            m_spellIcon.Visible      = false;
            m_iconHolder1            = new SpriteObj("BlacksmithUI_IconBG_Sprite");
            m_iconHolder1.ForceDraw  = true;
            m_iconHolder1.Opacity    = 0.5f;
            m_iconHolder1.Scale      = new Vector2(0.8f, 0.8f);
            m_iconHolder2            = (m_iconHolder1.Clone() as SpriteObj);
            m_spellCost              = new TextObj(Game.JunicodeFont);
            m_spellCost.Align        = Types.TextAlign.Centre;
            m_spellCost.ForceDraw    = true;
            m_spellCost.OutlineWidth = 2;
            m_spellCost.FontSize     = 8f;
            m_spellCost.Visible      = false;
            UpdateSpecialItemIcon();
            UpdateSpellIcon();
        }