Ejemplo n.º 1
0
        public static int CalculateConditionCost(int baseValue, int shopQuality, int conditionPercentage = -1)
        {
            float conditionMod = (conditionPercentage == -1) ? 1f : Mathf.Max((float)conditionPercentage / 100, 0.2f);

            int cost = (int)(baseValue * conditionMod);

            if (cost < 1)
            {
                cost = 1;
            }

            cost = FormulaHelper.ApplyRegionalPriceAdjustment(cost);
            cost = 2 * (cost * (shopQuality - 10) / 100 + cost);

            return(cost);
        }