private void HeatflowCard(HoverTextDrawer hoverTextDrawer) { if (!Grid.Solid[cellPos] && isVisible) { float thermalComfort = GameUtil.GetThermalComfort(cellPos, 0f); float thermalComfort2 = GameUtil.GetThermalComfort(cellPos, -0.08368001f); float num2 = 0f; string text = String.Empty; if (thermalComfort2 * 0.001f > -0.278933346f - num2 && thermalComfort2 * 0.001f < 0.278933346f + num2) { text = UI.OVERLAYS.HEATFLOW.NEUTRAL; } else if (thermalComfort2 <= ExternalTemperatureMonitor.GetExternalColdThreshold(null)) { text = UI.OVERLAYS.HEATFLOW.COOLING; } else if (thermalComfort2 >= ExternalTemperatureMonitor.GetExternalWarmThreshold(null)) { text = UI.OVERLAYS.HEATFLOW.HEATING; } float dtu_s = 1f * thermalComfort; text = text + " (" + GameUtil.GetFormattedHeatEnergyRate(dtu_s, GameUtil.HeatEnergyFormatterUnit.Automatic) + ")"; hoverTextDrawer.BeginShadowBar(false); hoverTextDrawer.DrawText(UI.OVERLAYS.HEATFLOW.HOVERTITLE, __this.Styles_BodyText.Standard); hoverTextDrawer.NewLine(26); hoverTextDrawer.DrawText(text, __this.Styles_BodyText.Standard); hoverTextDrawer.EndShadowBar(); } }
public static void Postfix(ExternalTemperatureMonitor __instance) { Frostbitten.AddNotification(); frostbite = __instance.CreateState(nameof(frostbite)); transitionToFrostbite = __instance.CreateState(nameof(transitionToFrostbite)); __instance.tooCool.Transition(transitionToFrostbite, smi => isFrostbite(smi) && smi.timeinstate > 3.0f); transitionToFrostbite .Transition(__instance.tooCool, smi => !isFrostbite(smi)) .Transition(frostbite, smi => { // If in a frostbite-valid state and stays there for 1s, we are now frostbitten return(isFrostbite(smi) && smi.timeinstate > 1.0); }); frostbite .Transition(__instance.tooCool, smi => !isFrostbite(smi) && smi.timeinstate > 3.0f) // to leave frostbite state .ToggleExpression(Db.Get().Expressions.Cold) // brr .ToggleThought(Db.Get().Thoughts.Cold) // I'm thinking of brr .ToggleStatusItem(Frostbitten, smi => smi) .Update("ColdDamage", (smi, dt) => smi.ScaldDamage(dt), UpdateRate.SIM_1000ms); }