Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of BCMERMoreEvents v0.0.1
BCMERMoreEvents.dll
Decompiled 8 hours agousing 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 BCMERMoreEvents.Events.ConfettiCrackers; using BCMERMoreEvents.Events.DiverseEcosystem; using BCMERMoreEvents.Events.HealingMines; using BCMERMoreEvents.Events.JudgementDay; using BCMERMoreEvents.Events.MissileTurrets; using BCMERMoreEvents.Events.SilverAndBronze; using BCMERMoreEvents.Events.Sirensfall; using BCMERMoreEvents.Events.TimeSingularity; using BCMERMoreEvents.Events.WorldWideTour; using BCMERMoreEvents.Events._ItemEvents.Anvils; using BCMERMoreEvents.Events._ItemEvents.Concord; using BCMERMoreEvents.Events._ItemEvents.HandleWithCare; using BCMERMoreEvents.Events._ItemEvents.Ingots; using BCMERMoreEvents.Events._ItemEvents.LightInTheDarkness; using BCMERMoreEvents.Events._ItemEvents.WorldOfGold; using BCMERMoreEvents.Events._WeatherEvents.ImpendingStorm; using BCMERMoreEvents.Events._WeatherEvents.SeriouslyStormyDay; using BCMERMoreEvents.Events._WeatherEvents.SolarBlackout; using BCMERMoreEvents.NetcodePatcher; using BCMERMoreEvents.Patches; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using BrutalCompanyMinus; using BrutalCompanyMinus.Minus; using BrutalCompanyMinus.Minus.CustomEvents; using BrutalCompanyMinus.Minus.Handlers.Modded; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.Rendering; [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("BCMERMoreEvents")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("0.0.1.0")] [assembly: AssemblyInformationalVersion("0.0.1")] [assembly: AssemblyProduct("BCMERMoreEvents")] [assembly: AssemblyTitle("BCMERMoreEvents")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.1.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 BCMERMoreEvents { internal static class BCMERCompatibility { internal static void RegisterEvents() { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new ConfettiCrackers()); RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new TimeSingularity()); RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new HealingMines()); if (Plugin.hasMetalItemVariants) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new WorldOfGold()); RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new SilverAndBronze()); RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new Ingots()); } if (Plugin.hasLethalAnomalies) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new WorldWideTour()); } if (Plugin.hasBiodiversity && Plugin.hasCodeRebirth) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new DiverseEcosystem()); } if (Plugin.hasImmersiveScrap) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new Anvils()); } if (Plugin.hasMissileTurret) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new MissileTurrets()); } if (Plugin.hasCodeRebirth && Plugin.hasLethalNuke && Plugin.hasUsualScrap) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new HandleWithCare()); } if (Plugin.hasCodeRebirth && Plugin.hasLethalNuke && Plugin.hasUsualScrap && Plugin.hasMissileTurret) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new JudgementDay()); } if (Plugin.hasMetalItemVariants && Plugin.hasAbandonedCompanyAssets) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new LightInTheDarkness()); } if (Plugin.hasSirenHead) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new Sirensfall()); } if (Plugin.hasConcordScrap) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new Concord()); } if (Plugin.hasCombinedWeathersToolkit) { if (CustomWeather.isWeatherPresent("Cloudy") && CustomWeather.isWeatherPresent("Hurricane")) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new ImpendingStorm()); } if (CustomWeather.isWeatherPresent("Hurricane") && CustomWeather.isWeatherPresent("Tornado")) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new SeriouslyStormyDay()); } if (CustomWeather.isWeatherPresent("Blackout") && CustomWeather.isWeatherPresent("SolarFlare")) { RegisterEvent(EventManager.moddedEvents, (MEvent)(object)new SolarBlackout()); } } } private static void RegisterEvent(List<MEvent> moddedEvents, MEvent moddedEvent) { string eventName = moddedEvent.Name(); if (!moddedEvents.Any((MEvent registeredEvent) => registeredEvent.Name() == eventName)) { moddedEvents.Add(moddedEvent); Plugin.mls.LogInfo((object)("BCMER " + eventName + " modded event registered")); } } internal static void SetActive(MEvent moddedEvent, bool active) { moddedEvent.Active = active; } internal static void SetExecuted(MEvent moddedEvent, bool executed) { moddedEvent.Executed = executed; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("MrHat.BCMERMoreEvents", "BCMERMoreEvents", "0.0.1")] public class Plugin : BaseUnityPlugin { internal const string modGUID = "MrHat.BCMERMoreEvents"; internal const string modName = "BCMERMoreEvents"; internal const string modVersion = "0.0.1"; internal static Harmony _harmony; internal static ManualLogSource mls; internal static Plugin Instance; private const string BrutalCompanyMinusExtraRebornGUID = "SoftDiamond.BrutalCompanyMinusExtraReborn"; internal const string MetalItemVariantsGUID = "MrHat.MetalItemVariants.Internals"; internal const string LethalAnomaliesGUID = "Zeldahu.LethalAnomalies"; internal const string BiodiversityGUID = "com.github.biodiversitylc.Biodiversity"; internal const string CodeRebirthGUID = "CodeRebirth"; internal const string ImmersiveScrapGUID = "ImmersiveScrap"; internal const string MissileTurretGUID = "MissileTurret"; internal const string LethalNukeGUID = "Lethal_Nuke"; internal const string UsualScrapGUID = "Emil.UsualScrap"; internal const string AbandonedCompanyAssetsGUID = "AbandonedCompanyAssets"; internal const string SirenHeadGUID = "Ccode.SirenHead"; internal const string ConcordScrapGUID = "ConcordScrap"; internal const string CombinedWeathersToolkitGUID = "zigzag.combinedweatherstoolkit"; internal static bool hasMetalItemVariants; internal static bool hasLethalAnomalies; internal static bool hasBiodiversity; internal static bool hasCodeRebirth; internal static bool hasImmersiveScrap; internal static bool hasMissileTurret; internal static bool hasLethalNuke; internal static bool hasUsualScrap; internal static bool hasAbandonedCompanyAssets; internal static bool hasSirenHead; internal static bool hasConcordScrap; internal static bool hasCombinedWeathersToolkit; private void Awake() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown Instance = this; mls = Logger.CreateLogSource("MrHat.BCMERMoreEvents"); _harmony = new Harmony("MrHat.BCMERMoreEvents"); hasMetalItemVariants = CheckSoftDependency("MrHat.MetalItemVariants.Internals", "MetalItemVariants"); hasLethalAnomalies = CheckSoftDependency("Zeldahu.LethalAnomalies", "LethalAnomalies"); hasBiodiversity = CheckSoftDependency("com.github.biodiversitylc.Biodiversity", "Biodiversity"); hasCodeRebirth = CheckSoftDependency("CodeRebirth", "CodeRebirth"); hasImmersiveScrap = CheckSoftDependency("ImmersiveScrap", "ImmersiveScrap"); hasMissileTurret = CheckSoftDependency("MissileTurret", "MissileTurret"); hasLethalNuke = CheckSoftDependency("Lethal_Nuke", "LethalNuke"); hasUsualScrap = CheckSoftDependency("Emil.UsualScrap", "UsualScrap"); hasAbandonedCompanyAssets = CheckSoftDependency("AbandonedCompanyAssets", "AbandonedCompanyAssets"); hasSirenHead = CheckSoftDependency("Ccode.SirenHead", "SirenHead"); hasConcordScrap = CheckSoftDependency("ConcordScrap", "ConcordScrap"); hasCombinedWeathersToolkit = CheckSoftDependency("zigzag.combinedweatherstoolkit", "CombinedWeathersToolkit"); _harmony.PatchAll(typeof(ConfettiCrackersBehaviour)); _harmony.PatchAll(typeof(TimeSingularityBehaviour)); _harmony.PatchAll(typeof(HealingMines)); _harmony.PatchAll(typeof(NetworkManagerPatches)); _harmony.PatchAll(typeof(StartOfRoundPatches)); _harmony.PatchAll(typeof(GameNetworkManagerPatches)); BCMERCompatibility.RegisterEvents(); } private static bool CheckSoftDependency(string guid, string modName) { bool flag = Chainloader.PluginInfos.ContainsKey(guid); if (flag) { mls.LogInfo((object)$"Is {modName} installed? {flag}"); } else { mls.LogWarning((object)$"Is {modName} installed? {flag}, skipping event registration"); } return flag; } } internal static class Utils { private const string AssetBundleName = "bcmermoreeventsassets"; private const string HealingLandminePrefabPath = "Assets/LethalCompany/Mods/plugins/BCMERMoreEvents/HealthMine/HealthLandmine.prefab"; private const string MineBeepClipName = "MineBeep"; private const string MinePressClipName = "PressLandmine"; private const string MineTriggerClipName = "MineTrigger"; internal static AssetBundle? AssetBundle; internal static GameObject? HealingLandminePrefab; private static bool healingLandminePrefabHooked; private static AudioClip? mineBeepClip; private static AudioClip? minePressClip; private static AudioClip? mineTriggerClip; internal static AudioClip MineBeepClip => mineBeepClip; internal static AudioClip MinePressClip => minePressClip; internal static AudioClip MineTriggerClip => mineTriggerClip; internal static bool RegisterHealingLandminePrefab() { if (healingLandminePrefabHooked) { return true; } NetworkManager singleton = NetworkManager.Singleton; if ((Object)(object)singleton == (Object)null) { return false; } HealingLandminePrefab = Utils.BundleAsset<GameObject>("Assets/LethalCompany/Mods/plugins/BCMERMoreEvents/HealthMine/HealthLandmine.prefab"); if ((Object)(object)HealingLandminePrefab == (Object)null) { return false; } singleton.PrefabHandler.AddNetworkPrefab(HealingLandminePrefab); healingLandminePrefabHooked = true; return true; } internal static void FindMineClips() { AudioClip[] array = Resources.FindObjectsOfTypeAll<AudioClip>(); for (int i = 0; i < array.Length; i++) { if (((Object)array[i]).name == "MineTrigger") { mineTriggerClip = array[i]; } else if (((Object)array[i]).name == "PressLandmine") { minePressClip = array[i]; } else if (((Object)array[i]).name == "MineBeep") { mineBeepClip = array[i]; } } } internal static T? BundleAsset<T>(string assetPath) where T : Object { if (!OpenAssetBundle()) { return default(T); } return AssetBundle.LoadAsset<T>(assetPath); } private static bool OpenAssetBundle() { if ((Object)(object)AssetBundle != (Object)null) { return true; } AssetBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)Plugin.Instance).Info.Location), "bcmermoreeventsassets")); return (Object)(object)AssetBundle != (Object)null; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "BCMERMoreEvents"; public const string PLUGIN_NAME = "BCMERMoreEvents"; public const string PLUGIN_VERSION = "0.0.1"; } } namespace BCMERMoreEvents.Patches { internal static class GameNetworkManagerPatches { [HarmonyPatch(typeof(GameNetworkManager), "Start")] [HarmonyPostfix] private static void StartPostfix() { Utils.FindMineClips(); } } internal static class NetworkManagerPatches { [HarmonyPatch(typeof(NetworkManager), "SetSingleton")] [HarmonyPostfix] private static void SetSingletonPostfix() { Utils.RegisterHealingLandminePrefab(); } } [HarmonyPatch(typeof(StartOfRound))] internal static class StartOfRoundPatches { [HarmonyPatch("OnLocalDisconnect")] [HarmonyPatch("OnDestroy")] [HarmonyPostfix] private static void Postfix() { ConfettiCrackersBehaviour.StopFor(); TimeSingularityBehaviour.StopFor(); } } } namespace BCMERMoreEvents.Events._WeatherEvents.SolarBlackout { internal class SolarBlackout : MEvent { public override string Name() { return "SolarBlackout"; } public override void Initalize() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) base.Weight = 1; base.Descriptions = new List<string>(1) { "The Black of Night falls upon the Facility..." }; base.ColorHex = "#000000"; base.Type = (EventType)1; base.EventsToSpawnWith = new List<string>(1) { "" }; base.EventsToRemove = new List<string>(15) { "AllWeather", "BloodMoon", "Forsaken", "Gloomy", "Hallowed", "Heatwave", "HeavyRain", "Hurricane", "MajoraMoon", "MeteorShower", "Raining", "SolarFlare", "Windy", "SeriouslyStormyDay", "ImpendingStorm" }; base.Aliases = new List<string>(1) { "SolarBlackout" }; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); CustomWeather.SetCustomWeather("Solar Blackout"); Plugin.mls.LogInfo((object)"SolarBlackout event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events._WeatherEvents.SeriouslyStormyDay { internal class SeriouslyStormyDay : MEvent { public override string Name() { return "SeriouslyStormyDay"; } public override void Initalize() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) base.Weight = 1; base.Descriptions = new List<string>(1) { "Seriously Stormy Day" }; base.ColorHex = "#c0c0c0"; base.Type = (EventType)1; base.EventsToSpawnWith = new List<string>(1) { "" }; base.EventsToRemove = new List<string>(15) { "AllWeather", "BloodMoon", "Forsaken", "Gloomy", "Hallowed", "Heatwave", "HeavyRain", "Hurricane", "MajoraMoon", "MeteorShower", "Raining", "SolarFlare", "Windy", "SolarBlackout", "ImpendingStorm" }; base.Aliases = new List<string>(1) { "SeriouslyStormyDay" }; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); CustomWeather.SetCustomWeather("Seriously Stormy Day"); Plugin.mls.LogInfo((object)"SeriouslyStormyDay event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events._WeatherEvents.ImpendingStorm { internal class ImpendingStorm : MEvent { public override string Name() { return "ImpendingStorm"; } public override void Initalize() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) base.Weight = 1; base.Descriptions = new List<string>(1) { "Forecast says leave early" }; base.ColorHex = "#c0c0c0"; base.Type = (EventType)2; base.EventsToSpawnWith = new List<string>(1) { "" }; base.EventsToRemove = new List<string>(15) { "AllWeather", "BloodMoon", "Forsaken", "Gloomy", "Hallowed", "Heatwave", "HeavyRain", "Hurricane", "MajoraMoon", "MeteorShower", "Raining", "SolarFlare", "Windy", "SeriouslyStormyDay", "SolarBlackout" }; base.Aliases = new List<string>(1) { "ImpendingStorm" }; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); CustomWeather.SetCustomWeather("Impending Storm"); Plugin.mls.LogInfo((object)"ImpendingStorm event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events.SilverAndBronze { internal class SilverAndBronze : MEvent { public override string Name() { return "Silver&Bronze"; } public override void Initalize() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00f3: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Expected O, but got Unknown //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Expected O, but got Unknown //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Expected O, but got Unknown //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Expected O, but got Unknown //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Expected O, but got Unknown //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Expected O, but got Unknown //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Expected O, but got Unknown //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Expected O, but got Unknown //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Expected O, but got Unknown //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Expected O, but got Unknown base.Weight = 1; base.Descriptions = new List<string>(3) { "Not gold, but still quota friendly", "Precious metal items", "Second and third place prizes only" }; base.ColorHex = "#008000"; base.Type = (EventType)4; base.Enabled = true; base.EventsToRemove = new List<string>(3) { "SID", "RealityShift", "Ingots" }; base.Aliases = new List<string>(1) { "SilverAndBronze" }; base.ScaleList.Add((ScaleType)8, new Scale(1f, 0.005f, 1f, 1.5f)); base.scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), (SpawnableItemWithRarity[])(object)new SpawnableItemWithRarity[20] { new SpawnableItemWithRarity(Assets.GetItem("SilverMetalSheet"), 5), new SpawnableItemWithRarity(Assets.GetItem("SilverMagnifyingGlass"), 5), new SpawnableItemWithRarity(Assets.GetItem("SilverLargeAxle"), 5), new SpawnableItemWithRarity(Assets.GetItem("SilverFancyCup"), 5), new SpawnableItemWithRarity(Assets.GetItem("SilverEggBeater"), 5), new SpawnableItemWithRarity(Assets.GetItem("SilverMoldPan"), 5), new SpawnableItemWithRarity(Assets.GetItem("SilverCashRegister"), 5), new SpawnableItemWithRarity(Assets.GetItem("SilverBolt"), 5), new SpawnableItemWithRarity(Assets.GetItem("BronzeMetalSheet"), 5), new SpawnableItemWithRarity(Assets.GetItem("BronzeMagnifyingGlass"), 5), new SpawnableItemWithRarity(Assets.GetItem("BronzeFancyCup"), 5), new SpawnableItemWithRarity(Assets.GetItem("BronzeMoldPan"), 5), new SpawnableItemWithRarity(Assets.GetItem("BronzeCashRegister"), 5), new SpawnableItemWithRarity(Assets.GetItem("BronzeBolt"), 5), new SpawnableItemWithRarity(Assets.GetItem("SilverVTypeEngine"), 5), new SpawnableItemWithRarity(Assets.GetItem("BronzeVTypeEngine"), 5), new SpawnableItemWithRarity(Assets.GetItem("BronzeGiftBox"), 5), new SpawnableItemWithRarity(Assets.GetItem("SilverGiftBox"), 5), new SpawnableItemWithRarity(Assets.GetItem("BronzeBar"), 5), new SpawnableItemWithRarity(Assets.GetItem("SilverBar"), 5) }); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); Manager.scrapAmountMultiplier *= ((MEvent)this).Getf((ScaleType)8); base.scrapTransmutationEvent.Execute(); Plugin.mls.LogInfo((object)"Silver&Bronze event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events._ItemEvents.WorldOfGold { internal class WorldOfGold : MEvent { public override string Name() { return "WorldOfGold"; } public override void Initalize() { //IL_0039: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Expected O, but got Unknown //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Expected O, but got Unknown //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Expected O, but got Unknown //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Expected O, but got Unknown //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Expected O, but got Unknown //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Expected O, but got Unknown //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Expected O, but got Unknown //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Expected O, but got Unknown //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Expected O, but got Unknown //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Expected O, but got Unknown base.Weight = 3; base.Descriptions = new List<string>(2) { "Then, you dreamed of a world of gold.", "Items have become transcendent" }; base.ColorHex = "#00FFFF"; base.Type = (EventType)6; base.Enabled = true; base.EventsToRemove = new List<string>(3) { "SID", "RealityShift", "WorldOfMetal" }; base.Aliases = new List<string>(1) { "WorldOfGold" }; base.ScaleList.Add((ScaleType)8, new Scale(1f, 0.005f, 1f, 1.5f)); base.scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), (SpawnableItemWithRarity[])(object)new SpawnableItemWithRarity[17] { new SpawnableItemWithRarity(Assets.GetItem("GoldBar"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldApolloItem"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldIngotItem"), 5), new SpawnableItemWithRarity(Assets.GetItem("CartOfIngotsItem"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldenFlashlight"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldMetalSheet"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldMagnifyingGlass"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldLargeAxle"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldenGarbageLid"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldFancyCup"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldEggBeater"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldMoldPan"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldCashRegister"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldBolt"), 5), new SpawnableItemWithRarity(Assets.GetItem("RadiantJarOfPickles"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldVTypeEngine"), 5), new SpawnableItemWithRarity(Assets.GetItem("GoldGiftBox"), 5) }); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); Manager.scrapAmountMultiplier *= ((MEvent)this).Getf((ScaleType)8); base.scrapTransmutationEvent.Execute(); Plugin.mls.LogInfo((object)"WorldOfGold event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events._ItemEvents.LightInTheDarkness { internal class LightInTheDarkness : MEvent { public override string Name() { return "LightInTheDarkness"; } public override void Initalize() { //IL_0045: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Expected O, but got Unknown //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Expected O, but got Unknown //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Expected O, but got Unknown base.Weight = 1; base.Descriptions = new List<string>(3) { "Light in the darkness", "The facility has discovered mood lighting", "The dark is no longer the problem" }; base.ColorHex = "#FDDA0D"; base.Type = (EventType)4; base.Enabled = true; base.Aliases = new List<string>(1) { "LightInTheDarkness" }; base.EventsToRemove = new List<string>(2) { "SID", "RealityShift" }; base.ScaleList.Add((ScaleType)8, new Scale(1f, 0.005f, 1f, 1.5f)); base.scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), (SpawnableItemWithRarity[])(object)new SpawnableItemWithRarity[10] { new SpawnableItemWithRarity(Assets.GetItem("candleItem"), 10), new SpawnableItemWithRarity(Assets.GetItem("Lighter"), 10), new SpawnableItemWithRarity(Assets.GetItem("bulletLighter"), 10), new SpawnableItemWithRarity(Assets.GetItem("proAbandonedFlashlight"), 6), new SpawnableItemWithRarity(Assets.GetItem("abandonedBBFlashlight"), 2), new SpawnableItemWithRarity(Assets.GetItem("industrialFlashlightItem"), 6), new SpawnableItemWithRarity(Assets.GetItem("RadiantJarOfPickles"), 10), new SpawnableItemWithRarity(Assets.GetItem("GoldenFlashlight"), 6), new SpawnableItemWithRarity(Assets.GetItem("LibrarylampItem"), 10), new SpawnableItemWithRarity(Assets.GetItem("FancyLamp"), 10) }); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); Manager.scrapAmountMultiplier *= ((MEvent)this).Getf((ScaleType)8); base.scrapTransmutationEvent.Execute(); Plugin.mls.LogInfo((object)"LightInTheDarkness event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events._ItemEvents.Ingots { internal class Ingots : MEvent { public override string Name() { return "Ingots"; } public override void Initalize() { //IL_0045: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown base.Weight = 1; base.Descriptions = new List<string>(3) { "Who said only gold ingots exist?", "Some of these are worth more than you", "Scrap value has never looked so organized" }; base.ColorHex = "#008000"; base.Type = (EventType)4; base.Enabled = true; base.Aliases = new List<string>(1) { "Ingots" }; base.EventsToRemove = new List<string>(2) { "SID", "RealityShift" }; base.ScaleList.Add((ScaleType)8, new Scale(1f, 0.005f, 1f, 1.5f)); base.scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), (SpawnableItemWithRarity[])(object)new SpawnableItemWithRarity[4] { new SpawnableItemWithRarity(Assets.GetItem("BronzeBar"), 20), new SpawnableItemWithRarity(Assets.GetItem("SilverBar"), 20), new SpawnableItemWithRarity(Assets.GetItem("CopperBar"), 20), new SpawnableItemWithRarity(Assets.GetItem("GoldBar"), 5) }); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); Manager.scrapAmountMultiplier *= ((MEvent)this).Getf((ScaleType)8); base.scrapTransmutationEvent.Execute(); Plugin.mls.LogInfo((object)"Ingots event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events._ItemEvents.HandleWithCare { internal class HandleWithCare : MEvent { public override string Name() { return "HandleWithCare"; } public override void Initalize() { //IL_0045: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown base.Weight = 1; base.Descriptions = new List<string>(3) { "Loot is a workplace hazard", "Do not shake the merchandise", "Everything is one bad throw from becoming fireworks" }; base.ColorHex = "#800000"; base.Type = (EventType)1; base.Enabled = true; base.Aliases = new List<string>(1) { "HandleWithCare" }; base.EventsToRemove = new List<string>(2) { "SID", "RealityShift" }; base.ScaleList.Add((ScaleType)8, new Scale(1f, 0.005f, 1f, 1.5f)); base.scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), (SpawnableItemWithRarity[])(object)new SpawnableItemWithRarity[6] { new SpawnableItemWithRarity(Assets.GetItem("NitroCrateObj"), 40), new SpawnableItemWithRarity(Assets.GetItem("LETHAL_NUKE"), 5), new SpawnableItemWithRarity(Assets.GetItem("US_FuelCylinderItem"), 35), new SpawnableItemWithRarity(Assets.GetItem("propane"), 5), new SpawnableItemWithRarity(Assets.GetItem("US_RadioactiveCellItem"), 14), new SpawnableItemWithRarity(Assets.GetItem("DetonatorObj"), 1) }); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); Manager.scrapAmountMultiplier *= ((MEvent)this).Getf((ScaleType)8); base.scrapTransmutationEvent.Execute(); Plugin.mls.LogInfo((object)"HandleWithCare event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events._ItemEvents.Concord { internal class Concord : MEvent { public override string Name() { return "Concord"; } public override void Initalize() { //IL_002d: 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_00b0: 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_00cf: Expected O, but got Unknown //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown base.Weight = 1; base.Descriptions = new List<string>(1) { "A long forgotten relic from humanity's dark past has descended" }; base.ColorHex = "#FFFFFF"; base.Type = (EventType)3; base.Enabled = true; base.Aliases = new List<string>(1) { "Concord" }; base.EventsToRemove = new List<string>(2) { "SID", "RealityShift" }; base.ScaleList.Add((ScaleType)8, new Scale(1f, 0.005f, 1f, 1.5f)); base.scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.01f, 0.001f, 0.01f, 0.03f), (SpawnableItemWithRarity[])(object)new SpawnableItemWithRarity[1] { new SpawnableItemWithRarity(Assets.GetItem("ConcordScrapItem"), 100) }); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); Manager.scrapAmountMultiplier *= ((MEvent)this).Getf((ScaleType)8); base.scrapTransmutationEvent.Execute(); Plugin.mls.LogInfo((object)"Concord event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events._ItemEvents.Anvils { internal class Anvils : MEvent { public override string Name() { return "Anvils"; } public override void Initalize() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown base.Weight = 3; base.Descriptions = new List<string>(2) { "Really?", "Everything is heavy..." }; base.ColorHex = "#800000"; base.Type = (EventType)1; base.Enabled = true; base.Aliases = new List<string>(1) { "Anvils" }; base.EventsToRemove = new List<string>(2) { "SID", "RealityShift" }; base.ScaleList.Add((ScaleType)8, new Scale(1f, 0.005f, 1f, 1.5f)); base.scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), (SpawnableItemWithRarity[])(object)new SpawnableItemWithRarity[1] { new SpawnableItemWithRarity(Assets.GetItem("AnvilItem"), 100) }); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); Manager.scrapAmountMultiplier *= ((MEvent)this).Getf((ScaleType)8); base.scrapTransmutationEvent.Execute(); Plugin.mls.LogInfo((object)"Anvils event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events.WorldWideTour { internal class WorldWideTour : MEvent { private static readonly Scale NoSpawn = new Scale(0f, 0f, 0f, 0f); public override string Name() { return "WorldWideTour"; } public override void Initalize() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_00bd: 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_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: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown base.Weight = 1; base.Descriptions = new List<string>(2) { "World Wide Tour!", "Sightseeing has become an explosive industry" }; base.ColorHex = "#800000"; base.Type = (EventType)1; base.Enabled = true; base.Blacklist = new List<string>(1) { "" }; base.EventsToRemove = new List<string>(1) { "" }; base.Aliases = new List<string>(1) { "WorldWideTour" }; base.monstersToSpawn = new List<MonsterEvent>(2) { new MonsterEvent("Tourist", NoSpawn, new Scale(3f, 0.03f, 3f, 50f), NoSpawn, NoSpawn, new Scale(1f, 0.02f, 1f, 2f), new Scale(1f, 0.05f, 1f, 5f)), new MonsterEvent("Tour Bus", NoSpawn, new Scale(3f, 0.03f, 3f, 40f), NoSpawn, NoSpawn, new Scale(1f, 0.02f, 1f, 1f), new Scale(1f, 0.05f, 1f, 3f)) }; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); ((MEvent)this).ExecuteAllMonsterEvents(); Plugin.mls.LogInfo((object)"WorldWideTour event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events.TimeSingularity { internal class TimeSingularity : MEvent { public override string Name() { return "TimeSingularity"; } public override void Initalize() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) base.Weight = 1; base.Descriptions = new List<string>(2) { "Time Singularity", "Daylight is folding in on itself" }; base.ColorHex = "#FF0000"; base.Type = (EventType)2; base.Enabled = true; base.Aliases = new List<string>(1) { "TimeSingularity" }; base.EventsToRemove = new List<string>(7) { "TimeChaos", "VeryLateShip", "VeryEarlyShip", "LateShip", "EarlyShip", "MajoraMoon", "Hell" }; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); Net instance = Net.Instance; if (instance != null) { instance.SetEventActiveServerRPC("TimeSingularity", true); } TimeSingularityBehaviour.StartFor(); Plugin.mls.LogInfo((object)"TimeSingularity event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); Net instance = Net.Instance; if (instance != null) { instance.SetEventActiveServerRPC("TimeSingularity", false); } TimeSingularityBehaviour.StopFor(); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); Net instance = Net.Instance; if (instance != null) { instance.SetEventActiveServerRPC("TimeSingularity", false); } TimeSingularityBehaviour.StopFor(); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); Net instance = Net.Instance; if (instance != null) { instance.SetEventActiveServerRPC("TimeSingularity", false); } TimeSingularityBehaviour.StopFor(); } } internal class TimeSingularityBehaviour : MonoBehaviour { private const float CycleCount = 6f; private static TimeSingularityBehaviour? current; private bool running; private float visualStartTime; private bool hasVisualStartTime; internal static bool Running => current?.running ?? false; internal static void StartFor() { StartClientSide(); } internal static void StopFor() { StopClientSide(); } private static void StartClientSide() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if ((Object)(object)current == (Object)null) { GameObject val = new GameObject("BCMERMoreEvents.TimeSingularity"); current = val.AddComponent<TimeSingularityBehaviour>(); } current.running = true; current.hasVisualStartTime = false; } private static void StopClientSide() { if (!((Object)(object)current == (Object)null)) { current.running = false; Object.Destroy((Object)(object)((Component)current).gameObject); } } [HarmonyPatch(typeof(TimeOfDay), "Update")] [HarmonyPostfix] private static void UpdatePostfix(TimeOfDay __instance) { if (!API.IsEventActive("TimeSingularity")) { if (Running) { StopClientSide(); } return; } if (!Running) { StartClientSide(); } if (!Running || !__instance.currentDayTimeStarted || !__instance.timeHasStarted || StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded) { return; } Animator sunAnimator = __instance.sunAnimator; if (!((Object)(object)sunAnimator == (Object)null)) { if (!current.hasVisualStartTime) { current.visualStartTime = Mathf.Clamp(__instance.normalizedTimeOfDay, 0f, 0.99f); current.hasVisualStartTime = true; } float num = Mathf.InverseLerp(current.visualStartTime, 0.99f, __instance.normalizedTimeOfDay); float num2 = Mathf.Lerp(current.visualStartTime, 0.99f, Mathf.PingPong(num * 6f * 2f, 1f)); sunAnimator.SetFloat(Animator.StringToHash("timeOfDay"), Mathf.Clamp(num2, 0f, 0.99f)); } } private void OnDestroy() { if ((Object)(object)current == (Object)(object)this) { running = false; current = null; Animator sunAnimator = TimeOfDay.Instance.sunAnimator; if (sunAnimator != null) { sunAnimator.SetFloat(Animator.StringToHash("timeOfDay"), Mathf.Clamp(TimeOfDay.Instance.normalizedTimeOfDay, 0f, 0.99f)); } } } } } namespace BCMERMoreEvents.Events.Sirensfall { internal class Sirensfall : MEvent { private static readonly Scale NoSpawn = new Scale(0f, 0f, 0f, 0f); public override string Name() { return "Sirensfall"; } public override void Initalize() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00db: 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_00ea: Expected O, but got Unknown base.Weight = 1; base.Descriptions = new List<string>(2) { "Forest is broadcasting again", "If you hear the sirens, it already heard you" }; base.ColorHex = "#FF0000"; base.Type = (EventType)2; base.Enabled = true; base.Blacklist = new List<string>(1) { "" }; base.EventsToRemove = new List<string>(1) { "NoGiants" }; base.Aliases = new List<string>(1) { "Sirensfall" }; base.monstersToSpawn = new List<MonsterEvent>(1) { new MonsterEvent("SirenHead", NoSpawn, NoSpawn, NoSpawn, NoSpawn, new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f)) }; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); ((MEvent)this).ExecuteAllMonsterEvents(); Plugin.mls.LogInfo((object)"Sirensfall event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events.MissileTurrets { internal class MissileTurrets : MEvent { private HazardEvent missileTurretHazard = null; public override string Name() { return "MissileTurrets"; } public override void Initalize() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown base.Weight = 1; base.Descriptions = new List<string>(2) { "Indoor artillery", "Turrets have launch authorisation" }; base.ColorHex = "#800000"; base.Type = (EventType)1; base.Enabled = true; base.Aliases = new List<string>(1) { "MissileTurrets" }; base.EventsToRemove = new List<string>(1) { "NoTurrets" }; missileTurretHazard = new HazardEvent("TurretMissile", new Scale(3f, 0.08f, 3f, 8f), new Scale(4f, 0.12f, 4f, 16f), true, false, false, false, false, true, false); } public override void Execute() { BCMERCompatibility.SetActive((MEvent)(object)this, active: true); missileTurretHazard.Execute(); Plugin.mls.LogInfo((object)"MissileTurrets event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events.JudgementDay { internal class JudgementDay : MEvent { public override string Name() { return "JudgementDay"; } public override void Initalize() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Expected O, but got Unknown base.Weight = 1; base.Descriptions = new List<string>(3) { "Judgement Day", "Come with me if you want scrap", "Survival odds calculated as negligible" }; base.ColorHex = "#8B008B"; base.Type = (EventType)0; base.Enabled = true; base.Blacklist = new List<string>(1) { "" }; base.EventsToRemove = new List<string>(6) { "LeaflessBrownTrees", "LeaflessTrees", "NoLandmines", "NoTurrets", "RealityShift", "SID" }; base.EventsToSpawnWith = new List<string>(6) { "Landmines", "OutsideLandmines", "Warzone", "Turrets", "MissileTurrets", "HandleWithCare" }; base.Aliases = new List<string>(1) { "JudgementDay" }; base.monstersToSpawn = new List<MonsterEvent>(1) { new MonsterEvent("PeaceKeeperObj", new Scale(5f, 0.2f, 5f, 20f), new Scale(15f, 0.3525f, 15f, 40f), new Scale(1f, 0.01f, 1f, 2f), new Scale(2f, 0.02f, 2f, 5f), new Scale(1f, 0.01f, 1f, 2f), new Scale(2f, 0.02f, 2f, 5f)) }; } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); ((MEvent)this).ExecuteAllMonsterEvents(); Plugin.mls.LogInfo((object)"JudgementDay event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events.HealingMines { internal class HealingMines : MEvent { private static MEvent? activeEvent; internal static bool IsActive => activeEvent != null && API.IsEventActive(activeEvent); public override string Name() { return "HealingMines"; } public override void Initalize() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) base.Weight = 1; base.Descriptions = new List<string>(2) { "Landmines are feeling merciful", "Explosive medicine" }; base.ColorHex = "#FF99CC"; base.Type = (EventType)4; base.Enabled = true; base.Aliases = new List<string>(1) { "HealingMines" }; base.EventsToSpawnWith = new List<string>(2) { "Landmines", "OutsideLandmines" }; base.EventsToRemove = new List<string>(3) { "GrabbableLandmines", "RealityShift", "NoLandmines" }; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); activeEvent = (MEvent?)(object)this; ReplaceLandmines(); Plugin.mls.LogInfo((object)"HealingMines event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); if ((object)activeEvent == this) { activeEvent = null; } } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); if ((object)activeEvent == this) { activeEvent = null; } } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); if ((object)activeEvent == this) { activeEvent = null; } } internal static void ReplaceLandmines() { //IL_004b: 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) if (IsActive && !((Object)(object)Utils.HealingLandminePrefab == (Object)null) && ((NetworkBehaviour)RoundManager.Instance).IsServer) { Landmine[] array = Object.FindObjectsByType<Landmine>((FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { NetworkObject networkObject = ((NetworkBehaviour)array[i]).NetworkObject; GameObject val = Object.Instantiate<GameObject>(Utils.HealingLandminePrefab, ((Component)networkObject).transform.position, ((Component)networkObject).transform.rotation, RoundManager.Instance.mapPropsContainer.transform); val.GetComponent<NetworkObject>().Spawn(true); networkObject.Despawn(true); } } } [HarmonyPatch(typeof(RoundManager), "SpawnMapObjects")] [HarmonyPostfix] private static void SpawnMapObjectsPostfix() { ReplaceLandmines(); } } } namespace BCMERMoreEvents.Events.DiverseEcosystem { internal class DiverseEcosystem : MEvent { private static readonly Scale NoSpawn = new Scale(0f, 0f, 0f, 0f); public override string Name() { return "DiverseEcosystem"; } public override void Initalize() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_00bd: 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_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: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: 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_0224: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Expected O, but got Unknown //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Expected O, but got Unknown //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Expected O, but got Unknown //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Expected O, but got Unknown base.Weight = 3; base.Descriptions = new List<string>(2) { "Wildlife is thriving today", "Do not disturb the ecosystem" }; base.ColorHex = "#FFFFFF"; base.Type = (EventType)3; base.Enabled = true; base.Blacklist = new List<string>(1) { "" }; base.EventsToRemove = new List<string>(1) { "NoBirds" }; base.Aliases = new List<string>(1) { "DiverseEcosystem" }; base.monstersToSpawn = new List<MonsterEvent>(6) { new MonsterEvent("Doublewing", NoSpawn, new Scale(10f, 0.4f, 10f, 50f), NoSpawn, NoSpawn, new Scale(4f, 0.08f, 4f, 12f), new Scale(5f, 0.1f, 5f, 15f)), new MonsterEvent("FlowerSnake", new Scale(5f, 0.2f, 5f, 20f), new Scale(15f, 0.3525f, 15f, 40f), new Scale(1f, 0.01f, 1f, 2f), new Scale(2f, 0.02f, 2f, 5f), new Scale(1f, 0.01f, 1f, 2f), new Scale(2f, 0.02f, 2f, 5f)), new MonsterEvent("LeafBoiEnemyType", new Scale(10f, 0.4f, 10f, 50f), new Scale(33f, 0.66f, 33f, 100f), new Scale(2f, 0.04f, 2f, 6f), new Scale(3f, 0.06f, 3f, 9f), new Scale(4f, 0.08f, 4f, 12f), new Scale(5f, 0.1f, 5f, 15f)), new MonsterEvent("MicBird", NoSpawn, new Scale(33f, 0.66f, 33f, 100f), NoSpawn, NoSpawn, new Scale(4f, 0.08f, 4f, 12f), new Scale(5f, 0.1f, 5f, 15f)), new MonsterEvent("CoilCrab", new Scale(10f, 0.4f, 10f, 50f), new Scale(33f, 0.66f, 33f, 100f), new Scale(2f, 0.04f, 2f, 6f), new Scale(3f, 0.06f, 3f, 9f), new Scale(4f, 0.08f, 4f, 12f), new Scale(5f, 0.1f, 5f, 15f)), new MonsterEvent("SnailCatEnemyObj", NoSpawn, new Scale(33f, 0.66f, 33f, 100f), new Scale(2f, 0.04f, 2f, 6f), new Scale(3f, 0.06f, 3f, 9f), new Scale(4f, 0.08f, 4f, 12f), new Scale(5f, 0.1f, 5f, 15f)) }; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); ((MEvent)this).ExecuteAllMonsterEvents(); Plugin.mls.LogInfo((object)"DiverseEcosystem event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); } } } namespace BCMERMoreEvents.Events.ConfettiCrackers { internal class ConfettiCrackers : MEvent { public override string Name() { return "ConfettiCrackers"; } public override void Initalize() { //IL_0039: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Expected O, but got Unknown base.Weight = 1; base.Descriptions = new List<string>(2) { "Confetti Crackers", "Nutcrackers are throwing a party" }; base.ColorHex = "#FF0000"; base.Type = (EventType)2; base.Enabled = true; base.Aliases = new List<string>(1) { "ConfettiCrackers" }; base.EventsToRemove = new List<string>(1) { "NoNutcracker" }; base.monstersToSpawn = new List<MonsterEvent>(1) { new MonsterEvent("Nutcracker", new Scale(33f, 0.66f, 33f, 100f), new Scale(10f, 0.4f, 10f, 50f), new Scale(2f, 0.04f, 2f, 6f), new Scale(3f, 0.06f, 3f, 9f), new Scale(0f, 0.02f, 0f, 1f), new Scale(0f, 0.03f, 0f, 3f)) }; } public override void Execute() { BCMERCompatibility.SetExecuted((MEvent)(object)this, executed: true); BCMERCompatibility.SetActive((MEvent)(object)this, active: true); Net instance = Net.Instance; if (instance != null) { instance.SetEventActiveServerRPC("ConfettiCrackers", true); } ConfettiCrackersBehaviour.StartFor(); ((MEvent)this).ExecuteAllMonsterEvents(); Plugin.mls.LogInfo((object)"ConfettiCrackers event started"); } public override void OnShipLeave() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); Net instance = Net.Instance; if (instance != null) { instance.SetEventActiveServerRPC("ConfettiCrackers", false); } ConfettiCrackersBehaviour.StopFor(); } public override void OnGameStart() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); Net instance = Net.Instance; if (instance != null) { instance.SetEventActiveServerRPC("ConfettiCrackers", false); } ConfettiCrackersBehaviour.StopFor(); } public override void OnLocalDisconnect() { BCMERCompatibility.SetActive((MEvent)(object)this, active: false); Net instance = Net.Instance; if (instance != null) { instance.SetEventActiveServerRPC("ConfettiCrackers", false); } ConfettiCrackersBehaviour.StopFor(); } } internal class ConfettiCrackersBehaviour : MonoBehaviour { private static readonly Dictionary<StunGrenadeItem, NutcrackerEnemyAI> eggShooters = new Dictionary<StunGrenadeItem, NutcrackerEnemyAI>(); private static ConfettiCrackersBehaviour? current; private static NutcrackerEnemyAI? explodingShooter; private bool running; internal static bool Running => current?.running ?? false; internal static void StartFor() { StartClientSide(); } internal static void StopFor() { StopClientSide(); } private static void StartClientSide() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if ((Object)(object)current == (Object)null) { GameObject val = new GameObject("BCMERMoreEvents.ConfettiCrackers"); current = val.AddComponent<ConfettiCrackersBehaviour>(); } current.running = true; } private static void StopClientSide() { if (!((Object)(object)current == (Object)null)) { current.running = false; Object.Destroy((Object)(object)((Component)current).gameObject); } } [HarmonyPatch(typeof(ShotgunItem), "ShootGun")] [HarmonyPrefix] private static bool ShootGunPrefix(ShotgunItem __instance, Vector3 shotgunPosition, Vector3 shotgunForward) { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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) if (!API.IsEventActive("ConfettiCrackers")) { return true; } EnemyAI heldByEnemy = __instance.heldByEnemy; NutcrackerEnemyAI val = (NutcrackerEnemyAI)(object)((heldByEnemy is NutcrackerEnemyAI) ? heldByEnemy : null); if (val == null) { return true; } if (!Running) { StartClientSide(); } __instance.isReloading = false; RoundManager.PlayRandomClip(__instance.gunShootAudio, __instance.gunShootSFX, true, 1f, 1840, 1000); WalkieTalkie.TransmitOneShotAudio(__instance.gunShootAudio, __instance.gunShootSFX[0], 1f); __instance.gunShootParticle.Play(true); __instance.shellsLoaded = Mathf.Clamp(__instance.shellsLoaded - 1, 0, 2); ((MonoBehaviour)current).StartCoroutine(current.ShootEgg(shotgunPosition + shotgunForward * 0.6f, shotgunForward, val)); return false; } [HarmonyPatch(typeof(StunGrenadeItem), "ExplodeStunGrenade")] [HarmonyPrefix] private static void ExplodeStunGrenadePrefix(StunGrenadeItem __instance) { if (!Running || !eggShooters.TryGetValue(__instance, out explodingShooter)) { explodingShooter = null; } } [HarmonyPatch(typeof(StunGrenadeItem), "ExplodeStunGrenade")] [HarmonyPostfix] private static void ExplodeStunGrenadePostfix(StunGrenadeItem __instance) { if (!((Object)(object)explodingShooter == (Object)null)) { eggShooters.Remove(__instance); explodingShooter = null; } } [HarmonyPatch(typeof(EnemyAI), "HitEnemyOnLocalClient")] [HarmonyPrefix] private static bool HitEnemyOnLocalClientPrefix(EnemyAI __instance) { return (Object)(object)explodingShooter == (Object)null || (Object)(object)__instance != (Object)(object)explodingShooter; } private IEnumerator ShootEgg(Vector3 position, Vector3 forward, NutcrackerEnemyAI nutcracker) { //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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) GameObject eggObject = Object.Instantiate<GameObject>(Assets.GetItem((ItemName)47).spawnPrefab, position, Quaternion.LookRotation(forward), RoundManager.Instance.mapPropsContainer.transform); StunGrenadeItem egg = eggObject.GetComponent<StunGrenadeItem>(); eggShooters[egg] = nutcracker; egg.chanceToExplode = 100f; egg.explodeOnThrow = true; egg.pinPulled = true; ((GrabbableObject)egg).fallTime = 1f; ((GrabbableObject)egg).hasHitGround = true; ((GrabbableObject)egg).reachedFloorTarget = true; ((GrabbableObject)egg).targetFloorPosition = eggObject.transform.localPosition; float distance = 0f; RaycastHit hit = default(RaycastHit); while (distance < 30f) { float step = 45f * Time.deltaTime; if (Physics.SphereCast(position, 0.2f, forward, ref hit, step, StartOfRound.Instance.collidersAndRoomMaskAndDefault | 8, (QueryTriggerInteraction)1)) { position = ((RaycastHit)(ref hit)).point; break; } position += forward * step; distance += step; eggObject.transform.position = position; ((GrabbableObject)egg).targetFloorPosition = eggObject.transform.localPosition; yield return null; } eggObject.transform.position = position; ((GrabbableObject)egg).targetFloorPosition = eggObject.transform.localPosition; egg.gotExplodeOnThrowRPC = true; egg.hasCollided = true; Object.Destroy((Object)(object)eggObject, 3f); } private void OnDestroy() { if ((Object)(object)current == (Object)(object)this) { running = false; eggShooters.Clear(); explodingShooter = null; current = null; } } } } namespace BCMERMoreEvents.AssetBehaviours { internal class HealthLandmine : NetworkBehaviour, IHittable { private const int HealAmount = 50; private static readonly int StartIdle = Animator.StringToHash("startIdle"); private static readonly int DetonateAnimation = Animator.StringToHash("detonate"); private static readonly int Limp = Animator.StringToHash("Limp"); [SerializeField] private Animator mineAnimator = null; [SerializeField] private AudioSource mineAudio = null; [SerializeField] private AudioSource mineFarAudio = null; [SerializeField] private AudioClip mineDetonate = null; [SerializeField] private AudioClip mineDetonateFar = null; [SerializeField] private Volume healPulseVolume = null; [SerializeField] private float healRadius = 6f; [SerializeField] private float healPulseWeight = 0.35f; [SerializeField] private float healPulseDuration = 0.6f; private bool hasExploded; private bool localPlayerOnMine; private float pressMineDebounceTimer; private int[] playerClientIdsToHeal = Array.Empty<int>(); private int[] healedHealths = Array.Empty<int>(); private int playersToHealCount; private void Start() { ((Component)healPulseVolume).gameObject.SetActive(true); ((Behaviour)healPulseVolume).enabled = true; healPulseVolume.isGlobal = true; healPulseVolume.weight = 0f; ((MonoBehaviour)this).StartCoroutine(StartIdleAnimation()); } private void Update() { if (pressMineDebounceTimer > 0f) { pressMineDebounceTimer -= Time.deltaTime; } if (localPlayerOnMine && GameNetworkManager.Instance.localPlayerController.teleportedLastFrame) { localPlayerOnMine = false; TriggerMineOnLocalClient(GameNetworkManager.Instance.localPlayerController); } } private IEnumerator StartIdleAnimation() { yield return (object)new WaitForSeconds((float)RoundManager.Instance.BreakerBoxRandom.NextDouble() + 0.5f); mineAnimator.SetTrigger(StartIdle); mineAudio.pitch = Random.Range(0.9f, 1.1f); } private void OnTriggerEnter(Collider other) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!hasExploded && !(pressMineDebounceTimer > 0f) && !((Object)(object)other != (Object)(object)localPlayerController.playerCollider) && !localPlayerController.isPlayerDead) { localPlayerOnMine = true; pressMineDebounceTimer = 0.5f; PressMineServerRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void PressMineServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: 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_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3048330526u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3048330526u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; PressMineClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PressMineClientRpc() { //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_0043: 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_0051: 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) //IL_0073: 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_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3647093904u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3647093904u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; pressMineDebounceTimer = 0.5f; mineAudio.PlayOneShot(Utils.MinePressClip); WalkieTalkie.TransmitOneShotAudio(mineAudio, Utils.MinePressClip, 1f); } } } private void OnTriggerExit(Collider other) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!hasExploded && !((Object)(object)other != (Object)(object)localPlayerController.playerCollider) && !localPlayerController.isPlayerDead) { localPlayerOnMine = false; TriggerMineOnLocalClient(localPlayerController); } } private void TriggerMineOnLocalClient(PlayerControllerB player) { if (!hasExploded) { ExplodeMineServerRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void ExplodeMineServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: 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_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00fc: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1270761476u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1270761476u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; int[] array = new int[allPlayerScripts.Length]; int[] array2 = new int[allPlayerScripts.Length]; int num = 0; for (int i = 0; i < allPlayerScripts.Length; i++) { PlayerControllerB val4 = allPlayerScripts[i]; if (val4.isPlayerControlled && !val4.isPlayerDead && !(Vector3.Distance(((Component)this).transform.position, ((Component)val4).transform.position) > healRadius)) { array[num] = i; array2[num] = Mathf.Clamp(val4.health + 50, 0, 100); num++; } } ExplodeMineClientRpc(array, array2, num); } [Rpc(/*Could not decode attribute arguments.*/)] private void ExplodeMineClientRpc(int[] playerClientIds, int[] newHealths, int playersToHeal) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Invalid comparison between Unknown and I4 //IL_0043: 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_0051: 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) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_0116: 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_00ee: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(773198671u, val3, val, (SendTo)7, (RpcDelivery)0); bool flag = playerClientIds != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<int>(playerClientIds, default(ForPrimitives)); } bool flag2 = newHealths != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe<int>(newHealths, default(ForPrimitives)); } BytePacker.WriteValueBitPacked(val2, playersToHeal); ((NetworkBehaviour)this).__endSendRpc(ref val2, 773198671u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; playerClientIdsToHeal = playerClientIds; healedHealths = newHealths; playersToHealCount = playersToHeal; SetOffMineAnimation(); } } private void SetOffMineAnimation() { hasExploded = true; mineAnimator.SetTrigger(DetonateAnimation); mineAudio.PlayOneShot(Utils.MineTriggerClip); WalkieTalkie.TransmitOneShotAudio(mineAudio, Utils.MineTriggerClip, 1f); } public void PlayMineBeep() { mineAudio.PlayOneShot(Utils.MineBeepClip); WalkieTalkie.TransmitOneShotAudio(mineAudio, Utils.MineBeepClip, 1f); } public void Detonate() { mineAudio.pitch = Random.Range(0.93f, 1.07f); mineAudio.PlayOneShot(mineDetonate); mineFarAudio.PlayOneShot(mineDetonateFar); WalkieTalkie.TransmitOneShotAudio(mineAudio, mineDetonate, 1f); WalkieTalkie.TransmitOneShotAudio(mineFarAudio, mineDetonateFar, 1f); ((Collider)((Component)this).GetComponentInChildren<SphereCollider>()).enabled = false; ((Component)((Component)this).GetComponentInChildren<ScanNodeProperties>()).gameObject.SetActive(false); for (int i = 0; i < playersToHealCount; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerClientIdsToHeal[i]]; val.health = healedHealths[i]; val.bleedingHeavily = false; val.criticallyInjured = false; val.playerBodyAnimator.SetBool(Limp, false); if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController) { HUDManager.Instance.SetCracksOnVisor((float)val.health); HUDManager.Instance.UpdateHealthUI(val.health, false); ((MonoBehaviour)this).StartCoroutine(HealPulse()); } } } private IEnumerator HealPulse() { float elapsedTime = 0f; while (elapsedTime < healPulseDuration) { elapsedTime += Time.deltaTime; healPulseVolume.weight = Mathf.Lerp(0f, healPulseWeight, Mathf.Sin(Mathf.Clamp01(elapsedTime / healPulseDuration) * MathF.PI)); yield return null; } healPulseVolume.weight = 0f; } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { if (hasExploded) { return true; } ExplodeMineServerRpc(); return true; } public override void OnDestroy() { healPulseVolume.weight = 0f; ((NetworkBehaviour)this).OnDestroy(); } protected override void __initializeVariables() { ((NetworkBehaviour)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(3048330526u, new RpcReceiveHandler(__rpc_handler_3048330526), "PressMineServerRpc"); ((NetworkBehaviour)this).__registerRpc(3647093904u, new RpcReceiveHandler(__rpc_handler_3647093904), "PressMineClientRpc"); ((NetworkBehaviour)this).__registerRpc(1270761476u, new RpcReceiveHandler(__rpc_handler_1270761476), "ExplodeMineServerRpc"); ((NetworkBehaviour)this).__registerRpc(773198671u, new RpcReceiveHandler(__rpc_handler_773198671), "ExplodeMineClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3048330526(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; ((HealthLandmine)(object)target).PressMineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3647093904(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; ((HealthLandmine)(object)target).PressMineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1270761476(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; ((HealthLandmine)(object)target).ExplodeMineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_773198671(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_0074: 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_0058: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_00a3: 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<bool>(ref flag, default(ForPrimitives)); int[] playerClientIds = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref playerClientIds, default(ForPrimitives)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag2, default(ForPrimitives)); int[] newHealths = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref newHealths, default(ForPrimitives)); } int playersToHeal = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playersToHeal); target.__rpc_exec_stage = (__RpcExecStage)1; ((HealthLandmine)(object)target).ExplodeMineClientRpc(playerClientIds, newHealths, playersToHeal); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "HealthLandmine"; } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace BCMERMoreEvents.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }