Ejemplo n.º 1
0
 public void InitiateCrashEvent(WorldObject worldObject)
 {
     vehicle.CompVehicleLauncher.inFlight = false;
     Tile = WorldHelper.GetNearestTile(DrawPos);
     ResetPosition(Find.WorldGrid.GetTileCenter(Tile));
     flightPath.ResetPath();
     AirDefensePositionTracker.DeregisterAerialVehicle(this);
     (VehicleIncidentDefOf.BlackHawkDown.Worker as IncidentWorker_ShuttleDowned).TryExecuteEvent(this, worldObject);
 }
Ejemplo n.º 2
0
 public virtual void MoveForward()
 {
     transition += speedPctPerTick;
     if (transition >= 1)
     {
         if (flightPath.Path.Count > 1)
         {
             Vector3 newPos    = DrawPos;
             int     ticksLeft = Mathf.RoundToInt(1 / speedPctPerTick);
             flightPath.NodeReached(ticksLeft > TicksTillLandingElevation && !recon);
             if (Spawned)
             {
                 InitializeNextFlight(newPos);
             }
         }
         else
         {
             if (Elevation <= vehicle.CompVehicleLauncher.LandingAltitude)
             {
                 Messages.Message("VehicleAerialArrived".Translate(vehicle.LabelShort), MessageTypeDefOf.NeutralEvent);
                 Tile = flightPath.First.tile;
                 if (arrivalAction is AerialVehicleArrivalAction action)
                 {
                     action.Arrived(flightPath.First.tile);
                     if (action.DestroyOnArrival)
                     {
                         Destroy();
                     }
                 }
                 vehicle.CompVehicleLauncher.inFlight = false;
                 AirDefensePositionTracker.DeregisterAerialVehicle(this);
             }
             else if (flightPath.Path.Count <= 1 && vehicle.CompVehicleLauncher.Props.circleToLand)
             {
                 Vector3 newPos = DrawPos;
                 SetCircle(flightPath.First.tile);
                 InitializeNextFlight(newPos);
             }
         }
     }
 }