using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using Dawn; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UsualScrap.Behaviors; using UsualScrap.Behaviors.Effects; using UsualScrap.NetcodePatcher; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("UsualScrap")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Adds many new unique items that expand on the available scrap items and interactions!")] [assembly: AssemblyFileVersion("2.0.2.0")] [assembly: AssemblyInformationalVersion("2.0.2")] [assembly: AssemblyProduct("UsualScrap")] [assembly: AssemblyTitle("UsualScrap")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace UsualScrap { [BepInPlugin("Emil.UsualScrap", "UsualScrap", "2.0.2")] public class Plugin : BaseUnityPlugin { public static class ScrapPackKeys { public static NamespacedKey US_PocketWatch = NamespacedKey.From("Usual_Scrap", "US_Pocket_Watch"); public static NamespacedKey US_ServantBell = NamespacedKey.From("Usual_Scrap", "US_Servant_Bell"); public static NamespacedKey US_ChessPieces = NamespacedKey.From("Usual_Scrap", "US_Chess_Pieces"); public static NamespacedKey US_GoldenChessPieces = NamespacedKey.From("Usual_Scrap", "US_Golden_Chess_Pieces"); public static NamespacedKey US_TrafficCone = NamespacedKey.From("Usual_Scrap", "US_Traffic_Cone"); public static NamespacedKey US_MereGear = NamespacedKey.From("Usual_Scrap", "US_Mere_Gear"); } public static class ScrapItemKeys { public static NamespacedKey US_Ticket = NamespacedKey.From("Usual_Scrap", "US_Ticket"); public static NamespacedKey US_GoldenTicket = NamespacedKey.From("Usual_Scrap", "US_Golden_Ticket"); public static NamespacedKey US_Rose = NamespacedKey.From("Usual_Scrap", "US_Rose"); public static NamespacedKey US_SizableScissors = NamespacedKey.From("Usual_Scrap", "US_Sizable_Scissors"); public static NamespacedKey US_WalkingCane = NamespacedKey.From("Usual_Scrap", "US_Walking_Cane"); public static NamespacedKey US_CandyDispenser = NamespacedKey.From("Usual_Scrap", "US_Candy_Dispenser"); public static NamespacedKey US_VintageCandy = NamespacedKey.From("Usual_Scrap", "US_Vintage_Candy"); public static NamespacedKey US_FuelCylinder = NamespacedKey.From("Usual_Scrap", "US_Fuel_Cylinder"); public static NamespacedKey US_RadioactiveCell = NamespacedKey.From("Usual_Scrap", "US_Radioactive_Cell"); public static NamespacedKey US_GloomyCapsule = NamespacedKey.From("Usual_Scrap", "US_Gloomy_Capsule"); public static NamespacedKey US_FrigidCapsule = NamespacedKey.From("Usual_Scrap", "US_Frigid_Capsule"); public static NamespacedKey US_BloodyCapsule = NamespacedKey.From("Usual_Scrap", "US_Bloody_Capsule"); public static NamespacedKey US_Padlock = NamespacedKey.From("Usual_Scrap", "US_Padlock"); public static NamespacedKey US_Crowbar = NamespacedKey.From("Usual_Scrap", "US_Crowbar"); } public static class StoreItemKeys { public static NamespacedKey US_HandLamp = NamespacedKey.From("Usual_Scrap", "US_Hand_Lamp"); public static NamespacedKey US_Bandages = NamespacedKey.From("Usual_Scrap", "US_Bandages"); public static NamespacedKey US_MedicalKit = NamespacedKey.From("Usual_Scrap", "US_Medical_Kit"); public static NamespacedKey US_Defibrillator = NamespacedKey.From("Usual_Scrap", "US_Defibrillator"); public static NamespacedKey US_ProductivityAutoinjector = NamespacedKey.From("Usual_Scrap", "US_Productivity_Autoinjector"); public static NamespacedKey US_ShiftController = NamespacedKey.From("Usual_Scrap", "US_Shift_Controller"); public static NamespacedKey US_Toolkit = NamespacedKey.From("Usual_Scrap", "US_Toolkit"); } public const string PLUGIN_GUID = "Emil.UsualScrap"; public const string PLUGIN_NAME = "UsualScrap"; public const string PLUGIN_VERSION = "2.0.2"; public static Plugin instance; private List, DawnMoonInfo>> FinalMoons = new List, DawnMoonInfo>>(); private List FinalMoonNames = new List(); internal static UsualScrapConfigs BoundConfig { get; private set; } public void InitializeItem(GrabbableObject itemScript, bool grabbable, bool grabbableToEnemies, Item itemProperties) { DawnLib.RegisterNetworkPrefab(itemProperties.spawnPrefab); Utilities.FixMixerGroups(itemProperties.spawnPrefab); itemScript.grabbable = grabbable; itemScript.grabbableToEnemies = grabbableToEnemies; itemScript.itemProperties = itemProperties; } public void Awake() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } List list = new List(); instance = this; BoundConfig = new UsualScrapConfigs(((BaseUnityPlugin)this).Config); new UsualScrapConfigs(((BaseUnityPlugin)this).Config); AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "usualscrapassetbundle")); try { if (BoundConfig.HandlampLoaded.Value) { Item val2 = val.LoadAsset("Assets/UsualScrapContent/Items/HandlampAssets/US_HandlampItem.asset"); list.Add(val2); TerminalNode US_HandlampNode = val.LoadAsset("Assets/Items/HandlampAssets/US_HandlampNode.asset"); HandlampScript itemScript = val2.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript, grabbable: true, grabbableToEnemies: true, val2); if (BoundConfig.HandlampIsStoreItem.Value && BoundConfig.HandlampStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_HandLamp, val2, (Action)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.HandlampStorePrice.Value).OverrideInfoNode(US_HandlampNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Handlamp experienced an error while loading. Skipping..."); } try { if (BoundConfig.BandagesLoaded.Value) { Item val3 = val.LoadAsset("Assets/UsualScrapContent/Items/BandagesAssets/US_BandagesItem.asset"); list.Add(val3); TerminalNode US_BandagesNode = val.LoadAsset("Assets/Items/BandagesAssets/US_BandagesNode.asset"); BandagesScript itemScript2 = val3.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript2, grabbable: true, grabbableToEnemies: true, val3); if (BoundConfig.BandagesIsStoreItem.Value && BoundConfig.BandagesStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_Bandages, val3, (Action)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.BandagesStorePrice.Value).OverrideInfoNode(US_BandagesNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Bandages experienced an error while loading. Skipping..."); } try { if (BoundConfig.MedicalKitLoaded.Value) { Item val4 = val.LoadAsset("Assets/UsualScrapContent/Items/MedicalKitAssets/US_MedicalKitItem.asset"); list.Add(val4); TerminalNode US_MedicalKitNode = val.LoadAsset("Assets/Items/MedicalKitAssets/US_MedicalKitNode.asset"); MedicalKitScript itemScript3 = val4.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript3, grabbable: true, grabbableToEnemies: true, val4); if (BoundConfig.MedicalKitIsStoreItem.Value && BoundConfig.MedicalKitStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_MedicalKit, val4, (Action)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.MedicalKitStorePrice.Value).OverrideInfoNode(US_MedicalKitNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Medical Kit experienced an error while loading. Skipping..."); } try { if (BoundConfig.DefibrillatorLoaded.Value) { Item val5 = val.LoadAsset("Assets/UsualScrapContent/Items/DefibrillatorAssets/US_DefibrillatorItem.asset"); list.Add(val5); TerminalNode US_DefibrillatorNode = val.LoadAsset("Assets/Items/DefibrillatorAssets/US_DefibrillatorNode.asset"); DefibrillatorScript itemScript4 = val5.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript4, grabbable: true, grabbableToEnemies: true, val5); if (BoundConfig.DefibrillatorIsStoreItem.Value && BoundConfig.DefibrillatorStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_Defibrillator, val5, (Action)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.DefibrillatorStorePrice.Value).OverrideInfoNode(US_DefibrillatorNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Defibrillator experienced an error while loading. Skipping..."); } try { if (BoundConfig.ProductivityAutoinjectorLoaded.Value) { Item val6 = val.LoadAsset("Assets/UsualScrapContent/Items/ProductivityAutoinjectorAssets/US_ProductivityAutoinjectorItem.asset"); list.Add(val6); TerminalNode US_ProductivityAutoinjectorNode = val.LoadAsset("Assets/Items/ProductivityAutoinjectorAssets/US_ProductivityAutoinjectorNode.asset"); ProductivityAutoinjectorScript itemScript5 = val6.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript5, grabbable: true, grabbableToEnemies: true, val6); if (BoundConfig.ProductivityAutoinjectorIsStoreItem.Value && BoundConfig.ProductivityAutoinjectorStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_ProductivityAutoinjector, val6, (Action)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.ProductivityAutoinjectorStorePrice.Value).OverrideInfoNode(US_ProductivityAutoinjectorNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Productivity Autoinjector experienced an error while loading. Skipping..."); } try { if (BoundConfig.ToolkitLoaded.Value) { Item val7 = val.LoadAsset("Assets/UsualScrapContent/Items/ToolkitAssets/US_ToolkitItem.asset"); list.Add(val7); TerminalNode US_ToolkitNode = val.LoadAsset("Assets/Items/ToolkitAssets/US_ToolkitNode.asset"); ToolkitScript itemScript6 = val7.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript6, grabbable: true, grabbableToEnemies: true, val7); if (BoundConfig.ToolkitIsStoreItem.Value && BoundConfig.ToolkitStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_Toolkit, val7, (Action)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.ToolkitStorePrice.Value).OverrideInfoNode(US_ToolkitNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Toolkit experienced an error while loading. Skipping..."); } try { if (BoundConfig.ShiftControllerLoaded.Value) { Item val8 = val.LoadAsset("Assets/UsualScrapContent/Items/ShiftControllerAssets/US_ShiftControllerItem.asset"); list.Add(val8); TerminalNode US_ShiftControllerNode = val.LoadAsset("Assets/Items/ShiftControllerAssets/US_ShiftControllerNode.asset"); ShiftControllerScript itemScript7 = val8.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript7, grabbable: true, grabbableToEnemies: true, val8); if (BoundConfig.ShiftControllerIsStoreItem.Value && BoundConfig.ShiftControllerStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_ShiftController, val8, (Action)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.ShiftControllerStorePrice.Value).OverrideInfoNode(US_ShiftControllerNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Shift Controller experienced an error while loading. Skipping..."); } Item US_Ticket = null; Item US_GoldenTicket = null; Item US_Rose = null; Item US_SizableScissors = null; Item US_WalkingCane = null; Item US_CandyDispenser = null; Item US_VintageCandy = null; Item US_FuelCylinder = null; Item US_RadioactiveCell = null; Item US_GloomyCapsule = null; Item US_FrigidCapsule = null; Item US_BloodyCapsule = null; Item US_Padlock = null; Item US_Crowbar = null; Item US_PocketWatch = null; Item US_ServantBell = null; Item US_ChessPieces = null; Item US_GoldenChessPieces = null; Item US_TrafficCone = null; Item US_MereGear = null; ((Registry)(object)LethalContent.Moons).BeforeFreeze += DetectMoons; ((Registry)(object)LethalContent.Moons).BeforeFreeze += SetWeights; try { if (BoundConfig.TicketLoaded.Value) { US_Ticket = val.LoadAsset("Assets/UsualScrapContent/Items/TicketAssets/US_TicketItem.asset"); list.Add(US_Ticket); TicketScript itemScript8 = US_Ticket.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript8, grabbable: true, grabbableToEnemies: true, US_Ticket); } } catch { Debug.LogError((object)"USUAL SCRAP - Ticket experienced an error while loading. Skipping..."); } try { if (BoundConfig.GoldenTicketLoaded.Value) { US_GoldenTicket = val.LoadAsset("Assets/UsualScrapContent/Items/GoldenTicketAssets/US_GoldenTicketItem.asset"); list.Add(US_GoldenTicket); GoldenTicketScript itemScript9 = US_GoldenTicket.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript9, grabbable: true, grabbableToEnemies: true, US_GoldenTicket); } } catch { Debug.LogError((object)"USUAL SCRAP - Golden Ticket experienced an error while loading. Skipping..."); } try { if (BoundConfig.RoseLoaded.Value) { US_Rose = val.LoadAsset("Assets/UsualScrapContent/Items/RoseAssets/US_RoseItem.asset"); list.Add(US_Rose); RoseScript itemScript10 = US_Rose.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript10, grabbable: true, grabbableToEnemies: true, US_Rose); } } catch { Debug.LogError((object)"USUAL SCRAP - Rose experienced an error while loading. Skipping..."); } try { if (BoundConfig.SizableScissorsLoaded.Value) { US_SizableScissors = val.LoadAsset("Assets/UsualScrapContent/Items/SizableScissorsAssets/US_SizableScissorsItem.asset"); list.Add(US_SizableScissors); SizableScissorsScript itemScript11 = US_SizableScissors.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript11, grabbable: true, grabbableToEnemies: true, US_SizableScissors); } } catch { Debug.LogError((object)"USUAL SCRAP - Scissors experienced an error while loading. Skipping..."); } try { if (BoundConfig.WalkingCaneLoaded.Value) { US_WalkingCane = val.LoadAsset("Assets/UsualScrapContent/Items/WalkingCaneAssets/US_WalkingCaneItem.asset"); list.Add(US_WalkingCane); WalkingCaneScript itemScript12 = US_WalkingCane.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript12, grabbable: true, grabbableToEnemies: true, US_WalkingCane); } } catch { Debug.LogError((object)"USUAL SCRAP - Walking Cane experienced an error while loading. Skipping..."); } try { if (BoundConfig.CandyDispenserLoaded.Value) { US_CandyDispenser = val.LoadAsset("Assets/UsualScrapContent/Items/CandyDispenserAssets/US_CandyDispenserItem.asset"); list.Add(US_CandyDispenser); CandyDispenserScript itemScript13 = US_CandyDispenser.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript13, grabbable: true, grabbableToEnemies: true, US_CandyDispenser); US_VintageCandy = val.LoadAsset("Assets/UsualScrapContent/Items/VintageCandyAssets/US_VintageCandyItem.asset"); list.Add(US_VintageCandy); VintageCandyScript itemScript14 = US_VintageCandy.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript14, grabbable: true, grabbableToEnemies: true, US_VintageCandy); } else if (BoundConfig.VintageCandyLoaded.Value) { US_VintageCandy = val.LoadAsset("Assets/UsualScrapContent/Items/VintageCandyAssets/US_VintageCandyItem.asset"); list.Add(US_VintageCandy); VintageCandyScript itemScript15 = US_VintageCandy.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript15, grabbable: true, grabbableToEnemies: true, US_VintageCandy); } } catch { Debug.LogError((object)"USUAL SCRAP - Candy Dispenser experienced an error while loading. Skipping..."); } try { if (BoundConfig.FuelCylinderLoaded.Value) { US_FuelCylinder = val.LoadAsset("Assets/UsualScrapContent/Items/FuelCylinderAssets/US_FuelCylinderItem.asset"); list.Add(US_FuelCylinder); FuelCylinderScript itemScript16 = US_FuelCylinder.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript16, grabbable: true, grabbableToEnemies: true, US_FuelCylinder); } } catch { Debug.LogError((object)"USUAL SCRAP - Fuel Cylinder experienced an error while loading. Skipping..."); } try { if (BoundConfig.RadioactiveCellLoaded.Value) { US_RadioactiveCell = val.LoadAsset("Assets/UsualScrapContent/Items/RadioactiveCellAssets/US_RadioactiveCellItem.asset"); list.Add(US_RadioactiveCell); RadioactiveCellScript itemScript17 = US_RadioactiveCell.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript17, grabbable: true, grabbableToEnemies: true, US_RadioactiveCell); } } catch { Debug.LogError((object)"USUAL SCRAP - Radioactive Cell experienced an error while loading. Skipping..."); } try { if (BoundConfig.GloomyCapsuleLoaded.Value) { US_GloomyCapsule = val.LoadAsset("Assets/UsualScrapContent/Items/GloomyCapsuleAssets/US_GloomyCapsuleItem.asset"); list.Add(US_GloomyCapsule); GloomyCapsuleScript itemScript18 = US_GloomyCapsule.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript18, grabbable: true, grabbableToEnemies: true, US_GloomyCapsule); } } catch { Debug.LogError((object)"USUAL SCRAP - Gloomy Capsule experienced an error while loading. Skipping..."); } try { if (BoundConfig.FrigidCapsuleLoaded.Value) { US_FrigidCapsule = val.LoadAsset("Assets/UsualScrapContent/Items/FrigidCapsuleAssets/US_FrigidCapsuleItem.asset"); list.Add(US_FrigidCapsule); FrigidCapsuleScript itemScript19 = US_FrigidCapsule.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript19, grabbable: true, grabbableToEnemies: true, US_FrigidCapsule); } } catch { Debug.LogError((object)"USUAL SCRAP - Frigid Capsule experienced an error while loading. Skipping..."); } try { if (BoundConfig.BloodyCapsuleLoaded.Value) { US_BloodyCapsule = val.LoadAsset("Assets/UsualScrapContent/Items/BloodyCapsuleAssets/US_BloodyCapsuleItem.asset"); list.Add(US_BloodyCapsule); BloodyCapsuleScript itemScript20 = US_BloodyCapsule.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript20, grabbable: true, grabbableToEnemies: true, US_BloodyCapsule); } } catch { Debug.LogError((object)"USUAL SCRAP - Bloody Capsule experienced an error while loading. Skipping..."); } try { if (BoundConfig.PadlockLoaded.Value) { US_Padlock = val.LoadAsset("Assets/UsualScrapContent/Items/PadlockAssets/US_PadlockItem.asset"); list.Add(US_Padlock); PadlockScript itemScript21 = US_Padlock.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript21, grabbable: true, grabbableToEnemies: true, US_Padlock); } } catch { Debug.LogError((object)"USUAL SCRAP - Padlock experienced an error while loading. Skipping..."); } try { if (BoundConfig.CrowbarLoaded.Value) { US_Crowbar = val.LoadAsset("Assets/UsualScrapContent/Items/CrowbarAssets/US_CrowbarItem.asset"); list.Add(US_Crowbar); CrowbarScript itemScript22 = US_Crowbar.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript22, grabbable: true, grabbableToEnemies: true, US_Crowbar); } } catch { Debug.LogError((object)"USUAL SCRAP - Crowbar experienced an error while loading. Skipping..."); } if (BoundConfig.MansionScrapPackEnabled.Value) { try { US_PocketWatch = val.LoadAsset("Assets/UsualScrapContent/ScrapPackItems/PocketWatchAssets/US_PocketWatchItem.asset"); list.Add(US_PocketWatch); PhysicsProp itemScript23 = US_PocketWatch.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript23, grabbable: true, grabbableToEnemies: true, US_PocketWatch); } catch { Debug.LogError((object)"USUAL SCRAP - Pocket Watch scrap pack item experienced an error while loading. Skipping..."); } try { US_ServantBell = val.LoadAsset("Assets/UsualScrapContent/ScrapPackItems/ServantBellAssets/US_ServantBellItem.asset"); list.Add(US_ServantBell); NoiseMakerScript itemScript24 = US_ServantBell.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript24, grabbable: true, grabbableToEnemies: true, US_ServantBell); } catch { Debug.LogError((object)"USUAL SCRAP - Servant Bell scrap pack item experienced an error while loading. Skipping..."); } try { US_ChessPieces = val.LoadAsset("Assets/UsualScrapContent/ScrapPackItems/ChessPiecesAssets/US_ChessPiecesItem.asset"); list.Add(US_ChessPieces); RandomModelBNWScript randomModelBNWScript = US_ChessPieces.spawnPrefab.AddComponent(); randomModelBNWScript.changeColor = true; InitializeItem((GrabbableObject)(object)randomModelBNWScript, grabbable: true, grabbableToEnemies: true, US_ChessPieces); } catch { Debug.LogError((object)"USUAL SCRAP - Chess Pieces scrap pack item experienced an error while loading. Skipping..."); } try { US_GoldenChessPieces = val.LoadAsset("Assets/UsualScrapContent/ScrapPackItems/GoldenChessPiecesAssets/US_GoldenChessPiecesItem.asset"); list.Add(US_GoldenChessPieces); RandomModelBNWScript randomModelBNWScript2 = US_GoldenChessPieces.spawnPrefab.AddComponent(); randomModelBNWScript2.changeColor = false; InitializeItem((GrabbableObject)(object)randomModelBNWScript2, grabbable: true, grabbableToEnemies: true, US_GoldenChessPieces); } catch { Debug.LogError((object)"USUAL SCRAP - Golden Chess Pieces scrap pack item experienced an error while loading. Skipping..."); } } if (BoundConfig.FacilityScrapPackEnabled.Value) { try { US_TrafficCone = val.LoadAsset("Assets/UsualScrapContent/ScrapPackItems/TrafficConeAssets/US_TrafficConeItem.asset"); list.Add(US_TrafficCone); PhysicsProp itemScript25 = US_TrafficCone.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript25, grabbable: true, grabbableToEnemies: true, US_TrafficCone); } catch { Debug.LogError((object)"USUAL SCRAP - Traffic Cone scrap pack item experienced an error while loading. Skipping..."); } try { US_MereGear = val.LoadAsset("Assets/UsualScrapContent/ScrapPackItems/MereGearAssets/US_MereGearItem.asset"); list.Add(US_MereGear); PhysicsProp itemScript26 = US_MereGear.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript26, grabbable: true, grabbableToEnemies: true, US_MereGear); } catch { Debug.LogError((object)"USUAL SCRAP - Mere Gear scrap pack item experienced an error while loading. Skipping..."); } } if (BoundConfig.DisableItemIcons.Value) { foreach (Item item in list) { item.itemIcon = null; } } Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Emil.UsualScrap"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Emil.UsualScrap is loaded!"); void SetWeights() { if (BoundConfig.MansionScrapPackEnabled.Value) { try { if ((Object)(object)US_PocketWatch != (Object)null) { string[] pocketWatchMoonStrings = BoundConfig.PocketWatchMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapPackKeys.US_PocketWatch, US_PocketWatch, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, pocketWatchMoonStrings, US_Ticket, BoundConfig.PocketWatchMoonSpawnWeights, BoundConfig.PocketWatchGlobalSpawnWeight); }); }); }); } if ((Object)(object)US_ServantBell != (Object)null) { string[] servantBellMoonStrings = BoundConfig.ServantBellMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapPackKeys.US_ServantBell, US_ServantBell, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, servantBellMoonStrings, US_Ticket, BoundConfig.ServantBellMoonSpawnWeights, BoundConfig.ServantBellGlobalSpawnWeight); }); }); }); } if ((Object)(object)US_ChessPieces != (Object)null) { string[] chessPiecesMoonStrings = BoundConfig.ChessPiecesMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapPackKeys.US_ChessPieces, US_ChessPieces, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, chessPiecesMoonStrings, US_Ticket, BoundConfig.ChessPiecesMoonSpawnWeights, BoundConfig.ChessPiecesGlobalSpawnWeight); }); }); }); } if ((Object)(object)US_GoldenChessPieces != (Object)null) { string[] goldenChessPiecesMoonStrings = BoundConfig.GoldenChessPiecesMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapPackKeys.US_GoldenChessPieces, US_GoldenChessPieces, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, goldenChessPiecesMoonStrings, US_Ticket, BoundConfig.GoldenChessPiecesMoonSpawnWeights, BoundConfig.GoldenChessPiecesGlobalSpawnWeight); }); }); }); } } catch { } } if (BoundConfig.FacilityScrapPackEnabled.Value) { try { if ((Object)(object)US_TrafficCone != (Object)null) { string[] trafficConeMoonStrings = BoundConfig.TrafficConeMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapPackKeys.US_TrafficCone, US_TrafficCone, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, trafficConeMoonStrings, US_TrafficCone, BoundConfig.TrafficConeMoonSpawnWeights, BoundConfig.TrafficConeGlobalSpawnWeight); }); }); }); } if ((Object)(object)US_MereGear != (Object)null) { string[] mereGearMoonStrings = BoundConfig.MereGearMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapPackKeys.US_MereGear, US_MereGear, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, mereGearMoonStrings, US_MereGear, BoundConfig.MereGearMoonSpawnWeights, BoundConfig.MereGearGlobalSpawnWeight); }); }); }); } } catch { } } if ((Object)(object)US_Ticket != (Object)null) { if (BoundConfig.GoldenTicketSpawnsAsScrap.Value) { string[] ticketMoonStrings = BoundConfig.TicketMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_Ticket, US_Ticket, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, ticketMoonStrings, US_Ticket, BoundConfig.TicketMoonSpawnWeights, BoundConfig.TicketGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_GoldenTicket); } if ((Object)(object)US_GoldenTicket != (Object)null) { if (BoundConfig.GoldenTicketSpawnsAsScrap.Value) { string[] goldenTicketMoonStrings = BoundConfig.GoldenTicketMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_GoldenTicket, US_GoldenTicket, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, goldenTicketMoonStrings, US_GoldenTicket, BoundConfig.GoldenTicketMoonSpawnWeights, BoundConfig.GoldenTicketGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_GoldenTicket); } if ((Object)(object)US_Rose != (Object)null) { if (BoundConfig.RoseSpawnsAsScrap.Value) { string[] roseMoonStrings = BoundConfig.RoseMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_Rose, US_Rose, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, roseMoonStrings, US_Rose, BoundConfig.RoseMoonSpawnWeights, BoundConfig.RoseGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_Rose); } } if ((Object)(object)US_SizableScissors != (Object)null) { if (BoundConfig.SizableScissorsSpawnsAsScrap.Value) { string[] sizableScissorsMoonStrings = BoundConfig.SizableScissorsMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_SizableScissors, US_SizableScissors, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, sizableScissorsMoonStrings, US_SizableScissors, BoundConfig.SizableScissorsMoonSpawnWeights, BoundConfig.SizableScissorsGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_SizableScissors); } } if ((Object)(object)US_WalkingCane != (Object)null) { if (BoundConfig.WalkingCaneSpawnsAsScrap.Value) { string[] walkingCaneMoonStrings = BoundConfig.WalkingCaneMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_WalkingCane, US_WalkingCane, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, walkingCaneMoonStrings, US_WalkingCane, BoundConfig.WalkingCaneMoonSpawnWeights, BoundConfig.WalkingCaneGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_WalkingCane); } } if ((Object)(object)US_CandyDispenser != (Object)null && (Object)(object)US_VintageCandy != (Object)null) { if (BoundConfig.CandyDispenserSpawnsAsScrap.Value) { string[] candyDispenserMoonStrings = BoundConfig.CandyDispenserMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_CandyDispenser, US_CandyDispenser, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, candyDispenserMoonStrings, US_CandyDispenser, BoundConfig.CandyDispenserMoonSpawnWeights, BoundConfig.CandyDispenserGlobalSpawnWeight); }); }); }); string[] vintageCandyMoonStrings = BoundConfig.VintageCandyMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_VintageCandy, US_VintageCandy, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, vintageCandyMoonStrings, US_VintageCandy, BoundConfig.VintageCandyMoonSpawnWeights, BoundConfig.VintageCandyGlobalSpawnWeight); }); }); }); } else if (BoundConfig.VintageCandySpawnsAsScrap.Value && !BoundConfig.CandyDispenserSpawnsAsScrap.Value) { string[] vintageCandyMoonStrings2 = BoundConfig.VintageCandyMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_VintageCandy, US_VintageCandy, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, vintageCandyMoonStrings2, US_VintageCandy, BoundConfig.VintageCandyMoonSpawnWeights, BoundConfig.VintageCandyGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_CandyDispenser); Items.RegisterItem(US_VintageCandy); } } if ((Object)(object)US_FuelCylinder != (Object)null) { if (BoundConfig.FuelCylinderSpawnsAsScrap.Value) { string[] fuelCylinderMoonStrings = BoundConfig.FuelCylinderMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_FuelCylinder, US_FuelCylinder, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, fuelCylinderMoonStrings, US_FuelCylinder, BoundConfig.FuelCylinderMoonSpawnWeights, BoundConfig.FuelCylinderGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_FuelCylinder); } } if ((Object)(object)US_RadioactiveCell != (Object)null) { if (BoundConfig.RadioactiveCellSpawnsAsScrap.Value) { string[] radioactiveCellMoonStrings = BoundConfig.RadioactiveCellMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_RadioactiveCell, US_RadioactiveCell, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, radioactiveCellMoonStrings, US_RadioactiveCell, BoundConfig.RadioactiveCellMoonSpawnWeights, BoundConfig.RadioactiveCellGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_RadioactiveCell); } } if ((Object)(object)US_GloomyCapsule != (Object)null) { if (BoundConfig.GloomyCapsuleSpawnsAsScrap.Value) { string[] gloomyCapsuleMoonStrings = BoundConfig.GloomyCapsuleMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_GloomyCapsule, US_GloomyCapsule, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, gloomyCapsuleMoonStrings, US_GloomyCapsule, BoundConfig.GloomyCapsuleMoonSpawnWeights, BoundConfig.GloomyCapsuleGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_GloomyCapsule); } } if ((Object)(object)US_FrigidCapsule != (Object)null) { if (BoundConfig.FrigidCapsuleSpawnsAsScrap.Value) { string[] frigidCapsuleMoonStrings = BoundConfig.FrigidCapsuleMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_FrigidCapsule, US_FrigidCapsule, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, frigidCapsuleMoonStrings, US_FrigidCapsule, BoundConfig.FrigidCapsuleMoonSpawnWeights, BoundConfig.FrigidCapsuleGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_FrigidCapsule); } } if ((Object)(object)US_BloodyCapsule != (Object)null) { if (BoundConfig.BloodyCapsuleSpawnsAsScrap.Value) { string[] bloodyCapsuleMoonStrings = BoundConfig.BloodyCapsuleMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_BloodyCapsule, US_BloodyCapsule, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, bloodyCapsuleMoonStrings, US_BloodyCapsule, BoundConfig.BloodyCapsuleMoonSpawnWeights, BoundConfig.BloodyCapsuleGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_BloodyCapsule); } } if ((Object)(object)US_Padlock != (Object)null) { if (BoundConfig.PadlockSpawnsAsScrap.Value) { string[] padlockMoonStrings = BoundConfig.PadlockMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_Padlock, US_Padlock, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, padlockMoonStrings, US_Padlock, BoundConfig.PadlockMoonSpawnWeights, BoundConfig.PadlockGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_Padlock); } } if ((Object)(object)US_Crowbar != (Object)null) { if (BoundConfig.CrowbarSpawnsAsScrap.Value) { string[] crowbarMoonStrings = BoundConfig.CrowbarMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_Crowbar, US_Crowbar, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, crowbarMoonStrings, US_Crowbar, BoundConfig.CrowbarMoonSpawnWeights, BoundConfig.CrowbarGlobalSpawnWeight); }); }); }); } else { Items.RegisterItem(US_Crowbar); } } } } } void buildallweights(WeightTableBuilder builder, string[] moonStrings, Item item, ConfigEntry moonWeightConfig, ConfigEntry globalWeightConfig) { List list2 = new List(); Dictionary dictionary = new Dictionary(); List list3 = new List(); foreach (KeyValuePair, DawnMoonInfo> finalMoon in FinalMoons) { foreach (string text in moonStrings) { try { string[] array3 = text.Split('='); string text2 = array3[0].Trim().ToLowerInvariant(); string s = array3[1].Trim(); int num = int.Parse(s); string text3 = Regex.Replace(finalMoon.Value.Level.PlanetName, "[\\d\\s]", "").Trim().ToLowerInvariant(); if (text3 == text2 && num >= 0) { if (BoundConfig.DebugLogging.Value) { MonoBehaviour.print((object)$"Setting moon {finalMoon}'s weight to moon weight {num} for {item}"); } dictionary[text2] = num; builder.AddWeight(finalMoon.Key, num); list2.Add(text2); } else if (text3 == text2 && num <= -1 && globalWeightConfig.Value >= 0) { if (BoundConfig.DebugLogging.Value) { MonoBehaviour.print((object)$"Setting moon {finalMoon}'s weight to global weight {globalWeightConfig} for {item}"); } dictionary[text2] = -1; builder.AddWeight(finalMoon.Key, globalWeightConfig.Value); list2.Add(text2); } else if (text3 == text2 && num <= -1 && globalWeightConfig.Value == -1) { list2.Add(text2); dictionary[text2] = -1; } else if ((text2 == null || !(text3 != text2)) && !list3.Contains(text)) { Debug.LogWarning((object)$"Usual Scrap - Moon weight config entry [{text2}] from [{item}] is unreadable and returned an error. Reformatting and resetting entry..."); list3.Add(text); } } catch { if (!list3.Contains(text)) { Debug.LogWarning((object)$"Usual Scrap - Moon weight config entry [{text}] from [{item}] is unreadable and returned an error. Reformatting and resetting entry..."); list3.Add(text); } } } } foreach (string text4 in moonStrings) { try { string text5 = text4.Split('=')[0].Trim().ToLowerInvariant(); if (!list2.Contains(text5) && !string.IsNullOrWhiteSpace(text5)) { Debug.LogWarning((object)$"Usual Scrap - Config entry '{text5}' for [{item}] does not match any loaded moons or is formatted incorrectly. Reformatting and resetting entry..."); } } catch { } } foreach (KeyValuePair, DawnMoonInfo> finalMoon2 in FinalMoons) { string text6 = Regex.Replace(finalMoon2.Value.Level.PlanetName, "[\\d\\s]", "").Trim().ToLowerInvariant(); if (!list2.Contains(text6)) { if (BoundConfig.DebugLogging.Value) { Debug.LogWarning((object)$"{item} config does not contain {text6}, adding it to the config.. Weight setting skipped for this moon.."); } bool flag = false; foreach (string text7 in moonStrings) { if (text7.ToLowerInvariant().Contains(text6)) { flag = true; break; } } if (!flag) { string text8 = moonWeightConfig.Value; if (!string.IsNullOrWhiteSpace(text8) && !text8.EndsWith(",")) { text8 += ", "; } text8 = text8 + text6 + "=-1"; moonWeightConfig.Value = text8; list2.Add(text6); } } } List list4 = new List(); foreach (string item2 in list2) { int num2 = (dictionary.ContainsKey(item2) ? dictionary[item2] : (-1)); list4.Add($"{item2}={num2}"); } string value = string.Join(", ", list4); moonWeightConfig.Value = value; ((BaseUnityPlugin)this).Config.Save(); string text9 = $"USUAL SCRAP - {item} spawn weights successfully set for "; foreach (string item3 in list2) { text9 = text9 + item3 + ", "; } if (BoundConfig.DebugLogging.Value) { MonoBehaviour.print((object)text9); } } } private void DetectMoons() { TaggedRegistry moons = LethalContent.Moons; List list = new List(); TerminalKeyword[] allKeywords = Object.FindObjectOfType().terminalNodes.allKeywords; TerminalKeyword[] array = allKeywords; foreach (TerminalKeyword val in array) { if (!(((Object)val).name == "route") && !(((Object)val).name == "Route")) { continue; } CompatibleNoun[] compatibleNouns = val.compatibleNouns; foreach (CompatibleNoun val2 in compatibleNouns) { if (!list.Contains(val2.noun)) { list.Add(val2.noun); } } } foreach (KeyValuePair, DawnMoonInfo> item in (Registry)(object)moons) { foreach (TerminalKeyword item2 in list) { if ((Object)(object)item.Value.NameKeyword == (Object)(object)item2 && item.Value.Level.spawnEnemiesAndScrap) { FinalMoons.Add(item); FinalMoonNames.Add(((object)item.Value.NameKeyword).ToString().ToLowerInvariant().Trim()); } } } } } internal class UsualScrapConfigs { public readonly ConfigEntry MansionScrapPackEnabled; public readonly ConfigEntry FacilityScrapPackEnabled; public readonly ConfigEntry TicketLoaded; public readonly ConfigEntry TicketSpawnsAsScrap; public readonly ConfigEntry TicketMoonSpawnWeights; public readonly ConfigEntry TicketGlobalSpawnWeight; public readonly ConfigEntry GoldenTicketLoaded; public readonly ConfigEntry GoldenTicketSpawnsAsScrap; public readonly ConfigEntry GoldenTicketMoonSpawnWeights; public readonly ConfigEntry GoldenTicketGlobalSpawnWeight; public readonly ConfigEntry RoseLoaded; public readonly ConfigEntry RoseSpawnsAsScrap; public readonly ConfigEntry RoseMoonSpawnWeights; public readonly ConfigEntry RoseGlobalSpawnWeight; public readonly ConfigEntry SizableScissorsLoaded; public readonly ConfigEntry SizableScissorsSpawnsAsScrap; public readonly ConfigEntry SizableScissorsMoonSpawnWeights; public readonly ConfigEntry SizableScissorsGlobalSpawnWeight; public readonly ConfigEntry WalkingCaneLoaded; public readonly ConfigEntry WalkingCaneSpawnsAsScrap; public readonly ConfigEntry WalkingCaneMoonSpawnWeights; public readonly ConfigEntry WalkingCaneGlobalSpawnWeight; public readonly ConfigEntry CandyDispenserLoaded; public readonly ConfigEntry CandyDispenserSpawnsAsScrap; public readonly ConfigEntry CandyDispenserMoonSpawnWeights; public readonly ConfigEntry CandyDispenserGlobalSpawnWeight; public readonly ConfigEntry VintageCandyLoaded; public readonly ConfigEntry VintageCandySpawnsAsScrap; public readonly ConfigEntry VintageCandyMoonSpawnWeights; public readonly ConfigEntry VintageCandyGlobalSpawnWeight; public readonly ConfigEntry FuelCylinderLoaded; public readonly ConfigEntry FuelCylinderSpawnsAsScrap; public readonly ConfigEntry FuelCylinderMoonSpawnWeights; public readonly ConfigEntry FuelCylinderGlobalSpawnWeight; public readonly ConfigEntry RadioactiveCellLoaded; public readonly ConfigEntry RadioactiveCellSpawnsAsScrap; public readonly ConfigEntry RadioactiveCellMoonSpawnWeights; public readonly ConfigEntry RadioactiveCellGlobalSpawnWeight; public readonly ConfigEntry GloomyCapsuleLoaded; public readonly ConfigEntry GloomyCapsuleSpawnsAsScrap; public readonly ConfigEntry GloomyCapsuleMoonSpawnWeights; public readonly ConfigEntry GloomyCapsuleGlobalSpawnWeight; public readonly ConfigEntry FrigidCapsuleLoaded; public readonly ConfigEntry FrigidCapsuleSpawnsAsScrap; public readonly ConfigEntry FrigidCapsuleMoonSpawnWeights; public readonly ConfigEntry FrigidCapsuleGlobalSpawnWeight; public readonly ConfigEntry BloodyCapsuleLoaded; public readonly ConfigEntry BloodyCapsuleSpawnsAsScrap; public readonly ConfigEntry BloodyCapsuleMoonSpawnWeights; public readonly ConfigEntry BloodyCapsuleGlobalSpawnWeight; public readonly ConfigEntry PadlockLoaded; public readonly ConfigEntry PadlockSpawnsAsScrap; public readonly ConfigEntry PadlockMoonSpawnWeights; public readonly ConfigEntry PadlockGlobalSpawnWeight; public readonly ConfigEntry CrowbarLoaded; public readonly ConfigEntry CrowbarSpawnsAsScrap; public readonly ConfigEntry CrowbarMoonSpawnWeights; public readonly ConfigEntry CrowbarGlobalSpawnWeight; public readonly ConfigEntry HandlampLoaded; public readonly ConfigEntry HandlampIsStoreItem; public readonly ConfigEntry HandlampStorePrice; public readonly ConfigEntry BandagesLoaded; public readonly ConfigEntry BandagesIsStoreItem; public readonly ConfigEntry BandagesStorePrice; public readonly ConfigEntry MedicalKitLoaded; public readonly ConfigEntry MedicalKitIsStoreItem; public readonly ConfigEntry MedicalKitStorePrice; public readonly ConfigEntry DefibrillatorLoaded; public readonly ConfigEntry DefibrillatorIsStoreItem; public readonly ConfigEntry DefibrillatorStorePrice; public readonly ConfigEntry DefibrillatorRequiresBattery; public readonly ConfigEntry DefibrillatorUsesLimited; public readonly ConfigEntry DefibrillatorUseLimit; public readonly ConfigEntry DefibrillatorPermaDeathRule; public readonly ConfigEntry DefibrillatorRefillsOnLanding; public readonly ConfigEntry ProductivityAutoinjectorLoaded; public readonly ConfigEntry ProductivityAutoinjectorIsStoreItem; public readonly ConfigEntry ProductivityAutoinjectorStorePrice; public readonly ConfigEntry ToolkitLoaded; public readonly ConfigEntry ToolkitIsStoreItem; public readonly ConfigEntry ToolkitStorePrice; public readonly ConfigEntry ShiftControllerLoaded; public readonly ConfigEntry ShiftControllerIsStoreItem; public readonly ConfigEntry ShiftControllerStorePrice; public readonly ConfigEntry ShiftControllerGreatRange; public readonly ConfigEntry ShiftControllerPoorRange; public readonly ConfigEntry PocketWatchMoonSpawnWeights; public readonly ConfigEntry PocketWatchGlobalSpawnWeight; public readonly ConfigEntry ServantBellMoonSpawnWeights; public readonly ConfigEntry ServantBellGlobalSpawnWeight; public readonly ConfigEntry ChessPiecesMoonSpawnWeights; public readonly ConfigEntry ChessPiecesGlobalSpawnWeight; public readonly ConfigEntry GoldenChessPiecesMoonSpawnWeights; public readonly ConfigEntry GoldenChessPiecesGlobalSpawnWeight; public readonly ConfigEntry TrafficConeMoonSpawnWeights; public readonly ConfigEntry TrafficConeGlobalSpawnWeight; public readonly ConfigEntry MereGearMoonSpawnWeights; public readonly ConfigEntry MereGearGlobalSpawnWeight; public readonly ConfigEntry CapsulesDisabledOnTheShip; public readonly ConfigEntry TicketsFunctionOnCheapItems; public readonly ConfigEntry DisableItemIcons; public readonly ConfigEntry TrueSurvivorPreset; public readonly ConfigEntry NoScrapItemsPreset; public readonly ConfigEntry NoStoreItemsPreset; public readonly ConfigEntry DebugLogging; public UsualScrapConfigs(ConfigFile cfg) { try { string configFilePath = cfg.ConfigFilePath; if (File.Exists(configFilePath)) { string destFileName = configFilePath + ".bak"; File.Copy(configFilePath, destFileName, overwrite: true); } } catch (Exception ex) { Debug.LogWarning((object)("Usual Scrap - Failed to create config backup: " + ex.Message)); } cfg.SaveOnConfigSet = false; DebugLogging = cfg.Bind("1. Debugging", "Log actions for debugging purposes", false, "Whether or not to log actions for debugging purposes"); DisableItemIcons = cfg.Bind("2. General Options", "Disable Item Icons", false, "Whether or not to disable this mod's items icons (For use with runtime icons and similar mods)"); MansionScrapPackEnabled = cfg.Bind("4. Scrap Packs", "Mansion Scrap Pack Enabled", false, "Whether or not the Mansion Scrap Pack is enabled, required for scrap pack items below to spawn. Scrap Packs include thematic items that have little to no function besides being scrap, they could be considered bloat and so they are toggleable."); FacilityScrapPackEnabled = cfg.Bind("4. Scrap Packs", "Facility Scrap Pack Enabled", false, "Whether or not the Facility Scrap Pack is enabled, required for scrap pack items below to spawn. Scrap Packs include thematic items that have little to no function besides being scrap, they could be considered bloat and so they are toggleable."); PocketWatchMoonSpawnWeights = cfg.Bind("5. Scrap Pack Items", "Pocket Watch Moon Spawn Weight", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Pocket Watch will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); PocketWatchGlobalSpawnWeight = cfg.Bind("5. Scrap Pack Items", "Pocket Watch Global Spawn Weight", 15, "How often the Pocket Watch will spawn globally (Will affect all moons including modded moons, -1 to disable)"); ServantBellMoonSpawnWeights = cfg.Bind("5. Scrap Pack Items", "Servant Bell Moon Spawn Weight", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Servant Bell will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); ServantBellGlobalSpawnWeight = cfg.Bind("5. Scrap Pack Items", "Servant Bell Global Spawn Weight", 15, "How often the Servant Bell will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); ChessPiecesMoonSpawnWeights = cfg.Bind("5. Scrap Pack Items", "Chess Pieces Moon Spawn Weight", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often Chess Pieces will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); ChessPiecesGlobalSpawnWeight = cfg.Bind("5. Scrap Pack Items", "Chess Pieces Global Spawn Weight", 30, "How often Chess Pieces will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); GoldenChessPiecesMoonSpawnWeights = cfg.Bind("5. Scrap Pack Items", "Golden Chess Pieces Moon Spawn Weight", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often Golden Chess Pieces will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); GoldenChessPiecesGlobalSpawnWeight = cfg.Bind("5. Scrap Pack Items", "Golden Chess Pieces Global Spawn Weight", 10, "How often Golden Chess Pieces will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); TrafficConeMoonSpawnWeights = cfg.Bind("5. Scrap Pack Items", "Traffic Cone Moon Spawn Weight", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Traffic Cone will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); TrafficConeGlobalSpawnWeight = cfg.Bind("5. Scrap Pack Items", "Traffic Cone Global Spawn Weight", 20, "How often Traffic Cone will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); MereGearMoonSpawnWeights = cfg.Bind("5. Scrap Pack Items", "Mere Gear Moon Spawn Weight", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Mere Gear will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); MereGearGlobalSpawnWeight = cfg.Bind("5. Scrap Pack Items", "Mere Gear Global Spawn Weight", 20, "How often Mere Gear will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); TicketsFunctionOnCheapItems = cfg.Bind("Scrap Items - Tickets", "Tickets function on cheap items", true, "Whether or not tickets function when used on items with a value below 5 (Meaning tickets will no longer work on most equipment whose value is normally 0)"); TicketLoaded = cfg.Bind("Scrap Items - Tickets", "Ticket is loaded", true, "Whether or not the Ticket is loaded"); TicketSpawnsAsScrap = cfg.Bind("Scrap Items - Tickets", "Ticket is a scrap item", true, "Whether or not the Ticket spawns as scrap"); TicketMoonSpawnWeights = cfg.Bind("Scrap Items - Tickets", "Ticket Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Ticket will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); TicketGlobalSpawnWeight = cfg.Bind("Scrap Items - Tickets", "Ticket Global Spawning", 40, "How often the Ticket will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); GoldenTicketLoaded = cfg.Bind("Scrap Items - Tickets", "Golden Ticket is loaded", true, "Whether or not the Golden Ticket is loaded"); GoldenTicketSpawnsAsScrap = cfg.Bind("Scrap Items - Tickets", "Golden Ticket is a scrap item", true, "Whether or not the Golden Ticket spawns as scrap"); GoldenTicketMoonSpawnWeights = cfg.Bind("Scrap Items - Tickets", "Golden Ticket Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Golden Ticket will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); GoldenTicketGlobalSpawnWeight = cfg.Bind("Scrap Items - Tickets", "Golden Ticket Global Spawning", 5, "How often the Golden Ticket will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); RoseLoaded = cfg.Bind("Scrap Item - Rose", "Rose is loaded", true, "Whether or not the Rose is loaded"); RoseSpawnsAsScrap = cfg.Bind("Scrap Item - Rose", "Rose is a scrap item", true, "Whether or not the Rose spawns as scrap"); RoseMoonSpawnWeights = cfg.Bind("Scrap Item - Rose", "Rose Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Rose will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); RoseGlobalSpawnWeight = cfg.Bind("Scrap Item - Rose", "Rose Global Spawning", 30, "How often the Rose will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); SizableScissorsLoaded = cfg.Bind("Scrap Item - Sizable Scissors", "Sizable Scissors is loaded", true, "Whether or not the Sizable Scissors is loaded"); SizableScissorsSpawnsAsScrap = cfg.Bind("Scrap Item - Sizable Scissors", "Sizable Scissors is a scrap item", true, "Whether or not the Sizable Scissors spawns as scrap"); SizableScissorsMoonSpawnWeights = cfg.Bind("Scrap Item - Sizable Scissors", "Sizable Scissors Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Sizable Scissors will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); SizableScissorsGlobalSpawnWeight = cfg.Bind("Scrap Item - Sizable Scissors", "Sizable Scissors Global Spawning", 20, "How often the Sizable Scissors will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); WalkingCaneLoaded = cfg.Bind("Scrap Item - Walking Cane", "Walking Cane is loaded", true, "Whether or not the Walking Cane is loaded"); WalkingCaneSpawnsAsScrap = cfg.Bind("Scrap Item - Walking Cane", "Walking Cane is a scrap item", true, "Whether or not the Walking Cane spawns as scrap"); WalkingCaneMoonSpawnWeights = cfg.Bind("Scrap Item - Walking Cane", "Walking Cane Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often Walking Cane will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); WalkingCaneGlobalSpawnWeight = cfg.Bind("Scrap Item - Walking Cane", "Walking Cane Global Spawning", 15, "How often the Walking Cane will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); CandyDispenserLoaded = cfg.Bind("Scrap Item - Candy Dispenser", "Candy Dispenser is loaded", true, "Whether or not the Candy Dispenser is loaded"); CandyDispenserSpawnsAsScrap = cfg.Bind("Scrap Item - Candy Dispenser", "Candy Dispenser is a scrap item", true, "Whether or not the Candy Dispenser spawns as scrap"); CandyDispenserMoonSpawnWeights = cfg.Bind("Scrap Item - Candy Dispenser", "Candy Dispenser Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Candy Dispenser will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); CandyDispenserGlobalSpawnWeight = cfg.Bind("Scrap Item - Candy Dispenser", "Candy Dispenser Global Spawning", 30, "How often the Candy Dispenser will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); VintageCandyLoaded = cfg.Bind("Scrap Item - Vintage Candy", "Vintage Candy is loaded", true, "Whether or not the Vintage Candy is loaded"); VintageCandySpawnsAsScrap = cfg.Bind("Scrap Item - Vintage Candy", "Vintage Candy is a scrap item", true, "Whether or not the Vintage Candy spawns as scrap"); VintageCandyMoonSpawnWeights = cfg.Bind("Scrap Item - Vintage Candy", "Vintage Candy Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often Vintage Candy will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); VintageCandyGlobalSpawnWeight = cfg.Bind("Scrap Item - Vintage Candy", "Vintage Candy Global Spawning", 20, "How often Vintage Candy will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); FuelCylinderLoaded = cfg.Bind("Scrap Item - Fuel Cylinder", "Fuel Cylinder is loaded", true, "Whether or not the Fuel Cylinder is loaded"); FuelCylinderSpawnsAsScrap = cfg.Bind("Scrap Item - Fuel Cylinder", "Fuel Cylinder is a scrap item", true, "Whether or not the Fuel Cylinder spawns as scrap"); FuelCylinderMoonSpawnWeights = cfg.Bind("Scrap Item - Fuel Cylinder", "Fuel Cylinder Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Fuel Cylinder will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); FuelCylinderGlobalSpawnWeight = cfg.Bind("Scrap Item - Fuel Cylinder", "Fuel Cylinder Global Spawning", 20, "How often the Fuel Cylinder will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); RadioactiveCellLoaded = cfg.Bind("Scrap Item - Radioactive Cell", "Radioactive Cell is loaded", true, "Whether or not the Radioactive Cell is loaded"); RadioactiveCellSpawnsAsScrap = cfg.Bind("Scrap Item - Radioactive Cell", "Radioactive Cell is a scrap item", true, "Whether or not the Radioactive Cell spawns as scrap"); RadioactiveCellMoonSpawnWeights = cfg.Bind("Scrap Item - Radioactive Cell", "Radioactive Cell Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Radioactive Cell will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); RadioactiveCellGlobalSpawnWeight = cfg.Bind("Scrap Item - Radioactive Cell", "Radioactive Cell Global Spawning", 20, "How often the Radioactive Cell will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); CapsulesDisabledOnTheShip = cfg.Bind("Scrap Items - Capsules", "Capsules Disabled On The Ship", true, "Whether or not capsules are disabled inside the ship when landed (Capsules are disabled in orbit always)"); GloomyCapsuleLoaded = cfg.Bind("Scrap Items - Capsules", "Gloomy Capsule is loaded", true, "Whether or not the Gloomy Capsule is loaded"); GloomyCapsuleSpawnsAsScrap = cfg.Bind("Scrap Items - Capsules", "Gloomy Capsule is a scrap item", true, "Whether or not the Gloomy Capsule spawns as scrap"); GloomyCapsuleMoonSpawnWeights = cfg.Bind("Scrap Items - Capsules", "Gloomy Capsule Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often Gloomy Capsule will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); GloomyCapsuleGlobalSpawnWeight = cfg.Bind("Scrap Items - Capsules", "Gloomy Capsule Global Spawning", 15, "How often the Gloomy Capsule will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); FrigidCapsuleLoaded = cfg.Bind("Scrap Items - Capsules", "Frigid Capsule is loaded", true, "Whether or not the Frigid Capsule is loaded"); FrigidCapsuleSpawnsAsScrap = cfg.Bind("Scrap Items - Capsules", "Frigid Capsule is a scrap item", true, "Whether or not the Frigid Capsule spawns as scrap"); FrigidCapsuleMoonSpawnWeights = cfg.Bind("Scrap Items - Capsules", "Frigid Capsule Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Frigid Capsule will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); FrigidCapsuleGlobalSpawnWeight = cfg.Bind("Scrap Items - Capsules", "Frigid Capsule Global Spawning", 15, "How often the Frigid Capsule will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); BloodyCapsuleLoaded = cfg.Bind("Scrap Items - Capsules", "Bloody Capsule is loaded", true, "Whether or not the Bloody Capsule is loaded"); BloodyCapsuleSpawnsAsScrap = cfg.Bind("Scrap Items - Capsules", "Bloody Capsule is a scrap item", true, "Whether or not the Bloody Capsule spawns as scrap"); BloodyCapsuleMoonSpawnWeights = cfg.Bind("Scrap Items - Capsules", "Bloody Capsule Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Bloody Capsule will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); BloodyCapsuleGlobalSpawnWeight = cfg.Bind("Scrap Items - Capsules", "Bloody Capsule Global Spawning", 15, "How often the Bloody Capsule will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); PadlockLoaded = cfg.Bind("Item - Padlock", "Padlock is loaded", true, "Whether or not the Padlock is loaded"); PadlockSpawnsAsScrap = cfg.Bind("Item - Padlock", "Padlock is a scrap item", true, "Whether or not the Padlock spawns as scrap"); PadlockMoonSpawnWeights = cfg.Bind("Item - Padlock", "Padlock Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Padlock will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); PadlockGlobalSpawnWeight = cfg.Bind("Item - Padlock", "Padlock Global Spawning", 30, "How often the Padlock will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); CrowbarLoaded = cfg.Bind("Item - Crowbar", "Crowbar is loaded", true, "Whether or not the Crowbar is loaded"); CrowbarSpawnsAsScrap = cfg.Bind("Item - Crowbar", "Crowbar is a scrap item", true, "Whether or not the Crowbar spawns as scrap"); CrowbarMoonSpawnWeights = cfg.Bind("Item - Crowbar", "Crowbar Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Where and how often the Crowbar will spawn (Moon spawn weights will individually overwrite global spawn weights, set to -1 to disable. Correct spelling and formatting is critical, shown, and a log will appear pointing out unreadable/disabled configs. Modded moon spawn weights are generated upon loading into a game for the first time with the moon mod downloaded and enabled.)"); CrowbarGlobalSpawnWeight = cfg.Bind("Item - Crowbar", "Crowbar Global Spawning", 30, "How often the Crowbar will spawn globally (Will affect all moons including modded moons unless overwritten by moon spawn weights, -1 to disable)"); HandlampLoaded = cfg.Bind("Store Item - Handlamp", "Handlamp is loaded", true, "Whether or not the Handlamp is loaded"); HandlampIsStoreItem = cfg.Bind("Store Item - Handlamp", "Handlamp is a store item", true, "Whether or not the Handlamp is a store item"); HandlampStorePrice = cfg.Bind("Store Item - Handlamp", "Handlamp store price", 25, "The store price of the Handlamp (Cannot be a negative number)"); BandagesLoaded = cfg.Bind("Store Item - Bandages", "Bandages are loaded", true, "Whether or not the Bandages are loaded"); BandagesIsStoreItem = cfg.Bind("Store Item - Bandages", "Bandages are a store item", true, "Whether or not the Bandages are a store item"); BandagesStorePrice = cfg.Bind("Store Item - Bandages", "Bandages store price", 20, "The store price of the Bandages (Cannot be a negative number)"); MedicalKitLoaded = cfg.Bind("Store Item - Medical Kit", "Medical Kit is loaded", true, "Whether or not the Medical Kit is loaded"); MedicalKitIsStoreItem = cfg.Bind("Store Item - Medical Kit", "Medical Kit is a store item", true, "Whether or not the Medical Kit is a store item"); MedicalKitStorePrice = cfg.Bind("Store Item - Medical Kit", "Medical Kit store price", 120, "The store price of the Medical Kit (Cannot be a negative number)"); DefibrillatorLoaded = cfg.Bind("Store Item - Defibrillator", "Defibrillator is loaded", true, "Whether or not the Defibrillator is loaded"); DefibrillatorIsStoreItem = cfg.Bind("Store Item - Defibrillator", "Defibrillator is a store item", true, "Whether or not the Defibrillator is a store item"); DefibrillatorStorePrice = cfg.Bind("Store Item - Defibrillator", "Defibrillator store price", 375, "The store price of the Defibrillator (Cannot be a negative number)"); DefibrillatorRequiresBattery = cfg.Bind("Store Item - Defibrillator", "Defibrillator requires battery", true, "Whether or not the Defibrillator requires battery"); DefibrillatorUsesLimited = cfg.Bind("Store Item - Defibrillator", "Defibrillator uses are limited", true, "Whether or not Defibrillators have limited uses"); DefibrillatorUseLimit = cfg.Bind("Store Item - Defibrillator", "Defibrillators use limit", 3, "The number of uses each Defibrillator has (Uses have a minimum of 1, uses are used up on players successfully revived only)"); DefibrillatorRefillsOnLanding = cfg.Bind("Store Item - Defibrillator", "Defibrillator refills every moon landing", false, "Whether or not existing Defibrillators will refill their uses upon landing on a moon"); DefibrillatorPermaDeathRule = cfg.Bind("Store Item - Defibrillator", "Defibrillator follows perma-death rules", true, "Whether or not specific causes of death will prevent the defibrillator from reviving players (Ex - Corpses decapitated by CoilHeads, Corpses snipped in half by a Barber, Corpses head popped by the Ghost Girl)"); ProductivityAutoinjectorLoaded = cfg.Bind("Store Item - Productivity Autoinjector", "Productivity Autoinjector is loaded", true, "Whether or not the Productivity Autoinjector is loaded"); ProductivityAutoinjectorIsStoreItem = cfg.Bind("Store Item - Productivity Autoinjector", "Productivity Autoinjector is a store item", true, "Whether or not the Productivity Autoinjector is a store item"); ProductivityAutoinjectorStorePrice = cfg.Bind("Store Item - Productivity Autoinjector", "Productivity Autoinjector store price", 90, "The store price of the Productivity Autoinjector"); ToolkitLoaded = cfg.Bind("Store Item - Toolkit", "Toolkit is loaded", true, "Whether or not the Toolkit is loaded"); ToolkitIsStoreItem = cfg.Bind("Store Item - Toolkit", "Toolkit is a store item", true, "Whether or not the Toolkit is a store item"); ToolkitStorePrice = cfg.Bind("Store Item - Toolkit", "Toolkit store price", 115, "The store price of the Toolkit"); ShiftControllerLoaded = cfg.Bind("Store Item - Shift Controller", "Shift Controller is loaded", true, "Whether or not the Shift Controller is loaded"); ShiftControllerIsStoreItem = cfg.Bind("Store Item - Shift Controller", "Shift Controller is a store item", true, "Whether or not the Shift Controller is a store item"); ShiftControllerStorePrice = cfg.Bind("Store Item - Shift Controller", "Shift Controller store price", 225, "The store price of the Shift Controller"); ShiftControllerGreatRange = cfg.Bind("Store Item - Shift Controller", "Shift Controllers great/first connection range", 50, "The max range of the Shift Controller's great/first connection range. (The great/first connection range starts at 0 and stops at this value, The average/middle connection range starts at this value)"); ShiftControllerPoorRange = cfg.Bind("Store Item - Shift Controller", "Shift Controllers poor/last connection range", 175, "The range where the Shift Controller enters it's poor/last connection range. (The average/middle connection range stops at this value, The poor/last connection range starts at this value)"); ClearOrphanedEntries(cfg); cfg.Save(); cfg.SaveOnConfigSet = true; } private static void ClearOrphanedEntries(ConfigFile cfg) { PropertyInfo propertyInfo = AccessTools.Property(typeof(ConfigFile), "OrphanedEntries"); Dictionary dictionary = (Dictionary)propertyInfo.GetValue(cfg); dictionary.Clear(); } } } namespace UsualScrap.Behaviors { public class BandagesScript : GrabbableObject { private int uses = 3; private ParticleSystem particle; public void Awake() { particle = ((Component)this).GetComponentInChildren(); } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); if (base.heldByPlayerOnServer && !base.isPocketed) { UpdateControlTip(); } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (base.heldByPlayerOnServer && !base.isPocketed) { UpdateControlTip(); } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown && base.playerHeldBy.health < 100) { HealServerRpc(); if (base.heldByPlayerOnServer && !base.isPocketed) { UpdateControlTip(); } } } public void UpdateControlTip() { string text = $"Remaining Uses - {uses}"; HUDManager.Instance.ChangeControlTip(1, text, false); } [ServerRpc(RequireOwnership = false)] public void HealServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(87823207u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 87823207u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HealClientRpc(); } } } [ClientRpc] public void HealClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2085797069u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2085797069u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Heal(); } } } public void Heal() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB playerHeldBy = base.playerHeldBy; if (uses > 1 && playerHeldBy.health < 70) { playerHeldBy.health += 30; ParticleSystem val = Object.Instantiate(particle, ((Component)playerHeldBy).transform.position, Quaternion.identity, ((Component)playerHeldBy).transform); val.Play(); uses--; } else if (uses == 1 && playerHeldBy.health < 70) { playerHeldBy.health += 30; ParticleSystem val2 = Object.Instantiate(particle, ((Component)playerHeldBy).transform.position, Quaternion.identity, ((Component)playerHeldBy).transform); val2.Play(); if (base.heldByPlayerOnServer && (Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } Object.Destroy((Object)(object)((Component)this).gameObject); } else if (uses > 1 && playerHeldBy.health >= 70 && playerHeldBy.health < 100) { playerHeldBy.health = 100; ParticleSystem val3 = Object.Instantiate(particle, ((Component)playerHeldBy).transform.position, Quaternion.identity, ((Component)playerHeldBy).transform); val3.Play(); uses--; } else if (uses == 1 && playerHeldBy.health >= 70 && playerHeldBy.health < 100) { playerHeldBy.health = 100; ParticleSystem val4 = Object.Instantiate(particle, ((Component)playerHeldBy).transform.position, Quaternion.identity, ((Component)playerHeldBy).transform); val4.Play(); if (base.heldByPlayerOnServer && (Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } Object.Destroy((Object)(object)((Component)this).gameObject); } else if (uses < 1 || uses > 3) { if (base.heldByPlayerOnServer && (Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } Object.Destroy((Object)(object)((Component)this).gameObject); } if (playerHeldBy.health >= 20) { if (playerHeldBy.criticallyInjured) { playerHeldBy.criticallyInjured = false; } if (playerHeldBy.bleedingHeavily) { playerHeldBy.bleedingHeavily = false; } if ((Object)(object)playerHeldBy.playerBodyAnimator != (Object)null) { playerHeldBy.playerBodyAnimator.SetBool("Limp", false); } if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerHeldBy) { HUDManager.Instance.UpdateHealthUI(playerHeldBy.health, false); } } MonoBehaviour.print((object)playerHeldBy.health); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(87823207u, new RpcReceiveHandler(__rpc_handler_87823207), "HealServerRpc"); ((NetworkBehaviour)this).__registerRpc(2085797069u, new RpcReceiveHandler(__rpc_handler_2085797069), "HealClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_87823207(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((BandagesScript)(object)target).HealServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2085797069(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((BandagesScript)(object)target).HealClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BandagesScript"; } } public class BloodyCapsuleScript : GrabbableObject { private ParticleSystem chargedParticles; private ParticleSystem chargingParticles; private ParticleSystem drainingParticles; private AudioSource[] sounds; private AudioClip pulse; private Light light; private bool chargingParticlePlaying = false; private bool chargedParticlesPlaying = false; private Coroutine detectCoroutine = null; private int charge = 0; private bool disabledInShip; internal static UsualScrapConfigs BoundConfig { get; private set; } public void Awake() { BoundConfig = Plugin.BoundConfig; try { chargedParticles = ((Component)((Component)this).transform.Find("ChargedParticles")).GetComponent(); chargingParticles = ((Component)((Component)this).transform.Find("ChargingParticles")).GetComponent(); drainingParticles = ((Component)((Component)this).transform.Find("DrainingParticles")).GetComponent(); sounds = ((Component)((Component)this).transform.Find("BloodyCapsuleSounds")).gameObject.GetComponents(); light = ((Component)((Component)this).transform.Find("Point Light")).GetComponent(); pulse = sounds[0].clip; } catch { if ((Object)(object)chargedParticles == (Object)null) { MonoBehaviour.print((object)"Bloody Capsule missing charged particles! - USUAL SCRAP"); } if ((Object)(object)chargingParticles == (Object)null) { MonoBehaviour.print((object)"Bloody Capsule missing charging particles! - USUAL SCRAP"); } if ((Object)(object)drainingParticles == (Object)null) { MonoBehaviour.print((object)"Bloody Capsule missing draining particles! - USUAL SCRAP"); } if (sounds == null) { MonoBehaviour.print((object)"Bloody Capsule missing sounds! - USUAL SCRAP"); } } disabledInShip = BoundConfig.CapsulesDisabledOnTheShip.Value; ((MonoBehaviour)this).StartCoroutine(Glow()); } private IEnumerator Glow() { float maxintensity = light.intensity * 1.5f; float minintensity = light.intensity * 0.5f; while (true) { if (!((Behaviour)light).enabled) { yield return (object)new WaitUntil((Func)(() => ((Behaviour)light).enabled)); } float t = (MathF.Sin(Time.time * 1f) + 1f) / 2f; light.intensity = minintensity + (maxintensity - minintensity) * t; yield return null; } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if (((Behaviour)light).enabled) { ((Behaviour)light).enabled = false; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (!((Behaviour)light).enabled) { ((Behaviour)light).enabled = true; } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if (!((Behaviour)light).enabled) { ((Behaviour)light).enabled = true; } } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); if (!StartOfRound.Instance.inShipPhase && detectCoroutine == null) { detectCoroutine = ((MonoBehaviour)this).StartCoroutine(Detecting()); } } private IEnumerator Detecting() { while (true) { yield return (object)new WaitForSeconds(1f); if (chargingParticlePlaying) { chargingParticles.Stop(); chargingParticlePlaying = false; } if (StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded || !TimeOfDay.Instance.currentLevel.planetHasTime) { continue; } if (disabledInShip && base.isInShipRoom) { yield return null; continue; } while (((int)TimeOfDay.Instance.dayMode == 3 && !base.isInFactory) || ((int)TimeOfDay.Instance.dayMode == 2 && !base.isInFactory)) { yield return (object)new WaitForSeconds(3f); if (StartOfRound.Instance.inShipPhase || (disabledInShip && base.isInShipRoom)) { charge = 0; break; } if (base.isPocketed) { chargingParticles.Stop(true, (ParticleSystemStopBehavior)0); chargingParticlePlaying = false; } else if (!chargingParticlePlaying) { chargingParticles.Play(); chargingParticlePlaying = true; } Collider[] playerColliderArray = Physics.OverlapSphere(((Component)this).transform.position, 4f, LayerMask.GetMask(new string[1] { "Player" }), (QueryTriggerInteraction)2); HashSet drainedPlayers = new HashSet(); if (playerColliderArray.Length != 0) { Collider[] array = playerColliderArray; foreach (Collider collider in array) { PlayerControllerB targetPlayer = ((Component)collider).gameObject.GetComponent(); if ((Object)(object)targetPlayer != (Object)null && !drainedPlayers.Contains(targetPlayer)) { targetPlayer.DamagePlayer(10, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); drainedPlayers.Add(targetPlayer); ParticleSystem DrainingParticle = Object.Instantiate(drainingParticles, ((Component)collider).transform.position, Quaternion.identity, ((Component)targetPlayer).transform); DrainingParticle.Play(); sounds[0].PlayOneShot(pulse); charge++; } } } if (charge >= 20) { chargingParticles.Stop(); chargingParticlePlaying = false; chargedParticles.Play(); chargedParticlesPlaying = true; chargedParticles.Stop(); chargedParticlesPlaying = false; charge = 0; break; } } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "BloodyCapsuleScript"; } } public class CandyDispenserScript : GrabbableObject { private RaycastHit[] objectsHitByMeleeWeapon; private List objectsHitByMeleeWeaponList = new List(); private bool isHoldingButton; private bool reelingUp; private Coroutine reelingUpCoroutine; private PlayerControllerB previousPlayerHeldBy; private static Item _candyItem; private GameObject dispenserBase; private MeshRenderer dispenserMesh; private int meleeWeaponMask = 1084754248; private int meleeWeaponHitForce = 1; private AudioSource dispenserAudio; private AudioClip swing; private AudioClip Dispense; private AudioClip[] hitSFX; private Color setColor; public void Awake() { dispenserAudio = ((Component)((Component)this).transform.Find("CandyDispenserSounds")).gameObject.GetComponent(); AudioSource[] components = ((Component)((Component)this).transform.Find("CandyDispenserSounds")).gameObject.GetComponents(); swing = components[1].clip; Dispense = components[2].clip; hitSFX = (AudioClip[])(object)new AudioClip[1] { dispenserAudio.clip }; } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.activatingItem = false; } ((GrabbableObject)this).DiscardItem(); } public override void Start() { ((GrabbableObject)this).Start(); SetColorServerRPC(); } [ServerRpc(RequireOwnership = false)] public void SetColorServerRPC() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3606619266u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3606619266u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; byte b = (byte)new Random().Next(1, 256); byte b2 = (byte)new Random().Next(1, 256); byte b3 = (byte)new Random().Next(1, 256); setColor = Color32.op_Implicit(new Color32(b, b2, b3, byte.MaxValue)); SetColorClientRPC(setColor); } } } [ClientRpc] public void SetColorClientRPC(Color color) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) //IL_011f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(809217553u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref color); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 809217553u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; dispenserBase = ((Component)((Component)((Component)this).transform.Find("CandyDispenserModel")).gameObject.transform.Find("DispenserBase")).gameObject; dispenserMesh = dispenserBase.GetComponent(); ((Renderer)dispenserMesh).material.color = color; } } } public override void ItemActivate(bool used, bool buttonDown = true) { if ((Object)(object)base.playerHeldBy == (Object)null) { return; } isHoldingButton = buttonDown; if (!reelingUp && !reelingUp && buttonDown) { reelingUp = true; previousPlayerHeldBy = base.playerHeldBy; if (reelingUpCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine); } reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpMeleeWeapon()); } } private IEnumerator reelUpMeleeWeapon() { base.playerHeldBy.activatingItem = true; base.playerHeldBy.twoHanded = true; base.playerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit"); base.playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); yield return (object)new WaitForSeconds(0.35f); yield return (object)new WaitUntil((Func)(() => !isHoldingButton || !base.isHeld)); SwingMeleeWeapon(!base.isHeld); yield return (object)new WaitForSeconds(0.13f); yield return (object)new WaitForEndOfFrame(); HitMeleeWeapon(!base.isHeld); yield return (object)new WaitForSeconds(0.3f); reelingUp = false; reelingUpCoroutine = null; } public void SwingMeleeWeapon(bool cancel = false) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); if (!cancel) { dispenserAudio.PlayOneShot(swing); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public void HitMeleeWeapon(bool cancel = false) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: 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_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: 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_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: 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) if ((Object)(object)previousPlayerHeldBy == (Object)null) { return; } previousPlayerHeldBy.activatingItem = false; bool flag = false; bool flag2 = false; bool flag3 = false; int num = -1; if (!cancel) { previousPlayerHeldBy.twoHanded = false; objectsHitByMeleeWeapon = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.8f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.5f, meleeWeaponMask, (QueryTriggerInteraction)2); objectsHitByMeleeWeaponList = objectsHitByMeleeWeapon.OrderBy(delegate(RaycastHit x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) RaycastHit val4 = x; return ((RaycastHit)(ref val4)).distance; }).ToList(); List list = new List(); IHittable val2 = default(IHittable); RaycastHit val3 = default(RaycastHit); for (int i = 0; i < objectsHitByMeleeWeaponList.Count; i++) { RaycastHit val = objectsHitByMeleeWeaponList[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByMeleeWeaponList[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByMeleeWeaponList[i]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = objectsHitByMeleeWeaponList[i]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByMeleeWeaponList[i]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; val = objectsHitByMeleeWeaponList[i]; if (Physics.Linecast(position, ((RaycastHit)(ref val)).point, ref val3, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { continue; } } flag = true; Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward; try { val = objectsHitByMeleeWeaponList[i]; EnemyAICollisionDetect component = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)component != (Object)null) { if ((Object)(object)component.mainScript == (Object)null || list.Contains(component.mainScript)) { continue; } goto IL_0369; } val = objectsHitByMeleeWeaponList[i]; if (!((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent() != (Object)null)) { goto IL_0369; } if (flag3) { continue; } flag3 = true; goto IL_0369; IL_0369: bool flag4 = val2.Hit(meleeWeaponHitForce, forward, previousPlayerHeldBy, true, 1); if (flag4 && (Object)(object)component != (Object)null) { list.Add(component.mainScript); } if (!flag2) { flag2 = flag4; } } catch (Exception arg) { MonoBehaviour.print((object)$"Error hitting object with Candy Dispenser {arg}, caused by playerInital: {previousPlayerHeldBy.playerClientId}"); } continue; } } val = objectsHitByMeleeWeaponList[i]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; val = objectsHitByMeleeWeaponList[i]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++) { if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag) { num = j; dispenserAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX); break; } } } float num2 = new Random().Next(1, 25); if (num2 == 1f) { if (StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded || !TimeOfDay.Instance.currentLevel.planetHasTime) { MonoBehaviour.print((object)"US - Candy spawning disabled here, land at a moon with a time cycle!"); return; } dispenserAudio.PlayOneShot(Dispense); SpawnScrapServerRpc(); } } if (flag) { int num3 = RoundManager.PlayRandomClip(dispenserAudio, hitSFX, true, 1f, 0, 1000); Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); if (num != -1) { dispenserAudio.PlayOneShot(hitSFX[num3]); WalkieTalkie.TransmitOneShotAudio(dispenserAudio, hitSFX[num3], 1f); } base.playerHeldBy.playerBodyAnimator.SetTrigger("shovelHit"); HitMeleeWeaponServerRpc(num3); } } [ServerRpc] public void HitMeleeWeaponServerRpc(int sound) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2363479380u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, sound); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2363479380u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitMeleeWeaponClientRpc(sound); } } [ClientRpc] public void HitMeleeWeaponClientRpc(int sound) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(823714643u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, sound); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 823714643u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitSurfaceWithMeleeWeapon(sound); } } } private void HitSurfaceWithMeleeWeapon(int sound) { if (!((NetworkBehaviour)this).IsOwner) { dispenserAudio.PlayOneShot(hitSFX[sound]); } WalkieTalkie.TransmitOneShotAudio(dispenserAudio, hitSFX[sound], 1f); } [ServerRpc(RequireOwnership = false)] public void SpawnScrapServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2364265404u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2364265404u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SpawnCandy(); } } } public void SpawnCandy() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) Item val = PullCandyItem(); GameObject val2 = Object.Instantiate(val.spawnPrefab, ((Component)base.playerHeldBy).transform.position + Vector3.up, Quaternion.identity); GrabbableObject component = val2.GetComponent(); component.fallTime = 0f; ((NetworkBehaviour)component).NetworkObject.Spawn(false); component.SetScrapValue(6); if ((Object)(object)previousPlayerHeldBy != (Object)null && previousPlayerHeldBy.isInHangarShipRoom) { previousPlayerHeldBy.SetItemInElevator(true, true, val2.GetComponent()); } } public static Item PullCandyItem() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown if ((Object)_candyItem == (Object)null) { _candyItem = StartOfRound.Instance.allItemsList.itemsList.First((Item i) => ((Object)i).name == "US_PieceofCandyItem"); } return _candyItem; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3606619266u, new RpcReceiveHandler(__rpc_handler_3606619266), "SetColorServerRPC"); ((NetworkBehaviour)this).__registerRpc(809217553u, new RpcReceiveHandler(__rpc_handler_809217553), "SetColorClientRPC"); ((NetworkBehaviour)this).__registerRpc(2363479380u, new RpcReceiveHandler(__rpc_handler_2363479380), "HitMeleeWeaponServerRpc"); ((NetworkBehaviour)this).__registerRpc(823714643u, new RpcReceiveHandler(__rpc_handler_823714643), "HitMeleeWeaponClientRpc"); ((NetworkBehaviour)this).__registerRpc(2364265404u, new RpcReceiveHandler(__rpc_handler_2364265404), "SpawnScrapServerRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3606619266(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CandyDispenserScript)(object)target).SetColorServerRPC(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_809217553(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Color colorClientRPC = default(Color); ((FastBufferReader)(ref reader)).ReadValueSafe(ref colorClientRPC); target.__rpc_exec_stage = (__RpcExecStage)1; ((CandyDispenserScript)(object)target).SetColorClientRPC(colorClientRPC); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2363479380(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int sound = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref sound); target.__rpc_exec_stage = (__RpcExecStage)1; ((CandyDispenserScript)(object)target).HitMeleeWeaponServerRpc(sound); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_823714643(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int sound = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref sound); target.__rpc_exec_stage = (__RpcExecStage)1; ((CandyDispenserScript)(object)target).HitMeleeWeaponClientRpc(sound); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2364265404(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CandyDispenserScript)(object)target).SpawnScrapServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CandyDispenserScript"; } } public class CrowbarScript : GrabbableObject { private PlayerControllerB previousPlayerHeldBy; private DoorLock viewedDoorLock; private int hitsToOpen = new Random().Next(2, 3); private AudioSource crowbarAudio; private AudioClip swing; private AudioClip[] hitSFX; public int meleeWeaponHitForce = 1; private bool isHoldingButton; private bool reelingUp; private Coroutine reelingUpCoroutine; private RaycastHit[] objectsHitByMeleeWeapon; private List objectsHitByMeleeWeaponList = new List(); public int meleeWeaponMask = 1084754248; public void Awake() { crowbarAudio = ((Component)((Component)this).transform.Find("CrowbarSounds")).gameObject.GetComponent(); AudioSource[] components = ((Component)((Component)this).transform.Find("CrowbarSounds")).gameObject.GetComponents(); swing = components[1].clip; hitSFX = (AudioClip[])(object)new AudioClip[1] { crowbarAudio.clip }; } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.activatingItem = false; } ((GrabbableObject)this).DiscardItem(); } public override void ItemActivate(bool used, bool buttonDown = true) { if ((Object)(object)base.playerHeldBy == (Object)null) { return; } isHoldingButton = buttonDown; if (!reelingUp && buttonDown) { reelingUp = true; previousPlayerHeldBy = base.playerHeldBy; if (reelingUpCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine); } reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpMeleeWeapon()); } } private IEnumerator reelUpMeleeWeapon() { base.playerHeldBy.activatingItem = true; base.playerHeldBy.twoHanded = true; base.playerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit"); base.playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); yield return (object)new WaitForSeconds(0.35f); yield return (object)new WaitUntil((Func)(() => !isHoldingButton || !base.isHeld)); SwingMeleeWeapon(!base.isHeld); yield return (object)new WaitForSeconds(0.13f); yield return (object)new WaitForEndOfFrame(); HitMeleeWeapon(!base.isHeld); yield return (object)new WaitForSeconds(0.3f); reelingUp = false; reelingUpCoroutine = null; } public void SwingMeleeWeapon(bool cancel = false) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); if (!cancel) { crowbarAudio.PlayOneShot(swing); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public void HitMeleeWeapon(bool cancel = false) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: 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_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: 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_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: 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) if ((Object)(object)previousPlayerHeldBy == (Object)null) { return; } previousPlayerHeldBy.activatingItem = false; bool flag = false; bool flag2 = false; bool flag3 = false; int num = -1; if (!cancel) { previousPlayerHeldBy.twoHanded = false; objectsHitByMeleeWeapon = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.8f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.5f, meleeWeaponMask, (QueryTriggerInteraction)2); objectsHitByMeleeWeaponList = objectsHitByMeleeWeapon.OrderBy(delegate(RaycastHit x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) RaycastHit val5 = x; return ((RaycastHit)(ref val5)).distance; }).ToList(); List list = new List(); IHittable val2 = default(IHittable); RaycastHit val3 = default(RaycastHit); for (int i = 0; i < objectsHitByMeleeWeaponList.Count; i++) { RaycastHit val = objectsHitByMeleeWeaponList[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByMeleeWeaponList[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByMeleeWeaponList[i]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = objectsHitByMeleeWeaponList[i]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByMeleeWeaponList[i]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; val = objectsHitByMeleeWeaponList[i]; if (Physics.Linecast(position, ((RaycastHit)(ref val)).point, ref val3, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { continue; } } flag = true; Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward; try { val = objectsHitByMeleeWeaponList[i]; EnemyAICollisionDetect component = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)component != (Object)null) { if ((Object)(object)component.mainScript == (Object)null || list.Contains(component.mainScript)) { continue; } goto IL_0369; } val = objectsHitByMeleeWeaponList[i]; if (!((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent() != (Object)null)) { goto IL_0369; } if (flag3) { continue; } flag3 = true; goto IL_0369; IL_0369: bool flag4 = val2.Hit(meleeWeaponHitForce, forward, previousPlayerHeldBy, true, 1); if (flag4 && (Object)(object)component != (Object)null) { list.Add(component.mainScript); } if (!flag2) { flag2 = flag4; } } catch (Exception arg) { MonoBehaviour.print((object)$"Error hitting object with crowbar {arg}, caused by playerInital: {previousPlayerHeldBy.playerClientId}"); } continue; } } val = objectsHitByMeleeWeaponList[i]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; val = objectsHitByMeleeWeaponList[i]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++) { if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag) { num = j; crowbarAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX); break; } } } RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(new Ray(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward), ref val4, 3f, LayerMask.GetMask(new string[1] { "InteractableObject" }))) { viewedDoorLock = ((Component)((RaycastHit)(ref val4)).transform).GetComponent(); if ((Object)(object)viewedDoorLock != (Object)null && viewedDoorLock.isLocked && hitsToOpen > 0) { hitsToOpen--; } else if ((Object)(object)viewedDoorLock != (Object)null && viewedDoorLock.isLocked && hitsToOpen == 0) { UnlockDoorServerRpc(); OpenDoorServerRpc(); hitsToOpen = new Random().Next(2, 3); } if ((Object)(object)viewedDoorLock != (Object)null && !viewedDoorLock.isLocked) { OpenDoorServerRpc(); } } } if (flag) { int num2 = RoundManager.PlayRandomClip(crowbarAudio, hitSFX, true, 1f, 0, 1000); Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); if (num != -1) { crowbarAudio.PlayOneShot(hitSFX[num2]); WalkieTalkie.TransmitOneShotAudio(crowbarAudio, hitSFX[num2], 1f); } base.playerHeldBy.playerBodyAnimator.SetTrigger("shovelHit"); HitMeleeWeaponServerRpc(num2); } } [ServerRpc] public void HitMeleeWeaponServerRpc(int sound) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(18646315u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, sound); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 18646315u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitMeleeWeaponClientRpc(sound); } } [ClientRpc] public void HitMeleeWeaponClientRpc(int sound) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(292927352u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, sound); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 292927352u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitSurfaceWithMeleeWeapon(sound); } } } private void HitSurfaceWithMeleeWeapon(int sound) { if (!((NetworkBehaviour)this).IsOwner && sound != -1) { crowbarAudio.PlayOneShot(hitSFX[sound]); } } [ServerRpc(RequireOwnership = false)] public void OpenDoorServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(121767703u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 121767703u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OpenDoorClientRpc(); } } } [ClientRpc] public void OpenDoorClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4047106965u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4047106965u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; try { viewedDoorLock.OpenOrCloseDoor(base.playerHeldBy); viewedDoorLock.SetDoorAsOpen(true); } catch (Exception) { } } [ServerRpc(RequireOwnership = false)] public void UnlockDoorServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1016317823u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1016317823u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UnlockDoorClientRpc(); } } } [ClientRpc] public void UnlockDoorClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3693078860u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3693078860u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; viewedDoorLock.UnlockDoor(); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(18646315u, new RpcReceiveHandler(__rpc_handler_18646315), "HitMeleeWeaponServerRpc"); ((NetworkBehaviour)this).__registerRpc(292927352u, new RpcReceiveHandler(__rpc_handler_292927352), "HitMeleeWeaponClientRpc"); ((NetworkBehaviour)this).__registerRpc(121767703u, new RpcReceiveHandler(__rpc_handler_121767703), "OpenDoorServerRpc"); ((NetworkBehaviour)this).__registerRpc(4047106965u, new RpcReceiveHandler(__rpc_handler_4047106965), "OpenDoorClientRpc"); ((NetworkBehaviour)this).__registerRpc(1016317823u, new RpcReceiveHandler(__rpc_handler_1016317823), "UnlockDoorServerRpc"); ((NetworkBehaviour)this).__registerRpc(3693078860u, new RpcReceiveHandler(__rpc_handler_3693078860), "UnlockDoorClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_18646315(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int sound = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref sound); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrowbarScript)(object)target).HitMeleeWeaponServerRpc(sound); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_292927352(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int sound = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref sound); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrowbarScript)(object)target).HitMeleeWeaponClientRpc(sound); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_121767703(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CrowbarScript)(object)target).OpenDoorServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4047106965(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CrowbarScript)(object)target).OpenDoorClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1016317823(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CrowbarScript)(object)target).UnlockDoorServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3693078860(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CrowbarScript)(object)target).UnlockDoorClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CrowbarScript"; } } public class DefibrillatorScript : GrabbableObject { private Coroutine coroutine; private bool ReadyingDefib = false; private Renderer[] displayRenderers; private GameObject ChargeDisplayOne; private GameObject ChargeDisplayTwo; private GameObject ChargeDisplayThree; private GameObject ChargeDisplayFour; private GameObject ChargeDisplayFive; private GameObject BatteryDisplay; private Renderer DisplayOneRenderer; private Renderer DisplayTwoRenderer; private Renderer DisplayThreeRenderer; private Renderer DisplayFourRenderer; private Renderer DisplayFiveRenderer; private Renderer BatteryDisplayRenderer; private AudioSource ChargedAudio; private AudioSource ShockAudio; private AudioSource ShockHitAudio; private int timeToHold; private float batteryCost; private bool RequiresBattery; private bool UsesLimited; private bool PermaDeathRule; private bool DefibrillatorRefillsOnLanding; private int useLimit; public NetworkVariable savedUseLimit = new NetworkVariable(3, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal static UsualScrapConfigs BoundConfig { get; private set; } public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); if (useLimit <= 0) { savedUseLimit.Value = -1; } else { savedUseLimit.Value = useLimit; } return savedUseLimit.Value; } public override void LoadItemSaveData(int saveData) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).LoadItemSaveData(saveData); if (saveData == -1) { useLimit = 0; Renderer[] array = displayRenderers; foreach (Renderer val in array) { val.material.SetColor("_EmissiveColor", Color.red); } } else { useLimit = saveData; } } public void Awake() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown BoundConfig = Plugin.BoundConfig; BatteryDisplay = ((Component)((Component)((Component)this).transform.Find("DefibrillatorModel")).gameObject.transform.Find("BatteryDisplay")).gameObject; BatteryDisplayRenderer = BatteryDisplay.GetComponent(); RequiresBattery = BoundConfig.DefibrillatorRequiresBattery.Value; BatteryDisplayRenderer.material.SetColor("_EmissiveColor", Color.yellow); if (RequiresBattery) { base.insertedBattery = new Battery(false, 1f); batteryCost = base.insertedBattery.charge / 2f; } else { base.itemProperties.requiresBattery = false; } AudioSource[] components = ((Component)((Component)this).transform.Find("DefibrillatorSounds")).gameObject.GetComponents(); ChargedAudio = components[0]; ShockAudio = components[1]; ShockHitAudio = components[2]; ChargeDisplayOne = ((Component)((Component)((Component)this).transform.Find("DefibrillatorModel")).gameObject.transform.Find("Charge1")).gameObject; ChargeDisplayTwo = ((Component)((Component)((Component)this).transform.Find("DefibrillatorModel")).gameObject.transform.Find("Charge2")).gameObject; ChargeDisplayThree = ((Component)((Component)((Component)this).transform.Find("DefibrillatorModel")).gameObject.transform.Find("Charge3")).gameObject; ChargeDisplayFour = ((Component)((Component)((Component)this).transform.Find("DefibrillatorModel")).gameObject.transform.Find("Charge4")).gameObject; ChargeDisplayFive = ((Component)((Component)((Component)this).transform.Find("DefibrillatorModel")).gameObject.transform.Find("Charge5")).gameObject; DisplayOneRenderer = ChargeDisplayOne.GetComponent(); DisplayTwoRenderer = ChargeDisplayTwo.GetComponent(); DisplayThreeRenderer = ChargeDisplayThree.GetComponent(); DisplayFourRenderer = ChargeDisplayFour.GetComponent(); DisplayFiveRenderer = ChargeDisplayFive.GetComponent(); displayRenderers = (Renderer[])(object)new Renderer[5] { DisplayOneRenderer, DisplayTwoRenderer, DisplayThreeRenderer, DisplayFourRenderer, DisplayFiveRenderer }; UsesLimited = BoundConfig.DefibrillatorUsesLimited.Value; useLimit = BoundConfig.DefibrillatorUseLimit.Value; PermaDeathRule = BoundConfig.DefibrillatorPermaDeathRule.Value; DefibrillatorRefillsOnLanding = BoundConfig.DefibrillatorRefillsOnLanding.Value; if (UsesLimited && useLimit < 1) { MonoBehaviour.print((object)"US - US_Defibrillator savedUses enabled but number of savedUses less than the minimum of 1! setting savedUses to 1."); useLimit = 1; } } public override void ChargeBatteries() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ChargeBatteries(); if (RequiresBattery) { BatteryDisplayRenderer.material.SetColor("_EmissiveColor", Color.yellow); } } public override void Update() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if (DefibrillatorRefillsOnLanding && StartOfRound.Instance.inShipPhase && useLimit != BoundConfig.DefibrillatorUseLimit.Value) { useLimit = BoundConfig.DefibrillatorUseLimit.Value; Renderer[] array = displayRenderers; foreach (Renderer val in array) { val.material.SetColor("_EmissiveColor", Color.black); } } } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); if (base.heldByPlayerOnServer && UsesLimited && !base.isPocketed) { UpdateControlTip(); } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (base.heldByPlayerOnServer && UsesLimited && !base.isPocketed) { UpdateControlTip(); } } public void UpdateControlTip() { string text = $"Remaining Uses - {useLimit}"; HUDManager.Instance.ChangeControlTip(1, text, false); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) if (buttonDown) { if (RequiresBattery && !base.insertedBattery.empty) { Renderer[] array = displayRenderers; foreach (Renderer val in array) { val.material.SetColor("_EmissiveColor", Color.black); } if (UsesLimited && useLimit <= 0) { Renderer[] array2 = displayRenderers; foreach (Renderer val2 in array2) { val2.material.SetColor("_EmissiveColor", Color.red); } return; } ReadyingDefib = true; coroutine = ((MonoBehaviour)this).StartCoroutine(ReadyDefib()); } else if (!RequiresBattery) { Renderer[] array3 = displayRenderers; foreach (Renderer val3 in array3) { val3.material.SetColor("_EmissiveColor", Color.black); } if (UsesLimited && useLimit <= 0) { Renderer[] array4 = displayRenderers; foreach (Renderer val4 in array4) { val4.material.SetColor("_EmissiveColor", Color.red); } return; } ReadyingDefib = true; coroutine = ((MonoBehaviour)this).StartCoroutine(ReadyDefib()); } if (base.heldByPlayerOnServer && UsesLimited && !base.isPocketed) { UpdateControlTip(); } } if (!buttonDown) { ReadyingDefib = false; if (base.heldByPlayerOnServer && UsesLimited && !base.isPocketed) { UpdateControlTip(); } } } private IEnumerator ReadyDefib() { timeToHold = 20; base.isBeingUsed = true; while (ReadyingDefib) { yield return (object)new WaitForSeconds(0.05f); if (!base.isHeld || base.isPocketed) { ReadyingDefib = false; Renderer[] array = displayRenderers; foreach (Renderer display2 in array) { display2.material.SetColor("_EmissiveColor", Color.black); } base.isBeingUsed = false; yield break; } if (timeToHold > 0) { timeToHold--; } if (timeToHold > 15) { DisplayOneRenderer.material.SetColor("_EmissiveColor", Color.green); } int num = timeToHold; if (num < 15 && num > 10) { DisplayTwoRenderer.material.SetColor("_EmissiveColor", Color.green); } num = timeToHold; if (num < 10 && num > 5) { DisplayThreeRenderer.material.SetColor("_EmissiveColor", Color.green); } num = timeToHold; if (num < 5 && num > 0) { DisplayFourRenderer.material.SetColor("_EmissiveColor", Color.green); } if (timeToHold != 0 || !ReadyingDefib) { continue; } DisplayFiveRenderer.material.SetColor("_EmissiveColor", Color.green); ChargedAudio.PlayOneShot(ChargedAudio.clip); yield return (object)new WaitUntil((Func)(() => !ReadyingDefib || !base.isHeld || base.isPocketed)); if (RequiresBattery) { if (base.insertedBattery.charge > batteryCost) { base.insertedBattery.charge = base.insertedBattery.charge - batteryCost; } else if (base.insertedBattery.charge < batteryCost) { BatteryDisplayRenderer.material.SetColor("_EmissiveColor", Color.black); base.insertedBattery.empty = true; base.insertedBattery.charge = 0f; base.isBeingUsed = false; } } if (!base.isHeld || base.isPocketed) { ReadyingDefib = false; base.isBeingUsed = false; Renderer[] array2 = displayRenderers; foreach (Renderer display3 in array2) { display3.material.SetColor("_EmissiveColor", Color.black); } yield break; } ReadyingDefib = false; break; } Renderer[] array3 = displayRenderers; foreach (Renderer display in array3) { display.material.SetColor("_EmissiveColor", Color.black); } base.isBeingUsed = false; if (base.isHeld && timeToHold == 0) { FindBody(); } } public void FindBody() { //IL_0011: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Invalid comparison between Unknown and I4 //IL_0185: Unknown result type (might be due to invalid IL or missing references) RaycastHit[] array = Physics.SphereCastAll(((Component)base.playerHeldBy.gameplayCamera).transform.position, 3f, ((Component)base.playerHeldBy.gameplayCamera).transform.forward, 5f, LayerMask.GetMask(new string[1] { "PlayerRagdoll" })); if (array.Length != 0) { ShockHitAudio.PlayOneShot(ShockHitAudio.clip); HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else { ShockAudio.PlayOneShot(ShockAudio.clip); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } DeadBodyInfo val2 = default(DeadBodyInfo); for (int i = 0; i < array.Length; i++) { RaycastHit val = array[i]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } int playerObjectId = val2.playerObjectId; PlayerControllerB val3 = RoundManager.Instance.playersManager.allPlayerScripts[playerObjectId]; Vector3 spawnPosition = ((RaycastHit)(ref val)).transform.position + Vector3.up * 0.25f; if (PermaDeathRule && ((int)val2.causeOfDeath == 17 || val2.detachedHead || (Object)(object)val2.detachedHeadObject != (Object)null)) { MonoBehaviour.print((object)"US - This corpse can't be saved. What a mess."); break; } if (!((Object)(object)val3 != (Object)null) || !val3.isPlayerDead || Object.op_Implicit((Object)(object)val3.currentlyHeldObject)) { continue; } RevivePlayerServerRpc(playerObjectId, spawnPosition); if (((NetworkBehaviour)this).IsHost) { DeadBodyInfo[] array2 = Object.FindObjectsOfType(true); DeadBodyInfo[] array3 = array2; foreach (DeadBodyInfo val4 in array3) { if (val4.playerObjectId != playerObjectId) { continue; } RagdollGrabbableObject[] array4 = Object.FindObjectsOfType(true); RagdollGrabbableObject[] array5 = array4; foreach (RagdollGrabbableObject val5 in array5) { if (val5.ragdoll.playerObjectId == val4.playerObjectId) { Object.Destroy((Object)(object)((Component)((Component)val5).transform).gameObject); } } } } else if (((NetworkBehaviour)this).IsClient) { DestroyBodyServerRpc(playerObjectId); } break; } } [ServerRpc(RequireOwnership = false)] public void DestroyBodyServerRpc(int ID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(803055702u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 803055702u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DeadBodyInfo[] array = Object.FindObjectsOfType(true); DeadBodyInfo[] array2 = array; foreach (DeadBodyInfo val3 in array2) { if (val3.playerObjectId != ID) { continue; } RagdollGrabbableObject[] array3 = Object.FindObjectsOfType(true); RagdollGrabbableObject[] array4 = array3; foreach (RagdollGrabbableObject val4 in array4) { if (val4.ragdoll.playerObjectId == val3.playerObjectId) { Object.Destroy((Object)(object)((Component)((Component)val4).transform).gameObject); } } } } [ServerRpc(RequireOwnership = false)] public void RevivePlayerServerRpc(int ID, Vector3 SpawnPosition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(409997040u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ID); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref SpawnPosition); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 409997040u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RevivePlayerClientRpc(ID, SpawnPosition); } } } [ClientRpc] public void RevivePlayerClientRpc(int ID, Vector3 SpawnPosition) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(106382891u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ID); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref SpawnPosition); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 106382891u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RevivePlayer(ID, SpawnPosition); } } } public void RevivePlayer(int PlayerID, Vector3 SpawnPosition) { //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) if (PlayerID < 0) { MonoBehaviour.print((object)"US - No player inital id? returning.."); return; } PlayerControllerB val = RoundManager.Instance.playersManager.allPlayerScripts[PlayerID]; if (!val.isPlayerDead) { return; } if (base.playerHeldBy.isInsideFactory) { val.isInsideFactory = true; val.isInElevator = false; val.isInHangarShipRoom = false; } else { val.isInsideFactory = false; val.isInElevator = true; val.isInHangarShipRoom = true; } val.ResetPlayerBloodObjects(val.isPlayerDead); val.health = 5; val.isClimbingLadder = false; val.clampLooking = false; val.inVehicleAnimation = false; val.disableMoveInput = false; val.disableLookInput = false; val.disableInteract = false; val.ResetZAndXRotation(); ((Collider)val.thisController).enabled = true; if (val.isPlayerDead) { MonoBehaviour.print((object)"US - Player inital is dead, reviving them!"); ((Collider)val.thisController).enabled = true; val.isPlayerDead = false; val.isPlayerControlled = true; val.health = 5; val.hasBeenCriticallyInjured = false; val.criticallyInjured = false; val.playerBodyAnimator.SetBool("Limp", false); val.TeleportPlayer(SpawnPosition, false, 0f, false, true); val.parentedToElevatorLastFrame = false; val.overrideGameOverSpectatePivot = null; StartOfRound.Instance.SetPlayerObjectExtrapolate(false); val.setPositionOfDeadPlayer = false; val.DisablePlayerModel(((Component)val).gameObject, true, true); ((Behaviour)val.helmetLight).enabled = false; val.Crouch(false); if ((Object)(object)val.playerBodyAnimator != (Object)null) { val.playerBodyAnimator.SetBool("Limp", false); } val.bleedingHeavily = true; val.deadBody = null; val.activatingItem = false; val.twoHanded = false; val.inShockingMinigame = false; val.inSpecialInteractAnimation = false; val.freeRotationInInteractAnimation = false; val.disableSyncInAnimation = false; val.inAnimationWithEnemy = null; val.holdingWalkieTalkie = false; val.speakingToWalkieTalkie = false; val.isSinking = false; val.isUnderwater = false; val.sinkingValue = 0f; ((Behaviour)val.nightVisionRadar).enabled = false; val.statusEffectAudio.Stop(); val.DisableJetpackControlsLocally(); val.mapRadarDotAnimator.SetBool("dead", false); val.hasBegunSpectating = false; val.externalForceAutoFade = Vector3.zero; val.hinderedMultiplier = 1f; val.isMovementHindered = 0; val.sourcesCausingSinking = 0; val.carryWeight = 1f; val.reverbPreset = StartOfRound.Instance.shipReverb; SoundManager.Instance.earsRingingTimer = 0f; val.voiceMuffledByEnemy = false; SoundManager.Instance.playerVoicePitchTargets[PlayerID] = 1f; SoundManager.Instance.SetPlayerPitch(1f, PlayerID); if ((Object)(object)val.currentVoiceChatIngameSettings == (Object)null) { StartOfRound.Instance.RefreshPlayerVoicePlaybackObjects(); } if ((Object)(object)val.currentVoiceChatIngameSettings != (Object)null) { if ((Object)(object)val.currentVoiceChatIngameSettings.voiceAudio == (Object)null) { val.currentVoiceChatIngameSettings.InitializeComponents(); } try { ((Component)val.currentVoiceChatIngameSettings.voiceAudio).GetComponent().overridingLowPass = false; } catch { Debug.LogError((object)("Audio error for player " + ((Object)val).name + ", US.")); } } } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (localPlayerController.playerClientId == val.playerClientId) { localPlayerController.bleedingHeavily = false; localPlayerController.criticallyInjured = false; localPlayerController.health = 5; localPlayerController.hasBegunSpectating = false; HUDManager.Instance.SetCracksOnVisor(100f); HUDManager.Instance.UpdateHealthUI(5, true); localPlayerController.playerBodyAnimator.SetBool("Limp", false); localPlayerController.spectatedPlayerScript = null; StartOfRound.Instance.SetSpectateCameraToGameOverMode(false, localPlayerController); StartOfRound.Instance.SetPlayerObjectExtrapolate(false); ((Behaviour)HUDManager.Instance.audioListenerLowPass).enabled = false; HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", false); HUDManager.Instance.RemoveSpectateUI(); HUDManager.Instance.gameOverAnimator.SetTrigger("revive"); StartOfRound.Instance.SendChangedWeightEvent(); } StartOfRound.Instance.allPlayersDead = false; StartOfRound instance = StartOfRound.Instance; instance.livingPlayers++; if ((Object)(object)HUDManager.Instance != (Object)null) { HUDManager.Instance.UpdateBoxesSpectateUI(); } StartOfRound.Instance.UpdatePlayerVoiceEffects(); if (!UsesLimited || useLimit <= 0) { return; } useLimit--; if (useLimit <= 0) { Renderer[] array = displayRenderers; foreach (Renderer val2 in array) { val2.material.SetColor("_EmissiveColor", Color.red); } } } protected override void __initializeVariables() { if (savedUseLimit == null) { throw new Exception("DefibrillatorScript.savedUseLimit cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)savedUseLimit).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)savedUseLimit, "savedUseLimit"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)savedUseLimit); ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(803055702u, new RpcReceiveHandler(__rpc_handler_803055702), "DestroyBodyServerRpc"); ((NetworkBehaviour)this).__registerRpc(409997040u, new RpcReceiveHandler(__rpc_handler_409997040), "RevivePlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(106382891u, new RpcReceiveHandler(__rpc_handler_106382891), "RevivePlayerClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_803055702(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int iD = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref iD); target.__rpc_exec_stage = (__RpcExecStage)1; ((DefibrillatorScript)(object)target).DestroyBodyServerRpc(iD); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_409997040(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int iD = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref iD); Vector3 spawnPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((DefibrillatorScript)(object)target).RevivePlayerServerRpc(iD, spawnPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_106382891(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int iD = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref iD); Vector3 spawnPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((DefibrillatorScript)(object)target).RevivePlayerClientRpc(iD, spawnPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "DefibrillatorScript"; } } public class FrigidCapsuleScript : GrabbableObject { private ParticleSystem chargingSnowflakeParticles; private ParticleSystem ambientSnowflakeParticles; private ParticleSystem snowstormParticles; private ParticleSystem frostedParticles; private ParticleSystem ambientSnowParticles; private ParticleSystem activeSnowParticles; private Coroutine detectCoroutine = null; private AudioSource[] Sounds; private AudioSource snowstormAudio; private bool chargingSnowflakeParticlesPlaying = false; private bool ambientSnowflakeParticlesPlaying = false; private bool snowstormCoroutineRunning = false; private bool activeSnowParticlesPlaying = false; private bool passiveSnowParticlesPlaying = false; private Light light; private int charge = 0; private bool disabledInShip; internal static UsualScrapConfigs BoundConfig { get; private set; } public void Awake() { BoundConfig = Plugin.BoundConfig; ambientSnowflakeParticles = ((Component)((Component)this).transform.Find("AmbientSnowflakeParticles")).GetComponent(); chargingSnowflakeParticles = ((Component)((Component)this).transform.Find("ActiveSnowflakeParticles")).GetComponent(); snowstormParticles = ((Component)((Component)this).transform.Find("StormParticles")).GetComponent(); frostedParticles = ((Component)((Component)this).transform.Find("FrostedParticles")).GetComponent(); ambientSnowParticles = ((Component)((Component)this).transform.Find("AmbientSnowParticles")).GetComponent(); activeSnowParticles = ((Component)((Component)this).transform.Find("ActiveSnowParticles")).GetComponent(); light = ((Component)((Component)this).transform.Find("Point Light")).GetComponent(); Sounds = ((Component)((Component)this).transform.Find("FrigidCapsuleSounds")).gameObject.GetComponents(); snowstormAudio = Sounds[0]; disabledInShip = BoundConfig.CapsulesDisabledOnTheShip.Value; ambientSnowflakeParticles.Play(); ambientSnowflakeParticlesPlaying = true; ((MonoBehaviour)this).StartCoroutine(Glow()); } private IEnumerator Glow() { float maxintensity = light.intensity * 0.5f; float minintensity = light.intensity * 1.5f; while (true) { if (!((Behaviour)light).enabled) { yield return (object)new WaitUntil((Func)(() => ((Behaviour)light).enabled)); } float t = (MathF.Sin(Time.time * 0.5f) + 1f) / 2f; light.intensity = minintensity + (maxintensity - minintensity) * t; yield return null; } } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); if (!StartOfRound.Instance.inShipPhase && detectCoroutine == null) { ((MonoBehaviour)this).StartCoroutine(Detecting()); } } private IEnumerator Detecting() { while (true) { yield return (object)new WaitForSeconds(1f); if (!ambientSnowflakeParticlesPlaying && !base.isPocketed) { ambientSnowflakeParticles.Play(); ambientSnowflakeParticlesPlaying = true; if (chargingSnowflakeParticlesPlaying) { chargingSnowflakeParticles.Stop(); chargingSnowflakeParticlesPlaying = false; } } else if (base.isPocketed && ambientSnowflakeParticlesPlaying) { ambientSnowflakeParticles.Stop(true, (ParticleSystemStopBehavior)0); ambientSnowflakeParticlesPlaying = false; if (chargingSnowflakeParticlesPlaying) { chargingSnowflakeParticles.Stop(true, (ParticleSystemStopBehavior)0); chargingSnowflakeParticlesPlaying = false; } } if (!passiveSnowParticlesPlaying) { ((MonoBehaviour)this).StartCoroutine(PassiveSnowParticles()); } if (StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded || !TimeOfDay.Instance.currentLevel.planetHasTime) { continue; } if (disabledInShip && base.isInShipRoom) { yield return null; continue; } while (!base.isInFactory && !snowstormCoroutineRunning) { yield return (object)new WaitForSeconds(1f); if (StartOfRound.Instance.inShipPhase || (disabledInShip && base.isInShipRoom)) { charge = 0; break; } charge++; if (base.isPocketed) { if (chargingSnowflakeParticlesPlaying) { chargingSnowflakeParticles.Stop(true, (ParticleSystemStopBehavior)0); chargingSnowflakeParticlesPlaying = false; } if (ambientSnowflakeParticlesPlaying) { ambientSnowflakeParticles.Stop(true, (ParticleSystemStopBehavior)0); ambientSnowflakeParticlesPlaying = false; } } else if (!chargingSnowflakeParticlesPlaying) { if (ambientSnowflakeParticlesPlaying) { ambientSnowflakeParticles.Stop(); ambientSnowflakeParticlesPlaying = false; } chargingSnowflakeParticles.Play(); chargingSnowflakeParticlesPlaying = true; } if (charge >= 45 && !snowstormCoroutineRunning) { SnowstormCoroutineServerRpc(); charge = 0; break; } } } } [ServerRpc(RequireOwnership = false)] public void SnowstormCoroutineServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1202212278u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1202212278u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SnowstormCoroutineClientRpc(); } } } [ClientRpc] public void SnowstormCoroutineClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3740556898u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3740556898u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(Snowstorm()); } } } private IEnumerator Snowstorm() { snowstormCoroutineRunning = true; int stormDuration = 15; int particlespacer = 0; snowstormAudio.Play(); if (!activeSnowParticlesPlaying) { activeSnowParticles.Play(); activeSnowParticlesPlaying = true; } while (stormDuration > 0) { yield return (object)new WaitForSeconds(1f); switch (particlespacer) { case 0: snowstormParticles.Play(); particlespacer++; break; case 1: particlespacer = 0; break; default: particlespacer++; break; } stormDuration--; CheckForPlayerAndCallServerRpc(); } if (activeSnowParticlesPlaying) { activeSnowParticles.Stop(); activeSnowParticlesPlaying = false; } snowstormCoroutineRunning = false; } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if (((Behaviour)light).enabled) { ((Behaviour)light).enabled = false; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (!((Behaviour)light).enabled) { ((Behaviour)light).enabled = true; } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if (!((Behaviour)light).enabled) { ((Behaviour)light).enabled = true; } } private IEnumerator PassiveSnowParticles() { passiveSnowParticlesPlaying = true; int randomSnowParticleDelay = new Random().Next(10, 15); while (!snowstormCoroutineRunning) { yield return (object)new WaitForSeconds(1f); if (!base.isPocketed) { randomSnowParticleDelay--; if (randomSnowParticleDelay <= 0) { ambientSnowParticles.Play(); randomSnowParticleDelay = new Random().Next(10, 15); } } } passiveSnowParticlesPlaying = false; } [ServerRpc(RequireOwnership = false)] public void CheckForPlayerAndCallServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2841949532u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2841949532u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckForPlayerAndCallClientRpc(); } } } [ClientRpc] public void CheckForPlayerAndCallClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2562481381u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2562481381u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckForPlayerAndCall(); } } } public void CheckForPlayerAndCall() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 3f, LayerMask.GetMask(new string[1] { "Player" }), (QueryTriggerInteraction)2); HashSet hashSet = new HashSet(); Collider[] array2 = array; foreach (Collider val in array2) { PlayerControllerB component = ((Component)val).gameObject.GetComponent(); if (!hashSet.Contains(component)) { if ((Object)(object)component == (Object)null || component.isPlayerDead) { break; } int playerID = (int)component.playerClientId; CheckAndApplyFrostStacksServerRpc(playerID); hashSet.Add(component); } } } [ServerRpc(RequireOwnership = false)] public void CheckAndApplyFrostStacksServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2521115770u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2521115770u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckAndApplyFrostStacksClientRpc(playerID); } } } [ClientRpc] public void CheckAndApplyFrostStacksClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(323017126u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 323017126u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CheckAndApplyFrostStacks(playerID); } } } public void CheckAndApplyFrostStacks(int playerID) { PlayerControllerB val = RoundManager.Instance.playersManager.allPlayerScripts[playerID]; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; StackingSlowEffect[] components = ((Component)val).gameObject.GetComponents(); if (components.Length < 5 && (Object)(object)localPlayerController == (Object)(object)val) { StackingSlowEffect stackingSlowEffect = ((Component)val).gameObject.AddComponent(); stackingSlowEffect.frostedParticles = frostedParticles; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1202212278u, new RpcReceiveHandler(__rpc_handler_1202212278), "SnowstormCoroutineServerRpc"); ((NetworkBehaviour)this).__registerRpc(3740556898u, new RpcReceiveHandler(__rpc_handler_3740556898), "SnowstormCoroutineClientRpc"); ((NetworkBehaviour)this).__registerRpc(2841949532u, new RpcReceiveHandler(__rpc_handler_2841949532), "CheckForPlayerAndCallServerRpc"); ((NetworkBehaviour)this).__registerRpc(2562481381u, new RpcReceiveHandler(__rpc_handler_2562481381), "CheckForPlayerAndCallClientRpc"); ((NetworkBehaviour)this).__registerRpc(2521115770u, new RpcReceiveHandler(__rpc_handler_2521115770), "CheckAndApplyFrostStacksServerRpc"); ((NetworkBehaviour)this).__registerRpc(323017126u, new RpcReceiveHandler(__rpc_handler_323017126), "CheckAndApplyFrostStacksClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1202212278(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((FrigidCapsuleScript)(object)target).SnowstormCoroutineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3740556898(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((FrigidCapsuleScript)(object)target).SnowstormCoroutineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2841949532(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((FrigidCapsuleScript)(object)target).CheckForPlayerAndCallServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2562481381(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((FrigidCapsuleScript)(object)target).CheckForPlayerAndCallClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2521115770(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((FrigidCapsuleScript)(object)target).CheckAndApplyFrostStacksServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_323017126(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((FrigidCapsuleScript)(object)target).CheckAndApplyFrostStacksClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "FrigidCapsuleScript"; } } public class FuelCylinderScript : GrabbableObject, IHittable { public NetworkVariable activated = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable defusalActive = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private bool countdownCoroutineRunning = false; private bool pitchcoroutinerunning = false; public NetworkVariable startingTime = new NetworkVariable(0f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable currentTime = new NetworkVariable(0f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable startingEffectTime = new NetworkVariable(140f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable currentEffectTime = new NetworkVariable(140f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private Coroutine countdownCoroutine; private Coroutine pitchCoroutine; private ParticleSystem FireEffect; private ParticleSystem WildFireEffect; private ParticleSystem SmokeEffect; private AudioSource FireSound; public void Awake() { FireEffect = ((Component)((Component)this).transform.Find("FireEffect")).GetComponentInChildren(); WildFireEffect = ((Component)((Component)this).transform.Find("WildFireEffect")).GetComponentInChildren(); SmokeEffect = ((Component)((Component)this).transform.Find("SmokeEffect")).GetComponentInChildren(); AudioSource[] components = ((Component)((Component)this).transform.Find("FuelCylinderSounds")).gameObject.GetComponents(); FireSound = components[0]; } public override void GrabItem() { if (!activated.Value && !base.isInShipRoom && !defusalActive.Value) { int num = new Random().Next(0, 10); if (num != 1) { SmokeEffect.Play(); ToggleStateServerRpc(State: true); } } } public void DropAndShipUpdate() { if (base.isInShipRoom) { return; } DepositItemsDesk val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null && val.itemsOnCounter.Contains((GrabbableObject)(object)this)) { return; } if (activated.Value && currentTime.Value > 20f) { float num = currentTime.Value * 0.6f; num = (float)Math.Floor(num); RestartCountdownServerRpc(num); } else if (activated.Value) { ExplodeServerRpc(); } if (!activated.Value && defusalActive.Value) { int num2 = new Random().Next(0, 6); if (num2 == 1) { SmokeEffect.Play(); ToggleStateServerRpc(State: true); defusalActive.Value = false; } } } [ServerRpc(RequireOwnership = false)] public void RestartCountdownServerRpc(float f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2796347741u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref f, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2796347741u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (countdownCoroutineRunning) { ((MonoBehaviour)this).StopCoroutine(countdownCoroutine); countdownCoroutine = ((MonoBehaviour)this).StartCoroutine(Countdown(State: true, f)); } if (pitchcoroutinerunning) { TogglePitchClientRpc(toggle: false); TogglePitchClientRpc(toggle: true); } } } [ServerRpc(RequireOwnership = false)] public void ToggleStateServerRpc(bool State) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(431760331u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref State, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 431760331u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; activated.Value = State; if (State) { startingTime.Value = Random.Range(120, 160); ToggleEffectsClientRpc(state: true); currentEffectTime.Value = 140f; startingEffectTime.Value = 140f; if (!pitchcoroutinerunning) { TogglePitchClientRpc(toggle: true); pitchcoroutinerunning = true; } if (!countdownCoroutineRunning) { countdownCoroutine = ((MonoBehaviour)this).StartCoroutine(Countdown(State, startingTime.Value)); countdownCoroutineRunning = true; } } else if (!State) { if (countdownCoroutineRunning) { ((MonoBehaviour)this).StopCoroutine(countdownCoroutine); countdownCoroutineRunning = false; } TogglePitchClientRpc(toggle: false); ToggleEffectsClientRpc(state: false); } } private IEnumerator Countdown(bool State, float Timer) { countdownCoroutineRunning = true; currentTime.Value = Timer; while (Timer > 0f) { yield return (object)new WaitForSeconds(1f); DepositItemsDesk companyDesk = Object.FindObjectOfType(); if (base.isInShipRoom || (base.heldByPlayerOnServer && base.playerHeldBy.isInHangarShipRoom) || ((Object)(object)companyDesk != (Object)null && companyDesk.itemsOnCounter.Contains((GrabbableObject)(object)this))) { ToggleStateServerRpc(State: false); defusalActive.Value = true; } Timer -= 1f; currentTime.Value = Timer; } if (Timer <= 0f) { ExplodeServerRpc(); } countdownCoroutineRunning = false; } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); DropAndShipUpdate(); } [ClientRpc] public void ToggleEffectsClientRpc(bool state) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3305488877u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3305488877u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (state) { ActivateEffects(); } else if (!state) { DeactivateEffects(); } } } public async void ActivateEffects() { await Task.Delay(TimeSpan.FromSeconds(0.4000000059604645)); FireEffect.Play(); FireSound.Play(); } public void DeactivateEffects() { FireEffect.Stop(); WildFireEffect.Stop(); FireSound.Stop(); SmokeEffect.Play(); } [ClientRpc] public void TogglePitchClientRpc(bool toggle) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4177066957u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref toggle, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4177066957u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (toggle) { pitchCoroutine = ((MonoBehaviour)this).StartCoroutine(Pitch()); } else if (!toggle && pitchCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(pitchCoroutine); } } } private IEnumerator Pitch() { yield return null; startingEffectTime.Value = 140f; while (currentEffectTime.Value > 3f) { currentEffectTime.Value = currentTime.Value; float e = 1f - currentEffectTime.Value / startingEffectTime.Value; FireSound.pitch = Mathf.Lerp(1f, 1.3f, e); FireSound.volume = Mathf.Lerp(0.2f, 0.4f, e); MainModule fireEffectMain = FireEffect.main; ((MainModule)(ref fireEffectMain)).simulationSpeed = Mathf.Lerp(2f, 4f, e); yield return null; fireEffectMain = default(MainModule); } FireEffect.Stop(); while (true) { float value = currentEffectTime.Value; if (value > 0f && value <= 3f) { currentEffectTime.Value = currentTime.Value; float e2 = 1f - currentEffectTime.Value / startingEffectTime.Value; FireSound.pitch = Mathf.Lerp(1.3f, 1.6f, e2) + Random.Range(-0.05f, 0.05f); FireSound.volume = Mathf.Lerp(0.4f, 0.8f, e2); WildFireEffect.Play(); FireEffect.Stop(); yield return null; continue; } break; } } public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ExplodeServerRpc(); return true; } [ServerRpc(RequireOwnership = false)] public void ExplodeServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3620014731u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3620014731u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(Kaboom()); } } } private IEnumerator Kaboom() { yield return (object)new WaitForSeconds(1f); ExplodeClientRpc(); if (base.heldByPlayerOnServer && (Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } if ((Object)(object)base.radarIcon != (Object)null) { Object.Destroy((Object)(object)((Component)base.radarIcon).gameObject); } Object.Destroy((Object)(object)((Component)this).gameObject); } [ClientRpc] public void ExplodeClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1931107274u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1931107274u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Landmine.SpawnExplosion(((Component)this).transform.position, true, 5.7f, 6.4f, 50, 0f, (GameObject)null, false); } } } protected override void __initializeVariables() { if (activated == null) { throw new Exception("FuelCylinderScript.activated cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)activated).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)activated, "activated"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)activated); if (defusalActive == null) { throw new Exception("FuelCylinderScript.defusalActive cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)defusalActive).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)defusalActive, "defusalActive"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)defusalActive); if (startingTime == null) { throw new Exception("FuelCylinderScript.startingTime cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)startingTime).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)startingTime, "startingTime"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)startingTime); if (currentTime == null) { throw new Exception("FuelCylinderScript.currentTime cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)currentTime).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)currentTime, "currentTime"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)currentTime); if (startingEffectTime == null) { throw new Exception("FuelCylinderScript.startingEffectTime cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)startingEffectTime).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)startingEffectTime, "startingEffectTime"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)startingEffectTime); if (currentEffectTime == null) { throw new Exception("FuelCylinderScript.currentEffectTime cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)currentEffectTime).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)currentEffectTime, "currentEffectTime"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)currentEffectTime); ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2796347741u, new RpcReceiveHandler(__rpc_handler_2796347741), "RestartCountdownServerRpc"); ((NetworkBehaviour)this).__registerRpc(431760331u, new RpcReceiveHandler(__rpc_handler_431760331), "ToggleStateServerRpc"); ((NetworkBehaviour)this).__registerRpc(3305488877u, new RpcReceiveHandler(__rpc_handler_3305488877), "ToggleEffectsClientRpc"); ((NetworkBehaviour)this).__registerRpc(4177066957u, new RpcReceiveHandler(__rpc_handler_4177066957), "TogglePitchClientRpc"); ((NetworkBehaviour)this).__registerRpc(3620014731u, new RpcReceiveHandler(__rpc_handler_3620014731), "ExplodeServerRpc"); ((NetworkBehaviour)this).__registerRpc(1931107274u, new RpcReceiveHandler(__rpc_handler_1931107274), "ExplodeClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_2796347741(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float f = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref f, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((FuelCylinderScript)(object)target).RestartCountdownServerRpc(f); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_431760331(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool state = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref state, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((FuelCylinderScript)(object)target).ToggleStateServerRpc(state); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3305488877(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool state = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref state, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((FuelCylinderScript)(object)target).ToggleEffectsClientRpc(state); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4177066957(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool toggle = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref toggle, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((FuelCylinderScript)(object)target).TogglePitchClientRpc(toggle); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3620014731(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((FuelCylinderScript)(object)target).ExplodeServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1931107274(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((FuelCylinderScript)(object)target).ExplodeClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "FuelCylinderScript"; } } public class GloomyCapsuleScript : GrabbableObject { private ParticleSystem teleportParticles; private ParticleSystem createdTeleportParticles; private ParticleSystem createdPocketedChargingParticles; private ParticleSystem chargingParticles; private bool chargingParticlePlaying = false; private ParticleSystem pocketedChargingParticles; private bool pocketedChargingParticlesPlaying = false; private ParticleSystem chargedParticles; private bool chargedParticlesPlaying = false; private Coroutine detectCoroutine = null; private Random shipTeleporterSeed; private Light light; private bool teleportingCoroutineRunning = false; private int teleportChanceRoll; private int charge = 0; private bool disabledInShip; internal static UsualScrapConfigs BoundConfig { get; private set; } public void Awake() { BoundConfig = Plugin.BoundConfig; teleportParticles = ((Component)((Component)this).transform.Find("TeleportParticles")).GetComponent(); chargingParticles = ((Component)((Component)this).transform.Find("ChargingParticles")).GetComponent(); pocketedChargingParticles = ((Component)((Component)this).transform.Find("PocketedChargingParticles")).GetComponent(); chargedParticles = ((Component)((Component)this).transform.Find("ChargedParticles")).GetComponent(); light = ((Component)((Component)this).transform.Find("Point Light")).GetComponent(); if (!StartOfRound.Instance.inShipPhase) { shipTeleporterSeed = new Random(StartOfRound.Instance.randomMapSeed + 17 + (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } disabledInShip = BoundConfig.CapsulesDisabledOnTheShip.Value; ((MonoBehaviour)this).StartCoroutine(Glow()); } private IEnumerator Glow() { float maxintensity = light.intensity * 1.5f; float minintensity = light.intensity * 0.5f; while (true) { if (!((Behaviour)light).enabled) { yield return (object)new WaitUntil((Func)(() => ((Behaviour)light).enabled)); } float t = (MathF.Sin(Time.time * 0.5f) + 1f) / 2f; light.intensity = minintensity + (maxintensity - minintensity) * t; yield return null; } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if (((Behaviour)light).enabled) { ((Behaviour)light).enabled = false; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (!((Behaviour)light).enabled) { ((Behaviour)light).enabled = true; } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if (!((Behaviour)light).enabled) { ((Behaviour)light).enabled = true; } } private void OnEnable() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((UnityEvent)StartOfRound.Instance.StartNewRoundEvent).AddListener(new UnityAction(SetTeleporterSeed)); } private void SetTeleporterSeed() { shipTeleporterSeed = new Random(StartOfRound.Instance.randomMapSeed + 17 + (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); if (!StartOfRound.Instance.inShipPhase && detectCoroutine == null) { detectCoroutine = ((MonoBehaviour)this).StartCoroutine(Detecting()); } } private IEnumerator Detecting() { while (true) { yield return (object)new WaitForSeconds(1f); if (chargingParticlePlaying) { chargingParticles.Stop(); chargingParticlePlaying = false; } if (StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded || !TimeOfDay.Instance.currentLevel.planetHasTime) { continue; } if (disabledInShip && base.isInShipRoom) { yield return null; continue; } while (((int)TimeOfDay.Instance.dayMode == 3 && !base.isInFactory && !teleportingCoroutineRunning) || ((int)TimeOfDay.Instance.dayMode == 2 && !base.isInFactory && !teleportingCoroutineRunning)) { yield return (object)new WaitForSeconds(1f); if (StartOfRound.Instance.inShipPhase || (disabledInShip && base.isInShipRoom)) { charge = 0; break; } charge++; if (base.isPocketed) { chargingParticles.Stop(true, (ParticleSystemStopBehavior)0); chargingParticlePlaying = false; createdPocketedChargingParticles = Object.Instantiate(pocketedChargingParticles, ((Component)base.playerHeldBy).transform.position, Quaternion.identity, ((Component)base.playerHeldBy).transform); createdPocketedChargingParticles.Play(); } else if (!chargingParticlePlaying) { chargingParticles.Play(); chargingParticlePlaying = true; } if (charge >= 40 && !teleportingCoroutineRunning) { chargingParticles.Stop(); chargingParticlePlaying = false; chargedParticles.Play(); chargedParticlesPlaying = true; teleportingCoroutineRunning = true; ((MonoBehaviour)this).StartCoroutine(WaitToTeleport()); yield return (object)new WaitUntil((Func)(() => !teleportingCoroutineRunning)); chargedParticles.Stop(); chargedParticlesPlaying = false; charge = 0; break; } } } } private IEnumerator WaitToTeleport() { teleportingCoroutineRunning = true; bool playerTeleported = false; while (!playerTeleported) { yield return (object)new WaitForSeconds(1f); if (StartOfRound.Instance.inShipPhase || (disabledInShip && base.isInShipRoom)) { break; } teleportChanceRoll = new Random().Next(1, 6); if (teleportChanceRoll != 1) { continue; } if (base.heldByPlayerOnServer) { if (base.playerHeldBy.isInsideFactory) { createdTeleportParticles = Object.Instantiate(teleportParticles, ((Component)base.playerHeldBy).gameObject.transform.position + new Vector3(0f, 0f, 0f), Quaternion.identity, ((Component)base.playerHeldBy).transform); createdTeleportParticles.Play(); TeleportPlayerServerRpc(indoors: true); break; } if (!base.playerHeldBy.isInsideFactory) { createdTeleportParticles = Object.Instantiate(teleportParticles, ((Component)base.playerHeldBy).gameObject.transform.position + new Vector3(0f, 0f, 0f), Quaternion.identity, ((Component)base.playerHeldBy).transform); createdTeleportParticles.Play(); TeleportPlayerServerRpc(indoors: false); break; } } else { yield return null; } } teleportingCoroutineRunning = false; } [ServerRpc(RequireOwnership = false)] public void TeleportPlayerServerRpc(bool indoors) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(839018670u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref indoors, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 839018670u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TeleportPlayerClientRpc(indoors); } } } [ClientRpc] public void TeleportPlayerClientRpc(bool isIndoors) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(347973268u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isIndoors, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 347973268u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (RoundManager.Instance.insideAINodes.Length != 0 && !isIndoors) { Vector3 position = RoundManager.Instance.insideAINodes[shipTeleporterSeed.Next(0, RoundManager.Instance.insideAINodes.Length)].transform.position; RandomlyTeleportPlayer(position, teleportedIndoors: true); } else if (RoundManager.Instance.outsideAINodes.Length != 0 && isIndoors) { Vector3 position2 = RoundManager.Instance.outsideAINodes[shipTeleporterSeed.Next(0, RoundManager.Instance.outsideAINodes.Length)].transform.position; RandomlyTeleportPlayer(position2, teleportedIndoors: false); } } } public async void RandomlyTeleportPlayer(Vector3 TeleportVector, bool teleportedIndoors) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) int playerID = (int)base.playerHeldBy.playerClientId; PlayerControllerB player = RoundManager.Instance.playersManager.allPlayerScripts[playerID]; await Task.Delay(TimeSpan.FromSeconds(2.0)); if ((Object)(object)player != (Object)null) { player.averageVelocity = 0f; player.velocityLastFrame = Vector3.zero; player.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3)); player.TeleportPlayer(TeleportVector, false, 0f, false, true); if (Object.op_Implicit((Object)(object)Object.FindObjectOfType())) { Object.FindObjectOfType().audioPresets[2].ChangeAudioReverbForPlayer(player); } if (teleportedIndoors) { player.isInsideFactory = true; player.isInHangarShipRoom = false; player.isInElevator = false; } else { player.isInsideFactory = false; player.isInHangarShipRoom = true; player.isInElevator = true; } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(839018670u, new RpcReceiveHandler(__rpc_handler_839018670), "TeleportPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(347973268u, new RpcReceiveHandler(__rpc_handler_347973268), "TeleportPlayerClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_839018670(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool indoors = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref indoors, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GloomyCapsuleScript)(object)target).TeleportPlayerServerRpc(indoors); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_347973268(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool isIndoors = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isIndoors, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GloomyCapsuleScript)(object)target).TeleportPlayerClientRpc(isIndoors); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GloomyCapsuleScript"; } } public class GoldenTicketScript : GrabbableObject { private ParticleSystem idleSparkle; private bool particlePlaying = true; public static Item _giftBoxItem; private GameObject WrappedPresent; private ScanNodeProperties scanNodeProperties; private GiftBoxItem component; private ParticleSystem wrapEffect; private AudioSource[] sounds; private bool worksOnCheapItemsConfig; internal static UsualScrapConfigs BoundConfig { get; private set; } public void Awake() { wrapEffect = ((Component)((Component)this).transform.Find("WrapEffect")).GetComponent(); idleSparkle = ((Component)((Component)this).transform.Find("SparkleEffect")).GetComponent(); BoundConfig = Plugin.BoundConfig; worksOnCheapItemsConfig = BoundConfig.TicketsFunctionOnCheapItems.Value; sounds = ((Component)((Component)this).transform.Find("GoldenTicketSounds")).gameObject.GetComponents(); } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if (particlePlaying) { particlePlaying = false; idleSparkle.Stop(); } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (!particlePlaying) { particlePlaying = true; idleSparkle.Play(); } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if (!particlePlaying) { particlePlaying = true; idleSparkle.Play(); } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown) { CheckForItems(); } } public void CheckForItems() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) bool flag = false; int num = 0; Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 5f, LayerMask.GetMask(new string[1] { "Props" })); Collider[] array2 = array; foreach (Collider val in array2) { if (num == 5) { break; } try { Object gameObject = (Object)(object)((Component)((Component)val).transform).gameObject; NetworkObject val2 = ((Component)((Component)val).transform).gameObject.GetComponent(); Vector3 vector = ((Component)((Component)val).transform).gameObject.transform.position + Vector3.up * 0.5f; GrabbableObject componentInChildren = ((Component)((Component)val).transform).gameObject.GetComponentInChildren(); if (!((Object)(object)((Component)val2).GetComponentInChildren() != (Object)null) && !((Object)(object)((Component)val2).GetComponent() != (Object)null) && !((Object)(object)((Component)val2).GetComponent() != (Object)null) && (worksOnCheapItemsConfig || componentInChildren.scrapValue > 5) && gameObject != (Object)null && (Object)(object)val2 != (Object)null && (Object)(object)base.playerHeldBy != (Object)null && (Object)(object)componentInChildren != (Object)null) { RemoveTargetRadarIconsServerRpc(val2.NetworkObjectId); DespawnItemServerRpc(val2.NetworkObjectId); SpawnGiftBoxServerRpc(vector); flag = true; num++; } } catch (Exception) { } } if (flag) { if (particlePlaying) { particlePlaying = false; idleSparkle.Stop(); } RemoveThisRadarIconsServerRpc(); base.playerHeldBy.DespawnHeldObject(); } } [ServerRpc(RequireOwnership = false)] public void SpawnGiftBoxServerRpc(Vector3 vector) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(445196551u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref vector); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 445196551u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SpawnGiftBox(vector); } } } public void SpawnGiftBox(Vector3 vector) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_002c: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) Item val = PullGiftBox(); WrappedPresent = Object.Instantiate(val.spawnPrefab, vector, Quaternion.identity); GrabbableObject val2 = WrappedPresent.GetComponent(); val2.startFallingPosition = vector; ((MonoBehaviour)this).StartCoroutine(SetObjectToHitGroundSFX((GrabbableObject)(object)component)); val2.targetFloorPosition = val2.GetItemFloorPosition(((Component)val2).transform.position); component = WrappedPresent.GetComponent(); ((NetworkBehaviour)component).NetworkObject.Spawn(false); ((GrabbableObject)component).SetScrapValue(5); wrapEffect = Object.Instantiate(wrapEffect, WrappedPresent.transform.position, Quaternion.identity); wrapEffect.Play(); AudioSource.PlayClipAtPoint(sounds[0].clip, WrappedPresent.transform.position); } public IEnumerator SetObjectToHitGroundSFX(GrabbableObject Item) { yield return (object)new WaitForEndOfFrame(); Item.reachedFloorTarget = false; Item.hasHitGround = false; Item.fallTime = 0f; } public static Item PullGiftBox() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown if ((Object)_giftBoxItem == (Object)null) { _giftBoxItem = StartOfRound.Instance.allItemsList.itemsList.First((Item i) => ((Object)i).name == "GiftBox"); } return _giftBoxItem; } [ServerRpc] public void DespawnItemServerRpc(ulong ID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2069273192u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2069273192u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = ((NetworkBehaviour)this).NetworkManager.SpawnManager.SpawnedObjects[ID]; val3.Despawn(true); } } [ServerRpc] public void RemoveThisRadarIconsServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1650880828u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1650880828u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RemoveThisRadarIconsClientRpc(); } } [ClientRpc] public void RemoveThisRadarIconsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1237844101u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1237844101u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; try { if ((Object)(object)((Component)base.radarIcon).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)base.radarIcon).gameObject); } } catch (Exception arg) { MonoBehaviour.print((object)$"US - {arg} Radar icons already missing. Skipping.."); } } [ServerRpc] public void RemoveTargetRadarIconsServerRpc(ulong ID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(283028086u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 283028086u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RemoveTargetRadarIconsClientRpc(ID); } } [ClientRpc] public void RemoveTargetRadarIconsClientRpc(ulong ID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4177853400u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4177853400u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; try { NetworkObject val3 = ((NetworkBehaviour)this).NetworkManager.SpawnManager.SpawnedObjects[ID]; GrabbableObject componentInParent = ((Component)val3).GetComponentInParent(); if ((Object)(object)((Component)componentInParent.radarIcon).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)componentInParent.radarIcon).gameObject); } } catch (Exception arg) { MonoBehaviour.print((object)$"US - {arg} Radar icons already missing. Skipping.."); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(445196551u, new RpcReceiveHandler(__rpc_handler_445196551), "SpawnGiftBoxServerRpc"); ((NetworkBehaviour)this).__registerRpc(2069273192u, new RpcReceiveHandler(__rpc_handler_2069273192), "DespawnItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(1650880828u, new RpcReceiveHandler(__rpc_handler_1650880828), "RemoveThisRadarIconsServerRpc"); ((NetworkBehaviour)this).__registerRpc(1237844101u, new RpcReceiveHandler(__rpc_handler_1237844101), "RemoveThisRadarIconsClientRpc"); ((NetworkBehaviour)this).__registerRpc(283028086u, new RpcReceiveHandler(__rpc_handler_283028086), "RemoveTargetRadarIconsServerRpc"); ((NetworkBehaviour)this).__registerRpc(4177853400u, new RpcReceiveHandler(__rpc_handler_4177853400), "RemoveTargetRadarIconsClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_445196551(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 vector = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref vector); target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldenTicketScript)(object)target).SpawnGiftBoxServerRpc(vector); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2069273192(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { ulong iD = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref iD); target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldenTicketScript)(object)target).DespawnItemServerRpc(iD); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1650880828(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldenTicketScript)(object)target).RemoveThisRadarIconsServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1237844101(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldenTicketScript)(object)target).RemoveThisRadarIconsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_283028086(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { ulong iD = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref iD); target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldenTicketScript)(object)target).RemoveTargetRadarIconsServerRpc(iD); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4177853400(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong iD = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref iD); target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldenTicketScript)(object)target).RemoveTargetRadarIconsClientRpc(iD); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GoldenTicketScript"; } } public class HandlampScript : GrabbableObject { private Light[] lights; private Light light; private Light pocketLight; private bool lightstate = false; private bool previouslightstate = false; private GameObject Bulb; private AudioSource LightOnSound; private AudioSource LightOffSound; private PlayerControllerB previousPlayerHeldBy; public void Awake() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown Bulb = ((Component)((Component)((Component)this).transform.Find("HandlampModel")).gameObject.transform.Find("Bulb")).gameObject; AudioSource[] components = ((Component)((Component)this).transform.Find("HandlampSounds")).gameObject.GetComponents(); LightOnSound = components[0]; LightOffSound = components[1]; base.insertedBattery = new Battery(false, 1f); lights = ((Component)this).GetComponentsInChildren(); light = lights[1]; } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); previousPlayerHeldBy = base.playerHeldBy; } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); previousPlayerHeldBy = null; if ((Object)(object)pocketLight != (Object)null) { Object.Destroy((Object)(object)((Component)pocketLight).gameObject); } } public void ToggleLights(bool toggle) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) lightstate = toggle; Light[] array = lights; foreach (Light val in array) { ((Behaviour)val).enabled = toggle; } if (toggle) { LightOnSound.PlayOneShot(LightOnSound.clip); Bulb.GetComponent().material.SetColor("_EmissiveColor", Color.white); } if (!toggle) { LightOffSound.PlayOneShot(LightOffSound.clip); Bulb.GetComponent().material.SetColor("_EmissiveColor", Color.black); } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!lightstate && base.insertedBattery.charge > 0f) { ToggleLights(toggle: true); base.isBeingUsed = true; previouslightstate = true; } else if (base.insertedBattery.charge > 0f) { ToggleLights(toggle: false); base.isBeingUsed = false; previouslightstate = false; } } public override void UseUpBatteries() { ((GrabbableObject)this).UseUpBatteries(); ToggleLights(toggle: false); base.isBeingUsed = false; previouslightstate = false; } public override void PocketItem() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).PocketItem(); if (lightstate) { ToggleLights(toggle: false); if ((Object)(object)pocketLight == (Object)null) { pocketLight = Object.Instantiate(light, ((Component)previousPlayerHeldBy.gameplayCamera).transform.position + new Vector3(0f, 1.5f, -1f), Quaternion.identity, ((Component)previousPlayerHeldBy.gameplayCamera).transform); pocketLight.intensity = 40f; ((Behaviour)pocketLight).enabled = true; } else { ((Behaviour)pocketLight).enabled = true; } } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (previouslightstate && !lightstate && base.insertedBattery.charge > 0f) { ToggleLights(toggle: true); if ((Object)(object)pocketLight != (Object)null) { ((Behaviour)pocketLight).enabled = false; } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "HandlampScript"; } } public class MedicalKitScript : GrabbableObject { private int Healthpool = 150; private Coroutine healCoroutine; private Coroutine replenishCoroutine; private ParticleSystem particle; private bool healCoroutineRunning = false; private bool replenishCoroutineRunning = false; private Coroutine tip; private bool tiprunning = false; public void Awake() { particle = ((Component)this).GetComponentInChildren(); } public override void LateUpdate() { ((GrabbableObject)this).LateUpdate(); if (!replenishCoroutineRunning && !healCoroutineRunning && Healthpool < 150) { replenishCoroutine = ((MonoBehaviour)this).StartCoroutine(ReplenishKitRoutine()); } if (base.isHeld && !base.isPocketed && !tiprunning && (replenishCoroutineRunning || healCoroutineRunning)) { tip = ((MonoBehaviour)this).StartCoroutine(UpdateTip()); } } public override void DiscardItem() { if (tiprunning) { ((MonoBehaviour)this).StopCoroutine(tip); tiprunning = false; } StopHealRoutineServerRpc(); if ((Object)(object)HUDManager.Instance != (Object)null) { HUDManager.Instance.ChangeControlTip(1, "", false); HUDManager.Instance.ClearControlTips(); } ((GrabbableObject)this).DiscardItem(); } public override void PocketItem() { if (tiprunning) { ((MonoBehaviour)this).StopCoroutine(tip); tiprunning = false; } if ((Object)(object)HUDManager.Instance != (Object)null) { HUDManager.Instance.ChangeControlTip(1, "", false); HUDManager.Instance.ClearControlTips(); } ((GrabbableObject)this).PocketItem(); } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); if (base.isHeld && !base.isPocketed && !tiprunning) { tip = ((MonoBehaviour)this).StartCoroutine(UpdateTip()); } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (base.isHeld && !base.isPocketed && !tiprunning) { tip = ((MonoBehaviour)this).StartCoroutine(UpdateTip()); } } private IEnumerator UpdateTip() { tiprunning = true; if (base.isHeld) { UpdateControlTip(); } while (base.isHeld && !base.isPocketed && (replenishCoroutineRunning || healCoroutineRunning)) { yield return (object)new WaitForSeconds(0.1f); if (base.isHeld && !base.isPocketed) { UpdateControlTip(); } } tiprunning = false; } public void UpdateControlTip() { string text = $"Remaining Uses - {Healthpool}"; HUDManager.Instance.ChangeControlTip(1, text, false); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if ((Object)(object)base.playerHeldBy == (Object)null) { MonoBehaviour.print((object)"US - Medical Kit playerheldby returned null."); return; } if (buttonDown) { HealServerRpc(); if (base.heldByPlayerOnServer && !base.isPocketed && !tiprunning) { tip = ((MonoBehaviour)this).StartCoroutine(UpdateTip()); } } if (!buttonDown) { StopHealRoutineServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void HealServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1457944474u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1457944474u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RaycastHit val3 = default(RaycastHit); if (Physics.SphereCast(((Component)base.playerHeldBy.gameplayCamera).transform.position, 0.5f, ((Component)base.playerHeldBy.gameplayCamera).transform.forward, ref val3, 3f, LayerMask.GetMask(new string[1] { "Player" })) && (Object)(object)((Component)((RaycastHit)(ref val3)).transform).gameObject.GetComponent() != (Object)(object)base.playerHeldBy) { PlayerControllerB component = ((Component)((RaycastHit)(ref val3)).transform).gameObject.GetComponent(); ulong playerClientId = component.playerClientId; if (playerClientId != base.playerHeldBy.playerClientId) { healCoroutine = ((MonoBehaviour)this).StartCoroutine(HealPlayer((int)playerClientId, 0.1f, otherplayer: true)); } else { healCoroutine = ((MonoBehaviour)this).StartCoroutine(HealPlayer((int)base.playerHeldBy.playerClientId, 0.2f, otherplayer: false)); } } else { healCoroutine = ((MonoBehaviour)this).StartCoroutine(HealPlayer((int)base.playerHeldBy.playerClientId, 0.2f, otherplayer: false)); } } [ServerRpc(RequireOwnership = false)] public void StopHealRoutineServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3322642250u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3322642250u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StopHealRoutineClientRpc(); } } } [ClientRpc] public void StopHealRoutineClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3730725157u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3730725157u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (healCoroutineRunning) { ((MonoBehaviour)this).StopCoroutine(healCoroutine); healCoroutineRunning = false; } } } private IEnumerator HealPlayer(int playerID, float rateOfHealing, bool otherplayer) { healCoroutineRunning = true; PlayerControllerB player = ((!otherplayer) ? base.playerHeldBy : RoundManager.Instance.playersManager.allPlayerScripts[playerID]); while (player.health < 100 && Healthpool > 0 && (Object)(object)base.playerHeldBy == (Object)(object)player && !base.isPocketed) { yield return (object)new WaitForSeconds(rateOfHealing); if (otherplayer) { float num = Vector3.Distance(((Component)player).transform.position, ((Component)base.playerHeldBy).transform.position); if (num > 3f) { break; } } if (otherplayer) { HealClientRpc(playerID, otherplayer: true); } else { HealClientRpc(playerID, otherplayer: false); } SubtractHealpoolClientRpc(); } healCoroutineRunning = false; } [ClientRpc] public void SubtractHealpoolClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1821240513u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1821240513u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Healthpool--; } } } [ClientRpc] public void HealClientRpc(int playerID, bool otherplayer) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3772690673u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref otherplayer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3772690673u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (otherplayer) { Heal(playerID, otherplayer: true); } else { Heal(playerID, otherplayer: false); } } } public void Heal(int playerID, bool otherplayer) { PlayerControllerB val = ((!otherplayer) ? base.playerHeldBy : RoundManager.Instance.playersManager.allPlayerScripts[playerID]); if (!base.isHeld || val.health >= 100 || Healthpool <= 0) { return; } Effects(playerID); val.health++; if (val.health >= 20) { if (val.criticallyInjured) { val.criticallyInjured = false; } if (val.bleedingHeavily) { val.bleedingHeavily = false; } if ((Object)(object)val.playerBodyAnimator != (Object)null) { val.playerBodyAnimator.SetBool("Limp", false); } if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)val) { HUDManager.Instance.UpdateHealthUI(val.health, false); } } } public void Effects(int playerID) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = ((!((Object)(object)RoundManager.Instance.playersManager.allPlayerScripts[playerID] != (Object)(object)base.playerHeldBy)) ? base.playerHeldBy : RoundManager.Instance.playersManager.allPlayerScripts[playerID]); ParticleSystem val2 = Object.Instantiate(particle, ((Component)val).transform.position, Quaternion.identity, ((Component)val).transform); val2.Play(); } private IEnumerator ReplenishKitRoutine() { replenishCoroutineRunning = true; while (Healthpool < 150) { yield return (object)new WaitForSeconds(1.5f); if (healCoroutineRunning) { break; } ReplenishKitServerRpc(); } replenishCoroutineRunning = false; } [ServerRpc(RequireOwnership = false)] public void ReplenishKitServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1380560060u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1380560060u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ReplenishKitClientRpc(); } } } [ClientRpc] public void ReplenishKitClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1621356948u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1621356948u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ReplenishKit(); } } } public void ReplenishKit() { if (StartOfRound.Instance.inShipPhase) { Healthpool = 150; } if (Healthpool < 150) { Healthpool++; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1457944474u, new RpcReceiveHandler(__rpc_handler_1457944474), "HealServerRpc"); ((NetworkBehaviour)this).__registerRpc(3322642250u, new RpcReceiveHandler(__rpc_handler_3322642250), "StopHealRoutineServerRpc"); ((NetworkBehaviour)this).__registerRpc(3730725157u, new RpcReceiveHandler(__rpc_handler_3730725157), "StopHealRoutineClientRpc"); ((NetworkBehaviour)this).__registerRpc(1821240513u, new RpcReceiveHandler(__rpc_handler_1821240513), "SubtractHealpoolClientRpc"); ((NetworkBehaviour)this).__registerRpc(3772690673u, new RpcReceiveHandler(__rpc_handler_3772690673), "HealClientRpc"); ((NetworkBehaviour)this).__registerRpc(1380560060u, new RpcReceiveHandler(__rpc_handler_1380560060), "ReplenishKitServerRpc"); ((NetworkBehaviour)this).__registerRpc(1621356948u, new RpcReceiveHandler(__rpc_handler_1621356948), "ReplenishKitClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1457944474(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MedicalKitScript)(object)target).HealServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3322642250(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MedicalKitScript)(object)target).StopHealRoutineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3730725157(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MedicalKitScript)(object)target).StopHealRoutineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1821240513(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MedicalKitScript)(object)target).SubtractHealpoolClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3772690673(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool otherplayer = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref otherplayer, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MedicalKitScript)(object)target).HealClientRpc(playerID, otherplayer); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1380560060(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MedicalKitScript)(object)target).ReplenishKitServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1621356948(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MedicalKitScript)(object)target).ReplenishKitClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MedicalKitScript"; } } public class PadlockScript : GrabbableObject { private DoorLock viewedDoorLock; private AudioSource lockSound; public void Awake() { AudioSource[] components = ((Component)((Component)this).transform.Find("PadlockSounds")).gameObject.GetComponents(); lockSound = components[0]; } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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) ((GrabbableObject)this).ItemActivate(used, buttonDown); RaycastHit val = default(RaycastHit); if (!Physics.Raycast(new Ray(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward), ref val, 3f, LayerMask.GetMask(new string[1] { "InteractableObject" }))) { return; } viewedDoorLock = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)viewedDoorLock == (Object)null) { TriggerPointToDoor component = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)component != (Object)null) { viewedDoorLock = component.pointToDoor; } } if ((Object)(object)viewedDoorLock != (Object)null && !viewedDoorLock.isLocked) { MonoBehaviour.print((object)"US - US_Padlock locking door!"); UsePadlockServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void UsePadlockServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2862679596u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2862679596u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UsePadlockClientRpc(); } } } [ClientRpc] public void UsePadlockClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4258470499u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4258470499u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UsePadlock(); } } } public void UsePadlock() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //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_00ca: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (!Physics.Raycast(new Ray(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward), ref val, 3f, LayerMask.GetMask(new string[1] { "InteractableObject" }))) { return; } viewedDoorLock = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)viewedDoorLock == (Object)null) { TriggerPointToDoor component = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)component != (Object)null) { viewedDoorLock = component.pointToDoor; } } viewedDoorLock.LockDoor(30f); AudioSource.PlayClipAtPoint(lockSound.clip, ((Component)viewedDoorLock).transform.position); if ((Object)(object)base.radarIcon != (Object)null) { Object.Destroy((Object)(object)((Component)base.radarIcon).gameObject); } base.playerHeldBy.DespawnHeldObject(); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2862679596u, new RpcReceiveHandler(__rpc_handler_2862679596), "UsePadlockServerRpc"); ((NetworkBehaviour)this).__registerRpc(4258470499u, new RpcReceiveHandler(__rpc_handler_4258470499), "UsePadlockClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_2862679596(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((PadlockScript)(object)target).UsePadlockServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4258470499(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((PadlockScript)(object)target).UsePadlockClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PadlockScript"; } } public class ProductivityAutoinjectorScript : GrabbableObject { private AudioSource audioSource; private MeshRenderer InjectorDisplay; public NetworkVariable usedUp = new NetworkVariable(2, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public void Awake() { GameObject gameObject = ((Component)((Component)this).transform.Find("InjectSound")).gameObject; audioSource = gameObject.GetComponent(); GameObject gameObject2 = ((Component)((Component)((Component)this).transform.Find("ProductivityAutoinjectorModel")).gameObject.transform.Find("InjectorDisplay")).gameObject; InjectorDisplay = gameObject2.GetComponent(); } public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); return usedUp.Value; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); usedUp.Value = saveData; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (base.itemUsedUp) { UseUpInjectorServerRpc(Used: true); } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown && !base.itemUsedUp && !((Object)(object)((Component)base.playerHeldBy).gameObject.GetComponent() != (Object)null)) { ((Component)base.playerHeldBy).gameObject.AddComponent(); UseUpInjectorServerRpc(Used: true); } } [ServerRpc(RequireOwnership = false)] public void UseUpInjectorServerRpc(bool Used) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2909117143u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Used, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2909117143u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UseUpInjectorClientRpc(Used); } } } [ClientRpc] public void UseUpInjectorClientRpc(bool Used) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(459030011u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Used, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 459030011u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.itemUsedUp = true; ((Renderer)InjectorDisplay).material.SetColor("_EmissiveColor", Color.red); AudioSource.PlayClipAtPoint(audioSource.clip, ((Component)base.playerHeldBy).transform.position); } } } protected override void __initializeVariables() { if (usedUp == null) { throw new Exception("ProductivityAutoinjectorScript.usedUp cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)usedUp).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)usedUp, "usedUp"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)usedUp); ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2909117143u, new RpcReceiveHandler(__rpc_handler_2909117143), "UseUpInjectorServerRpc"); ((NetworkBehaviour)this).__registerRpc(459030011u, new RpcReceiveHandler(__rpc_handler_459030011), "UseUpInjectorClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_2909117143(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool used = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref used, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ProductivityAutoinjectorScript)(object)target).UseUpInjectorServerRpc(used); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_459030011(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool used = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref used, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ProductivityAutoinjectorScript)(object)target).UseUpInjectorClientRpc(used); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ProductivityAutoinjectorScript"; } } public class RadioactiveCellScript : GrabbableObject { private Light light; private ParticleSystem particle; private GameObject core; private bool coroutinerunning = false; private Coroutine coroutine; private int damageRamp; private Color setColor; private AudioSource burnSound; public void Awake() { light = ((Component)this).GetComponentInChildren(); particle = ((Component)this).GetComponentInChildren(); AudioSource[] components = ((Component)((Component)this).transform.Find("RadioactiveCellSounds")).gameObject.GetComponents(); burnSound = components[0]; core = ((Component)((Component)((Component)this).transform.Find("RadioactiveCellModel")).gameObject.transform.Find("Core")).gameObject; } public override void Start() { ((GrabbableObject)this).Start(); SetColorServerRpc(); } [ServerRpc(RequireOwnership = false)] public void SetColorServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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_0109: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(649887750u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 649887750u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; byte b = (byte)new Random().Next(1, 160); byte b2 = (byte)new Random().Next(1, 180); setColor = Color32.op_Implicit(new Color32(b, byte.MaxValue, b2, byte.MaxValue)); SetColorClientRpc(setColor); } } } [ClientRpc] public void SetColorClientRpc(Color color) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3127999173u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref color); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3127999173u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Material material = ((Renderer)core.GetComponent()).material; material.color = color; material.SetColor("_EmissionColor", color); light.color = color; } } } public void ToggleLights(bool toggle) { ((Behaviour)light).enabled = toggle; } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); ToggleLights(toggle: false); particle.Stop(); particle.Clear(); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if (coroutinerunning) { ((MonoBehaviour)this).StopCoroutine(coroutine); coroutinerunning = false; } ToggleLights(toggle: true); particle.Play(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); ToggleLights(toggle: true); particle.Play(); } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); if (!coroutinerunning) { coroutine = ((MonoBehaviour)this).StartCoroutine(DamageHolder()); } } private IEnumerator DamageHolder() { coroutinerunning = true; damageRamp = 5; yield return (object)new WaitForSeconds(2.5f); base.playerHeldBy.DamagePlayer(damageRamp, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); burnSound.pitch = Random.Range(1f, 1.2f); burnSound.Play(); while ((Object)(object)base.playerHeldBy != (Object)null) { yield return (object)new WaitForSeconds(5f); if ((Object)(object)base.playerHeldBy == (Object)null) { yield break; } base.playerHeldBy.DamagePlayer(damageRamp, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); damageRamp += 5; burnSound.pitch = Random.Range(0.8f, 1f); burnSound.Play(); } coroutinerunning = false; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(649887750u, new RpcReceiveHandler(__rpc_handler_649887750), "SetColorServerRpc"); ((NetworkBehaviour)this).__registerRpc(3127999173u, new RpcReceiveHandler(__rpc_handler_3127999173), "SetColorClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_649887750(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((RadioactiveCellScript)(object)target).SetColorServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3127999173(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Color colorClientRpc = default(Color); ((FastBufferReader)(ref reader)).ReadValueSafe(ref colorClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((RadioactiveCellScript)(object)target).SetColorClientRpc(colorClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RadioactiveCellScript"; } } public class RoseScript : GrabbableObject { private PlayerControllerB player; public override void EquipItem() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).EquipItem(); player = base.playerHeldBy; player.DamagePlayer(5, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } public override void PocketItem() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).PocketItem(); player.DamagePlayer(5, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); player = null; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "RoseScript"; } } public class ShiftControllerScript : GrabbableObject { private bool teleportSetIndoors; private Vector3 savedLocation; private GameObject startScreen; private GameObject shiftScreen; private GameObject glitchScreen; private GameObject cScreenPoor; private GameObject cScreenAverage; private GameObject cScreenGreat; private AudioSource setCoordAudio; private AudioSource teleportAudio; private AudioSource glitchAudio; private AudioSource buttonAudio; private bool itemGlitching = false; private bool itemTeleporting = false; private float teleportBatteryCost; private int Stage = 0; private Light light; private ParticleSystem particle; private bool sparksPlaying = true; private int GreatRange; private int PoorRange; internal static UsualScrapConfigs BoundConfig { get; private set; } public void Awake() { //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown BoundConfig = Plugin.BoundConfig; AudioSource[] components = ((Component)((Component)this).transform.Find("ShiftControllerSounds")).gameObject.GetComponents(); setCoordAudio = components[0]; teleportAudio = components[1]; glitchAudio = components[2]; buttonAudio = components[3]; startScreen = ((Component)((Component)((Component)this).transform.Find("ShiftControllerModel")).gameObject.transform.Find("StartScreen")).gameObject; shiftScreen = ((Component)((Component)((Component)this).transform.Find("ShiftControllerModel")).gameObject.transform.Find("TeleportScreen")).gameObject; glitchScreen = ((Component)((Component)((Component)this).transform.Find("ShiftControllerModel")).gameObject.transform.Find("GlitchScreen")).gameObject; cScreenPoor = ((Component)((Component)((Component)this).transform.Find("ShiftControllerModel")).gameObject.transform.Find("CScreenPoor")).gameObject; cScreenAverage = ((Component)((Component)((Component)this).transform.Find("ShiftControllerModel")).gameObject.transform.Find("CScreenAverage")).gameObject; cScreenGreat = ((Component)((Component)((Component)this).transform.Find("ShiftControllerModel")).gameObject.transform.Find("CScreenGreat")).gameObject; base.insertedBattery = new Battery(false, 1f); teleportBatteryCost = base.insertedBattery.charge / 5f; GreatRange = BoundConfig.ShiftControllerGreatRange.Value; PoorRange = BoundConfig.ShiftControllerPoorRange.Value; if (GreatRange >= PoorRange - 5 || PoorRange <= GreatRange + 5) { MonoBehaviour.print((object)"US - The Shift Controller's great/first connection range cannot be too close, higher than, or equal to the poor/last connection range! setting value to default."); MonoBehaviour.print((object)"US - The Shift Controller's poor/last connection range cannot be too close to, lower than, or equal to the great/first connection range! setting value to default."); GreatRange = 50; PoorRange = 175; } light = ((Component)this).GetComponentInChildren(); particle = ((Component)this).GetComponentInChildren(); } public override void ChargeBatteries() { if ((Object)(object)base.playerHeldBy != (Object)null && !itemGlitching) { GlitchServerRpc(3); base.insertedBattery.empty = false; base.insertedBattery.charge = 1f; if (!sparksPlaying) { ((Behaviour)light).enabled = true; particle.Play(); sparksPlaying = true; } } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if (sparksPlaying) { ((Behaviour)light).enabled = false; particle.Stop(); sparksPlaying = false; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (!sparksPlaying && base.insertedBattery.charge > 0f) { ((Behaviour)light).enabled = true; particle.Play(); sparksPlaying = true; } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if (!sparksPlaying && base.insertedBattery.charge > 0f) { ((Behaviour)light).enabled = true; particle.Play(); sparksPlaying = true; } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown && !itemGlitching && !itemTeleporting) { if (Stage == 0) { SetStageServerRpc(1); } else if (Stage == 1) { SetStageServerRpc(2); } } } [ServerRpc(RequireOwnership = false)] public void ToggleCoroutineServerRpc(bool toggle) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(917582628u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref toggle, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 917582628u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleCoroutine(toggle); } } } public void ToggleCoroutine(bool toggle) { if (toggle) { ((MonoBehaviour)this).StartCoroutine(CheckDistance()); } else if (!toggle) { ((MonoBehaviour)this).StopAllCoroutines(); } } [ServerRpc(RequireOwnership = false)] public void SetStageServerRpc(int stage) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1373662317u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, stage); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1373662317u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetStageClientRpc(stage); } } } [ClientRpc] public void SetStageClientRpc(int stage) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2153902911u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, stage); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2153902911u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetStage(stage); } } } public async void SetStage(int setStage) { if ((StartOfRound.Instance.inShipPhase && !base.insertedBattery.empty && !itemGlitching) || (!StartOfRound.Instance.shipHasLanded && !base.insertedBattery.empty && !itemGlitching)) { GlitchServerRpc(3); MonoBehaviour.print((object)" US - WE ARE LEAVING OR IN ORBIT, CONTROLLER DISABLED!"); } else if (setStage == 1 && !base.insertedBattery.empty && !itemGlitching) { buttonAudio.PlayOneShot(buttonAudio.clip); await Task.Delay(TimeSpan.FromSeconds(0.20000000298023224)); Stage = 1; SwitchScreenServerRpc("Start"); setCoordAudio.PlayOneShot(setCoordAudio.clip); base.isBeingUsed = true; savedLocation = ((Component)base.playerHeldBy).transform.position; if (base.playerHeldBy.isInsideFactory) { teleportSetIndoors = true; } else { teleportSetIndoors = false; } ToggleCoroutineServerRpc(toggle: true); } else if (setStage == 2 && !base.insertedBattery.empty && !itemGlitching) { buttonAudio.PlayOneShot(buttonAudio.clip); Stage = 0; SwitchScreenServerRpc("Shift"); TeleportDelay(); } } public async void TeleportDelay() { itemTeleporting = true; ToggleCoroutineServerRpc(toggle: false); await Task.Delay(TimeSpan.FromSeconds(1.0)); if (base.heldByPlayerOnServer) { base.isBeingUsed = false; teleportAudio.PlayOneShot(teleportAudio.clip); if (teleportSetIndoors) { Stage = 0; TeleportServerRpc("Indoors", savedLocation); MonoBehaviour.print((object)"US - Shift Controller teleporting indoors!"); } else { Stage = 0; TeleportServerRpc("Outdoors", savedLocation); MonoBehaviour.print((object)"US - Shift Controller teleporting outdoors!"); } if (base.insertedBattery.charge > teleportBatteryCost) { base.insertedBattery.charge = base.insertedBattery.charge - teleportBatteryCost; } else if (base.insertedBattery.charge < teleportBatteryCost) { base.isBeingUsed = false; base.insertedBattery.empty = true; base.insertedBattery.charge = 0f; ToggleCoroutineServerRpc(toggle: false); SwitchScreenServerRpc("Off"); ((Behaviour)light).enabled = false; particle.Stop(); sparksPlaying = false; Stage = 0; } if (base.insertedBattery.charge > 0f) { SwitchScreenServerRpc("Start"); } } else { GlitchServerRpc(6); } itemTeleporting = false; } [ServerRpc(RequireOwnership = false)] public void GlitchServerRpc(int duration) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(391308571u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, duration); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 391308571u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleCoroutine(toggle: false); GlitchClientRpc(duration); } } } [ClientRpc] public void GlitchClientRpc(int duration) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1722557415u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, duration); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1722557415u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Glitch(duration); } } } public async void Glitch(int duration) { itemGlitching = true; base.isBeingUsed = false; Stage = 0; SwitchScreenServerRpc("Glitch"); glitchAudio.Play(); await Task.Delay(TimeSpan.FromSeconds(duration)); SwitchScreenServerRpc("Start"); glitchAudio.Stop(); itemGlitching = false; } [ServerRpc(RequireOwnership = false)] public void SwitchScreenServerRpc(string Screen) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3522520608u, val, (RpcDelivery)0); bool flag = Screen != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Screen, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3522520608u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SwitchScreenClientRpc(Screen); } } [ClientRpc] public void SwitchScreenClientRpc(string Screen) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3045810712u, val, (RpcDelivery)0); bool flag = Screen != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Screen, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3045810712u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SwitchScreen(Screen); } } private IEnumerator CheckDistance() { SwitchScreenServerRpc("Great"); int glitchChance = 0; int averageGlitchCuchion = 10; while (!itemGlitching && Stage == 1) { yield return (object)new WaitForSeconds(1f); if (!base.heldByPlayerOnServer) { yield return (object)new WaitUntil((Func)(() => base.heldByPlayerOnServer)); } float distance = Vector3.Distance(((Component)base.playerHeldBy).transform.position, savedLocation); if (distance <= (float)GreatRange) { SwitchScreenServerRpc("Great"); glitchChance = 0; } else if (distance > (float)GreatRange && distance < (float)PoorRange) { SwitchScreenServerRpc("Average"); glitchChance = 0; } else if (distance >= (float)PoorRange) { SwitchScreenServerRpc("Poor"); glitchChance = 25; } if (glitchChance == 25) { if (averageGlitchCuchion > 0) { averageGlitchCuchion--; } if (averageGlitchCuchion <= 0) { int diceRoll = new Random().Next(0, 5); if (diceRoll == 1) { GlitchServerRpc(6); averageGlitchCuchion = 10; } } } glitchChance = 0; } } public void SwitchScreen(string Screen) { switch (Screen) { case "Off": glitchScreen.SetActive(false); startScreen.SetActive(false); shiftScreen.SetActive(false); cScreenPoor.SetActive(false); cScreenAverage.SetActive(false); cScreenGreat.SetActive(false); break; case "Start": glitchScreen.SetActive(false); startScreen.SetActive(true); shiftScreen.SetActive(false); cScreenPoor.SetActive(false); cScreenAverage.SetActive(false); cScreenGreat.SetActive(false); break; case "Shift": glitchScreen.SetActive(false); startScreen.SetActive(false); shiftScreen.SetActive(true); cScreenPoor.SetActive(false); cScreenAverage.SetActive(false); cScreenGreat.SetActive(false); break; case "Poor": glitchScreen.SetActive(false); startScreen.SetActive(false); shiftScreen.SetActive(false); cScreenPoor.SetActive(true); cScreenAverage.SetActive(false); cScreenGreat.SetActive(false); break; case "Average": glitchScreen.SetActive(false); startScreen.SetActive(false); shiftScreen.SetActive(false); cScreenPoor.SetActive(false); cScreenAverage.SetActive(true); cScreenGreat.SetActive(false); break; case "Great": glitchScreen.SetActive(false); startScreen.SetActive(false); shiftScreen.SetActive(false); cScreenPoor.SetActive(false); cScreenAverage.SetActive(false); cScreenGreat.SetActive(true); break; case "Glitch": glitchScreen.SetActive(true); startScreen.SetActive(false); shiftScreen.SetActive(false); cScreenPoor.SetActive(false); cScreenAverage.SetActive(false); cScreenGreat.SetActive(false); break; } } [ServerRpc(RequireOwnership = false)] public void TeleportServerRpc(string Area, Vector3 Location) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1162398535u, val, (RpcDelivery)0); bool flag = Area != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Area, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Location); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1162398535u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (Area == null) { MonoBehaviour.print((object)"US - Shift Controller Teleport location returned null. Resetting.."); } else if (((NetworkBehaviour)this).IsOwner) { Teleport(Area, Location); } else { TeleportClientRpc(Area, Location); } } } [ClientRpc] public void TeleportClientRpc(string Area, Vector3 Location) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_00c7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1191106644u, val, (RpcDelivery)0); bool flag = Area != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Area, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Location); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1191106644u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Teleport(Area, Location); } } public void Teleport(string Area, Vector3 Location) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if (Area == "Indoors" && (Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.TeleportPlayer(Location, false, 0f, false, true); base.playerHeldBy.averageVelocity = 0f; base.playerHeldBy.velocityLastFrame = Vector3.zero; base.playerHeldBy.isInElevator = false; base.playerHeldBy.isInHangarShipRoom = false; base.playerHeldBy.isInsideFactory = true; } else if (Area == "Outdoors" && (Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.TeleportPlayer(Location, false, 0f, false, true); base.playerHeldBy.averageVelocity = 0f; base.playerHeldBy.velocityLastFrame = Vector3.zero; base.playerHeldBy.isInElevator = true; base.playerHeldBy.isInHangarShipRoom = true; base.playerHeldBy.isInsideFactory = false; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(917582628u, new RpcReceiveHandler(__rpc_handler_917582628), "ToggleCoroutineServerRpc"); ((NetworkBehaviour)this).__registerRpc(1373662317u, new RpcReceiveHandler(__rpc_handler_1373662317), "SetStageServerRpc"); ((NetworkBehaviour)this).__registerRpc(2153902911u, new RpcReceiveHandler(__rpc_handler_2153902911), "SetStageClientRpc"); ((NetworkBehaviour)this).__registerRpc(391308571u, new RpcReceiveHandler(__rpc_handler_391308571), "GlitchServerRpc"); ((NetworkBehaviour)this).__registerRpc(1722557415u, new RpcReceiveHandler(__rpc_handler_1722557415), "GlitchClientRpc"); ((NetworkBehaviour)this).__registerRpc(3522520608u, new RpcReceiveHandler(__rpc_handler_3522520608), "SwitchScreenServerRpc"); ((NetworkBehaviour)this).__registerRpc(3045810712u, new RpcReceiveHandler(__rpc_handler_3045810712), "SwitchScreenClientRpc"); ((NetworkBehaviour)this).__registerRpc(1162398535u, new RpcReceiveHandler(__rpc_handler_1162398535), "TeleportServerRpc"); ((NetworkBehaviour)this).__registerRpc(1191106644u, new RpcReceiveHandler(__rpc_handler_1191106644), "TeleportClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_917582628(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool toggle = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref toggle, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ShiftControllerScript)(object)target).ToggleCoroutineServerRpc(toggle); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1373662317(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int stageServerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref stageServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((ShiftControllerScript)(object)target).SetStageServerRpc(stageServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2153902911(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int stageClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref stageClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((ShiftControllerScript)(object)target).SetStageClientRpc(stageClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_391308571(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int duration = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref duration); target.__rpc_exec_stage = (__RpcExecStage)1; ((ShiftControllerScript)(object)target).GlitchServerRpc(duration); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1722557415(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int duration = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref duration); target.__rpc_exec_stage = (__RpcExecStage)1; ((ShiftControllerScript)(object)target).GlitchClientRpc(duration); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3522520608(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string screen = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref screen, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((ShiftControllerScript)(object)target).SwitchScreenServerRpc(screen); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3045810712(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string screen = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref screen, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((ShiftControllerScript)(object)target).SwitchScreenClientRpc(screen); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1162398535(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_008c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string area = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref area, false); } Vector3 location = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref location); target.__rpc_exec_stage = (__RpcExecStage)1; ((ShiftControllerScript)(object)target).TeleportServerRpc(area, location); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1191106644(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_008c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string area = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref area, false); } Vector3 location = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref location); target.__rpc_exec_stage = (__RpcExecStage)1; ((ShiftControllerScript)(object)target).TeleportClientRpc(area, location); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ShiftControllerScript"; } } public class NoiseMakerScript : GrabbableObject { private AudioSource[] sources; private AudioClip clip; public void Awake() { base.useCooldown = 2f; sources = ((Component)this).GetComponentsInChildren(); AudioSource[] array = sources; foreach (AudioSource val in array) { if ((Object)(object)val.clip != (Object)null) { clip = val.clip; } } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); ((Component)this).GetComponent().pitch = Random.Range(0.75f, 1.1f); ((Component)this).GetComponent().PlayOneShot(clip); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 16f, 0.9f, 0, false, 0); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "NoiseMakerScript"; } } public class RandomModelBNWScript : PhysicsProp { public bool changeColor; private List transformList = new List(); private List gameObjects = new List(); public void Awake() { //IL_0123: Unknown result type (might be due to invalid IL or missing references) Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren(); foreach (Transform val in componentsInChildren) { if (((Object)val).name.Contains("Body")) { transformList.Add(val); } } foreach (Transform transform in transformList) { gameObjects.Add(((Component)transform).gameObject); } int num = Random.Range(0, gameObjects.Count); int num2 = 0; int num3 = Random.Range(1, 3); foreach (GameObject gameObject in gameObjects) { if ((Object)(object)gameObject.GetComponent() != (Object)null) { if (num2 == num) { gameObject.SetActive(true); } else { gameObject.SetActive(false); } if (num3 == 1 && changeColor) { ((Renderer)gameObject.GetComponent()).material.color = Color.white; } } num2++; } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((PhysicsProp)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "RandomModelBNWScript"; } } public class SizableScissorsScript : GrabbableObject { private Coroutine coroutine; private PlayerControllerB previousPlayerHeldBy; private RaycastHit[] objectsHitByMeleeWeapon; private List objectsHitByMeleeWeaponList = new List(); private AudioSource scissorAudio; private AudioClip swing; private AudioClip Hit; private AudioClip snip; public int meleeWeaponHitForce = 2; private bool isHoldingButton; private bool reelingUp; private Coroutine reelingUpCoroutine; public int meleeWeaponMask = 1084754248; public void Awake() { scissorAudio = ((Component)((Component)this).transform.Find("ScissorsSounds")).gameObject.GetComponent(); AudioSource[] components = ((Component)((Component)this).transform.Find("ScissorsSounds")).gameObject.GetComponents(); snip = components[0].clip; Hit = components[1].clip; swing = components[2].clip; } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); coroutine = ((MonoBehaviour)this).StartCoroutine(WaitForRoll()); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); ((MonoBehaviour)this).StopCoroutine(coroutine); if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.activatingItem = false; } } private IEnumerator WaitForRoll() { while (true) { if (base.playerHeldBy.isSprinting) { RollForDamage(); } yield return (object)new WaitForSeconds(1f); } } public async void RollForDamage() { int damageroll = new Random().Next(1, 5); if (damageroll == 1) { await Task.Delay(TimeSpan.FromSeconds(0.2)); if (base.isHeld) { PlaySound(); base.playerHeldBy.DamagePlayer(15, true, true, (CauseOfDeath)17, 7, false, default(Vector3)); } await Task.Delay(TimeSpan.FromSeconds(0.2)); if (base.isHeld) { PlaySound(); base.playerHeldBy.DamagePlayer(15, true, true, (CauseOfDeath)17, 7, false, default(Vector3)); } } } public void PlaySound() { scissorAudio.pitch = Random.Range(0.8f, 1f); scissorAudio.PlayOneShot(snip); } public override void ItemActivate(bool used, bool buttonDown = true) { if ((Object)(object)base.playerHeldBy == (Object)null) { return; } isHoldingButton = buttonDown; if (!reelingUp && !reelingUp && buttonDown) { reelingUp = true; previousPlayerHeldBy = base.playerHeldBy; if (reelingUpCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine); } reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpMeleeWeapon()); } } private IEnumerator reelUpMeleeWeapon() { base.playerHeldBy.activatingItem = true; base.playerHeldBy.twoHanded = true; base.playerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit"); base.playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); yield return (object)new WaitForSeconds(0.35f); yield return (object)new WaitUntil((Func)(() => !isHoldingButton || !base.isHeld)); SwingMeleeWeapon(!base.isHeld); yield return (object)new WaitForSeconds(0.13f); yield return (object)new WaitForEndOfFrame(); HitMeleeWeapon(!base.isHeld); yield return (object)new WaitForSeconds(0.3f); reelingUp = false; reelingUpCoroutine = null; } public void SwingMeleeWeapon(bool cancel = false) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); if (!cancel) { scissorAudio.PlayOneShot(swing); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public void HitMeleeWeapon(bool cancel = false) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_040c: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_0204: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: 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_0257: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)previousPlayerHeldBy == (Object)null) { return; } previousPlayerHeldBy.activatingItem = false; bool flag = false; bool flag2 = false; bool flag3 = false; int num = -1; if (!cancel) { objectsHitByMeleeWeapon = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.8f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.5f, meleeWeaponMask, (QueryTriggerInteraction)2); objectsHitByMeleeWeaponList = objectsHitByMeleeWeapon.OrderBy(delegate(RaycastHit x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) RaycastHit val4 = x; return ((RaycastHit)(ref val4)).distance; }).ToList(); List list = new List(); IHittable val2 = default(IHittable); RaycastHit val3 = default(RaycastHit); for (int i = 0; i < objectsHitByMeleeWeaponList.Count; i++) { RaycastHit val = objectsHitByMeleeWeaponList[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByMeleeWeaponList[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByMeleeWeaponList[i]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = objectsHitByMeleeWeaponList[i]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByMeleeWeaponList[i]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; val = objectsHitByMeleeWeaponList[i]; if (Physics.Linecast(position, ((RaycastHit)(ref val)).point, ref val3, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { continue; } } flag = true; Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward; try { val = objectsHitByMeleeWeaponList[i]; EnemyAICollisionDetect component = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)component != (Object)null) { if ((Object)(object)component.mainScript == (Object)null || list.Contains(component.mainScript)) { continue; } goto IL_035d; } val = objectsHitByMeleeWeaponList[i]; if (!((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent() != (Object)null)) { goto IL_035d; } if (flag3) { continue; } flag3 = true; goto IL_035d; IL_035d: bool flag4 = val2.Hit(meleeWeaponHitForce, forward, previousPlayerHeldBy, true, 1); if (flag4 && (Object)(object)component != (Object)null) { list.Add(component.mainScript); } if (!flag2) { flag2 = flag4; } } catch (Exception arg) { MonoBehaviour.print((object)$"Error hitting object with scissors {arg}, caused by playerInital: {previousPlayerHeldBy.playerClientId}"); } continue; } } val = objectsHitByMeleeWeaponList[i]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; val = objectsHitByMeleeWeaponList[i]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++) { if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag) { num = j; scissorAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX); break; } } } } if (flag) { Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); if (num != -1) { scissorAudio.PlayOneShot(Hit); WalkieTalkie.TransmitOneShotAudio(scissorAudio, Hit, 1f); } base.playerHeldBy.playerBodyAnimator.SetTrigger("shovelHit"); HitMeleeWeaponServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void HitMeleeWeaponServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1406364424u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1406364424u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitMeleeWeaponClientRpc(); } } } [ClientRpc] public void HitMeleeWeaponClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(66967687u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 66967687u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitSurfaceWithMeleeWeapon(); } } } private void HitSurfaceWithMeleeWeapon() { if (!((NetworkBehaviour)this).IsOwner) { scissorAudio.PlayOneShot(Hit); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1406364424u, new RpcReceiveHandler(__rpc_handler_1406364424), "HitMeleeWeaponServerRpc"); ((NetworkBehaviour)this).__registerRpc(66967687u, new RpcReceiveHandler(__rpc_handler_66967687), "HitMeleeWeaponClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1406364424(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((SizableScissorsScript)(object)target).HitMeleeWeaponServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_66967687(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((SizableScissorsScript)(object)target).HitMeleeWeaponClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "SizableScissorsScript"; } } public class TicketScript : GrabbableObject { public static Item _giftBoxItem; private Object viewedGameObject; private GameObject WrappedPresent; private NetworkObject viewedNetworkObject; private GrabbableObject viewedGrabbableObject; private GiftBoxItem component; private RaycastHit hit; private ParticleSystem wrapEffect; private AudioSource[] sounds; private bool worksOnCheapItemsConfig; internal static UsualScrapConfigs BoundConfig { get; private set; } public void Awake() { BoundConfig = Plugin.BoundConfig; worksOnCheapItemsConfig = BoundConfig.TicketsFunctionOnCheapItems.Value; wrapEffect = ((Component)this).GetComponentInChildren(); sounds = ((Component)((Component)this).transform.Find("TicketSounds")).gameObject.GetComponents(); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0023: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!buttonDown || !Physics.Raycast(new Ray(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward), ref hit, 5f, LayerMask.GetMask(new string[1] { "Props" }))) { return; } viewedGameObject = (Object)(object)((Component)((RaycastHit)(ref hit)).transform).gameObject; viewedNetworkObject = ((Component)((RaycastHit)(ref hit)).transform).gameObject.GetComponent(); Vector3 vector = ((Component)((RaycastHit)(ref hit)).transform).gameObject.transform.position + Vector3.up * 0.5f; try { viewedGrabbableObject = ((Component)((RaycastHit)(ref hit)).transform).gameObject.GetComponentInChildren(); if (!((Object)(object)((Component)viewedNetworkObject).GetComponentInChildren() != (Object)null) && !((Object)(object)((Component)viewedNetworkObject).GetComponent() != (Object)null) && (worksOnCheapItemsConfig || viewedGrabbableObject.scrapValue > 15) && viewedGameObject != (Object)null && (Object)(object)viewedNetworkObject != (Object)null && (Object)(object)base.playerHeldBy != (Object)null && (Object)(object)viewedGrabbableObject != (Object)null) { DestroyTargetRadarIconsServerRpc(viewedNetworkObject.NetworkObjectId); DespawnItemServerRpc(viewedNetworkObject.NetworkObjectId); SpawnGiftBoxServerRpc(vector); DestroyThisRadarIconsServerRpc(); base.playerHeldBy.DespawnHeldObject(); } } catch { } } [ServerRpc(RequireOwnership = false)] public void SpawnGiftBoxServerRpc(Vector3 vector) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3334875059u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref vector); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3334875059u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SpawnGiftBox(vector); SpawnGiftBoxClientRpc(); } } } [ClientRpc] public void SpawnGiftBoxClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2612649702u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2612649702u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; } } } public void SpawnGiftBox(Vector3 vector) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_002c: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) Item val = PullGiftBox(); WrappedPresent = Object.Instantiate(val.spawnPrefab, vector, Quaternion.identity); GrabbableObject val2 = WrappedPresent.GetComponent(); val2.startFallingPosition = vector; ((MonoBehaviour)this).StartCoroutine(SetObjectToHitGroundSFX((GrabbableObject)(object)component)); val2.targetFloorPosition = val2.GetItemFloorPosition(((Component)val2).transform.position); component = WrappedPresent.GetComponent(); ((NetworkBehaviour)component).NetworkObject.Spawn(false); ((GrabbableObject)component).SetScrapValue(5); wrapEffect = Object.Instantiate(wrapEffect, WrappedPresent.transform.position, Quaternion.identity); wrapEffect.Play(); AudioSource.PlayClipAtPoint(sounds[0].clip, WrappedPresent.transform.position); } public IEnumerator SetObjectToHitGroundSFX(GrabbableObject Item) { yield return (object)new WaitForEndOfFrame(); Item.reachedFloorTarget = false; Item.hasHitGround = false; Item.fallTime = 0f; } public static Item PullGiftBox() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown if ((Object)_giftBoxItem == (Object)null) { _giftBoxItem = StartOfRound.Instance.allItemsList.itemsList.First((Item i) => ((Object)i).name == "GiftBox"); } return _giftBoxItem; } [ServerRpc] public void DespawnItemServerRpc(ulong ID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(858281490u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 858281490u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = ((NetworkBehaviour)this).NetworkManager.SpawnManager.SpawnedObjects[ID]; val3.Despawn(true); } } [ServerRpc] public void DestroyTargetRadarIconsServerRpc(ulong ID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4017305039u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4017305039u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DestroyTargetRadarIconsClientRpc(ID); } } [ClientRpc] public void DestroyTargetRadarIconsClientRpc(ulong ID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3908839215u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3908839215u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; try { NetworkObject val3 = ((NetworkBehaviour)this).NetworkManager.SpawnManager.SpawnedObjects[ID]; GrabbableObject componentInParent = ((Component)val3).GetComponentInParent(); if ((Object)(object)((Component)componentInParent.radarIcon).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)componentInParent.radarIcon).gameObject); } } catch (Exception arg) { MonoBehaviour.print((object)$"US - {arg} Radar icons already missing. Skipping.."); } } [ServerRpc] public void DestroyThisRadarIconsServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1317609795u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1317609795u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DestroyThisRadarIconsClientRpc(); } } [ClientRpc] public void DestroyThisRadarIconsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2558092374u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2558092374u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; try { if ((Object)(object)((Component)base.radarIcon).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)base.radarIcon).gameObject); } } catch (Exception arg) { MonoBehaviour.print((object)$"US - {arg} Radar icons already missing. Skipping.."); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3334875059u, new RpcReceiveHandler(__rpc_handler_3334875059), "SpawnGiftBoxServerRpc"); ((NetworkBehaviour)this).__registerRpc(2612649702u, new RpcReceiveHandler(__rpc_handler_2612649702), "SpawnGiftBoxClientRpc"); ((NetworkBehaviour)this).__registerRpc(858281490u, new RpcReceiveHandler(__rpc_handler_858281490), "DespawnItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(4017305039u, new RpcReceiveHandler(__rpc_handler_4017305039), "DestroyTargetRadarIconsServerRpc"); ((NetworkBehaviour)this).__registerRpc(3908839215u, new RpcReceiveHandler(__rpc_handler_3908839215), "DestroyTargetRadarIconsClientRpc"); ((NetworkBehaviour)this).__registerRpc(1317609795u, new RpcReceiveHandler(__rpc_handler_1317609795), "DestroyThisRadarIconsServerRpc"); ((NetworkBehaviour)this).__registerRpc(2558092374u, new RpcReceiveHandler(__rpc_handler_2558092374), "DestroyThisRadarIconsClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3334875059(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 vector = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref vector); target.__rpc_exec_stage = (__RpcExecStage)1; ((TicketScript)(object)target).SpawnGiftBoxServerRpc(vector); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2612649702(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((TicketScript)(object)target).SpawnGiftBoxClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_858281490(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { ulong iD = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref iD); target.__rpc_exec_stage = (__RpcExecStage)1; ((TicketScript)(object)target).DespawnItemServerRpc(iD); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4017305039(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { ulong iD = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref iD); target.__rpc_exec_stage = (__RpcExecStage)1; ((TicketScript)(object)target).DestroyTargetRadarIconsServerRpc(iD); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3908839215(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong iD = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref iD); target.__rpc_exec_stage = (__RpcExecStage)1; ((TicketScript)(object)target).DestroyTargetRadarIconsClientRpc(iD); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1317609795(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((TicketScript)(object)target).DestroyThisRadarIconsServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2558092374(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((TicketScript)(object)target).DestroyThisRadarIconsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "TicketScript"; } } public class ToolkitScript : GrabbableObject { private static Item _laserPointerItem; private static Item _bigBoltItem; private static Item _metalSheetItem; private Object viewedTrapObject; private Turret viewedTurret; private Landmine viewedLandmine; private Coroutine coroutine; private int timeLapsed = 0; private int timeToSuccess; private bool coroutinerunning = false; private Vector3 trap; private AudioSource[] toolkitAudio; private AudioSource toolkitSound; private AudioClip Smash; private ParticleSystem sparkEffect; public void Awake() { try { toolkitSound = ((Component)((Component)this).transform.Find("ToolkitSounds")).gameObject.GetComponent(); toolkitAudio = ((Component)((Component)this).transform.Find("ToolkitSounds")).gameObject.GetComponents(); Smash = toolkitAudio[0].clip; sparkEffect = ((Component)((Component)this).transform.Find("SparkEffect")).GetComponent(); } catch { if (toolkitAudio == null) { MonoBehaviour.print((object)"ERROR: Toolkit audio not found."); } if ((Object)(object)sparkEffect == (Object)null) { MonoBehaviour.print((object)"ERROR: Toolkit effect not found."); } } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if (coroutinerunning) { ((MonoBehaviour)this).StopCoroutine(coroutine); coroutinerunning = false; } viewedTrapObject = null; viewedTurret = null; viewedLandmine = null; timeLapsed = 0; } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if (coroutinerunning) { ((MonoBehaviour)this).StopCoroutine(coroutine); coroutinerunning = false; } viewedTrapObject = null; viewedTurret = null; viewedLandmine = null; timeLapsed = 0; } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown) { Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 3f, LayerMask.GetMask(new string[1] { "MapHazards" }), (QueryTriggerInteraction)2); if (array.Length != 0) { Collider[] array2 = array; foreach (Collider val in array2) { if ((Object)(object)((Component)((Component)val).transform).GetComponent() != (Object)null || (Object)(object)((Component)((Component)val).transform).GetComponent() != (Object)null || (Object)(object)((Component)((Component)val).transform).gameObject.GetComponent() != (Object)null) { viewedTrapObject = (Object)(object)((Component)((Component)((Component)val).transform).gameObject.transform.parent).gameObject; viewedTurret = ((Component)((Component)val).transform).GetComponent(); viewedLandmine = ((Component)((Component)val).transform).GetComponent(); trap = ((Component)val).transform.position; if ((Object)(object)viewedTurret != (Object)null && viewedTrapObject != (Object)null && !coroutinerunning) { coroutine = ((MonoBehaviour)this).StartCoroutine(DismantleTrap("Turret")); } else if ((Object)(object)viewedLandmine != (Object)null && viewedTrapObject != (Object)null && !coroutinerunning) { coroutine = ((MonoBehaviour)this).StartCoroutine(DismantleTrap("Landmine")); } } } } } if (!buttonDown) { if (coroutinerunning) { ((MonoBehaviour)this).StopCoroutine(coroutine); coroutinerunning = false; } viewedTrapObject = null; viewedTurret = null; viewedLandmine = null; timeLapsed = 0; } } private IEnumerator DismantleTrap(string trapType) { coroutinerunning = true; timeLapsed = 0; Vector3 playerPosition = ((Component)base.playerHeldBy).transform.position; if ((Object)(object)viewedTurret != (Object)null) { timeToSuccess = 10; } else if ((Object)(object)viewedLandmine != (Object)null) { timeToSuccess = 5; } while (viewedTrapObject != (Object)null) { yield return (object)new WaitForSeconds(0.8f); sparkEffect = Object.Instantiate(sparkEffect, trap, Quaternion.identity); sparkEffect.Play(); toolkitSound.pitch = Random.Range(0.4f, 0.6f); toolkitSound.PlayOneShot(Smash); Vector3 newPlayerPosition = ((Component)base.playerHeldBy).transform.position; if (newPlayerPosition != playerPosition) { viewedTrapObject = null; viewedTurret = null; viewedLandmine = null; timeLapsed = 0; break; } if (timeLapsed == timeToSuccess) { DismantleFunctionServerRPC(trapType); viewedTrapObject = null; viewedTurret = null; viewedLandmine = null; timeLapsed = 0; break; } timeLapsed++; MonoBehaviour.print((object)timeLapsed); } coroutinerunning = false; } [ServerRpc(RequireOwnership = false)] public void DismantleFunctionServerRPC(string trapType) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0233: 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_024a: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(800117706u, val, (RpcDelivery)0); bool flag = trapType != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(trapType, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 800117706u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; MonoBehaviour.print((object)"US - Running spawn dismantled scrap method!"); Item val3 = PullLaserPointer(); Item val4 = PullBigBolt(); Item val5 = PullMetalSheet(); Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 3f, LayerMask.GetMask(new string[1] { "MapHazards" }), (QueryTriggerInteraction)2); if (array.Length != 0) { Collider[] array2 = array; foreach (Collider val6 in array2) { viewedTrapObject = (Object)(object)((Component)((Component)((Component)val6).transform).gameObject.transform.parent).gameObject; if (trapType == "Turret" && (Object)(object)((Component)((Component)val6).transform).GetComponent() != (Object)null) { viewedTurret = ((Component)((Component)val6).transform).GetComponent(); for (int num = new Random().Next(1, 3); num > 0; num--) { float num2 = new Random().Next(1, 11); Vector3 val7 = ((Component)viewedTurret).transform.position + Vector3.up * 0.25f; if (num2 == 1f) { GameObject val8 = Object.Instantiate(val3.spawnPrefab, val7, Quaternion.identity); GrabbableObject component = val8.GetComponent(); component.startFallingPosition = val7; ((MonoBehaviour)this).StartCoroutine(SetObjectToHitGroundSFX(component)); component.targetFloorPosition = component.GetItemFloorPosition(((Component)viewedTurret).transform.position); component.SetScrapValue(new Random().Next(35, 50)); ((NetworkBehaviour)component).NetworkObject.Spawn(false); } else if (num2 > 1f && num2 <= 6f) { GameObject val8 = Object.Instantiate(val4.spawnPrefab, val7, Quaternion.identity); GrabbableObject component2 = val8.GetComponent(); component2.startFallingPosition = val7; ((MonoBehaviour)this).StartCoroutine(SetObjectToHitGroundSFX(component2)); component2.targetFloorPosition = component2.GetItemFloorPosition(((Component)viewedTurret).transform.position); component2.SetScrapValue(new Random().Next(15, 25)); ((NetworkBehaviour)component2).NetworkObject.Spawn(false); } else if (num2 > 6f && num2 <= 10f) { GameObject val8 = Object.Instantiate(val5.spawnPrefab, val7, Quaternion.identity); GrabbableObject component3 = val8.GetComponent(); component3.startFallingPosition = val7; ((MonoBehaviour)this).StartCoroutine(SetObjectToHitGroundSFX(component3)); component3.targetFloorPosition = component3.GetItemFloorPosition(((Component)viewedTurret).transform.position); component3.SetScrapValue(new Random().Next(15, 25)); ((NetworkBehaviour)component3).NetworkObject.Spawn(false); } } } else if (trapType == "Landmine" && (Object)(object)((Component)((Component)val6).transform).GetComponent() != (Object)null) { viewedLandmine = ((Component)((Component)val6).transform).GetComponent(); Vector3 val7 = ((Component)viewedLandmine).transform.position; GameObject val8 = Object.Instantiate(val4.spawnPrefab, val7, Quaternion.identity); GrabbableObject component4 = val8.GetComponent(); component4.startFallingPosition = val7; ((MonoBehaviour)this).StartCoroutine(SetObjectToHitGroundSFX(component4)); component4.targetFloorPosition = component4.GetItemFloorPosition(((Component)viewedLandmine).transform.position); component4.SetScrapValue(new Random().Next(15, 25)); ((NetworkBehaviour)component4).NetworkObject.Spawn(false); } } } DismantleFunctionClientRPC(trapType); } [ClientRpc] public void DismantleFunctionClientRPC(string trapType) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2134829576u, val, (RpcDelivery)0); bool flag = trapType != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(trapType, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2134829576u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DismantleFunction(trapType); } } public void DismantleFunction(string trapType) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) MonoBehaviour.print((object)"US - Running destroy trap method!"); Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 3f, LayerMask.GetMask(new string[1] { "MapHazards" }), (QueryTriggerInteraction)2); if (array.Length == 0) { return; } Collider[] array2 = array; foreach (Collider val in array2) { viewedTrapObject = (Object)(object)((Component)((Component)((Component)val).transform).gameObject.transform.parent).gameObject; if (trapType == "Turret" && (Object)(object)((Component)((Component)val).transform).GetComponent() != (Object)null) { Object.Destroy(viewedTrapObject); } else if (trapType == "Landmine" && (Object)(object)((Component)((Component)val).transform).GetComponent() != (Object)null) { Object.Destroy(viewedTrapObject); } } } private IEnumerator SetObjectToHitGroundSFX(GrabbableObject lootObject) { yield return (object)new WaitForEndOfFrame(); lootObject.reachedFloorTarget = false; lootObject.hasHitGround = false; lootObject.fallTime = 0f; } public static Item PullLaserPointer() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown if ((Object)_laserPointerItem == (Object)null) { _laserPointerItem = StartOfRound.Instance.allItemsList.itemsList.First((Item i) => ((Object)i).name == "FlashLaserPointer"); } return _laserPointerItem; } public static Item PullBigBolt() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown if ((Object)_bigBoltItem == (Object)null) { _bigBoltItem = StartOfRound.Instance.allItemsList.itemsList.First((Item i) => ((Object)i).name == "BigBolt"); } return _bigBoltItem; } public static Item PullMetalSheet() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown if ((Object)_metalSheetItem == (Object)null) { _metalSheetItem = StartOfRound.Instance.allItemsList.itemsList.First((Item i) => ((Object)i).name == "MetalSheet"); } return _metalSheetItem; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(800117706u, new RpcReceiveHandler(__rpc_handler_800117706), "DismantleFunctionServerRPC"); ((NetworkBehaviour)this).__registerRpc(2134829576u, new RpcReceiveHandler(__rpc_handler_2134829576), "DismantleFunctionClientRPC"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_800117706(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string trapType = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref trapType, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((ToolkitScript)(object)target).DismantleFunctionServerRPC(trapType); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2134829576(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string trapType = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref trapType, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((ToolkitScript)(object)target).DismantleFunctionClientRPC(trapType); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ToolkitScript"; } } public class VintageCandyScript : GrabbableObject { private MeshRenderer candyMesh; private GameObject candyModel; private MeshRenderer wrapperObject; private MeshRenderer candyObject; private Color setColor; public override void Start() { ((GrabbableObject)this).Start(); SetColorServerRpc(); } [ServerRpc(RequireOwnership = false)] public void SetColorServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_00f9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4162469168u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4162469168u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Random random = new Random(); float num = (float)random.NextDouble(); Color val3 = Color.HSVToRGB(num, 1f, 1f); setColor = Color32.op_Implicit(Color32.op_Implicit(val3)); SetColorClientRpc(setColor); } } } [ClientRpc] public void SetColorClientRpc(Color color) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) //IL_0124: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2663061315u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref color); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2663061315u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; candyModel = ((Component)((Component)this).transform.Find("VintageCandyModel")).gameObject; wrapperObject = ((Component)candyModel.gameObject.transform.Find("Wrapper")).gameObject.GetComponent(); ((Renderer)wrapperObject).material.color = color; } } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown) { ((Component)base.playerHeldBy).gameObject.AddComponent(); base.playerHeldBy.DespawnHeldObject(); } } [ServerRpc] public void DestroyRadarIconServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1334827072u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1334827072u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DestroyRadarIconClientRpc(); } } [ClientRpc] public void DestroyRadarIconClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(190369978u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 190369978u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Object.Destroy((Object)(object)((Component)base.radarIcon).gameObject); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4162469168u, new RpcReceiveHandler(__rpc_handler_4162469168), "SetColorServerRpc"); ((NetworkBehaviour)this).__registerRpc(2663061315u, new RpcReceiveHandler(__rpc_handler_2663061315), "SetColorClientRpc"); ((NetworkBehaviour)this).__registerRpc(1334827072u, new RpcReceiveHandler(__rpc_handler_1334827072), "DestroyRadarIconServerRpc"); ((NetworkBehaviour)this).__registerRpc(190369978u, new RpcReceiveHandler(__rpc_handler_190369978), "DestroyRadarIconClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_4162469168(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((VintageCandyScript)(object)target).SetColorServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2663061315(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Color colorClientRpc = default(Color); ((FastBufferReader)(ref reader)).ReadValueSafe(ref colorClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((VintageCandyScript)(object)target).SetColorClientRpc(colorClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1334827072(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((VintageCandyScript)(object)target).DestroyRadarIconServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_190369978(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((VintageCandyScript)(object)target).DestroyRadarIconClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "VintageCandyScript"; } } public class WalkingCaneScript : GrabbableObject { private PlayerControllerB Player; private readonly float speedBuff = 1.5f; private bool speedCoroutineRunning = false; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if (!speedCoroutineRunning) { ((MonoBehaviour)this).StartCoroutine(ApplySpeedBuff()); } } private IEnumerator ApplySpeedBuff() { speedCoroutineRunning = true; Player = base.playerHeldBy; Player.movementSpeed += speedBuff; while (base.isHeld && !Player.isPlayerDead && !base.isPocketed) { yield return (object)new WaitForSeconds(0.5f); } Player.movementSpeed -= speedBuff; speedCoroutineRunning = false; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "WalkingCaneScript"; } } } namespace UsualScrap.Behaviors.Effects { public class ProductivityAutoinjectorEffect : MonoBehaviour { private int buffDuration = 10; private float speedStrength = 1f; private PlayerControllerB playerUsedBy; public void Awake() { playerUsedBy = ((Component)this).GetComponent(); ((MonoBehaviour)this).StartCoroutine(Boost()); } private IEnumerator Boost() { playerUsedBy.carryWeight = 1f; StartOfRound.Instance.SendChangedWeightEvent(); playerUsedBy.jumpForce += speedStrength / 2f; playerUsedBy.movementSpeed += speedStrength; while (buffDuration > 0) { yield return (object)new WaitForSeconds(0.5f); playerUsedBy.carryWeight = 1f; StartOfRound.Instance.SendChangedWeightEvent(); buffDuration--; if (playerUsedBy.isPlayerDead) { buffDuration = 0; } } playerUsedBy.jumpForce -= speedStrength / 2f; playerUsedBy.movementSpeed -= speedStrength; GrabbableObject[] itemSlots = playerUsedBy.ItemSlots; foreach (GrabbableObject fl in itemSlots) { if ((Object)(object)fl != (Object)null) { playerUsedBy.carryWeight = Math.Clamp(playerUsedBy.carryWeight + (fl.itemProperties.weight - 1f), 1f, 10f); StartOfRound.Instance.SendChangedWeightEvent(); } } Object.Destroy((Object)(object)this); } } public class RandomCandyEffect : MonoBehaviour { private int randomRoll = new Random().Next(1, 3); private int Duration = 10; private PlayerControllerB playerUsedBy; private float speedStrength = 2f; private float jumpStrength = 6f; public void Awake() { playerUsedBy = ((Component)this).GetComponent(); if (randomRoll == 1) { ((MonoBehaviour)this).StartCoroutine(SpeedEffect()); } else if (randomRoll == 2) { ((MonoBehaviour)this).StartCoroutine(JumpEffect()); } } private IEnumerator SpeedEffect() { playerUsedBy.movementSpeed += speedStrength; while (Duration > 0) { yield return (object)new WaitForSeconds(1f); Duration--; } playerUsedBy.movementSpeed -= speedStrength; Object.Destroy((Object)(object)this); } private IEnumerator JumpEffect() { playerUsedBy.jumpForce += jumpStrength; while (Duration > 0) { yield return (object)new WaitForSeconds(1f); Duration--; } playerUsedBy.jumpForce -= jumpStrength; Object.Destroy((Object)(object)this); } } public class StackingSlowEffect : MonoBehaviour { private PlayerControllerB player; public ParticleSystem frostedParticles; private ParticleSystem particle; private float slowDebuff = 0.3f; private float effectDuration = 20f; public void Awake() { player = ((Component)this).GetComponent(); ((MonoBehaviour)this).StartCoroutine(SlowEffect()); } private IEnumerator SlowEffect() { yield return (object)new WaitUntil((Func)(() => (Object)(object)frostedParticles != (Object)null)); player = ((Component)this).GetComponent(); CheckAndApplySlow(apply: true); particle = Object.Instantiate(frostedParticles, ((Component)player).transform.position, Quaternion.identity, ((Component)player).transform); particle.Play(); while (effectDuration > 0f) { effectDuration -= 1f; yield return (object)new WaitForSeconds(1f); if (StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded || player.enteringSpecialAnimation) { effectDuration = 0f; } } CheckAndApplySlow(apply: false); Object.Destroy((Object)(object)this); } public void CheckAndApplySlow(bool apply) { if (apply) { PlayerControllerB obj = player; obj.movementSpeed -= slowDebuff; PlayerControllerB obj2 = player; obj2.jumpForce -= slowDebuff * 3f; Animator playerBodyAnimator = player.playerBodyAnimator; playerBodyAnimator.speed -= 0.05f; } else if (!apply) { PlayerControllerB obj3 = player; obj3.movementSpeed += slowDebuff; PlayerControllerB obj4 = player; obj4.jumpForce += slowDebuff * 3f; Animator playerBodyAnimator2 = player.playerBodyAnimator; playerBodyAnimator2.speed += 0.05f; } } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); } } } namespace UsualScrap.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }