Ejemplo n.º 1
0
 private void UpdateEquipmentDataText()
 {
     m_equipmentTitleText.Text = EquipmentAbilityType.ToString(m_currentEquipmentIndex) + " Rune\n(" +
                                 EquipmentCategoryType.ToString2(m_currentCategoryIndex - 6) + ")";
     m_descriptionText.Text = EquipmentAbilityType.Description(m_currentEquipmentIndex);
     m_descriptionText.WordWrap(195);
     m_descriptionText.Y = m_equipmentTitleText.Y + 60f;
     m_instructionsTitleText.Position = new Vector2(m_enchantressUI.X + 140f,
                                                    m_descriptionText.Bounds.Bottom + 20);
     m_instructionsText.Text = EquipmentAbilityType.Instructions(m_currentEquipmentIndex);
     m_instructionsText.WordWrap(200);
     m_instructionsText.Position = new Vector2(m_instructionsTitleText.X, m_instructionsTitleText.Bounds.Bottom);
 }
Ejemplo n.º 2
0
        public void UpdateDescriptionPlate(SkillObj trait)
        {
            var text = trait.IconName;

            text = text.Replace("Locked", "");
            text = text.Replace("Max", "");
            m_skillIcon.ChangeSprite(text);
            m_skillTitle.Text       = trait.Name;
            m_skillDescription.Text = trait.Description;
            m_skillDescription.WordWrap(280);
            m_inputDescription.Text = trait.InputDescription;
            m_inputDescription.WordWrap(280);
            m_inputDescription.Y = m_skillDescription.Bounds.Bottom + 10;
            var num = TraitStatType.GetTraitStat(trait.TraitType);

            if (num > -1f)
            {
                if (num < 1f)
                {
                    num *= 100f;
                    num  = (int)Math.Round(num, MidpointRounding.AwayFromZero);
                }
                if (num == 0f)
                {
                    num = trait.ModifierAmount;
                    if (trait.TraitType == SkillType.Crit_Chance_Up)
                    {
                        num *= 100f;
                        num  = (int)Math.Round(num, MidpointRounding.AwayFromZero);
                    }
                }
                m_skillCurrent.Text = "Current: " + num + trait.UnitOfMeasurement;
                if (trait.CurrentLevel < trait.MaxLevel)
                {
                    var num2 = trait.PerLevelModifier;
                    if (num2 < 1f && trait.TraitType != SkillType.Invuln_Time_Up)
                    {
                        num2 *= 100f;
                        if (trait.TraitType != SkillType.Death_Dodge)
                        {
                            num2 = (int)Math.Round(num2, MidpointRounding.AwayFromZero);
                        }
                    }
                    m_skillUpgrade.Text = "Upgrade: +" + num2 + trait.UnitOfMeasurement;
                }
                else
                {
                    m_skillUpgrade.Text = "Upgrade: --";
                }
                m_skillLevel.Text = string.Concat("Level: ", trait.CurrentLevel, "/", trait.MaxLevel);
                var arg = "unlock";
                if (trait.CurrentLevel > 0)
                {
                    arg = "upgrade";
                }
                m_skillCost.Text = trait.TotalCost + " gold to " + arg;
                if (m_inputDescription.Text != " " && m_inputDescription.Text != "")
                {
                    m_skillCurrent.Y = m_inputDescription.Bounds.Bottom + 40;
                }
                else
                {
                    m_skillCurrent.Y = m_skillDescription.Bounds.Bottom + 40;
                }
                m_skillUpgrade.Y             = m_skillCurrent.Y + 30f;
                m_skillLevel.Y               = m_skillUpgrade.Y + 30f;
                m_descriptionDivider.Visible = true;
            }
            else
            {
                m_skillCurrent.Text          = "";
                m_skillUpgrade.Text          = "";
                m_skillLevel.Text            = "";
                m_descriptionDivider.Visible = false;
                var arg2 = "unlock";
                if (trait.CurrentLevel > 0)
                {
                    arg2 = "upgrade";
                }
                m_skillCost.Text = trait.TotalCost + " gold to " + arg2;
            }
            m_descriptionDivider.Position = new Vector2(m_skillCurrent.AbsX, m_skillCurrent.AbsY - 20f);
            if (trait.CurrentLevel >= trait.MaxLevel)
            {
                m_skillCost.Visible   = false;
                m_skillCostBG.Visible = false;
            }
            else
            {
                m_skillCost.Visible   = true;
                m_skillCostBG.Visible = true;
            }
            m_playerMoney.Text = Game.PlayerStats.Gold.ToString();
        }
Ejemplo n.º 3
0
        public override void LoadContent()
        {
            m_impactEffectPool.Initialize();
            m_manor           = new ObjContainer("TraitsCastle_Character");
            m_manor.Scale     = new Vector2(2f, 2f);
            m_manor.ForceDraw = true;
            for (var i = 0; i < m_manor.NumChildren; i++)
            {
                m_manor.GetChildAt(i).Visible = false;
                m_manor.GetChildAt(i).Opacity = 0f;
            }
            m_dialoguePlate           = new ObjContainer("TraitsScreenPlate_Container");
            m_dialoguePlate.ForceDraw = true;
            m_dialoguePlate.Position  = new Vector2(1320 - m_dialoguePlate.Width / 2, 360f);
            m_skillIcon          = new SpriteObj("Icon_Health_Up_Sprite");
            m_skillIcon.Position = new Vector2(-110f, -200f);
            m_dialoguePlate.AddChild(m_skillIcon);
            m_skillTitle              = new TextObj(Game.JunicodeFont);
            m_skillTitle.Text         = "Skill name";
            m_skillTitle.DropShadow   = new Vector2(2f, 2f);
            m_skillTitle.TextureColor = new Color(236, 197, 132);
            m_skillTitle.Position     = new Vector2(m_skillIcon.Bounds.Right + 15, m_skillIcon.Y);
            m_skillTitle.FontSize     = 12f;
            m_dialoguePlate.AddChild(m_skillTitle);
            m_skillDescription          = new TextObj(Game.JunicodeFont);
            m_skillDescription.Text     = "Description text goes here.  Let's see how well the word wrap function works.";
            m_skillDescription.Position = new Vector2(m_dialoguePlate.GetChildAt(1).X - 30f,
                                                      m_dialoguePlate.GetChildAt(1).Bounds.Bottom + 20);
            m_skillDescription.FontSize     = 10f;
            m_skillDescription.DropShadow   = new Vector2(2f, 2f);
            m_skillDescription.TextureColor = new Color(228, 218, 208);
            m_skillDescription.WordWrap(m_dialoguePlate.Width - 50);
            m_dialoguePlate.AddChild(m_skillDescription);
            m_inputDescription              = new KeyIconTextObj(Game.JunicodeFont);
            m_inputDescription.Text         = "Input descriptions go here..";
            m_inputDescription.Position     = new Vector2(m_skillIcon.X - 30f, m_skillDescription.Bounds.Bottom + 20);
            m_inputDescription.FontSize     = 10f;
            m_inputDescription.DropShadow   = new Vector2(2f, 2f);
            m_inputDescription.TextureColor = new Color(228, 218, 208);
            m_inputDescription.WordWrap(m_dialoguePlate.Width - 50);
            m_dialoguePlate.AddChild(m_inputDescription);
            m_descriptionDivider            = new SpriteObj("Blank_Sprite");
            m_descriptionDivider.ScaleX     = 250f / m_descriptionDivider.Width;
            m_descriptionDivider.ScaleY     = 0.25f;
            m_descriptionDivider.ForceDraw  = true;
            m_descriptionDivider.DropShadow = new Vector2(2f, 2f);
            m_skillCurrent              = new TextObj(Game.JunicodeFont);
            m_skillCurrent.Position     = new Vector2(m_inputDescription.X, m_inputDescription.Bounds.Bottom + 10);
            m_skillCurrent.FontSize     = 10f;
            m_skillCurrent.DropShadow   = new Vector2(2f, 2f);
            m_skillCurrent.TextureColor = new Color(228, 218, 208);
            m_skillCurrent.WordWrap(m_dialoguePlate.Width - 50);
            m_dialoguePlate.AddChild(m_skillCurrent);
            m_skillUpgrade    = (m_skillCurrent.Clone() as TextObj);
            m_skillUpgrade.Y += 15f;
            m_dialoguePlate.AddChild(m_skillUpgrade);
            m_skillLevel    = (m_skillUpgrade.Clone() as TextObj);
            m_skillLevel.Y += 15f;
            m_dialoguePlate.AddChild(m_skillLevel);
            m_skillCost              = new TextObj(Game.JunicodeFont);
            m_skillCost.X            = m_skillIcon.X;
            m_skillCost.Y            = 182f;
            m_skillCost.FontSize     = 10f;
            m_skillCost.DropShadow   = new Vector2(2f, 2f);
            m_skillCost.TextureColor = Color.Yellow;
            m_dialoguePlate.AddChild(m_skillCost);
            m_skillCostBG          = new SpriteObj("SkillTreeGoldIcon_Sprite");
            m_skillCostBG.Position = new Vector2(-180f, 180f);
            m_dialoguePlate.AddChild(m_skillCostBG);
            m_dialoguePlate.ForceDraw = true;
            m_bg           = new SpriteObj("TraitsBG_Sprite");
            m_bg.Scale     = new Vector2(1320f / m_bg.Width, 1320f / m_bg.Width);
            m_bg.ForceDraw = true;
            m_cloud1       = new SpriteObj("TraitsCloud1_Sprite")
            {
                ForceDraw = true
            };
            m_cloud2 = new SpriteObj("TraitsCloud2_Sprite")
            {
                ForceDraw = true
            };
            m_cloud3 = new SpriteObj("TraitsCloud3_Sprite")
            {
                ForceDraw = true
            };
            m_cloud4 = new SpriteObj("TraitsCloud4_Sprite")
            {
                ForceDraw = true
            };
            m_cloud5 = new SpriteObj("TraitsCloud5_Sprite")
            {
                ForceDraw = true
            };
            var opacity = 1f;

            m_cloud1.Opacity               = opacity;
            m_cloud2.Opacity               = opacity;
            m_cloud3.Opacity               = opacity;
            m_cloud4.Opacity               = opacity;
            m_cloud5.Opacity               = opacity;
            m_cloud1.Position              = new Vector2(CDGMath.RandomInt(0, 1520), CDGMath.RandomInt(0, 360));
            m_cloud2.Position              = new Vector2(CDGMath.RandomInt(0, 1520), CDGMath.RandomInt(0, 360));
            m_cloud3.Position              = new Vector2(CDGMath.RandomInt(0, 1520), CDGMath.RandomInt(0, 360));
            m_cloud4.Position              = new Vector2(CDGMath.RandomInt(0, 1520), CDGMath.RandomInt(0, 360));
            m_cloud5.Position              = new Vector2(CDGMath.RandomInt(0, 1520), CDGMath.RandomInt(0, 360));
            m_selectionIcon                = new SpriteObj("IconHalo_Sprite");
            m_selectionIcon.ForceDraw      = true;
            m_selectionIcon.AnimationDelay = 0.1f;
            m_selectionIcon.PlayAnimation();
            m_selectionIcon.Scale        = new Vector2(1.1f, 1.1f);
            m_titleText                  = new SpriteObj("ManorTitleText_Sprite");
            m_titleText.X                = m_titleText.Width / 2f + 20f;
            m_titleText.Y                = 64.8f;
            m_titleText.ForceDraw        = true;
            m_continueText               = new KeyIconTextObj(Game.JunicodeFont);
            m_continueText.ForceDraw     = true;
            m_continueText.FontSize      = 12f;
            m_continueText.DropShadow    = new Vector2(2f, 2f);
            m_continueText.Position      = new Vector2(1300f, 630f);
            m_continueText.Align         = Types.TextAlign.Right;
            m_toggleIconsText            = new KeyIconTextObj(Game.JunicodeFont);
            m_toggleIconsText.ForceDraw  = true;
            m_toggleIconsText.FontSize   = 12f;
            m_toggleIconsText.DropShadow = new Vector2(2f, 2f);
            m_toggleIconsText.Position   = new Vector2(m_continueText.X, m_continueText.Y + 40f);
            m_toggleIconsText.Align      = Types.TextAlign.Right;
            m_confirmText                = new KeyIconTextObj(Game.JunicodeFont);
            m_confirmText.Align          = Types.TextAlign.Right;
            m_confirmText.FontSize       = 12f;
            m_confirmText.DropShadow     = new Vector2(2f, 2f);
            m_confirmText.Position       = new Vector2(1300f, 10f);
            m_confirmText.ForceDraw      = true;
            m_navigationText             = new KeyIconTextObj(Game.JunicodeFont);
            m_navigationText.Align       = Types.TextAlign.Right;
            m_navigationText.FontSize    = 12f;
            m_navigationText.DropShadow  = new Vector2(2f, 2f);
            m_navigationText.Position    = new Vector2(m_confirmText.X, m_confirmText.Y + 40f);
            m_navigationText.ForceDraw   = true;
            m_coinIcon              = new SpriteObj("CoinIcon_Sprite");
            m_coinIcon.Position     = new Vector2(1100f, 585f);
            m_coinIcon.Scale        = new Vector2(0.9f, 0.9f);
            m_coinIcon.ForceDraw    = true;
            m_playerMoney           = new TextObj(Game.GoldFont);
            m_playerMoney.Align     = Types.TextAlign.Left;
            m_playerMoney.Text      = "1000";
            m_playerMoney.FontSize  = 30f;
            m_playerMoney.Position  = new Vector2(m_coinIcon.X + 35f, m_coinIcon.Y);
            m_playerMoney.ForceDraw = true;
            base.LoadContent();
        }