Example #1
0
    public override void PlaySound(AnimEventManager.EventPlayerData behaviour)
    {
        Vector3 position  = behaviour.GetComponent <Transform>().GetPosition();
        Worker  component = behaviour.GetComponent <Worker>();

        if ((UnityEngine.Object)component == (UnityEngine.Object)null)
        {
            SoundEvent.PlayOneShot(GlobalAssets.GetSound("Building_Dmg_Metal", false), position);
        }
        else
        {
            Workable workable = component.workable;
            if ((UnityEngine.Object)workable != (UnityEngine.Object)null)
            {
                Building component2 = workable.GetComponent <Building>();
                if ((UnityEngine.Object)component2 != (UnityEngine.Object)null)
                {
                    BuildingDef def   = component2.Def;
                    string      name  = StringFormatter.Combine(base.name, "_", def.AudioCategory);
                    string      sound = GlobalAssets.GetSound(name, false);
                    if (sound == null)
                    {
                        name  = "Building_Dmg_Metal";
                        sound = GlobalAssets.GetSound(name, false);
                    }
                    if (sound != null)
                    {
                        SoundEvent.PlayOneShot(sound, position);
                    }
                }
            }
        }
    }
Example #2
0
            public static void Postfix(Workable __instance)
            {
                try
                {
                    if (Game.Instance == null)
                    {
                        return;
                    }

                    var door = __instance.GetComponent <Door>();

                    if (door != null && !State.DoorIcons.ContainsKey(door))
                    {
                        var icon = IconManager.CreateIcon(door);

                        State.DoorIcons.Add
                        (
                            door,
                            icon
                        );

                        __instance.gameObject.Subscribe((int)GameHashes.LogicEvent, data => IconManager.UpdateIcon(door));
                        __instance.gameObject.Subscribe((int)GameHashes.DoorStateChanged, data => IconManager.UpdateIcon(door));
                        __instance.gameObject.Subscribe((int)GameHashes.CopySettings, data => IconManager.UpdateIcon(door));
                        __instance.gameObject.Subscribe((int)GameHashes.DoorControlStateChanged, data => IconManager.UpdateIcon(door));
                    }
                }
                catch (Exception e)
                {
                    State.Common.Logger.LogOnce("Error while trying to create door icon", e);
                }
            }
            private static void Postfix(Workable __instance, ref float __result)
            {
                var tinkerableWorkable = __instance.GetComponent <TinkerableWorkable>();

                if (tinkerableWorkable != null)
                {
                    __result *= tinkerableWorkable.GetCraftingSpeedMultiplier();
                }
            }
Example #4
0
    public override void OnPlay(AnimEventManager.EventPlayerData behaviour)
    {
        if (!string.IsNullOrEmpty(base.sound) && SoundEvent.ShouldPlaySound(behaviour.controller, base.sound, base.looping, isDynamic))
        {
            int        num        = -1;
            GameObject gameObject = behaviour.controller.gameObject;
            if (counterModulus >= -1)
            {
                HandleVector <int> .Handle h = GameComps.WhiteBoards.GetHandle(gameObject);
                if (!h.IsValid())
                {
                    h = GameComps.WhiteBoards.Add(gameObject);
                }
                num = (GameComps.WhiteBoards.HasValue(h, base.soundHash) ? ((int)GameComps.WhiteBoards.GetValue(h, base.soundHash)) : 0);
                int num2 = (counterModulus != -1) ? ((num + 1) % counterModulus) : 0;
                GameComps.WhiteBoards.SetValue(h, base.soundHash, num2);
            }
            Vector3 position  = behaviour.GetComponent <Transform>().GetPosition();
            string  sound     = GlobalAssets.GetSound("Hammer_sculpture", false);
            Worker  component = behaviour.GetComponent <Worker>();
            if ((UnityEngine.Object)component != (UnityEngine.Object)null)
            {
                Workable workable = component.workable;
                if ((UnityEngine.Object)workable != (UnityEngine.Object)null)
                {
                    Building component2 = workable.GetComponent <Building>();
                    if ((UnityEngine.Object)component2 != (UnityEngine.Object)null)
                    {
                        BuildingDef def = component2.Def;
                        switch (def.name)
                        {
                        case "MetalSculpture":
                            sound = GlobalAssets.GetSound("Hammer_sculpture_metal", false);
                            break;

                        case "MarbleSculpture":
                            sound = GlobalAssets.GetSound("Hammer_sculpture_marble", false);
                            break;
                        }
                    }
                }
            }
            EventInstance instance = SoundEvent.BeginOneShot(sound, position);
            if (instance.isValid())
            {
                if (num >= 0)
                {
                    instance.setParameterValue("eventCount", (float)num);
                }
                SoundEvent.EndOneShot(instance);
            }
        }
    }
Example #5
0
    public override void PlaySound(AnimEventManager.EventPlayerData behaviour)
    {
        Vector3  position = behaviour.GetComponent <Transform>().GetPosition();
        Workable workable = behaviour.GetComponent <Worker>().workable;

        if ((UnityEngine.Object)workable != (UnityEngine.Object)null)
        {
            Toggleable component = workable.GetComponent <Toggleable>();
            if ((UnityEngine.Object)component != (UnityEngine.Object)null)
            {
                IToggleHandler toggleHandlerForWorker = component.GetToggleHandlerForWorker(behaviour.GetComponent <Worker>());
                float          value = 1f;
                if (toggleHandlerForWorker != null && toggleHandlerForWorker.IsHandlerOn())
                {
                    value = 0f;
                }
                EventInstance instance = SoundEvent.BeginOneShot(base.sound, position);
                instance.setParameterValue("State", value);
                SoundEvent.EndOneShot(instance);
            }
        }
    }
Example #6
0
        protected static void RemoveDupe(Workable instance, Chore chore, Func <Workable, bool> isEndlessWorking)
        {
            KSelectable kSelectable = instance.GetComponent <KSelectable>();

            if (isEndlessWorking(instance) && chore != null)
            {
                bool isBeingWorked = false;
                if (chore.driver != null)
                {
                    isBeingWorked = true;
                    if (!ShouldChoreBeWorked(chore))
                    {
                        chore.driver.StopChore();
                    }
                }
                kSelectable.ToggleStatusItem(requiresAttributeRange, !isBeingWorked, GetAttributeRange(chore));
            }
            else
            {
                kSelectable.ToggleStatusItem(requiresAttributeRange, false);
            }
        }
Example #7
0
 static bool IsEndlessWorking(Workable instance) => Research.Instance.GetActiveResearch() == null && instance.GetComponent <InfiniteModeToggleButton>().isInfiniteMode;
Example #8
0
        private void CreateStatusItems()
        {
            Func <string, object, string> resolveStringCallback = delegate(string str, object data)
            {
                Workable workable3 = (Workable)data;
                if ((UnityEngine.Object)workable3 != (UnityEngine.Object)null)
                {
                    str = str.Replace("{Target}", workable3.GetComponent <KSelectable>().GetName());
                }
                return(str);
            };
            Func <string, object, string> resolveStringCallback2 = delegate(string str, object data)
            {
                Workable workable2 = (Workable)data;
                if ((UnityEngine.Object)workable2 != (UnityEngine.Object)null)
                {
                    str = str.Replace("{Target}", workable2.GetComponent <KSelectable>().GetName());
                    ComplexFabricatorWorkable complexFabricatorWorkable = workable2 as ComplexFabricatorWorkable;
                    if ((UnityEngine.Object)complexFabricatorWorkable != (UnityEngine.Object)null)
                    {
                        ComplexRecipe currentWorkingOrder = complexFabricatorWorkable.CurrentWorkingOrder;
                        if (currentWorkingOrder != null)
                        {
                            str = str.Replace("{Item}", currentWorkingOrder.FirstResult.ProperName());
                        }
                    }
                }
                return(str);
            };

            BedUnreachable = CreateStatusItem("BedUnreachable", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            BedUnreachable.AddNotification(null, null, null, 0f);
            DailyRationLimitReached = CreateStatusItem("DailyRationLimitReached", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            DailyRationLimitReached.AddNotification(null, null, null, 0f);
            HoldingBreath = CreateStatusItem("HoldingBreath", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            Hungry        = CreateStatusItem("Hungry", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            Unhappy       = CreateStatusItem("Unhappy", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            Unhappy.AddNotification(null, null, null, 0f);
            NervousBreakdown = CreateStatusItem("NervousBreakdown", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Bad, false, OverlayModes.None.ID, true, 2);
            NervousBreakdown.AddNotification(null, null, null, 0f);
            NoRationsAvailable       = CreateStatusItem("NoRationsAvailable", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Bad, false, OverlayModes.None.ID, true, 2);
            PendingPacification      = CreateStatusItem("PendingPacification", "DUPLICANTS", "status_item_pending_pacification", StatusItem.IconType.Custom, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            QuarantineAreaUnassigned = CreateStatusItem("QuarantineAreaUnassigned", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            QuarantineAreaUnassigned.AddNotification(null, null, null, 0f);
            QuarantineAreaUnreachable = CreateStatusItem("QuarantineAreaUnreachable", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            QuarantineAreaUnreachable.AddNotification(null, null, null, 0f);
            Quarantined        = CreateStatusItem("Quarantined", "DUPLICANTS", "status_item_quarantined", StatusItem.IconType.Custom, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            RationsUnreachable = CreateStatusItem("RationsUnreachable", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            RationsUnreachable.AddNotification(null, null, null, 0f);
            RationsNotPermitted = CreateStatusItem("RationsNotPermitted", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            RationsNotPermitted.AddNotification(null, null, null, 0f);
            Rotten   = CreateStatusItem("Rotten", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            Starving = CreateStatusItem("Starving", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Bad, false, OverlayModes.None.ID, true, 2);
            Starving.AddNotification(null, null, null, 0f);
            Suffocating = CreateStatusItem("Suffocating", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.DuplicantThreatening, false, OverlayModes.None.ID, true, 2);
            Suffocating.AddNotification(null, null, null, 0f);
            Tired = CreateStatusItem("Tired", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            Idle  = CreateStatusItem("Idle", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            Idle.AddNotification(null, null, null, 0f);
            Pacified = CreateStatusItem("Pacified", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Dead     = CreateStatusItem("Dead", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            Dead.resolveStringCallback = delegate(string str, object data)
            {
                Death death = (Death)data;
                return(str.Replace("{Death}", death.Name));
            };
            MoveToSuitNotRequired   = CreateStatusItem("MoveToSuitNotRequired", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            DroppingUnusedInventory = CreateStatusItem("DroppingUnusedInventory", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            MovingToSafeArea        = CreateStatusItem("MovingToSafeArea", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            ToiletUnreachable       = CreateStatusItem("ToiletUnreachable", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            ToiletUnreachable.AddNotification(null, null, null, 0f);
            NoUsableToilets = CreateStatusItem("NoUsableToilets", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            NoUsableToilets.AddNotification(null, null, null, 0f);
            NoToilets = CreateStatusItem("NoToilets", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            NoToilets.AddNotification(null, null, null, 0f);
            BreathingO2 = CreateStatusItem("BreathingO2", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 130);
            BreathingO2.resolveStringCallback = delegate(string str, object data)
            {
                OxygenBreather oxygenBreather2 = (OxygenBreather)data;
                float          averageRate     = Game.Instance.accumulators.GetAverageRate(oxygenBreather2.O2Accumulator);
                return(str.Replace("{ConsumptionRate}", GameUtil.GetFormattedMass(0f - averageRate, GameUtil.TimeSlice.PerSecond, GameUtil.MetricMassFormat.UseThreshold, true, "{0:0.#}")));
            };
            EmittingCO2 = CreateStatusItem("EmittingCO2", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 130);
            EmittingCO2.resolveStringCallback = delegate(string str, object data)
            {
                OxygenBreather oxygenBreather = (OxygenBreather)data;
                return(str.Replace("{EmittingRate}", GameUtil.GetFormattedMass(oxygenBreather.CO2EmitRate, GameUtil.TimeSlice.PerSecond, GameUtil.MetricMassFormat.UseThreshold, true, "{0:0.#}")));
            };
            Vomiting  = CreateStatusItem("Vomiting", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            Coughing  = CreateStatusItem("Coughing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            LowOxygen = CreateStatusItem("LowOxygen", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            LowOxygen.AddNotification(null, null, null, 0f);
            RedAlert = CreateStatusItem("RedAlert", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Sleeping = CreateStatusItem("Sleeping", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Sleeping.resolveTooltipCallback = delegate(string str, object data)
            {
                if (data is SleepChore.StatesInstance)
                {
                    SleepChore.StatesInstance statesInstance2 = (SleepChore.StatesInstance)data;
                    string stateChangeNoiseSource             = statesInstance2.stateChangeNoiseSource;
                    if (!string.IsNullOrEmpty(stateChangeNoiseSource))
                    {
                        string text5 = DUPLICANTS.STATUSITEMS.SLEEPING.TOOLTIP;
                        text5 = text5.Replace("{Disturber}", stateChangeNoiseSource);
                        str  += text5;
                    }
                }
                return(str);
            };
            SleepingInterruptedByNoise = CreateStatusItem("SleepingInterruptedByNoise", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            SleepingInterruptedByLight = CreateStatusItem("SleepingInterruptedByLight", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Eating = CreateStatusItem("Eating", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Eating.resolveStringCallback = resolveStringCallback;
            Digging  = CreateStatusItem("Digging", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Cleaning = CreateStatusItem("Cleaning", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Cleaning.resolveStringCallback = resolveStringCallback;
            PickingUp = CreateStatusItem("PickingUp", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            PickingUp.resolveStringCallback = resolveStringCallback;
            Mopping = CreateStatusItem("Mopping", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Cooking = CreateStatusItem("Cooking", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Cooking.resolveStringCallback = resolveStringCallback2;
            Mushing = CreateStatusItem("Mushing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Mushing.resolveStringCallback = resolveStringCallback2;
            Researching = CreateStatusItem("Researching", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Researching.resolveStringCallback = delegate(string str, object data)
            {
                TechInstance activeResearch = Research.Instance.GetActiveResearch();
                if (activeResearch != null)
                {
                    return(str.Replace("{Tech}", activeResearch.tech.Name));
                }
                return(str);
            };
            Tinkering = CreateStatusItem("Tinkering", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Tinkering.resolveStringCallback = delegate(string str, object data)
            {
                Tinkerable tinkerable = (Tinkerable)data;
                if ((UnityEngine.Object)tinkerable != (UnityEngine.Object)null)
                {
                    return(string.Format(str, tinkerable.tinkerMaterialTag.ProperName()));
                }
                return(str);
            };
            Storing = CreateStatusItem("Storing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Storing.resolveStringCallback = delegate(string str, object data)
            {
                Workable workable = (Workable)data;
                if ((UnityEngine.Object)workable != (UnityEngine.Object)null && (UnityEngine.Object)workable.worker != (UnityEngine.Object)null)
                {
                    KSelectable component = workable.GetComponent <KSelectable>();
                    if ((bool)component)
                    {
                        str = str.Replace("{Target}", component.GetName());
                    }
                    Pickupable pickupable = workable.worker.workCompleteData as Pickupable;
                    if ((UnityEngine.Object)workable.worker != (UnityEngine.Object)null && (bool)pickupable)
                    {
                        KSelectable component2 = pickupable.GetComponent <KSelectable>();
                        if ((bool)component2)
                        {
                            str = str.Replace("{Item}", component2.GetName());
                        }
                    }
                }
                return(str);
            };
            Building = CreateStatusItem("Building", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Building.resolveStringCallback = resolveStringCallback;
            Equipping = CreateStatusItem("Equipping", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Equipping.resolveStringCallback = resolveStringCallback;
            WarmingUp = CreateStatusItem("WarmingUp", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            WarmingUp.resolveStringCallback = resolveStringCallback;
            GeneratingPower = CreateStatusItem("GeneratingPower", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            GeneratingPower.resolveStringCallback = resolveStringCallback;
            Harvesting = CreateStatusItem("Harvesting", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Harvesting.resolveStringCallback = resolveStringCallback;
            Uprooting = CreateStatusItem("Uprooting", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Uprooting.resolveStringCallback = resolveStringCallback;
            Emptying = CreateStatusItem("Emptying", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Emptying.resolveStringCallback = resolveStringCallback;
            Toggling = CreateStatusItem("Toggling", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Toggling.resolveStringCallback = resolveStringCallback;
            Deconstructing = CreateStatusItem("Deconstructing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Deconstructing.resolveStringCallback = resolveStringCallback;
            Disinfecting = CreateStatusItem("Disinfecting", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Disinfecting.resolveStringCallback = resolveStringCallback;
            Upgrading = CreateStatusItem("Upgrading", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Upgrading.resolveStringCallback = resolveStringCallback;
            Fabricating = CreateStatusItem("Fabricating", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Fabricating.resolveStringCallback = resolveStringCallback2;
            Processing = CreateStatusItem("Processing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Processing.resolveStringCallback = resolveStringCallback2;
            Clearing = CreateStatusItem("Clearing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Clearing.resolveStringCallback = resolveStringCallback;
            GeneratingPower = CreateStatusItem("GeneratingPower", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            GeneratingPower.resolveStringCallback = resolveStringCallback;
            Cold = CreateStatusItem("Cold", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            Cold.resolveTooltipCallback = delegate(string str, object data)
            {
                str = str.Replace("{StressModification}", GameUtil.GetFormattedPercent(Db.Get().effects.Get("ColdAir").SelfModifiers[0].Value, GameUtil.TimeSlice.PerCycle));
                float dtu_s2 = ((ExternalTemperatureMonitor.Instance)data).temperatureTransferer.average_kilowatts_exchanged.GetWeightedAverage * 1000f;
                str = str.Replace("{currentTransferWattage}", GameUtil.GetFormattedHeatEnergyRate(dtu_s2, GameUtil.HeatEnergyFormatterUnit.Automatic));
                AttributeInstance attributeInstance3 = ((ExternalTemperatureMonitor.Instance)data).attributes.Get("ThermalConductivityBarrier");
                string            text3 = "<b>" + attributeInstance3.GetFormattedValue() + "</b>";
                for (int j = 0; j != attributeInstance3.Modifiers.Count; j++)
                {
                    AttributeModifier attributeModifier2 = attributeInstance3.Modifiers[j];
                    text3 += "\n";
                    string text4 = text3;
                    text3 = text4 + "    • " + attributeModifier2.GetDescription() + " <b>" + attributeModifier2.GetFormattedString(attributeInstance3.gameObject) + "</b>";
                }
                str = str.Replace("{conductivityBarrier}", text3);
                return(str);
            };
            Hot = CreateStatusItem("Hot", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            Hot.resolveTooltipCallback = delegate(string str, object data)
            {
                str = str.Replace("{StressModification}", GameUtil.GetFormattedPercent(Db.Get().effects.Get("WarmAir").SelfModifiers[0].Value, GameUtil.TimeSlice.PerCycle));
                float dtu_s = ((ExternalTemperatureMonitor.Instance)data).temperatureTransferer.average_kilowatts_exchanged.GetWeightedAverage * 1000f;
                str = str.Replace("{currentTransferWattage}", GameUtil.GetFormattedHeatEnergyRate(dtu_s, GameUtil.HeatEnergyFormatterUnit.Automatic));
                AttributeInstance attributeInstance2 = ((ExternalTemperatureMonitor.Instance)data).attributes.Get("ThermalConductivityBarrier");
                string            text = "<b>" + attributeInstance2.GetFormattedValue() + "</b>";
                for (int i = 0; i != attributeInstance2.Modifiers.Count; i++)
                {
                    AttributeModifier attributeModifier = attributeInstance2.Modifiers[i];
                    text += "\n";
                    string text2 = text;
                    text = text2 + "    • " + attributeModifier.GetDescription() + " <b>" + attributeModifier.GetFormattedString(attributeInstance2.gameObject) + "</b>";
                }
                str = str.Replace("{conductivityBarrier}", text);
                return(str);
            };
            BodyRegulatingHeating = CreateStatusItem("BodyRegulatingHeating", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            BodyRegulatingHeating.resolveStringCallback = delegate(string str, object data)
            {
                WarmBlooded.StatesInstance statesInstance = (WarmBlooded.StatesInstance)data;
                return(str.Replace("{TempDelta}", GameUtil.GetFormattedTemperature(statesInstance.TemperatureDelta, GameUtil.TimeSlice.PerSecond, GameUtil.TemperatureInterpretation.Relative, true, false)));
            };
            BodyRegulatingCooling = CreateStatusItem("BodyRegulatingCooling", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            BodyRegulatingCooling.resolveStringCallback = BodyRegulatingHeating.resolveStringCallback;
            EntombedChore = CreateStatusItem("EntombedChore", "DUPLICANTS", "status_item_entombed", StatusItem.IconType.Custom, NotificationType.DuplicantThreatening, false, OverlayModes.None.ID, true, 2);
            EntombedChore.AddNotification(null, null, null, 0f);
            EarlyMorning                 = CreateStatusItem("EarlyMorning", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            NightTime                    = CreateStatusItem("NightTime", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            PoorDecor                    = CreateStatusItem("PoorDecor", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            PoorQualityOfLife            = CreateStatusItem("PoorQualityOfLife", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            PoorFoodQuality              = CreateStatusItem("PoorFoodQuality", DUPLICANTS.STATUSITEMS.POOR_FOOD_QUALITY.NAME, DUPLICANTS.STATUSITEMS.POOR_FOOD_QUALITY.TOOLTIP, string.Empty, StatusItem.IconType.Exclamation, NotificationType.Neutral, false, OverlayModes.None.ID, 2);
            GoodFoodQuality              = CreateStatusItem("GoodFoodQuality", DUPLICANTS.STATUSITEMS.GOOD_FOOD_QUALITY.NAME, DUPLICANTS.STATUSITEMS.GOOD_FOOD_QUALITY.TOOLTIP, string.Empty, StatusItem.IconType.Exclamation, NotificationType.Neutral, false, OverlayModes.None.ID, 2);
            Arting                       = CreateStatusItem("Arting", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Arting.resolveStringCallback = resolveStringCallback;
            SevereWounds                 = CreateStatusItem("SevereWounds", "DUPLICANTS", "status_item_broken", StatusItem.IconType.Custom, NotificationType.Bad, false, OverlayModes.None.ID, true, 2);
            SevereWounds.AddNotification(null, null, null, 0f);
            Incapacitated = CreateStatusItem("Incapacitated", "DUPLICANTS", "status_item_broken", StatusItem.IconType.Custom, NotificationType.DuplicantThreatening, false, OverlayModes.None.ID, true, 2);
            Incapacitated.AddNotification(null, null, null, 0f);
            Incapacitated.resolveStringCallback = delegate(string str, object data)
            {
                IncapacitationMonitor.Instance instance = (IncapacitationMonitor.Instance)data;
                float bleedLifeTime = instance.GetBleedLifeTime(instance);
                str = str.Replace("{CauseOfIncapacitation}", instance.GetCauseOfIncapacitation().Name);
                return(str.Replace("{TimeUntilDeath}", GameUtil.GetFormattedTime(bleedLifeTime)));
            };
            Relocating = CreateStatusItem("Relocating", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Relocating.resolveStringCallback = resolveStringCallback;
            Fighting = CreateStatusItem("Fighting", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Bad, false, OverlayModes.None.ID, true, 2);
            Fighting.AddNotification(null, null, null, 0f);
            Fleeing = CreateStatusItem("Fleeing", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Bad, false, OverlayModes.None.ID, true, 2);
            Fleeing.AddNotification(null, null, null, 0f);
            Stressed = CreateStatusItem("Stressed", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Stressed.AddNotification(null, null, null, 0f);
            LashingOut = CreateStatusItem("LashingOut", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Bad, false, OverlayModes.None.ID, true, 2);
            LashingOut.AddNotification(null, null, null, 0f);
            LowImmunity = CreateStatusItem("LowImmunity", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2);
            LowImmunity.AddNotification(null, null, null, 0f);
            Studying         = CreateStatusItem("Studying", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2);
            Socializing      = CreateStatusItem("Socializing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Good, false, OverlayModes.None.ID, true, 2);
            Dancing          = CreateStatusItem("Dancing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Good, false, OverlayModes.None.ID, true, 2);
            Gaming           = CreateStatusItem("Gaming", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Good, false, OverlayModes.None.ID, true, 2);
            Mingling         = CreateStatusItem("Mingling", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Good, false, OverlayModes.None.ID, true, 2);
            ContactWithGerms = CreateStatusItem("ContactWithGerms", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, true, OverlayModes.Disease.ID, true, 2);
            ContactWithGerms.resolveStringCallback = delegate(string str, object data)
            {
                GermExposureMonitor.ExposureStatusData exposureStatusData4 = (GermExposureMonitor.ExposureStatusData)data;
                string name2 = Db.Get().Sicknesses.Get(exposureStatusData4.exposure_type.sickness_id).Name;
                str = str.Replace("{Sickness}", name2);
                return(str);
            };
            ContactWithGerms.statusItemClickCallback = delegate(object data)
            {
                GermExposureMonitor.ExposureStatusData exposureStatusData3 = (GermExposureMonitor.ExposureStatusData)data;
                Vector3 lastExposurePosition2 = exposureStatusData3.owner.GetLastExposurePosition(exposureStatusData3.exposure_type.germ_id);
                CameraController.Instance.CameraGoTo(lastExposurePosition2, 2f, true);
                if (OverlayScreen.Instance.mode == OverlayModes.None.ID)
                {
                    OverlayScreen.Instance.ToggleOverlay(OverlayModes.Disease.ID, true);
                }
            };
            ExposedToGerms = CreateStatusItem("ExposedToGerms", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, true, OverlayModes.Disease.ID, true, 2);
            ExposedToGerms.resolveStringCallback = delegate(string str, object data)
            {
                GermExposureMonitor.ExposureStatusData exposureStatusData2 = (GermExposureMonitor.ExposureStatusData)data;
                string                       name = Db.Get().Sicknesses.Get(exposureStatusData2.exposure_type.sickness_id).Name;
                AttributeInstance            attributeInstance = Db.Get().Attributes.GermResistance.Lookup(exposureStatusData2.owner.gameObject);
                string                       lastDiseaseSource = exposureStatusData2.owner.GetLastDiseaseSource(exposureStatusData2.exposure_type.germ_id);
                GermExposureMonitor.Instance sMI = exposureStatusData2.owner.GetSMI <GermExposureMonitor.Instance>();
                float num        = (float)exposureStatusData2.exposure_type.base_resistance + GERM_EXPOSURE.EXPOSURE_TIER_RESISTANCE_BONUSES[0];
                float totalValue = attributeInstance.GetTotalValue();
                float resistanceToExposureType = sMI.GetResistanceToExposureType(exposureStatusData2.exposure_type, -1f);
                float contractionChance        = GermExposureMonitor.GetContractionChance(resistanceToExposureType);
                float exposureTier             = sMI.GetExposureTier(exposureStatusData2.exposure_type.germ_id);
                float num2 = GERM_EXPOSURE.EXPOSURE_TIER_RESISTANCE_BONUSES[(int)exposureTier - 1] - GERM_EXPOSURE.EXPOSURE_TIER_RESISTANCE_BONUSES[0];
                str = str.Replace("{Severity}", DUPLICANTS.STATUSITEMS.EXPOSEDTOGERMS.EXPOSURE_TIERS[(int)exposureTier - 1]);
                str = str.Replace("{Sickness}", name);
                str = str.Replace("{Source}", lastDiseaseSource);
                str = str.Replace("{Base}", GameUtil.GetFormattedSimple(num, GameUtil.TimeSlice.None, null));
                str = str.Replace("{Dupe}", GameUtil.GetFormattedSimple(totalValue, GameUtil.TimeSlice.None, null));
                str = str.Replace("{Total}", GameUtil.GetFormattedSimple(resistanceToExposureType, GameUtil.TimeSlice.None, null));
                str = str.Replace("{ExposureLevelBonus}", GameUtil.GetFormattedSimple(num2, GameUtil.TimeSlice.None, null));
                str = str.Replace("{Chance}", GameUtil.GetFormattedPercent(contractionChance * 100f, GameUtil.TimeSlice.None));
                return(str);
            };
            ExposedToGerms.statusItemClickCallback = delegate(object data)
            {
                GermExposureMonitor.ExposureStatusData exposureStatusData = (GermExposureMonitor.ExposureStatusData)data;
                Vector3 lastExposurePosition = exposureStatusData.owner.GetLastExposurePosition(exposureStatusData.exposure_type.germ_id);
                CameraController.Instance.CameraGoTo(lastExposurePosition, 2f, true);
                if (OverlayScreen.Instance.mode == OverlayModes.None.ID)
                {
                    OverlayScreen.Instance.ToggleOverlay(OverlayModes.Disease.ID, true);
                }
            };
            LightWorkEfficiencyBonus = CreateStatusItem("LightWorkEfficiencyBonus", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Good, false, OverlayModes.None.ID, true, 2);
        }
 static bool IsEndlessWorking(Workable instance) => !SpacecraftManager.instance.HasAnalysisTarget() && instance.GetComponent <InfiniteModeToggleButton>().isInfiniteMode;