Exemple #1
0
        public int CalculateFinalProductionTimeSeconds(Character character, int targetDefinition, int lineOrCPRGTimePoints)
        {
            if (EntityDefault.Get(targetDefinition).CategoryFlags.IsCategory(CategoryFlags.cf_random_items))
            {
                return(10); //fix time for mission items
            }

            //definition related time modifier
            var durationModifier = ProductionDataAccess.GetProductionDuration(targetDefinition);

            var multiplier = CalculateFinalTimeMultiplier(character, targetDefinition, lineOrCPRGTimePoints);

            var facilityProductionTime = GetProductionTimeSeconds();

            return((int)(facilityProductionTime * multiplier * durationModifier));
        }
        public int CalculatePrototypeTimeSeconds(Character character, int targetDefinition)
        {
            //(1+(100/( PC_EXT_PONT+100))*10 *Prototyper.productionTime *targetDefinition.CF.durationMultiplier

            var durationModifier = ProductionDataAccess.GetProductionDuration(targetDefinition);

            var multiplier = 1 + (100 / (GetAdditiveComponentForTime(character) + 100.0));

            var configPrototypeTime = GetProductionTimeSeconds();

            var rawValue = multiplier * 10 * durationModifier * configPrototypeTime;

            if (rawValue > int.MaxValue)
            {
                Logger.Error("overflow in CalculatePrototypeTimeSeconds. definition:" + targetDefinition + " durationModifier:" + durationModifier + " multiplier:" + multiplier + " configPrototypeTime:" + configPrototypeTime + " characterID:" + character.Id);
                rawValue = int.MaxValue;
            }

            return((int)rawValue);
        }