private static float GetTemperatureScore(Pawn guest, Room room, Building_Bed bed) { if (room == null) { return(0); } var optimalTemperature = GenTemperature.ComfortableTemperatureRange(guest.def); var pctTemperature = Abs(optimalTemperature.InverseLerpThroughRange(room.Temperature) - 0.5f) * 2; // 0-1 return(RoundToInt(Lerp(0, -200, pctTemperature - 0.75f) * 4)); // -200 - 0 }