Beispiel #1
0
        private void UpdateEquipmentDataText()
        {
            (m_textInfoStatContainer.GetChildAt(0) as TextObj).Text = Player.MaxHealth.ToString();
            (m_textInfoStatContainer.GetChildAt(1) as TextObj).Text = Player.MaxMana.ToString();
            (m_textInfoStatContainer.GetChildAt(2) as TextObj).Text = Player.Damage.ToString();
            (m_textInfoStatContainer.GetChildAt(3) as TextObj).Text = Player.TotalMagicDamage.ToString();
            (m_textInfoStatContainer.GetChildAt(4) as TextObj).Text = Player.TotalArmor.ToString();
            (m_textInfoStatContainer.GetChildAt(5) as TextObj).Text = Player.CurrentWeight + "/" +
                                                                      Player.MaxWeight;
            var num            = m_currentCategoryIndex - 6;
            var equipmentData  = Game.EquipmentSystem.GetEquipmentData(num, m_currentEquipmentIndex);
            int num2           = Game.PlayerStats.GetEquippedArray[num];
            var equipmentData2 = new EquipmentData();

            if (num2 > -1)
            {
                equipmentData2 = Game.EquipmentSystem.GetEquipmentData(num, num2);
            }
            var flag = Game.PlayerStats.GetEquippedArray[CurrentCategoryIndex] == m_currentEquipmentIndex;
            var num3 = equipmentData.BonusHealth - equipmentData2.BonusHealth;

            if (flag)
            {
                num3 = -equipmentData.BonusHealth;
            }
            var textObj = m_textInfoStatModContainer.GetChildAt(0) as TextObj;

            if (num3 > 0)
            {
                textObj.TextureColor = Color.Cyan;
                textObj.Text         = "+" + num3;
            }
            else if (num3 < 0)
            {
                textObj.TextureColor = Color.Red;
                textObj.Text         = num3.ToString();
            }
            else
            {
                textObj.Text = "";
            }
            var textObj2 = m_textInfoStatModContainer.GetChildAt(1) as TextObj;
            var num4     = equipmentData.BonusMana - equipmentData2.BonusMana;

            if (flag)
            {
                num4 = -equipmentData.BonusMana;
            }
            if (num4 > 0)
            {
                textObj2.TextureColor = Color.Cyan;
                textObj2.Text         = "+" + num4;
            }
            else if (num4 < 0)
            {
                textObj2.TextureColor = Color.Red;
                textObj2.Text         = num4.ToString();
            }
            else
            {
                textObj2.Text = "";
            }
            var textObj3 = m_textInfoStatModContainer.GetChildAt(2) as TextObj;
            var num5     = equipmentData.BonusDamage - equipmentData2.BonusDamage;

            if (flag)
            {
                num5 = -equipmentData.BonusDamage;
            }
            if (num5 > 0)
            {
                textObj3.TextureColor = Color.Cyan;
                textObj3.Text         = "+" + num5;
            }
            else if (num5 < 0)
            {
                textObj3.TextureColor = Color.Red;
                textObj3.Text         = num5.ToString();
            }
            else
            {
                textObj3.Text = "";
            }
            var textObj4 = m_textInfoStatModContainer.GetChildAt(3) as TextObj;
            var num6     = equipmentData.BonusMagic - equipmentData2.BonusMagic;

            if (flag)
            {
                num6 = -equipmentData.BonusMagic;
            }
            if (num6 > 0)
            {
                textObj4.TextureColor = Color.Cyan;
                textObj4.Text         = "+" + num6;
            }
            else if (num6 < 0)
            {
                textObj4.TextureColor = Color.Red;
                textObj4.Text         = num6.ToString();
            }
            else
            {
                textObj4.Text = "";
            }
            var textObj5 = m_textInfoStatModContainer.GetChildAt(4) as TextObj;
            var num7     = equipmentData.BonusArmor - equipmentData2.BonusArmor;

            if (flag)
            {
                num7 = -equipmentData.BonusArmor;
            }
            if (num7 > 0)
            {
                textObj5.TextureColor = Color.Cyan;
                textObj5.Text         = "+" + num7;
            }
            else if (num7 < 0)
            {
                textObj5.TextureColor = Color.Red;
                textObj5.Text         = num7.ToString();
            }
            else
            {
                textObj5.Text = "";
            }
            var textObj6 = m_textInfoStatModContainer.GetChildAt(5) as TextObj;
            var num8     = equipmentData.Weight - equipmentData2.Weight;

            if (flag)
            {
                num8 = -equipmentData.Weight;
            }
            if (num8 > 0)
            {
                textObj6.TextureColor = Color.Red;
                textObj6.Text         = "+" + num8;
            }
            else if (num8 < 0)
            {
                textObj6.TextureColor = Color.Cyan;
                textObj6.Text         = num8.ToString();
            }
            else
            {
                textObj6.Text = "";
            }
            var secondaryAttribute = equipmentData.SecondaryAttribute;

            m_addPropertiesText.Text = "";
            if (secondaryAttribute != null)
            {
                var array = secondaryAttribute;
                for (var i = 0; i < array.Length; i++)
                {
                    var vector = array[i];
                    if (vector.X != 0f)
                    {
                        if (vector.X < 7f)
                        {
                            var expr_4FE = m_addPropertiesText;
                            var text     = expr_4FE.Text;
                            expr_4FE.Text = string.Concat(text, "+", (vector.Y * 100f).ToString(), "% ",
                                                          EquipmentSecondaryDataType.ToString((int)vector.X), "\n");
                        }
                        else
                        {
                            var expr_56E = m_addPropertiesText;
                            var text2    = expr_56E.Text;
                            var array2   = new string[6];
                            array2[0] = text2;
                            array2[1] = "+";
                            var arg_5A0_0 = array2;
                            var arg_5A0_1 = 2;
                            var y         = vector.Y;
                            arg_5A0_0[arg_5A0_1] = y.ToString();
                            array2[3]            = " ";
                            array2[4]            = EquipmentSecondaryDataType.ToString((int)vector.X);
                            array2[5]            = "\n";
                            expr_56E.Text        = string.Concat(array2);
                        }
                    }
                }
                if (secondaryAttribute.Length == 0)
                {
                    m_addPropertiesText.Text = "None";
                }
            }
            else
            {
                m_addPropertiesText.Text = "None";
            }
            m_equipmentTitleText.Text = EquipmentBaseType.ToString(m_currentEquipmentIndex) + " " +
                                        EquipmentCategoryType.ToString(num);
        }
Beispiel #2
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();
        }
Beispiel #3
0
        private void LoadBackCardStats(PlayerObj player)
        {
            for (var i = 0; i < m_dataList1.Count; i++)
            {
                switch (i)
                {
                case 0:
                    m_dataList1[i].Text = player.MaxHealth.ToString();
                    m_dataList2[i].Text = player.Damage.ToString();
                    break;

                case 1:
                    m_dataList1[i].Text = player.MaxMana.ToString();
                    m_dataList2[i].Text = player.TotalMagicDamage.ToString();
                    break;

                case 2:
                {
                    m_dataList1[i].Text = string.Concat(player.TotalArmor.ToString(), "(",
                                                        (int)(player.TotalDamageReduc * 100f), "%)");
                    var num = player.TotalCritChance * 100f;
                    m_dataList2[i].Text = ((int)Math.Round(num, MidpointRounding.AwayFromZero)) + "%";
                    break;
                }

                case 3:
                    m_dataList1[i].Text = player.CurrentWeight + "/" + player.MaxWeight;
                    m_dataList2[i].Text = ((int)(player.TotalCriticalDamage * 100f)) + "%";
                    break;
                }
            }
            var getEquippedArray = Game.PlayerStats.GetEquippedArray;
            var num2             = (int)m_equipmentTitle.Y + 40;

            for (var j = 0; j < Game.PlayerStats.GetEquippedArray.Length; j++)
            {
                m_equipmentList[j].Visible = false;
                m_equipmentList[j].Y       = num2;
                if (getEquippedArray[j] != -1)
                {
                    m_equipmentList[j].Text = EquipmentBaseType.ToString(getEquippedArray[j]) + " " +
                                              EquipmentCategoryType.ToString2(j);
                    m_equipmentList[j].Visible = true;
                    num2 += 20;
                }
            }
            num2 = (int)m_runesTitle.Y + 40;
            for (var k = 0; k < m_runeBackTitleList.Count; k++)
            {
                m_runeBackTitleList[k].Y             = num2;
                m_runeBackDescriptionList[k].Y       = num2;
                m_runeBackTitleList[k].Visible       = false;
                m_runeBackDescriptionList[k].Visible = false;
                var num3 = 0f;
                switch (k)
                {
                case 0:
                    num3 = player.TotalDoubleJumps;
                    break;

                case 1:
                    num3 = player.TotalAirDashes;
                    break;

                case 2:
                    num3 = player.TotalVampBonus;
                    break;

                case 3:
                    num3 = player.TotalFlightTime;
                    break;

                case 4:
                    num3 = player.ManaGain;
                    break;

                case 5:
                    num3 = player.TotalDamageReturn * 100f;
                    break;

                case 6:
                    num3 = player.TotalGoldBonus * 100f;
                    break;

                case 7:
                    num3 = player.TotalMovementSpeedPercent * 100f - 100f;
                    break;

                case 8:
                    num3 = Game.PlayerStats.GetNumberOfEquippedRunes(8) * 8;
                    break;

                case 9:
                    num3 = Game.PlayerStats.GetNumberOfEquippedRunes(9) * 0.75f;
                    break;
                }
                if (num3 > 0f)
                {
                    m_runeBackDescriptionList[k].Text    = "(" + EquipmentAbilityType.ShortDescription(k, num3) + ")";
                    m_runeBackTitleList[k].Visible       = true;
                    m_runeBackDescriptionList[k].Visible = true;
                    num2 += 20;
                }
            }
            if (Game.PlayerStats.HasArchitectFee)
            {
                m_runeBackDescriptionList[m_runeBackDescriptionList.Count - 2].Text = "(" +
                                                                                      EquipmentAbilityType
                                                                                      .ShortDescription(20, 0f) +
                                                                                      ")";
                m_runeBackDescriptionList[m_runeBackDescriptionList.Count - 2].Visible = true;
                m_runeBackTitleList[m_runeBackDescriptionList.Count - 2].Visible       = true;
                num2 += 20;
            }
            if (Game.PlayerStats.TimesCastleBeaten > 0)
            {
                m_runeBackDescriptionList[m_runeBackDescriptionList.Count - 1].Text = "(" +
                                                                                      EquipmentAbilityType
                                                                                      .ShortDescription(21,
                                                                                                        50 *
                                                                                                        Game.PlayerStats
                                                                                                        .TimesCastleBeaten) +
                                                                                      ")";
                m_runeBackDescriptionList[m_runeBackDescriptionList.Count - 1].Visible = true;
                m_runeBackTitleList[m_runeBackDescriptionList.Count - 1].Visible       = true;
                if (Game.PlayerStats.HasArchitectFee)
                {
                    m_runeBackDescriptionList[m_runeBackDescriptionList.Count - 1].Y = num2;
                    m_runeBackTitleList[m_runeBackDescriptionList.Count - 1].Y       = num2;
                }
            }
            (m_backCard.GetChildAt(3) as TextObj).Text = Game.PlayerStats.PlayerName;
        }