Esempio n. 1
0
        private void Debug(int id)
        {
            switch (id)
            {
            case 0:
                Screen.ShowSubtitle($"WSpeed: {Math.Round(WheelSpeed)} " +
                                    $"RPM: {Math.Round(EngineRpm, 2)} " +
                                    $"Breaking: {IsBreaking} " +
                                    $"Idle: {IsIdle} " +
                                    $"Neutral: {IsNeutral} " +
                                    $"Accel: {IsAccelerating} " +
                                    $"Revers: {IsReversing} " +
                                    $"Revving: {IsRevving}");
                break;

            case 1:
                Screen.ShowSubtitle($"Accel: {_engineAccell1Sound.IsAnyInstancePlaying} {_engineAccell1Sound.InstancesNumber}  " +
                                    $"Decel: {_engineDecellSound.IsAnyInstancePlaying} {_engineDecellSound.InstancesNumber}  " +
                                    $"Neutral: {_engineNeutralSound.IsAnyInstancePlaying} {_engineNeutralSound.InstancesNumber}  " +
                                    $"Reverse: {_engineReverseSound.IsAnyInstancePlaying} {_engineReverseSound.InstancesNumber}  " +
                                    $"Idle: {_engineIdleSound.IsAnyInstancePlaying} {_engineIdleSound.InstancesNumber}  " +
                                    $"Rev: {_engineRevvingSound.IsAnyInstancePlaying} {_engineRevvingSound.InstancesNumber} ");
                break;

            case 2:
                Screen.ShowSubtitle($"WSpeed: {Math.Round(WheelSpeed, 2)} Accel: {Math.Round(Acceleration, 2)} IsAccel: {IsAccelerating} " +
                                    $"RPM: {Math.Round(EngineRpm, 2)} ");
                break;
            }
        }
Esempio n. 2
0
 public void ShowHelp(string entry, int duration = -1, bool beep = true, bool looped = false, params object[] values)
 {
     Screen.ShowHelpText(string.Format(GetLocalizedText(entry), values), duration, beep, looped);
 }
Esempio n. 3
0
        public override void Process()
        {
            _reentryTimer += Game.LastFrameTime;

            if (_reentryTimer > 2)
            {
                if (Vehicle.Driver == null)
                {
                    Vehicle.IsHandbrakeForcedOn = false;
                    Vehicle.SteeringAngle       = 0;
                }
            }

            if (!IsTimeTravelling)
            {
                return;
            }

            if (!Vehicle.IsVisible)
            {
                Vehicle.IsEngineRunning = false;
            }

            if (Vehicle == null)
            {
                return;
            }

            if (Game.GameTime < gameTimer)
            {
                return;
            }

            switch (_currentStep)
            {
            case 0:
                TimeCircuits.Delorean.LastVelocity = Vehicle.Velocity;

                TimeCircuits.WasOnTracks = TimeCircuits.IsOnTracks;

                if (IsOnTracks)
                {
                    TimeCircuits.GetHandler <RailroadHandler>().StopTrain();
                }

                // Set previous time
                PreviousTime = Utils.GetWorldTime();

                // Invoke delegate
                TimeCircuits.OnTimeTravel?.Invoke();

                if (!IsRemoteControlled && Vehicle.GetPedOnSeat(VehicleSeat.Driver) == Main.PlayerPed && (!CutsceneMode || Utils.IsPlayerUseFirstPerson()))
                {
                    // Create a copy of the current status of the Delorean
                    TimeCircuits.Delorean.LastDisplacementCopy = TimeCircuits.Delorean.Copy;

                    timeTravelAudioInstant.Play();

                    if (Utils.IsPlayerUseFirstPerson())
                    {
                        _whiteSphere.SpawnProp();
                    }
                    else
                    {
                        ScreenFlash.FlashScreen(0.25f);
                    }

                    // Have to call SetupJump manually here.
                    TimeHandler.TimeTravelTo(TimeCircuits, DestinationTime);

                    Stop();

                    TimeCircuits.GetHandler <SparksHandler>().StartTimeTravelCooldown();

                    if (TimeCircuits.WasOnTracks)
                    {
                        TimeCircuits.GetHandler <RailroadHandler>().StartDriving(true);
                    }

                    if (!is99)
                    {
                        IsFueled = false;
                    }

                    TimeCircuits.GetHandler <FreezeHandler>().StartFreezeHandling(!is99);

                    if (Mods.Hoodbox == ModState.On && !TimeCircuits.IsWarmedUp)
                    {
                        TimeCircuits.GetHandler <HoodboxHandler>().SetInstant();
                    }

                    if (Mods.Hook == HookState.On)
                    {
                        Mods.Hook = HookState.Removed;
                    }

                    if (Mods.Plate == PlateType.Outatime)
                    {
                        Mods.Plate = PlateType.Empty;
                    }

                    // Invoke delegate
                    TimeCircuits.OnTimeTravelComplete?.Invoke();

                    // Stop handling
                    Stop();

                    //Add LastDisplacementCopy to remote Deloreans list
                    RemoteDeloreansHandler.AddDelorean(TimeCircuits.Delorean.LastDisplacementCopy);

                    return;
                }

                timeTravelAudioCutscene.Play();

                // Play the effects
                _timeTravelEffect.Play();

                // Play the light explosion
                _lightExplosion.Play();

                trails = FireTrailsHandler.SpawnForDelorean(
                    TimeCircuits,
                    is99,
                    (is99 || (Mods.HoverUnderbody == ModState.On && IsFlying)) ? 1f : 45,
                    is99 ? -1 : 15,
                    DeloreanType == DeloreanType.BTTF1, Mods.Wheel == WheelType.RailroadInvisible ? 75 : 50);

                // If the Vehicle is remote controlled or the player is not the one in the driver seat
                if (IsRemoteControlled || Vehicle.GetPedOnSeat(VehicleSeat.Driver) != Main.PlayerPed)
                {
                    MPHSpeed = 0;

                    // Stop remote controlling
                    TimeCircuits.GetHandler <RcHandler>()?.StopRC();

                    // Add to time travelled list
                    RemoteDeloreansHandler.AddDelorean(TimeCircuits.Delorean.Copy);

                    Utils.HideVehicle(Vehicle, true);

                    gameTimer = Game.GameTime + 300;

                    _currentStep++;
                    return;
                }

                // Create a copy of the current status of the Delorean
                TimeCircuits.Delorean.LastDisplacementCopy = TimeCircuits.Delorean.Copy;

                if (Mods.HoverUnderbody == ModState.On)
                {
                    CanConvert = false;
                }

                Game.Player.IgnoredByPolice = true;

                Main.HideGui = true;

                Main.DisablePlayerSwitching = true;

                Utils.HideVehicle(Vehicle, true);

                TimeCircuits.Delorean.IsInTime = true;

                gameTimer = Game.GameTime + 300;

                _currentStep++;
                break;

            case 1:
                _timeTravelEffect.Stop();

                if (Vehicle.GetPedOnSeat(VehicleSeat.Driver) != Main.PlayerPed)
                {
                    DeloreanHandler.RemoveDelorean(TimeCircuits.Delorean, true, true);
                    return;
                }

                gameTimer = Game.GameTime + 3700;
                _currentStep++;

                break;

            case 2:
                Screen.FadeOut(1000);
                gameTimer = Game.GameTime + 1500;

                _currentStep++;
                break;

            case 3:
                TimeHandler.TimeTravelTo(TimeCircuits, DestinationTime);
                FireTrailsHandler.RemoveTrail(trails);

                gameTimer = Game.GameTime + 1000;

                _currentStep++;
                break;

            case 4:
                TimeCircuits.OnTimeTravelComplete?.Invoke();

                gameTimer = Game.GameTime + 2000;
                Screen.FadeIn(1000);

                _currentStep++;
                break;

            case 5:
                //Add LastDisplacementCopy to remote Deloreans list
                RemoteDeloreansHandler.AddDelorean(TimeCircuits.Delorean.LastDisplacementCopy);

                Reenter();

                ResetFields();
                break;
            }
        }