60292 {
60298 bool isInGameMenuOrIsServer =
info.isInGameMenuOrIsServer;
60300 {
60301 if (num < 13500.0)
60302 {
60303 num2 = (float)(num / 13500.0);
60304 sunColor.R = (byte)(
num2 * 200f + 55f);
60305 sunColor.G = (byte)(
num2 * 180f + 75f);
60306 sunColor.B = (byte)(
num2 * 250f + 5f);
60307 bgColorToSet.R = (byte)(
num2 * 230f + 25f);
60308 bgColorToSet.G = (byte)(
num2 * 220f + 35f);
60309 bgColorToSet.B = (byte)(
num2 * 220f + 35f);
60310 }
60311 if (num > 45900.0)
60312 {
60313 num2 = (float)(1.0 - (num / 54000.0 - 0.85) * 6.666666666666667);
60314 sunColor.R = (byte)(
num2 * 120f + 55f);
60315 sunColor.G = (byte)(
num2 * 100f + 25f);
60316 sunColor.B = (byte)(
num2 * 120f + 55f);
60317 bgColorToSet.R = (byte)(
num2 * 200f + 35f);
60318 bgColorToSet.G = (byte)(
num2 * 85f + 35f);
60319 bgColorToSet.B = (byte)(
num2 * 135f + 35f);
60320 }
60321 else if (num > 37800.0)
60322 {
60323 num2 = (float)(1.0 - (num / 54000.0 - 0.7) * 6.666666666666667);
60324 sunColor.R = (byte)(
num2 * 80f + 175f);
60325 sunColor.G = (byte)(
num2 * 130f + 125f);
60326 sunColor.B = (byte)(
num2 * 100f + 155f);
60327 bgColorToSet.R = (byte)(
num2 * 20f + 235f);
60328 bgColorToSet.G = (byte)(
num2 * 135f + 120f);
60329 bgColorToSet.B = (byte)(
num2 * 85f + 170f);
60330 }
60331 }
60333 {
60334 if (
info.BloodMoonActive)
60335 {
60336 if (num < 16200.0)
60337 {
60338 num2 = (float)(1.0 - num / 16200.0);
60339 moonColor.R = (byte)(
num2 * 10f + 205f);
60340 moonColor.G = (byte)(
num2 * 170f + 55f);
60341 moonColor.B = (byte)(
num2 * 200f + 55f);
60342 bgColorToSet.R = (byte)(40f -
num2 * 40f + 35f);
60343 bgColorToSet.G = (byte)(
num2 * 20f + 15f);
60344 bgColorToSet.B = (byte)(
num2 * 20f + 15f);
60345 }
60346 else if (num >= 16200.0)
60347 {
60348 num2 = (float)((num / 32400.0 - 0.5) * 2.0);
60349 moonColor.R = (byte)(
num2 * 50f + 205f);
60350 moonColor.G = (byte)(
num2 * 100f + 155f);
60351 moonColor.B = (byte)(
num2 * 100f + 155f);
60352 moonColor.R = (byte)(
num2 * 10f + 205f);
60353 moonColor.G = (byte)(
num2 * 170f + 55f);
60354 moonColor.B = (byte)(
num2 * 200f + 55f);
60355 bgColorToSet.R = (byte)(40f -
num2 * 40f + 35f);
60356 bgColorToSet.G = (byte)(
num2 * 20f + 15f);
60357 bgColorToSet.B = (byte)(
num2 * 20f + 15f);
60358 }
60359 }
60360 else if (num < 16200.0)
60361 {
60362 num2 = (float)(1.0 - num / 16200.0);
60363 moonColor.R = (byte)(
num2 * 10f + 205f);
60364 moonColor.G = (byte)(
num2 * 70f + 155f);
60365 moonColor.B = (byte)(
num2 * 100f + 155f);
60366 bgColorToSet.R = (byte)(
num2 * 30f + 5f);
60367 bgColorToSet.G = (byte)(
num2 * 30f + 5f);
60368 bgColorToSet.B = (byte)(
num2 * 30f + 5f);
60369 }
60370 else if (num >= 16200.0)
60371 {
60372 num2 = (float)((num / 32400.0 - 0.5) * 2.0);
60373 moonColor.R = (byte)(
num2 * 50f + 205f);
60374 moonColor.G = (byte)(
num2 * 100f + 155f);
60375 moonColor.B = (byte)(
num2 * 100f + 155f);
60376 bgColorToSet.R = (byte)(
num2 * 20f + 5f);
60377 bgColorToSet.G = (byte)(
num2 * 30f + 5f);
60378 bgColorToSet.B = (byte)(
num2 * 30f + 5f);
60379 }
60381 {
60383 }
60384 }
60386 {
60391 }
60393 {
60394 float num4 = 1f - info.GraveyardInfluence * 0.6f;
60398 }
60399 if (isInGameMenuOrIsServer && !
dayTime)
60400 {
60401 bgColorToSet.R = 35;
60402 bgColorToSet.G = 35;
60403 bgColorToSet.B = 35;
60404 }
60405 if (
info.CorruptionBiomeInfluence > 0f)
60406 {
60407 float num5 =
info.CorruptionBiomeInfluence;
60409 {
60411 }
60419 {
60421 }
60422 if (g < 15)
60423 {
60424 g = 15;
60425 }
60427 {
60429 }
60431 bgColorToSet.R = (byte)
r;
60432 bgColorToSet.G = (byte)g;
60433 bgColorToSet.B = (byte)
b;
60438 g -= (int)(100f *
num5 * ((
float)(int)
sunColor.G / 255f));
60441 {
60443 }
60444 if (g < 15)
60445 {
60446 g = 15;
60447 }
60449 {
60451 }
60452 sunColor.R = (byte)
r;
60453 sunColor.G = (byte)g;
60454 sunColor.B = (byte)
b;
60455 }
60456 if (
info.CrimsonBiomeInfluence > 0f)
60457 {
60458 float num6 =
info.CrimsonBiomeInfluence;
60460 {
60462 }
60470 {
60472 }
60474 {
60476 }
60478 {
60480 }
60482 bgColorToSet.R = (byte)
r2;
60483 bgColorToSet.G = (byte)
g2;
60484 bgColorToSet.B = (byte)
b2;
60491 {
60493 }
60495 {
60497 }
60499 {
60501 }
60502 sunColor.R = (byte)
r2;
60503 sunColor.G = (byte)
g2;
60504 sunColor.B = (byte)
b2;
60505 }
60506 if (
info.JungleBiomeInfluence > 0f)
60507 {
60508 float num7 =
info.JungleBiomeInfluence;
60510 {
60512 }
60519 {
60521 }
60523 {
60525 }
60527 {
60529 }
60531 {
60533 }
60535 {
60537 }
60539 bgColorToSet.R = (byte)
r3;
60540 bgColorToSet.G = (byte)
G;
60541 bgColorToSet.B = (byte)
b3;
60548 {
60550 }
60552 {
60554 }
60556 {
60558 }
60559 sunColor.R = (byte)
r3;
60560 sunColor.G = (byte)
G;
60561 sunColor.B = (byte)
b3;
60562 }
60563 if (
info.MushroomBiomeInfluence > 0f)
60564 {
60573 {
60575 }
60577 {
60579 }
60581 {
60583 }
60585 bgColorToSet.R = (byte)
r4;
60586 bgColorToSet.G = (byte)
g3;
60587 bgColorToSet.B = (byte)
b4;
60595 {
60597 }
60599 {
60601 }
60603 {
60605 }
60606 sunColor.R = (byte)
r4;
60607 sunColor.G = (byte)
g3;
60608 sunColor.B = (byte)
b4;
60616 {
60618 }
60620 {
60622 }
60624 {
60626 }
60627 moonColor.R = (byte)
r4;
60628 moonColor.G = (byte)
g3;
60629 moonColor.B = (byte)
b4;
60630 }
60633 {
60636 break;
60640 break;
60644 break;
60648 break;
60651 break;
60652 }
60654 {
60656 }
60658 {
60660 }
60662 {
60664 }
60666 {
60668 }
60669 if (
info.BloodMoonActive)
60670 {
60672 {
60673 bgColorToSet.R = 25;
60674 }
60676 {
60677 bgColorToSet.G = 25;
60678 }
60680 {
60681 bgColorToSet.B = 25;
60682 }
60683 }
60685 {
60686 float num8 = 1242f;
60689 {
60691 }
60692 }
60694 {
60697 {
60699 }
60700 }
60702 {
60709 bgColorToSet.R = (byte)
num12;
60710 bgColorToSet.G = (byte)
num13;
60711 bgColorToSet.B = (byte)
num14;
60712 sunColor.R = byte.MaxValue;
60713 sunColor.G = 127;
60714 sunColor.B = 67;
60716 {
60717 bgColorToSet.R = 20;
60718 }
60720 {
60721 bgColorToSet.G = 10;
60722 }
60723 if (!Lighting.NotRetro)
60724 {
60726 {
60727 bgColorToSet.R = 20;
60728 }
60730 {
60731 bgColorToSet.G = 14;
60732 }
60734 {
60735 bgColorToSet.B = 6;
60736 }
60737 }
60738 }
60740 {
60741 bgColorToSet.R = 1;
60742 bgColorToSet.G = 1;
60743 bgColorToSet.B = 1;
60744 }
60746 {
60747 float value = (float)(
int)bgColorToSet.R / 255f;
60748 float value2 = (float)(
int)bgColorToSet.G / 255f;
60749 float value3 = (float)(
int)bgColorToSet.B / 255f;
60753 bgColorToSet.R = (byte)(
value * 255f);
60754 bgColorToSet.G = (byte)(
value2 * 255f);
60755 bgColorToSet.B = (byte)(
value3 * 255f);
60756 }
60757 if (!
info.BloodMoonActive)
60758 {
60760 }
60762 }
static float Lerp(float value1, float value2, float amount)
static void ModifyNightColor(ref Color bgColorToSet, ref Color moonColor)
static void FixBiomeDarkness(ref Color bgColor, ref int R, ref int G, ref int B)
static void ModifyMinimumLightColorAtNight(ref byte minimalLight)
static Microsoft.Xna.Framework.Color ColorOfTheSkies
static MoonPhase GetMoonPhase()
static bool dontStarveWorld
static float eclipseLight