Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ButteryFixes v1.17.5
ButteryFixes.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; 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.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using ButteryFixes.Utility; using DunGen; using DunGen.Graph; using GameNetcodeStuff; using HarmonyLib; using LobbyCompatibility.Enums; using LobbyCompatibility.Features; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("ButteryFixes")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Bundle of miscellaneous vanilla-compatible fixes")] [assembly: AssemblyFileVersion("1.17.5.0")] [assembly: AssemblyInformationalVersion("1.17.5+5fb4807a450537cca5637275feb9749ebdc7cc4c")] [assembly: AssemblyProduct("ButteryFixes")] [assembly: AssemblyTitle("ButteryFixes")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.17.5.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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ButteryFixes { internal class Compatibility { internal const string GUID_LETHAL_FIXES = "uk.1a3.lethalfixes"; internal const string GUID_GENERAL_IMPROVEMENTS = "ShaosilGaming.GeneralImprovements"; internal const string GUID_BETTER_SPRAY_PAINT = "taffyko.BetterSprayPaint"; internal const string GUID_EVERYTHING_CAN_DIE = "nwnt.EverythingCanDie"; internal const string GUID_MORE_COMPANY = "me.swipez.melonloader.morecompany"; internal const string GUID_TOUCHSCREEN = "me.pm.TheDeadSnake"; internal const string GUID_REBALANCED_MOONS = "dopadream.lethalcompany.rebalancedmoons"; internal const string GUID_CRUISER_ADDITIONS = "4902.Cruiser_Additions"; internal const string GUID_TERMINAL_STUFF = "darmuh.TerminalStuff"; internal const string GUID_LOBBY_COMPATIBILITY = "BMX.LobbyCompatibility"; internal const string GUID_OPEN_BODY_CAMS = "Zaggy1024.OpenBodyCams"; internal const string GUID_NO_LOST_SIGNAL = "Tomatobird.NoLostSignal"; internal const string GUID_DROP_SHIP_DELIVERY_CAP_MODIFIER = "com.github.Sylkadi.DropShipDeliveryCapModifier"; internal const string GUID_CRUISER_IMPROVED = "DiggC.CruiserImproved"; internal const string GUID_UPTURNED_VARIETY = "butterystancakes.lethalcompany.upturnedvariety"; internal static bool INSTALLED_GENERAL_IMPROVEMENTS; internal static bool INSTALLED_MORE_COMPANY; internal static bool INSTALLED_EVERYTHING_CAN_DIE; internal static bool INSTALLED_REBALANCED_MOONS; internal static bool INSTALLED_UPTURNED_VARIETY; internal static bool DISABLE_SPRAY_PAINT_PATCHES; internal static bool DISABLE_INTERACT_FIX; internal static bool DISABLE_PRICE_TEXT_FITTING; internal static bool DISABLE_ROTATION_PATCH; internal static bool DISABLE_SIGNAL_PATCH; internal static bool DISABLE_PURCHASE_CAP_PATCH; internal static bool DISABLE_SCAN_PATCH; internal static void Init() { if (Chainloader.PluginInfos.ContainsKey("ShaosilGaming.GeneralImprovements")) { INSTALLED_GENERAL_IMPROVEMENTS = true; Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - GeneralImprovements detected"); } if (Chainloader.PluginInfos.ContainsKey("taffyko.BetterSprayPaint")) { DISABLE_SPRAY_PAINT_PATCHES = true; Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - Spray paint patches will be disabled"); } if (Chainloader.PluginInfos.ContainsKey("nwnt.EverythingCanDie")) { INSTALLED_EVERYTHING_CAN_DIE = true; Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - Everything Can Die detected"); } if (Chainloader.PluginInfos.ContainsKey("me.swipez.melonloader.morecompany")) { INSTALLED_MORE_COMPANY = true; Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - More Company detected"); } if (Chainloader.PluginInfos.ContainsKey("me.pm.TheDeadSnake")) { DISABLE_INTERACT_FIX = true; Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - Touchscreen detected"); } if (Chainloader.PluginInfos.ContainsKey("dopadream.lethalcompany.rebalancedmoons")) { INSTALLED_REBALANCED_MOONS = true; Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - Rebalanced Moons detected"); } if (INSTALLED_GENERAL_IMPROVEMENTS || Chainloader.PluginInfos.ContainsKey("darmuh.TerminalStuff")) { Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - Price text patch will be disabled"); DISABLE_PRICE_TEXT_FITTING = true; } if (Chainloader.PluginInfos.ContainsKey("BMX.LobbyCompatibility")) { Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - Lobby Compatibility detected"); LobbyCompatibility.Init(); } if (Chainloader.PluginInfos.ContainsKey("Zaggy1024.OpenBodyCams")) { DISABLE_ROTATION_PATCH = true; Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - OpenBodyCams detected"); } if (Chainloader.PluginInfos.ContainsKey("Tomatobird.NoLostSignal")) { DISABLE_SIGNAL_PATCH = true; Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - NoLostSignal detected"); } if (INSTALLED_GENERAL_IMPROVEMENTS || Chainloader.PluginInfos.ContainsKey("com.github.Sylkadi.DropShipDeliveryCapModifier")) { DISABLE_PURCHASE_CAP_PATCH = true; Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - Purchase cap patch (x12) will be disabled"); } if (Chainloader.PluginInfos.ContainsKey("DiggC.CruiserImproved")) { DISABLE_SCAN_PATCH = true; Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - CruiserImproved detected"); } if (Chainloader.PluginInfos.ContainsKey("butterystancakes.lethalcompany.upturnedvariety")) { INSTALLED_UPTURNED_VARIETY = true; Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - Upturned Variety detected"); } } } internal enum FilmGrains { None = -1, MenusOnly, Full } internal enum GameResolution { DontChange = -1, Low, High } internal enum MusicDopplerLevel { Vanilla = -1, None, Reduced } internal class Configuration { private static ConfigFile configFile; internal static ConfigEntry<bool> makeConductive; internal static ConfigEntry<bool> fixJumpCheese; internal static ConfigEntry<bool> showApparatusValue; internal static ConfigEntry<bool> scanImprovements; internal static ConfigEntry<bool> fixSurfacePrices; internal static ConfigEntry<bool> lockInTerminal; internal static ConfigEntry<bool> filterDecor; internal static ConfigEntry<bool> typeGordion; internal static ConfigEntry<bool> playermodelPatches; internal static ConfigEntry<bool> patchLadders; internal static ConfigEntry<bool> adjustCooldowns; internal static ConfigEntry<bool> noBodyNoSignal; internal static ConfigEntry<bool> theGoldenGoblet; internal static ConfigEntry<bool> charredBodies; internal static ConfigEntry<bool> bodiesCollectSelf; internal static ConfigEntry<FilmGrains> restoreFilmGrain; internal static void Init(ConfigFile cfg) { configFile = cfg; CompatibilityConfig(); GameplayConfig(); VisualConfig(); ExtraConfig(); MigrateLegacyConfigs(); } private static void CompatibilityConfig() { patchLadders = configFile.Bind<bool>("Compatibility", "PatchLadders", true, "Fixes stamina being wasted if you hold the sprint button on ladders. This will prevent other mods (Better Ladders, Fast Climbing, Better Stamina, General Improvements, etc.) from allowing ladder sprint as a feature."); bodiesCollectSelf = configFile.Bind<bool>("Compatibility", "BodiesCollectSelf", true, "Bodies will automatically collect themselves when teleported to the ship, or when players die inside of the ship."); } private static void GameplayConfig() { makeConductive = configFile.Bind<bool>("Gameplay", "MakeConductive", true, "(Host only) Makes some metallic items that are non-conductive in vanilla actually conductive. This fix applies sensibly to the existing items, but you can disable it if you are used to vanilla's properties."); fixJumpCheese = configFile.Bind<bool>("Gameplay", "FixJumpCheese", true, "(Host only) Enabling this makes enemies hear players jumping and landing on the floor. This fixes the exploit where you can silently move past dogs with sprinting speed by spamming the jump button."); fixSurfacePrices = configFile.Bind<bool>("Gameplay", "FixSurfacePrices", true, "(Host only) Fixes individual bee hives not having separate prices from one another. (In vanilla, all hives fall into two price classes depending on distance from ship) This also fixes sapsucker eggs having inconsistent prices on identical seeds."); } private static void VisualConfig() { restoreFilmGrain = configFile.Bind<FilmGrains>("Visual", "RestoreFilmGrain", FilmGrains.None, "Restores film grain effects from pre-release versions of the game. WARNING: Be aware that this might cause white screens on certain hardware."); showApparatusValue = configFile.Bind<bool>("Visual", "ShowApparatusValue", false, "Actually show the apparatus' value on the scanner instead of \"???\" (in vanilla, it is always $80)"); playermodelPatches = configFile.Bind<bool>("Visual", "PlayermodelPatches", true, "Fixes some issues with dead bodies not displaying badges, using the wrong suit, not having attachments (bee and bunny), etc.\nIf you use ModelReplacementAPI I would strongly suggest disabling this if you run into issues!"); } private static void ExtraConfig() { scanImprovements = configFile.Bind<bool>("Extra", "ScanImprovements", true, "Allows the \"scan\" command on the terminal to count the value of items on your ship while parked at Gordion. Butlers' knives will be visible on the map and \"scan\" command before they are killed. When infected by Cadavers, you will be able to see a red dot when spectating yourself on the ship's radar, just like other players."); lockInTerminal = configFile.Bind<bool>("Extra", "LockInTerminal", false, "The camera will be frozen when you use the terminal, and typing should be more immediately responsive.\nThis will also lock the camera when charging items, pulling the lever, or sitting in the sofa chair."); filterDecor = configFile.Bind<bool>("Extra", "FilterDecor", true, "Decorations (suits, furniture, etc.) you have already purchased will be filtered out of the shop's list on the terminal, potentially allowing you to see the unused \"[No items available]\" text.\n(Also fixes the missing bullet points.)"); typeGordion = configFile.Bind<bool>("Extra", "TypeGordion", false, "You can type \"Gordion\" into the terminal (in place of \"company\") when using the route/info commands."); adjustCooldowns = configFile.Bind<bool>("Extra", "AdjustCooldowns", true, "Changes the cooldown on some items and interactable furniture to prevent sounds overlapping in strange ways."); noBodyNoSignal = configFile.Bind<bool>("Extra", "NoBodyNoSignal", false, "When a player's corpse is completely destroyed (eaten by a Forest Keeper, suffocated by quicksand, etc.) the radar will display the \"No signal!\" screen instead of spectating the location where they died."); theGoldenGoblet = configFile.Bind<bool>("Extra", "TheGoldenGoblet", false, "Renames the \"Golden cup\" to \"Golden goblet\""); charredBodies = configFile.Bind<bool>("Extra", "CharredBodies", true, "When a player dies to any sort of explosion, their corpse will appear burnt, much like Cruiser explosions. (This also applies to electrocution from the electric chair.) \"PlayermodelPatches\" is *required* for this to work!"); } private static void MigrateLegacyConfigs() { configFile.Bind<bool>("Gameplay", "KillOldBirds", true, "Legacy setting, doesn't work"); configFile.Remove(configFile["Gameplay", "KillOldBirds"].Definition); configFile.Bind<bool>("Visual", "FancyEntranceDoors", false, "Legacy setting, use \"Chameleon\" instead"); configFile.Remove(configFile["Visual", "FancyEntranceDoors"].Definition); if (!scanImprovements.Value) { if (configFile.Bind<bool>("Extra", "ScanOnShip", false, "Legacy setting, doesn't work").Value) { scanImprovements.Value = true; } configFile.Remove(configFile["Extra", "ScanOnShip"].Definition); } configFile.Bind<bool>("Visual", "RestoreShipIcon", true, "Legacy setting, doesn't work"); configFile.Remove(configFile["Visual", "RestoreShipIcon"].Definition); if (fixSurfacePrices.Value) { if (!configFile.Bind<bool>("Gameplay", "FixHivePrices", true, "Legacy setting, doesn't work").Value) { fixSurfacePrices.Value = false; } configFile.Remove(configFile["Gameplay", "FixHivePrices"].Definition); } configFile.Bind<bool>("Gameplay", "LimitSpawnChance", false, "Legacy setting, use \"Spawn Cycle Fixes\" instead"); configFile.Remove(configFile["Gameplay", "LimitSpawnChance"].Definition); configFile.Bind<bool>("Gameplay", "UnlimitedOldBirds", false, "Legacy setting, use \"Spawn Cycle Fixes\" instead"); configFile.Remove(configFile["Gameplay", "UnlimitedOldBirds"].Definition); configFile.Bind<bool>("Gameplay", "MaskHornetsPower", false, "Legacy setting, use \"Spawn Cycle Fixes\" instead"); configFile.Remove(configFile["Gameplay", "MaskHornetsPower"].Definition); configFile.Bind<bool>("Gameplay", "RandomizeDefaultSeed", true, "Legacy setting, doesn't work"); configFile.Remove(configFile["Gameplay", "RandomizeDefaultSeed"].Definition); configFile.Bind<bool>("Gameplay", "FixGiantSight", true, "Legacy setting, doesn't work"); configFile.Remove(configFile["Gameplay", "FixGiantSight"].Definition); configFile.Bind<bool>("Compatibility", "PatchPocketLights", true, "Legacy setting, doesn't work"); configFile.Remove(configFile["Compatibility", "PatchPocketLights"].Definition); configFile.Bind<bool>("Audio", "RestoreArtificeAmbience", true, "Legacy setting, doesn't work"); configFile.Remove(configFile["Audio", "RestoreArtificeAmbience"].Definition); configFile.Bind<bool>("Visual", "DisableLODFade", true, "Legacy setting, doesn't work"); configFile.Remove(configFile["Visual", "DisableLODFade"].Definition); configFile.Bind<bool>("Compatibility", "AutoCollect", true, "Legacy setting, doesn't work"); configFile.Remove(configFile["Compatibility", "AutoCollect"].Definition); configFile.Bind<bool>("Compatibility", "EndOrbitEarly", true, "Legacy setting, doesn't work"); configFile.Remove(configFile["Compatibility", "EndOrbitEarly"].Definition); configFile.Bind<bool>("Visual", "ForceMaxQuality", false, "Legacy setting, doesn't work"); configFile.Remove(configFile["Visual", "ForceMaxQuality"].Definition); configFile.Bind<bool>("Gameplay", "KeysAreScrap", false, "Legacy setting, doesn't work"); configFile.Remove(configFile["Gameplay", "KeysAreScrap"].Definition); configFile.Bind<bool>("Gameplay", "FixFireExits", true, "Legacy setting, doesn't work"); configFile.Remove(configFile["Gameplay", "FixFireExits"].Definition); configFile.Bind<bool>("Audio", "MusicDopplerLevel", false, "Legacy setting, use \"Enemy Sound Fixes\" instead"); configFile.Remove(configFile["Audio", "MusicDopplerLevel"].Definition); configFile.Bind<bool>("Extra", "AlterBestiary", false, "Legacy setting, doesn't work"); configFile.Remove(configFile["Extra", "AlterBestiary"].Definition); configFile.Save(); } } internal static class LobbyCompatibility { internal static void Init() { PluginHelper.RegisterPlugin("butterystancakes.lethalcompany.butteryfixes", Version.Parse("1.17.5"), (CompatibilityLevel)0, (VersionStrictness)0); } } [BepInPlugin("butterystancakes.lethalcompany.butteryfixes", "Buttery Fixes", "1.17.5")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal const string PLUGIN_GUID = "butterystancakes.lethalcompany.butteryfixes"; internal const string PLUGIN_NAME = "Buttery Fixes"; internal const string PLUGIN_VERSION = "1.17.5"; internal static ManualLogSource Logger; private void Awake() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) Logger = ((BaseUnityPlugin)this).Logger; Compatibility.Init(); Configuration.Init(((BaseUnityPlugin)this).Config); if (RestoreFilmGrain.GetTextures()) { SceneManager.sceneLoaded += RestoreFilmGrain.OverrideVolumes; } new Harmony("butterystancakes.lethalcompany.butteryfixes").PatchAll(); SceneManager.sceneLoaded += SceneOverrides.OnSceneLoaded; SceneManager.sceneUnloaded += delegate { GlobalReferences.caveTiles.Clear(); }; RenderPipelineManager.beginCameraRendering += RenderingOverrides.OnBeginCameraRendering; RenderPipelineManager.endCameraRendering += RenderingOverrides.OnEndCameraRendering; Logger.LogInfo((object)"Buttery Fixes v1.17.5 loaded"); } } public static class PluginInfo { public const string PLUGIN_GUID = "ButteryFixes"; public const string PLUGIN_NAME = "ButteryFixes"; public const string PLUGIN_VERSION = "1.17.5"; } } namespace ButteryFixes.Utility { internal static class EnemyRadar { internal class RadarButler { internal ButlerEnemyAI butler; internal Transform radarIcon; internal Transform knife; internal bool dying; } [CompilerGenerated] private sealed class <ButlerDeathAnimation>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public RadarButler butler; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ButlerDeathAnimation>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1.1f); <>1__state = 1; return true; case 1: <>1__state = -1; if (butler == null) { return false; } break; case 2: <>1__state = -1; break; } if (butler != null && !((EnemyAI)butler.butler).creatureAnimator.GetBool("popFinish")) { <>2__current = null; <>1__state = 2; return true; } if (butler != null) { if ((Object)(object)butler.radarIcon != (Object)null) { Object.Destroy((Object)(object)((Component)butler.radarIcon).gameObject); } allButlers.Remove(butler); Plugin.Logger.LogDebug((object)$"Radar: Butler #{((Object)butler.butler).GetInstanceID()} dropped knife"); } 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 List<RadarButler> allButlers = new List<RadarButler>(7); private static Transform infectionDot; internal static void SpawnButler(ButlerEnemyAI butler) { List<RadarButler> list = allButlers; RadarButler obj = new RadarButler { butler = butler }; GameObject itemRadarIconPrefab = StartOfRound.Instance.itemRadarIconPrefab; GameObject mapPropsContainer = RoundManager.Instance.mapPropsContainer; obj.radarIcon = Object.Instantiate<GameObject>(itemRadarIconPrefab, (mapPropsContainer != null) ? mapPropsContainer.transform : null).transform; obj.knife = ((Component)((EnemyAI)butler).creatureAnimator).transform.Find("Rig 1/Arms/RightArm/upperRightArmContainer/upper_arm.R_target/Knife"); list.Add(obj); Plugin.Logger.LogDebug((object)$"Radar: Butler #{((Object)butler).GetInstanceID()} registered"); } internal static void Reset() { if (allButlers.Count > 0) { for (int num = allButlers.Count - 1; num >= 0; num--) { if ((Object)(object)allButlers[num]?.radarIcon != (Object)null) { Object.Destroy((Object)(object)((Component)allButlers[num].radarIcon).gameObject); } } allButlers.Clear(); Plugin.Logger.LogDebug((object)"Radar: No more butlers"); } CureLocalPlayer(); } internal static void Refresh() { //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) if (allButlers.Count <= 0) { return; } for (int num = allButlers.Count - 1; num >= 0; num--) { if (allButlers[num] == null || (Object)(object)allButlers[num].radarIcon == (Object)null) { allButlers.RemoveAt(num); Plugin.Logger.LogDebug((object)$"Radar: Butler at index {num} is missing, this shouldn't happen"); } else if (((EnemyAI)allButlers[num].butler).isEnemyDead) { if (!allButlers[num].dying) { allButlers[num].dying = true; ((MonoBehaviour)StartOfRound.Instance).StartCoroutine(ButlerDeathAnimation(allButlers[num])); allButlers[num].radarIcon.position = ((Component)allButlers[num].butler).transform.position + Vector3.up * 0.5f; Plugin.Logger.LogDebug((object)$"Radar: Butler #{((Object)allButlers[num].butler).GetInstanceID()} just died"); } } else { Vector3 position = allButlers[num].knife.position; if (allButlers[num].knife.localScale.x < 0.025f) { position.x = ((Component)allButlers[num].butler).transform.position.x; position.z = ((Component)allButlers[num].butler).transform.position.z; } allButlers[num].radarIcon.position = position; } } } [IteratorStateMachine(typeof(<ButlerDeathAnimation>d__6))] private static IEnumerator ButlerDeathAnimation(RadarButler butler) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ButlerDeathAnimation>d__6(0) { butler = butler }; } internal static int CountButlers() { return allButlers.Count; } internal static void InfectLocalPlayer(CadaverGrowthAI cadaverGrowthAI) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)infectionDot == (Object)null) { if ((Object)(object)cadaverGrowthAI?.scanNodePrefab == (Object)null) { return; } infectionDot = Object.Instantiate<Transform>(cadaverGrowthAI.scanNodePrefab.transform.Find("MapDot (2)"), GameNetworkManager.Instance.localPlayerController.bodyParts[5]); infectionDot.SetLocalPositionAndRotation(new Vector3(0f, 0.23112391f, -0.007852852f), Quaternion.Euler(0f, 99.461f, 0f)); infectionDot.localScale = new Vector3(0.21584508f, 0.20841183f, 0.21113071f); } if (!((Component)infectionDot).gameObject.activeSelf) { ((Component)infectionDot).gameObject.SetActive(true); Plugin.Logger.LogDebug((object)"Radar: Local player is infected"); } } internal static void CureLocalPlayer() { if ((Object)(object)infectionDot != (Object)null && ((Component)infectionDot).gameObject.activeSelf) { ((Component)infectionDot).gameObject.SetActive(false); Plugin.Logger.LogDebug((object)"Radar: Infection is over"); } } } internal static class GlobalReferences { internal const int NUM_LEVELS = 13; internal static readonly string[] INTERIOR_WHITELIST = new string[4] { "Level1Flow", "Level1Flow3Exits", "Level2Flow", "Level3Flow" }; private static Terminal _terminal; private static HangarShipDoor hangarShipDoor; private static StartMatchLever startMatchLever; private static MoldSpreadManager moldSpreadManager; internal static Dictionary<string, EnemyType> allEnemiesList = new Dictionary<string, EnemyType>(); internal static Mesh playerBody; internal static Material scavengerSuitBurnt; internal static bool crashedJetpackAsLocalPlayer; internal static GameObject smokeParticle; internal static Transform shipNode; internal static Vector3 shipNodeOffset; internal static readonly Vector3 shipDefaultPos = new Vector3(1.2714634f, 0.27843857f, -7.5f); internal static Animator shipAnimator; internal static VehicleController vehicleController; internal static int lockingCamera; internal static bool sittingInArmchair; internal static PlayerControllerB friedPlayer; internal static PlayerControllerB gibbedPlayer; internal static List<Bounds> caveTiles = new List<Bounds>(); internal static Vector3 mainEntrancePos; internal static Bounds mineStartBounds; internal static Renderer viewmodelArms; internal static Camera shipCamera; internal static Camera securityCamera; internal static List<GrabbableObject> microwavedItems = new List<GrabbableObject>(); internal static PlayerControllerB lastDriver; internal static Vector3 lastLightningStrike = new Vector3(3000f, 0f, 3000f); internal static float lightningLastStruck; internal static bool forceMaxQuality; internal static bool localPlayerHasBackFlowers; internal static BreakerBox breakerBox; internal static Terminal Terminal { get { if ((Object)(object)_terminal == (Object)null) { _terminal = Object.FindAnyObjectByType<Terminal>(); } return _terminal; } } internal static HangarShipDoor HangarShipDoor { get { if ((Object)(object)hangarShipDoor == (Object)null) { hangarShipDoor = Object.FindAnyObjectByType<HangarShipDoor>(); } return hangarShipDoor; } } internal static StartMatchLever StartMatchLever { get { if ((Object)(object)startMatchLever == (Object)null) { startMatchLever = Object.FindAnyObjectByType<StartMatchLever>(); } return startMatchLever; } } internal static MoldSpreadManager MoldSpreadManager { get { if ((Object)(object)moldSpreadManager == (Object)null) { moldSpreadManager = Object.FindAnyObjectByType<MoldSpreadManager>(); } return moldSpreadManager; } } } internal class HeartHack : MonoBehaviour { internal LoopShapeKey loopShapeKey; private float time; private void LateUpdate() { if ((Object)(object)loopShapeKey != (Object)null) { time += Time.deltaTime * loopShapeKey.fearMultiplier; if ((Object)(object)loopShapeKey.skinnedMeshRenderer != (Object)null && ((Behaviour)loopShapeKey).enabled) { loopShapeKey.skinnedMeshRenderer.SetBlendShapeWeight(0, Mathf.PingPong(time * 156f, 100f)); loopShapeKey.skinnedMeshRenderer.SetBlendShapeWeight(1, Mathf.PingPong(time * 120f, 100f)); } } else { loopShapeKey = ((Component)this).GetComponent<LoopShapeKey>(); if ((Object)(object)loopShapeKey == (Object)null) { Plugin.Logger.LogWarning((object)("Error initializing heartbeat animation for " + ((Object)this).name)); ((Behaviour)this).enabled = false; } } } } public static class NonPatchFunctions { [CompilerGenerated] private sealed class <>c__DisplayClass2_0 { public ShotgunItem shotgun; public float timeSinceStart; internal bool <ShellsAppearAfterDelay>b__0() { if (shotgun.isReloading) { return Time.realtimeSinceStartup - timeSinceStart > 3f; } return true; } } [CompilerGenerated] private sealed class <InteractionTemporarilyLocksCamera>d__7 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public InteractTrigger trigger; private float <startTime>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <InteractionTemporarilyLocksCamera>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)trigger == (Object)null) { return false; } <startTime>5__2 = Time.realtimeSinceStartup; goto IL_0056; case 1: <>1__state = -1; goto IL_0056; case 2: { <>1__state = -1; if (GlobalReferences.lockingCamera > 0) { GlobalReferences.lockingCamera--; } return false; } IL_0056: if ((Object)(object)trigger.playerScriptInSpecialAnimation != (Object)(object)GameNetworkManager.Instance.localPlayerController && Time.realtimeSinceStartup - <startTime>5__2 < 2f) { <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)trigger.playerScriptInSpecialAnimation != (Object)(object)GameNetworkManager.Instance.localPlayerController) { Plugin.Logger.LogDebug((object)"Failed to lock animation for local player, who never entered animation state"); return false; } GlobalReferences.lockingCamera++; <>2__current = (object)new WaitForSeconds(trigger.animationWaitTime); <>1__state = 2; return true; } } 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 <LightningShakesBody>d__11 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DeadBodyInfo deadBodyInfo; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LightningShakesBody>d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForFixedUpdate(); <>1__state = 1; return true; case 1: <>1__state = -1; if (Time.realtimeSinceStartup - GlobalReferences.lightningLastStruck <= 2f && (Object)(object)deadBodyInfo?.playerScript != (Object)null && Vector3.Distance(GlobalReferences.lastLightningStrike, deadBodyInfo.playerScript.positionOfDeath) <= 7f) { Plugin.Logger.LogDebug((object)("Player \"" + deadBodyInfo.playerScript.playerUsername + "\" was likely struck by lightning, shake rigidbodies")); ShakeRigidbodies obj = ((Component)deadBodyInfo).gameObject.AddComponent<ShakeRigidbodies>(); obj.rigidBodies = (from rb in ((Component)deadBodyInfo).GetComponentsInChildren<Rigidbody>() where ((Component)rb).gameObject.layer == 20 && !((Object)rb).name.EndsWith("lower") && !((Object)rb).name.StartsWith("shin") select rb).ToArray(); obj.shakeTimer = 5f; obj.shakeIntensity = 4755f; } 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 <ShellsAppearAfterDelay>d__2 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ShotgunItem shotgun; private <>c__DisplayClass2_0 <>8__1; private bool <wasHeldByEnemy>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ShellsAppearAfterDelay>d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass2_0(); <>8__1.shotgun = shotgun; <wasHeldByEnemy>5__2 = ((GrabbableObject)<>8__1.shotgun).isHeldByEnemy; <>8__1.timeSinceStart = Time.realtimeSinceStartup; <>2__current = (object)new WaitForSeconds(((GrabbableObject)<>8__1.shotgun).isHeldByEnemy ? 0.85f : 1.9f); <>1__state = 1; return true; case 1: <>1__state = -1; if (((GrabbableObject)<>8__1.shotgun).isHeldByEnemy) { ((Renderer)<>8__1.shotgun.shotgunShellLeft).forceRenderingOff = false; ((Renderer)<>8__1.shotgun.shotgunShellLeft).enabled = true; ((Renderer)<>8__1.shotgun.shotgunShellRight).forceRenderingOff = false; ((Renderer)<>8__1.shotgun.shotgunShellRight).enabled = true; } else if (((Renderer)<>8__1.shotgun.shotgunShellLeft).enabled) { ((Renderer)<>8__1.shotgun.shotgunShellRight).enabled = true; } else { ((Renderer)<>8__1.shotgun.shotgunShellLeft).enabled = true; } <>2__current = (object)new WaitForSeconds(((GrabbableObject)<>8__1.shotgun).isHeldByEnemy ? 0.66f : 0.75f); <>1__state = 2; return true; case 2: <>1__state = -1; if (!<wasHeldByEnemy>5__2) { <>2__current = (object)new WaitUntil((Func<bool>)(() => !<>8__1.shotgun.isReloading || Time.realtimeSinceStartup - <>8__1.timeSinceStart > 3f)); <>1__state = 3; return true; } break; case 3: <>1__state = -1; break; } ((Renderer)<>8__1.shotgun.shotgunShellLeft).forceRenderingOff = true; ((Renderer)<>8__1.shotgun.shotgunShellRight).forceRenderingOff = true; Plugin.Logger.LogDebug((object)$"Finished animating shotgun shells (held by enemy: {((GrabbableObject)<>8__1.shotgun).isHeldByEnemy})"); 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 <TryAutoCollectBody>d__12 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DeadBodyInfo deadBodyInfo; private float <timeOfDeath>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <TryAutoCollectBody>d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <timeOfDeath>5__2 = Time.realtimeSinceStartup; break; case 1: <>1__state = -1; break; } if (Time.realtimeSinceStartup - <timeOfDeath>5__2 <= 2f && (Object)(object)deadBodyInfo?.grabBodyObject == (Object)null) { <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)deadBodyInfo != (Object)null && !deadBodyInfo.deactivated && (Object)(object)deadBodyInfo.grabBodyObject != (Object)null && !deadBodyInfo.grabBodyObject.deactivated && (Object)(object)deadBodyInfo.playerScript != (Object)null) { deadBodyInfo.playerScript.SetItemInElevator(true, true, deadBodyInfo.grabBodyObject); RoundManager.Instance.CollectNewScrapForThisRound(deadBodyInfo.grabBodyObject); Plugin.Logger.LogDebug((object)("Player \"" + deadBodyInfo.playerScript?.playerUsername + "\" automatically collected themself")); } 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(); } } internal static bool[] playerWasLastSprinting = new bool[50]; internal static int hives; [IteratorStateMachine(typeof(<ShellsAppearAfterDelay>d__2))] internal static IEnumerator ShellsAppearAfterDelay(ShotgunItem shotgun) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ShellsAppearAfterDelay>d__2(0) { shotgun = shotgun }; } internal static void FakeFootstepAlert(PlayerControllerB player) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) bool flag = player.isInHangarShipRoom && StartOfRound.Instance.hangarDoorsClosed; if ((int)player.actualClientId < playerWasLastSprinting.Length && (((NetworkBehaviour)player).IsOwner ? player.isSprinting : playerWasLastSprinting[(uint)player.actualClientId])) { RoundManager.Instance.PlayAudibleNoise(((Component)player).transform.position, 22f, 0.6f, 0, flag, 3322); } else { RoundManager.Instance.PlayAudibleNoise(((Component)player).transform.position, 17f, 0.4f, 0, flag, 3322); } } internal static void ForceRefreshAllHelmetLights(PlayerControllerB player, bool forceOff = false) { for (int i = 0; i < player.allHelmetLights.Length; i++) { bool flag = false; if (!forceOff) { if ((Object)(object)player.ItemOnlySlot != (Object)null) { GrabbableObject itemOnlySlot = player.ItemOnlySlot; FlashlightItem val = (FlashlightItem)(object)((itemOnlySlot is FlashlightItem) ? itemOnlySlot : null); if ((Object)(object)val != (Object)null && val.flashlightTypeID == i && ((GrabbableObject)val).isPocketed && ((GrabbableObject)val).isBeingUsed && ((GrabbableObject)val).insertedBattery.charge > 0f) { flag = true; } } if (!flag) { for (int j = 0; j < player.ItemSlots.Length; j++) { if ((Object)(object)player.ItemSlots[j] != (Object)null) { GrabbableObject obj = player.ItemSlots[j]; FlashlightItem val2 = (FlashlightItem)(object)((obj is FlashlightItem) ? obj : null); if ((Object)(object)val2 != (Object)null && val2.flashlightTypeID == i && ((GrabbableObject)val2).isPocketed && ((GrabbableObject)val2).isBeingUsed && ((GrabbableObject)val2).insertedBattery.charge > 0f) { flag = true; break; } } } } } if (((Behaviour)player.allHelmetLights[i]).enabled != flag) { ((Behaviour)player.allHelmetLights[i]).enabled = flag; Plugin.Logger.LogDebug((object)$"Fixed erroneous active state of {player.playerUsername}'s helmet light \"{((Object)player.allHelmetLights[i]).name}\" (now {flag})"); } } } internal static void SmokingHotCorpse(Transform body) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_009e: Unknown result type (might be due to invalid IL or missing references) SkinnedMeshRenderer skinnedMeshRenderer = default(SkinnedMeshRenderer); if ((Object)(object)GlobalReferences.smokeParticle == (Object)null || !((Component)body).TryGetComponent<SkinnedMeshRenderer>(ref skinnedMeshRenderer)) { return; } foreach (Transform item in body) { if (((Object)item).name.StartsWith(((Object)GlobalReferences.smokeParticle).name)) { return; } } GameObject obj = Object.Instantiate<GameObject>(GlobalReferences.smokeParticle, ((Component)body).transform); obj.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity); obj.transform.localScale = Vector3.one; ShapeModule shape = obj.GetComponent<ParticleSystem>().shape; ((ShapeModule)(ref shape)).skinnedMeshRenderer = skinnedMeshRenderer; Plugin.Logger.LogDebug((object)"Smoke from freshly burnt corpse"); } public static int RerollHivePrice(int price, Vector3 pos) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) hives++; if (!Configuration.fixSurfacePrices.Value || StartOfRound.Instance.isChallengeFile) { return price; } Random random = new Random(StartOfRound.Instance.randomMapSeed + 1314 + hives); int num = random.Next(50, 150); if (Vector3.Distance(pos, StartOfRound.Instance.shipLandingPosition.position) < 40f) { num = random.Next(40, 100); } Plugin.Logger.LogDebug((object)$"Hive price recalculated: ${price} -> ${num}"); return num; } [IteratorStateMachine(typeof(<InteractionTemporarilyLocksCamera>d__7))] internal static IEnumerator InteractionTemporarilyLocksCamera(InteractTrigger trigger) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <InteractionTemporarilyLocksCamera>d__7(0) { trigger = trigger }; } public static Vector3 GetTrueExitPoint(bool ignore = true, bool ignore2 = false) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (RoundManager.Instance.currentDungeonType == 4 && (Object)(object)RoundManager.Instance.currentMineshaftElevator != (Object)null && !((Bounds)(ref GlobalReferences.mineStartBounds)).Contains(((Component)StartOfRound.Instance.mapScreen.mapCamera).transform.position - Vector3.up * 3.75f)) { return RoundManager.Instance.currentMineshaftElevator.elevatorBottomPoint.position; } return GlobalReferences.mainEntrancePos; } internal static void ClearMicrowave() { for (int i = 0; i < GlobalReferences.microwavedItems.Count; i++) { if (!((Object)(object)GlobalReferences.microwavedItems[i] == (Object)null)) { GlobalReferences.microwavedItems[i].rotateObject = false; } } GlobalReferences.microwavedItems.Clear(); } public static PlayerControllerB CruiserCreditsPlayer() { if ((Object)(object)GlobalReferences.lastDriver != (Object)null) { return GlobalReferences.lastDriver; } return GameNetworkManager.Instance.localPlayerController; } [IteratorStateMachine(typeof(<LightningShakesBody>d__11))] internal static IEnumerator LightningShakesBody(DeadBodyInfo deadBodyInfo) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LightningShakesBody>d__11(0) { deadBodyInfo = deadBodyInfo }; } [IteratorStateMachine(typeof(<TryAutoCollectBody>d__12))] internal static IEnumerator TryAutoCollectBody(DeadBodyInfo deadBodyInfo) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <TryAutoCollectBody>d__12(0) { deadBodyInfo = deadBodyInfo }; } } internal class PlayerGibsLinker : MonoBehaviour { private void Start() { //IL_008e: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)GlobalReferences.gibbedPlayer != (Object)null)) { return; } if (Configuration.playermodelPatches.Value) { UnlockableItem val = StartOfRound.Instance.unlockablesList.unlockables[GlobalReferences.gibbedPlayer.currentSuitID]; Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<Renderer>(); foreach (Renderer val2 in componentsInChildren) { if (((Object)val2).name == "Head (2)") { val2.sharedMaterial = val.suitMaterial; if ((Object)(object)val.headCostumeObject != (Object)null) { Transform transform = Object.Instantiate<GameObject>(val.headCostumeObject, ((Component)val2).transform.position, ((Component)val2).transform.rotation, ((Component)val2).transform).transform; ((Component)transform).transform.SetLocalPositionAndRotation(new Vector3(0.06989373f, 0.0544735f, -0.6852454f), Quaternion.Euler(96.69699f, 0f, 0f)); ((Component)transform).transform.localScale = new Vector3(((Component)transform).transform.localScale.x / ((Component)val2).transform.lossyScale.x, ((Component)transform).transform.localScale.y / ((Component)val2).transform.lossyScale.y, ((Component)transform).transform.localScale.z / ((Component)val2).transform.lossyScale.z) * 0.9f; } } else if (val2 is SkinnedMeshRenderer) { val2.sharedMaterials = (Material[])(object)new Material[2] { val.suitMaterial, val2.sharedMaterials[1] }; if (((Object)val2).name == "RendedBodyTorsoMesh" && (Object)(object)val.lowerTorsoCostumeObject != (Object)null) { Transform transform2 = Object.Instantiate<GameObject>(val.lowerTorsoCostumeObject, ((Component)val2).transform.position, ((Component)val2).transform.rotation, ((Component)val2).transform).transform; ((Component)transform2).transform.SetLocalPositionAndRotation(new Vector3(0.55988234f, -0.046097063f, -5.0041165f), Quaternion.Euler(88.184f, -51.554f, -51.067f)); ((Component)transform2).transform.localScale = new Vector3(((Component)transform2).transform.localScale.x / ((Component)val2).transform.lossyScale.x, ((Component)transform2).transform.localScale.y / ((Component)val2).transform.lossyScale.y, ((Component)transform2).transform.localScale.z / ((Component)val2).transform.lossyScale.z); } } } Plugin.Logger.LogDebug((object)("Apply suit to " + GlobalReferences.gibbedPlayer.playerUsername + "'s gibs")); } GlobalReferences.gibbedPlayer = null; } } internal static class ReflectionCache { internal static readonly FieldInfo IS_IN_HANGAR_SHIP_ROOM = AccessTools.Field(typeof(PlayerControllerB), "isInHangarShipRoom"); internal static readonly MethodInfo FIND_OBJECT_OF_TYPE_VEHICLE_CONTROLLER = AccessTools.Method(typeof(Object), "FindObjectOfType", (Type[])null, new Type[1] { typeof(VehicleController) }); internal static readonly MethodInfo FIND_OBJECT_OF_TYPE_MOLD_SPREAD_MANAGER = AccessTools.Method(typeof(Object), "FindObjectOfType", (Type[])null, new Type[1] { typeof(MoldSpreadManager) }); internal static readonly FieldInfo VEHICLE_CONTROLLER = AccessTools.Field(typeof(GlobalReferences), "vehicleController"); internal static readonly MethodInfo MOLD_SPREAD_MANAGER = AccessTools.DeclaredPropertyGetter(typeof(GlobalReferences), "MoldSpreadManager"); internal static readonly MethodInfo SET_SCRAP_VALUE = AccessTools.Method(typeof(GrabbableObject), "SetScrapValue", (Type[])null, (Type[])null); internal static readonly MethodInfo TRACK_GIFT_BOX_ON_CLIENT = AccessTools.Method(typeof(ScrapTracker), "TrackGiftBoxOnClient", (Type[])null, (Type[])null); } internal static class RenderingOverrides { private static bool? armsNotRendering; public static void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera) { ResetRendering(); if ((Object)(object)GlobalReferences.viewmodelArms == (Object)null) { armsNotRendering = null; return; } if ((Object)(object)camera == (Object)(object)GlobalReferences.shipCamera || (Object)(object)camera == (Object)(object)GlobalReferences.securityCamera) { armsNotRendering = GlobalReferences.viewmodelArms.forceRenderingOff; GlobalReferences.viewmodelArms.forceRenderingOff = true; } ManualCameraRenderer val = StartOfRound.Instance?.mapScreen; if (!((Object)(object)val != (Object)null) || !((Object)(object)camera == (Object)(object)val.headMountedCam) || !((Object)(object)val.targetedPlayer != (Object)null)) { return; } if (val.targetedPlayer.isPlayerDead) { if ((Object)(object)val.targetedPlayer.deadBody?.nightVisionRadar != (Object)null) { ((Behaviour)val.targetedPlayer.deadBody.nightVisionRadar).enabled = true; } } else if ((Object)(object)val.targetedPlayer.nightVisionRadar != (Object)null) { ((Behaviour)val.targetedPlayer.nightVisionRadar).enabled = true; } } public static void OnEndCameraRendering(ScriptableRenderContext context, Camera camera) { ResetRendering(); } private static void ResetRendering() { if (!armsNotRendering.HasValue) { return; } if ((Object)(object)GlobalReferences.viewmodelArms != (Object)null) { GlobalReferences.viewmodelArms.forceRenderingOff = armsNotRendering.Value; armsNotRendering = null; } PlayerControllerB val = StartOfRound.Instance.mapScreen?.targetedPlayer; if ((Object)(object)val != (Object)null) { if ((Object)(object)val.nightVisionRadar != (Object)null) { ((Behaviour)val.nightVisionRadar).enabled = false; } if ((Object)(object)val.deadBody?.nightVisionRadar != (Object)null) { ((Behaviour)val.deadBody.nightVisionRadar).enabled = false; } } } } internal static class RestoreFilmGrain { private static Texture scanline; private static Texture scanlineBlue; internal static bool GetTextures() { try { AssetBundle obj = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "filmgrain")); scanline = obj.LoadAsset<Texture>("scanline"); scanlineBlue = obj.LoadAsset<Texture>("scanlineBlue"); obj.Unload(false); return true; } catch { Plugin.Logger.LogError((object)"Encountered some error loading assets from bundle \"filmgrain\". Did you install the plugin correctly?"); return false; } } internal static void OverrideVolumes(Scene scene, LoadSceneMode mode) { if (Configuration.restoreFilmGrain.Value == FilmGrains.None || (Object)(object)scanline == (Object)null || (Object)(object)scanlineBlue == (Object)null) { return; } Volume[] array = Object.FindObjectsByType<Volume>((FindObjectsInactive)1, (FindObjectsSortMode)0); Bloom val2 = default(Bloom); foreach (Volume val in array) { if (((Object)val.sharedProfile).name != "UIEffects" && Configuration.restoreFilmGrain.Value == FilmGrains.MenusOnly) { continue; } switch (((Object)val.sharedProfile).name) { case "UIEffects": ApplyFilmGrain(val.sharedProfile, 0.085f, 0.06f, scanline, (FilmGrainLookup)10); val.sharedProfile.TryGet<Bloom>(ref val2); if ((Object)(object)val2 != (Object)null) { ((VolumeComponent)val2).active = true; Plugin.Logger.LogDebug((object)("Bloom: " + ((Object)val.sharedProfile).name)); } break; case "IngameHUD": ApplyFilmGrain(val.sharedProfile, 0f, 0.49f, scanline, (FilmGrainLookup)10); break; case "FlashbangedFilter": ApplyFilmGrain(val.sharedProfile, 1f, 0.818f, null, (FilmGrainLookup)9); break; case "InsanityVolume": ApplyFilmGrain(val.sharedProfile, 0.374f, 0.558f, null, (FilmGrainLookup)9); break; case "WakeUpVolume": ApplyFilmGrain(val.sharedProfile, 0.112f, 0.524f, scanline, (FilmGrainLookup)10); break; case "ScanVolume": ApplyFilmGrain(val.sharedProfile, 0.073f, 0.49f, scanlineBlue, (FilmGrainLookup)10); break; } } } private static void ApplyFilmGrain(VolumeProfile profile, float intensity, float response, Texture texture = null, FilmGrainLookup type = 10) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) FilmGrain val = default(FilmGrain); profile.TryGet<FilmGrain>(ref val); if ((Object)(object)val == (Object)null) { val = profile.Add<FilmGrain>(false); } if ((Object)(object)texture != (Object)null) { ((VolumeParameter<Texture>)(object)val.texture).Override(texture); ((VolumeParameter<FilmGrainLookup>)(object)val.type).Override((FilmGrainLookup)10); } else { ((VolumeParameter<FilmGrainLookup>)(object)val.type).Override(type); } ((VolumeParameter<float>)(object)val.intensity).Override(intensity); ((VolumeParameter<float>)(object)val.response).Override(response); if (((Object)profile).name == "InsanityVolume") { ((VolumeParameter)val.response).overrideState = false; } Plugin.Logger.LogDebug((object)("Film grain: " + ((Object)profile).name)); } } internal static class SceneOverrides { internal static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0a92: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_08be: Unknown result type (might be due to invalid IL or missing references) //IL_08c3: Unknown result type (might be due to invalid IL or missing references) //IL_08da: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_08fb: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_0911: Unknown result type (might be due to invalid IL or missing references) //IL_091e: Unknown result type (might be due to invalid IL or missing references) //IL_0934: Unknown result type (might be due to invalid IL or missing references) //IL_093e: Unknown result type (might be due to invalid IL or missing references) //IL_0948: Unknown result type (might be due to invalid IL or missing references) //IL_0955: Unknown result type (might be due to invalid IL or missing references) //IL_0ccc: Unknown result type (might be due to invalid IL or missing references) //IL_0c24: Unknown result type (might be due to invalid IL or missing references) //IL_09b9: Unknown result type (might be due to invalid IL or missing references) //IL_0b47: Unknown result type (might be due to invalid IL or missing references) //IL_0c6d: Unknown result type (might be due to invalid IL or missing references) //IL_0c86: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_0ee3: Unknown result type (might be due to invalid IL or missing references) //IL_0ee8: Unknown result type (might be due to invalid IL or missing references) //IL_0eed: Unknown result type (might be due to invalid IL or missing references) //IL_0ef2: Unknown result type (might be due to invalid IL or missing references) //IL_0d5c: Unknown result type (might be due to invalid IL or missing references) //IL_0d63: Expected O, but got Unknown //IL_0a14: Unknown result type (might be due to invalid IL or missing references) //IL_0a23: Unknown result type (might be due to invalid IL or missing references) //IL_0a36: Unknown result type (might be due to invalid IL or missing references) //IL_0a42: Unknown result type (might be due to invalid IL or missing references) //IL_0a4c: Unknown result type (might be due to invalid IL or missing references) //IL_0bcf: Unknown result type (might be due to invalid IL or missing references) //IL_0bde: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_06f5: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Expected O, but got Unknown //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) if ((int)mode != 1) { return; } GameObject obj = GameObject.Find("/Environment/Map/DiageticAmbiance/BigMachine"); Transform val = ((obj != null) ? obj.transform : null); List<string> list = new List<string>(); GameObject val2 = GameObject.Find("/Environment/ScanNodes/ScanNode"); switch (((Scene)(ref scene)).name) { case "Level1Experimentation": { Plugin.Logger.LogDebug((object)"Detected landing on Experimentation"); if ((Object)(object)val != (Object)null) { val.localPosition = new Vector3(-96.45731f, val.localPosition.y, val.localPosition.z); Plugin.Logger.LogDebug((object)"Experimentation - Fixed factory ambience"); } GameObject obj6 = GameObject.Find("/Environment/ReverbTriggers (1)/Cube (7)"); Transform val8 = ((obj6 != null) ? obj6.transform : null); if ((Object)(object)val8 != (Object)null) { val8.localPosition = new Vector3(-147.8f, val8.localPosition.y, -81.2f); val8.localScale = new Vector3(129.6264f, val8.localScale.y, 184.7249f); GameObject obj7 = GameObject.Find("/Environment/ReverbTriggers (1)/Cube (9)"); Transform val9 = ((obj7 != null) ? obj7.transform : null); if ((Object)(object)val9 != (Object)null) { val9.localPosition = new Vector3(-145.4f, val9.localPosition.y, -42.1f); val9.localScale = new Vector3(171.2598f, val9.localScale.y, 326.2066f); GameObject obj8 = GameObject.Find("/Environment/ReverbTriggers (1)/Cube (8)"); Transform val10 = ((obj8 != null) ? obj8.transform : null); if ((Object)(object)val10 != (Object)null) { val10.localPosition = new Vector3(-117.39f, val10.localPosition.y, -87.23f); val10.localScale = new Vector3(10.4316f, val10.localScale.y, 15.95104f); Plugin.Logger.LogDebug((object)"Experimentation - Adjusted water tower fog triggers"); } } } GameObject obj9 = GameObject.Find("/Environment/SteelDoor"); Transform val11 = ((obj9 != null) ? obj9.transform : null); if ((Object)(object)val11 != (Object)null) { val11.localPosition = new Vector3(-194.668f, 19.788f, val11.localPosition.z); Transform obj10 = val11.Find("DoorMesh/Cube"); InteractTrigger val12 = ((obj10 != null) ? ((Component)obj10).GetComponent<InteractTrigger>() : null); if ((Object)(object)val12 != (Object)null) { val12.hoverTip = val12.hoverTip.Replace("[ LMB ]", "[LMB]"); } Plugin.Logger.LogDebug((object)"Experimentation - Fixed old back entrance"); } GameObject obj11 = GameObject.Find("/Environment/Map/Cube (1)"); Renderer val13 = ((obj11 != null) ? obj11.GetComponent<Renderer>() : null); if ((Object)(object)val13 != (Object)null) { val13.enabled = false; Plugin.Logger.LogDebug((object)"Experimentation - Hide untextured geometry"); } GameObject val14 = GameObject.Find("/Environment/Map/ModelsIntroScene/Cube.007/Buttresses.001"); if ((Object)(object)val14 != (Object)null) { val14.AddComponent<MeshCollider>(); Plugin.Logger.LogDebug((object)"Experimentation - Fix buttress collision"); } list.AddRange(new <>z__ReadOnlyArray<string>(new string[38] { "BendingPipe", "Bolt", "CatwalkChunk", "CatwalkChunk.004", "CatwalkChunk.005", "CatwalkRailPost", "CatwalkStairTile", "ChainlinkFenceBend", "ChainlinkFenceCut", "CordConnector", "Cube.001", "Cube.004", "Cube.006", "Girder1", "GridPlate", "LadderFrame", "LongCord1", "LongCord2", "LongCord3", "LongCord4", "MeterBoxDevice", "MiscShelf1", "MiscShelf2", "NurbsPath", "Pipework2", "PlayerScaleCube.001", "PlayerScaleRef", "PlayerScaleRef.001", "RaisedCementPlatform", "Scaffolding", "SiloTall", "SpawnRoom", "StandardDoorSize", "StandardDoorSize.001", "StandardDoorSize.002", "TelephonePoleCordsC", "TrainCarRailLowDetail", "ValveWithHandle.001" })); break; } case "Level2Assurance": Plugin.Logger.LogDebug((object)"Detected landing on Assurance"); list.AddRange(new <>z__ReadOnlyArray<string>(new string[6] { "ChainlinkFenceCut", "NurbsPath", "Pipework2", "PlayerScaleCube.001", "PlayerScaleRef", "PlayerScaleRef.001" })); break; case "Level3Vow": Plugin.Logger.LogDebug((object)"Detected landing on Vow"); break; case "Level4March": { Plugin.Logger.LogDebug((object)"Detected landing on March"); GameObject obj2 = GameObject.Find("/Environment/Map/Trees"); Transform val3 = ((obj2 != null) ? obj2.transform : null); if (!((Object)(object)val3 != (Object)null)) { break; } MeshFilter? obj3 = ((IEnumerable<MeshFilter>)((Component)val3).GetComponentsInChildren<MeshFilter>()).FirstOrDefault((Func<MeshFilter, bool>)delegate(MeshFilter meshFilter) { if (((Object)meshFilter).name == "WychElmA_LOD1") { Mesh sharedMesh = meshFilter.sharedMesh; if (((sharedMesh != null) ? ((Object)sharedMesh).name : null) == "WychElmTreeALOD1") { return (Object)(object)((Component)meshFilter).GetComponent<Renderer>() != (Object)null; } } return false; }); GameObject val4 = ((obj3 != null) ? ((Component)obj3).gameObject : null); foreach (Transform item in val3) { Transform val5 = item; if (!((Object)val5).name.StartsWith("WychElmA")) { continue; } Transform obj4 = val5.Find("WychElmA_LOD1"); Renderer val6 = ((obj4 != null) ? ((Component)obj4).GetComponent<Renderer>() : null); if ((Object)(object)val6 != (Object)null) { val6.enabled = true; Plugin.Logger.LogDebug((object)("March - Enable LOD \"" + ((Object)val6).name + "\" for \"" + ((Object)val5).name + "\"")); } else { if (!((Object)(object)val4 != (Object)null)) { continue; } LODGroup component = ((Component)val5).GetComponent<LODGroup>(); if (!((Object)(object)component == (Object)null)) { LOD[] lODs = component.GetLODs(); if (lODs.Length >= 2 && (lODs[1].renderers == null || lODs[1].renderers.Length == 0 || !((Object)(object)lODs[1].renderers[0] != (Object)null))) { lODs[1].renderers = (Renderer[])(object)new Renderer[1] { Object.Instantiate<GameObject>(val4, val5).GetComponent<Renderer>() }; component.SetLODs(lODs); Plugin.Logger.LogDebug((object)("March - Add LOD1 \"" + ((Object)lODs[1].renderers[0]).name + "\" to \"" + ((Object)val5).name + "\"")); } } } } break; } case "Level5Rend": { Plugin.Logger.LogDebug((object)"Detected landing on Rend"); GameObject val17 = GameObject.Find("/Environment/Map/CementFacility1/Cube.002"); if ((Object)(object)val17 != (Object)null) { GameObject val18 = new GameObject("Cube.002 (2)"); val18.transform.SetParent(val17.transform.parent); val18.transform.SetLocalPositionAndRotation(new Vector3(-24.297f, val17.transform.localPosition.y, 19.699f), val17.transform.localRotation); val18.transform.localScale = new Vector3(val17.transform.localScale.x, 0.655802f, val17.transform.localScale.z); val18.layer = val17.layer; val18.AddComponent<MeshFilter>().sharedMesh = val17.GetComponent<MeshCollider>().sharedMesh; Renderer component2 = val17.GetComponent<Renderer>(); ((Renderer)val18.AddComponent<MeshRenderer>()).sharedMaterial = component2.sharedMaterial; component2.enabled = false; Plugin.Logger.LogDebug((object)"Rend - Adjust fire exit visuals"); } if ((Object)(object)val != (Object)null) { val.localPosition = new Vector3(63.55667f, -18.09991f, -139.49373f); Plugin.Logger.LogDebug((object)"Rend - Fixed factory ambience"); } break; } case "Level6Dine": { Plugin.Logger.LogDebug((object)"Detected landing on Dine"); GameObject obj13 = GameObject.Find("/Environment/Map/KillTrigger (4)"); Transform val19 = ((obj13 != null) ? obj13.transform : null); if ((Object)(object)val19 != (Object)null) { val19.localPosition = new Vector3(148.11f, val19.localPosition.y, 83.61f); val19.localScale = new Vector3(35.3778f, val19.localScale.y, val19.localScale.z); Plugin.Logger.LogDebug((object)"Dine - Fixed death pit"); } break; } case "Level7Offense": Plugin.Logger.LogDebug((object)"Detected landing on Offense"); if ((Object)(object)val != (Object)null) { val.localPosition = new Vector3(27.601871f, 24.056633f, -67.70342f); Plugin.Logger.LogDebug((object)"Offense - Fixed factory ambience"); } list.AddRange(new <>z__ReadOnlyArray<string>(new string[11] { "ChainlinkFenceCut", "CreeperVine", "MiscShelf1", "NurbsPath", "Pipework2", "PlayerScaleCube.001", "PlayerScaleRef", "PlayerScaleRef.001", "LargePipeCorner (1)", "LargePipeCorner (2)", "Girder1 (4)" })); break; case "Level8Titan": Plugin.Logger.LogDebug((object)"Detected landing on Titan"); if ((Object)(object)val != (Object)null) { val.localPosition = new Vector3(-36.07f, 55.12f, 26.15f); Plugin.Logger.LogDebug((object)"Titan - Fixed factory ambience"); } break; case "Level9Artifice": { Plugin.Logger.LogDebug((object)"Detected landing on Artifice"); GameObject val15 = GameObject.Find("/Environment/Map/WarehouseV1 (2)/CircularRoofBeam"); if ((Object)(object)val15 != (Object)null) { val15.SetActive(false); Plugin.Logger.LogDebug((object)"Artifice - Hide out-of-bounds objects"); } GameObject obj12 = GameObject.Find("/Environment/FireExit/FireExitDoorContainer/FireExitDoor"); Transform val16 = ((obj12 != null) ? obj12.transform : null); if ((Object)(object)val16 != (Object)null) { val16.localPosition = new Vector3(12.356f, val16.localPosition.y, -13.3f); Plugin.Logger.LogDebug((object)"Artifice - Adjust fire exit position"); } break; } case "Level10Adamance": { Plugin.Logger.LogDebug((object)"Detected landing on Adamance"); if ((Object)(object)val != (Object)null) { val.localPosition = new Vector3(-108.44491f, -3.2953954f, 8.043371f); Plugin.Logger.LogDebug((object)"Adamance - Fixed factory ambience"); } GameObject val7 = GameObject.Find("/Environment/Props/QuicksandSign"); if ((Object)(object)val7 != (Object)null) { BoxCollider obj5 = val7.AddComponent<BoxCollider>(); obj5.center = new Vector3(-0.0035005957f, -0.012053336f, 2.0186164f); obj5.size = new Vector3(1.5744015f, 0.14966871f, 4.2035575f); Plugin.Logger.LogDebug((object)"Adamance - Fix sign collision"); } break; } case "Level11Embrion": Plugin.Logger.LogDebug((object)"Detected landing on Embrion"); if ((Object)(object)val != (Object)null) { val.localPosition = new Vector3(202.6046f, 14.0158f, 3.280455f); Plugin.Logger.LogDebug((object)"Embrion - Fixed factory ambience"); } break; case "CompanyBuilding": Plugin.Logger.LogDebug((object)"Detected landing on Gordion"); if ((Object)(object)val2 != (Object)null) { val2.SetActive(false); Plugin.Logger.LogDebug((object)"Gordion - Disabled \"Main entrance\" scan node"); } break; default: Plugin.Logger.LogInfo((object)"Landed on unknown moon"); break; } if (list.Count > 0) { GameObject obj14 = GameObject.Find("Environment/Map/ModelsIntroScene"); Transform val20 = ((obj14 != null) ? obj14.transform : null); foreach (Transform item2 in val20) { Transform val21 = item2; if (list.Remove(((Object)val21).name)) { ((Component)val21).gameObject.SetActive(false); } } Plugin.Logger.LogDebug((object)"Hide out-of-bounds objects (Experimentation and leftovers)"); if (list.Count > 0) { int num = 0; foreach (string item3 in list) { Transform val22 = val20.Find(item3); if ((Object)(object)val22 != (Object)null) { ((Component)val22).gameObject.SetActive(!((Component)val22).gameObject.activeSelf); num++; } } if (list.Count != num) { Plugin.Logger.LogWarning((object)$"Failed to hide {list.Count} objects:"); foreach (string item4 in list) { Plugin.Logger.LogWarning((object)("- \"" + item4 + "\"")); } } } } if (!Compatibility.INSTALLED_GENERAL_IMPROVEMENTS) { ScanNodeProperties? obj15 = ((IEnumerable<ScanNodeProperties>)Object.FindObjectsByType<ScanNodeProperties>((FindObjectsSortMode)0)).FirstOrDefault((Func<ScanNodeProperties, bool>)((ScanNodeProperties scanNodeProperties) => scanNodeProperties.headerText == "Ship")); GlobalReferences.shipNode = ((obj15 != null) ? ((Component)obj15).transform : null); if ((Object)(object)GlobalReferences.shipNode != (Object)null) { GlobalReferences.shipNodeOffset = GlobalReferences.shipNode.position - GlobalReferences.shipDefaultPos; } } if ((Object)(object)StartOfRound.Instance != (Object)null) { StartOfRound.Instance.mapScreen.checkedForContourMap = false; } } } public static class ScrapTracker { private static List<GrabbableObject> allTrackedItems = new List<GrabbableObject>(); internal static int TotalValue { get; private set; } internal static void Reset() { allTrackedItems.Clear(); TotalValue = 0; } internal static void Track(GrabbableObject grabbableObject, bool addValue = true) { if ((Object)(object)grabbableObject == (Object)null || (Object)(object)((NetworkBehaviour)grabbableObject).NetworkObject == (Object)null || !((NetworkBehaviour)grabbableObject).NetworkObject.IsSpawned || !grabbableObject.itemProperties.isScrap || grabbableObject.deactivated || grabbableObject.scrapPersistedThroughRounds || grabbableObject is RagdollGrabbableObject) { return; } GiftBoxItem val = (GiftBoxItem)(object)((grabbableObject is GiftBoxItem) ? grabbableObject : null); if (val != null && ((NetworkBehaviour)val).IsServer) { Plugin.Logger.LogDebug((object)("Scrap tracker: Can't track \"" + ((Object)grabbableObject).name + "\" with Track()")); } else if (!allTrackedItems.Contains(grabbableObject)) { allTrackedItems.Add(grabbableObject); if (addValue) { TotalValue += grabbableObject.scrapValue; } Plugin.Logger.LogDebug((object)$"Scrap tracker: Tracking \"{((Object)grabbableObject).name}\" worth ${grabbableObject.scrapValue}"); } } internal static void Untrack(GrabbableObject grabbableObject) { if ((Object)(object)grabbableObject != (Object)null) { allTrackedItems.Remove(grabbableObject); } } internal static void CountButlers() { ButlerEnemyAI[] array = Object.FindObjectsByType<ButlerEnemyAI>((FindObjectsSortMode)0); foreach (ButlerEnemyAI val in array) { if (!((EnemyAI)val).isEnemyDead) { GameObject knifePrefab = val.knifePrefab; KnifeItem val2 = ((knifePrefab != null) ? knifePrefab.GetComponent<KnifeItem>() : null); if ((Object)(object)val2 != (Object)null) { TotalValue += ((GrabbableObject)val2).scrapValue; Plugin.Logger.LogDebug((object)$"Did not kill Butler (${((GrabbableObject)val2).scrapValue})"); } } } } internal static void TrackGiftBoxOnServer(GiftBoxItem giftBoxItem) { if (!allTrackedItems.Contains((GrabbableObject)(object)giftBoxItem)) { allTrackedItems.Add((GrabbableObject)(object)giftBoxItem); TotalValue = Mathf.Max(TotalValue + ((GrabbableObject)giftBoxItem).scrapValue, TotalValue + giftBoxItem.objectInPresentValue); } } public static void TrackGiftBoxOnClient(GiftBoxItem giftBoxItem, GrabbableObject objectInPresent) { if (!allTrackedItems.Contains((GrabbableObject)(object)giftBoxItem)) { allTrackedItems.Add((GrabbableObject)(object)giftBoxItem); if (((GrabbableObject)giftBoxItem).scrapValue > 0) { TotalValue += ((GrabbableObject)giftBoxItem).scrapValue; } } if (((GrabbableObject)giftBoxItem).isInShipRoom) { RoundManager.Instance.scrapCollectedInLevel = Mathf.Max(RoundManager.Instance.scrapCollectedInLevel - ((GrabbableObject)giftBoxItem).scrapValue, 0); } if ((Object)(object)objectInPresent != (Object)null) { if (!allTrackedItems.Contains(objectInPresent)) { allTrackedItems.Add(objectInPresent); } if (((GrabbableObject)giftBoxItem).isInShipRoom || objectInPresent.isInShipRoom || (Object)(object)((Component)objectInPresent).transform.parent == (Object)(object)StartOfRound.Instance.elevatorTransform) { RoundManager.Instance.CollectNewScrapForThisRound(objectInPresent); } } if (!((NetworkBehaviour)giftBoxItem).IsServer) { TotalValue = Mathf.Max(TotalValue - Mathf.Max(((GrabbableObject)giftBoxItem).scrapValue, 0) + (((Object)(object)objectInPresent != (Object)null) ? objectInPresent.scrapValue : 0), TotalValue); } } } internal static class ScriptableObjectOverrides { internal static void OverrideEnemyTypes() { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair<string, EnemyType> allEnemies in GlobalReferences.allEnemiesList) { switch (allEnemies.Key) { case "RadMech": { ScanNodeProperties componentInChildren2 = allEnemies.Value.nestSpawnPrefab.GetComponentInChildren<ScanNodeProperties>(); if ((Object)(object)componentInChildren2 != (Object)null) { componentInChildren2.requiresLineOfSight = false; ((Component)componentInChildren2).transform.localPosition = new Vector3(0f, ((Component)componentInChildren2).transform.localPosition.y, 0f); Plugin.Logger.LogDebug((object)(allEnemies.Value.enemyName + ": Scan on both sides")); } break; } case "Blob": if (!Compatibility.INSTALLED_EVERYTHING_CAN_DIE) { allEnemies.Value.canDie = false; Plugin.Logger.LogDebug((object)(allEnemies.Value.enemyName + ": Don't \"die\" when crushed by spike trap")); } break; case "ForestGiant": { ScanNodeProperties componentInChildren = allEnemies.Value.enemyPrefab.GetComponentInChildren<ScanNodeProperties>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.headerText = "Forest Keeper"; Plugin.Logger.LogDebug((object)(allEnemies.Value.enemyName + ": Rename scan node")); } break; } case "ClaySurgeon": { Renderer[] componentsInChildren = allEnemies.Value.enemyPrefab.GetComponentsInChildren<Renderer>(); foreach (Renderer val in componentsInChildren) { if (((Component)val).gameObject.layer == 19) { val.shadowCastingMode = (ShadowCastingMode)0; } } break; } case "CaveDweller": ((GrabbableObject)allEnemies.Value.enemyPrefab.GetComponent<CaveDwellerPhysicsProp>()).itemProperties.isConductiveMetal = false; Plugin.Logger.LogDebug((object)("Conductive: " + allEnemies.Value.enemyName + " (False)")); break; case "SandWorm": allEnemies.Value.canBeDestroyed = false; Plugin.Logger.LogDebug((object)(allEnemies.Value.enemyName + ": Don't get eaten by other worms")); break; } allEnemies.Value.numberSpawned = 0; allEnemies.Value.hasSpawnedAtLeastOne = false; } } internal static void OverrideSelectableLevels() { SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { if (((Object)val).name == "OffenseLevel" && (Object)(object)val.videoReel != (Object)null && ((Object)val.videoReel).name == "MapView220Ass") { val.videoReel = null; Plugin.Logger.LogDebug((object)"Offense: Video reel"); } } } internal static void OverrideItems() { Dictionary<string, bool> dictionary = new Dictionary<string, bool> { { "DustPan", true }, { "FancyCup", !Compatibility.INSTALLED_UPTURNED_VARIETY }, { "LockPicker", true }, { "Shotgun", true }, { "SprayPaint", true } }; Dictionary<string, bool> dictionary2 = new Dictionary<string, bool> { { "Airhorn", false }, { "CashRegister", false }, { "ChemicalJug", true }, { "ClownHorn", false }, { "ComedyMask", false }, { "RubberDuck", false }, { "TragedyMask", false } }; Dictionary<string, bool> dictionary3 = new Dictionary<string, bool> { { "BabyKiwiEgg", false }, { "PillBottle", true }, { "SprayPaint", true }, { "WeedKillerBottle", true } }; foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { if ((Object)(object)items == (Object)null) { Plugin.Logger.LogWarning((object)"Encountered a missing item in StartOfRound.allItemsList; this is probably an issue with another mod"); continue; } GameObject spawnPrefab = items.spawnPrefab; ScanNodeProperties val = ((spawnPrefab != null) ? spawnPrefab.GetComponentInChildren<ScanNodeProperties>() : null); switch (((Object)items).name) { case "BabyKiwiEgg": ((GrabbableObject)items.spawnPrefab.GetComponent<KiwiBabyItem>()).isInFactory = false; Plugin.Logger.LogDebug((object)"Factory: Egg"); break; case "CashRegister": if (Configuration.adjustCooldowns.Value) { ((GrabbableObject)items.spawnPrefab.GetComponent<NoisemakerProp>()).useCooldown = 2.35f; Plugin.Logger.LogDebug((object)"Cooldown: Cash register"); } break; case "ClownHorn": if (Configuration.adjustCooldowns.Value) { ((GrabbableObject)items.spawnPrefab.GetComponent<NoisemakerProp>()).useCooldown = 0.35f; Plugin.Logger.LogDebug((object)"Cooldown: Clown horn"); } break; case "FancyCup": if (Configuration.theGoldenGoblet.Value) { if ((Object)(object)val != (Object)null) { val.headerText = val.headerText.Replace("Golden cup", "Golden goblet"); Plugin.Logger.LogDebug((object)"Scan node: Golden cup"); } items.itemName = items.itemName.Replace("Golden cup", "Golden goblet"); Plugin.Logger.LogDebug((object)"Name: Golden cup"); } break; case "FancyLamp": items.verticalOffset = 0f; break; case "ProFlashlight": case "Flashlight": { FlashlightItem component2 = items.spawnPrefab.GetComponent<FlashlightItem>(); Material[] sharedMaterials = ((Renderer)component2.flashlightMesh).sharedMaterials; sharedMaterials[1] = component2.bulbDark; ((Renderer)component2.flashlightMesh).sharedMaterials = sharedMaterials; Plugin.Logger.LogDebug((object)("Bulb off: " + items.itemName)); break; } case "Hairdryer": if (Configuration.adjustCooldowns.Value) { ((GrabbableObject)items.spawnPrefab.GetComponent<NoisemakerProp>()).useCooldown = 1.35f; Plugin.Logger.LogDebug((object)"Cooldown: Hairdryer"); } break; case "Knife": { KnifeItem component3 = items.spawnPrefab.GetComponent<KnifeItem>(); if ((Object)(object)val != (Object)null) { val.scrapValue = ((GrabbableObject)component3).scrapValue; val.subText = $"Value: ${val.scrapValue}"; Plugin.Logger.LogDebug((object)"Scan node: Kitchen knife"); } break; } case "RedLocustHive": ((GrabbableObject)items.spawnPrefab.GetComponent<PhysicsProp>()).isInFactory = false; Plugin.Logger.LogDebug((object)"Factory: Hive"); break; case "SeveredHeart": { LoopShapeKey[] componentsInChildren = items.spawnPrefab.GetComponentsInChildren<LoopShapeKey>(); if (componentsInChildren == null || componentsInChildren.Length == 0) { break; } LoopShapeKey[] array = componentsInChildren; foreach (LoopShapeKey val2 in array) { if ((Object)(object)((Component)val2).GetComponent<HeartHack>() == (Object)null) { ((Component)val2).gameObject.AddComponent<HeartHack>().loopShapeKey = val2; } } Plugin.Logger.LogDebug((object)"Animation: Heart"); break; } case "SeveredThigh": { LODGroup component = items.spawnPrefab.GetComponent<LODGroup>(); LOD[] lODs = component.GetLODs(); lODs[0].screenRelativeTransitionHeight = 0.15f; component.SetLODs(lODs); Plugin.Logger.LogDebug((object)"LoDs: Knee"); break; } case "SeveredTongue": items.syncDiscardFunction = true; Plugin.Logger.LogDebug((object)"Sync: Tongue"); break; } if ((Object)(object)items.spawnPrefab != (Object)null) { bool flag = false; Renderer[] componentsInChildren2 = items.spawnPrefab.GetComponentsInChildren<Renderer>(); foreach (Renderer val3 in componentsInChildren2) { if (val3.enabled && ((Component)val3).gameObject.layer == 13) { val3.enabled = false; flag = true; } } if (flag) { Plugin.Logger.LogDebug((object)("Invisible trigger: " + items.itemName)); } if ((Object)(object)items.spawnPrefab.GetComponent<Rigidbody>() != (Object)null && (Object)(object)val != (Object)null && (Object)(object)((Component)val).GetComponent<Rigidbody>() == (Object)null) { ((Component)val).gameObject.AddComponent<Rigidbody>().isKinematic = true; Plugin.Logger.LogDebug((object)("Scan node rigidbody: " + items.itemName)); } } if (dictionary3.ContainsKey(((Object)items).name)) { items.canBeInspected = dictionary3[((Object)items).name]; Plugin.Logger.LogDebug((object)$"Inspectable: {items.itemName} ({items.canBeInspected})"); } if (items.canBeInspected) { if (items.toolTips == null) { Plugin.Logger.LogWarning((object)("Item \"" + ((Object)items).name + "\" is missing toolTips")); } else if (items.toolTips.Length < 3) { bool flag2 = false; string[] toolTips = items.toolTips; for (int i = 0; i < toolTips.Length; i++) { if (toolTips[i].StartsWith("Inspect")) { flag2 = true; break; } } if (!flag2) { items.toolTips = CollectionExtensions.AddToArray<string>(items.toolTips, "Inspect: [Z]"); Plugin.Logger.LogDebug((object)("Inspect tooltip: " + items.itemName)); } } } if (dictionary.ContainsKey(((Object)items).name)) { items.isConductiveMetal = dictionary[((Object)items).name] && Configuration.makeConductive.Value; Plugin.Logger.LogDebug((object)$"Conductive: {items.itemName} ({items.isConductiveMetal})"); } if (dictionary2.ContainsKey(((Object)items).name) && !Compatibility.INSTALLED_GENERAL_IMPROVEMENTS) { items.canBeGrabbedBeforeGameStart = dictionary2[((Object)items).name]; Plugin.Logger.LogDebug((object)$"Hold before ship has landed: {items.itemName} ({items.canBeGrabbedBeforeGameStart})"); } } } internal static void OverrideUnlockables() { foreach (UnlockableItem unlockable in StartOfRound.Instance.unlockablesList.unlockables) { switch (unlockable.unlockableName) { case "JackOLantern": if (Configuration.adjustCooldowns.Value) { unlockable.prefabObject.GetComponentInChildren<InteractTrigger>().cooldownTime = 0.45f; Plugin.Logger.LogDebug((object)"Cooldown: Jack o' Lantern"); } break; case "Plushie pajama man": if (Configuration.adjustCooldowns.Value) { unlockable.prefabObject.GetComponentInChildren<InteractTrigger>().cooldownTime = 0.2f; Plugin.Logger.LogDebug((object)"Cooldown: Plushie pajama man"); } break; case "Inverse Teleporter": if (!Compatibility.INSTALLED_GENERAL_IMPROVEMENTS) { InteractTrigger buttonTrigger = unlockable.prefabObject.GetComponentInChildren<ShipTeleporter>().buttonTrigger; buttonTrigger.hoverTip = buttonTrigger.hoverTip.Replace("Beam up", "Beam out"); Plugin.Logger.LogDebug((object)"Text: Inverse teleporter"); } break; case "Microwave": { Transform obj = unlockable.prefabObject.transform.Find("MicrowaveBody"); ((Component)obj).gameObject.layer = 8; Plugin.Logger.LogDebug((object)"Collision: Microwave"); InteractTrigger component = ((Component)obj.Find("MicrowaveDoor/DoorButtonClose")).GetComponent<InteractTrigger>(); component.hoverTip = component.hoverTip.Replace("Store item", "Use microwave"); Plugin.Logger.LogDebug((object)"Text: Microwave"); break; } case "Fridge": { Transform[] componentsInChildren = unlockable.prefabObject.GetComponentsInChildren<Transform>(); foreach (Transform val in componentsInChildren) { if (((Object)val).name == "FridgeBody" || ((Component)val).gameObject.layer == 6) { ((Component)val).gameObject.layer = 8; } else if ((Object)(object)((Component)val).GetComponent<PlaceableObjectsSurface>() != (Object)null) { ((Component)val).GetComponent<Collider>().isTrigger = false; } } Plugin.Logger.LogDebug((object)"Collision: Fridge"); break; } } } } } internal static class TileOverrides { internal static void OverrideTiles(IndoorMapType[] indoorMapTypes) { //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) foreach (GameObject allTile in GetAllTiles(indoorMapTypes)) { switch (((Object)allTile).name) { case "DoubleDoorRoom": case "MediumRoomHallway1B": { Transform val3 = allTile.transform.Find("AnomalySpawns"); if ((Object)(object)val3 != (Object)null) { ((Component)val3).gameObject.SetActive(false); Plugin.Logger.LogDebug((object)(((Object)allTile).name + ": Removed obsolete triggers (fix spray paint)")); } break; } case "4x4BigStairTile": { RandomScrapSpawn[] componentsInChildren = allTile.GetComponentsInChildren<RandomScrapSpawn>(); foreach (RandomScrapSpawn val8 in componentsInChildren) { if (((Object)val8).name.StartsWith("SmallItemsSpawn")) { ((Component)val8).gameObject.SetActive(false); Plugin.Logger.LogDebug((object)(((Object)allTile).name + ": Fix scrap stacking")); } } break; } case "KitchenTile": { Transform val4 = allTile.transform.Find("TablesMisc"); if ((Object)(object)val4 != (Object)null) { Transform obj = val4.Find("ArrangementA/coffeeTable"); BoxCollider val5 = ((obj != null) ? ((Component)obj).GetComponent<BoxCollider>() : null); Transform obj2 = val4.Find("ArrangementB/coffeeTable (1)"); BoxCollider val6 = ((obj2 != null) ? ((Component)obj2).GetComponent<BoxCollider>() : null); if ((Object)(object)val5 != (Object)null && (Object)(object)val6 != (Object)null) { val5.center = val6.center; val5.size = val6.size; Plugin.Logger.LogDebug((object)(((Object)allTile).name + ": Adjusted collider on prop \"" + ((Object)val5).name + "\"")); } } break; } case "GreenhouseTile": { string[] array = new string[4] { "Colliders/Cube (4)", "Colliders/Cube (6)", "Colliders/Cube (7)", "Colliders/Cube (5)" }; foreach (string text in array) { Transform obj3 = allTile.transform.Find(text); GameObject val7 = ((obj3 != null) ? ((Component)obj3).gameObject : null); if ((Object)(object)val7 != (Object)null) { val7.SetActive(false); Plugin.Logger.LogDebug((object)(((Object)allTile).name + ": Removed unused collider \"" + ((Object)val7).name + "\"")); } } break; } case "GarageTile": { if (Chainloader.PluginInfos.ContainsKey("watergun.v72lightfix")) { Plugin.Logger.LogInfo((object)"CROSS-COMPATIBILITY - V70PoweredLights Fix detected"); break; } Transform val = allTile.transform.Find("HangingLEDBarLight (4)"); Transform val2 = ((val != null) ? val.Find("IndirectLight (1)") : null); if ((Object)(object)val2 != (Object)null && (Object)(object)val.Find("IndirectLight") == (Object)null) { ((Object)val2).name = "IndirectLight"; Plugin.Logger.LogDebug((object)(((Object)allTile).name + ": Corrected child reference for \"" + ((Object)val).name + "\"")); } break; } } if (((Object)allTile).name.StartsWith("Cave") || ((Object)allTile).name.Contains("Tunnel")) { ParticleSystemRenderer[] componentsInChildren2 = allTile.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val9 in componentsInChildren2) { if ((Object)(object)((Renderer)val9).sharedMaterial != (Object)null && ((Object)((Renderer)val9).sharedMaterial).name.StartsWith("RainParticle") && !((Object)val9).name.StartsWith("RainHit")) { val9.renderMode = (ParticleSystemRenderMode)3; Plugin.Logger.LogDebug((object)(((Object)allTile).name + ": Fix drip billboarding")); } } } Animator[] componentsInChildren3 = allTile.GetComponentsInChildren<Animator>(); if (componentsInChildren3 == null || componentsInChildren3.Length == 0) { continue; } Animator[] array2 = componentsInChildren3; foreach (Animator val10 in array2) { if (!((Component)val10).CompareTag("PoweredLight") && (Object)(object)val10.runtimeAnimatorController != (Object)null && (((Object)val10.runtimeAnimatorController).name.StartsWith("MineshaftSpotlight") || ((Object)val10.runtimeAnimatorController).name.StartsWith("LEDHangingLight"))) { ((Component)val10).tag = "PoweredLight"; Plugin.Logger.LogDebug((object)(((Object)allTile).name + ": Fix power state for \"" + ((Object)val10).name + "\"")); } } } } private static List<GameObject> GetAllTiles(IndoorMapType[] indoorMapTypes) { List<TileSet> list = new List<TileSet>(); HashSet<GameObject> hashSet = new HashSet<GameObject>(); foreach (IndoorMapType val in indoorMapTypes) { if (Array.IndexOf(GlobalReferences.INTERIOR_WHITELIST, ((Object)val.dungeonFlow).name) < 0) { continue; } foreach (GraphNode node in val.dungeonFlow.Nodes) { list.AddRange(node.TileSets); } foreach (GraphLine line in val.dungeonFlow.Lines) { foreach (DungeonArchetype dungeonArchetype in line.DungeonArchetypes) { list.AddRange(dungeonArchetype.TileSets); } } foreach (TileSet item in list) { foreach (GameObjectChance weight in item.TileWeights.Weights) { if (hashSet.Add(weight.Value)) { Plugin.Logger.LogDebug((object)("Cached reference to tile \"" + ((Object)weight.Value).name + "\"")); } } } } return hashSet.ToList(); } } } namespace ButteryFixes.Patches.Player { [HarmonyPatch(typeof(DeadBodyInfo))] internal static class BodyPatches { private static bool dontCheckRenderers; [HarmonyPatch("Start")] [HarmonyPostfix] private static void DeadBodyInfo_Post_Start(DeadBodyInfo __instance) { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Invalid comparison between Unknown and I4 //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Invalid comparison between Unknown and I4 //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Invalid comparison between Unknown and I4 //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Invalid comparison between Unknown and I4 //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Invalid comparison between Unknown and I4 //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) if (Configuration.bodiesCollectSelf.Value) { if (!__instance.playerScript.isInHangarShipRoom) { Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; if (!((Bounds)(ref bounds)).Contains(__instance.playerScript.positionOfDeath)) { goto IL_00a5; } } Plugin.Logger.LogDebug((object)("Player \"" + __instance.playerScript?.playerUsername + "\" died inside the ship")); if (!((Object)__instance).name.Contains("Mask Variant") || ((Object)StartOfRound.Instance.currentLevel).name == "CompanyBuildingLevel") { ((MonoBehaviour)__instance).StartCoroutine(NonPatchFunctions.TryAutoCollectBody(__instance)); } } goto IL_00a5; IL_00a5: if (!Configuration.playermodelPatches.Value) { return; } if ((int)__instance.causeOfDeath == 14) { __instance.MakeCorpseBloody(); } if ((int)__instance.causeOfDeath == 3 && (int)StartOfRound.Instance.currentLevel.currentWeather == 2 && (Object)(object)__instance.playerScript != (Object)null && __instance.playerScript.positionOfDeath.y >= -100f) { Plugin.Logger.LogDebug((object)("Player \"" + __instance.playerScript?.playerUsername + "\" died to \"Blast\" outside during stormy weather")); ((MonoBehaviour)__instance).StartCoroutine(NonPatchFunctions.LightningShakesBody(__instance)); } SkinnedMeshRenderer componentInChildren = ((Component)__instance).GetComponentInChildren<SkinnedMeshRenderer>(); if (!((Object)(object)componentInChildren != (Object)null) || !((Object)(object)StartOfRound.Instance != (Object)null)) { return; } UnlockableItem val = StartOfRound.Instance.unlockablesList.unlockables[__instance.playerScript.c