Пример #1
0
        private static void CountdownEnded()
        {
            List <Building> list          = ShipUtility.ShipBuildingsAttachedTo(ShipCountdown.shipRoot).ToList <Building>();
            StringBuilder   stringBuilder = new StringBuilder();

            foreach (Building current in list)
            {
                Building_CryptosleepCasket building_CryptosleepCasket = current as Building_CryptosleepCasket;
                if (building_CryptosleepCasket != null && building_CryptosleepCasket.HasAnyContents)
                {
                    stringBuilder.AppendLine("   " + building_CryptosleepCasket.ContainedThing.LabelCap);
                    Find.StoryWatcher.statsRecord.colonistsLaunched++;
                    TaleRecorder.RecordTale(TaleDefOf.LaunchedShip, new object[]
                    {
                        building_CryptosleepCasket.ContainedThing
                    });
                }
                current.Destroy(DestroyMode.Vanish);
            }
            string victoryText = "GameOverShipLaunched".Translate(new object[]
            {
                stringBuilder.ToString(),
                GameVictoryUtility.PawnsLeftBehind()
            });

            GameVictoryUtility.ShowCredits(victoryText);
        }
Пример #2
0
 private static void CountdownEnded()
 {
     if (shipRoot != null)
     {
         List <Building> list          = ShipUtility.ShipBuildingsAttachedTo(shipRoot).ToList();
         StringBuilder   stringBuilder = new StringBuilder();
         foreach (Building item in list)
         {
             Building_CryptosleepCasket building_CryptosleepCasket = item as Building_CryptosleepCasket;
             if (building_CryptosleepCasket != null && building_CryptosleepCasket.HasAnyContents)
             {
                 stringBuilder.AppendLine("   " + building_CryptosleepCasket.ContainedThing.LabelCap);
                 Find.StoryWatcher.statsRecord.colonistsLaunched++;
                 TaleRecorder.RecordTale(TaleDefOf.LaunchedShip, building_CryptosleepCasket.ContainedThing);
             }
         }
         GameVictoryUtility.ShowCredits(GameVictoryUtility.MakeEndCredits("GameOverShipLaunchedIntro".Translate(), "GameOverShipLaunchedEnding".Translate(), stringBuilder.ToString()));
         foreach (Building item2 in list)
         {
             item2.Destroy();
         }
     }
     else if (!customLaunchString.NullOrEmpty())
     {
         GameVictoryUtility.ShowCredits(customLaunchString);
     }
     else
     {
         GameVictoryUtility.ShowCredits(GameVictoryUtility.MakeEndCredits("GameOverShipLaunchedIntro".Translate(), "GameOverShipLaunchedEnding".Translate(), null));
     }
 }
        public override void Notify_QuestSignalReceived(Signal signal)
        {
            base.Notify_QuestSignalReceived(signal);
            if (!(signal.tag == inSignal) || ShipCountdown.CountingDown)
            {
                return;
            }
            if (!Find.TickManager.Paused)
            {
                Find.TickManager.CurTimeSpeed = TimeSpeed.Normal;
            }
            if (!signal.args.TryGetArg("SENTCOLONISTS", out List <Pawn> arg))
            {
                arg = null;
            }
            StringBuilder stringBuilder = new StringBuilder();

            if (arg != null)
            {
                for (int i = 0; i < arg.Count; i++)
                {
                    stringBuilder.AppendLine("   " + arg[i].LabelCap);
                }
                Find.StoryWatcher.statsRecord.colonistsLaunched += arg.Count;
            }
            ShipCountdown.InitiateCountdown(GameVictoryUtility.MakeEndCredits(introText, endingText, stringBuilder.ToString()));
            if (arg == null)
            {
                return;
            }
            for (int j = 0; j < arg.Count; j++)
            {
                if (!arg[j].Destroyed)
                {
                    arg[j].Destroy();
                }
            }
        }