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; using UsualScrap.Patches; [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.7.0")] [assembly: AssemblyInformationalVersion("2.0.7")] [assembly: AssemblyProduct("UsualScrap")] [assembly: AssemblyTitle("UsualScrap")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.7.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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.7")] 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 NamespacedKey US_FireAxe = NamespacedKey.From("Usual_Scrap", "US_FireAxe"); public static NamespacedKey US_Sledgehammer = NamespacedKey.From("Usual_Scrap", "US_Sledgehammer"); public static NamespacedKey US_AntiqueSword = NamespacedKey.From("Usual_Scrap", "US_AntiqueSword"); public static NamespacedKey US_RegalScepter = NamespacedKey.From("Usual_Scrap", "US_RegalScepter"); } 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_Blowtorch = NamespacedKey.From("Usual_Scrap", "US_Blowtorch"); public static NamespacedKey US_ShockBaton = NamespacedKey.From("Usual_Scrap", "US_ShockBaton"); } public static class EffectLoader { private static AssetBundle assetBundle; private static readonly Dictionary loadedEffects = new Dictionary(); public static void Initialize(AssetBundle bundle) { assetBundle = bundle; } public static GameObject Get(string path) { if (!loadedEffects.TryGetValue(path, out var value)) { value = assetBundle.LoadAsset(path); if ((Object)(object)value == (Object)null) { Debug.LogError((object)("USUAL SCRAP - Failed to load effect: " + path)); return null; } loadedEffects[path] = value; } return value; } } public const string PLUGIN_GUID = "Emil.UsualScrap"; public const string PLUGIN_NAME = "UsualScrap"; public const string PLUGIN_VERSION = "2.0.7"; 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")); EffectLoader.Initialize(val); 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.BlowtorchLoaded.Value) { Item val7 = val.LoadAsset("Assets/UsualScrapContent/Items/BlowtorchAssets/US_BlowtorchItem.asset"); list.Add(val7); TerminalNode US_BlowtorchNode = val.LoadAsset("Assets/Items/BlowtorchAssets/US_BlowtorchNode.asset"); RedoneBlowtorch itemScript6 = val7.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript6, grabbable: true, grabbableToEnemies: true, val7); if (BoundConfig.BlowtorchIsStoreItem.Value && BoundConfig.BlowtorchStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_Blowtorch, val7, (Action)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.BlowtorchStorePrice.Value).OverrideInfoNode(US_BlowtorchNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Blowtorch 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..."); } try { if (BoundConfig.ShockBatonLoaded.Value) { Item val9 = val.LoadAsset("Assets/UsualScrapContent/Items/ShockBatonAssets/US_ShockBatonItem.asset"); list.Add(val9); TerminalNode US_ShockBatonNode = val.LoadAsset("Assets/Items/ShockBatonAssets/US_ShockBatonNode.asset"); ShockBatonScript itemScript8 = val9.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript8, grabbable: true, grabbableToEnemies: true, val9); if (BoundConfig.ShockBatonIsStoreItem.Value && BoundConfig.ShockBatonStorePrice.Value >= 0) { DawnLib.DefineItem(StoreItemKeys.US_ShockBaton, val9, (Action)delegate(ItemInfoBuilder builder) { builder.DefineShop((Action)delegate(ShopBuilder shopBuilder) { shopBuilder.OverrideCost(BoundConfig.ShockBatonStorePrice.Value).OverrideInfoNode(US_ShockBatonNode); }); }); } } } catch { Debug.LogError((object)"USUAL SCRAP - Shock Baton 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_FireAxe = null; Item US_Sledgehammer = null; Item US_AntiqueSword = null; Item US_RegalScepter = 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; if (BoundConfig.TicketLoaded.Value) { try { US_Ticket = val.LoadAsset("Assets/UsualScrapContent/Items/TicketAssets/US_TicketItem.asset"); list.Add(US_Ticket); TicketScript itemScript9 = US_Ticket.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript9, grabbable: true, grabbableToEnemies: true, US_Ticket); } catch { Debug.LogError((object)"USUAL SCRAP - Ticket experienced an error while loading. Skipping..."); } } if (BoundConfig.GoldenTicketLoaded.Value) { try { US_GoldenTicket = val.LoadAsset("Assets/UsualScrapContent/Items/GoldenTicketAssets/US_GoldenTicketItem.asset"); list.Add(US_GoldenTicket); GoldenTicketScript itemScript10 = US_GoldenTicket.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript10, grabbable: true, grabbableToEnemies: true, US_GoldenTicket); } catch { Debug.LogError((object)"USUAL SCRAP - Golden Ticket experienced an error while loading. Skipping..."); } } if (BoundConfig.RoseLoaded.Value) { try { US_Rose = val.LoadAsset("Assets/UsualScrapContent/Items/RoseAssets/US_RoseItem.asset"); list.Add(US_Rose); RoseScript itemScript11 = US_Rose.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript11, grabbable: true, grabbableToEnemies: true, US_Rose); } catch { Debug.LogError((object)"USUAL SCRAP - Rose experienced an error while loading. Skipping..."); } } if (BoundConfig.SizableScissorsLoaded.Value) { try { US_SizableScissors = val.LoadAsset("Assets/UsualScrapContent/Items/SizableScissorsAssets/US_SizableScissorsItem.asset"); list.Add(US_SizableScissors); SizableScissorsScript itemScript12 = US_SizableScissors.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript12, grabbable: true, grabbableToEnemies: true, US_SizableScissors); } catch { Debug.LogError((object)"USUAL SCRAP - Scissors experienced an error while loading. Skipping..."); } } if (BoundConfig.WalkingCaneLoaded.Value) { try { US_WalkingCane = val.LoadAsset("Assets/UsualScrapContent/Items/WalkingCaneAssets/US_WalkingCaneItem.asset"); list.Add(US_WalkingCane); WalkingCaneScript itemScript13 = US_WalkingCane.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript13, grabbable: true, grabbableToEnemies: true, US_WalkingCane); } catch { Debug.LogError((object)"USUAL SCRAP - Walking Cane experienced an error while loading. Skipping..."); } } if (BoundConfig.CandyDispenserLoaded.Value) { try { US_CandyDispenser = val.LoadAsset("Assets/UsualScrapContent/Items/CandyDispenserAssets/US_CandyDispenserItem.asset"); list.Add(US_CandyDispenser); CandyDispenserScript itemScript14 = US_CandyDispenser.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript14, grabbable: true, grabbableToEnemies: true, US_CandyDispenser); 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 or Vintage Candy experienced an error while loading. Skipping..."); } } else if (BoundConfig.VintageCandyLoaded.Value && !BoundConfig.CandyDispenserLoaded.Value) { try { US_VintageCandy = val.LoadAsset("Assets/UsualScrapContent/Items/VintageCandyAssets/US_VintageCandyItem.asset"); list.Add(US_VintageCandy); VintageCandyScript itemScript16 = US_VintageCandy.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript16, grabbable: true, grabbableToEnemies: true, US_VintageCandy); } catch { Debug.LogError((object)"USUAL SCRAP - Vintage Candy experienced an error while loading. Skipping..."); } } if (BoundConfig.FuelCylinderLoaded.Value) { try { US_FuelCylinder = val.LoadAsset("Assets/UsualScrapContent/Items/FuelCylinderAssets/US_FuelCylinderItem.asset"); list.Add(US_FuelCylinder); FuelCylinderScript itemScript17 = US_FuelCylinder.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript17, grabbable: true, grabbableToEnemies: true, US_FuelCylinder); } catch { Debug.LogError((object)"USUAL SCRAP - Fuel Cylinder experienced an error while loading. Skipping..."); } } if (BoundConfig.RadioactiveCellLoaded.Value) { try { US_RadioactiveCell = val.LoadAsset("Assets/UsualScrapContent/Items/RadioactiveCellAssets/US_RadioactiveCellItem.asset"); list.Add(US_RadioactiveCell); RadioactiveCellScript itemScript18 = US_RadioactiveCell.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript18, grabbable: true, grabbableToEnemies: true, US_RadioactiveCell); } catch { Debug.LogError((object)"USUAL SCRAP - Radioactive Cell experienced an error while loading. Skipping..."); } } if (BoundConfig.GloomyCapsuleLoaded.Value) { try { US_GloomyCapsule = val.LoadAsset("Assets/UsualScrapContent/Items/GloomyCapsuleAssets/US_GloomyCapsuleItem.asset"); list.Add(US_GloomyCapsule); GloomyCapsuleScript itemScript19 = US_GloomyCapsule.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript19, grabbable: true, grabbableToEnemies: true, US_GloomyCapsule); } catch { Debug.LogError((object)"USUAL SCRAP - Gloomy Capsule experienced an error while loading. Skipping..."); } } if (BoundConfig.FrigidCapsuleLoaded.Value) { try { US_FrigidCapsule = val.LoadAsset("Assets/UsualScrapContent/Items/FrigidCapsuleAssets/US_FrigidCapsuleItem.asset"); list.Add(US_FrigidCapsule); FrigidCapsuleScript itemScript20 = US_FrigidCapsule.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript20, grabbable: true, grabbableToEnemies: true, US_FrigidCapsule); } catch { Debug.LogError((object)"USUAL SCRAP - Frigid Capsule experienced an error while loading. Skipping..."); } } if (BoundConfig.BloodyCapsuleLoaded.Value) { try { US_BloodyCapsule = val.LoadAsset("Assets/UsualScrapContent/Items/BloodyCapsuleAssets/US_BloodyCapsuleItem.asset"); list.Add(US_BloodyCapsule); BloodyCapsuleScript itemScript21 = US_BloodyCapsule.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript21, grabbable: true, grabbableToEnemies: true, US_BloodyCapsule); } catch { Debug.LogError((object)"USUAL SCRAP - Bloody Capsule experienced an error while loading. Skipping..."); } } if (BoundConfig.PadlockLoaded.Value) { try { US_Padlock = val.LoadAsset("Assets/UsualScrapContent/Items/PadlockAssets/US_PadlockItem.asset"); list.Add(US_Padlock); PadlockScript itemScript22 = US_Padlock.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript22, grabbable: true, grabbableToEnemies: true, US_Padlock); } catch { Debug.LogError((object)"USUAL SCRAP - Padlock experienced an error while loading. Skipping..."); } } if (BoundConfig.CrowbarLoaded.Value) { try { US_Crowbar = val.LoadAsset("Assets/UsualScrapContent/Items/CrowbarAssets/US_CrowbarItem.asset"); list.Add(US_Crowbar); CrowbarScript itemScript23 = US_Crowbar.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript23, grabbable: true, grabbableToEnemies: true, US_Crowbar); } catch { Debug.LogError((object)"USUAL SCRAP - Crowbar experienced an error while loading. Skipping..."); } } if (BoundConfig.FireAxeLoaded.Value) { try { US_FireAxe = val.LoadAsset("Assets/UsualScrapContent/Items/FireAxeAssets/US_FireAxeItem.asset"); list.Add(US_FireAxe); FireAxeScript itemScript24 = US_FireAxe.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript24, grabbable: true, grabbableToEnemies: true, US_FireAxe); } catch { Debug.LogError((object)"USUAL SCRAP - Fire Axe experienced an error while loading. Skipping..."); } } if (BoundConfig.SledgehammerLoaded.Value) { try { US_Sledgehammer = val.LoadAsset("Assets/UsualScrapContent/Items/SledgehammerAssets/US_SledgehammerItem.asset"); list.Add(US_Sledgehammer); SledgehammerScript itemScript25 = US_Sledgehammer.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript25, grabbable: true, grabbableToEnemies: true, US_Sledgehammer); } catch { Debug.LogError((object)"USUAL SCRAP - Sledgehammer experienced an error while loading. Skipping..."); } } if (BoundConfig.AntiqueSwordLoaded.Value) { try { US_AntiqueSword = val.LoadAsset("Assets/UsualScrapContent/Items/AntiqueSwordAssets/US_AntiqueSwordItem.asset"); list.Add(US_AntiqueSword); AntiqueSwordScript itemScript26 = US_AntiqueSword.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript26, grabbable: true, grabbableToEnemies: true, US_AntiqueSword); } catch { Debug.LogError((object)"USUAL SCRAP - Antique Sword experienced an error while loading. Skipping..."); } } if (BoundConfig.RegalScepterLoaded.Value) { try { US_RegalScepter = val.LoadAsset("Assets/UsualScrapContent/Items/RegalScepterAssets/US_RegalScepterItem.asset"); list.Add(US_RegalScepter); RegalScepterScript itemScript27 = US_RegalScepter.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript27, grabbable: true, grabbableToEnemies: true, US_RegalScepter); } catch { Debug.LogError((object)"USUAL SCRAP - Regal Scepter 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 itemScript28 = US_PocketWatch.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript28, 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 itemScript29 = US_ServantBell.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript29, 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 itemScript30 = US_TrafficCone.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript30, 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 itemScript31 = US_MereGear.spawnPrefab.AddComponent(); InitializeItem((GrabbableObject)(object)itemScript31, 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_PocketWatch, 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_ServantBell, 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_ChessPieces, 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_GoldenChessPieces, 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 (BoundConfig.TicketSpawnsAsScrap.Value && BoundConfig.TicketLoaded.Value) { try { if ((Object)(object)US_Ticket != (Object)null) { 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); }); }); }); } } catch { } } else if (!BoundConfig.TicketSpawnsAsScrap.Value && BoundConfig.TicketLoaded.Value) { try { if ((Object)(object)US_Ticket != (Object)null) { Items.RegisterItem(US_Ticket); } } catch { } } if (BoundConfig.GoldenTicketSpawnsAsScrap.Value && BoundConfig.GoldenTicketLoaded.Value) { try { if ((Object)(object)US_GoldenTicket != (Object)null) { 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); }); }); }); } } catch { } } else if (!BoundConfig.GoldenTicketSpawnsAsScrap.Value && BoundConfig.GoldenTicketLoaded.Value) { try { if ((Object)(object)US_GoldenTicket != (Object)null) { Items.RegisterItem(US_GoldenTicket); } } catch { } } if (BoundConfig.RoseSpawnsAsScrap.Value && BoundConfig.RoseLoaded.Value) { try { if ((Object)(object)US_Rose != (Object)null) { 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); }); }); }); } } catch { } } else if (!BoundConfig.RoseSpawnsAsScrap.Value && BoundConfig.RoseLoaded.Value) { try { if ((Object)(object)US_Rose != (Object)null) { Items.RegisterItem(US_Rose); } } catch { } } if (BoundConfig.SizableScissorsSpawnsAsScrap.Value && BoundConfig.SizableScissorsLoaded.Value) { try { if ((Object)(object)US_SizableScissors != (Object)null) { 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); }); }); }); } } catch { } } else if (!BoundConfig.SizableScissorsSpawnsAsScrap.Value && BoundConfig.SizableScissorsLoaded.Value) { try { if ((Object)(object)US_SizableScissors != (Object)null) { Items.RegisterItem(US_SizableScissors); } } catch { } } if (BoundConfig.WalkingCaneSpawnsAsScrap.Value && BoundConfig.WalkingCaneLoaded.Value) { try { if ((Object)(object)US_WalkingCane != (Object)null) { 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); }); }); }); } } catch { } } else if (!BoundConfig.WalkingCaneSpawnsAsScrap.Value && BoundConfig.WalkingCaneLoaded.Value) { try { if ((Object)(object)US_WalkingCane != (Object)null) { Items.RegisterItem(US_WalkingCane); } } catch { } } if ((BoundConfig.CandyDispenserSpawnsAsScrap.Value && BoundConfig.CandyDispenserLoaded.Value) || (BoundConfig.VintageCandySpawnsAsScrap.Value && BoundConfig.VintageCandyLoaded.Value)) { try { if ((Object)(object)US_CandyDispenser != (Object)null) { if ((Object)(object)US_VintageCandy == (Object)null) { return; } 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); }); }); }); } if ((Object)(object)US_VintageCandy != (Object)null) { 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); }); }); }); } } catch { } } else if ((!BoundConfig.CandyDispenserSpawnsAsScrap.Value && BoundConfig.CandyDispenserLoaded.Value) || (!BoundConfig.VintageCandySpawnsAsScrap.Value && BoundConfig.VintageCandyLoaded.Value)) { try { if ((Object)(object)US_CandyDispenser != (Object)null) { if ((Object)(object)US_VintageCandy == (Object)null) { return; } Items.RegisterItem(US_CandyDispenser); } if ((Object)(object)US_VintageCandy != (Object)null) { Items.RegisterItem(US_VintageCandy); } } catch { } } if (BoundConfig.FuelCylinderSpawnsAsScrap.Value && BoundConfig.FuelCylinderLoaded.Value) { try { if ((Object)(object)US_FuelCylinder != (Object)null) { 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); }); }); }); } } catch { } } else if (!BoundConfig.FuelCylinderSpawnsAsScrap.Value && BoundConfig.FuelCylinderLoaded.Value) { try { if ((Object)(object)US_FuelCylinder != (Object)null) { Items.RegisterItem(US_FuelCylinder); } } catch { } } if (BoundConfig.RadioactiveCellSpawnsAsScrap.Value && BoundConfig.RadioactiveCellLoaded.Value) { try { if ((Object)(object)US_RadioactiveCell != (Object)null) { 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); }); }); }); } } catch { } } else if (!BoundConfig.RadioactiveCellSpawnsAsScrap.Value && BoundConfig.RadioactiveCellLoaded.Value) { try { if ((Object)(object)US_RadioactiveCell != (Object)null) { Items.RegisterItem(US_RadioactiveCell); } } catch { } } if (BoundConfig.GloomyCapsuleSpawnsAsScrap.Value && BoundConfig.GloomyCapsuleLoaded.Value) { try { if ((Object)(object)US_GloomyCapsule != (Object)null) { 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); }); }); }); } } catch { } } else if (!BoundConfig.GloomyCapsuleSpawnsAsScrap.Value && BoundConfig.GloomyCapsuleLoaded.Value) { try { if ((Object)(object)US_GloomyCapsule != (Object)null) { Items.RegisterItem(US_GloomyCapsule); } } catch { } } if (BoundConfig.FrigidCapsuleSpawnsAsScrap.Value && BoundConfig.FrigidCapsuleLoaded.Value) { try { if ((Object)(object)US_FrigidCapsule != (Object)null) { 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); }); }); }); } } catch { } } else if (!BoundConfig.FrigidCapsuleSpawnsAsScrap.Value && BoundConfig.FrigidCapsuleLoaded.Value) { try { if ((Object)(object)US_FrigidCapsule != (Object)null) { Items.RegisterItem(US_FrigidCapsule); } } catch { } } if (BoundConfig.BloodyCapsuleSpawnsAsScrap.Value && BoundConfig.BloodyCapsuleLoaded.Value) { try { if ((Object)(object)US_BloodyCapsule != (Object)null) { 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); }); }); }); } } catch { } } else if (!BoundConfig.BloodyCapsuleSpawnsAsScrap.Value && BoundConfig.BloodyCapsuleLoaded.Value) { try { if ((Object)(object)US_BloodyCapsule != (Object)null) { Items.RegisterItem(US_BloodyCapsule); } } catch { } } if (BoundConfig.PadlockSpawnsAsScrap.Value && BoundConfig.PadlockLoaded.Value) { try { if ((Object)(object)US_Padlock != (Object)null) { 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); }); }); }); } } catch { } } else if (!BoundConfig.PadlockSpawnsAsScrap.Value && BoundConfig.PadlockLoaded.Value) { try { if ((Object)(object)US_Padlock != (Object)null) { Items.RegisterItem(US_Padlock); } } catch { } } if (BoundConfig.CrowbarSpawnsAsScrap.Value && BoundConfig.CrowbarLoaded.Value) { try { if ((Object)(object)US_Crowbar != (Object)null) { 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); }); }); }); } } catch { } } else if (!BoundConfig.CrowbarSpawnsAsScrap.Value && BoundConfig.CrowbarLoaded.Value) { try { if ((Object)(object)US_Crowbar != (Object)null) { Items.RegisterItem(US_Crowbar); } } catch { } } if (BoundConfig.FireAxeSpawnsAsScrap.Value && BoundConfig.FireAxeLoaded.Value) { try { if ((Object)(object)US_FireAxe != (Object)null) { string[] fireAxeMoonStrings = BoundConfig.FireAxeMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_FireAxe, US_FireAxe, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, fireAxeMoonStrings, US_FireAxe, BoundConfig.FireAxeMoonSpawnWeights, BoundConfig.FireAxeGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.FireAxeSpawnsAsScrap.Value && BoundConfig.FireAxeLoaded.Value) { try { if ((Object)(object)US_FireAxe != (Object)null) { Items.RegisterItem(US_FireAxe); } } catch { } } if (BoundConfig.SledgehammerSpawnsAsScrap.Value && BoundConfig.SledgehammerLoaded.Value) { try { if ((Object)(object)US_Sledgehammer != (Object)null) { string[] sledgehammerMoonStrings = BoundConfig.SledgehammerMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_Sledgehammer, US_Sledgehammer, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, sledgehammerMoonStrings, US_Sledgehammer, BoundConfig.SledgehammerMoonSpawnWeights, BoundConfig.SledgehammerGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.SledgehammerSpawnsAsScrap.Value && BoundConfig.SledgehammerLoaded.Value) { try { if ((Object)(object)US_Sledgehammer != (Object)null) { Items.RegisterItem(US_Sledgehammer); } } catch { } } if (BoundConfig.AntiqueSwordSpawnsAsScrap.Value && BoundConfig.AntiqueSwordLoaded.Value) { try { if ((Object)(object)US_AntiqueSword != (Object)null) { string[] antiqueSwordMoonStrings = BoundConfig.AntiqueSwordMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_AntiqueSword, US_AntiqueSword, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, antiqueSwordMoonStrings, US_AntiqueSword, BoundConfig.AntiqueSwordMoonSpawnWeights, BoundConfig.AntiqueSwordGlobalSpawnWeight); }); }); }); } } catch { } } else if (!BoundConfig.AntiqueSwordSpawnsAsScrap.Value && BoundConfig.AntiqueSwordLoaded.Value) { try { if ((Object)(object)US_AntiqueSword != (Object)null) { Items.RegisterItem(US_AntiqueSword); } } catch { } } if (BoundConfig.RegalScepterSpawnsAsScrap.Value && BoundConfig.RegalScepterLoaded.Value) { try { if ((Object)(object)US_RegalScepter != (Object)null) { string[] regalScepterMoonStrings = BoundConfig.RegalScepterMoonSpawnWeights.Value.Split(','); DawnLib.DefineItem(ScrapItemKeys.US_RegalScepter, US_RegalScepter, (Action)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action>)delegate(WeightTableBuilder weightBuilder) { buildallweights(weightBuilder, regalScepterMoonStrings, US_RegalScepter, BoundConfig.RegalScepterMoonSpawnWeights, BoundConfig.RegalScepterGlobalSpawnWeight); }); }); }); } return; } catch { return; } } if (!BoundConfig.RegalScepterSpawnsAsScrap.Value && BoundConfig.RegalScepterLoaded.Value) { try { if ((Object)(object)US_RegalScepter != (Object)null) { Items.RegisterItem(US_RegalScepter); } } catch { } } } void buildallweights(WeightTableBuilder builder, string[] moonStrings, Item item, ConfigEntry moonWeightConfig, ConfigEntry globalWeightConfig) { MonoBehaviour.print((object)$"Building moon weights for {item}"); bool flag = false; 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; try { builder.AddWeight(finalMoon.Key, num); } catch (Exception ex) { Debug.LogWarning((object)$"Failed to add specified weight for {item} to {text2}, Attempted weight -> {num}"); Debug.LogWarning((object)ex); } 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; try { builder.AddWeight(finalMoon.Key, globalWeightConfig.Value); } catch (Exception ex2) { Debug.LogWarning((object)$"Failed to add global weight for {item} to {text2}, Attempted weight -> {globalWeightConfig.Value}"); Debug.LogWarning((object)ex2); } 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 flag2 = false; foreach (string text7 in moonStrings) { if (text7.ToLowerInvariant().Contains(text6)) { flag2 = true; break; } } if (!flag2) { string text8 = moonWeightConfig.Value; if (!string.IsNullOrWhiteSpace(text8) && !text8.EndsWith(",")) { text8 += ", "; } text8 = text8 + text6 + "=-1"; moonWeightConfig.Value = text8; flag = true; 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(); if (flag) { MonoBehaviour.print((object)$"USUALS SCRAP - Detected new moon(s) while processing '{item}'."); } 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); } MonoBehaviour.print((object)$"Moon weights for {item} set."); } } 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 ConfigInfo; public readonly ConfigEntry ConfigBackup; public readonly ConfigEntry ConfigLayout; 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 FireAxeLoaded; public readonly ConfigEntry FireAxeSpawnsAsScrap; public readonly ConfigEntry FireAxeMoonSpawnWeights; public readonly ConfigEntry FireAxeGlobalSpawnWeight; public readonly ConfigEntry SledgehammerLoaded; public readonly ConfigEntry SledgehammerSpawnsAsScrap; public readonly ConfigEntry SledgehammerMoonSpawnWeights; public readonly ConfigEntry SledgehammerGlobalSpawnWeight; public readonly ConfigEntry AntiqueSwordLoaded; public readonly ConfigEntry AntiqueSwordSpawnsAsScrap; public readonly ConfigEntry AntiqueSwordMoonSpawnWeights; public readonly ConfigEntry AntiqueSwordGlobalSpawnWeight; public readonly ConfigEntry RegalScepterLoaded; public readonly ConfigEntry RegalScepterSpawnsAsScrap; public readonly ConfigEntry RegalScepterMoonSpawnWeights; public readonly ConfigEntry RegalScepterGlobalSpawnWeight; 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 BlowtorchLoaded; public readonly ConfigEntry BlowtorchIsStoreItem; public readonly ConfigEntry BlowtorchStorePrice; public readonly ConfigEntry ShockBatonLoaded; public readonly ConfigEntry ShockBatonIsStoreItem; public readonly ConfigEntry ShockBatonStorePrice; 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 DebugLogging; public UsualScrapConfigs(ConfigFile cfg) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown 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; ConfigInfo = cfg.Bind("0. Important Information", "Modded Moon Generation", "Read Above", new ConfigDescription("Modded Moon Config Generation: If this is your first time using the mod, or you have added or removed moon mods, launch the game and enter a save with this installed to generate modded moon config entries", (AcceptableValueBase)null, Array.Empty())); ConfigBackup = cfg.Bind("0. Important Information", "Config backup", "Read Above", new ConfigDescription("Config Backup Saves: Configs will always be saved to a backup before being recreated, it can be found alongside your original config file", (AcceptableValueBase)null, Array.Empty())); ConfigLayout = cfg.Bind("0. Important Information", "Moon Config Formatting", "Read Above", new ConfigDescription("Moon Config Format: Moon=Weight, Moon=Weight, Moon=Weight,...\n• Unspecified or disabled moon weights will use the global weight setting instead, specified moon weights overwrite the global weight individually\n• Set a specific moon's weight to -1 to use the global weight (this is the Default setting)\n• Set the global weight to -1 to disable spawning on unspecified moons\n• Incorrectly formatted entries will be skipped, reset, and reported in the log\n• After adding or removing moon mods you must launch the game and enter a save once to generate config entries to edit for those new moons or clear old entries", (AcceptableValueBase)null, Array.Empty())); 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 or similar mods)"); MansionScrapPackEnabled = cfg.Bind("3. 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 in a pack"); FacilityScrapPackEnabled = cfg.Bind("3. 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 in a pack"); 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", "Specifically which moons and how often the Pocket Watch will spawn, -1 to disable"); PocketWatchGlobalSpawnWeight = cfg.Bind("5. Scrap Pack Items", "Pocket Watch Global Spawn Weight", 15, "How often the Pocket Watch will spawn globally, -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", "Specifically which moons and how often the Servant Bell will spawn, -1 to disable"); ServantBellGlobalSpawnWeight = cfg.Bind("5. Scrap Pack Items", "Servant Bell Global Spawn Weight", 15, "How often the Servant Bell will spawn globally, -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", "Specifically which moons and how often Chess Pieces will spawn, -1 to disable"); ChessPiecesGlobalSpawnWeight = cfg.Bind("5. Scrap Pack Items", "Chess Pieces Global Spawn Weight", 30, "How often Chess Pieces will spawn globally, -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", "Specifically which moons and how often Golden Chess Pieces will spawn, -1 to disable"); GoldenChessPiecesGlobalSpawnWeight = cfg.Bind("5. Scrap Pack Items", "Golden Chess Pieces Global Spawn Weight", 10, "How often Golden Chess Pieces will spawn globally, -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", "Specifically which moons and how often the Traffic Cone will spawn, -1 to disable"); TrafficConeGlobalSpawnWeight = cfg.Bind("5. Scrap Pack Items", "Traffic Cone Global Spawn Weight", 20, "How often the Traffic Cone will spawn globally, -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", "Specifically which moons and how often the Mere Gear will spawn, -1 to disable"); MereGearGlobalSpawnWeight = cfg.Bind("5. Scrap Pack Items", "Mere Gear Global Spawn Weight", 25, "How often Mere Gear will spawn globally, -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", "Specifically which moons and how often the Ticket will spawn, -1 to disable"); TicketGlobalSpawnWeight = cfg.Bind("Scrap Items - Tickets", "Ticket Global Spawning", 40, "How often the Ticket will spawn globally, -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", "Specifically which moons and how often the Golden Ticket will spawn, -1 to disable"); GoldenTicketGlobalSpawnWeight = cfg.Bind("Scrap Items - Tickets", "Golden Ticket Global Spawning", 5, "How often the Golden Ticket will spawn globally, -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", "Specifically which moons and how often the Rose will spawn, -1 to disable"); RoseGlobalSpawnWeight = cfg.Bind("Scrap Item - Rose", "Rose Global Spawning", 35, "How often the Rose will spawn globally, -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", "Specifically which moons and how often the Sizable Scissors will spawn, -1 to disable"); SizableScissorsGlobalSpawnWeight = cfg.Bind("Scrap Item - Sizable Scissors", "Sizable Scissors Global Spawning", 20, "How often the Sizable Scissors will spawn globally, -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", "Specifically which moons and how often the Walking Cane will spawn, -1 to disable"); WalkingCaneGlobalSpawnWeight = cfg.Bind("Scrap Item - Walking Cane", "Walking Cane Global Spawning", 15, "How often the Walking Cane will spawn globally, -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", "Specifically which moons and how often the Candy Dispenser will spawn, -1 to disable"); CandyDispenserGlobalSpawnWeight = cfg.Bind("Scrap Item - Candy Dispenser", "Candy Dispenser Global Spawning", 30, "How often the Candy Dispenser will spawn globally, -1 to disable"); VintageCandyLoaded = cfg.Bind("Scrap Item - Vintage Candy", "Vintage Candy is loaded", true, "Whether or not the Vintage Candy is loaded, this is ignored and set to true automatically if the candy dispenser 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", "Specifically which moons and how often Vintage Candy will spawn, -1 to disable"); VintageCandyGlobalSpawnWeight = cfg.Bind("Scrap Item - Vintage Candy", "Vintage Candy Global Spawning", 20, "How often Vintage Candy will spawn globally, -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", "Specifically which moons and how often the Fuel Cylinder will spawn, -1 to disable"); FuelCylinderGlobalSpawnWeight = cfg.Bind("Scrap Item - Fuel Cylinder", "Fuel Cylinder Global Spawning", 25, "How often the Fuel Cylinder will spawn globally, -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", "Specifically which moons and how often the Radioactive Cell will spawn, -1 to disable"); RadioactiveCellGlobalSpawnWeight = cfg.Bind("Scrap Item - Radioactive Cell", "Radioactive Cell Global Spawning", 20, "How often the Radioactive Cell will spawn globally, -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", "Specifically which moons and how often the Gloomy Capsule will spawn, -1 to disable"); GloomyCapsuleGlobalSpawnWeight = cfg.Bind("Scrap Items - Capsules", "Gloomy Capsule Global Spawning", 15, "How often the Gloomy Capsule will spawn globally, -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", "Specifically which moons and how often the Frigid Capsule will spawn, -1 to disable"); FrigidCapsuleGlobalSpawnWeight = cfg.Bind("Scrap Items - Capsules", "Frigid Capsule Global Spawning", 15, "How often the Frigid Capsule will spawn globally, -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", "Specifically which moons and how often the Bloody Capsule will spawn, -1 to disable"); BloodyCapsuleGlobalSpawnWeight = cfg.Bind("Scrap Items - Capsules", "Bloody Capsule Global Spawning", 15, "How often the Bloody Capsule will spawn globally, -1 to disable"); PadlockLoaded = cfg.Bind("Scrap Item - Padlock", "Padlock is loaded", true, "Whether or not the Padlock is loaded"); PadlockSpawnsAsScrap = cfg.Bind("Scrap Item - Padlock", "Padlock is a scrap item", true, "Whether or not the Padlock spawns as scrap"); PadlockMoonSpawnWeights = cfg.Bind("Scrap 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", "Specifically which moons and how often the Padlock will spawn, -1 to disable"); PadlockGlobalSpawnWeight = cfg.Bind("Scrap Item - Padlock", "Padlock Global Spawning", 35, "How often the Padlock will spawn globally, -1 to disable"); CrowbarLoaded = cfg.Bind("Scrap Item - Crowbar", "Crowbar is loaded", true, "Whether or not the Crowbar is loaded"); CrowbarSpawnsAsScrap = cfg.Bind("Scrap Item - Crowbar", "Crowbar is a scrap item", true, "Whether or not the Crowbar spawns as scrap"); CrowbarMoonSpawnWeights = cfg.Bind("Scrap 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", "Specifically which moons and how often the Crowbar will spawn, -1 to disable"); CrowbarGlobalSpawnWeight = cfg.Bind("Scrap Item - Crowbar", "Crowbar Global Spawning", 25, "How often the Crowbar will spawn globally, -1 to disable"); FireAxeLoaded = cfg.Bind("Scrap Item - Fire Axe", "Fire Axe is loaded", false, "Whether or not the Fire Axe is loaded"); FireAxeSpawnsAsScrap = cfg.Bind("Scrap Item - Fire Axe", "Fire Axe is a scrap item", true, "Whether or not the Fire Axe spawns as scrap"); FireAxeMoonSpawnWeights = cfg.Bind("Scrap Item - Fire Axe", "Fire Axe Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Fire Axe will spawn, -1 to disable"); FireAxeGlobalSpawnWeight = cfg.Bind("Scrap Item - Fire Axe", "Fire Axe Global Spawning", 25, "How often the Fire Axe will spawn globally, -1 to disable"); SledgehammerLoaded = cfg.Bind("Scrap Item - Sledgehammer", "Sledgehammer is loaded", true, "Whether or not the Sledgehammer is loaded"); SledgehammerSpawnsAsScrap = cfg.Bind("Scrap Item - Sledgehammer", "Sledgehammer is a scrap item", true, "Whether or not the Sledgehammer spawns as scrap"); SledgehammerMoonSpawnWeights = cfg.Bind("Scrap Item - Sledgehammer", "Sledgehammer Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Sledgehammer will spawn, -1 to disable"); SledgehammerGlobalSpawnWeight = cfg.Bind("Scrap Item - Sledgehammer", "Sledgehammer Global Spawning", 20, "How often the Sledgehammer will spawn globally, -1 to disable"); AntiqueSwordLoaded = cfg.Bind("Scrap Item - Antique Sword", "Antique Sword is loaded", false, "Whether or not the Antique Sword is loaded"); AntiqueSwordSpawnsAsScrap = cfg.Bind("Scrap Item - Antique Sword", "Antique Sword is a scrap item", true, "Whether or not the Antique Sword spawns as scrap"); AntiqueSwordMoonSpawnWeights = cfg.Bind("Scrap Item - Antique Sword", "Antique Sword Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Antique Sword will spawn, -1 to disable"); AntiqueSwordGlobalSpawnWeight = cfg.Bind("Scrap Item - Antique Sword", "Antique Sword Global Spawning", 20, "How often the Antique Sword will spawn globally, -1 to disable"); RegalScepterLoaded = cfg.Bind("Scrap Item - Regal Scepter", "Regal Scepter is loaded", false, "Whether or not the Regal Scepter is loaded"); RegalScepterSpawnsAsScrap = cfg.Bind("Scrap Item - Regal Scepter", "Regal Scepter is a scrap item", true, "Whether or not the Regal Scepter spawns as scrap"); RegalScepterMoonSpawnWeights = cfg.Bind("Scrap Item - Regal Scepter", "Regal Scepter Moon Spawning", "experimentation=-1, vow=-1, march=-1, assurance=-1, offense=-1, rend=-1, dine=-1, titan=-1, adamance=-1, artifice=-1, embrion=-1", "Specifically which moons and how often the Regal Scepter will spawn, -1 to disable"); RegalScepterGlobalSpawnWeight = cfg.Bind("Scrap Item - Regal Scepter", "Regal Scepter Global Spawning", 15, "How often the Regal Scepter will spawn globally, -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"); BlowtorchLoaded = cfg.Bind("Store Item - Blowtorch", "Blowtorch is loaded", true, "Whether or not the Blowtorch is loaded"); BlowtorchIsStoreItem = cfg.Bind("Store Item - Blowtorch", "Blowtorch is a store item", true, "Whether or not the Blowtorch is a store item"); BlowtorchStorePrice = cfg.Bind("Store Item - Blowtorch", "Blowtorch store price", 245, "The store price of the Blowtorch"); ShockBatonLoaded = cfg.Bind("Store Item - Shock Baton", "Shock Baton is loaded", false, "Whether or not the Shock Baton is loaded"); ShockBatonIsStoreItem = cfg.Bind("Store Item - Shock Baton", "Shock Baton is a store item", true, "Whether or not the Shock Baton is a store item"); ShockBatonStorePrice = cfg.Bind("Store Item - Shock Baton", "Shock Baton store price", 115, "The store price of the Shock Baton"); 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.Patches { internal static class Deathtracker { public static readonly Dictionary DeathAnimations = new Dictionary(); public static readonly Dictionary CausesOfDeath = new Dictionary(); public static readonly HashSet BurstCorpses = new HashSet(); public static readonly HashSet SpiderWebbedBodies = new HashSet(); public static void Clear() { DeathAnimations.Clear(); CausesOfDeath.Clear(); BurstCorpses.Clear(); SpiderWebbedBodies.Clear(); } } [HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")] internal class KillPlayerPatch { [HarmonyPrefix] private static void Prefix(PlayerControllerB __instance, CauseOfDeath causeOfDeath, int deathAnimation) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) int key = (int)__instance.playerClientId; Deathtracker.CausesOfDeath[key] = causeOfDeath; Deathtracker.DeathAnimations[key] = deathAnimation; } } [HarmonyPatch(typeof(CadaverGrowthAI), "BurstFromPlayer")] internal class CadaverGrowthBurstPatch { [HarmonyPrefix] private static void Prefix(PlayerControllerB playerScript) { Deathtracker.BurstCorpses.Add((int)playerScript.playerClientId); } } [HarmonyPatch(typeof(SandSpiderAI))] internal class SandSpiderPatches { [HarmonyPatch("HangBodyFromCeiling")] [HarmonyPrefix] private static void HangBodyFromCeilingPrefix(DeadBodyInfo ___currentlyHeldBody) { if (!((Object)(object)___currentlyHeldBody == (Object)null)) { Deathtracker.SpiderWebbedBodies.Add(___currentlyHeldBody.playerObjectId); } } } [HarmonyPatch(typeof(StartOfRound), "ResetShip")] internal class RoundResetPatch { [HarmonyPostfix] private static void ResetShipPostfix() { Deathtracker.Clear(); } } [HarmonyPatch(typeof(HUDManager), "UpdateBoxesSpectateUI")] internal class SpectateUIFix { private static readonly FieldInfo boxesField = AccessTools.Field(typeof(HUDManager), "spectatingPlayerBoxes"); private static readonly FieldInfo boxesAddedField = AccessTools.Field(typeof(HUDManager), "boxesAdded"); private static readonly FieldInfo yOffsetAmountField = AccessTools.Field(typeof(HUDManager), "yOffsetAmount"); private static void Postfix(HUDManager __instance) { //IL_008e: 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) //IL_00f1: 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_010d: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = (Dictionary)boxesField.GetValue(__instance); List list = new List(); foreach (KeyValuePair item in dictionary) { if (!item.Value.isPlayerDead) { list.Add(item.Key); } } foreach (Animator item2 in list) { RectTransform component = ((Component)item2).GetComponent(); float y = component.anchoredPosition.y; foreach (KeyValuePair item3 in dictionary) { if (!((Object)(object)item3.Key == (Object)(object)item2)) { RectTransform component2 = ((Component)item3.Key).GetComponent(); if (component2.anchoredPosition.y <= y) { component2.anchoredPosition = new Vector2(component2.anchoredPosition.x, component2.anchoredPosition.y + 70f); } } } Object.Destroy((Object)(object)((Component)item2).gameObject); dictionary.Remove(item2); int num = (int)boxesAddedField.GetValue(__instance); float num2 = (float)yOffsetAmountField.GetValue(__instance); boxesAddedField.SetValue(__instance, num - 1); yOffsetAmountField.SetValue(__instance, num2 + 70f); } } } } namespace UsualScrap.Behaviors { internal class AntiqueSwordScript : GrabbableObject { private PlayerControllerB previousPlayerHeldBy; private AudioSource swordAudio; 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() { try { swordAudio = ((Component)((Component)this).transform.Find("SwordSounds")).gameObject.GetComponent(); AudioSource[] components = ((Component)((Component)this).transform.Find("SwordSounds")).gameObject.GetComponents(); swing = components[1].clip; hitSFX = (AudioClip[])(object)new AudioClip[1] { swordAudio.clip }; } catch (Exception ex) { Debug.LogError((object)ex.Message); } } 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) { swordAudio.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_043a: 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 num2 = 0; num2 < objectsHitByMeleeWeaponList.Count; num2++) { RaycastHit val = objectsHitByMeleeWeaponList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByMeleeWeaponList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByMeleeWeaponList[num2]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = objectsHitByMeleeWeaponList[num2]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByMeleeWeaponList[num2]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; val = objectsHitByMeleeWeaponList[num2]; 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[num2]; 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)) { goto IL_0369; } continue; } val = objectsHitByMeleeWeaponList[num2]; 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[num2]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; val = objectsHitByMeleeWeaponList[num2]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int num3 = 0; num3 < StartOfRound.Instance.footstepSurfaces.Length; num3++) { if (StartOfRound.Instance.footstepSurfaces[num3].surfaceTag == tag) { num = num3; swordAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num3].hitSurfaceSFX); break; } } } } if (flag) { int num4 = RoundManager.PlayRandomClip(swordAudio, hitSFX, true, 1f, 0, 1000); Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); if (num != -1) { swordAudio.PlayOneShot(hitSFX[num4]); WalkieTalkie.TransmitOneShotAudio(swordAudio, hitSFX[num4], 1f); } base.playerHeldBy.playerBodyAnimator.SetTrigger("shovelHit"); HitMeleeWeaponServerRpc(num4); } } [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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3447496327u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, sound); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3447496327u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2385955149u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, sound); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2385955149u, val2, (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) { swordAudio.PlayOneShot(hitSFX[sound]); } } 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(3447496327u, new RpcReceiveHandler(__rpc_handler_3447496327), "HitMeleeWeaponServerRpc"); ((NetworkBehaviour)this).__registerRpc(2385955149u, new RpcReceiveHandler(__rpc_handler_2385955149), "HitMeleeWeaponClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3447496327(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; ((AntiqueSwordScript)(object)target).HitMeleeWeaponServerRpc(sound); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2385955149(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; ((AntiqueSwordScript)(object)target).HitMeleeWeaponClientRpc(sound); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "AntiqueSwordScript"; } } 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(87823207u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 87823207u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2085797069u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2085797069u, val2, (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; private Transform candyTube; 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 }; candyTube = ((Component)((Component)this).transform.Find("CandyDispenserModel")).transform.Find("CandyTube"); } 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_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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3606619266u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3606619266u, val2, (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_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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(809217553u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref color); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 809217553u, val2, (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 num2 = 0; num2 < objectsHitByMeleeWeaponList.Count; num2++) { RaycastHit val = objectsHitByMeleeWeaponList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByMeleeWeaponList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByMeleeWeaponList[num2]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = objectsHitByMeleeWeaponList[num2]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByMeleeWeaponList[num2]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; val = objectsHitByMeleeWeaponList[num2]; 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[num2]; 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)) { goto IL_0369; } continue; } val = objectsHitByMeleeWeaponList[num2]; 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[num2]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; val = objectsHitByMeleeWeaponList[num2]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int num3 = 0; num3 < StartOfRound.Instance.footstepSurfaces.Length; num3++) { if (StartOfRound.Instance.footstepSurfaces[num3].surfaceTag == tag) { num = num3; dispenserAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num3].hitSurfaceSFX); break; } } } float num4 = new Random().Next(1, 15); if (num4 == 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 num5 = 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[num5]); WalkieTalkie.TransmitOneShotAudio(dispenserAudio, hitSFX[num5], 1f); } base.playerHeldBy.playerBodyAnimator.SetTrigger("shovelHit"); HitMeleeWeaponServerRpc(num5); } } [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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2363479380u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, sound); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2363479380u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(823714643u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, sound); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 823714643u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2364265404u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2364265404u, val2, (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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) Item val = PullCandyItem(); GameObject val2 = Object.Instantiate(val.spawnPrefab, candyTube.position, Quaternion.identity); GrabbableObject component = val2.GetComponent(); component.SetScrapValue(5); component.fallTime = 0f; component.floorYRot = Random.Range(0, 360); ((NetworkBehaviour)component).NetworkObject.Spawn(false); SyncScrapValueClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)component).NetworkObject), 5, component.floorYRot); } [ClientRpc] private void SyncScrapValueClientRpc(NetworkObjectReference itemRef, int value, int rotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1927767254u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref itemRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); BytePacker.WriteValueBitPacked(val, rotation); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1927767254u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref itemRef)).TryGet(ref val3, (NetworkManager)null)) { GrabbableObject component = ((Component)val3).GetComponent(); component.SetScrapValue(value); component.floorYRot = rotation; } } } 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) { NamespacedKey uS_VintageCandy = Plugin.ScrapItemKeys.US_VintageCandy; _candyItem = ((Registry)(object)LethalContent.Items)[uS_VintageCandy].Item; } 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 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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"); ((NetworkBehaviour)this).__registerRpc(1927767254u, new RpcReceiveHandler(__rpc_handler_1927767254), "SyncScrapValueClientRpc"); ((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; } } private static void __rpc_handler_1927767254(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_003e: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemRef, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); int rotation = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref rotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((CandyDispenserScript)(object)target).SyncScrapValueClientRpc(itemRef, value, rotation); 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 num2 = 0; num2 < objectsHitByMeleeWeaponList.Count; num2++) { RaycastHit val = objectsHitByMeleeWeaponList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByMeleeWeaponList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByMeleeWeaponList[num2]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = objectsHitByMeleeWeaponList[num2]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByMeleeWeaponList[num2]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; val = objectsHitByMeleeWeaponList[num2]; 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[num2]; 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)) { goto IL_0369; } continue; } val = objectsHitByMeleeWeaponList[num2]; 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[num2]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; val = objectsHitByMeleeWeaponList[num2]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int num3 = 0; num3 < StartOfRound.Instance.footstepSurfaces.Length; num3++) { if (StartOfRound.Instance.footstepSurfaces[num3].surfaceTag == tag) { num = num3; crowbarAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num3].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 num4 = 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[num4]); WalkieTalkie.TransmitOneShotAudio(crowbarAudio, hitSFX[num4], 1f); } base.playerHeldBy.playerBodyAnimator.SetTrigger("shovelHit"); HitMeleeWeaponServerRpc(num4); } } [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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(18646315u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, sound); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 18646315u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(292927352u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, sound); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 292927352u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(121767703u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 121767703u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4047106965u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4047106965u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1016317823u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1016317823u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3693078860u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3693078860u, val2, (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 display in array) { display.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 display2 in array2) { display2.material.SetColor("_EmissiveColor", Color.black); } yield break; } ReadyingDefib = false; break; } Renderer[] array3 = displayRenderers; foreach (Renderer display3 in array3) { display3.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_0236: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Invalid comparison between Unknown and I4 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) { if (val2.detachedHead || (Object)(object)val2.detachedHeadObject != (Object)null) { MonoBehaviour.print((object)"US - This corpse has no head!"); break; } if (Deathtracker.DeathAnimations.TryGetValue(val2.playerObjectId, out var value) && (((uint)(value - 1) <= 1u || (uint)(value - 6) <= 3u) ? true : false)) { MonoBehaviour.print((object)"US - This corpse can't be saved. What a mess."); break; } if (Deathtracker.CausesOfDeath.TryGetValue(val2.playerObjectId, out var value2) && (int)value2 == 13) { break; } if (Deathtracker.BurstCorpses.Contains(val2.playerObjectId) || Deathtracker.SpiderWebbedBodies.Contains(val2.playerObjectId)) { MonoBehaviour.print((object)"US - This corpse is infected. Nasty."); 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(803055702u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, ID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 803055702u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(409997040u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, ID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref SpawnPosition); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 409997040u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(106382891u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, ID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref SpawnPosition); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 106382891u, val2, (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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0511: 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 ((Object)(object)base.playerHeldBy != (Object)null) { if (base.playerHeldBy.isInsideFactory) { val.isInsideFactory = true; val.isInElevator = false; val.isInHangarShipRoom = false; } else { val.isInsideFactory = false; val.isInElevator = true; val.isInHangarShipRoom = true; } } 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.enemyWaitingForBodyRagdoll = null; 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 (GameNetworkManager.Instance.localPlayerController.isPlayerDead) { 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"; } } internal class FireAxeScript : GrabbableObject { private PlayerControllerB previousPlayerHeldBy; private AudioSource axeAudio; private AudioClip swing; private AudioClip[] hitSFX; private bool isReadied = false; private int ReadyWeaponTime; private Coroutine readyingRoutine; 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() { try { axeAudio = ((Component)((Component)this).transform.Find("AxeSounds")).gameObject.GetComponent(); AudioSource[] components = ((Component)((Component)this).transform.Find("AxeSounds")).gameObject.GetComponents(); swing = components[1].clip; hitSFX = (AudioClip[])(object)new AudioClip[1] { axeAudio.clip }; } catch (Exception ex) { Debug.LogError((object)ex.Message); } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); StartReadyingTimer(); } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if (readyingRoutine != null) { ((MonoBehaviour)this).StopCoroutine(readyingRoutine); readyingRoutine = null; } if (((NetworkBehaviour)this).IsServer) { ToggleReadyWeaponClientRpc(readied: false); } else { ToggleReadyWeaponServerRpc(readied: false); } } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.activatingItem = false; } ((GrabbableObject)this).DiscardItem(); if (readyingRoutine != null) { ((MonoBehaviour)this).StopCoroutine(readyingRoutine); readyingRoutine = null; } if (((NetworkBehaviour)this).IsServer) { ToggleReadyWeaponClientRpc(readied: false); } else { ToggleReadyWeaponServerRpc(readied: false); } } 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) { axeAudio.PlayOneShot(swing); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public void HitMeleeWeapon(bool cancel = false) { //IL_0098: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: 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_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: 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_02d1: 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_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0381: 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_03c3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)previousPlayerHeldBy == (Object)null) { return; } if (!cancel) { MonoBehaviour.print((object)"ready cancelled"); if (((NetworkBehaviour)this).IsServer) { ToggleReadyWeaponClientRpc(readied: false); } else { ToggleReadyWeaponServerRpc(readied: false); } StartReadyingTimer(); } 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 num2 = 0; num2 < objectsHitByMeleeWeaponList.Count; num2++) { RaycastHit val = objectsHitByMeleeWeaponList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByMeleeWeaponList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByMeleeWeaponList[num2]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = objectsHitByMeleeWeaponList[num2]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByMeleeWeaponList[num2]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; val = objectsHitByMeleeWeaponList[num2]; 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[num2]; 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)) { goto IL_03ac; } continue; } val = objectsHitByMeleeWeaponList[num2]; if (!((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent() != (Object)null)) { goto IL_03ac; } if (flag3) { continue; } flag3 = true; goto IL_03ac; IL_03ac: bool flag4; if (isReadied) { flag4 = val2.Hit(meleeWeaponHitForce * 2, forward, previousPlayerHeldBy, true, 1); if (flag4) { if (((NetworkBehaviour)this).IsServer) { ToggleReadyWeaponClientRpc(readied: false); } else { ToggleReadyWeaponServerRpc(readied: false); } } } else { 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[num2]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; val = objectsHitByMeleeWeaponList[num2]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int num3 = 0; num3 < StartOfRound.Instance.footstepSurfaces.Length; num3++) { if (StartOfRound.Instance.footstepSurfaces[num3].surfaceTag == tag) { num = num3; axeAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num3].hitSurfaceSFX); break; } } } } if (flag) { int num4 = RoundManager.PlayRandomClip(axeAudio, hitSFX, true, 1f, 0, 1000); Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); if (num != -1) { axeAudio.PlayOneShot(hitSFX[num4]); WalkieTalkie.TransmitOneShotAudio(axeAudio, hitSFX[num4], 1f); } base.playerHeldBy.playerBodyAnimator.SetTrigger("shovelHit"); HitMeleeWeaponServerRpc(num4); } } [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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1346745646u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, sound); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1346745646u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(766649229u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, sound); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 766649229u, val2, (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) { axeAudio.PlayOneShot(hitSFX[sound]); } } [ServerRpc] public void ToggleReadyWeaponServerRpc(bool readied) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(840298944u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref readied, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 840298944u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleReadyWeaponClientRpc(readied); } } [ClientRpc] public void ToggleReadyWeaponClientRpc(bool readied) { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1781573346u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref readied, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1781573346u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleReadyWeapon(readied); } } } public void ToggleReadyWeapon(bool readied) { isReadied = readied; if (readied) { isReadied = true; } else { isReadied = false; } } private void StartReadyingTimer() { if (readyingRoutine != null) { ((MonoBehaviour)this).StopCoroutine(readyingRoutine); } readyingRoutine = ((MonoBehaviour)this).StartCoroutine(ReadyingTimer()); } private IEnumerator ReadyingTimer() { yield return (object)new WaitForSeconds(15f); if (!isReadied) { MonoBehaviour.print((object)"weapon readied"); if (((NetworkBehaviour)this).IsServer) { ToggleReadyWeaponClientRpc(readied: true); } else { ToggleReadyWeaponServerRpc(readied: true); } } readyingRoutine = null; } 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(1346745646u, new RpcReceiveHandler(__rpc_handler_1346745646), "HitMeleeWeaponServerRpc"); ((NetworkBehaviour)this).__registerRpc(766649229u, new RpcReceiveHandler(__rpc_handler_766649229), "HitMeleeWeaponClientRpc"); ((NetworkBehaviour)this).__registerRpc(840298944u, new RpcReceiveHandler(__rpc_handler_840298944), "ToggleReadyWeaponServerRpc"); ((NetworkBehaviour)this).__registerRpc(1781573346u, new RpcReceiveHandler(__rpc_handler_1781573346), "ToggleReadyWeaponClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1346745646(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; ((FireAxeScript)(object)target).HitMeleeWeaponServerRpc(sound); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_766649229(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; ((FireAxeScript)(object)target).HitMeleeWeaponClientRpc(sound); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_840298944(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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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 { bool readied = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref readied, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((FireAxeScript)(object)target).ToggleReadyWeaponServerRpc(readied); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1781573346(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 readied = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref readied, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((FireAxeScript)(object)target).ToggleReadyWeaponClientRpc(readied); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "FireAxeScript"; } } 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1202212278u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1202212278u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3740556898u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3740556898u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2841949532u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2841949532u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2562481381u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2562481381u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2521115770u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2521115770u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(323017126u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 323017126u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2796347741u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref f, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2796347741u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(431760331u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref State, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 431760331u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3305488877u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3305488877u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4177066957u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref toggle, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4177066957u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3620014731u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3620014731u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1931107274u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1931107274u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(839018670u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref indoors, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 839018670u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(347973268u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref isIndoors, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 347973268u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(445196551u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref vector); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 445196551u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2069273192u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, ID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2069273192u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1650880828u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1650880828u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1237844101u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1237844101u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(283028086u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, ID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 283028086u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4177853400u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, ID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4177853400u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1457944474u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1457944474u, val2, (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.3f, otherplayer: false)); } } else { healCoroutine = ((MonoBehaviour)this).StartCoroutine(HealPlayer((int)base.playerHeldBy.playerClientId, 0.3f, 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3322642250u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3322642250u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3730725157u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3730725157u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1821240513u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1821240513u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3772690673u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((FastBufferWriter)(ref val)).WriteValueSafe(ref otherplayer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3772690673u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1380560060u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1380560060u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1621356948u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1621356948u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2862679596u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2862679596u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4258470499u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4258470499u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2909117143u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref Used, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2909117143u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(459030011u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref Used, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 459030011u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(649887750u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 649887750u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3127999173u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref color); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3127999173u, val2, (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 RedoneBlowtorch : GrabbableObject { public enum blowtorchTargets { None, Player, Turret, Landmine, Enemy } private static Item _laserPointerItem; private static Item _bigBoltItem; private static Item _metalSheetItem; private bool damageReady = true; private bool isCutting = false; private float currentHeat; private readonly float heatThreshold = 100f; private bool overheating = false; private readonly float heatGainRate = 8f; private readonly float heatCoolRate = 16f; private float burnDamageCooldown = 5f; private RaycastHit[] enemyHits = (RaycastHit[])(object)new RaycastHit[10]; private Coroutine startEffectsRoutine; private Coroutine functionRoutine; private GameObject previoustrap; private GameObject currentTrap; private float trapStartTime; private float damageCooldown; private bool isHoldingButton; private ParticleSystem sparkEffect; private ParticleSystem idleEffect; private ParticleSystem longCuttingEffect; private ParticleSystem mediumCuttingEffect; private ParticleSystem wildEffect; private ParticleSystem smokeEffectWarning; private ParticleSystem smokeEffectDanger; private ParticleSystem overloadedEffect; private ParticleSystem overloadingEffect; private GameObject spark = null; private GameObject sparkPop = null; private AudioSource weldFlame; private AudioSource weldSparks; private Coroutine weldSoundRoutine; public void Awake() { idleEffect = ((Component)((Component)this).transform.Find("TorchIdleEffect")).GetComponent(); longCuttingEffect = ((Component)((Component)this).transform.Find("TorchCuttingEffectLong")).GetComponent(); mediumCuttingEffect = ((Component)((Component)this).transform.Find("TorchCuttingEffectMedium")).GetComponent(); wildEffect = ((Component)((Component)this).transform.Find("TorchWildEffect")).GetComponent(); smokeEffectWarning = ((Component)((Component)this).transform.Find("TorchSmokeEffectsWarning")).GetComponent(); smokeEffectDanger = ((Component)((Component)this).transform.Find("TorchSmokeEffectsDanger")).GetComponent(); overloadedEffect = ((Component)((Component)this).transform.Find("TorchOverloadedEffect")).GetComponent(); overloadingEffect = ((Component)((Component)this).transform.Find("TorchOverloadingEffect")).GetComponent(); AudioSource[] components = ((Component)((Component)this).transform.Find("BlowtorchSounds")).gameObject.GetComponents(); weldFlame = components[0]; weldSparks = components[1]; } public void Update() { ((GrabbableObject)this).Update(); UpdateHeat(); } public override void OnDestroy() { if ((Object)(object)spark != (Object)null) { Object.Destroy((Object)(object)spark); } isHoldingButton = false; weldFlame.Stop(); weldSparks.Stop(); ((GrabbableObject)this).OnDestroy(); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); isHoldingButton = false; if (weldSoundRoutine != null) { ((MonoBehaviour)this).StopCoroutine(weldSoundRoutine); weldSoundRoutine = null; } weldSoundRoutine = ((MonoBehaviour)this).StartCoroutine(FadeFlameRoutine(0)); ResetTorchEffects(); } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); isHoldingButton = false; if (startEffectsRoutine != null) { ((MonoBehaviour)this).StopCoroutine(startEffectsRoutine); startEffectsRoutine = null; } if (weldSoundRoutine != null) { ((MonoBehaviour)this).StopCoroutine(weldSoundRoutine); weldSoundRoutine = null; } weldSoundRoutine = ((MonoBehaviour)this).StartCoroutine(FadeFlameRoutine(0)); idleEffect.Stop(true, (ParticleSystemStopBehavior)1); wildEffect.Stop(true, (ParticleSystemStopBehavior)1); longCuttingEffect.Stop(true, (ParticleSystemStopBehavior)1); mediumCuttingEffect.Stop(true, (ParticleSystemStopBehavior)1); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); ResetTorchEffects(); } private void ResetTorchEffects() { if (startEffectsRoutine != null) { ((MonoBehaviour)this).StopCoroutine(startEffectsRoutine); startEffectsRoutine = null; } idleEffect.Play(); wildEffect.Stop(true, (ParticleSystemStopBehavior)1); longCuttingEffect.Stop(true, (ParticleSystemStopBehavior)1); mediumCuttingEffect.Stop(true, (ParticleSystemStopBehavior)1); } private IEnumerator StartTorchEffects() { idleEffect.Stop(true, (ParticleSystemStopBehavior)1); wildEffect.Play(); mediumCuttingEffect.Play(); float timer = 0f; while (timer < 0.25f) { if (!base.isHeld || !isHoldingButton || (Object)(object)base.playerHeldBy == (Object)null) { ResetTorchEffects(); startEffectsRoutine = null; yield break; } timer += Time.deltaTime; yield return null; } mediumCuttingEffect.Stop(true, (ParticleSystemStopBehavior)1); longCuttingEffect.Play(); timer = 0f; while (timer < 0.25f) { if (!base.isHeld || !isHoldingButton || (Object)(object)base.playerHeldBy == (Object)null) { ResetTorchEffects(); startEffectsRoutine = null; yield break; } timer += Time.deltaTime; yield return null; } wildEffect.Stop(true, (ParticleSystemStopBehavior)1); startEffectsRoutine = null; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if ((Object)(object)base.playerHeldBy == (Object)null) { return; } isHoldingButton = buttonDown; if (!buttonDown) { currentTrap = null; trapStartTime = 0f; ResetTorchEffects(); if (weldSoundRoutine != null) { ((MonoBehaviour)this).StopCoroutine(weldSoundRoutine); weldSoundRoutine = null; } weldSoundRoutine = ((MonoBehaviour)this).StartCoroutine(FadeFlameRoutine(0)); if ((Object)(object)spark != (Object)null) { spark.SetActive(false); } } else if (buttonDown && functionRoutine == null) { functionRoutine = ((MonoBehaviour)this).StartCoroutine(Function()); if (startEffectsRoutine == null) { startEffectsRoutine = ((MonoBehaviour)this).StartCoroutine(StartTorchEffects()); } if (weldSoundRoutine != null) { ((MonoBehaviour)this).StopCoroutine(weldSoundRoutine); weldSoundRoutine = null; } weldSoundRoutine = ((MonoBehaviour)this).StartCoroutine(FadeFlameRoutine(1)); } } private IEnumerator FadeFlameRoutine(int volume) { if (!weldFlame.isPlaying) { weldFlame.Play(); } while (!Mathf.Approximately(weldFlame.volume, (float)volume)) { weldFlame.volume = Mathf.MoveTowards(weldFlame.volume, (float)volume, 5f * Time.deltaTime); yield return null; } if (Mathf.Approximately((float)volume, 0f)) { weldFlame.Stop(); } weldSoundRoutine = null; } private IEnumerator Function() { RaycastHit raycastHit = default(RaycastHit); Landmine mine = default(Landmine); Turret Turret = default(Turret); IHittable hittable = default(IHittable); while (base.isHeld && isHoldingButton) { yield return (object)new WaitForSeconds(0.02f); if ((Object)(object)base.playerHeldBy == (Object)null || (Object)(object)base.playerHeldBy.gameplayCamera == (Object)null || (Object)(object)base.playerHeldBy.currentlyHeldObjectServer != (Object)(object)this) { break; } if (!damageReady && Time.time >= damageCooldown) { damageReady = true; } isCutting = false; Vector3 origin = ((Component)base.playerHeldBy.gameplayCamera).transform.position + ((Component)base.playerHeldBy.gameplayCamera).transform.forward * 0.5f; if (Physics.SphereCast(origin, 0.35f, ((Component)base.playerHeldBy.gameplayCamera).transform.forward, ref raycastHit, 3.5f, LayerMask.GetMask(new string[2] { "MapHazards", "Enemies" }))) { if ((Object)(object)spark == (Object)null) { spark = Object.Instantiate(Plugin.EffectLoader.Get("Assets/UsualScrapContent/ParticlePrefabs/TorchSparkEffect.prefab"), ((RaycastHit)(ref raycastHit)).point, Quaternion.LookRotation(((RaycastHit)(ref raycastHit)).normal)); sparkEffect = spark.GetComponent(); if (!sparkEffect.isPlaying) { spark.GetComponent().Play(); } } else { spark.transform.position = ((RaycastHit)(ref raycastHit)).point; spark.transform.rotation = Quaternion.LookRotation(((RaycastHit)(ref raycastHit)).normal); if (!spark.activeSelf) { spark.SetActive(true); } if (!sparkEffect.isPlaying) { spark.GetComponent().Play(); } } if ((Object)(object)sparkPop == (Object)null) { sparkPop = Object.Instantiate(Plugin.EffectLoader.Get("Assets/UsualScrapContent/ParticlePrefabs/TorchSparkPopEffect.prefab"), ((Component)this).transform.position, Quaternion.LookRotation(((RaycastHit)(ref raycastHit)).normal)); } if (((Component)((Component)((RaycastHit)(ref raycastHit)).collider).transform).TryGetComponent(ref mine)) { if ((Object)(object)currentTrap != (Object)(object)((Component)mine).gameObject) { currentTrap = ((Component)mine).gameObject; trapStartTime = Time.time; } else { isCutting = true; if (Time.time - trapStartTime >= 4f) { currentTrap = null; trapStartTime = 0f; if ((Object)(object)spark != (Object)null) { spark.SetActive(false); } if ((Object)(object)sparkPop != (Object)null) { sparkPop.transform.position = ((Component)mine).transform.position; sparkPop.GetComponent().Play(); } HUDManager.Instance.ShakeCamera((ScreenShakeType)0); destroyTrapServerRpc(); } } } else { if (((Component)((Component)((RaycastHit)(ref raycastHit)).collider).transform).TryGetComponent(ref Turret)) { if ((Object)(object)currentTrap != (Object)(object)((Component)Turret).gameObject) { currentTrap = ((Component)Turret).gameObject; trapStartTime = Time.time; } else { isCutting = true; if (Time.time - trapStartTime >= 8f) { currentTrap = null; trapStartTime = 0f; if ((Object)(object)spark != (Object)null) { spark.SetActive(false); } if ((Object)(object)sparkPop != (Object)null) { sparkPop.transform.position = ((Component)Turret).transform.position; sparkPop.GetComponent().Play(); } HUDManager.Instance.ShakeCamera((ScreenShakeType)0); destroyTrapServerRpc(); } } } else { Ray enemyRay = new Ray(origin, ((Component)base.playerHeldBy.gameplayCamera).transform.forward); int hitCount = Physics.SphereCastNonAlloc(enemyRay, 0.35f, enemyHits, 3.5f, LayerMask.GetMask(new string[1] { "Enemies" }), (QueryTriggerInteraction)2); EnemyAICollisionDetect closestEnemy = null; IHittable closestHittable = null; float closestDistance = float.MaxValue; for (int i = 0; i < hitCount; i++) { EnemyAICollisionDetect detect = ((Component)((RaycastHit)(ref enemyHits[i])).collider).GetComponentInParent(); if (!((Object)(object)detect == (Object)null) && ((Component)detect).TryGetComponent(ref hittable) && (!detect.onlyCollideWhenGrounded || detect.alwaysAllowHitting)) { if (((RaycastHit)(ref enemyHits[i])).distance < closestDistance) { closestDistance = ((RaycastHit)(ref enemyHits[i])).distance; closestEnemy = detect; closestHittable = hittable; } hittable = null; } } if ((Object)(object)closestEnemy != (Object)null) { currentTrap = null; trapStartTime = 0f; if ((Object)(object)spark != (Object)null) { spark.SetActive(false); } if (damageReady) { Vector3 forward = ((Component)base.playerHeldBy.gameplayCamera).transform.forward; closestHittable.Hit(1, forward, base.playerHeldBy, true, 1); damageReady = false; damageCooldown = Time.time + 1.5f; } } else { currentTrap = null; trapStartTime = 0f; if ((Object)(object)spark != (Object)null) { spark.SetActive(false); } } } Turret = null; } mine = null; } else { currentTrap = null; trapStartTime = 0f; if ((Object)(object)spark != (Object)null) { spark.SetActive(false); } } if (isCutting && !weldSparks.isPlaying) { weldSparks.Play(); } else if (!isCutting) { weldSparks.Stop(); } raycastHit = default(RaycastHit); } currentTrap = null; trapStartTime = 0f; ResetTorchEffects(); if ((Object)(object)spark != (Object)null) { spark.SetActive(false); } functionRoutine = null; } [ServerRpc] public void destroyTrapServerRpc() { //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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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 //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: 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)) { 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4197878062u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4197878062u, val2, (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.2f, ((Component)base.playerHeldBy.gameplayCamera).transform.forward, ref val3, 3f, LayerMask.GetMask(new string[1] { "MapHazards" }))) { return; } Turret component = ((Component)((RaycastHit)(ref val3)).transform).GetComponent(); Landmine component2 = ((Component)((RaycastHit)(ref val3)).transform).GetComponent(); if ((Object)(object)component != (Object)null) { switch (Random.Range(1, 3)) { case 1: SpawnScrap(_metalSheetItem, ((Component)component).transform.position + Vector3.up * 0.25f); break; case 2: SpawnScrap(_bigBoltItem, ((Component)component).transform.position + Vector3.up * 0.25f); break; } int num = Random.Range(1, 6); if (num == 1) { SpawnScrap(_laserPointerItem, ((Component)component).transform.position + Vector3.up * 0.25f); } ((NetworkBehaviour)component).NetworkObject.Despawn(true); } else if ((Object)(object)component2 != (Object)null) { int num2 = Random.Range(1, 7); if ((uint)(num2 - 1) <= 2u) { SpawnScrap(_metalSheetItem, ((Component)component2).transform.position); } else if ((uint)(num2 - 4) <= 2u) { SpawnScrap(_bigBoltItem, ((Component)component2).transform.position); } ((NetworkBehaviour)component2).NetworkObject.Despawn(true); } } [ClientRpc] public void destroyTrapClientRpc() { //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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(154910867u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 154910867u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; } } } public void SpawnScrap(Item item, Vector3 position) { //IL_0083: 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_0097: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) Item val = null; int num = 0; if ((Object)(object)item == (Object)(object)_metalSheetItem) { val = PullScrapitem(_metalSheetItem); num = Random.Range(15, 25); } if ((Object)(object)item == (Object)(object)_bigBoltItem) { val = PullScrapitem(_bigBoltItem); num = Random.Range(15, 25); } if ((Object)(object)item == (Object)(object)_laserPointerItem) { val = PullScrapitem(_laserPointerItem); num = Random.Range(45, 65); } GameObject val2 = Object.Instantiate(val.spawnPrefab, position, Quaternion.identity); GrabbableObject component = val2.GetComponent(); component.startFallingPosition = position; component.fallTime = 0f; ((MonoBehaviour)this).StartCoroutine(SetObjectToHitGroundSFX(component)); component.targetFloorPosition = component.GetItemFloorPosition(position); component.SetScrapValue(num); component.floorYRot = Random.Range(0, 360); ((NetworkBehaviour)component).NetworkObject.Spawn(false); SyncScrapValueClientRpc(NetworkObjectReference.op_Implicit(val2), num, component.floorYRot); } public static Item PullScrapitem(Item item) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown if ((Object)(object)item == (Object)(object)_laserPointerItem) { if ((Object)_laserPointerItem == (Object)null) { NamespacedKey laserpointer = ItemKeys.Laserpointer; _laserPointerItem = ((Registry)(object)LethalContent.Items)[laserpointer].Item; } return _laserPointerItem; } if ((Object)(object)item == (Object)(object)_bigBoltItem) { if ((Object)_bigBoltItem == (Object)null) { NamespacedKey bigbolt = ItemKeys.Bigbolt; _bigBoltItem = ((Registry)(object)LethalContent.Items)[bigbolt].Item; } return _bigBoltItem; } if ((Object)(object)item == (Object)(object)_metalSheetItem) { if ((Object)_metalSheetItem == (Object)null) { NamespacedKey metalsheet = ItemKeys.Metalsheet; _metalSheetItem = ((Registry)(object)LethalContent.Items)[metalsheet].Item; } return _metalSheetItem; } return null; } private IEnumerator SetObjectToHitGroundSFX(GrabbableObject lootObject) { yield return (object)new WaitForEndOfFrame(); lootObject.reachedFloorTarget = false; lootObject.hasHitGround = false; lootObject.fallTime = 0f; } [ClientRpc] private void SyncScrapValueClientRpc(NetworkObjectReference itemRef, int value, int rotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3648146099u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref itemRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); BytePacker.WriteValueBitPacked(val, rotation); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3648146099u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref itemRef)).TryGet(ref val3, (NetworkManager)null)) { GrabbableObject component = ((Component)val3).GetComponent(); component.SetScrapValue(value); component.floorYRot = rotation; } } } private void UpdateHeat() { //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) if (base.isHeld && isHoldingButton) { currentHeat += heatGainRate * Time.deltaTime; } else { currentHeat -= heatCoolRate * Time.deltaTime; if (overloadingEffect.isPlaying) { overloadingEffect.Stop(); } if (overloadedEffect.isPlaying) { overloadedEffect.Stop(); } } currentHeat = Mathf.Clamp(currentHeat, 0f, heatThreshold); if (currentHeat < heatThreshold - 10f && currentHeat > 50f) { if (!smokeEffectWarning.isPlaying) { smokeEffectWarning.Play(); } if (!overloadingEffect.isPlaying) { overloadingEffect.Play(); } } else if (currentHeat >= heatThreshold - 10f || currentHeat < 25f) { if (smokeEffectWarning.isPlaying) { smokeEffectWarning.Stop(); } if (overloadingEffect.isPlaying) { overloadingEffect.Stop(); } } if (currentHeat >= heatThreshold - 10f) { if (!smokeEffectDanger.isPlaying) { smokeEffectDanger.Play(); } if (!overloadedEffect.isPlaying) { overloadedEffect.Play(); } } else if (currentHeat < heatThreshold - 10f) { if (smokeEffectDanger.isPlaying) { smokeEffectDanger.Stop(); } if (overloadedEffect.isPlaying) { overloadedEffect.Stop(); } } if (!(Time.time < burnDamageCooldown)) { burnDamageCooldown = Time.time + 1f; if (currentHeat >= heatThreshold && !((Object)(object)base.playerHeldBy == (Object)null)) { base.playerHeldBy.DamagePlayer(10, true, true, (CauseOfDeath)13, 6, false, default(Vector3)); overheating = 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 //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4197878062u, new RpcReceiveHandler(__rpc_handler_4197878062), "destroyTrapServerRpc"); ((NetworkBehaviour)this).__registerRpc(154910867u, new RpcReceiveHandler(__rpc_handler_154910867), "destroyTrapClientRpc"); ((NetworkBehaviour)this).__registerRpc(3648146099u, new RpcReceiveHandler(__rpc_handler_3648146099), "SyncScrapValueClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_4197878062(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; ((RedoneBlowtorch)(object)target).destroyTrapServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_154910867(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; ((RedoneBlowtorch)(object)target).destroyTrapClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3648146099(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_003e: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemRef, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); int rotation = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref rotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((RedoneBlowtorch)(object)target).SyncScrapValueClientRpc(itemRef, value, rotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RedoneBlowtorch"; } } internal class RegalScepterScript : GrabbableObject { protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "RegalScepterScript"; } } 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(917582628u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref toggle, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 917582628u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1373662317u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, stage); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1373662317u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2153902911u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, stage); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2153902911u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(391308571u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, duration); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 391308571u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1722557415u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, duration); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1722557415u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3522520608u, val2, (RpcDelivery)0); bool flag = Screen != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(Screen, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3522520608u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3045810712u, val2, (RpcDelivery)0); bool flag = Screen != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(Screen, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3045810712u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1162398535u, val2, (RpcDelivery)0); bool flag = Area != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(Area, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref Location); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1162398535u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1191106644u, val2, (RpcDelivery)0); bool flag = Area != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(Area, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref Location); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1191106644u, val2, (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"; } } internal class ShockBatonScript : GrabbableObject { protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "ShockBatonScript"; } } 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 num2 = 0; num2 < objectsHitByMeleeWeaponList.Count; num2++) { RaycastHit val = objectsHitByMeleeWeaponList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByMeleeWeaponList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByMeleeWeaponList[num2]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = objectsHitByMeleeWeaponList[num2]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByMeleeWeaponList[num2]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; val = objectsHitByMeleeWeaponList[num2]; 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[num2]; 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)) { goto IL_035d; } continue; } val = objectsHitByMeleeWeaponList[num2]; 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[num2]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; val = objectsHitByMeleeWeaponList[num2]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int num3 = 0; num3 < StartOfRound.Instance.footstepSurfaces.Length; num3++) { if (StartOfRound.Instance.footstepSurfaces[num3].surfaceTag == tag) { num = num3; scissorAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num3].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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1406364424u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1406364424u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(66967687u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 66967687u, val2, (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"; } } internal class SledgehammerScript : GrabbableObject { private PlayerControllerB previousPlayerHeldBy; private AudioSource sledgeAudio; private AudioClip swing; private AudioClip[] hitSFX; public int meleeWeaponHitForce = 2; private bool isHoldingButton; private bool reelingUp; private Coroutine reelingUpCoroutine; private RaycastHit[] objectsHitByMeleeWeapon; private List objectsHitByMeleeWeaponList = new List(); public int meleeWeaponMask = 1084754248; public void Awake() { try { sledgeAudio = ((Component)((Component)this).transform.Find("SledgeSounds")).gameObject.GetComponent(); AudioSource[] components = ((Component)((Component)this).transform.Find("SledgeSounds")).gameObject.GetComponents(); swing = components[1].clip; hitSFX = (AudioClip[])(object)new AudioClip[1] { sledgeAudio.clip }; } catch (Exception ex) { Debug.LogError((object)ex.Message); } } 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.6f); 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) { sledgeAudio.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_042e: 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 num2 = 0; num2 < objectsHitByMeleeWeaponList.Count; num2++) { RaycastHit val = objectsHitByMeleeWeaponList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByMeleeWeaponList[num2]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByMeleeWeaponList[num2]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2)) { continue; } val = objectsHitByMeleeWeaponList[num2]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByMeleeWeaponList[num2]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; val = objectsHitByMeleeWeaponList[num2]; 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[num2]; 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)) { goto IL_035d; } continue; } val = objectsHitByMeleeWeaponList[num2]; 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 Sledgehammer {arg}, caused by playerInital: {previousPlayerHeldBy.playerClientId}"); } continue; } } val = objectsHitByMeleeWeaponList[num2]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; val = objectsHitByMeleeWeaponList[num2]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int num3 = 0; num3 < StartOfRound.Instance.footstepSurfaces.Length; num3++) { if (StartOfRound.Instance.footstepSurfaces[num3].surfaceTag == tag) { num = num3; sledgeAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num3].hitSurfaceSFX); break; } } } } if (flag) { int num4 = RoundManager.PlayRandomClip(sledgeAudio, hitSFX, true, 1f, 0, 1000); Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); if (num != -1) { sledgeAudio.PlayOneShot(hitSFX[num4]); WalkieTalkie.TransmitOneShotAudio(sledgeAudio, hitSFX[num4], 1f); } base.playerHeldBy.playerBodyAnimator.SetTrigger("shovelHit"); HitMeleeWeaponServerRpc(num4); } } [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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(293765400u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, sound); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 293765400u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2837033581u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, sound); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2837033581u, val2, (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) { sledgeAudio.PlayOneShot(hitSFX[sound]); } } 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(293765400u, new RpcReceiveHandler(__rpc_handler_293765400), "HitMeleeWeaponServerRpc"); ((NetworkBehaviour)this).__registerRpc(2837033581u, new RpcReceiveHandler(__rpc_handler_2837033581), "HitMeleeWeaponClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_293765400(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; ((SledgehammerScript)(object)target).HitMeleeWeaponServerRpc(sound); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2837033581(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; ((SledgehammerScript)(object)target).HitMeleeWeaponClientRpc(sound); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "SledgehammerScript"; } } 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3334875059u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref vector); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3334875059u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2612649702u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2612649702u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(858281490u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, ID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 858281490u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4017305039u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, ID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4017305039u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3908839215u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, ID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3908839215u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1317609795u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1317609795u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2558092374u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2558092374u, val2, (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 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4162469168u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4162469168u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2663061315u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref color); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2663061315u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1334827072u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1334827072u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(190369978u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 190369978u, val2, (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 { } }