コード例 #1
0
        public void CalcBoost()
        {
            CheckSetTypeSkin();
            if (Boost == null)
            {
                Boost = new int[12];
            }

            if (ActivateBoost == null)
            {
                ActivateBoost = new ActivateBoost[8];
                for (int i = 0; i < 8; i++)
                {
                    ActivateBoost[i] = new ActivateBoost();
                }
            }

            for (var i = 0; i < Boost.Length; i++)
            {
                Boost[i] = 0;
            }

            for (var i = 0; i < 4; i++)
            {
                if (Inventory.Length < i || Inventory.Length == 0)
                {
                    return;
                }
                if (Inventory[i] == null)
                {
                    continue;
                }
                foreach (var pair in Inventory[i].StatsBoost)
                {
                    if (pair.Key == StatsType.MaximumHP)
                    {
                        Boost[0] += pair.Value;
                    }
                    if (pair.Key == StatsType.MaximumMP)
                    {
                        Boost[1] += pair.Value;
                    }
                    if (pair.Key == StatsType.Attack)
                    {
                        Boost[2] += pair.Value;
                    }
                    if (pair.Key == StatsType.Defense)
                    {
                        Boost[3] += pair.Value;
                    }
                    if (pair.Key == StatsType.Speed)
                    {
                        Boost[4] += pair.Value;
                    }
                    if (pair.Key == StatsType.Vitality)
                    {
                        Boost[5] += pair.Value;
                    }
                    if (pair.Key == StatsType.Wisdom)
                    {
                        Boost[6] += pair.Value;
                    }
                    if (pair.Key == StatsType.Dexterity)
                    {
                        Boost[7] += pair.Value;
                    }
                }
            }

            for (int i = 0; i < 8; i++) // apply activate boosts
            {
                Boost[i] += ActivateBoost[i].GetBoost();
            }

            if (setTypeBoosts == null)
            {
                return;
            }
            for (var i = 0; i < 8; i++)
            {
                Boost[i] += setTypeBoosts[i];
            }
        }
コード例 #2
0
        public void CalculateBoost()
        {
            CheckSetTypeSkin();

            if (Boost == null)
            {
                Boost = new int[12];
            }

            if (ActivateBoost == null)
            {
                ActivateBoost = new ActivateBoost[8];
                for (int i = 0; i < 8; i++)
                {
                    ActivateBoost[i] = new ActivateBoost();
                }
            }

            for (var i = 0; i < Boost.Length; i++)
            {
                Boost[i] = 0;
            }

            for (var i = 0; i < 4; i++)
            {
                if (Inventory.Length < i || Inventory.Length == 0)
                {
                    return;
                }

                if (Inventory[i] == null)
                {
                    continue;
                }

                foreach (var pair in Inventory[i].StatsBoost)
                {
                    if (pair.Key == StatsType.MAX_HP_STAT)
                    {
                        Boost[0] += GetAccountType().Item1 ? (Stats[0] / (GetAccountType().Item2 == AccType.VIP_ACCOUNT ? 10 : 20 / 3)) + pair.Value : pair.Value;
                    }
                    if (pair.Key == StatsType.MAX_MP_STAT)
                    {
                        Boost[1] += GetAccountType().Item1 ? (Stats[1] / (GetAccountType().Item2 == AccType.VIP_ACCOUNT ? 10 : 20 / 3)) + pair.Value : pair.Value;
                    }
                    if (pair.Key == StatsType.ATTACK_STAT)
                    {
                        Boost[2] += GetAccountType().Item1 ? (Stats[2] / (GetAccountType().Item2 == AccType.VIP_ACCOUNT ? 10 : 20 / 3)) + pair.Value : pair.Value;
                    }
                    if (pair.Key == StatsType.DEFENSE_STAT)
                    {
                        Boost[3] += GetAccountType().Item1 ? (Stats[3] / (GetAccountType().Item2 == AccType.VIP_ACCOUNT ? 10 : 20 / 3)) + pair.Value : pair.Value;
                    }
                    if (pair.Key == StatsType.SPEED_STAT)
                    {
                        Boost[4] += GetAccountType().Item1 ? (Stats[4] / (GetAccountType().Item2 == AccType.VIP_ACCOUNT ? 10 : 20 / 3)) + pair.Value : pair.Value;
                    }
                    if (pair.Key == StatsType.VITALITY_STAT)
                    {
                        Boost[5] += GetAccountType().Item1 ? (Stats[5] / (GetAccountType().Item2 == AccType.VIP_ACCOUNT ? 10 : 20 / 3)) + pair.Value : pair.Value;
                    }
                    if (pair.Key == StatsType.WISDOM_STAT)
                    {
                        Boost[6] += GetAccountType().Item1 ? (Stats[6] / (GetAccountType().Item2 == AccType.VIP_ACCOUNT ? 10 : 20 / 3)) + pair.Value : pair.Value;
                    }
                    if (pair.Key == StatsType.DEXTERITY_STAT)
                    {
                        Boost[7] += GetAccountType().Item1 ? (Stats[7] / (GetAccountType().Item2 == AccType.VIP_ACCOUNT ? 10 : 20 / 3)) + pair.Value : pair.Value;
                    }
                }
            }

            for (int i = 0; i < 8; i++)
            {
                Boost[i] += ActivateBoost[i].GetBoost();
            }

            if (setTypeBoosts == null)
            {
                return;
            }

            for (var i = 0; i < 8; i++)
            {
                Boost[i] += setTypeBoosts[i];
            }
        }