Decompiled source of Bozoros v2.9.0
BepInEx/plugins/Bozoros.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using AntlerShed.SkinRegistry; using AntlerShed.SkinRegistry.Events; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using Bozoros.Compatibility; using Bozoros.Compatibility.Interiors; using Bozoros.Compatibility.Moons; using Bozoros.Effects; using Bozoros.NetcodePatcher; using Bozoros.Patches; using Bozoros.Skins; using DunGen; using DunGen.Graph; using GameNetcodeStuff; using HarmonyLib; using JLL.API; using JLL.ScriptableObjects; using LethalLevelLoader; using Microsoft.CodeAnalysis; using Mimics; using Mimics.API; using MysteryDice; using MysteryDice.Dice; using MysteryDice.Effects; using MysteryDice.MiscStuff; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.VFX; using VoxxWeatherPlugin.Behaviours; using WesleyMoonScripts; using WesleyMoonScripts.Components; using WesleyMoonScripts.ScriptableObjects; using itolib.Behaviours.Animations; using itolib.Behaviours.Enemies; using itolib.Behaviours.Interactables; using itolib.Behaviours.Kinematics; using itolib.Behaviours.Materials; using itolib.Behaviours.Networking; using itolib.Behaviours.Props; using itolib.Extensions; using itolib.Util; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("BepInEx")] [assembly: IgnoresAccessChecksTo("EnemySkinRegistry")] [assembly: IgnoresAccessChecksTo("voxx.LethalElementsPlugin")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Bozoros")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Plugin for LethalMatt's Bozoros, adds configuration and some additional stuff.")] [assembly: AssemblyFileVersion("2.9.0.0")] [assembly: AssemblyInformationalVersion("2.9.0+df80d5f7a82a36702f56724688975268f9d92a0d")] [assembly: AssemblyProduct("Bozoros")] [assembly: AssemblyTitle("Bozoros")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.9.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Bozoros { internal sealed class BananaPeels { [CompilerGenerated] private static class <>O { public static Action <0>__ApplyMultiplierInside; public static Action <1>__ApplyMultiplierOutside; public static Action <2>__InjectBananaPeels; public static UnityAction <3>__ResetKeysInside; public static UnityAction <4>__ResetKeysOutside; public static UnityAction <5>__UninjectBananaPeels; } private static Keyframe[]? bananaKeysInside; private static Keyframe[]? bananaKeysOutside; internal static List<ExtendedLevel> BananaLevels { get; } = new List<ExtendedLevel>(); internal static SpawnableMapObject? BananaPeelInside { get; private set; } internal static SpawnableOutsideObjectWithRarity? BananaPeelOutside { get; private set; } internal static void RegisterBananaPeel() { if (BananaPeelInside != null) { return; } BananaPeelInside = (((Object)(object)Plugin.CircusFacilityExtendedDungeon != (Object)null && Plugin.CircusFacilityExtendedDungeon.SpawnableMapObjects.Count > 0) ? Plugin.CircusFacilityExtendedDungeon.SpawnableMapObjects[0] : null); if (BananaPeelInside != null) { bananaKeysInside = BananaPeelInside.numberToSpawn.keys; Transform val = BananaPeelInside.prefabToSpawn.transform.Find("BananaLauncher"); PlayerLauncher val2 = default(PlayerLauncher); if ((Object)(object)val != (Object)null && ((Component)val).TryGetComponent<PlayerLauncher>(ref val2)) { val2.dropHeldItemAtStart = Plugin.Settings.BANANA_DROPS_ITEMS.Value < BananaPeelDropLevel.NoItems; val2.dropPlayerItemsAtEnd = Plugin.Settings.BANANA_DROPS_ITEMS.Value < BananaPeelDropLevel.HeldItem; } ((ExtendedEvent)DungeonManager.GlobalDungeonEvents.onBeforeDungeonGenerate).AddListener((Action)ApplyMultiplierInside); } if ((Object)(object)Plugin.BozorosExtendedLevel == (Object)null) { return; } for (int i = 0; i < Plugin.BozorosExtendedLevel.SelectableLevel.spawnableOutsideObjects.Length; i++) { SpawnableOutsideObjectWithRarity val3 = Plugin.BozorosExtendedLevel.SelectableLevel.spawnableOutsideObjects[i]; if ((Object)(object)val3?.spawnableObject != (Object)null && (Object)(object)val3.spawnableObject.prefabToSpawn != (Object)null && StringExtensions.CompareOrdinal(((Object)val3.spawnableObject.prefabToSpawn).name, "BananaPeelSpawn")) { BananaPeelOutside = val3; bananaKeysOutside = val3.randomAmount.keys; break; } } RegisterBananaLevel(Plugin.BozorosExtendedLevel); } internal static void RegisterBananaLevel(ExtendedLevel extendedLevel) { int num = Array.IndexOf(extendedLevel.SelectableLevel.spawnableOutsideObjects, BananaPeelOutside); if (num == -1) { SelectableLevel selectableLevel = extendedLevel.SelectableLevel; SpawnableOutsideObjectWithRarity[] spawnableOutsideObjects = extendedLevel.SelectableLevel.spawnableOutsideObjects; int num2 = 0; SpawnableOutsideObjectWithRarity[] array = (SpawnableOutsideObjectWithRarity[])(object)new SpawnableOutsideObjectWithRarity[1 + spawnableOutsideObjects.Length]; ReadOnlySpan<SpawnableOutsideObjectWithRarity> readOnlySpan = new ReadOnlySpan<SpawnableOutsideObjectWithRarity>(spawnableOutsideObjects); readOnlySpan.CopyTo(new Span<SpawnableOutsideObjectWithRarity>(array).Slice(num2, readOnlySpan.Length)); num2 += readOnlySpan.Length; array[num2] = BananaPeelOutside; selectableLevel.spawnableOutsideObjects = array; } extendedLevel.LevelEvents.onLevelLoaded.AddListener((Action)ApplyMultiplierOutside); BananaLevels.Add(extendedLevel); } private static void ApplyMultiplierInside() { //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown bool flag = false; for (int i = 0; i < BananaLevels.Count; i++) { if (BananaLevels[i].IsCurrentLevel) { if ((Object)(object)DungeonManager.CurrentExtendedDungeonFlow != (Object)null && ((Object)(object)Plugin.CircusFacilityExtendedDungeon == (Object)null || !Plugin.CircusFacilityExtendedDungeon.IsCurrentDungeon)) { ((ExtendedEvent)DungeonManager.CurrentExtendedDungeonFlow.DungeonEvents.onSpawnedSyncedObjects).AddListener((Action)InjectBananaPeels); } flag = true; break; } } if (!flag && (!((Object)(object)Plugin.CircusFacilityExtendedDungeon != (Object)null) || !Plugin.CircusFacilityExtendedDungeon.IsCurrentDungeon)) { return; } float value = Plugin.Settings.BANANA_MULTIPLIER_INSIDE.Value; if (value != 1f && BananaPeelInside != null) { Keyframe[] keys = BananaPeelInside.numberToSpawn.keys; for (int j = 0; j < keys.Length; j++) { ref Keyframe reference = ref keys[j]; ((Keyframe)(ref reference)).value = ((Keyframe)(ref reference)).value * value; } BananaPeelInside.numberToSpawn.keys = keys; } if ((Object)(object)StartOfRound.Instance != (Object)null) { SimpleEvent startNewRoundEvent = StartOfRound.Instance.StartNewRoundEvent; object obj = <>O.<3>__ResetKeysInside; if (obj == null) { UnityAction val = ResetKeysInside; <>O.<3>__ResetKeysInside = val; obj = (object)val; } ((UnityEvent)startNewRoundEvent).AddListener((UnityAction)obj); } } private static void ApplyMultiplierOutside() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown float value = Plugin.Settings.BANANA_MULTIPLIER_OUTSIDE.Value; if (value != 1f && BananaPeelOutside != null) { Keyframe[] keys = BananaPeelOutside.randomAmount.keys; for (int i = 0; i < keys.Length; i++) { ref Keyframe reference = ref keys[i]; ((Keyframe)(ref reference)).value = ((Keyframe)(ref reference)).value * value; } BananaPeelOutside.randomAmount.keys = keys; } if ((Object)(object)StartOfRound.Instance != (Object)null) { SimpleEvent startNewRoundEvent = StartOfRound.Instance.StartNewRoundEvent; object obj = <>O.<4>__ResetKeysOutside; if (obj == null) { UnityAction val = ResetKeysOutside; <>O.<4>__ResetKeysOutside = val; obj = (object)val; } ((UnityEvent)startNewRoundEvent).AddListener((UnityAction)obj); } } private static void ResetKeysInside() { //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_0031: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)StartOfRound.Instance)) { SimpleEvent startNewRoundEvent = StartOfRound.Instance.StartNewRoundEvent; object obj = <>O.<3>__ResetKeysInside; if (obj == null) { UnityAction val = ResetKeysInside; <>O.<3>__ResetKeysInside = val; obj = (object)val; } ((UnityEvent)startNewRoundEvent).RemoveListener((UnityAction)obj); } if (bananaKeysInside != null && BananaPeelInside != null) { BananaPeelInside.numberToSpawn.keys = bananaKeysInside; } } private static void ResetKeysOutside() { //IL_0027: 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_0032: Expected O, but got Unknown if ((Object)(object)StartOfRound.Instance != (Object)null) { SimpleEvent startNewRoundEvent = StartOfRound.Instance.StartNewRoundEvent; object obj = <>O.<4>__ResetKeysOutside; if (obj == null) { UnityAction val = ResetKeysOutside; <>O.<4>__ResetKeysOutside = val; obj = (object)val; } ((UnityEvent)startNewRoundEvent).RemoveListener((UnityAction)obj); } if (bananaKeysOutside != null && BananaPeelOutside != null) { BananaPeelOutside.randomAmount.keys = bananaKeysOutside; } } private static void InjectBananaPeels() { //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Expected O, but got Unknown if ((Object)(object)DungeonManager.CurrentExtendedDungeonFlow != (Object)null) { ((ExtendedEvent)DungeonManager.CurrentExtendedDungeonFlow.DungeonEvents.onSpawnedSyncedObjects).RemoveListener((Action)InjectBananaPeels); } if ((Object)(object)LevelManager.CurrentExtendedLevel != (Object)null && BananaPeelInside != null && (Object)(object)BananaPeelInside.prefabToSpawn != (Object)null) { SpawnableMapObject[] spawnableMapObjects = LevelManager.CurrentExtendedLevel.SelectableLevel.spawnableMapObjects; int num = Array.IndexOf(spawnableMapObjects, BananaPeelInside); if (num == -1) { SelectableLevel selectableLevel = LevelManager.CurrentExtendedLevel.SelectableLevel; SpawnableMapObject[] array = spawnableMapObjects; int num2 = 0; SpawnableMapObject[] array2 = (SpawnableMapObject[])(object)new SpawnableMapObject[1 + array.Length]; ReadOnlySpan<SpawnableMapObject> readOnlySpan = new ReadOnlySpan<SpawnableMapObject>(array); readOnlySpan.CopyTo(new Span<SpawnableMapObject>(array2).Slice(num2, readOnlySpan.Length)); num2 += readOnlySpan.Length; array2[num2] = BananaPeelInside; selectableLevel.spawnableMapObjects = array2; } } if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.dungeonGenerator != (Object)null && (Object)(object)RoundManager.Instance.dungeonGenerator.Root != (Object)null && BananaPeelInside != null && (Object)(object)BananaPeelInside.prefabToSpawn != (Object)null) { RandomMapObject[] componentsInChildren = RoundManager.Instance.dungeonGenerator.Root.GetComponentsInChildren<RandomMapObject>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].spawnablePrefabs.Add(BananaPeelInside.prefabToSpawn); } } if ((Object)(object)StartOfRound.Instance != (Object)null) { SimpleEvent startNewRoundEvent = StartOfRound.Instance.StartNewRoundEvent; object obj = <>O.<5>__UninjectBananaPeels; if (obj == null) { UnityAction val = UninjectBananaPeels; <>O.<5>__UninjectBananaPeels = val; obj = (object)val; } ((UnityEvent)startNewRoundEvent).AddListener((UnityAction)obj); } } private static void UninjectBananaPeels() { //IL_0027: 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_0032: Expected O, but got Unknown if ((Object)(object)StartOfRound.Instance != (Object)null) { SimpleEvent startNewRoundEvent = StartOfRound.Instance.StartNewRoundEvent; object obj = <>O.<5>__UninjectBananaPeels; if (obj == null) { UnityAction val = UninjectBananaPeels; <>O.<5>__UninjectBananaPeels = val; obj = (object)val; } ((UnityEvent)startNewRoundEvent).RemoveListener((UnityAction)obj); } if ((Object)(object)LevelManager.CurrentExtendedLevel != (Object)null && BananaPeelInside != null && (Object)(object)BananaPeelInside.prefabToSpawn != (Object)null) { List<SpawnableMapObject> list = LevelManager.CurrentExtendedLevel.SelectableLevel.spawnableMapObjects.ToList(); if (list.Remove(BananaPeelInside)) { LevelManager.CurrentExtendedLevel.SelectableLevel.spawnableMapObjects = list.ToArray(); } } } } public enum BananaPeelDropLevel { AllItems = -1, HeldItem, NoItems } public sealed class Config { public ConfigEntry<bool> STREAMER_FRIENDLY { get; private set; } public ConfigEntry<float> FIREWORK_PARTICLES { get; private set; } public ConfigEntry<float> CONFETTI_PARTICLES { get; private set; } public ConfigEntry<float> BALLOON_PARTICLES { get; private set; } public ConfigEntry<float> FIREWORK_MUSIC_VOLUME { get; private set; } public ConfigEntry<float> FIREWORK_EXPLOSION_VOLUME { get; private set; } public ConfigEntry<float> ANNOUNCER_VOLUME { get; private set; } public ConfigEntry<float> TENT_MUSIC_VOLUME { get; private set; } public ConfigEntry<float> DROPSHIP_VOLUME { get; private set; } public ConfigEntry<string> GOOFY_PUFFER_NAMES { get; private set; } public ConfigEntry<string> CLOWN_GIANT_NAMES { get; private set; } public ConfigEntry<string> SANTA_BUTLER_NAMES { get; private set; } public ConfigEntry<bool> EXTRA_PUFFER_SPAWNS { get; private set; } public ConfigEntry<bool> FOGGY_BARBER_SPAWNS { get; private set; } public ConfigEntry<bool> BALLOON_INSTRUCTIONS { get; private set; } public ConfigEntry<int> BALLOON_PRICE { get; private set; } public ConfigEntry<bool> FERRIS_WHEEL_EXIT { get; private set; } public ConfigEntry<float> BANANA_MULTIPLIER_INSIDE { get; private set; } public ConfigEntry<float> BANANA_MULTIPLIER_OUTSIDE { get; private set; } public ConfigEntry<BananaPeelDropLevel> BANANA_DROPS_ITEMS { get; private set; } public ConfigEntry<bool> MODIFY_SHIP_NODE { get; private set; } public ConfigEntry<bool> ADD_DROPSHIP_NODE { get; private set; } public ConfigEntry<bool> REDUCE_MOTION_SICKNESS { get; private set; } public ConfigEntry<bool> CIRCUS_FACILITY_MIMICS { get; private set; } public ConfigEntry<bool> CIRCUS_PANDORAMUS_PORTAL { get; private set; } public ConfigEntry<bool> CIRCUS_STARLANCERZERO_DOOR { get; private set; } public ConfigEntry<bool> BOZO_DICE_EFFECTS { get; private set; } public ConfigEntry<bool> WESLEY_INTEGRATION { get; private set; } public ConfigEntry<bool> WESLEY_INJECT_SCRAPS { get; private set; } public ConfigEntry<bool> BLACK_FOG_VOIDHEAD_SPAWNS { get; private set; } public Config(ConfigFile cfg) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Expected O, but got Unknown //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Expected O, but got Unknown //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Expected O, but got Unknown //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Expected O, but got Unknown cfg.SaveOnConfigSet = false; STREAMER_FRIENDLY = cfg.Bind<bool>("General", "StreamerFriendly", true, "Whether the music is streamer-friendly or not."); FIREWORK_PARTICLES = cfg.Bind<float>("Particles", "FireworkParticles", 1f, new ConfigDescription("Intensity of firework particles at the end of a clear day.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); CONFETTI_PARTICLES = cfg.Bind<float>("Particles", "ConfettiParticles", 1f, new ConfigDescription("Intensity of confetti particles during eclipsed weather.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); BALLOON_PARTICLES = cfg.Bind<float>("Particles", "BalloonParticles", 1f, new ConfigDescription("Intensity of balloon particles during stormy weather.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); FIREWORK_MUSIC_VOLUME = cfg.Bind<float>("Audio", "FireworkMusicVolume", 1f, new ConfigDescription("Volume level for the firework music at the end of a clear day.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); FIREWORK_EXPLOSION_VOLUME = cfg.Bind<float>("Audio", "FireworkExplosionVolume", 1f, new ConfigDescription("Volume level for the firework explosion sound effects at the end of a clear day.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); ANNOUNCER_VOLUME = cfg.Bind<float>("Audio", "AnnouncerVolume", 2f, new ConfigDescription("Volume level for the announcer voice at the end of each day.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); TENT_MUSIC_VOLUME = cfg.Bind<float>("Audio", "TentMusicVolume", 1f, new ConfigDescription("Volume level for the circus tent music near every entrance.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); DROPSHIP_VOLUME = cfg.Bind<float>("Audio", "DropshipVolume", 1f, new ConfigDescription("Volume level for the dropship's music when delivering items.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); GOOFY_PUFFER_NAMES = cfg.Bind<string>("Enemies", "GoofyPufferNames", "Steve,Krusty,Ronald,Arthur,Toodles,Jingles,Dusty,Dumbo,Bingo,Whistle,Mittens,Pancake,Freckles,Chester,Oddball,Snuggles,Charlie,Bashful,Flower,Jumbo,Jimbo,Snickers,Pogo,Giggles,Loofy,Blinky,Ruffles,Dinky,Beebo,Chuckles", "A comma-separated list of names for Spore Lizard enemy variants to show in their scan node. Requires restart."); CLOWN_GIANT_NAMES = cfg.Bind<string>("Enemies", "ClownGiantNames", "Penn,Teller,Houdini,Dante,Copperfield,Blaine,Angel,Borden,Angier,Merlin,Kaito,Oz,Zatara,Mysterio,Riddler,Eisenheim,Gallico,Splendini", "A comma-separated list of names for Forest Giant enemy variants to show in their scan node. Requires restart."); SANTA_BUTLER_NAMES = cfg.Bind<string>("Enemies", "SantaButlerNames", "Santa Claus,St. Nicholas,Joulupukki,Sinterklaas,Ded Moroz,Julenisse,Mikulás,Shengdan Laoren,Père Noël,Krampus,Knecht Ruprecht,Kriss Kringle", "A comma-separated list of names for Santa Butler enemy variants to show in their scan node. Requires restart."); EXTRA_PUFFER_SPAWNS = cfg.Bind<bool>("Enemies", "ExtraPufferSpawns", true, "Whether there should be additional Goofy Puffer spawns at the start of a round or not. Spore Lizards are capped at a maximum of 2 in vanilla."); FOGGY_BARBER_SPAWNS = cfg.Bind<bool>("Enemies", "FoggyBarberSpawns", true, "Whether there should be additional outside Barber spawns during Foggy weather or not."); BALLOON_INSTRUCTIONS = cfg.Bind<bool>("Mechanics", "BalloonInstructions", true, "Show a one-time notification with instructions on how to operate balloons. Shows once per session, until the game is reopened."); BALLOON_PRICE = cfg.Bind<int>("Mechanics", "BalloonPrice", 15, new ConfigDescription("Credits required to purchase a one-time balloon shortcut from one of the balloon stands around the map. Can be set to -1 to disable (if you HATE fun).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(-1, 200), Array.Empty<object>())); FERRIS_WHEEL_EXIT = cfg.Bind<bool>("Mechanics", "FerrisWheelExit", true, "Whether the Fire Exit inside the Ferris Wheel should spawn or not — wormholes may not be immersive!"); BANANA_MULTIPLIER_INSIDE = cfg.Bind<float>("Mechanics", "BananaMultiplierInside", 1f, new ConfigDescription("Multiply inside banana peel hazard spawning curve across the board (minimum and maximum) by this value. Set to 0 to disable banana peels inside.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); BANANA_MULTIPLIER_OUTSIDE = cfg.Bind<float>("Mechanics", "BananaMultiplierOutside", 1f, new ConfigDescription("Multiply outside banana peel hazard spawning curve across the board (minimum and maximum) by this value. Set to 0 to disable banana peels outside.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); BANANA_DROPS_ITEMS = cfg.Bind<BananaPeelDropLevel>("Mechanics", "BananaDropsItems", BananaPeelDropLevel.HeldItem, "Whether slipping on a banana peel causes players to drop items."); MODIFY_SHIP_NODE = cfg.Bind<bool>("Other", "ModifyShipNode", false, "Increase (subjective) accuracy of the ship's scan node."); ADD_DROPSHIP_NODE = cfg.Bind<bool>("Other", "AddDropshipNode", true, "Add a scan node to the dropship and allow it to be scanned."); REDUCE_MOTION_SICKNESS = cfg.Bind<bool>("Other", "ReduceMotionSickness", false, "Attempts to reduce motion sickness a bit. Currently only stops the camera turning when going through the twisted hallway."); CIRCUS_FACILITY_MIMICS = cfg.Bind<bool>("Compatibility", "CircusFacilityMimics", true, "Allow x753's Mimics to spawn in Circus Facility."); CIRCUS_PANDORAMUS_PORTAL = cfg.Bind<bool>("Compatibility", "CircusPandoramusPortal", true, "Enable Circus Facility's special portal for DemonMae's Pandoramus; otherwise it'll just be the same as regular facility. Requires restart."); CIRCUS_STARLANCERZERO_DOOR = cfg.Bind<bool>("Compatibility", "CircusStarlancerZeroDoor", true, "Enable Circus Facility swapping StarlancerZero's main entrance door. Requires restart."); BOZO_DICE_EFFECTS = cfg.Bind<bool>("Compatibility", "BozoEmergencyDiceEffects", true, "Enable Bozoros' custom effects for Emergency Dice. Requires restart."); WESLEY_INTEGRATION = cfg.Bind<bool>("Compatibility", "WesleyIntegration", false, "Enable progression integration with Wesley's Moons: Journeys. Requires restart."); WESLEY_INJECT_SCRAPS = cfg.Bind<bool>("Compatibility", "WesleyInjectScraps", true, "Add a few Wesley-related scraps to Bozoros' spawn pool, if Wesley integration is active. Requires restart."); BLACK_FOG_VOIDHEAD_SPAWNS = cfg.Bind<bool>("Compatibility", "BlackFogVoidheadSpawns", true, "Whether temporary Voidheads should spawn during Black Fog weather or not. Requires both Wesley's Interiors and DemonMae's Black Fog weather."); BANANA_DROPS_ITEMS.SettingChanged += delegate(object setting, EventArgs _) { if (BananaPeels.BananaPeelInside != null && !((Object)(object)BananaPeels.BananaPeelInside.prefabToSpawn == (Object)null)) { Transform val = BananaPeels.BananaPeelInside.prefabToSpawn.transform.Find("BananaLauncher"); PlayerLauncher val3 = default(PlayerLauncher); if (setting is ConfigEntry<BananaPeelDropLevel> val2 && (Object)(object)val != (Object)null && ((Component)val).TryGetComponent<PlayerLauncher>(ref val3)) { val3.dropHeldItemAtStart = val2.Value < BananaPeelDropLevel.NoItems; val3.dropPlayerItemsAtEnd = val2.Value < BananaPeelDropLevel.HeldItem; } } }; cfg.OrphanedEntries.Clear(); cfg.SaveOnConfigSet = true; cfg.Save(); } } [BepInDependency("imabatby.lethallevelloader", "1.5.1")] [BepInDependency("pacoito.itolib", "0.9.0")] [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("LethalMatt.Bozoros", "BozorosPlugin", "2.9.0")] public class Plugin : BaseUnityPlugin { public const string PLUGIN_GUID = "LethalMatt.Bozoros"; public const string PLUGIN_NAME = "BozorosPlugin"; public const string VERSION = "2.9.0"; internal static ManualLogSource StaticLogger { get; private set; } internal static Harmony Harmony { get; private set; } public static Config Settings { get; private set; } internal static AssetBundle? BozorosBundle { get; private set; } internal static ExtendedLevel? BozorosExtendedLevel { get; private set; } internal static ExtendedDungeonFlow? CircusFacilityExtendedDungeon { get; private set; } private void Awake() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown StaticLogger = ((BaseUnityPlugin)this).Logger; try { Settings = new Config(((BaseUnityPlugin)this).Config); Harmony = new Harmony("LethalMatt.Bozoros"); LoadAssets(); Harmony.PatchAll(typeof(LoadPatch)); StaticLogger.LogInfo((object)"'BozorosPlugin' loaded!"); } catch (Exception arg) { StaticLogger.LogError((object)string.Format("Error while initializing '{0}': {1}", "BozorosPlugin", arg)); } } private static void LoadAssets() { AssetBundleLoader.AddOnExtendedModLoadedListener((Action<ExtendedMod>)delegate(ExtendedMod bozorosExtended) { if (bozorosExtended.ExtendedLevels.Count > 0 && (Object)(object)bozorosExtended.ExtendedLevels[0] != (Object)null) { BozorosExtendedLevel = bozorosExtended.ExtendedLevels[0]; } else if ((Object)(object)BozorosExtendedLevel == (Object)null) { StaticLogger.LogError((object)"Could not load Bozoros... ExtendedLevel not found!"); } if (bozorosExtended.ExtendedDungeonFlows.Count > 0 && (Object)(object)bozorosExtended.ExtendedDungeonFlows[0] != (Object)null) { CircusFacilityExtendedDungeon = bozorosExtended.ExtendedDungeonFlows[0]; } else if ((Object)(object)CircusFacilityExtendedDungeon == (Object)null) { StaticLogger.LogError((object)"Could not load CircusFacility... ExtendedDungeonFlow not found!"); } if ((Object)(object)BozorosExtendedLevel != (Object)null && (Object)(object)CircusFacilityExtendedDungeon != (Object)null) { BananaPeels.RegisterBananaPeel(); } }, "LethalMatt", "Bozoros"); AssetBundleLoader.AddOnLethalBundleLoadedListener((Action<AssetBundle>)delegate(AssetBundle assetBundle) { BozorosBundle = assetBundle; }, "bozoros.lethalbundle"); AssetBundleLoader.AddOnExtendedModLoadedListener((Action<ExtendedMod>)delegate(ExtendedMod extendedMod) { PlayZoneCompatibility.PlayZoneExtendedMod = extendedMod; }, "LethalMatt", "PlayZone"); if (EnemySkinRegistryCompatibility.Enabled) { EnemySkinRegistryCompatibility.LoadSkins(); EnemySkinRegistryCompatibility.RegisterSkins(); } if (MimicsCompatibility.Enabled) { MimicsCompatibility.RegisterCircusMimic(); } if (WesleyCompatibility.Enabled) { WesleyCompatibility.RegisterWesleyBozoIntegration(); } if (Settings.CIRCUS_PANDORAMUS_PORTAL.Value) { PandoramusCompatibility.RegisterCompat(); } if (Settings.CIRCUS_STARLANCERZERO_DOOR.Value) { StarlancerZeroCompatibility.RegisterCompat(); } } } } namespace Bozoros.Skins { internal sealed class CircusMimic : MimicEventHandler { private static readonly int attackID = Animator.StringToHash("Attack"); public static GameObject? CircusMimicPrefab { get; internal set; } public override string ModGUID => "LethalMatt.Bozoros"; public override bool IsMyInteriorLoaded { get { if ((Object)(object)Plugin.CircusFacilityExtendedDungeon != (Object)null) { return Plugin.CircusFacilityExtendedDungeon.IsCurrentDungeon; } return false; } } public override int Priority => 100; public override bool OverrideDefaultImperfectionCreation(MimicDoor mimicDoor, Doorway doorway) { return false; } public override void OnMimicCreated(MimicDoor mimicDoor, Doorway doorway) { //IL_007f: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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) ((MimicEventHandler)this).OnMimicCreated(mimicDoor, doorway); if (!((Object)(object)CircusMimicPrefab == (Object)null)) { Object.Instantiate<GameObject>(CircusMimicPrefab, ((Component)mimicDoor).transform); Transform val = ((Component)mimicDoor).transform.Find("Armature/Frame"); if ((Object)(object)val != (Object)null) { ((Component)val).transform.SetLocalPositionAndRotation(new Vector3(0f, -0.65f, 0f), Quaternion.Euler(new Vector3(90f, 0f, 0f))); } ((Component)mimicDoor).transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity); Transform val2 = ((Component)mimicDoor).transform.Find("Armature/Door"); if ((Object)(object)val2 != (Object)null) { ((Component)val2).gameObject.SetActive(false); } Transform val3 = ((Component)mimicDoor).transform.Find("Light"); if ((Object)(object)val3 != (Object)null) { ((Component)val3).gameObject.SetActive(false); } } } public override void OnMimicCreateImperfections(MimicDoor mimicDoor) { ((MimicEventHandler)this).OnMimicCreateImperfections(mimicDoor); } public override void OnMimicAttackStart(MimicDoor mimicDoor, PlayerControllerB playerToAttack) { ((MimicEventHandler)this).OnMimicAttackStart(mimicDoor, playerToAttack); Transform val = ((Component)mimicDoor).transform.Find("CircusWallDoorMimic(Clone)"); Animator val2 = default(Animator); if ((Object)(object)val != (Object)null && ((Component)val.GetChild(0).GetChild(1)).TryGetComponent<Animator>(ref val2)) { val2.SetTrigger(attackID); } } public override void OnMimicAttackEnd(MimicDoor mimicDoor) { ((MimicEventHandler)this).OnMimicAttackEnd(mimicDoor); } } internal sealed class ClownGiant : Skin, Skinner { public string Label => "Clown Giant"; public string Id => "LethalMatt.Bozoros.ClownGiant"; public string EnemyId => "LethalCompany.ForestKeeper"; public Texture2D Icon { get { if (!((Object)(object)EnemySkinRegistryCompatibility.BozorosIcon != (Object)null)) { return Texture2D.blackTexture; } return EnemySkinRegistryCompatibility.BozorosIcon; } } public static Material? ClownGiantMaterial { get; internal set; } public static GameObject? ClownHair { get; internal set; } public static GameObject? ClownNose { get; internal set; } public static List<string> ClownGiantNames { get; internal set; } = new List<string>(); public static Random? Random { get; internal set; } public Skinner CreateSkinner() { return (Skinner)(object)new ClownGiant(); } public void Apply(GameObject enemy) { ForestGiantAI val = default(ForestGiantAI); if ((Object)(object)ClownGiantMaterial == (Object)null || (Object)(object)ClownNose == (Object)null || (Object)(object)ClownHair == (Object)null || (Object)(object)enemy == (Object)null || !enemy.TryGetComponent<ForestGiantAI>(ref val)) { return; } Transform val2 = ((Component)val).transform.Find("FGiantModelContainer"); if ((Object)(object)val2 == (Object)null) { return; } SkinnedMeshRenderer val3 = default(SkinnedMeshRenderer); for (int i = 0; i < 3; i++) { Transform child = val2.GetChild(i); if ((Object)(object)child != (Object)null && ((Component)child).TryGetComponent<SkinnedMeshRenderer>(ref val3)) { ((Renderer)val3).sharedMaterial = ClownGiantMaterial; } } Transform val4 = val2.Find("AnimContainer/metarig/spine/spine.003"); if ((Object)(object)val4 != (Object)null) { Object.Instantiate<GameObject>(ClownHair, val4); Object.Instantiate<GameObject>(ClownNose, val4); } Transform child2 = ((Component)val).transform.GetChild(1); ScanNodeProperties val5 = default(ScanNodeProperties); if (ClownGiantNames.Count > 0 && (Object)(object)child2 != (Object)null && ((Component)child2).TryGetComponent<ScanNodeProperties>(ref val5)) { val5.headerText = ClownGiantNames[Random?.Next(0, ClownGiantNames.Count) ?? 0] ?? ""; val5.subText = "Clown Giant"; } } public void Remove(GameObject enemy) { } } internal sealed class GoofyPuffer : Skin, Skinner { public string Label => "Goofy Puffer"; public string Id => "LethalMatt.Bozoros.GoofyPuffer"; public string EnemyId => "LethalCompany.SporeLizard"; public Texture2D Icon { get { if (!((Object)(object)EnemySkinRegistryCompatibility.BozorosIcon != (Object)null)) { return Texture2D.blackTexture; } return EnemySkinRegistryCompatibility.BozorosIcon; } } public static Material? GoofyPufferMaterial { get; internal set; } public static List<string> GoofyPufferNames { get; internal set; } = new List<string>(); public static Random? Random { get; internal set; } public Skinner CreateSkinner() { return (Skinner)(object)new GoofyPuffer(); } public void Apply(GameObject enemy) { PufferAI val = default(PufferAI); if ((Object)(object)GoofyPufferMaterial == (Object)null || (Object)(object)enemy == (Object)null || !enemy.TryGetComponent<PufferAI>(ref val)) { return; } Transform val2 = ((Component)val).transform.Find("PufferModel/BezierCurve"); if (!((Object)(object)val2 == (Object)null)) { SkinnedMeshRenderer val3 = default(SkinnedMeshRenderer); if (((Component)val2).TryGetComponent<SkinnedMeshRenderer>(ref val3)) { ((Renderer)val3).sharedMaterial = GoofyPufferMaterial; } Transform child = ((Component)val).transform.GetChild(1); ScanNodeProperties val4 = default(ScanNodeProperties); if (GoofyPufferNames.Count > 0 && (Object)(object)child != (Object)null && ((Component)child).TryGetComponent<ScanNodeProperties>(ref val4)) { val4.headerText = GoofyPufferNames[Random?.Next(0, GoofyPufferNames.Count) ?? 0] ?? ""; val4.subText = "Goofy Puffer"; } } } public void Remove(GameObject enemy) { } } internal sealed class SantaButler : Skin, Skinner, ButlerEventHandler, EnemyEventHandler { public string Label => "Santa Butler"; public string Id => "LethalMatt.Bozoros.SantaButler"; public string EnemyId => "LethalCompany.Butler"; public Texture2D Icon { get { if (!((Object)(object)EnemySkinRegistryCompatibility.BozorosIcon != (Object)null)) { return Texture2D.blackTexture; } return EnemySkinRegistryCompatibility.BozorosIcon; } } public static Mesh? CandyCaneMesh { get; internal set; } public static Material? CandyCaneMaterial { get; internal set; } public static GameObject? CandyCaneKnife { get; internal set; } public static Material? SantaMaterial { get; internal set; } public static GameObject? SantaHat { get; internal set; } public static Texture2D? GrinchHornetsTexture { get; internal set; } public static List<string> SantaButlerNames { get; internal set; } = new List<string>(); public static Random? Random { get; internal set; } public Skinner CreateSkinner() { return (Skinner)(object)new SantaButler(); } public void Apply(GameObject enemy) { ButlerEnemyAI val = default(ButlerEnemyAI); if ((Object)(object)SantaMaterial == (Object)null || (Object)(object)CandyCaneMesh == (Object)null || (Object)(object)CandyCaneMaterial == (Object)null || (Object)(object)enemy == (Object)null || !enemy.TryGetComponent<ButlerEnemyAI>(ref val) || StringExtensions.CompareOrdinal(((Object)val).name.Substring(0, 4), "Ross")) { return; } Transform val2 = ((Component)val).transform.Find("MeshContainer"); if ((Object)(object)val2 == (Object)null) { return; } SkinnedMeshRenderer val3 = default(SkinnedMeshRenderer); for (int i = 0; i < 3; i++) { Transform child = val2.GetChild(i); if ((Object)(object)child != (Object)null && ((Component)child).TryGetComponent<SkinnedMeshRenderer>(ref val3)) { ((Renderer)val3).sharedMaterial = SantaMaterial; } } Transform val4 = val2.Find("Rig 1/Arms/RightArm/upperRightArmContainer/upper_arm.R_target/Knife"); MeshFilter val5 = default(MeshFilter); MeshRenderer val6 = default(MeshRenderer); if ((Object)(object)val4 != (Object)null && ((Component)val4).TryGetComponent<MeshFilter>(ref val5) && ((Component)val4).TryGetComponent<MeshRenderer>(ref val6)) { val5.sharedMesh = CandyCaneMesh; ((Renderer)val6).sharedMaterial = CandyCaneMaterial; } if ((Object)(object)CandyCaneKnife != (Object)null) { Transform val7 = ((Component)val).transform.Find("BloodStabParticle"); if ((Object)(object)val7 != (Object)null) { Object.Destroy((Object)(object)((Component)val7).gameObject); } GameObject val8 = Object.Instantiate<GameObject>(((Component)CandyCaneKnife.transform.GetChild(2)).gameObject, ((Component)val).transform, false); val.stabBloodParticle = val8.GetComponent<ParticleSystem>(); val.knifePrefab = CandyCaneKnife; } Transform val9 = val2.Find("metarig/spine/spine.001/NeckContainer/spine.004/face"); if ((Object)(object)val9 != (Object)null) { Object.Instantiate<GameObject>(SantaHat, val9); } Transform val10 = ((Component)val).transform.Find("ScanNode"); ScanNodeProperties val11 = default(ScanNodeProperties); if (SantaButlerNames.Count > 0 && (Object)(object)val10 != (Object)null && ((Component)val10).TryGetComponent<ScanNodeProperties>(ref val11)) { val11.headerText = SantaButlerNames[Random?.Next(0, SantaButlerNames.Count) ?? 0] ?? ""; val11.subText = "Santa Butler"; } EnemySkinRegistry.RegisterEnemyEventHandler((EnemyAI)(object)val, (EnemyEventHandler)(object)this); } public void OnSpawnHornets(ButlerEnemyAI instance, ButlerBeesEnemyAI hornets) { if (!StringExtensions.CompareOrdinal(((Object)instance).name.Substring(0, 4), "Ross")) { Transform child = ((Component)hornets).transform.GetChild(0); ScanNodeProperties val = default(ScanNodeProperties); if ((Object)(object)child != (Object)null && ((Component)child).TryGetComponent<ScanNodeProperties>(ref val)) { val.headerText = "Grinch Particles"; } VisualEffect val2 = default(VisualEffect); if ((Object)(object)GrinchHornetsTexture != (Object)null && ((Component)((Component)hornets).transform.Find("BugSwarmParticle")).TryGetComponent<VisualEffect>(ref val2)) { val2.SetTexture("BugTexture", (Texture)(object)GrinchHornetsTexture); } } } public void Remove(GameObject enemy) { } } } namespace Bozoros.Patches { [HarmonyPatch] internal sealed class LoadPatch { public static bool FirstLoad { get; private set; } = true; public static event Action? OnFinishGeneratingLevelPost; public static event Action? OnFinishGeneratingNewLevelClientRpcPost; [HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")] [HarmonyPostfix] private static void FinishGeneratingLevelPost() { LoadPatch.OnFinishGeneratingLevelPost?.Invoke(); } [HarmonyPatch(typeof(RoundManager), "FinishGeneratingNewLevelClientRpc")] [HarmonyPostfix] private static void FinishGeneratingNewLevelClientRpcPost() { LoadPatch.OnFinishGeneratingNewLevelClientRpcPost?.Invoke(); } [HarmonyPatch(typeof(MenuManager), "Start")] [HarmonyPrefix] private static void MenuManagerStartPre() { if (FirstLoad) { FirstLoad = false; if (EmergencyDiceCompatibility.Enabled && Plugin.Settings.BOZO_DICE_EFFECTS.Value) { EmergencyDiceCompatibility.RegisterDiceEffects(); Plugin.Harmony.PatchAll(typeof(EmergencyDiceCompatibility)); } if (LethalElementsCompatibility.Enabled) { LethalElementsCompatibility.RegisterSnozoros(); } } } } } namespace Bozoros.Effects { internal sealed class BananaPeelDiceEffect : NetworkedDiceEffect { public override EffectType Outcome => (EffectType)1; public override bool ShowDefaultTooltip => false; public override string Name => "Up! Up! Up! Banana!"; public override string Tooltip => "Potassium levels increased..."; public override void Use() { //IL_000b: 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) SpawnBananaPeelRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)GameNetworkManager.Instance.localPlayerController)); List<PlayerControllerB> list = StartOfRound.Instance.allPlayerScripts.ToList(); list.RemoveAll((PlayerControllerB player) => (Object)(object)player == (Object)null || !((Behaviour)player).isActiveAndEnabled || player.isPlayerDead || PlayerExtensions.IsLocalClient(player)); for (int i = 0; i < list.Count / 2; i++) { int index = Random.RandomRangeInt(0, list.Count); SpawnBananaPeelRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)list[index])); list.RemoveAt(index); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SpawnBananaPeelRpc(NetworkBehaviourReference playerReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_0082: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_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_0177: 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_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0193: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3282497943u, val2, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkBehaviourReference>(ref playerReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3282497943u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = default(PlayerControllerB); if (BananaPeels.BananaPeelOutside != null && !((Object)(object)BananaPeels.BananaPeelOutside.spawnableObject == (Object)null) && !((Object)(object)BananaPeels.BananaPeelOutside.spawnableObject.prefabToSpawn == (Object)null) && ((NetworkBehaviourReference)(ref playerReference)).TryGet<PlayerControllerB>(ref val4, (NetworkManager)null)) { GameObject prefabToSpawn = BananaPeels.BananaPeelOutside.spawnableObject.prefabToSpawn; Transform transform = ((Component)val4).transform; int num = Random.RandomRangeInt(8, 17); Vector3 val5 = default(Vector3); for (int i = 0; i < num; i++) { float num2 = MathF.PI * 2f / (float)num * (float)i; ((Vector3)(ref val5))..ctor(Mathf.Cos(num2), 0f, Mathf.Sin(num2)); Vector3 val6 = transform.position + val5 * Random.Range(1f, 5f); Quaternion val7 = Quaternion.FromToRotation(val6, transform.position); Object.Instantiate<GameObject>(prefabToSpawn, val6, val7, ((Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null) ? RoundManager.Instance.mapPropsContainer.transform : null); } } } protected override void __initializeVariables() { base.__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 ((NetworkBehaviour)this).__registerRpc(3282497943u, new RpcReceiveHandler(__rpc_handler_3282497943), "SpawnBananaPeelRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3282497943(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_004f: 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) { NetworkBehaviourReference playerReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref playerReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BananaPeelDiceEffect)(object)target).SpawnBananaPeelRpc(playerReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BananaPeelDiceEffect"; } } internal sealed class BonkDeliveryDiceEffect : NetworkedDiceEffect { private enum RotatorType { TWO_BAGS, BAG_UP, BAG_LOW } public override EffectType Outcome => (EffectType)1; public override bool ShowDefaultTooltip => false; public override string Name => "Bonk Delivery"; public override string Tooltip => "Watch your head!"; public override void Use() { if ((Object)(object)PlayZoneCompatibility.Rotator2BagsPrefab != (Object)null && (Object)(object)PlayZoneCompatibility.RotatorBagUpPrefab != (Object)null && (Object)(object)PlayZoneCompatibility.RotatorBagLowPrefab != (Object)null && (Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { SpawnRotatorRpc(GameNetworkManager.Instance.localPlayerController.isInsideFactory); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SpawnRotatorRpc(bool spawnInside) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_0082: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_01d4: 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_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2129222629u, val2, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref spawnInside, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2129222629u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)PlayZoneCompatibility.Rotator2BagsPrefab == (Object)null || (Object)(object)PlayZoneCompatibility.RotatorBagUpPrefab == (Object)null || (Object)(object)PlayZoneCompatibility.RotatorBagLowPrefab == (Object)null || (Object)(object)RoundManager.Instance == (Object)null || (Object)(object)RoundManager.Instance.mapPropsContainer == (Object)null) { return; } GameObject[] array = (spawnInside ? RoundManager.Instance.insideAINodes : RoundManager.Instance.outsideAINodes); if (array == null || array.Length == 0) { return; } int num = Random.RandomRangeInt(1, 5); MeshRenderer val8 = default(MeshRenderer); for (int i = 0; i < num; i++) { int num2 = Random.RandomRangeInt(0, 3); if (!Enum.IsDefined(typeof(RotatorType), num2)) { continue; } NetworkObject val4 = (NetworkObject)((RotatorType)num2 switch { RotatorType.TWO_BAGS => PlayZoneCompatibility.Rotator2BagsPrefab, RotatorType.BAG_UP => PlayZoneCompatibility.RotatorBagUpPrefab, RotatorType.BAG_LOW => PlayZoneCompatibility.RotatorBagLowPrefab, _ => null, }); if ((Object)(object)val4 == (Object)null) { continue; } GameObject val5 = array[Random.RandomRangeInt(0, array.Length)]; if ((Object)(object)val5 == (Object)null) { break; } Vector3 position = val5.transform.position; NetworkObject component = Object.Instantiate<GameObject>(MysteryDice.AgentObjectPrefab, position, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform).GetComponent<NetworkObject>(); component.Spawn(true); NetworkObject component2 = Object.Instantiate<GameObject>(((Component)val4).gameObject, position, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform).GetComponent<NetworkObject>(); component2.Spawn(true); SmartAgentNavigator component3 = ((Component)component).gameObject.GetComponent<SmartAgentNavigator>(); MakeMove val6 = ((Component)component2).gameObject.AddComponent<MakeMove>(); ((Component)component2).transform.SetParent(((Component)component).transform); ((Component)component2).transform.SetLocalPositionAndRotation(new Vector3(0f, 0.2f, 0f), Quaternion.identity); float num3 = Random.Range(0.65f, 1f); ((Component)component2).GetComponent<AnimationVelocity>().SyncSpeed(num3); CapsuleCollider[] componentsInChildren = ((Component)component2).GetComponentsInChildren<CapsuleCollider>(false); foreach (CapsuleCollider val7 in componentsInChildren) { if ((Object)(object)val7 != (Object)null && ((Component)val7).gameObject.layer == 8 && !((Component)val7).TryGetComponent<MeshRenderer>(ref val8)) { ((Collider)val7).enabled = false; } } Object.Destroy((Object)(object)((Component)((Component)component2).transform.GetChild(0)).gameObject); Object.Destroy((Object)(object)((Component)((Component)component2).transform.GetChild(2)).gameObject); val6.Initialize(component3); ((Behaviour)val6).enabled = true; Networker.Instance.FreebirdTrapClientRPC(component.NetworkObjectId); } } protected override void __initializeVariables() { base.__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 ((NetworkBehaviour)this).__registerRpc(2129222629u, new RpcReceiveHandler(__rpc_handler_2129222629), "SpawnRotatorRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2129222629(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 spawnInside = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref spawnInside, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BonkDeliveryDiceEffect)(object)target).SpawnRotatorRpc(spawnInside); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BonkDeliveryDiceEffect"; } } internal sealed class CircusInTownDiceEffect : NetworkedDiceEffect { public override EffectType Outcome => (EffectType)2; public override bool ShowDefaultTooltip => false; public override string Name => "The circus is in town!"; public override string Tooltip => "The trees are dressed for the occasion... Are you?"; public override void Use() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ForestGiantAI[] array = Object.FindObjectsByType<ForestGiantAI>((FindObjectsInactive)0, (FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { SwitchForestGiantSkinRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)array[i])); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SwitchForestGiantSkinRpc(NetworkBehaviourReference enemyReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_0082: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2347895434u, val2, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkBehaviourReference>(ref enemyReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2347895434u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ForestGiantAI enemy = default(ForestGiantAI); if (EnemySkinRegistryCompatibility.Enabled && ((NetworkBehaviourReference)(ref enemyReference)).TryGet<ForestGiantAI>(ref enemy, (NetworkManager)null)) { EnemySkinRegistryCompatibility.SwitchEnemySkin((EnemyAI)(object)enemy, "LethalMatt.Bozoros.ClownGiant"); } } } protected override void __initializeVariables() { base.__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 ((NetworkBehaviour)this).__registerRpc(2347895434u, new RpcReceiveHandler(__rpc_handler_2347895434), "SwitchForestGiantSkinRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2347895434(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_004f: 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) { NetworkBehaviourReference enemyReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref enemyReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CircusInTownDiceEffect)(object)target).SwitchForestGiantSkinRpc(enemyReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CircusInTownDiceEffect"; } } internal sealed class FishTouchDiceEffect : NetworkedDiceEffect { [CompilerGenerated] private sealed class <AttachPlayerDelayed>d__14 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NetworkBehaviourReference playerReference; public NetworkBehaviourReference trackerReference; private PlayerTracker <tracker>5__2; private PlayerControllerB <player>5__3; private float <startTime>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AttachPlayerDelayed>d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <tracker>5__2 = null; <player>5__3 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!((NetworkBehaviourReference)(ref playerReference)).TryGet<PlayerControllerB>(ref <player>5__3, (NetworkManager)null)) { return false; } <startTime>5__4 = Time.realtimeSinceStartup; goto IL_0065; case 1: <>1__state = -1; goto IL_0065; case 2: { <>1__state = -1; ((PlayerAttachable)<tracker>5__2).AttachPlayer(<player>5__3); return false; } IL_0065: if (!((NetworkBehaviourReference)(ref trackerReference)).TryGet<PlayerTracker>(ref <tracker>5__2, (NetworkManager)null) && Time.realtimeSinceStartup - <startTime>5__4 < 8f) { <>2__current = Yielders.WaitForSeconds(0.03f); <>1__state = 1; return true; } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static GameObject? FishTouchPrefab { get; internal set; } public override EffectType Outcome => (EffectType)2; public override bool ShowDefaultTooltip => false; public override string Name => "Fish Touch"; public override string Tooltip => "You've got the Fish Touch! Pass it to a crewmate!"; public override void Use() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) SummonFishRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)GameNetworkManager.Instance.localPlayerController)); } [Rpc(/*Could not decode attribute arguments.*/)] private void SummonFishRpc(NetworkBehaviourReference playerReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_0082: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_012c: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(876923144u, val2, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkBehaviourReference>(ref playerReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 876923144u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = default(PlayerControllerB); if ((Object)(object)FishTouchPrefab == (Object)null || !((NetworkBehaviourReference)(ref playerReference)).TryGet<PlayerControllerB>(ref val4, (NetworkManager)null)) { return; } Transform transform = ((Component)val4).transform; Transform val5 = (((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null) ? RoundManager.Instance.mapPropsContainer.transform : null); NetworkObject val6 = default(NetworkObject); if (Object.Instantiate<GameObject>(FishTouchPrefab, transform.position, transform.rotation, val5).TryGetComponent<NetworkObject>(ref val6)) { val6.Spawn(true); PlayerTracker componentInChildren = ((Component)val6).GetComponentInChildren<PlayerTracker>(false); if ((Object)(object)componentInChildren != (Object)null) { ((MonoBehaviour)this).StartCoroutine(AttachPlayerDelayed(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)componentInChildren), NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)val4))); } } } [IteratorStateMachine(typeof(<AttachPlayerDelayed>d__14))] private static IEnumerator AttachPlayerDelayed(NetworkBehaviourReference trackerReference, NetworkBehaviourReference playerReference) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AttachPlayerDelayed>d__14(0) { trackerReference = trackerReference, playerReference = playerReference }; } protected override void __initializeVariables() { base.__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 ((NetworkBehaviour)this).__registerRpc(876923144u, new RpcReceiveHandler(__rpc_handler_876923144), "SummonFishRpc"); base.__initializeRpcs(); } private static void __rpc_handler_876923144(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_004f: 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) { NetworkBehaviourReference playerReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref playerReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((FishTouchDiceEffect)(object)target).SummonFishRpc(playerReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "FishTouchDiceEffect"; } } public abstract class NetworkedDiceEffect : NetworkBehaviour, IEffect { public abstract EffectType Outcome { get; } public abstract bool ShowDefaultTooltip { get; } public abstract string Name { get; } public abstract string Tooltip { get; } public abstract void Use(); public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); MysteryDice.RegisterNewEffect((IEffect)(object)this, false, false); } public override void OnNetworkDespawn() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0051: Expected I4, but got Unknown DieBehaviour.AllEffects.Remove((IEffect)(object)this); DieBehaviour.CompleteEffects.Remove((IEffect)(object)this); DieBehaviour.AllowedEffects.Remove((IEffect)(object)this); EffectType outcome = Outcome; switch ((int)outcome) { case 0: DieBehaviour.AwfulEffects.Remove((IEffect)(object)this); break; case 1: DieBehaviour.BadEffects.Remove((IEffect)(object)this); break; case 2: DieBehaviour.MixedEffects.Remove((IEffect)(object)this); break; case 3: DieBehaviour.GoodEffects.Remove((IEffect)(object)this); break; case 4: DieBehaviour.GreatEffects.Remove((IEffect)(object)this); break; } ((NetworkBehaviour)this).OnNetworkDespawn(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "NetworkedDiceEffect"; } } internal sealed class PufferInfestationDiceEffect : NetworkedDiceEffect { [CompilerGenerated] private static EnemyType? <PufferEnemyType>k__BackingField; public static EnemyType? PufferEnemyType { get { if ((Object)(object)<PufferEnemyType>k__BackingField == (Object)null) { PufferEnemyType = OriginalContent.Enemies.Find((EnemyType enemy) => StringExtensions.CompareOrdinal(enemy.enemyName, "Puffer")); } return <PufferEnemyType>k__BackingField; } [CompilerGenerated] private set { <PufferEnemyType>k__BackingField = value; } } public override EffectType Outcome => (EffectType)1; public override bool ShowDefaultTooltip => false; public override string Name => "Spore Swarm"; public override string Tooltip => "Puffer infestation!"; public override void Use() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0064: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)GameNetworkManager.Instance.localPlayerController).transform; int num = Random.RandomRangeInt(4, 7); Vector3 val = default(Vector3); for (int i = 0; i < num; i++) { float num2 = MathF.PI * 2f / (float)num * (float)i; ((Vector3)(ref val))..ctor(Mathf.Cos(num2), 0f, Mathf.Sin(num2)); Vector3 spawnPosition = transform.position + val * Random.Range(5f, 10f); SpawnPufferServerRpc(spawnPosition); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SpawnPufferServerRpc(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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2884672709u, val2, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref spawnPosition); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2884672709u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)PufferEnemyType == (Object)null || (Object)(object)PufferEnemyType.enemyPrefab == (Object)null) { return; } NetworkObject componentInChildren = Object.Instantiate<GameObject>(PufferEnemyType.enemyPrefab, spawnPosition, Quaternion.identity).GetComponentInChildren<NetworkObject>(); if ((Object)(object)componentInChildren == (Object)null) { return; } componentInChildren.Spawn(true); PufferAI val4 = default(PufferAI); if (((Component)componentInChildren).TryGetComponent<PufferAI>(ref val4)) { if ((Object)(object)RoundManager.Instance != (Object)null && RoundManager.Instance.SpawnedEnemies != null) { RoundManager.Instance.SpawnedEnemies.Add((EnemyAI)(object)val4); } SpawnPufferClientRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)val4)); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SpawnPufferClientRpc(NetworkBehaviourReference enemyReference) { //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_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_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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00cd: 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) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2433991652u, val2, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkBehaviourReference>(ref enemyReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2433991652u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (EnemySkinRegistryCompatibility.Enabled) { ((MonoBehaviour)this).StartCoroutine(EnemySkinRegistryCompatibility.SwitchEnemySkinDelayed(enemyReference, "LethalMatt.Bozoros.GoofyPuffer")); } } } protected override void __initializeVariables() { base.__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(2884672709u, new RpcReceiveHandler(__rpc_handler_2884672709), "SpawnPufferServerRpc"); ((NetworkBehaviour)this).__registerRpc(2433991652u, new RpcReceiveHandler(__rpc_handler_2433991652), "SpawnPufferClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2884672709(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 spawnPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((PufferInfestationDiceEffect)(object)target).SpawnPufferServerRpc(spawnPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2433991652(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_004f: 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) { NetworkBehaviourReference enemyReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref enemyReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PufferInfestationDiceEffect)(object)target).SpawnPufferClientRpc(enemyReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PufferInfestationDiceEffect"; } } internal sealed class SantaVisitDiceEffect : NetworkedDiceEffect { [CompilerGenerated] private static EnemyType? <ButlerEnemyType>k__BackingField; public static EnemyType? ButlerEnemyType { get { if ((Object)(object)<ButlerEnemyType>k__BackingField == (Object)null) { ButlerEnemyType = OriginalContent.Enemies.Find((EnemyType enemy) => StringExtensions.CompareOrdinal(enemy.enemyName, "Butler")); } return <ButlerEnemyType>k__BackingField; } [CompilerGenerated] private set { <ButlerEnemyType>k__BackingField = value; } } public static GameObject? SantaGiftsPrefab { get; internal set; } public override EffectType Outcome => (EffectType)3; public override bool ShowDefaultTooltip => false; public override string Name => "Santa is here!"; public override string Tooltip => "Have you been good this year?"; public override void Use() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) SpawnButlerServerRpc(((Component)GameNetworkManager.Instance.localPlayerController).transform.position); } [Rpc(/*Could not decode attribute arguments.*/)] private void SpawnButlerServerRpc(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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3405927006u, val2, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref spawnPosition); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3405927006u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if ((Object)(object)ButlerEnemyType == (Object)null || (Object)(object)ButlerEnemyType.enemyPrefab == (Object)null || !Object.Instantiate<GameObject>(ButlerEnemyType.enemyPrefab, spawnPosition, Quaternion.identity).TryGetComponent<NetworkObject>(ref val4)) { return; } val4.Spawn(true); ButlerEnemyAI val5 = default(ButlerEnemyAI); if (!((Component)val4).TryGetComponent<ButlerEnemyAI>(ref val5)) { return; } if ((Object)(object)RoundManager.Instance != (Object)null && RoundManager.Instance.SpawnedEnemies != null) { RoundManager.Instance.SpawnedEnemies.Add((EnemyAI)(object)val5); } SpawnButlerClientRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)val5)); if (!((Object)(object)SantaGiftsPrefab == (Object)null)) { Transform val6 = (((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null) ? RoundManager.Instance.mapPropsContainer.transform : null); NetworkObject val7 = default(NetworkObject); if (Object.Instantiate<GameObject>(SantaGiftsPrefab, spawnPosition, Quaternion.identity, val6).TryGetComponent<NetworkObject>(ref val7)) { val7.Spawn(true); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SpawnButlerClientRpc(NetworkBehaviourReference enemyReference) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_0082: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00db: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = true }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(7196713u, val2, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkBehaviourReference>(ref enemyReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 7196713u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (EnemySkinRegistryCompatibility.Enabled) { ((MonoBehaviour)this).StartCoroutine(EnemySkinRegistryCompatibility.SwitchEnemySkinDelayed(enemyReference, "LethalMatt.Bozoros.SantaButler")); } } } protected override void __initializeVariables() { base.__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(3405927006u, new RpcReceiveHandler(__rpc_handler_3405927006), "SpawnButlerServerRpc"); ((NetworkBehaviour)this).__registerRpc(7196713u, new RpcReceiveHandler(__rpc_handler_7196713), "SpawnButlerClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3405927006(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 spawnPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((SantaVisitDiceEffect)(object)target).SpawnButlerServerRpc(spawnPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_7196713(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_004f: 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) { NetworkBehaviourReference enemyReference = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref enemyReference, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SantaVisitDiceEffect)(object)target).SpawnButlerClientRpc(enemyReference); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string? __getTypeName() { return "SantaVisitDiceEffect"; } } } namespace Bozoros.Compatibility { [HarmonyPatch] internal sealed class EmergencyDiceCompatibility { private static bool? _enabled; public static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("Theronguard.EmergencyDice"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void RegisterDiceEffects() { if ((Object)(object)Plugin.BozorosBundle != (Object)null) { FishTouchDiceEffect.FishTouchPrefab = Plugin.BozorosBundle.LoadAsset<GameObject>("FishDiceRoll.prefab"); SantaVisitDiceEffect.SantaGiftsPrefab = Plugin.BozorosBundle.LoadAsset<GameObject>("SantaGifts.prefab"); } if ((Object)(object)PlayZoneCompatibility.PlayZoneExtendedMod != (Object)null) { PlayZoneCompatibility.ObtainRotatorPrefabs(); } if (!((Object)(object)MysteryDice.NetworkerPrefab != (Object)null)) { return; } MysteryDice.NetworkerPrefab.AddComponent<BananaPeelDiceEffect>(); MysteryDice.NetworkerPrefab.AddComponent<FishTouchDiceEffect>(); if (EnemySkinRegistryCompatibility.Enabled) { if (EnemySkinRegistryCompatibility.SkinExists("LethalMatt.Bozoros.ClownGiant")) { MysteryDice.NetworkerPrefab.AddComponent<CircusInTownDiceEffect>(); } if (EnemySkinRegistryCompatibility.SkinExists("LethalMatt.Bozoros.GoofyPuffer")) { MysteryDice.NetworkerPrefab.AddComponent<PufferInfestationDiceEffect>(); } if (EnemySkinRegistryCompatibility.SkinExists("LethalMatt.Bozoros.SantaButler")) { MysteryDice.NetworkerPrefab.AddComponent<SantaVisitDiceEffect>(); } } if ((Object)(object)PlayZoneCompatibility.Rotator2BagsPrefab != (Object)null && (Object)(object)PlayZoneCompatibility.RotatorBagUpPrefab != (Object)null && (Object)(object)PlayZoneCompatibility.RotatorBagLowPrefab != (Object)null && (Object)(object)MysteryDice.AgentObjectPrefab != (Object)null) { MysteryDice.NetworkerPrefab.AddComponent<BonkDeliveryDiceEffect>(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] [HarmonyPatch(typeof(Networker), "InstantiateSpecialPrefabForPlayer")] [HarmonyPrefix] private static void InstantiateGreed(PlayerControllerB player) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0063: Unknown result type (might be due to invalid IL or missing references) if (!GameNetworkManager.Instance.disableSteam && player.playerSteamId == 76561198072744265L) { GameObject val = new GameObject("CustomPlayerScanNode"); val.transform.SetParent(((Component)player).transform); val.transform.SetLocalPositionAndRotation(((Component)player).transform.position + new Vector3(0f, 2.5f, 0f), Quaternion.identity); } } } internal sealed class EnemySkinRegistryCompatibility { [CompilerGenerated] private sealed class <SwitchEnemySkinDelayed>d__11 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NetworkBehaviourReference enemyReference; public string skin; private EnemyAI <enemy>5__2; private float <startTime>5__3; object? IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object? IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SwitchEnemySkinDelayed>d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <enemy>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <startTime>5__3 = Time.realtimeSinceStartup; goto IL_004f; case 1: <>1__state = -1; goto IL_004f; case 2: { <>1__state = -1; SwitchEnemySkin(<enemy>5__2, skin); return false; } IL_004f: if (!((NetworkBehaviourReference)(ref enemyReference)).TryGet<EnemyAI>(ref <enemy>5__2, (NetworkManager)null) && Time.realtimeSinceStartup - <startTime>5__3 < 8f) { <>2__current = Yielders.WaitForSeconds(0.03f); <>1__state = 1; return true; } <>2__current = Yielders.WaitForEndOfFrame; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static bool? _enabled; public static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("antlershed.lethalcompany.enemyskinregistry"); _enabled = valueOrDefault; } return _enabled.Value; } } public static Texture2D? BozorosIcon { get; private set; } internal static void LoadSkins() { AssetBundleLoader.AddOnLethalBundleLoadedListener((Action<AssetBundle>)delegate(AssetBundle assetBundle) { BozorosIcon = assetBundle.LoadAsset<Texture2D>("BozorosIcon.png"); GoofyPuffer.GoofyPufferMaterial = assetBundle.LoadAsset<Material>("GoofyPufferMat.mat"); ClownGiant.ClownGiantMaterial = assetBundle.LoadAsset<Material>("ClownGiantMat.mat"); ClownGiant.ClownHair = assetBundle.LoadAsset<GameObject>("ClownHair.prefab"); ClownGiant.ClownNose = assetBundle.LoadAsset<GameObject>("ClownNose.prefab"); SantaButler.CandyCaneMesh = assetBundle.LoadAsset<Mesh>("Xmas_CandyCane_Knife.fbx"); SantaButler.CandyCaneMaterial = assetBundle.LoadAsset<Material>("CandyCaneMat.mat"); SantaButler.CandyCaneKnife = assetBundle.LoadAsset<GameObject>("CandyCaneKnife.prefab"); SantaButler.SantaMaterial = assetBundle.LoadAsset<Material>("Xmas_SantaMat.mat"); SantaButler.SantaHat = assetBundle.LoadAsset<GameObject>("Xmas_SantaHat.prefab"); SantaButler.GrinchHornetsTexture = assetBundle.LoadAsset<Texture2D>("Xmas_GrinchHornets.png"); }, "bozoros.lethalbundle"); if (Plugin.Settings.GOOFY_PUFFER_NAMES.Value.Length > 0) { GoofyPuffer.GoofyPufferNames = Plugin.Settings.GOOFY_PUFFER_NAMES.Value.Split(',').ToList(); LoadPatch.OnFinishGeneratingLevelPost += delegate { GoofyPuffer.Random = new Random(StartOfRound.Instance.randomMapSeed + 1); }; } if (Plugin.Settings.CLOWN_GIANT_NAMES.Value.Length > 0) { ClownGiant.ClownGiantNames = Plugin.Settings.CLOWN_GIANT_NAMES.Value.Split(',').ToList(); LoadPatch.OnFinishGeneratingLevelPost += delegate { ClownGiant.Random = new Random(StartOfRound.Instance.randomMapSeed + 2); }; } if (Plugin.Settings.SANTA_BUTLER_NAMES.Value.Length > 0) { SantaButler.SantaButlerNames = Plugin.Settings.SANTA_BUTLER_NAMES.Value.Split(',').ToList(); LoadPatch.OnFinishGeneratingLevelPost += delegate { SantaButler.Random = new Random(StartOfRound.Instance.randomMapSeed + 3); }; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void RegisterSkins() { //IL_0017: Unknown result type (might be due to invalid IL or missing references