Example #1
0
        // ===================== Setup work =====================
        public override void SpawnSetup(Map map, bool respawningAfterLoad)
        {
            base.SpawnSetup(map, respawningAfterLoad);
            this.powerComp = base.GetComp <CompPowerTrader>();

            // Check if there is already another primary landing pad.
            if (this.Map.listerBuildings.ColonistsHaveBuilding(Util_ThingDefOf.LandingPad))
            {
                foreach (Building building in this.Map.listerBuildings.AllBuildingsColonistOfDef(Util_ThingDefOf.LandingPad))
                {
                    Building_LandingPad landingPad = building as Building_LandingPad;
                    if ((landingPad != this) &&
                        landingPad.isPrimary)
                    {
                        this.isPrimary = false;
                        break;
                    }
                }
            }
            if (this.beaconsAreSpawned == false)
            {
                SpawnBeacons();
                this.beaconsAreSpawned = true;
            }
            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                CheckForBlockingThing();
            }
            Util_OrbitalRelay.TryUpdateLandingPadAvailability(this.Map);
        }
 /// <summary>
 /// Notify beacons that powered is stopped.
 /// </summary>
 public void Notify_PowerStopped()
 {
     Util_OrbitalRelay.TryUpdateLandingPadAvailability(this.Map);
     foreach (Building building in this.Map.listerBuildings.AllBuildingsColonistOfDef(Util_ThingDefOf.LandingPadBeacon))
     {
         Building_LandingPadBeacon beacon = building as Building_LandingPadBeacon;
         if (beacon.landingPad == this)
         {
             beacon.Notify_PowerStopped();
         }
     }
 }
Example #3
0
        public override void Destroy(DestroyMode mode = DestroyMode.Vanish)
        {
            Map map = this.Map;

            // Destroy all landing pad beacons.
            foreach (IntVec3 cell in this.OccupiedRect().Cells)
            {
                Thing thing = cell.GetFirstThing(this.Map, Util_ThingDefOf.LandingPadBeacon);
                if (thing != null)
                {
                    thing.Destroy();
                }
            }
            Util_OrbitalRelay.TryUpdateLandingPadAvailability(map);
            base.Destroy(mode);
        }
Example #4
0
 public void NotifyShipTakingOff()
 {
     this.isReserved = false;
     Util_OrbitalRelay.TryUpdateLandingPadAvailability(this.Map);
 }
Example #5
0
 // ===================== Other functions =====================
 public void NotifyShipLanding()
 {
     this.isReserved = true;
     Util_OrbitalRelay.TryUpdateLandingPadAvailability(this.Map);
 }