/// <summary> /// Gets the speed up cost. /// </summary> public int GetSpeedUpCost(int RemainingTime) { if (RemainingTime <= 0) { return(0); } return(Math.Clamp((this.TotalTimeTakenSeconds + 600 * RemainingTime - 1) / this.TotalTimeTakenSeconds, 1, this.TotalTimeTakenSeconds / 600)); }
/// <summary> /// Updates the logic tick. /// </summary> public void IncreaseTick() { if (this.Time == 0) { this.GameMode.Time = new Time(); this.SendSectorState(); } this.GameMode.UpdateSectorTicks(this.Time); if (this.Time == 10 * (this.Time / 10)) { this.Queue.Commands.ForEach(Command => { Command.TickWhenGiven = Math.Clamp(Command.TickWhenGiven, Command.TickWhenGiven - 5, Command.TickWhenGiven + 20); this.GameMode.CommandManager.AddCommand(Command); }); this.SendSectorHeartbeat(this.Time / 10, this.GameMode.Checksum, this.Queue.Commands.ToArray()); } this.Time.IncreaseTick(); }