Exemple #1
0
 private static void Postfix(AuroraManager __instance)
 {
     if (HouseLights.electroSources.Count > 0)
     {
         HouseLights.UpdateElectroLights(__instance);
     }
 }
Exemple #2
0
            private static void Postfix(AuroraManager __instance, AuroraLightingSimple auroraLightSimple)
            {
                if (InterfaceManager.IsMainMenuActive() || (GameManager.IsOutDoorsScene(GameManager.m_ActiveScene) && !HouseLights.notReallyOutdoors.Contains(GameManager.m_ActiveScene)))
                {
                    return;
                }

                HouseLights.AddElectrolizerLight(auroraLightSimple);
            }
Exemple #3
0
            private static void Postfix(AuroraManager __instance)
            {
                if (InterfaceManager.IsMainMenuActive() || (GameManager.IsOutDoorsScene(GameManager.m_ActiveScene) && !HouseLights.notReallyOutdoors.Contains(GameManager.m_ActiveScene)))
                {
                    return;
                }

                if (HouseLights.electroSources.Count > 0)
                {
                    HouseLights.UpdateElectroLights(__instance);
                }
            }
        private static bool Prefix(ActionsToBlock actionBeingChecked, ref bool __result)
        {
            if (!GameManager.GetPlayerManagerComponent().m_ActionsToBlockInDarkness.Contains(actionBeingChecked))
            {
                __result = false;
                return(false);
            }
            float num = 10f;

            for (int i = 0; i < GearManager.m_Gear.Count; i++)
            {
                if (!(GearManager.m_Gear[i] == null))
                {
                    if (Vector3.Distance(GearManager.m_Gear[i].transform.position, GameManager.GetVpFPSCamera().transform.position) <= num)
                    {
                        if (GearManager.m_Gear[i].IsLitFlare() || GearManager.m_Gear[i].IsLitLamp() || GearManager.m_Gear[i].IsLitMatch() || GearManager.m_Gear[i].IsLitTorch() || GearManager.m_Gear[i].IsLitFlashlight())
                        {
                            __result = false;
                            return(false);
                        }
                    }
                }
            }
            for (int j = 0; j < FireManager.m_Fires.Count; j++)
            {
                if (!(FireManager.m_Fires[j] == null))
                {
                    if (Vector3.Distance(FireManager.m_Fires[j].transform.position, GameManager.GetVpFPSCamera().transform.position) <= num)
                    {
                        if (FireManager.m_Fires[j].IsBurning())
                        {
                            __result = false;
                            return(false);
                        }
                    }
                }
            }
            for (int k = 0; k < AuroraManager.GetAuroraElectrolizerList().Count; k++)
            {
                if (!(AuroraManager.GetAuroraElectrolizerList()[k] == null))
                {
                    if (Vector3.Distance(AuroraManager.GetAuroraElectrolizerList()[k].transform.position, GameManager.GetVpFPSCamera().transform.position) <= num)
                    {
                        if (AuroraManager.GetAuroraElectrolizerList()[k].IsElectrolized())
                        {
                            __result = false;
                            return(false);
                        }
                    }
                }
            }
            if (MissionIlluminationArea.IsInIlluminationArea(GameManager.GetVpFPSCamera().transform.position))
            {
                __result = false;
                return(false);
            }
            if (GameManager.GetWeatherComponent().IsIndoorScene() && GameManager.GetUniStorm().IsNightOrNightBlend() && !ThreeDaysOfNight.IsActive())
            {
                __result = true;
                return(false);
            }
            bool flag = GameManager.GetWeatherComponent().IsDenseFog() || GameManager.GetWeatherComponent().IsBlizzard();

            __result = !GameManager.GetWeatherComponent().IsIndoorScene() && GameManager.GetUniStorm().IsNightOrNightBlend() && flag;
            return(false);
        }
        internal static void UpdateElectroLights(AuroraManager mngr)
        {
            for (int e = 0; e < electroSources.Count; e++)
            {
                if (electroSources[e].electrolizer != null && electroSources[e].electrolizer.m_LocalLights != null)
                {
                    for (int i = 0; i < electroSources[e].electrolizer.m_LocalLights.Length; i++)
                    {
                        float cur_range = electroSources[e].ranges[i];

                        cur_range *= Settings.options.rangeMultiplier;
                        cur_range  = Math.Min(cur_range, 20f);

                        electroSources[e].electrolizer.m_LocalLights[i].range = cur_range;

                        ColorHSV curColor = electroSources[e].colors[i];

                        if (Settings.options.whiteLights)
                        {
                            curColor.s *= 0.15f;
                        }

                        electroSources[e].electrolizer.m_LocalLights[i].color = curColor;

                        if (Settings.options.castShadows)
                        {
                            electroSources[e].electrolizer.m_LocalLights[i].shadows = LightShadows.Soft;
                        }
                    }

                    if (lightsOn && !mngr.AuroraIsActive())
                    {
                        if (!electroSources[e].electrolizer.gameObject.name.Contains("Alarm") &&
                            !electroSources[e].electrolizer.gameObject.name.Contains("Headlight") &&
                            !electroSources[e].electrolizer.gameObject.name.Contains("Taillight") &&
                            !electroSources[e].electrolizer.gameObject.name.Contains("Television") &&
                            !electroSources[e].electrolizer.gameObject.name.Contains("Computer") &&
                            !electroSources[e].electrolizer.gameObject.name.Contains("Machine") &&
                            !electroSources[e].electrolizer.gameObject.name.Contains("ControlBox") &&
                            !electroSources[e].electrolizer.gameObject.name.Contains("Interiorlight"))
                        {
                            electroSources[e].electrolizer.m_CurIntensity = Settings.options.intensityValue;
                            electroSources[e].electrolizer.UpdateLight(false);
                            electroSources[e].electrolizer.UpdateFX(false);
                            electroSources[e].electrolizer.UpdateEmissiveObjects(false);
                            electroSources[e].electrolizer.StopAudio();
                        }
                    }
                    else if (!mngr.AuroraIsActive())
                    {
                        electroSources[e].electrolizer.m_CurIntensity = 0f;
                        electroSources[e].electrolizer.UpdateLight(true);
                        electroSources[e].electrolizer.UpdateFX(true);
                        electroSources[e].electrolizer.UpdateEmissiveObjects(true);
                        electroSources[e].electrolizer.UpdateAudio();
                    }
                    else
                    {
                        electroSources[e].electrolizer.UpdateIntensity(Time.deltaTime, true);
                    }
                }
            }

            for (int e = 0; e < electroLightSources.Count; e++)
            {
                if (electroLightSources[e].electrolizer != null && electroLightSources[e].electrolizer.m_LocalLights != null)
                {
                    for (int i = 0; i < electroLightSources[e].electrolizer.m_LocalLights.Length; i++)
                    {
                        float cur_range = electroLightSources[e].ranges[i];

                        cur_range *= Settings.options.rangeMultiplier;
                        cur_range  = Math.Min(cur_range, 20f);

                        electroLightSources[e].electrolizer.m_LocalLights[i].range = cur_range;

                        ColorHSV curColor = electroLightSources[e].colors[i];

                        if (Settings.options.whiteLights)
                        {
                            curColor.s *= 0.15f;
                        }

                        electroLightSources[e].electrolizer.m_LocalLights[i].color = curColor;

                        if (Settings.options.castShadows)
                        {
                            electroLightSources[e].electrolizer.m_LocalLights[i].shadows = LightShadows.Soft;
                        }
                    }

                    if (lightsOn && !mngr.AuroraIsActive())
                    {
                        if (!electroLightSources[e].electrolizer.gameObject.name.Contains("Alarm") &&
                            !electroLightSources[e].electrolizer.gameObject.name.Contains("Headlight") &&
                            !electroLightSources[e].electrolizer.gameObject.name.Contains("Taillight") &&
                            !electroLightSources[e].electrolizer.gameObject.name.Contains("Television") &&
                            !electroLightSources[e].electrolizer.gameObject.name.Contains("Computer") &&
                            !electroLightSources[e].electrolizer.gameObject.name.Contains("Machine") &&
                            !electroLightSources[e].electrolizer.gameObject.name.Contains("ControlBox") &&
                            !electroLightSources[e].electrolizer.gameObject.name.Contains("Interiorlight"))
                        {
                            electroLightSources[e].electrolizer.m_CurIntensity = Settings.options.intensityValue;
                            electroLightSources[e].electrolizer.UpdateLight(false);
                            electroLightSources[e].electrolizer.UpdateEmissiveObjects(false);
                            electroLightSources[e].electrolizer.StopAudio();
                        }
                    }
                    else if (!mngr.AuroraIsActive())
                    {
                        electroLightSources[e].electrolizer.m_CurIntensity = 0f;
                        electroLightSources[e].electrolizer.UpdateLight(true);
                        electroLightSources[e].electrolizer.UpdateEmissiveObjects(true);
                        electroLightSources[e].electrolizer.UpdateAudio();
                    }
                    else
                    {
                        electroLightSources[e].electrolizer.UpdateIntensity(Time.deltaTime);
                    }
                }
            }
        }
Exemple #6
0
 private static void Postfix(AuroraManager __instance, AuroraLightingSimple auroraLightSimple)
 {
     HouseLights.AddElectrolizerLight(auroraLightSimple);
 }