Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ColorfulJarOfPickles v1.1.5
ColorfulJarOfPickles.dll
Decompiled 6 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using ColorfulJarOfPickles.NetcodePatcher; using ColorfulJarOfPickles.Utils; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ColorfulJarOfPickles")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("ColorfulJarOfPickles")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+611fb6598058a3c1efddf510afcc5b0b8645d406")] [assembly: AssemblyProduct("ColorfulJarOfPickles")] [assembly: AssemblyTitle("ColorfulJarOfPickles")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ColorfulJarOfPickles { [BepInPlugin("wexop.colorful_jar_of_pickles", "ColorfulJarOfPickles", "1.1.5")] public class ColorfulJarOfPicklesPlugin : BaseUnityPlugin { private const string GUID = "wexop.colorful_jar_of_pickles"; private const string NAME = "ColorfulJarOfPickles"; private const string VERSION = "1.1.5"; public static ColorfulJarOfPicklesPlugin instance; public List<GameObject> ColorfulJarOfPicklesGameObjects = new List<GameObject>(); public List<GameObject> RainbowColorfulJarOfPicklesGameObjects = new List<GameObject>(); public ConfigEntry<string> spawnMoonRarity; public ConfigEntry<string> bigJarSpawnMoonRarity; public ConfigEntry<string> smallJarSpawnMoonRarity; public ConfigEntry<string> longJarSpawnMoonRarity; public ConfigEntry<string> flatJarSpawnMoonRarity; public ConfigEntry<string> stackSmallJarSpawnMoonRarity; public ConfigEntry<string> roundJarSpawnMoonRarity; public ConfigEntry<string> caseOfPicklesRarity; public ConfigEntry<string> caseOfSmallPicklesRarity; public ConfigEntry<string> flaskPicklesRarity; public ConfigEntry<string> giantPicklesRarity; public ConfigEntry<string> dancingPicklesRarity; public ConfigEntry<string> cubePicklesRarity; public ConfigEntry<string> lonelyPicklesRarity; public ConfigEntry<string> popPicklesRarity; public ConfigEntry<string> giftPicklesRarity; public ConfigEntry<string> rainbowSmallJarSpawnMoonRarity; public ConfigEntry<string> rainbowBigJarSpawnMoonRarity; public ConfigEntry<string> rainbowSpawnMoonRarity; public ConfigEntry<string> rainbowLongJarSpawnMoonRarity; public ConfigEntry<string> rainbowFlatJarSpawnMoonRarity; public ConfigEntry<string> rainbowStackSmallJarSpawnMoonRarity; public ConfigEntry<string> rainbowRoundJarSpawnMoonRarity; public ConfigEntry<string> rainbowCaseOfPicklesRarity; public ConfigEntry<string> rainbowCaseOfSmallPicklesRarity; public ConfigEntry<string> rainbowFlaskPicklesRarity; public ConfigEntry<string> rainbowGiantPicklesRarity; public ConfigEntry<string> rainbowDancingPicklesRarity; public ConfigEntry<string> rainbowCubePicklesRarity; public ConfigEntry<string> rainbowPopPicklesRarity; public ConfigEntry<string> rainbowGiftPicklesRarity; public ConfigEntry<float> dancingMusicVolume; private void Awake() { instance = this; ((BaseUnityPlugin)this).Logger.LogInfo((object)"ColorfulJarOfPickles starting...."); string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "colorfuljarofpickles"); AssetBundle bundle = AssetBundle.LoadFromFile(text); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ColorfulJarOfPickles bundle found !"); NetcodePatcher(); LoadConfigs(); RegisterScrap(bundle); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ColorfulJarOfPickles is ready!"); } private string RarityString(int rarity) { return $"Modded:{rarity},ExperimentationLevel:{rarity},AssuranceLevel:{rarity},VowLevel:{rarity},OffenseLevel:{rarity},MarchLevel:{rarity},RendLevel:{rarity},DineLevel:{rarity},TitanLevel:{rarity},Adamance:{rarity},Embrion:{rarity},Artifice:{rarity}"; } private void LoadConfigs() { spawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "ScrapSpawnRarity", RarityString(40), "Chance for scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(spawnMoonRarity, requireRestart: true); bigJarSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "BigJarScrapSpawnRarity", RarityString(20), "Chance for big jar scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(bigJarSpawnMoonRarity, requireRestart: true); smallJarSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "SmallJarScrapSpawnRarity", RarityString(30), "Chance for small jar scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(smallJarSpawnMoonRarity, requireRestart: true); longJarSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "LongJarSpawnMoonRarity", RarityString(15), "Chance for long jar scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(longJarSpawnMoonRarity, requireRestart: true); flatJarSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "FlatJarSpawnMoonRarity", RarityString(15), "Chance for flat jar scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(flatJarSpawnMoonRarity, requireRestart: true); stackSmallJarSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "StackSmallJarSpawnMoonRarity", RarityString(15), "Chance for stack of jars scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(stackSmallJarSpawnMoonRarity, requireRestart: true); roundJarSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RoundJarSpawnMoonRarity", RarityString(30), "Chance for round jar scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(roundJarSpawnMoonRarity, requireRestart: true); caseOfPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "CaseOfPicklesRarity", RarityString(15), "Chance for case of pickles to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(caseOfPicklesRarity, requireRestart: true); caseOfSmallPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "CaseOfSmallPicklesRarity", RarityString(15), "Chance for case of small pickles to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(caseOfSmallPicklesRarity, requireRestart: true); flaskPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "FlaskPicklesRarity", RarityString(30), "Chance for pickles in flask scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(flaskPicklesRarity, requireRestart: true); giantPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "GiantPicklesRarity", RarityString(5), "Chance for giant jar of pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(giantPicklesRarity, requireRestart: true); dancingPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "DancingPicklesRarity", RarityString(10), "Chance for dancing pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(dancingPicklesRarity, requireRestart: true); cubePicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "CubePicklesRarity", RarityString(30), "Chance for cube pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(cubePicklesRarity, requireRestart: true); lonelyPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "LonelyPicklesRarity", RarityString(12), "Chance for lonely pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(lonelyPicklesRarity, requireRestart: true); popPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "PopPicklesRarity", RarityString(8), "Chance for pop pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(popPicklesRarity, requireRestart: true); giftPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "GiftPicklesRarity", RarityString(20), "Chance for gift pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(giftPicklesRarity, requireRestart: true); rainbowSmallJarSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowSmallJarScrapSpawnRarity", RarityString(5), "Chance for rainbow small jar scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowSmallJarSpawnMoonRarity, requireRestart: true); rainbowBigJarSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowBigJarScrapSpawnRarity", RarityString(3), "Chance for rainbow big jar scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowBigJarSpawnMoonRarity, requireRestart: true); rainbowSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowScrapSpawnRarity", RarityString(5), "Chance for rainbow scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowSpawnMoonRarity, requireRestart: true); rainbowLongJarSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowLongJarSpawnMoonRarity", RarityString(3), "Chance for rainbow long jar scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowLongJarSpawnMoonRarity, requireRestart: true); rainbowFlatJarSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowFlatJarSpawnMoonRarity", RarityString(3), "Chance for rainbow flat jar scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowFlatJarSpawnMoonRarity, requireRestart: true); rainbowStackSmallJarSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowStackSmallJarSpawnMoonRarity", RarityString(3), "Chance for rainbow stack of jars scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowStackSmallJarSpawnMoonRarity, requireRestart: true); rainbowRoundJarSpawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowRoundJarSpawnMoonRarity", RarityString(5), "Chance for rainbow round jar scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowRoundJarSpawnMoonRarity, requireRestart: true); rainbowCaseOfSmallPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowCaseOfSmallPicklesRarity", RarityString(3), "Chance for rainbow case of small pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowCaseOfSmallPicklesRarity, requireRestart: true); rainbowCaseOfPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowCaseOfPicklesRarity", RarityString(3), "Chance for rainbow case of pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowCaseOfPicklesRarity, requireRestart: true); rainbowFlaskPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowFlaskPicklesRarity", RarityString(5), "Chance for rainbow pickles in flask scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowFlaskPicklesRarity, requireRestart: true); rainbowGiantPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowGiantPicklesRarity", RarityString(1), "Chance for rainbow giant jar of pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowGiantPicklesRarity, requireRestart: true); rainbowDancingPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowDancingPicklesRarity", RarityString(1), "Chance for rainbow giant jar of pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowDancingPicklesRarity, requireRestart: true); rainbowCubePicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowCubePicklesRarity", RarityString(5), "Chance for rainbow cube pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowDancingPicklesRarity, requireRestart: true); rainbowPopPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowPopPicklesRarity", RarityString(3), "Chance for rainbow pop pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowPopPicklesRarity, requireRestart: true); rainbowGiftPicklesRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "RainbowGiftPicklesRarity", RarityString(5), "Chance for rainbow gift pickles scrap to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(rainbowGiftPicklesRarity, requireRestart: true); dancingMusicVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Sound", "DancingMusicVolume", 0.4f, "Dancing Pickles music volume. You don't need to restart the game."); CreateFloatConfig(dancingMusicVolume, 0f, 1f); } private void RegisterScrap(AssetBundle bundle) { Item val = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/ColorfulPickleJar.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); Utilities.FixMixerGroups(val.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(spawnMoonRarity.Value, val); ColorfulJarOfPicklesGameObjects.Add(val.spawnPrefab); Item val2 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/RainbowPickleJar.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val2).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val2.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab); Utilities.FixMixerGroups(val2.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowSpawnMoonRarity.Value, val2); RainbowColorfulJarOfPicklesGameObjects.Add(val2.spawnPrefab); Item val3 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/BigPickleJar.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val3).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val3.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab); Utilities.FixMixerGroups(val3.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(bigJarSpawnMoonRarity.Value, val3); ColorfulJarOfPicklesGameObjects.Add(val3.spawnPrefab); Item val4 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/SmallPickleJar.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val4).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val4.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab); Utilities.FixMixerGroups(val4.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(smallJarSpawnMoonRarity.Value, val4); ColorfulJarOfPicklesGameObjects.Add(val4.spawnPrefab); Item val5 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/LongColorfulPickleJar.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val5).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val5.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val5.spawnPrefab); Utilities.FixMixerGroups(val5.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(longJarSpawnMoonRarity.Value, val5); ColorfulJarOfPicklesGameObjects.Add(val5.spawnPrefab); Item val6 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/FlatPickleJar.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val6).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val6.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val6.spawnPrefab); Utilities.FixMixerGroups(val6.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(flatJarSpawnMoonRarity.Value, val6); ColorfulJarOfPicklesGameObjects.Add(val6.spawnPrefab); Item val7 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/StackSmallPickleJars.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val7).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val7.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val7.spawnPrefab); Utilities.FixMixerGroups(val7.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(stackSmallJarSpawnMoonRarity.Value, val7); ColorfulJarOfPicklesGameObjects.Add(val7.spawnPrefab); Item val8 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/CaseOfPickles.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val8).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val8.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val8.spawnPrefab); Utilities.FixMixerGroups(val8.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(caseOfPicklesRarity.Value, val8); ColorfulJarOfPicklesGameObjects.Add(val8.spawnPrefab); Item val9 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/CaseOfSmallPickles.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val9).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val9.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val9.spawnPrefab); Utilities.FixMixerGroups(val9.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(caseOfSmallPicklesRarity.Value, val9); ColorfulJarOfPicklesGameObjects.Add(val9.spawnPrefab); Item val10 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/RoundPickleJar.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val10).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val10.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val10.spawnPrefab); Utilities.FixMixerGroups(val10.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(roundJarSpawnMoonRarity.Value, val10); ColorfulJarOfPicklesGameObjects.Add(val10.spawnPrefab); Item val11 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/FlaskPickles.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val11).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val11.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val11.spawnPrefab); Utilities.FixMixerGroups(val11.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(flaskPicklesRarity.Value, val11); ColorfulJarOfPicklesGameObjects.Add(val11.spawnPrefab); Item val12 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/CubePickles.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val12).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val12.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val12.spawnPrefab); Utilities.FixMixerGroups(val12.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(cubePicklesRarity.Value, val12); ColorfulJarOfPicklesGameObjects.Add(val12.spawnPrefab); Item val13 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/ColorfulPickleJarGiant.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val13).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val13.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val13.spawnPrefab); Utilities.FixMixerGroups(val13.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(giantPicklesRarity.Value, val13); ColorfulJarOfPicklesGameObjects.Add(val13.spawnPrefab); Item val14 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/DancingPickles.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val14).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val14.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val14.spawnPrefab); Utilities.FixMixerGroups(val14.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(dancingPicklesRarity.Value, val14); ColorfulJarOfPicklesGameObjects.Add(val14.spawnPrefab); Item val15 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/LonelyPickles.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val15).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val15.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val15.spawnPrefab); Utilities.FixMixerGroups(val15.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(lonelyPicklesRarity.Value, val15); Item val16 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/PopPickles.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val16).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val16.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val16.spawnPrefab); Utilities.FixMixerGroups(val16.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(popPicklesRarity.Value, val16); ColorfulJarOfPicklesGameObjects.Add(val16.spawnPrefab); Item val17 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/GiftPickles.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val17).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val17.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val17.spawnPrefab); Utilities.FixMixerGroups(val17.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(giftPicklesRarity.Value, val17); Item val18 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/RainbowSmallPickleJar.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val18).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val18.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val18.spawnPrefab); Utilities.FixMixerGroups(val18.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowSmallJarSpawnMoonRarity.Value, val18); RainbowColorfulJarOfPicklesGameObjects.Add(val18.spawnPrefab); Item val19 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/RainbowBigPickleJar.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val19).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val19.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val19.spawnPrefab); Utilities.FixMixerGroups(val19.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowBigJarSpawnMoonRarity.Value, val19); RainbowColorfulJarOfPicklesGameObjects.Add(val19.spawnPrefab); Item val20 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/RainbowLongColorfulPickleJar.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val20).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val20.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val20.spawnPrefab); Utilities.FixMixerGroups(val20.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowLongJarSpawnMoonRarity.Value, val20); RainbowColorfulJarOfPicklesGameObjects.Add(val20.spawnPrefab); Item val21 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/RainbowFlatPickleJar.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val21).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val21.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val21.spawnPrefab); Utilities.FixMixerGroups(val21.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowFlatJarSpawnMoonRarity.Value, val21); RainbowColorfulJarOfPicklesGameObjects.Add(val21.spawnPrefab); Item val22 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/RainbowStackSmallPickleJars.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val22).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val22.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val22.spawnPrefab); Utilities.FixMixerGroups(val22.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowStackSmallJarSpawnMoonRarity.Value, val22); RainbowColorfulJarOfPicklesGameObjects.Add(val22.spawnPrefab); Item val23 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/RainbowRoundPickleJar.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val23).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val23.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val23.spawnPrefab); Utilities.FixMixerGroups(val23.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowRoundJarSpawnMoonRarity.Value, val23); RainbowColorfulJarOfPicklesGameObjects.Add(val23.spawnPrefab); Item val24 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/CaseOfPicklesRainbow.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val24).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val24.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val24.spawnPrefab); Utilities.FixMixerGroups(val24.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowCaseOfPicklesRarity.Value, val24); RainbowColorfulJarOfPicklesGameObjects.Add(val24.spawnPrefab); Item val25 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/CaseOfSmallPicklesRainbow.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val25).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val25.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val25.spawnPrefab); Utilities.FixMixerGroups(val25.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowCaseOfSmallPicklesRarity.Value, val25); RainbowColorfulJarOfPicklesGameObjects.Add(val25.spawnPrefab); Item val26 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/FlaskPicklesRainbow.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val26).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val26.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val26.spawnPrefab); Utilities.FixMixerGroups(val26.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowFlaskPicklesRarity.Value, val26); RainbowColorfulJarOfPicklesGameObjects.Add(val26.spawnPrefab); Item val27 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/ColorfulPickleJarGiantRainbow.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val27).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val27.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val27.spawnPrefab); Utilities.FixMixerGroups(val27.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowGiantPicklesRarity.Value, val27); RainbowColorfulJarOfPicklesGameObjects.Add(val27.spawnPrefab); Item val28 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/DancingPicklesRainbow.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val28).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val28.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val28.spawnPrefab); Utilities.FixMixerGroups(val28.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowDancingPicklesRarity.Value, val28); RainbowColorfulJarOfPicklesGameObjects.Add(val28.spawnPrefab); Item val29 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/CubePicklesRainbow.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val29).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val29.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val29.spawnPrefab); Utilities.FixMixerGroups(val29.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowCubePicklesRarity.Value, val29); RainbowColorfulJarOfPicklesGameObjects.Add(val29.spawnPrefab); Item val30 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/PopPicklesRainbow.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val30).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val30.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val30.spawnPrefab); Utilities.FixMixerGroups(val30.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowPopPicklesRarity.Value, val30); RainbowColorfulJarOfPicklesGameObjects.Add(val30.spawnPrefab); Item val31 = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ColorfulJarOfPickles/GiftPicklesRainbow.asset"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val31).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val31.spawnPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val31.spawnPrefab); Utilities.FixMixerGroups(val31.spawnPrefab); RegisterUtil.RegisterScrapWithConfig(rainbowGiftPicklesRarity.Value, val31); } private static void NetcodePatcher() { Type[] array; try { array = Assembly.GetExecutingAssembly().GetTypes(); } catch (ReflectionTypeLoadException ex) { array = ex.Types.Where((Type type) => type != null).ToArray(); } Type[] array2 = array; foreach (Type type2 in array2) { MethodInfo[] methods = type2.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } } private void CreateFloatConfig(ConfigEntry<float> configEntry, float min = 0f, float max = 100f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown FloatSliderOptions val = new FloatSliderOptions(); ((BaseRangeOptions<float>)val).Min = min; ((BaseRangeOptions<float>)val).Max = max; ((BaseOptions)val).RequiresRestart = false; FloatSliderConfigItem val2 = new FloatSliderConfigItem(configEntry, val); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2); } private void CreateIntConfig(ConfigEntry<int> configEntry, int min = 0, int max = 100) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown IntSliderOptions val = new IntSliderOptions(); ((BaseRangeOptions<int>)val).Min = min; ((BaseRangeOptions<int>)val).Max = max; ((BaseOptions)val).RequiresRestart = false; IntSliderConfigItem val2 = new IntSliderConfigItem(configEntry, val); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2); } private void CreateStringConfig(ConfigEntry<string> configEntry, bool requireRestart = false) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown TextInputFieldConfigItem val = new TextInputFieldConfigItem(configEntry, new TextInputFieldOptions { RequiresRestart = requireRestart }); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val); } } public static class PluginInfo { public const string PLUGIN_GUID = "ColorfulJarOfPickles"; public const string PLUGIN_NAME = "ColorfulJarOfPickles"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace ColorfulJarOfPickles.Utils { public class RegisterUtil { public static void RegisterEnemyWithConfig(string configMoonRarity, EnemyType enemy, TerminalNode terminalNode, TerminalKeyword terminalKeyword, float powerLevel, int spawnCount) { enemy.MaxCount = spawnCount; enemy.PowerLevel = powerLevel; var (dictionary, dictionary2) = ConfigParsing(configMoonRarity); Enemies.RegisterEnemy(enemy, dictionary, dictionary2, terminalNode, terminalKeyword); } public static void RegisterScrapWithConfig(string configMoonRarity, Item scrap) { var (dictionary, dictionary2) = ConfigParsing(configMoonRarity); Items.RegisterScrap(scrap, dictionary, dictionary2); } public static void RegisterShopItemWithConfig(bool enabledScrap, Item item, TerminalNode terminalNode, int itemCost, string configMoonRarity) { Items.RegisterShopItem(item, (TerminalNode)null, (TerminalNode)null, terminalNode, itemCost); if (enabledScrap) { RegisterScrapWithConfig(configMoonRarity, item); } } public static (Dictionary<LevelTypes, int> spawnRateByLevelType, Dictionary<string, int> spawnRateByCustomLevelType) ConfigParsing(string configMoonRarity) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) Dictionary<LevelTypes, int> dictionary = new Dictionary<LevelTypes, int>(); Dictionary<string, int> dictionary2 = new Dictionary<string, int>(); foreach (string item in from s in configMoonRarity.Split(',') select s.Trim()) { string[] array = item.Split(':'); if (array.Length != 2) { continue; } string text = array[0]; if (!int.TryParse(array[1], out var result)) { continue; } if (Enum.TryParse<LevelTypes>(text, ignoreCase: true, out LevelTypes result2)) { dictionary[result2] = result; continue; } string value = text + "Level"; if (Enum.TryParse<LevelTypes>(value, ignoreCase: true, out result2)) { dictionary[result2] = result; } else { dictionary2[text] = result; } } return (dictionary, dictionary2); } } } namespace ColorfulJarOfPickles.Scripts { public class ColorfulJarOfPicklesScrap : PhysicsProp { public GameObject jarGameObject; public List<GameObject> picklesGameObjects; public Light lightObject; public List<Renderer> jarRenderers; public Color actualColor; public UnityEvent<bool> onTriggerDance; public UnityEvent onItemActivate; public UnityEvent onGrabItem; public override void ItemActivate(bool used, bool buttonDown = true) { onItemActivate.Invoke(); } public virtual void TriggerDance(bool dance) { if (onTriggerDance != null) { onTriggerDance.Invoke(dance); } } public override void GrabItem() { if (onGrabItem != null) { onGrabItem.Invoke(); } } public void ChangeColor(Color color) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_0046: Unknown result type (might be due to invalid IL or missing references) lightObject.color = color; jarRenderers.ForEach(delegate(Renderer r) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) r.material.color = SetColorAlpha(color, r.material.color.a); if (((Object)r.material).name.Contains("Pickle")) { r.material.SetColor("_EmissiveColor", color); } }); actualColor = color; } public float RandomZeroToOne() { return Random.Range(0f, 1f); } public float RandomLightColorFloat() { return Random.Range(0.75f, 1f); } public Color SetColorAlpha(Color color, float alpha) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) return new Color(((Color)(ref color))[0], ((Color)(ref color))[1], ((Color)(ref color))[2], alpha); } public virtual Color GetRandomColor(float initialAlpha = 1f) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Color result = default(Color); ((Color)(ref result))..ctor(RandomZeroToOne(), RandomZeroToOne(), RandomZeroToOne(), initialAlpha); ((Color)(ref result))[Random.Range(0, 4)] = RandomLightColorFloat(); return result; } public override void Start() { //IL_004b: 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) ((GrabbableObject)this).Start(); picklesGameObjects.ForEach(delegate(GameObject p) { jarRenderers.Add(p.GetComponent<Renderer>()); }); List<Renderer> list = jarGameObject.GetComponents<Renderer>().ToList(); list.ForEach(delegate(Renderer o) { if (((Object)o.material).name.Contains("JarGlass")) { jarRenderers.Add(o); } }); ChangeColor(GetRandomColor()); if (((NetworkBehaviour)this).IsServer) { ChangeColorClientRpc(actualColor); } else { AskColorServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void AskColorServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1776658465u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1776658465u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ChangeColorClientRpc(actualColor); } } } [ClientRpc] public void ChangeColorClientRpc(Color color) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1369064332u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref color); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1369064332u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsHost && !(actualColor == color)) { ChangeColor(color); } } } [ClientRpc] public void SetValueClientRpc(int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3136157749u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3136157749u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((GrabbableObject)this).SetScrapValue(value); } } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1776658465u, new RpcReceiveHandler(__rpc_handler_1776658465), "AskColorServerRpc"); ((NetworkBehaviour)this).__registerRpc(1369064332u, new RpcReceiveHandler(__rpc_handler_1369064332), "ChangeColorClientRpc"); ((NetworkBehaviour)this).__registerRpc(3136157749u, new RpcReceiveHandler(__rpc_handler_3136157749), "SetValueClientRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_1776658465(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((ColorfulJarOfPicklesScrap)(object)target).AskColorServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1369064332(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Color color = default(Color); ((FastBufferReader)(ref reader)).ReadValueSafe(ref color); target.__rpc_exec_stage = (__RpcExecStage)1; ((ColorfulJarOfPicklesScrap)(object)target).ChangeColorClientRpc(color); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3136157749(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int valueClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref valueClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((ColorfulJarOfPicklesScrap)(object)target).SetValueClientRpc(valueClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ColorfulJarOfPicklesScrap"; } } public class DancingJarOfPickles : NetworkBehaviour { [CompilerGenerated] private sealed class <onPlayingSong>d__5 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DancingJarOfPickles <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <onPlayingSong>d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func<bool>)(() => !<>4__this.audioSource.isPlaying)); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.isPlaying = false; <>4__this.animator.SetBool(Playing, false); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly int Playing = Animator.StringToHash("playing"); public Animator animator; public AudioClip happySong; public AudioSource audioSource; private bool isPlaying; [IteratorStateMachine(typeof(<onPlayingSong>d__5))] public IEnumerator onPlayingSong() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <onPlayingSong>d__5(0) { <>4__this = this }; } public void TriggerDance(bool dance) { animator.SetBool(Playing, dance); if (dance) { audioSource.volume = ColorfulJarOfPicklesPlugin.instance.dancingMusicVolume.Value; audioSource.PlayOneShot(happySong); } else if (audioSource.isPlaying) { audioSource.Stop(); } ((MonoBehaviour)this).StartCoroutine(onPlayingSong()); } public void OnGrabItem() { DancePicklesServerRpc(); } [ServerRpc(RequireOwnership = false)] public void DancePicklesServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(327956543u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 327956543u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; isPlaying = !isPlaying; DancePicklesClientRpc(isPlaying); } } } [ClientRpc] public void DancePicklesClientRpc(bool dance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(842130305u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref dance, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 842130305u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TriggerDance(dance); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(327956543u, new RpcReceiveHandler(__rpc_handler_327956543), "DancePicklesServerRpc"); ((NetworkBehaviour)this).__registerRpc(842130305u, new RpcReceiveHandler(__rpc_handler_842130305), "DancePicklesClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_327956543(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((DancingJarOfPickles)(object)target).DancePicklesServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_842130305(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 dance = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref dance, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DancingJarOfPickles)(object)target).DancePicklesClientRpc(dance); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "DancingJarOfPickles"; } } public class JarOfPicklesGift : NetworkBehaviour { [CompilerGenerated] private sealed class <DespawnCoroutine>d__11 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public JarOfPicklesGift <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DespawnCoroutine>d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 1; return true; case 1: <>1__state = -1; if (((NetworkBehaviour)<>4__this).IsServer) { ((NetworkBehaviour)<>4__this).NetworkObject.Despawn(true); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public ColorfulJarOfPicklesScrap scrap; public ParticleSystem PoofParticle; public AudioSource presentAudio; public AudioClip openGiftAudio; private GameObject objectInPresent; private bool hasUsedGift; public bool isRainbow; public void Start() { if (!isRainbow) { List<GameObject> colorfulJarOfPicklesGameObjects = ColorfulJarOfPicklesPlugin.instance.ColorfulJarOfPicklesGameObjects; objectInPresent = colorfulJarOfPicklesGameObjects[Random.RandomRangeInt(0, colorfulJarOfPicklesGameObjects.Count)]; } else { List<GameObject> rainbowColorfulJarOfPicklesGameObjects = ColorfulJarOfPicklesPlugin.instance.RainbowColorfulJarOfPicklesGameObjects; objectInPresent = rainbowColorfulJarOfPicklesGameObjects[Random.RandomRangeInt(0, rainbowColorfulJarOfPicklesGameObjects.Count)]; } } public void OnActiveItem() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (!hasUsedGift) { if (Object.op_Implicit((Object)(object)((GrabbableObject)scrap).playerHeldBy)) { ((GrabbableObject)scrap).playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } SpawnItemServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void SpawnItemServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2318347154u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2318347154u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; hasUsedGift = true; Vector3 zero = Vector3.zero; Transform val3 = ((((!((Object)(object)((GrabbableObject)scrap).playerHeldBy != (Object)null) || !((GrabbableObject)scrap).playerHeldBy.isInElevator) && !StartOfRound.Instance.inShipPhase) || !((Object)(object)RoundManager.Instance.spawnedScrapContainer != (Object)null)) ? StartOfRound.Instance.elevatorTransform : RoundManager.Instance.spawnedScrapContainer); zero = ((Component)this).transform.position + Vector3.up * 0.25f; GameObject val4 = Object.Instantiate<GameObject>(objectInPresent, zero, Quaternion.identity, val3); val4.GetComponent<NetworkObject>().Spawn(false); ColorfulJarOfPicklesScrap component = val4.GetComponent<ColorfulJarOfPicklesScrap>(); component.SetValueClientRpc(Mathf.RoundToInt((float)Random.Range(((GrabbableObject)component).itemProperties.minValue + 25, ((GrabbableObject)component).itemProperties.maxValue + 35) * RoundManager.Instance.scrapValueMultiplier)); SpawnItemClientRpc(); } } } [ClientRpc] public void SpawnItemClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(205616596u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 205616596u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; hasUsedGift = true; presentAudio.PlayOneShot(openGiftAudio); PoofParticle.Play(); if (((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).StartCoroutine(DespawnCoroutine()); } } } [IteratorStateMachine(typeof(<DespawnCoroutine>d__11))] private IEnumerator DespawnCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DespawnCoroutine>d__11(0) { <>4__this = this }; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2318347154u, new RpcReceiveHandler(__rpc_handler_2318347154), "SpawnItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(205616596u, new RpcReceiveHandler(__rpc_handler_205616596), "SpawnItemClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2318347154(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((JarOfPicklesGift)(object)target).SpawnItemServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_205616596(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((JarOfPicklesGift)(object)target).SpawnItemClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "JarOfPicklesGift"; } } public class PopPickles : NetworkBehaviour { private static readonly int Pop = Animator.StringToHash("pop"); public AudioClip popSound; public AudioSource audioSource; public Animator animator; private float _cooldown; public void OnItemActivate() { if (_cooldown <= 0f) { PlayPopSoundServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void PlayPopSoundServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1527106583u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1527106583u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (_cooldown <= 0f) { PlayPopSoundClientRpc(); } } } [ClientRpc] public void PlayPopSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1363500036u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1363500036u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; _cooldown = 1f; PlayPop(); } } } private void PlayPop() { audioSource.PlayOneShot(popSound); animator.SetTrigger(Pop); } public void Update() { _cooldown -= Time.deltaTime; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1527106583u, new RpcReceiveHandler(__rpc_handler_1527106583), "PlayPopSoundServerRpc"); ((NetworkBehaviour)this).__registerRpc(1363500036u, new RpcReceiveHandler(__rpc_handler_1363500036), "PlayPopSoundClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1527106583(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((PopPickles)(object)target).PlayPopSoundServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1363500036(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((PopPickles)(object)target).PlayPopSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PopPickles"; } } public class RainbowColorfulJarOfPickles : ColorfulJarOfPicklesScrap { private Color nextColor; private float lightSpeed = 1.5f; private float lightSpeedTimer; private int seed; private Random random = new Random(); private Color lastColorSaved; public override void Start() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) base.Start(); seed = random.Next(0, 1000); SetRandomServerRpc(seed); lastColorSaved = GetRandomColor(); nextColor = GetRandomColor(); } [ServerRpc(RequireOwnership = false)] public void SetRandomServerRpc(int sharedSeed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4178107183u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, sharedSeed); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4178107183u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetRandomClientRpc(sharedSeed); } } } [ClientRpc] public void SetRandomClientRpc(int sharedSeed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1048837070u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, sharedSeed); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1048837070u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetRandomLocalClient(sharedSeed); } } } private void SetRandomLocalClient(int sharedSeed) { if (sharedSeed != seed) { seed = sharedSeed; random = new Random(seed); } } public override Color GetRandomColor(float initialAlpha = 1f) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) float num = (float)random.NextDouble(); float num2 = (float)random.NextDouble(); float num3 = (float)random.NextDouble(); return new Color(num, num2, num3, initialAlpha); } public override void Update() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); lightSpeedTimer += Time.deltaTime; if (lightSpeedTimer >= lightSpeed) { lightSpeedTimer = 0f; int num = Mathf.FloorToInt(Time.time / lightSpeed); random = new Random(seed + num); lastColorSaved = nextColor; nextColor = GetRandomColor(); } float num2 = Mathf.Clamp(lightSpeedTimer / lightSpeed, 0f, 1f); ChangeColor(Color.Lerp(lastColorSaved, nextColor, num2)); } 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(4178107183u, new RpcReceiveHandler(__rpc_handler_4178107183), "SetRandomServerRpc"); ((NetworkBehaviour)this).__registerRpc(1048837070u, new RpcReceiveHandler(__rpc_handler_1048837070), "SetRandomClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_4178107183(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int randomServerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref randomServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((RainbowColorfulJarOfPickles)(object)target).SetRandomServerRpc(randomServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1048837070(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int randomClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref randomClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((RainbowColorfulJarOfPickles)(object)target).SetRandomClientRpc(randomClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RainbowColorfulJarOfPickles"; } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace ColorfulJarOfPickles.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }