public static double ComputeEffect(int AugmentorQuantity, bool RequiresInput, int ProcessingTime) { double ProcessingDays = ProcessingTime * 1.0 / MinutesPerDay; double BaseDaysPerDuplicate = RequiresInput ? MachineAugmentorsMod.UserConfig.DaysPerStandardDuplicate : MachineAugmentorsMod.UserConfig.DaysPerInputlessDuplicate; AugmentorConfig Config = MachineAugmentorsMod.UserConfig.GetConfig(AugmentorType.Duplication); int ActualQuantity = Math.Max(0, Math.Min(AugmentorQuantity, Config.MaxAttachmentsPerMachine)); double UpperLimit = RequiresInput ? Config.MaxEffectPerStandardMachine : Config.MaxEffectPerInputlessMachine; double RateOfDecay = RequiresInput ? Config.StandardDecayRate : Config.InputlessDecayRate; double Multiplier; if (Config.UseLinearFormula) { Multiplier = ((ActualQuantity - 1) * 1.0 / Config.MaxAttachmentsPerMachine * UpperLimit); } else { Multiplier = UpperLimit * (1.0 - Math.Exp((ActualQuantity - 1) * -1 * RateOfDecay)); } double DuplicateChance = Math.Min(1.0, ProcessingDays / (BaseDaysPerDuplicate * (1.0 - Multiplier))); return(DuplicateChance); }
public static double ComputeEffect(int AugmentorQuantity, bool RequiresInput) { AugmentorConfig Config = MachineAugmentorsMod.UserConfig.GetConfig(AugmentorType.Production); int ActualQuantity = Math.Max(0, Math.Min(AugmentorQuantity, Config.MaxAttachmentsPerMachine)); double UpperLimit = RequiresInput ? Config.MaxEffectPerStandardMachine : Config.MaxEffectPerInputlessMachine; double RateOfDecay = RequiresInput ? Config.StandardDecayRate : Config.InputlessDecayRate; return(1.0 + (UpperLimit * (1.0 - Math.Exp(ActualQuantity * -1 * RateOfDecay)))); }
public static double ComputeEffect(int AugmentorQuantity, bool RequiresInput) { AugmentorConfig Config = MachineAugmentorsMod.UserConfig.GetConfig(AugmentorType.Quality); int ActualQuantity = Math.Max(0, Math.Min(AugmentorQuantity, Config.MaxAttachmentsPerMachine)); double UpperLimit = RequiresInput ? Config.MaxEffectPerStandardMachine : Config.MaxEffectPerInputlessMachine; if (Config.UseLinearFormula) { return(Math.Min(0.999999, ActualQuantity * 1.0 / Config.MaxAttachmentsPerMachine * UpperLimit)); } else { double RateOfDecay = RequiresInput ? Config.StandardDecayRate : Config.InputlessDecayRate; return(Math.Min(0.999999, UpperLimit * (1.0 - Math.Exp(ActualQuantity * -1 * RateOfDecay)))); } }