public override void Cleanup()
        {
            base.Cleanup();             // there's nothing in the base call (at the moment), but just in case in the future there's something

            // get pawns that spawned from Reunion
            var listToReturn = pawns.FindAll((pawn) =>
            {
                return(pawn.Faction != Faction.OfPlayer && GameComponent.ListAllySpawned.Contains(pawn.GetUniqueLoadID()));
            });

            GameComponent.FlagNextEventReadyForScheduling();
            foreach (var pawn in listToReturn)
            {
                GameComponent.ReturnToAvailable(pawn, GameComponent.ListAllySpawned, GameComponent.ListAllyAvailable);
            }

            if (quest.State == QuestState.EndedOfferExpired)
            {
                saveByReference = true;
            }
            else
            {
                GameComponent.TryScheduleNextEvent(ScheduleMode.Forced);
            }
        }
Example #2
0
        public static void OnPostDestroyReschedule(SitePart sitePart)
        {
            // If recruited, will have been flagged on map generate: schedule will fire on DoRecruit
            // If abandoned but pawn alive, also will have been flagged on map generate: schedule will fire on PassToWorld

            // If quest failed without entering the map, flag here: schedule will fire on PassToWorld
            if (GameComponent.NextEventTick == -1)
            {
                GameComponent.FlagNextEventReadyForScheduling();
            }

            if (sitePart.things != null && sitePart.things.Any)
            {
                Pawn pawn = (Pawn)sitePart.things[0];
                // If pawn is dead on post destroy: schedule it HERE!
                if (pawn.Dead)
                {
                    GameComponent.TryScheduleNextEvent();
                }
            }
            // No "thing" in SitePart, pawn is recruited, or something else happened.
            // As mentioned above, if recruited, schedule will already have fired on DoRecruit.
            // If not recruited for whatever reason (likely dead, according to tests): schedule it HERE!
            else if (GameComponent.NextEventTick == 0)
            {
                GameComponent.TryScheduleNextEvent();
            }
        }
Example #3
0
 public override void PostMapGenerate(Map map)
 {
     base.PostMapGenerate(map);
     GameComponent.FlagNextEventReadyForScheduling();
 }