public override void Process() { if (Vehicle.AreLightsOn && Vehicle.IsEngineRunning) { if (!_leftIndicatorProp.IsSpawned && !Vehicle.IsLeftHeadLightBroken) { _leftIndicatorProp.SpawnProp(); } if (!_rightIndicatorProp.IsSpawned && !Vehicle.IsRightHeadLightBroken) { _rightIndicatorProp.SpawnProp(); } } else { _leftIndicatorProp.DeleteProp(); _rightIndicatorProp.DeleteProp(); return; } if (Vehicle.IsLeftHeadLightBroken && _leftIndicatorProp.IsSpawned) { _leftIndicatorProp.DeleteProp(); } if (Vehicle.IsRightHeadLightBroken && _rightIndicatorProp.IsSpawned) { _rightIndicatorProp.DeleteProp(); } }
public override void Dispose() { _emptySound?.Dispose(); _refuelSound?.Dispose(); _emptyGlowing?.DeleteProp(); _emptyOff?.DeleteProp(); _refuelPlayer?.Dispose(); }
public void HandleBoosting() { // First of all, check if vehicle is in fly mode, if its not just return if (Main.PlayerVehicle != Vehicle) { return; } // If the Handbrake control is pressed // Using this so that controllers are also supported if (Game.IsControlPressed(GTA.Control.VehicleHandbrake) && Vehicle.IsEngineRunning) { // Boost! Boost(); IsBoosting = true; } else { // Set vent effect invisible ventGlowing.DeleteProp(); // Reset flag _hasPlayedBoostSound = false; IsBoosting = false; } }
public override void Stop() { IsPlaying = false; _hasStartedWormhole = false; _hasStartedFluxEffect = false; numOfProps = 0; TimeCircuits.GetHandler <FluxCapacitorHandler>().StartNormalFluxing(); _coilsProp?.DeleteProp(); _separatedCoils?.ForEach(x => x?.DeleteProp()); _separatedCoils?.Clear(); TimeCircuits.Delorean.Mods.OffCoils = ModState.On; _sparkPTFX?.StopNonLooped(); _sparks?.ForEach(x => x?.Stop()); _wheelPtfxes?.ForEach(x => x?.Stop()); _wormholeRT?.DeleteProp(); }
public override void Stop() { _hoodboxLights?.DeleteProp(); _hoodboxLights = null; _state = false; _applyAlpha = false; _alphaLevel = 0; }
public override void Dispose() { timeTravelAudioCutscene.Dispose(); timeTravelAudioInstant.Dispose(); _whiteSphere?.DeleteProp(); _lightExplosion.Dispose(); _timeTravelEffect.Dispose(); }
private void OnTimeCircuitsToggle() { if (!TimeCircuits.Delorean.IsGivenScaleformPriority) { return; } if (IsOn) { if (ModSettings.PlayFluxCapacitorSound) { fluxCapacitor.Play(); } destinationSlot.SetDate(DestinationTime); destinationSlot.SetVisible(false); destinationSlot.SetVisibleAt(true, 500, 600); previousSlot.SetDate(PreviousTime); previousSlot.SetVisible(false); previousSlot.SetVisibleAt(true, 500, 600); presentSlot.SetDate(Utils.GetWorldTime()); presentSlot.SetVisible(false); presentSlot.SetVisibleAt(true, 500, 600); } else { if (fluxCapacitor.IsAnyInstancePlaying) { fluxCapacitor?.Stop(); } destinationSlot.SetVisibleAt(false, 750, 750); previousSlot.SetVisibleAt(false, 750, 750); presentSlot.SetVisibleAt(false, 750, 750); currentState = false; beep?.Stop(); GUI.CallFunction("SET_DIODE_STATE", false); tickingDiodes?.DeleteProp(); tickingDiodesOff?.SpawnProp(); } }
public override void Stop() { fluxCapacitor?.Stop(); fluxCapacitor?.Dispose(); destinationSlot.Dispose(); previousSlot.Dispose(); presentSlot.Dispose(); tickingDiodes?.DeleteProp(); tickingDiodesOff?.DeleteProp(); }
public void SetPhotoMode() { if (WormholeActive && !TimeCircuits.GetHandler <SparksHandler>().IsWormholePlaying) { TimeCircuits.GetHandler <SparksHandler>().StartWormhole(); } if (!WormholeActive && TimeCircuits.GetHandler <SparksHandler>().IsWormholePlaying) { TimeCircuits.GetHandler <SparksHandler>().StopWormhole(); } if (GlowingCoilsActive && !_coilsProp.IsSpawned) { if (Main.CurrentTime.Hour >= 20 || (Main.CurrentTime.Hour >= 0 && Main.CurrentTime.Hour <= 5)) { _coilsProp.Model = ModelHandler.CoilsGlowingNight; } else { _coilsProp.Model = ModelHandler.CoilsGlowing; } Mods.OffCoils = ModState.Off; _coilsProp.SpawnProp(false); } if (!GlowingCoilsActive && _coilsProp.IsSpawned) { Mods.OffCoils = ModState.On; _coilsProp.DeleteProp(); } if (FluxCapacitorActive && !TimeCircuits.GetHandler <FluxCapacitorHandler>().TimeTravelEffect) { TimeCircuits.GetHandler <FluxCapacitorHandler>().StartTimeTravelEffect(); } if (!FluxCapacitorActive && TimeCircuits.GetHandler <FluxCapacitorHandler>().TimeTravelEffect) { TimeCircuits.GetHandler <FluxCapacitorHandler>().StartNormalFluxing(); } if (IceActive && !IsFreezing) { TimeCircuits.GetHandler <FreezeHandler>().StartFreezeHandling(false); } if (!IceActive && IsFreezing) { TimeCircuits.GetHandler <FreezeHandler>().Stop(); } IsPhotoModeOn = WormholeActive | GlowingCoilsActive | FluxCapacitorActive | IceActive; }
public void Delete() { if (IsCargoAttached) { ToggleCargoVehicle(); } finalRamp?.DeleteProp(); rampSupports?.DeleteProp(); Vehicle?.Delete(); }
public void SetVisible(bool toggleTo, bool month = true, bool day = true, bool year = true, bool hour = true, bool minute = true, bool amPm = true) { if (!TcdEditer.IsEditing) { ScreenTCD.SetVisible(SlotType, toggleTo, month, day, year, hour, minute, amPm); } Scaleform.SetVisible(toggleTo, month, day, year, hour, minute); if ((!toggleTo && amPm) || (toggleTo && !amPm)) { amProp?.DeleteProp(); pmProp?.DeleteProp(); } else if ((!toggleTo && !amPm) || (toggleTo && amPm)) { amProp.SetState(date.ToString("tt", CultureInfo.InvariantCulture) == "AM"); pmProp.SetState(date.ToString("tt", CultureInfo.InvariantCulture) != "AM"); } toggle = toggleTo; }
private void OnTimeCircuitsToggle() { if(IsOn) { tfcOn.SpawnProp(false); tfcOff.DeleteProp(); rotate = true; rotateTfcTo = -45f; } else { tfcOff.SpawnProp(false); tfcOn.DeleteProp(); rotate = true; rotateTfcTo = 0; } }
public override void Stop() { _compass?.DeleteProp(); }
public override void Stop() { _currentFrame = 0; _spark.DeleteProp(); IsPlaying = false; }
public override void Dispose() { _coilsProp?.DeleteProp(); }
public void Process() { if (!Vehicle.IsVisible) { speedNeedle.DeleteProp(); rpmNeedle.DeleteProp(); fuelNeedle.DeleteProp(); tempNeedle.DeleteProp(); oilNeedle.DeleteProp(); voltNeedle.DeleteProp(); doorIndicator.DeleteProp(); leftFan.DeleteProp(); rightFan.DeleteProp(); suspensionLeftFront?.DeleteProp(); suspensionLeftRear?.DeleteProp(); suspensionRightFront?.DeleteProp(); suspensionRightRear?.DeleteProp(); return; } if (Game.Player.Character.Position.DistanceToSquared(Vehicle.Position) > 5f * 5f) { return; } spawnSuspension = !(DeloreanHandler.IsVehicleATimeMachine(Vehicle) && DeloreanHandler.GetTimeMachineFromVehicle(Vehicle).Mods.HoverUnderbody == ModState.On); if (Vehicle.IsEngineRunning) { // --- RPM -- rpmRotation = Vehicle.CurrentRPM * 210; // --- Speed --- float speed = Vehicle.Speed / 0.27777f / 1.60934f; speedRotation = 270 * speed / 95; if (speedRotation > 270) { speedRotation = 270; } fuelRotation = Utils.Lerp(fuelRotation, -31.5f, Game.LastFrameTime * 10f); tempRotation = Utils.Lerp(tempRotation, 4.5f, Game.LastFrameTime * 10f); oilRotation = Utils.Lerp(oilRotation, -5f, Game.LastFrameTime * 10f); voltRotation = Utils.Lerp(voltRotation, 5.5f, Game.LastFrameTime * 10f); } else { fuelRotation = Utils.Lerp(fuelRotation, 0, Game.LastFrameTime * 15f); tempRotation = Utils.Lerp(tempRotation, 0, Game.LastFrameTime * 15f); oilRotation = Utils.Lerp(oilRotation, 0, Game.LastFrameTime * 15f); voltRotation = Utils.Lerp(voltRotation, 0, Game.LastFrameTime * 15f); } if (Vehicle.EngineTemperature >= 50) { fanRotation += Game.LastFrameTime * 10.8f * (Vehicle.EngineTemperature - 50); leftFan.SpawnProp(Vector3.Zero, new Vector3(16f, fanRotation, 0), false); rightFan.SpawnProp(Vector3.Zero, new Vector3(16f, fanRotation, 0), false); if (fanRotation >= 360) { fanRotation -= 360; } } speedNeedle.SpawnProp(Vector3.Zero, new Vector3(0, speedRotation, 0), false); rpmNeedle.SpawnProp(Vector3.Zero, new Vector3(0, rpmRotation, 0), false); fuelNeedle.SpawnProp(Vector3.Zero, new Vector3(0, fuelRotation, 0), false); tempNeedle.SpawnProp(Vector3.Zero, new Vector3(0, tempRotation, 0), false); oilNeedle.SpawnProp(Vector3.Zero, new Vector3(0, oilRotation, 0), false); voltNeedle.SpawnProp(Vector3.Zero, new Vector3(0, voltRotation, 0), false); if (spawnSuspension) { if (!suspensionLeftFront.IsSpawned) { suspensionLeftFront.SpawnProp(); suspensionLeftRear.SpawnProp(); suspensionRightFront.SpawnProp(); suspensionRightRear.SpawnProp(); } } else { suspensionLeftFront?.DeleteProp(); suspensionLeftRear?.DeleteProp(); suspensionRightFront?.DeleteProp(); suspensionRightRear?.DeleteProp(); } if (Utils.IsAnyOfFrontDoorsOpen(Vehicle)) { doorIndicator.SpawnProp(); } else { doorIndicator.DeleteProp(); } }
public override void Stop() { redLog?.DeleteProp(); greenLog?.DeleteProp(); yellowLog?.DeleteProp(); }
public new void SetFlyMode(bool open, bool instant = false) { if (open && TimeCircuits.FlyingCircuitsBroken) { if (VehicleControl.GetDeluxoTransformation(Vehicle) > 0) { VehicleControl.SetDeluxoTransformation(Vehicle, 0f); } return; } Open = open; IsLanding = ModSettings.LandingSystem && !Open && !instant && Vehicle.HeightAboveGround <20 && Vehicle.HeightAboveGround> 0.5f && !Vehicle.IsUpsideDown && VehicleControl.GetDeluxoTransformation(Vehicle) > 0; if (instant) { wheelAnims.SetInstant(open); } else { wheelAnims.Play(open); } // undocced native, changes delxuo transformation // from land to hover // (DOES NOT CHANGE FLY MODE!) if (!IsLanding) { Function.Call((Hash)0x438b3d7ca026fe91, Vehicle, Open ? 1f : 0f); } else { Utils.DisplayHelpText(Game.GetLocalizedString("BTTFV_Input_VTOL_Tip")); } if (Open && !instant) { _flyOn.Play(); _smokeParticles.ForEach(x => x.Play()); } else if (!Open && !instant) { if (IsFlying) { _flyOff.Play(); } _hoverGlowing.DeleteProp(); } IsFlying = Open; Function.Call(Hash._FORCE_VEHICLE_ENGINE_AUDIO, Vehicle, IsFlying ? "DELUXO" : "VIRGO"); if (!IsLanding && !IsFlying) { Function.Call((Hash)0x1201E8A3290A3B98, Vehicle, false); Function.Call((Hash)0x28B18377EB6E25F6, Vehicle, false); Function.Call(Hash.MODIFY_VEHICLE_TOP_SPEED, Vehicle, 40f); } if (!IsFlying && IsAltitudeHolding) { IsAltitudeHolding = false; } ventGlowing?.DeleteProp(); _hoverGlowing?.DeleteProp(); }