private static void SetCurrentDelay(Delay delay) { if (delay.Randomize && Random.Next(0, 101) >= (100 - delay.Probability)) { var min = (delay.Default / 100f) * delay.MinDelay; var max = (delay.Default / 100f) * delay.MaxDelay; delay.CurrentDelay = Random.Next((int) Math.Min(min, max), (int) Math.Max(min, max) + 1); } else { delay.CurrentDelay = delay.Default; } }
public static void SetDelayRandomize(bool value, OrbwalkingDelay delay) { Delay delayEntry; if (Delays.TryGetValue(delay, out delayEntry)) { delayEntry.Randomize = value; } else { Delays[delay] = new Delay { Randomize = value }; } }
public static void SetMinDelay(float value, OrbwalkingDelay delay) { Delay delayEntry; if (Delays.TryGetValue(delay, out delayEntry)) { delayEntry.MinDelay = value; } else { Delays[delay] = new Delay { MinDelay = value }; } }
public static void SetDelayProbability(float value, OrbwalkingDelay delay) { Delay delayEntry; if (Delays.TryGetValue(delay, out delayEntry)) { delayEntry.Probability = value; } else { Delays[delay] = new Delay { Probability = value }; } }