protected override bool CanFireNowSub(IIncidentTarget target)
        {
            if (base.CanFireNowSub(target) == false)
            {
                return(false);
            }
            if (Util_Faction.MiningCoFaction.HostileTo(Faction.OfPlayer))
            {
                return(false);
            }
            Map map = (Map)target;

            if (Expedition.IsTemperatureValidForExpedition(map))
            {
                Building_OrbitalRelay orbitalRelay = Util_OrbitalRelay.GetOrbitalRelay(map);
                if ((orbitalRelay != null) &&
                    (orbitalRelay.powerComp.PowerOn))
                {
                    Building_LandingPad landingPad = Util_LandingPad.GetBestAvailableLandingPadReachingMapEdge(map);
                    if (landingPad != null)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            Map map = (Map)parms.target;
            Building_LandingPad landingPad = Util_LandingPad.GetBestAvailableLandingPadReachingMapEdge(map);

            if (landingPad == null)
            {
                // Should not happen if CanFireNowSub returned true.
                return(false);
            }

            // Spawn landing dispatcher spaceship.
            FlyingSpaceshipLanding dispatcherSpaceship = Util_Spaceship.SpawnSpaceship(landingPad, SpaceshipKind.DispatcherDrop);

            return(true);
        }
Esempio n. 3
0
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            Map map = (Map)parms.target;
            Building_LandingPad landingPad = Util_LandingPad.GetBestAvailableLandingPadReachingMapEdge(map);

            if (landingPad == null)
            {
                // Should not happen if CanFireNowSub returned true.
                return(false);
            }

            // Spawn landing dispatcher spaceship.
            FlyingSpaceshipLanding dispatcherSpaceship = Util_Spaceship.SpawnLandingSpaceship(landingPad, SpaceshipKind.DispatcherPick);

            // Spawn expedition team.
            List <Pawn> teamPawns = Expedition.GenerateExpeditionPawns(map);

            if (Rand.Value < 0.2f)
            {
                ApplyInjuriesOrIllnessToTeam(map, teamPawns);
            }
            return(SpawnTeamOnMapEdge(landingPad.Position, map, teamPawns));
        }