Beispiel #1
0
        public static void ParticipateInFlareupPostfix(SimGameState __instance, bool __state)
        {
            try {
                // __state is used to tell the postfix (from the prefix) that we're in the middle of accepting a flareup
                if (!__state)
                {
                    return;
                }

                Flareup flareup = Utilities.currentFlareup();
                if (flareup == null)
                {
                    return;
                }

                // Clean up the opposite-side travel contract, if it exists
                __instance.ClearBreadcrumb();
                flareup.removeParticipationContracts();

                // When the player arrives, we start the flareup the next day - it's only fair not to make them wait around. :)
                flareup.countdown        = 0;
                flareup.daysUntilMission = 1;

                WIIC.modLog.Info?.Write($"Player embarked on flareup at {flareup.location.Name}.");

                __instance.SetSimRoomState(DropshipLocation.SHIP);
                __instance.RoomManager.AddWorkQueueEntry(flareup.workOrder);
                __instance.RoomManager.RefreshTimeline(false);
            } catch (Exception e) {
                WIIC.modLog.Error?.Write(e);
            }
        }
Beispiel #2
0
        public static void SetCurrentSystemPrefix(StarSystem system, bool force = false, bool timeSkip = false)
        {
            try {
                WIIC.modLog.Debug?.Write($"Entering system {system.ID} from {WIIC.sim.CurSystem.ID}");

                if (WIIC.flareups.ContainsKey(WIIC.sim.CurSystem.ID))
                {
                    WIIC.modLog.Debug?.Write($"Found flareup from previous system, cleaning up contracts");
                    Flareup prevFlareup = WIIC.flareups[WIIC.sim.CurSystem.ID];
                    prevFlareup.removeParticipationContracts();
                }

                if (WIIC.flareups.ContainsKey(system.ID))
                {
                    WIIC.modLog.Debug?.Write($"Found flareup for new system, adding contracts");
                    WIIC.flareups[system.ID].spawnParticipationContracts();
                }
            } catch (Exception e) {
                WIIC.modLog.Error?.Write(e);
            }
        }