using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using DunGen;
using EpiVision.Patches;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("EpiVision")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("EpiVision")]
[assembly: AssemblyTitle("EpiVision")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace EpiVision
{
[BepInPlugin("EpiVision", "EpiVision", "1.0.0")]
public class EpiVision : BaseUnityPlugin
{
public static ConfigEntry<bool> PhotosensitivitySetting;
public static ConfigEntry<bool> MusicogenicSetting;
public static EpiVision Instance { get; private set; }
internal static ManualLogSource Logger { get; private set; }
internal static Harmony? Harmony { get; set; }
private void Awake()
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
PhotosensitivitySetting = ((BaseUnityPlugin)this).Config.Bind<bool>("Accessibility", "Photosensitivity features", true, new ConfigDescription("Removes flashing and camera shaking", (AcceptableValueBase)null, Array.Empty<object>()));
MusicogenicSetting = ((BaseUnityPlugin)this).Config.Bind<bool>("Accessibility", "Musicogenic sensitivity features", true, new ConfigDescription("Mutes deep, beeping, buzzing, or droning sounds", (AcceptableValueBase)null, Array.Empty<object>()));
Logger = ((BaseUnityPlugin)this).Logger;
Instance = this;
Patch();
Logger.LogInfo((object)"EpiVision v1.0.0 has loaded!");
}
internal static void Patch()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
if (Harmony == null)
{
Harmony = new Harmony("EpiVision");
}
Harmony.PatchAll(typeof(RoundManagerPatch));
Harmony.PatchAll(typeof(TilePatches));
if (PhotosensitivitySetting.Value)
{
Harmony.PatchAll(typeof(LungPropPatch));
Harmony.PatchAll(typeof(GrabbableObjectPatch));
Harmony.PatchAll(typeof(DressGirlPatch));
Harmony.PatchAll(typeof(MenuManagerPatch));
Harmony.PatchAll(typeof(HangarShipDoorPatch));
Harmony.PatchAll(typeof(ShipLightsPatch));
Harmony.PatchAll(typeof(StopTurretAnimator));
Harmony.PatchAll(typeof(TerminalPatch));
Harmony.PatchAll(typeof(StopEntryRoomFan));
Harmony.PatchAll(typeof(PlayerControllerBPatch));
Harmony.PatchAll(typeof(SwitchFlashlightSpamPatch));
Harmony.PatchAll(typeof(ManualCameraRendererPatch));
Harmony.PatchAll(typeof(insanityFilterPatch));
Harmony.PatchAll(typeof(PingScan_performedPatch));
Harmony.PatchAll(typeof(DisplayGlobalNotification_Patch));
Harmony.PatchAll(typeof(RadiationWarningHUD_Patch));
Harmony.PatchAll(typeof(DisplayTip_Patch));
Harmony.PatchAll(typeof(ToolTipFlashPatch));
Harmony.PatchAll(typeof(ItemChargerPatch));
Harmony.PatchAll(typeof(RadarBoosterPatch));
Harmony.PatchAll(typeof(RadarBoosterPatch2));
Harmony.PatchAll(typeof(BeeZapPatch));
Harmony.PatchAll(typeof(ShipTeleporterPatch));
Harmony.PatchAll(typeof(LightningPatch));
Harmony.PatchAll(typeof(StunGrenadeExplosionPatch));
Harmony.PatchAll(typeof(StunGrenadePatch));
Harmony.PatchAll(typeof(TorchPlayerAnimation));
Harmony.PatchAll(typeof(HUDManagerPatch));
}
if (MusicogenicSetting.Value)
{
Harmony.PatchAll(typeof(AudioSourcePatch));
Harmony.PatchAll(typeof(ButlerPatch));
Harmony.PatchAll(typeof(ButlerBeesPatch));
Harmony.PatchAll(typeof(RedLocustBeesPatch));
Harmony.PatchAll(typeof(EntranceTeleportPatch));
Harmony.PatchAll(typeof(VehicleControllerPatch));
}
}
internal static void Unpatch()
{
Harmony? harmony = Harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "EpiVision";
public const string PLUGIN_NAME = "EpiVision";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace EpiVision.Patches
{
[HarmonyPatch(typeof(LungProp))]
internal class LungPropPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void StartPatch(LungProp __instance)
{
CollectionExtensions.Do<Light>((IEnumerable<Light>)((Component)__instance).GetComponentsInChildren<Light>().ToList(), (Action<Light>)delegate(Light l)
{
((Behaviour)l).enabled = false;
});
MeshFilter[] componentsInChildren = ((Component)__instance).gameObject.GetComponentsInChildren<MeshFilter>();
MeshFilter[] array = componentsInChildren;
foreach (MeshFilter val in array)
{
val.mesh.subMeshCount = 2;
val.sharedMesh.subMeshCount = 2;
}
MeshRenderer[] componentsInChildren2 = ((Component)__instance).gameObject.GetComponentsInChildren<MeshRenderer>();
MeshRenderer[] array2 = componentsInChildren2;
foreach (MeshRenderer val2 in array2)
{
if (((Renderer)val2).sharedMaterials.Length > 1)
{
((Renderer)val2).sharedMaterials[1].renderQueue = 0;
}
}
}
}
[HarmonyPatch(typeof(GrabbableObject))]
public class GrabbableObjectPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void CreatePatch(GrabbableObject __instance)
{
string name = ((Object)__instance.itemProperties).name;
if (name.Contains("lamp") || name.Contains("Lamp"))
{
CollectionExtensions.Do<Light>((IEnumerable<Light>)((Component)__instance).GetComponentsInChildren<Light>().ToList(), (Action<Light>)delegate(Light l)
{
((Behaviour)l).enabled = false;
});
}
if (name == "FancyPainting")
{
((GrabbableObject)((Component)__instance).gameObject.GetComponent<PhysicsProp>()).itemProperties.verticalOffset = Random.Range(0f, 0.2f);
}
}
[HarmonyPatch("GrabItem")]
[HarmonyPostfix]
public static void GrabItem(GrabbableObject __instance)
{
string name = ((Object)__instance.itemProperties).name;
if (name == "FancyPainting")
{
((GrabbableObject)((Component)__instance).gameObject.GetComponent<PhysicsProp>()).itemProperties.verticalOffset = Random.Range(0f, 0.2f);
}
}
}
[HarmonyPatch(typeof(DressGirlAI))]
internal class DressGirlPatch
{
[HarmonyPatch("MessWithLightsClientRpc")]
[HarmonyPrefix]
private static bool MessWithLightsClientRpcPatch()
{
return false;
}
}
[HarmonyPatch(typeof(RoundManager))]
internal class RoundManagerPatch
{
public static string OFFENSE_NAME = "21 Offense";
public static string ASSURANCE_NAME = "220 Assurance";
[HarmonyPatch("FlickerLights", new Type[]
{
typeof(bool),
typeof(bool)
})]
[HarmonyPrefix]
private static bool FlickerLightsPatch(bool flickerFlashlights = false, bool disableFlashlights = false)
{
if (EpiVision.PhotosensitivitySetting.Value)
{
return false;
}
return true;
}
[HarmonyPatch("FlickerPoweredLights", new Type[]
{
typeof(bool),
typeof(bool)
})]
[HarmonyPrefix]
private static bool FlickerPoweredLightsPatch(bool flickerFlashlights = false, bool disableFlashlights = false)
{
if (EpiVision.PhotosensitivitySetting.Value)
{
return false;
}
return true;
}
[HarmonyPatch("GenerateNewFloor")]
[HarmonyPostfix]
private static void GenerateNewFloorPatch(ref SelectableLevel ___currentLevel)
{
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
if (EpiVision.PhotosensitivitySetting.Value)
{
if (___currentLevel.PlanetName == OFFENSE_NAME || ___currentLevel.PlanetName == ASSURANCE_NAME)
{
TimeOfDay.Instance.sunDirect.color = new Color(0.5f, 0.5f, 0.5f);
}
else
{
TimeOfDay.Instance.sunDirect.color = new Color(1f, 1f, 1f);
}
}
}
[HarmonyPatch("waitForMainEntranceTeleportToSpawn")]
[HarmonyPostfix]
private static void GenerateNewFloor()
{
if (!EpiVision.MusicogenicSetting.Value)
{
return;
}
AudioSource component = GameObject.Find("Systems/GameSystems/TimeAndWeather/Eclipse/EclipseMusic").GetComponent<AudioSource>();
if ((Object)(object)component != (Object)null)
{
component.mute = true;
}
GameObject[] array = Object.FindObjectsByType<GameObject>((FindObjectsSortMode)0);
GameObject[] array2 = array;
foreach (GameObject val in array2)
{
if (((Object)val).name.Contains("LungApparatus"))
{
val.GetComponent<AudioSource>().mute = true;
}
}
}
}
[HarmonyPatch(typeof(HangarShipDoor))]
internal class HangarShipDoorPatch
{
[HarmonyPatch("SetDoorOpen")]
[HarmonyPostfix]
private static void SetDoorOpenPatch()
{
//IL_020f: Unknown result type (might be due to invalid IL or missing references)
//IL_0214: Unknown result type (might be due to invalid IL or missing references)
HDAdditionalLightData[] array = Object.FindObjectsByType<HDAdditionalLightData>((FindObjectsSortMode)0);
foreach (HDAdditionalLightData val in array)
{
val.SetShadowResolutionLevel(3);
val.SetShadowResolution(2048);
}
Transform[] components = GameObject.Find("Environment").GetComponents<Transform>();
foreach (Transform val2 in components)
{
for (int k = 0; k < val2.childCount; k++)
{
Transform child = val2.GetChild(k);
Transform component = ((Component)child).GetComponent<Transform>();
for (int l = 0; l < component.childCount; l++)
{
Transform child2 = component.GetChild(l);
Transform component2 = ((Component)child2).GetComponent<Transform>();
HDAdditionalLightData component3 = ((Component)child2).GetComponent<HDAdditionalLightData>();
if ((Object)(object)component3 != (Object)null)
{
fixLight(component3);
}
if (!(((Object)child).name == "Map"))
{
continue;
}
for (int m = 0; m < component2.childCount; m++)
{
HDAdditionalLightData component4 = ((Component)component2.GetChild(m)).GetComponent<HDAdditionalLightData>();
if ((Object)(object)component4 != (Object)null)
{
fixLight(component4);
}
}
}
}
}
GameObject val3 = GameObject.Find("IndustrialFan");
if ((Object)(object)val3 != (Object)null)
{
Animator component5 = val3.GetComponent<Animator>();
if ((Object)(object)component5 != (Object)null)
{
((Behaviour)component5).enabled = false;
}
}
GameObject val4 = GameObject.Find("TimeAndWeather");
if ((Object)(object)val4 != (Object)null)
{
Transform val5 = val4.transform.Find("Foggy");
if ((Object)(object)val5 != (Object)null)
{
((Component)val5).gameObject.SetActive(false);
}
Transform val6 = val4.transform.Find("DustStorm");
if ((Object)(object)val6 != (Object)null)
{
LocalVolumetricFog component6 = ((Component)val6).gameObject.GetComponent<LocalVolumetricFog>();
if ((Object)(object)component6 != (Object)null)
{
((Behaviour)component6).enabled = false;
}
}
}
GameObject val7 = GameObject.Find("BrightDay");
if ((Object)(object)val7 != (Object)null)
{
LocalVolumetricFog componentInChildren = val7.GetComponentInChildren<LocalVolumetricFog>();
if ((Object)(object)componentInChildren == (Object)null)
{
componentInChildren = val7.GetComponentInChildren<LocalVolumetricFog>(true);
}
if ((Object)(object)componentInChildren != (Object)null)
{
componentInChildren.parameters.textureScrollingSpeed = Vector3.zero;
}
}
GameObject val8 = GameObject.Find("HeatWaveParticle");
GameObject val9 = GameObject.Find("HeatWaveParticle (1)");
GameObject val10 = GameObject.Find("HeatWaveParticle (2)");
if ((Object)(object)val8 != (Object)null)
{
val8.SetActive(false);
}
if ((Object)(object)val9 != (Object)null)
{
val9.SetActive(false);
}
if ((Object)(object)val10 != (Object)null)
{
val10.SetActive(false);
}
static void fixLight(HDAdditionalLightData lightData)
{
lightData.SetShadowResolutionLevel(0);
lightData.SetShadowDimmer(0f, 1f);
lightData.SetLightDimmer(0.7f, 1f);
}
}
}
internal class ShipLightsPatch
{
[HarmonyPatch(typeof(PlayerControllerB), "Start")]
[HarmonyPostfix]
private static void ShipLights()
{
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Expected O, but got Unknown
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
HDAdditionalLightData[] array = Object.FindObjectsByType<HDAdditionalLightData>((FindObjectsSortMode)0);
foreach (HDAdditionalLightData val in array)
{
val.SetShadowResolutionLevel(3);
val.SetShadowResolution(2048);
}
Object[] array2 = Resources.FindObjectsOfTypeAll(typeof(HDAdditionalCameraData));
Object[] array3 = array2;
foreach (Object val2 in array3)
{
if (val2 is HDAdditionalCameraData)
{
HDAdditionalCameraData val3 = (HDAdditionalCameraData)val2;
if (!(((Object)val3).name == "MapCamera"))
{
val3.customRenderingSettings = true;
((BitArray128)(ref val3.renderingPathCustomFrameSettingsOverrideMask.mask))[28u] = true;
FrameSettings renderingPathCustomFrameSettings = val3.renderingPathCustomFrameSettings;
((FrameSettings)(ref renderingPathCustomFrameSettings)).SetEnabled((FrameSettingsField)28, false);
}
}
}
GameObject val4 = GameObject.Find("VolumeMain");
if ((Object)(object)val4 != (Object)null)
{
val4.SetActive(false);
Volume component = val4.GetComponent<Volume>();
Fog val5 = default(Fog);
component.sharedProfile.TryGet<Fog>(ref val5);
((VolumeParameter<bool>)(object)val5.enableVolumetricFog).value = false;
}
quickMenuDisableAnimator("MainButtons/Resume");
quickMenuDisableAnimator("MainButtons/InvitePlayers");
quickMenuDisableAnimator("MainButtons/Settings");
quickMenuDisableAnimator("MainButtons/Quit");
quickMenuDisableAnimator("ConfirmLeaveGame/Quit (1)");
quickMenuDisableAnimator("ConfirmLeaveGame/Quit (2)");
quickMenuDisableAnimator("SettingsPanel/PleaseConfirmChangesPanel/Panel/Confirm");
quickMenuDisableAnimator("SettingsPanel/PleaseConfirmChangesPanel/Panel/Discard");
quickMenuDisableAnimator("SettingsPanel/KeybindsPanel/Back");
quickMenuDisableAnimator("SettingsPanel/BackButton");
quickMenuDisableAnimator("SettingsPanel/Confirm");
GameObject.Find("Systems/GameSystems/ItemSystems/MapScreenUI/MonitoringPlayerUIContainer/LocalPlayerPlaceholder").SetActive(false);
GameObject.Find("Systems/GameSystems/ItemSystems/MapScreenUI/MonitoringPlayerUIContainer/PlayerBeingMonitoredBG").SetActive(false);
GameObject.Find("Systems/GameSystems/ItemSystems/MapScreenUI/MonitoringPlayerUIContainer/PlayerBeingMonitored").SetActive(false);
GameObject.Find("Systems/GameSystems/ItemSystems/MapScreenUI/MonitoringPlayerUIContainer/PlayerBeingMonitoredBG").SetActive(false);
static void disableAnimator(string name)
{
GameObject val6 = GameObject.Find(name);
if ((Object)(object)val6 != (Object)null)
{
Animator component2 = val6.GetComponent<Animator>();
if ((Object)(object)component2 != (Object)null)
{
((Behaviour)component2).enabled = false;
}
}
}
static void quickMenuDisableAnimator(string name)
{
disableAnimator("Systems/UI/Canvas/QuickMenu/" + name);
}
}
}
[HarmonyPatch(typeof(MenuManager))]
internal class MenuManagerPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void Start(MenuManager __instance)
{
GameObject val = GameObject.Find("Canvas/MenuContainer/");
menuContainerDisableAnimator("MainButtons/HostButton");
menuContainerDisableAnimator("MainButtons/JoinACrew");
menuContainerDisableAnimator("MainButtons/SettingsButton");
menuContainerDisableAnimator("MainButtons/Credits");
menuContainerDisableAnimator("MainButtons/QuitButton");
menuContainerDisableAnimator("SettingsPanel/PleaseConfirmChangesPanel/Panel/Confirm");
menuContainerDisableAnimator("SettingsPanel/PleaseConfirmChangesPanel/Panel/Discard");
menuContainerDisableAnimator("SettingsPanel/KeybindsPanel/Back");
menuContainerDisableAnimator("SettingsPanel/BackButton");
menuContainerDisableAnimator("SettingsPanel/Confirm");
menuContainerDisableAnimator("LobbyHostSettings/HostSettingsContainer/Confirm");
menuContainerDisableAnimator("LobbyHostSettings/HostSettingsContainer/Back");
menuContainerDisableAnimator("CreditsPanel/Panel/BackButton");
menuContainerDisableAnimator("LobbyList/ListPanel/RefreshButton");
menuContainerDisableAnimator("LobbyList/BackToMenu");
menuContainerDisableAnimator("MenuNotification/Panel/ResponseButton");
static void disableAnimator(string name)
{
GameObject val2 = GameObject.Find(name);
if ((Object)(object)val2 != (Object)null)
{
Animator component = val2.GetComponent<Animator>();
if ((Object)(object)component != (Object)null)
{
((Behaviour)component).enabled = false;
}
}
}
static void menuContainerDisableAnimator(string name)
{
disableAnimator("Canvas/MenuContainer/" + name);
}
}
}
[HarmonyPatch(typeof(HUDManager))]
internal class insanityFilterPatch
{
[HarmonyPatch("Start")]
[HarmonyPrefix]
private static void Patch(HUDManager __instance)
{
__instance.insanityScreenFilter.weight = 0f;
}
}
[HarmonyPatch(typeof(ManualCameraRenderer))]
internal class ManualCameraRendererPatch
{
[HarmonyPostfix]
[HarmonyPatch("Start")]
private static void Postfix(ManualCameraRenderer __instance)
{
Animator mapCameraAnimator = __instance.mapCameraAnimator;
if ((Object)(object)mapCameraAnimator != (Object)null)
{
((Behaviour)mapCameraAnimator).enabled = false;
}
}
}
[HarmonyPatch(typeof(PlayerControllerB))]
internal class PlayerControllerBPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void StartPatch(ref PlayerControllerB __instance)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Expected O, but got Unknown
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
EmissionModule emission = __instance.beamUpParticle.emission;
((EmissionModule)(ref emission)).enabled = false;
EmissionModule emission2 = __instance.beamOutParticle.emission;
((EmissionModule)(ref emission2)).enabled = false;
EmissionModule emission3 = __instance.beamOutBuildupParticle.emission;
((EmissionModule)(ref emission3)).enabled = false;
GameObject.Find("Systems/UI/Canvas/SpecialGraphics/ScrapItemInfo/Box1Container/Item/AnimContainer/MeshContainer/HandBell").SetActive(false);
GameObject.Find("Systems/UI/Canvas/SpecialGraphics/ScrapItemInfo/Box2Container/Item/AnimContainer/MeshContainer/HandBell").SetActive(false);
GameObject.Find("Systems/UI/Canvas/SpecialGraphics/ScrapItemInfo/Box3Container/Item/AnimContainer/MeshContainer/HandBell").SetActive(false);
Object[] array = Resources.FindObjectsOfTypeAll(typeof(HDAdditionalCameraData));
Object[] array2 = array;
foreach (Object val in array2)
{
if (!(val is HDAdditionalCameraData))
{
continue;
}
HDAdditionalCameraData val2 = (HDAdditionalCameraData)val;
if (!(((Object)val2).name == "MapCamera"))
{
val2.customRenderingSettings = true;
if (!(((Object)((Component)val2).gameObject).name == "SecurityCamera") && !(((Object)((Component)val2).gameObject).name == "ShipCamera"))
{
val2.antialiasing = (AntialiasingMode)3;
}
}
}
}
[HarmonyPatch("Start")]
[HarmonyPrefix]
private static void KillInsanityFilter()
{
GameObject val = GameObject.Find("InsanityFilter");
if ((Object)(object)val != (Object)null)
{
val.SetActive(false);
}
}
[HarmonyPatch("Start")]
[HarmonyPrefix]
private static void KillFlashFilter()
{
GameObject val = GameObject.Find("FlashbangFilter");
if ((Object)(object)val != (Object)null)
{
val.SetActive(false);
}
}
}
[HarmonyPatch(typeof(PlayerControllerB), "ChangeHelmetLight")]
public static class SwitchFlashlightSpamPatch
{
[CompilerGenerated]
private sealed class <FlashlightCooldown>d__2 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <FlashlightCooldown>d__2(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
canTurnOnFlashlight = false;
<>2__current = (object)new WaitForSeconds(2f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
canTurnOnFlashlight = true;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private static bool canTurnOnFlashlight = true;
[HarmonyPrefix]
public static bool FLSpamPrefix(PlayerControllerB __instance)
{
if (!canTurnOnFlashlight)
{
return false;
}
((MonoBehaviour)__instance).StartCoroutine(FlashlightCooldown());
return true;
}
[IteratorStateMachine(typeof(<FlashlightCooldown>d__2))]
private static IEnumerator FlashlightCooldown()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <FlashlightCooldown>d__2(0);
}
}
[HarmonyPatch(typeof(StartOfRound))]
internal class StopEntryRoomFan
{
[HarmonyPrefix]
[HarmonyPatch("Start")]
private static void Postfix()
{
RemoveHelmet();
RemoveHelmet2();
RemoveCustomPass();
RemoveMiscReflections();
RemoveCriticalHealthWarning();
RemoveDrunkFilter();
Light[] componentsInChildren = GameObject.Find("Environment/HangarShip/ShipModels2b/").GetComponentsInChildren<Light>();
foreach (Light val in componentsInChildren)
{
if (((Object)((Component)val).transform).name == "RedLight")
{
((Component)((Component)val).transform).gameObject.SetActive(false);
}
}
}
private static void RemoveCriticalHealthWarning()
{
GameObject val = GameObject.Find("CriticalInjury");
if ((Object)(object)val != (Object)null)
{
val.SetActive(false);
}
}
private static void RemoveHelmet()
{
GameObject val = GameObject.Find("ScavengerHelmet");
if ((Object)(object)val != (Object)null)
{
val.SetActive(false);
}
}
public static void RemoveHelmet2()
{
GameObject val = GameObject.Find("ScavengerHelmet");
if (!((Object)(object)val != (Object)null))
{
return;
}
MeshRenderer component = val.GetComponent<MeshRenderer>();
if ((Object)(object)component != (Object)null)
{
Material[] materials = ((Renderer)component).materials;
if (materials.Length >= 3)
{
Material[] array = (Material[])(object)new Material[materials.Length - 1];
Array.Copy(materials, array, 2);
Array.Copy(materials, 3, array, 2, materials.Length - 3);
((Renderer)component).materials = array;
Object.Destroy((Object)(object)materials[2]);
}
}
}
private static void RemoveDrunkFilter()
{
GameObject val = GameObject.Find("DrunknessFilter");
if ((Object)(object)val != (Object)null)
{
val.SetActive(false);
((Behaviour)HUDManager.Instance.gasHelmetAnimator).enabled = false;
HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", false);
}
}
private static void RemoveCustomPass()
{
GameObject val = GameObject.Find("CustomPass");
if ((Object)(object)val != (Object)null)
{
val.SetActive(false);
}
}
private static void RemoveMiscReflections()
{
GameObject val = GameObject.Find("Puddles");
if ((Object)(object)val != (Object)null)
{
val.SetActive(false);
}
}
[HarmonyPatch(typeof(RoundManager))]
[HarmonyPrefix]
[HarmonyPatch("LoadNewLevel")]
private static void resetFanDisabled2()
{
GameObject val = GameObject.Find("StormVolume");
if ((Object)(object)val != (Object)null)
{
val.SetActive(false);
}
GameObject val2 = GameObject.Find("Sky and Fog Global Volume");
if (!((Object)(object)val2 != (Object)null))
{
return;
}
foreach (VolumeComponent component in val2.GetComponent<Volume>().profile.components)
{
if (component is Fog)
{
component.active = false;
}
}
}
}
[HarmonyPatch(typeof(Terminal), "Start")]
public static class TerminalPatch
{
[HarmonyPrefix]
public static void TerminalCaretPatch(Terminal __instance)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
__instance.screenText.caretColor = Color.clear;
}
}
[HarmonyPatch(typeof(Turret))]
internal class StopTurretAnimator
{
[HarmonyPostfix]
[HarmonyPatch("Start")]
private static void TurretAnimatorPatch(Turret __instance)
{
((Component)__instance.turretRod.Find("Rod/GunBody/GunBarrelPos/BulletParticle")).gameObject.SetActive(false);
}
}
[HarmonyPatch(typeof(RadMechAI))]
internal class TorchPlayerAnimation
{
[HarmonyPatch("FlickerFace")]
[HarmonyPrefix]
private static bool FlickerFacePatch()
{
return false;
}
[HarmonyPatch("flickerSpotlightAnim")]
[HarmonyPrefix]
private static bool FlickerSpotlightAnimPatch()
{
return false;
}
[HarmonyPatch("EnableBlowtorch")]
[HarmonyPrefix]
private static bool EnableBlowtorchPatch()
{
return false;
}
}
[HarmonyPatch(typeof(HUDManager))]
[HarmonyPatch("PingScan_performed")]
public static class PingScan_performedPatch
{
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
List<CodeInstruction> list = new List<CodeInstruction>(instructions);
for (int i = 0; i < list.Count; i++)
{
if (list[i].opcode == OpCodes.Ldstr && (string)list[i].operand == "scan")
{
list[i - 2].opcode = OpCodes.Nop;
list[i - 1].opcode = OpCodes.Nop;
list[i].opcode = OpCodes.Nop;
list[i + 1].opcode = OpCodes.Nop;
Debug.Log((object)"Scan animation replaced with NOP");
}
}
return list.AsEnumerable();
}
}
[HarmonyPatch(typeof(HUDManager))]
[HarmonyPatch("DisplayGlobalNotification")]
public static class DisplayGlobalNotification_Patch
{
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
List<CodeInstruction> list = new List<CodeInstruction>(instructions);
for (int i = 0; i < list.Count; i++)
{
if (list[i].opcode == OpCodes.Ldstr && (string)list[i].operand == "TriggerNotif")
{
list[i - 2].opcode = OpCodes.Nop;
list[i - 1].opcode = OpCodes.Nop;
list[i].opcode = OpCodes.Nop;
list[i + 1].opcode = OpCodes.Nop;
Debug.Log((object)"Notification animation replaced with NOP");
}
}
return list.AsEnumerable();
}
}
[HarmonyPatch(typeof(HUDManager))]
[HarmonyPatch("RadiationWarningHUD")]
public static class RadiationWarningHUD_Patch
{
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
List<CodeInstruction> list = new List<CodeInstruction>(instructions);
for (int i = 0; i < list.Count; i++)
{
if (list[i].opcode == OpCodes.Ldstr && (string)list[i].operand == "RadiationWarning")
{
list[i - 2].opcode = OpCodes.Nop;
list[i - 1].opcode = OpCodes.Nop;
list[i].opcode = OpCodes.Nop;
list[i + 1].opcode = OpCodes.Nop;
Debug.Log((object)"Radiation warning replaced with NOP");
}
}
return list.AsEnumerable();
}
}
[HarmonyPatch(typeof(HUDManager))]
[HarmonyPatch("DisplayTip")]
public static class DisplayTip_Patch
{
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
List<CodeInstruction> list = new List<CodeInstruction>(instructions);
for (int i = 0; i < list.Count; i++)
{
if (list[i].opcode == OpCodes.Ldstr && (string)list[i].operand == "TriggerWarning")
{
list[i].operand = "TriggerHint";
Debug.Log((object)"TriggerWarning replaced with TriggerHint");
}
}
return list.AsEnumerable();
}
}
[HarmonyPatch(typeof(HUDManager))]
internal class ToolTipFlashPatch
{
[CompilerGenerated]
private sealed class <FastForwardAnimation>d__2 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <FastForwardAnimation>d__2(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(6f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
HUDManager.Instance.tipsPanelAnimator.speed = 10000f;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <PauseAnimation>d__1 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <PauseAnimation>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(0.9f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
HUDManager.Instance.tipsPanelAnimator.speed = 0f;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[HarmonyPatch("DisplayTip")]
[HarmonyPostfix]
private static void PostFix()
{
HUDManager.Instance.tipsPanelAnimator.speed = 0.1f;
((MonoBehaviour)HUDManager.Instance).StartCoroutine(PauseAnimation());
((MonoBehaviour)HUDManager.Instance).StartCoroutine(FastForwardAnimation());
}
[IteratorStateMachine(typeof(<PauseAnimation>d__1))]
private static IEnumerator PauseAnimation()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <PauseAnimation>d__1(0);
}
[IteratorStateMachine(typeof(<FastForwardAnimation>d__2))]
private static IEnumerator FastForwardAnimation()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <FastForwardAnimation>d__2(0);
}
}
[HarmonyPatch]
public static class ItemChargerPatch
{
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
[HarmonyTranspiler]
public static IEnumerable<CodeInstruction> Transpile(IEnumerable<CodeInstruction> instructions)
{
List<CodeInstruction> list = new List<CodeInstruction>(instructions);
for (int i = 0; i < list.Count; i++)
{
CodeInstruction val = list[i];
if (list[i].opcode == OpCodes.Ldstr && (string)list[i].operand == "zap")
{
list[i - 2].opcode = OpCodes.Nop;
list[i - 1].opcode = OpCodes.Nop;
list[i].opcode = OpCodes.Nop;
list[i + 1].opcode = OpCodes.Nop;
Debug.Log((object)"Item Charger animation replaced with NOP");
}
}
return list.AsEnumerable();
}
}
[HarmonyPatch]
public static class RadarBoosterPatch
{
[HarmonyPatch(typeof(RadarBoosterItem), "EnableRadarBooster")]
[HarmonyTranspiler]
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
List<CodeInstruction> list = new List<CodeInstruction>(instructions);
for (int i = 0; i < list.Count; i++)
{
CodeInstruction val = list[i];
if (list[i].opcode == OpCodes.Ldstr && (string)list[i].operand == "on")
{
list[i].operand = "off";
Debug.Log((object)"Radar booster on animation replaced with off");
}
}
return list.AsEnumerable();
}
}
[HarmonyPatch(typeof(RadarBoosterItem), "Flash")]
public static class RadarBoosterPatch2
{
[HarmonyPrefix]
private static bool RemoveFlash()
{
return false;
}
}
[HarmonyPatch(typeof(RedLocustBees), "BeesZap")]
public static class BeeZapPatch
{
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
List<CodeInstruction> list = new List<CodeInstruction>(instructions);
for (int i = 0; i < list.Count; i++)
{
CodeInstruction val = list[i];
if (list[i].opcode == OpCodes.Ldfld && list[i].operand is FieldInfo fieldInfo && fieldInfo.Name == "lightningComponent")
{
list[i - 1].opcode = OpCodes.Nop;
list[i].opcode = OpCodes.Nop;
list[i + 1].opcode = OpCodes.Nop;
list[i + 2].opcode = OpCodes.Nop;
Debug.Log((object)"Replaced bee lightning call with NOP");
}
}
return list.AsEnumerable();
}
}
[HarmonyPatch]
public static class ShipTeleporterPatch
{
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
[HarmonyTranspiler]
public static IEnumerable<CodeInstruction> Transpile(IEnumerable<CodeInstruction> instructions)
{
List<CodeInstruction> source = new List<CodeInstruction>(instructions);
return source.AsEnumerable();
}
}
[HarmonyPatch(typeof(StormyWeather), "LightningStrike")]
public static class LightningPatch
{
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
List<CodeInstruction> list = new List<CodeInstruction>(instructions);
int num = 0;
for (int i = 0; i < list.Count; i++)
{
CodeInstruction val = list[i];
if (list[i].opcode == OpCodes.Stfld && list[i].operand is FieldInfo fieldInfo && fieldInfo.Name == "AutomaticModeSeconds")
{
list[i - 2].opcode = OpCodes.Nop;
list[i - 1].opcode = OpCodes.Nop;
list[i].opcode = OpCodes.Nop;
Debug.Log((object)"Lightning script replaced with NOP");
}
if (list[i].opcode == OpCodes.Ldfld && list[i].operand is FieldInfo fieldInfo2 && fieldInfo2.Name == "explosionEffectParticle")
{
if (num == 1)
{
list[i - 1].opcode = OpCodes.Nop;
list[i].opcode = OpCodes.Nop;
list[i + 1].opcode = OpCodes.Nop;
Debug.Log((object)"Lightning explosion trigger replaced with NOP");
}
else
{
num++;
}
}
}
return list.AsEnumerable();
}
}
[HarmonyPatch(typeof(StunGrenadeItem))]
[HarmonyPatch("ExplodeStunGrenade")]
public static class StunGrenadeExplosionPatch
{
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
List<CodeInstruction> list = new List<CodeInstruction>(instructions);
for (int i = 0; i < list.Count; i++)
{
CodeInstruction val = list[i];
if (list[i].opcode == OpCodes.Ldfld && list[i].operand is FieldInfo fieldInfo && fieldInfo.Name == "stunGrenadeExplosion")
{
list[i - 1].opcode = OpCodes.Nop;
list[i].opcode = OpCodes.Nop;
list[i + 1].opcode = OpCodes.Nop;
list[i + 2].opcode = OpCodes.Nop;
list[i + 3].opcode = OpCodes.Nop;
list[i + 4].opcode = OpCodes.Nop;
list[i + 5].opcode = OpCodes.Nop;
list[i + 6].opcode = OpCodes.Nop;
list[i + 7].opcode = OpCodes.Nop;
Debug.Log((object)"Flashbang Explosion replaced with NOP");
}
}
return list.AsEnumerable();
}
}
[HarmonyPatch(typeof(StunGrenadeItem))]
[HarmonyPatch("StunExplosion")]
public static class StunGrenadePatch
{
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
List<CodeInstruction> list = new List<CodeInstruction>(instructions);
for (int i = 0; i < list.Count; i++)
{
CodeInstruction val = list[i];
if (list[i].opcode == OpCodes.Ldfld && list[i].operand is FieldInfo fieldInfo && fieldInfo.Name == "flashbangScreenFilter")
{
list[i - 1].opcode = OpCodes.Nop;
list[i].opcode = OpCodes.Nop;
list[i + 1].opcode = OpCodes.Nop;
list[i + 2].opcode = OpCodes.Nop;
Debug.Log((object)"Flashbang filter replaced with NOP");
}
}
return list.AsEnumerable();
}
}
[HarmonyPatch(typeof(Tile))]
internal class TilePatches
{
[HarmonyPrefix]
[HarmonyPatch("OnTriggerEnter", new Type[] { typeof(Collider) })]
private static void AnyAnimatorPlayPrefix(Animator __instance, params object[] __args)
{
if (EpiVision.PhotosensitivitySetting.Value)
{
Animator[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<Animator>();
foreach (Animator val in componentsInChildren)
{
if (((Object)val).name.Contains("MineshaftSpotlight") || ((Object)val).name.Contains("lightbulbsLineMesh") || ((Object)val).name.Contains("PoweredLightTypeB"))
{
val.speed = 999999f;
}
}
}
if (!EpiVision.MusicogenicSetting.Value)
{
return;
}
AudioSource[] array = Object.FindObjectsByType<AudioSource>((FindObjectsSortMode)0);
foreach (AudioSource val2 in array)
{
if (((Object)val2).name.Contains("ConstantHum") || ((Object)val2).name.Contains("MineshaftElevatorAudio") || ((Object)val2).name.Contains("SteamValve"))
{
AudioSource[] componentsInChildren2 = ((Component)val2).GetComponentsInChildren<AudioSource>();
foreach (AudioSource val3 in componentsInChildren2)
{
val3.mute = true;
}
}
if (((Object)val2).name.Contains("Audio Source") && ((Object)((Component)val2).transform.parent).name.Contains("CaveDoorwayLight"))
{
AudioSource[] componentsInChildren3 = ((Component)val2).GetComponentsInChildren<AudioSource>();
foreach (AudioSource val4 in componentsInChildren3)
{
val4.mute = true;
}
}
}
}
}
[HarmonyPatch(typeof(AudioSource))]
internal class AudioSourcePatch
{
[HarmonyPatch("Play", new Type[] { typeof(double) })]
[HarmonyPatch("Play", new Type[] { })]
[HarmonyPatch("Play", new Type[] { typeof(ulong) })]
[HarmonyPatch("PlayDelayed", new Type[] { typeof(float) })]
[HarmonyPatch("PlayScheduled", new Type[] { typeof(double) })]
[HarmonyPrefix]
public static bool Play_Patch(AudioSource __instance)
{
bool result = true;
if ((Object)(object)__instance != (Object)null && (Object)(object)__instance.clip != (Object)null)
{
result = CheckIfMute(__instance.clip.GetName());
}
return result;
}
[HarmonyPatch("PlayOneShotHelper", new Type[]
{
typeof(AudioSource),
typeof(AudioClip),
typeof(float)
})]
[HarmonyPrefix]
private static bool PlaySourceClip_Patch(AudioSource __instance, ref AudioSource source, ref AudioClip clip)
{
bool flag = true;
bool flag2 = true;
bool flag3 = true;
if ((Object)(object)__instance != (Object)null && (Object)(object)__instance.clip != (Object)null)
{
flag = CheckIfMute(__instance.clip.GetName());
}
if ((Object)(object)source != (Object)null && (Object)(object)source.clip != (Object)null)
{
flag2 = CheckIfMute(source.clip.GetName());
}
if ((Object)(object)clip != (Object)null)
{
flag3 = CheckIfMute(clip.GetName());
}
return flag && flag2 && flag3;
}
[HarmonyPatch("PlayHelper", new Type[]
{
typeof(AudioSource),
typeof(ulong)
})]
[HarmonyPrefix]
private static bool PlaySource_Patch(AudioSource __instance, ref AudioSource source)
{
bool flag = true;
bool flag2 = true;
if ((Object)(object)__instance != (Object)null && (Object)(object)__instance.clip != (Object)null)
{
flag = CheckIfMute(__instance.clip.GetName());
}
if ((Object)(object)source != (Object)null && (Object)(object)source.clip != (Object)null)
{
flag2 = CheckIfMute(source.clip.GetName());
}
return flag && flag2;
}
[HarmonyPatch("PlayOneShot", new Type[] { typeof(AudioClip) })]
[HarmonyPatch("PlayOneShot", new Type[]
{
typeof(AudioClip),
typeof(float)
})]
[HarmonyPatch("PlayClipAtPoint", new Type[]
{
typeof(AudioClip),
typeof(Vector3)
})]
[HarmonyPatch("PlayClipAtPoint", new Type[]
{
typeof(AudioClip),
typeof(Vector3),
typeof(float)
})]
[HarmonyPrefix]
private static bool PlayClip_Patch(AudioSource __instance, ref AudioClip clip)
{
bool flag = true;
bool flag2 = true;
if ((Object)(object)__instance != (Object)null && (Object)(object)__instance.clip != (Object)null)
{
flag = CheckIfMute(__instance.clip.GetName());
}
if ((Object)(object)clip != (Object)null)
{
flag2 = CheckIfMute(clip.GetName());
}
return flag && flag2;
}
private static bool CheckIfMute(string name)
{
string[] source = new string[41]
{
"Menu1", "AmbientMusic1", "AmbientMusic2", "AmbientMusic3", "ShipAmbiance1", "ShipEngineOutside", "EclipseAmbience", "ButlerIdleAmbience", "ButlerBuzzingAmbience", "EmbrionAmbience",
"LungMachine", "LungMachineDisconnect", "ChargeItem", "LRADAlarm3", "LradBrainwashingSignal1", "LradBrainwashingSignal4", "LradBrainwashingSignal6", "LradBrainwashingSignal7", "LradBrainwashingSignal8", "robotTune",
"ToWar", "RobotToyCheer", "BeesAngry", "BeesDefensive", "BeeHiveIdle", "Deeper1", "Deeper2", "MessedUpMarimba", "GhostlySynth", "GhostlySynth2",
"Howling3", "Howling4", "Radio1", "Radio1_Bananas", "v50NondiageticAmbience2", "DeepBass", "CaveShifting1", "CaveShifting2", "ConstructionUnderground1", "ConstructionUnderground2",
"DropBell"
};
source.Contains(name);
return !source.Contains(name);
}
}
[HarmonyPatch(typeof(EntranceTeleport))]
internal class EntranceTeleportPatch
{
[HarmonyPatch("TeleportPlayer")]
[HarmonyPostfix]
private static void TeleportPlayerPatch()
{
GameObject[] array = Object.FindObjectsByType<GameObject>((FindObjectsSortMode)0);
GameObject[] array2 = array;
foreach (GameObject val in array2)
{
if (((Object)val).name.Contains("LungApparatus"))
{
val.GetComponent<AudioSource>().mute = true;
}
}
}
}
[HarmonyPatch(typeof(ButlerEnemyAI), "Start")]
internal class ButlerPatch
{
private static void Postfix(ButlerEnemyAI __instance)
{
if ((Object)(object)__instance != (Object)null)
{
__instance.ambience1.mute = true;
__instance.buzzingAmbience.mute = true;
}
}
}
[HarmonyPatch(typeof(ButlerBeesEnemyAI), "Start")]
internal class ButlerBeesPatch
{
private static void Postfix(EnemyAI __instance)
{
if ((Object)(object)__instance != (Object)null && __instance is ButlerBeesEnemyAI)
{
((ButlerBeesEnemyAI)((__instance is ButlerBeesEnemyAI) ? __instance : null)).buzzing.mute = true;
}
}
}
[HarmonyPatch(typeof(RedLocustBees), "Start")]
internal class RedLocustBeesPatch
{
private static void Postfix(RedLocustBees __instance)
{
if ((Object)(object)__instance != (Object)null)
{
__instance.beesAngry.mute = true;
__instance.beesDefensive.mute = true;
__instance.beesIdle.mute = true;
}
}
}
[HarmonyPatch(typeof(VehicleController), "Start")]
internal class VehicleControllerPatch
{
private static void Postfix(VehicleController __instance)
{
AudioSource[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<AudioSource>();
foreach (AudioSource val in componentsInChildren)
{
if (((Object)val).name.Contains("EngineAudio"))
{
val.mute = true;
}
}
}
}
[HarmonyPatch(typeof(HUDManager))]
internal class HUDManagerPatch
{
[HarmonyPatch("ShakeCamera")]
[HarmonyPrefix]
private static bool ShakeCameraPatch(ScreenShakeType shakeType)
{
return false;
}
}
}