Esempio n. 1
0
        public void TryLaunch(int destinationTile, AerialVehicleArrivalAction arrivalAction, bool recon = false)
        {
            if (!Vehicle.Spawned)
            {
                Log.Error("Tried to launch " + Vehicle + ", but it's unspawned.");
                return;
            }
            List <FlightNode> flightPath = LaunchTargeter.FlightPath;

            if (flightPath.LastOrDefault().tile != destinationTile)
            {
                flightPath.Add(new FlightNode(destinationTile, null));
            }
            Vehicle.CompVehicleLauncher.inFlight = true;
            VehicleSkyfaller_Leaving vehicleLeaving = (VehicleSkyfaller_Leaving)ThingMaker.MakeThing(Props.skyfallerLeaving);

            vehicleLeaving.arrivalAction = arrivalAction;
            vehicleLeaving.vehicle       = Vehicle;
            vehicleLeaving.flightPath    = new List <FlightNode>(flightPath);
            vehicleLeaving.orderRecon    = recon;
            GenSpawn.Spawn(vehicleLeaving, Vehicle.Position, Vehicle.Map, Vehicle.Rotation, WipeMode.Vanish);

            if (Vehicle.Spawned)
            {
                Vehicle.DeSpawn(DestroyMode.Vanish);
            }
            Find.WorldPawns.PassToWorld(Vehicle);

            CameraJumper.TryHideWorld();
        }
Esempio n. 2
0
 public void NewDestination(int destinationTile, AerialVehicleArrivalAction arrivalAction, bool recon = false)
 {
     vehicle.CompVehicleLauncher.inFlight = true;
     this.arrivalAction = arrivalAction;
     this.recon         = recon;
     OrderFlyToTiles(LaunchTargeter.FlightPath, DrawPos, arrivalAction);
 }
Esempio n. 3
0
        public void OrderFlyToTiles(List <FlightNode> flightPath, Vector3 origin, AerialVehicleArrivalAction arrivalAction = null)
        {
            if (flightPath.NullOrEmpty() || flightPath.Any(node => node.tile < 0))
            {
                return;
            }
            if (arrivalAction != null)
            {
                this.arrivalAction = arrivalAction;
            }
            this.flightPath.NewPath(flightPath);
            InitializeNextFlight(origin);
            var flyoverDefenses = AirDefensePositionTracker.CheckNearbyObjects(this, speedPctPerTick)?.ToHashSet() ?? new HashSet <AirDefense>();

            AirDefensePositionTracker.RegisterAerialVehicle(this, flyoverDefenses);
        }
Esempio n. 4
0
 public override void RegisterActionOnTile(int tile, AerialVehicleArrivalAction arrivalAction)
 {
     FlightPath.Pop();
     FlightPath.Add(new FlightNode(tile, arrivalAction));
 }
Esempio n. 5
0
 public void AddNode(int tile, AerialVehicleArrivalAction arrivalAction = null)
 {
     nodes.Add(new FlightNode(tile, arrivalAction));
 }
Esempio n. 6
0
 public FlightNode(int tile, AerialVehicleArrivalAction arrivalAction)
 {
     this.tile          = tile;
     this.arrivalAction = arrivalAction;
 }
Esempio n. 7
0
 public FlightNode(int tile)
 {
     this.tile     = tile;
     arrivalAction = null;
 }
 public abstract void RegisterActionOnTile(int tile, AerialVehicleArrivalAction arrivalAction);