Esempio n. 1
0
        /// <summary>
        /// Each Character Skill gives a specific increase (or decrease) for a certain income (or value) in the game.
        /// </summary>
        /// <param name="type">What type of multiplier is this skill affecting?</param>
        /// <param name="bonus">How much does this upgrade increase the multiplier by?</param>
        /// <param name="currentLevel">How many times have you already purchased this upgrade?</param>
        /// <param name="maxLevel">What's the maximum amount of times you can purchase this upgrade?</param>
        public void ChangeCharacterSkillDescTextComponents(MultiplierTypes type, float bonus, int currentLevel, int maxLevel)
        {
            EnableSkillDescTextGameObjects(true);

            l_currentLevel = currentLevel;
            l_maxLevel     = maxLevel;

            string flexDesc     = string.Empty;
            float  currentBonus = Mathf.Round(bonus * 100f) * currentLevel;
            float  nextBonus    = currentBonus + Mathf.Round(bonus * 100f);

            if (type == MultiplierTypes.DirtyMoneyIncrease)
            {
                skillTitleText.text = string.Format("INCREASE DIRTY MONEY");
                flexDesc            = dirtyMoneySkillDesc;
            }

            if (type == MultiplierTypes.CleanMoneyIncrease)
            {
                skillTitleText.text = string.Format("INCREASE CLEAN MONEY");
                flexDesc            = cleanMoneySkillDesc;
            }

            if (type == MultiplierTypes.ReputationIncrease)
            {
                skillTitleText.text = string.Format("INCREASE REPUTATION");
                flexDesc            = reputationSkillDesc;
            }

            if (type == MultiplierTypes.TimerReduction)
            {
                skillTitleText.text = string.Format("REDUCE PRODUCT TIMER");
                flexDesc            = timerSkillDesc;
            }

            if (type == MultiplierTypes.InfluenceIncrease)
            {
                skillTitleText.text = string.Format("INCREASE INFLUENCE");
                flexDesc            = influenceSkillDesc;
            }

            if (type == MultiplierTypes.ResearchCostReduction)
            {
                skillTitleText.text = string.Format("REDUCE RESEARCH COST");
                flexDesc            = researchSkillDesc;
            }

            skillDescText.text = currentLevel != maxLevel?string.Format("{0}.\n[{1}% -> <color=#FF0000>{2}%</color>]", flexDesc, currentBonus, nextBonus) : string.Format("{0} by <color=#FF0000>{1}%</color>.", flexDesc, currentBonus);

            skillCapText.text = string.Format("{0}/{1}", currentLevel, maxLevel);
            CheckIfCanUpgradeCharacterSkill();
        }
Esempio n. 2
0
        /// <summary>
        /// Each Research Skill gives a specific increase (or decrease) for a certain income (or value) in the game.
        /// </summary>
        /// <param name="type">What type of multiplier is this skill affecting?</param>
        /// <param name="cost">What's the cost to purchase this upgrade?</param>
        /// <param name="bonus">How much does this upgrade increase the multiplier by?</param>
        /// <param name="currentLevel">How many times have you already purchased this upgrade?</param>
        /// <param name="maxLevel">What's the maximum amount of times you can purchase this upgrade?</param>
        public void ChangeResearchSkillDescTextComponents(MultiplierTypes type, float cost, float bonus, int currentLevel, int maxLevel)
        {
            EnableSkillDescTextGameObjects(true);

            l_currentLevel = currentLevel;
            l_maxLevel     = maxLevel;
            l_skillCost    = cost;

            string flexDesc     = string.Empty;
            float  currentBonus = Mathf.Round(bonus * 100f) * currentLevel;
            float  nextBonus    = currentBonus + Mathf.Round(bonus * 100f);
            string oper         = "%";

            if (type == MultiplierTypes.ProductQuality)
            {
                skillTitleText.text = string.Format("PRODUCT QUALITY - {0}[{1}]", MultiplierManager.Instance.NextResearchedProduct.ToString().ToUpper(), MultiplierManager.Instance.NextResearchedGrade.ToString().ToUpper());
                flexDesc            = productQualityDesc;
            }

            if (type == MultiplierTypes.AllProductIncomeIncrease)
            {
                skillTitleText.text = string.Format("INCREASE PRODUCT INCOME");
                flexDesc            = allProductIncomeDesc;
            }

            if (type == MultiplierTypes.SecondsBetweenWeeksReduction)
            {
                skillTitleText.text = string.Format("REDUCE SECONDS BETWEEN WEEKS");
                flexDesc            = secondsBetweenWeeksDesc;
                oper         = "s";
                currentBonus = GameManager.Instance.SecondsBetweenWeeks;
                nextBonus    = currentBonus - bonus;
            }

            if (type == MultiplierTypes.LaunderRateIncrease)
            {
                skillTitleText.text = string.Format("INCREASE LAUNDER RATES");
                flexDesc            = launderRateDesc;
            }

            if (type == MultiplierTypes.ExperienceIncrease)
            {
                skillTitleText.text = string.Format("INCREASE EXPERIENCE");
                flexDesc            = experienceDesc;
            }

            if (type == MultiplierTypes.MoneyButtonClickIncrease)
            {
                skillTitleText.text = string.Format("INCREASE MONEY BUTTON BONUS");
                flexDesc            = moneyButtonDesc;
            }

            if (type == MultiplierTypes.AdBonusIncrease)
            {
                skillTitleText.text = string.Format("INCREASE AD BONUS");
                flexDesc            = adBonusDesc;
            }

            if (type == MultiplierTypes.AdLengthIncrease)
            {
                skillTitleText.text = string.Format("INCREASE AD BONUS LENGTH");
                flexDesc            = adLengthDesc;
            }

            skillDescText.text = currentLevel != maxLevel?string.Format("{0}\n[{1}{2} -> <color=#FF0000>{3}{4}</color>]", flexDesc, currentBonus, oper, nextBonus, oper) : string.Format("{0}\n[{1}{2}]", flexDesc, currentBonus, oper);

            skillCostText.text = string.Format("{0}", CurrencyManager.Instance.FormatValues(cost));
            skillCapText.text  = string.Format("{0}/{1}", currentLevel, maxLevel);
            CheckIfCanPurchaseResearchSkillUpgrade();
        }
Esempio n. 3
0
        public void UpdateAndApplyMultiplier(MultiplierTypes type, float bonus)
        {
            //This section here are for the shared Multipliers (bonuses where more than one different type of skills can increase it.)
            //i.e. Daily Life, Research, and Character Skill upgrades all increase these Multipliers.
            if (type == MultiplierTypes.DirtyMoneyIncrease || type == MultiplierTypes.AllProductIncomeIncrease || type == MultiplierTypes.ProductQuality)
            {
                DirtyMoneyIncreaseMultiplier += bonus;
                print(DirtyMoneyIncreaseMultiplier);
            }

            if (type == MultiplierTypes.CleanMoneyIncrease || type == MultiplierTypes.AllProductIncomeIncrease || type == MultiplierTypes.ProductQuality)
            {
                CleanMoneyIncreaseMultiplier += bonus;
            }

            if (type == MultiplierTypes.ReputationIncrease || type == MultiplierTypes.AllProductIncomeIncrease || type == MultiplierTypes.ProductQuality)
            {
                ReputationIncreaseMultiplier += bonus;
            }

            if (type == MultiplierTypes.InfluenceIncrease)
            {
                InfluenceIncreaseMultiplier += bonus;
            }

            if (type == MultiplierTypes.TimerReduction)
            {
                TimerReductionMultiplier += bonus;
            }

            if (type == MultiplierTypes.LaunderRateIncrease)
            {
                LaunderRateIncreaseMultiplier += bonus;
            }

            //This section here are for Research-Unique Multipliers.
            if (type == MultiplierTypes.ProductQuality)
            {
                CurrentResearchedGrade++;
                NextResearchedGrade++;
                if ((int)CurrentResearchedGrade > 3)
                {
                    CurrentResearchedGrade = 0;
                    CurrentResearchedProduct++;
                }

                if ((int)CurrentResearchedProduct > 5)
                {
                    CurrentResearchedProduct = (Product)5;
                    CurrentResearchedGrade   = (Grade)3;
                }

                if ((int)NextResearchedGrade > 3)
                {
                    NextResearchedGrade = 0;
                    NextResearchedProduct++;
                }

                if ((int)NextResearchedProduct > 5)
                {
                    NextResearchedProduct = (Product)5;
                    NextResearchedGrade   = (Grade)3;
                }
            }

            if (type == MultiplierTypes.AdBonusIncrease)
            {
                AdBonusRateIncreaseMultiplier += bonus;
            }

            if (type == MultiplierTypes.AdLengthIncrease)
            {
                AdBonusLengthIncreaseMultiplier += bonus;
            }

            if (type == MultiplierTypes.ExperienceIncrease)
            {
                ExperienceIncreaseMultiplier += bonus;
            }

            if (type == MultiplierTypes.SecondsBetweenWeeksReduction)
            {
                SecondsBetweenWeeksReductionMultiplier += bonus;
                GameManager.Instance.ApplySecondsBetweenWeeksReduction();
            }

            if (type == MultiplierTypes.MoneyButtonClickIncrease)
            {
                MoneyButtonClickIncreaseMultiplier += bonus;
                CurrencyManager.Instance.ApplyMoneyButtonMultiplier();
            }

            //This section here are for Other-Unique Multipliers.
            if (type == MultiplierTypes.NumberOfProductsIncrease)
            {
                ProductManager.Instance.IncrementTotalNumberOfProductsCanSell();
            }

            if (type == MultiplierTypes.ResearchCostReduction)
            {
                ResearchCostReductionMultiplier += bonus;
            }

            OnPurchaseMultiplier?.Invoke();
        }
Esempio n. 4
0
        /// <summary>
        /// Each Daily Life Skill gives a specific increase (or decrease) for a certain income (or value) in the game.
        /// </summary>
        /// <param name="type">What type of multiplier is this skill affecting?</param>
        /// <param name="cost">What's the cost to purchase this upgrade?</param>
        /// <param name="bonus">How much does this upgrade increase the multiplier by?</param>
        /// <param name="currentLevel">How many times have you already purchased this upgrade?</param>
        /// <param name="maxLevel">What's the maximum amount of times you can purchase this upgrade?</param>
        public void ChangeDailyLifeSkillDescTextComponents(MultiplierTypes type, float cost, float bonus, int currentLevel, int maxLevel)
        {
            EnableSkillDescTextGameObjects(true);

            l_currentLevel = currentLevel;
            l_maxLevel     = maxLevel;
            l_skillCost    = cost;

            string flexDesc           = string.Empty;
            string flexMultiplierDesc = string.Empty;
            float  currentBonus       = Mathf.Round(bonus * 100f) * currentLevel;
            float  nextBonus          = currentBonus + Mathf.Round(bonus * 100f);
            string oper = "%";

            //Officials.
            if (type == MultiplierTypes.TimerReduction)
            {
                skillTitleText.text = string.Format("OFFICIALS");
                flexDesc            = officialsSkillDesc;
                flexMultiplierDesc  = "TIMER REDUCTION:";
            }

            //Business.
            if (type == MultiplierTypes.CleanMoneyIncrease)
            {
                skillTitleText.text = string.Format("BUSINESSES");
                flexDesc            = businessSkillDesc;
                flexMultiplierDesc  = "<color=#009600FF>CLEAN MONEY</color> INCREASE:";
            }

            //Partners.
            if (type == MultiplierTypes.DirtyMoneyIncrease)
            {
                skillTitleText.text = string.Format("PARTNERS");
                flexDesc            = partnersSkillDesc;
                flexMultiplierDesc  = "<color=#DC7800FF>DIRTY MONEY</color> INCREASE:";
            }

            //Estates.
            if (type == MultiplierTypes.ReputationIncrease)
            {
                skillTitleText.text = string.Format("ESTATES");
                flexDesc            = estatesSkillDesc;
                flexMultiplierDesc  = "<color=#00A0FFFF>REPUTATION</color> INCREASE:";
            }

            //Vehicles.
            if (type == MultiplierTypes.NumberOfProductsIncrease)
            {
                oper         = string.Empty;
                currentBonus = ProductManager.Instance.TotalNumberOfProductCanSell;
                nextBonus    = currentBonus + bonus;

                skillTitleText.text = string.Format("VEHICLES");
                flexDesc            = vehiclesSkillDesc;
                flexMultiplierDesc  = "NUMBER OF PRODUCTS:";
            }

            //Weapons.
            if (type == MultiplierTypes.LaunderRateIncrease)
            {
                skillTitleText.text = string.Format("WEAPONS");
                flexDesc            = weaponsSkillDesc;
                flexMultiplierDesc  = "LAUNDER RATE INCREASE:";
            }

            multiplierText.text = string.Format("{0} {1}{2}", flexMultiplierDesc, currentBonus, oper);
            skillDescText.text  = currentLevel != maxLevel?string.Format("{0}\n\n[{1}{2} -> <color=#FF0000>{3}{4}</color>]", flexDesc, currentBonus, oper, nextBonus, oper) : string.Format("{0}", flexDesc);

            skillCostText.text = string.Format("{0}", CurrencyManager.Instance.FormatValues(cost));
            skillCapText.text  = string.Format("{0}/{1}", currentLevel, maxLevel);
            CheckIfCanPurchaseDailyLifeSkillUpgrade();
        }