Exemple #1
0
        /// <summary>
        /// Dangerous driving
        /// </summary>
        protected void HandleRecklessDrinving()
        {
            if (this.RecklessDriving)
            {
                return;
            }

            float speed = this.Vehicle.Speed;

            if (VehicleManager.ConvertRageToKMH(speed) <= 50)
            {
                speed = VehicleManager.ConvertKMHToRage((float)this.random.Next(70, 110));
            }
            else
            {
                if (VehicleManager.ConvertRageToKMH(speed) <= 110)
                {
                    speed = VehicleManager.ConvertKMHToRage((float)this.random.Next(110, 150));
                }
            }

            if (false == this.IsEventRunning)
            {
                return;
            }

            this.Driver.Tasks.PerformDrivingManeuver(VehicleManeuver.SwerveLeft);
            GameFiber.Sleep(200);

            if (Tools.HavingChance(7, 10))
            {
                this.Driver.Tasks.PerformDrivingManeuver(VehicleManeuver.Wait);
                GameFiber.Sleep(600);
                this.Driver.Tasks.PerformDrivingManeuver(VehicleManeuver.BurnOut);
                GameFiber.Sleep(200);
                this.Driver.Tasks.CruiseWithVehicle(this.Vehicle, speed, (VehicleDrivingFlags.FollowTraffic | VehicleDrivingFlags.YieldToCrossingPedestrians));
                GameFiber.Sleep(6000);
            }

            if (false == this.IsEventRunning)
            {
                this.Driver.Tasks.ClearSecondary();
                return;
            }

            this.Driver.Tasks.PerformDrivingManeuver(VehicleManeuver.SwerveRight);
            GameFiber.Sleep(300);
            if (false == this.IsEventRunning)
            {
                this.Driver.Tasks.ClearSecondary();
                return;
            }
            this.Driver.Tasks.CruiseWithVehicle(this.Vehicle, speed, (VehicleDrivingFlags.FollowTraffic | VehicleDrivingFlags.YieldToCrossingPedestrians));
            GameFiber.Sleep(6000);
            this.Driver.Tasks.ClearSecondary();
            this.RecklessDriving = true;
        }