public RemotePedAI(DeloreanTimeMachine del, Ped ped) { Delorean = del; RemotePed = ped; fuelHandler = Delorean.Circuits.GetHandler <FuelHandler>(); }
public static void StopRemoteControl(bool instant = false) { RemoteControlling = null; _cachedRCHandler?.Stop(instant); _cachedRCHandler = null; Main.DisablePlayerSwitching = false; }
private void Spawn() { if (Blip != null && Blip.Exists()) { Blip.Delete(); } DeloreanSpawned = DeloreanCopy.Spawn(); DeloreanSpawned.LastDisplacementCopy = DeloreanCopy; }
public void ExistenceCheck(DateTime time) { if (DeloreanCopy.Circuits.DestinationTime > time) { if (DeloreanSpawned != null && DeloreanSpawned.Vehicle.Exists() && Main.PlayerVehicle != DeloreanSpawned.Vehicle) { DeloreanHandler.RemoveDelorean(DeloreanSpawned); DeloreanSpawned = null; } } else if (DeloreanCopy.Circuits.DestinationTime < time) { if (DeloreanSpawned == null || !DeloreanSpawned.Vehicle.Exists()) { Spawn(); } } }
public static void RemoteControl(DeloreanTimeMachine timeMachine) { if (timeMachine == null) { return; } if (RemoteControlling != null) { RemoteControlling.Circuits?.GetHandler <RcHandler>().StopRC(); } _cachedRCHandler = timeMachine?.Circuits?.GetHandler <RcHandler>(); _cachedRCHandler?.StartRC(); RemoteControlling = timeMachine; Main.DisablePlayerSwitching = true; }
public void ApplyTo(DeloreanTimeMachine timeMachine) { DeloreanMods deloreanMods = timeMachine.Mods; deloreanMods.DeloreanType = DeloreanType; deloreanMods.SuspensionsType = SuspensionsType; deloreanMods.Wheel = Wheel; deloreanMods.Exterior = Exterior; deloreanMods.Interior = Interior; deloreanMods.OffCoils = OffCoils; deloreanMods.GlowingEmitter = GlowingEmitter; deloreanMods.GlowingReactor = GlowingReactor; deloreanMods.DamagedBumper = DamagedBumper; deloreanMods.SteeringWheelsButtons = SteeringWheelsButtons; deloreanMods.HoverUnderbody = HoverUnderbody; deloreanMods.Vents = Vents; deloreanMods.Seats = Seats; deloreanMods.Reactor = Reactor; deloreanMods.Exhaust = Exhaust; deloreanMods.Hoodbox = Hoodbox; deloreanMods.Hook = Hook; deloreanMods.Plate = Plate; }
public DeloreanTimeMachine Spawn() { Model model = new Model(VehicleInfo.Model); if (model == null) { return(null); } Vehicle veh = World.GetClosestVehicle(VehicleInfo.Position, 1.0f, model); if (veh == null) { ModelHandler.RequestModel(model); veh = World.CreateVehicle(model, VehicleInfo.Position, VehicleInfo.Heading); } DeloreanTimeMachine _destinationCar = new DeloreanTimeMachine(veh, true, Mods.DeloreanType); ApplyTo(_destinationCar); return(_destinationCar); }
public void ApplyTo(DeloreanTimeMachine destinationCar) { VehicleInfo.ApplyTo(destinationCar.Vehicle, false); Mods.ApplyTo(destinationCar); Circuits.ApplyTo(destinationCar.Circuits); }
public DeloreanCopy(DeloreanTimeMachine sourceCar, bool noLastDisplacementCopy = false) { Mods = new DeloreanModsCopy(sourceCar.Mods); Circuits = new TimeCircuitsCopy(sourceCar.Circuits, noLastDisplacementCopy); VehicleInfo = new VehicleInfo(sourceCar.Vehicle); }