using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalConfig; using LethalLib.Modules; using LethalMin; using LethalMin.Pikmin; using LethalMin.Utils; using LethalMinExtras; using Microsoft.CodeAnalysis; using NoteBoxz.LethalMinExtras.NetcodePatcher; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Animations; using UnityEngine.Events; using UnityEngine.Serialization; [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: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("DunGen")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.ASPP")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.UnityNav")] [assembly: IgnoresAccessChecksTo("EasyTextEffects")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("LethalConfig")] [assembly: IgnoresAccessChecksTo("LethalLib")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.XR.CoreUtils")] [assembly: IgnoresAccessChecksTo("Unity.XR.Management")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.ConformanceAutomation")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MetaQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MockRuntime")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.OculusQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.RuntimeDebugger")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("UnityEngine.XR.LegacyInputHelpers")] [assembly: AssemblyCompany("NoteBoxz.LethalMinExtras")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("0.1.1.0")] [assembly: AssemblyInformationalVersion("0.1.1")] [assembly: AssemblyProduct("LethalMinExtras")] [assembly: AssemblyTitle("NoteBoxz.LethalMinExtras")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.1.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; } } } public class CPBAnimEvent : MonoBehaviour { public CandyPopBud candyPopBud = null; public void PlayOpenSfx() { candyPopBud.PlayOpenSfx(); } public void PlayCloseSfx() { candyPopBud.PlayCloseSfx(); } } namespace LethalMinExtras { [BepInPlugin("NoteBoxz.LethalMinExtras", "LethalMinExtras", "0.1.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class LethalMinExtras : BaseUnityPlugin { public static LethalMinExtras Instance { get; private set; } internal static ManualLogSource Logger { get; private set; } internal static Harmony? Harmony { get; set; } internal static AssetBundle assetBundle { get; private set; } public static ConfigItem PosySpawnRate { get; private set; } public static ConfigItem PosyFalloffModifier { get; private set; } public static ConfigItem MaxPosyGrowTime { get; private set; } public static ConfigItem MinPosyGrowTime { get; private set; } public static ConfigItem PosyCycleInterval { get; private set; } public static ConfigItem MaxCPBTransforms { get; private set; } public static ConfigItem AllowOnionlessTypesToHaveCPB { get; private set; } public static ConfigItem CPBSpawnRate { get; private set; } public static ConfigItem CPBFalloffModifier { get; private set; } public static ConfigItem CPBSpawnSprouts { get; private set; } public static ConfigItem PosySpawnLocation { get; private set; } public static ConfigItem PosyOutdoorBias { get; private set; } public static ConfigItem CPBSpawnLocation { get; private set; } public static ConfigItem CPBOutdoorBias { get; private set; } public static ConfigItem NectarEggSpawnRate { get; private set; } public static ConfigItem NectarEggFalloffModifier { get; private set; } public static ConfigItem NectarEggSpawnLocation { get; private set; } public static ConfigItem NectarEggOutdoorBias { get; private set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Instance = this; Logger.LogInfo((object)"LethalMinExtras: Initializing LethalMinExtras"); Logger.LogInfo((object)"LethalMinExtras: Netcode Patching"); NetcodePatcher(); Logger.LogInfo((object)"LethalMinExtras: Patching"); Patch(); Logger.LogInfo((object)"LethalMinExtras: Binding Configs"); BindConfigs(); Logger.LogInfo((object)"LethalMinExtras: Loading AssetBundle"); LoadAssetBundle(); Logger.LogInfo((object)"LethalMinExtras: Registering Map Objects"); RegisterMapObjects(); Logger.LogInfo((object)"LethalMinExtras: Registering Pikmin task finders"); PikminTaskRegistry.RegisterIdleTaskFinder((Func)DrinkNectarTask.TryCreate); if (LethalMin.IsDependencyLoaded("ainavt.lc.lethalconfig")) { BindLCconfigs(); } Logger.LogInfo((object)"NoteBoxz.LethalMinExtras v0.1.1 has loaded!"); } public void RegisterMapObjects() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown GameObject prefabToSpawn = assetBundle.LoadAsset("Assets/LethalMinExtras/Posie.prefab"); SpawnableMapObject val = new SpawnableMapObject(); val.prefabToSpawn = prefabToSpawn; AnimationCurve val2 = new AnimationCurve(); val2.AddKey(0f, 1f); val2.AddKey(0.5f, 12f); val2.AddKey(1f, 1f); val.numberToSpawn = val2; MapObjects.RegisterMapObject(val, (LevelTypes)1, (Func)null); GameObject prefabToSpawn2 = assetBundle.LoadAsset("Assets/LethalMinExtras/CPB.prefab"); SpawnableMapObject val3 = new SpawnableMapObject(); val3.prefabToSpawn = prefabToSpawn2; AnimationCurve val4 = new AnimationCurve(); val4.AddKey(0f, 0.5f); val4.AddKey(0.5f, 1f); val4.AddKey(1f, 0.5f); val3.numberToSpawn = val4; MapObjects.RegisterMapObject(val3, (LevelTypes)1, (Func)null); GameObject prefabToSpawn3 = assetBundle.LoadAsset("Assets/LethalMinExtras/NectarEgg.prefab"); SpawnableMapObject val5 = new SpawnableMapObject(); val5.prefabToSpawn = prefabToSpawn3; AnimationCurve val6 = new AnimationCurve(); val6.AddKey(0f, 0.5f); val6.AddKey(0.5f, 5f); val6.AddKey(1f, 0.5f); val5.numberToSpawn = val6; MapObjects.RegisterMapObject(val5, (LevelTypes)1, (Func)null); } internal static void LoadAssetBundle() { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (directoryName == null) { throw new InvalidOperationException("Unable to determine assembly location."); } string text = Path.Combine(directoryName, "lethalminextraassets"); assetBundle = AssetBundle.LoadFromFile(text); if ((Object)(object)assetBundle == (Object)null) { throw new InvalidOperationException("Failed to load AssetBundle."); } } public void BindConfigs() { MaxPosyGrowTime = new ConfigItem("General", "Max Posy Grow Time", 100f, "The maximum time it takes for a Posy to grow from sprout to bloom.", false, (ConfigItemAuthority)0, ""); MinPosyGrowTime = new ConfigItem("General", "Min Posy Grow Time", 10f, "The minimum time it takes for a Posy to grow from sprout to bloom.", false, (ConfigItemAuthority)0, ""); PosyCycleInterval = new ConfigItem("General", "Posy Cycle Interval", 5f, "The time it takes for a Posy to cycle between other types.", false, (ConfigItemAuthority)0, ""); PosySpawnRate = new ConfigItem("General", "Posy Spawn Rate", 0.35f, "The spawn rate of Posies on the map. 1 is the default spawn rate of map objects, so 0.35 means that Posies will spawn at 35% of the normal spawn rate.", false, (ConfigItemAuthority)0, "slider(0,1)"); PosyFalloffModifier = new ConfigItem("General", "Posy Falloff Modifier", 0.9f, "How much the overall falloff value modifies the spawn rate of posies. 1 Means that full falloff will reduce the spawn rate to 0, 0 means that falloff will not reduce the spawn rate at all.", false, (ConfigItemAuthority)0, "slider(0,1)"); MaxCPBTransforms = new ConfigItem("General", "Max Candypop Bud Transforms", 5, "The maximum number of times a Candypop Bud can transform pikmin before despawning.", false, (ConfigItemAuthority)0, ""); AllowOnionlessTypesToHaveCPB = new ConfigItem("General", "Allow Onionless Types To Have CPB", false, "If true, Pikmin types that don't have registered Onions will have candypop buds still choose them as a random type when spawning.", false, (ConfigItemAuthority)0, ""); CPBSpawnRate = new ConfigItem("General", "Candypop Bud Spawn Rate", 0.15f, "The spawn rate of Candypop Buds on the map. 1 is the default spawn rate of map objects, so 0.15 means that Candypop Buds will spawn at 15% of the normal spawn rate.", false, (ConfigItemAuthority)0, "slider(0,1)"); CPBFalloffModifier = new ConfigItem("General", "Candypop Bud Falloff Modifier", 0.5f, "How much the overall falloff value modifies the spawn rate of candypop buds. 1 Means that full falloff will reduce the spawn rate to 0, 0 means that falloff will not reduce the spawn rate at all.", false, (ConfigItemAuthority)0, "slider(0,1)"); CPBSpawnSprouts = new ConfigItem("General", "Candypop Bud Spawn Sprouts", false, "If true, Candypop Buds will spawn on sprouts. (Could cause sprouts to clip out of bounds indoors)", false, (ConfigItemAuthority)0, ""); PosySpawnLocation = new ConfigItem("General", "Posy Spawn Location", SpawnLocation.Outdoor, "Where Pellet Posies can spawn. Indoor = facility only, Outdoor = outside only, Both = either.", false, (ConfigItemAuthority)0, ""); PosyOutdoorBias = new ConfigItem("General", "Posy Outdoor Spawn Bias", 1f, "When Posy Spawn Location is Both, the probability (0-1) that any given Posy spawns outdoors rather than indoors.", false, (ConfigItemAuthority)0, "slider(0,1)"); CPBSpawnLocation = new ConfigItem("General", "Candypop Bud Spawn Location", SpawnLocation.Indoor, "Where Candypop Buds can spawn. Indoor = facility only, Outdoor = outside only, Both = either.", false, (ConfigItemAuthority)0, ""); CPBOutdoorBias = new ConfigItem("General", "Candypop Bud Outdoor Spawn Bias", 0.5f, "When Candypop Bud Spawn Location is Both, the probability (0-1) that any given Candypop Bud spawns outdoors rather than indoors.", false, (ConfigItemAuthority)0, "slider(0,1)"); NectarEggSpawnRate = new ConfigItem("General", "Nectar Egg Spawn Rate", 0.2f, "The spawn rate of Nectar Eggs on the map. 1 is the default spawn rate, so 0.2 means 20% of the normal rate.", false, (ConfigItemAuthority)0, "slider(0,1)"); NectarEggFalloffModifier = new ConfigItem("General", "Nectar Egg Falloff Modifier", 0.5f, "How much the overall falloff value reduces Nectar Egg spawn rate. 1 = full falloff reduction, 0 = no reduction.", false, (ConfigItemAuthority)0, "slider(0,1)"); NectarEggSpawnLocation = new ConfigItem("General", "Nectar Egg Spawn Location", SpawnLocation.Both, "Where Nectar Eggs can spawn. Indoor = facility only, Outdoor = outside only, Both = either.", false, (ConfigItemAuthority)0, ""); NectarEggOutdoorBias = new ConfigItem("General", "Nectar Egg Outdoor Spawn Bias", 0.5f, "When Nectar Egg Spawn Location is Both, the probability (0-1) that any given Nectar Egg spawns outdoors rather than indoors.", false, (ConfigItemAuthority)0, "slider(0,1)"); } public void BindLCconfigs() { LethalConfigManager.SetModDescription("An addon mod for LethalMin that adds other content from the Pikmin Games!"); } internal static void Patch() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (Harmony == null) { Harmony = new Harmony("NoteBoxz.LethalMinExtras"); } Logger.LogDebug((object)"Patching..."); Harmony.PatchAll(); Logger.LogDebug((object)"Finished patching!"); } internal static void Unpatch() { Logger.LogDebug((object)"Unpatching..."); Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } Logger.LogDebug((object)"Finished unpatching!"); } private void NetcodePatcher() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } } public enum SpawnLocation { Indoor, Outdoor, Both } public class CandyPopBud : NetworkBehaviour { [CompilerGenerated] private sealed class d__28 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CandyPopBud <>4__this; private GameObject 5__1; private int 5__2; private Vector3 5__3; private Quaternion 5__4; private Sprout 5__5; private PikminSpawnProps 5__6; private Vector3 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__28(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) 5__1 = null; 5__5 = null; 5__6 = default(PikminSpawnProps); <>1__state = -2; } private bool MoveNext() { //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = LethalMin.SproutPrefab; LethalMinExtras.Logger.LogInfo((object)$"Transforming {<>4__this.transformCount} Pikmin into {((Object)<>4__this.TransformType).name}, count: {<>4__this.transformCount}/{<>4__this.maxTransformCount}"); <>4__this.maxTransformCount -= <>4__this.transformCount; <>4__this.audioSource.PlayOneShot(<>4__this.EatSfx); <>4__this.animator.SetTrigger("Eat"); <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.animator.SetTrigger("Spit"); <>2__current = (object)new WaitForSeconds(0.38f); <>1__state = 2; return true; case 2: <>1__state = -1; 5__2 = 0; goto IL_03ee; case 3: <>1__state = -1; <>4__this.audioSource.PlayOneShot(<>4__this.SpitSfx); if (ConfigItem.op_Implicit(LethalMinExtras.CPBSpawnSprouts)) { LethalMinExtras.Logger.LogInfo((object)$"Spawning sprout {5__2} of {<>4__this.transformCount} for {((Object)<>4__this.TransformType).name} from onion {((Object)((Component)<>4__this).gameObject).name}!"); 5__3 = <>4__this.GetPositionToSpawnSprout(); 5__4 = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f); 5__5 = Object.Instantiate(5__1, 5__3, Quaternion.identity).GetComponent(); 5__5.pikminType = <>4__this.TransformType; 5__5.IsPersistant = true; ((NetworkBehaviour)5__5).NetworkObject.Spawn(false); 5__5.InitalizeClientRpc(<>4__this.SproutSpawnPos.position, 5__3, 5__4, <>4__this.TransformType.PikminTypeID); 5__5 = null; } else { 5__6 = new PikminSpawnProps(); 5__7 = ((Component)<>4__this).transform.position; 5__6.SpawnAnimation = "Plucked"; 5__6.SpawnSound = "Born"; 5__6.OverrideVolume = 1f; 5__6.SpawnSoundDelay = 0f; 5__6.AddToSpawnCount = true; ManualLogSource logger = LethalMinExtras.Logger; object arg = 5__7; Quaternion rotation = ((Component)<>4__this).transform.rotation; logger.LogInfo((object)$"SpawnPosition: {arg} SpawnRotaion: {((Quaternion)(ref rotation)).eulerAngles}"); PikminManager.instance.SpawnPikminOnServer(<>4__this.TransformType, 5__7, ((Component)<>4__this).transform.rotation, 5__6, (Onion)null); 5__6 = default(PikminSpawnProps); } 5__2++; goto IL_03ee; case 4: { <>1__state = -1; if (<>4__this.maxTransformCount == 0) { <>4__this.audioSource.PlayOneShot(<>4__this.DieSfx); <>4__this.animator.SetTrigger("Die"); } else { <>4__this.isTransforming = false; <>4__this.animator.SetTrigger("Reset"); } return false; } IL_03ee: if (5__2 < <>4__this.transformCount) { <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 3; return true; } <>4__this.transformCount = 0; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 4; 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 PikminType TransformType = null; [SerializeField] private Renderer rend = null; [SerializeField] private Animator animator = null; [SerializeField] private AudioSource audioSource = null; [SerializeField] private Transform SproutSpawnPos = null; [SerializeField] private AudioClip OpenSfx = null; [SerializeField] private AudioClip EatSfx = null; [SerializeField] private AudioClip[] ConsumeSfx = null; [SerializeField] private AudioClip SpitSfx = null; [SerializeField] private AudioClip CloseSfx = null; [SerializeField] private AudioClip DieSfx = null; private int maxTransformCount = 5; private int transformCount = 0; private float autoCloseTimer = 4f; private bool isTransforming = false; private bool isNearPlayer = false; private float openCheckInterval = 0.5f; private List possibleTypes = new List(); private void Start() { PikminManager.instance.ExtrasSpawnedObjects.Add(((NetworkBehaviour)this).NetworkObject); if (!((NetworkBehaviour)this).IsServer) { return; } foreach (PikminType value in LethalMin.RegisteredPikminTypes.Values) { if ((PikChecks.DoesPikminHaveRegisteredOnion(value) || ConfigItem.op_Implicit(LethalMinExtras.AllowOnionlessTypesToHaveCPB)) && StartOfRound.Instance.gameStats.daysSpent > value.SpawnAfterDay) { possibleTypes.Add(value); } } if (possibleTypes.Count == 0) { Debug.LogWarning((object)"No valid Pikmin types found for Candy Pop Bud! Disabling..."); ((NetworkBehaviour)this).NetworkObject.Despawn(true); } else { TransformType = possibleTypes[Random.Range(0, possibleTypes.Count)]; SetTransformTypeRpc(TransformType.PikminTypeID); } maxTransformCount = ConfigItem.op_Implicit(LethalMinExtras.MaxCPBTransforms); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetTransformTypeRpc(int typeID) { //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_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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1844728853u, val2, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, typeID); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1844728853u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PikminType pikminTypeByID = LethalMin.GetPikminTypeByID(typeID); if ((Object)(object)pikminTypeByID == (Object)null) { Debug.LogError((object)$"Invalid PikminTypeID {typeID} sent to SetTransformTypeRpc!"); return; } TransformType = pikminTypeByID; switch (TransformType.PikminName) { case "Red Pikmin": { Texture2D val11 = LethalMinExtras.assetBundle.LoadAsset("Assets/LethalMinExtras/T_stg_PongashiRed_RE01_D.png"); rend.material.SetTexture("_BaseColorMap", (Texture)(object)val11); break; } case "Yellow Pikmin": { Texture2D val10 = LethalMinExtras.assetBundle.LoadAsset("Assets/LethalMinExtras/T_stg_PongashiYellow_YE01_D.png"); rend.material.SetTexture("_BaseColorMap", (Texture)(object)val10); break; } case "Blue Pikmin": { Texture2D val9 = LethalMinExtras.assetBundle.LoadAsset("Assets/LethalMinExtras/T_stg_PongashiBlue_BL01_D.png"); rend.material.SetTexture("_BaseColorMap", (Texture)(object)val9); break; } case "Purple Pikmin": { Texture2D val8 = LethalMinExtras.assetBundle.LoadAsset("Assets/LethalMinExtras/T_stg_PongashiPurple_PU01_D.png"); rend.material.SetTexture("_BaseColorMap", (Texture)(object)val8); break; } case "White Pikmin": { Texture2D val7 = LethalMinExtras.assetBundle.LoadAsset("Assets/LethalMinExtras/T_stg_PongashiWhite_WH01_D.png"); rend.material.SetTexture("_BaseColorMap", (Texture)(object)val7); break; } case "Rock Pikmin": { Texture2D val6 = LethalMinExtras.assetBundle.LoadAsset("Assets/LethalMinExtras/T_stg_PongashiStone_DGY01_D.png"); rend.material.SetTexture("_BaseColorMap", (Texture)(object)val6); break; } case "Winged Pikmin": { Texture2D val5 = LethalMinExtras.assetBundle.LoadAsset("Assets/LethalMinExtras/T_stg_PongashiPink_PI01_D.png"); rend.material.SetTexture("_BaseColorMap", (Texture)(object)val5); break; } case "Ice Pikmin": { Texture2D val4 = LethalMinExtras.assetBundle.LoadAsset("Assets/LethalMinExtras/T_stg_PongashiIce_LBL01_D.png"); rend.material.SetTexture("_BaseColorMap", (Texture)(object)val4); break; } default: LethalMinExtras.Logger.LogWarning((object)("No specific texture found for Pikmin type " + TransformType.PikminName + ", using default.")); rend.material.SetColor("_Color", TransformType.PikminPrimaryColor); break; } } public void Update() { animator.SetBool("Open", isNearPlayer); if (((NetworkBehaviour)this).IsServer) { UpdateIsNearPlayer(); } if (((NetworkBehaviour)this).IsServer && !isTransforming && isNearPlayer && transformCount > 0) { autoCloseTimer -= Time.deltaTime; if (autoCloseTimer <= 0f || maxTransformCount == transformCount) { DoTransformationSequnce(); DoTransformationSequnceRpc(); autoCloseTimer = 4f; } } } private void UpdateIsNearPlayer() { //IL_0078: 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) if (isTransforming) { return; } if (transformCount < 0) { isNearPlayer = true; return; } openCheckInterval -= Time.deltaTime; if (!(openCheckInterval <= 0f)) { return; } isNearPlayer = false; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (Vector3.Distance(((Component)val).transform.position, ((Component)this).transform.position) < 10f) { isNearPlayer = true; break; } } openCheckInterval = 0.5f; } public void OnTriggerEnter(Collider other) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Invalid comparison between Unknown and I4 //IL_00be: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsServer || isTransforming || !isNearPlayer || transformCount >= maxTransformCount) { return; } PikminCollisionDetect component = ((Component)other).GetComponent(); if ((Object)(object)component == (Object)null) { return; } PikminAI mainPikmin = component.mainPikmin; if (!((Object)(object)mainPikmin == (Object)null) && !((Object)(object)mainPikmin.pikminType == (Object)(object)TransformType) && (int)mainPikmin.CurrentIntention == 9) { SetPikminToTransform(mainPikmin); if ((Object)(object)mainPikmin != (Object)null && ((NetworkBehaviour)mainPikmin).IsSpawned) { SetPikminToTransformRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)mainPikmin).NetworkObject)); } } } public void PlayOpenSfx() { audioSource.PlayOneShot(OpenSfx); } public void PlayCloseSfx() { audioSource.PlayOneShot(CloseSfx); } private void SetPikminToTransform(PikminAI pikmin) { //IL_006e: 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) LethalMinExtras.Logger.LogInfo((object)("Transforming Pikmin of type " + ((Object)pikmin.pikminType).name + " into " + ((Object)TransformType).name + "!")); transformCount++; AudioSource creatureVoice = ((EnemyAI)pikmin).creatureVoice; AudioClip val = null; try { val = pikmin.pikminType.GetSoundPackByGeneration(PikUtils.ConvertCfgGenerationToPikminGeneration(LethalMin.PikminSoundGeneration.InternalValue)).HurtVoice[0]; } catch { val = null; } if ((Object)(object)creatureVoice != (Object)null && (Object)(object)val != (Object)null) { ((Component)creatureVoice).transform.parent = ((Component)this).transform; creatureVoice.PlayOneShot(val); Object.Destroy((Object)(object)((Component)creatureVoice).gameObject, val.length + 1f); } audioSource.PlayOneShot(ConsumeSfx[transformCount % ConsumeSfx.Length]); pikmin.IncrumentDestoryCountServerRpc(); } [Rpc(/*Could not decode attribute arguments.*/)] private void SetPikminToTransformRpc(NetworkObjectReference pikminRef) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3999458850u, val2, val, (SendTo)3, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref pikminRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3999458850u, val2, val, (SendTo)3, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref pikminRef)).TryGet(ref val4, (NetworkManager)null)) { PikminAI component = ((Component)val4).GetComponent(); if ((Object)(object)component != (Object)null) { SetPikminToTransform(component); } } } private void DoTransformationSequnce() { isTransforming = true; ((MonoBehaviour)this).StartCoroutine(TransformationSequnce()); } [IteratorStateMachine(typeof(d__28))] private IEnumerator TransformationSequnce() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this }; } [Rpc(/*Could not decode attribute arguments.*/)] private void DoTransformationSequnceRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2071504078u, val2, val, (SendTo)3, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2071504078u, val2, val, (SendTo)3, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; DoTransformationSequnce(); } } } public virtual Vector3 GetPositionToSpawnSprout(float radius = 8f, float fallbackY = 0f) { //IL_003e: 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) //IL_00f9: 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_00dc: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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) float num = 30f; float num2 = Random.Range(0f, 360f); float num3 = num2 + (float)LethalMinExtras.MaxCPBTransforms.InternalValue * num % 360f; if (TryGetGroundPositionAtAngle(num3, radius, fallbackY, out var groundPosition)) { return groundPosition; } for (float num4 = num; num4 < 360f; num4 += num) { float num5 = (num3 + num4) % 360f; if (TryGetGroundPositionAtAngle(num5, radius, fallbackY, out groundPosition)) { LethalMinExtras.Logger.LogDebug((object)$"Found ground position for sprout spawn at fallback angle {num5:F1}."); return groundPosition; } } LethalMinExtras.Logger.LogWarning((object)"Failed to find ground position for sprout spawn at any angle. Spawning at fallback position."); float num6 = num3 * (MathF.PI / 180f); return new Vector3(SproutSpawnPos.position.x + Mathf.Sin(num6) * radius, fallbackY, SproutSpawnPos.position.z + Mathf.Cos(num6) * radius); } private bool TryGetGroundPositionAtAngle(float angle, float radius, float fallbackY, out Vector3 groundPosition) { //IL_0011: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_00c7: 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) //IL_0081: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) float num = angle * (MathF.PI / 180f); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(SproutSpawnPos.position.x + Mathf.Sin(num) * radius, SproutSpawnPos.position.y, SproutSpawnPos.position.z + Mathf.Cos(num) * radius); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, float.PositiveInfinity, StartOfRound.Instance.collidersAndRoomMask)) { LethalMinExtras.Logger.LogDebug((object)$"Found ground position for sprout spawn at {((RaycastHit)(ref val2)).point} (from {((Object)((Component)((RaycastHit)(ref val2)).collider).gameObject).name}) using raycast from {val}"); groundPosition = ((RaycastHit)(ref val2)).point; return true; } NavMeshHit val3 = default(NavMeshHit); if (NavMesh.SamplePosition(new Vector3(val.x, fallbackY, val.z), ref val3, radius, -1)) { LethalMinExtras.Logger.LogDebug((object)$"Found ground position for sprout spawn at {((NavMeshHit)(ref val3)).position} using NavMesh sample from {val}"); groundPosition = ((NavMeshHit)(ref val3)).position; return true; } groundPosition = Vector3.zero; return false; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1844728853u, new RpcReceiveHandler(__rpc_handler_1844728853), "SetTransformTypeRpc"); ((NetworkBehaviour)this).__registerRpc(3999458850u, new RpcReceiveHandler(__rpc_handler_3999458850), "SetPikminToTransformRpc"); ((NetworkBehaviour)this).__registerRpc(2071504078u, new RpcReceiveHandler(__rpc_handler_2071504078), "DoTransformationSequnceRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1844728853(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 transformTypeRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref transformTypeRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((CandyPopBud)(object)target).SetTransformTypeRpc(transformTypeRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3999458850(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) { NetworkObjectReference pikminToTransformRpc = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikminToTransformRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CandyPopBud)(object)target).SetPikminToTransformRpc(pikminToTransformRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2071504078(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; ((CandyPopBud)(object)target).DoTransformationSequnceRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CandyPopBud"; } } public class DrinkNectarTask : PikminTask { private Nectar nectar; private bool hasDrunk = false; private const float DrinkRange = 1.4f; public DrinkNectarTask(PikminAI pikminAssigningTo, Nectar targetNectar) : base(pikminAssigningTo) { nectar = targetNectar; } public override void IntervaledUpdate() { //IL_0062: 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_0083: Unknown result type (might be due to invalid IL or missing references) if (hasDrunk || (Object)(object)nectar == (Object)null || !nectar.HasDrinksLeft) { ((PikminTask)this).TaskEnd(false, false); return; } ((EnemyAI)((PikminTask)this).pikmin).agent.stoppingDistance = 0f; ((PikminTask)this).pikmin.PathToPosition(((Component)nectar).transform.position); if (Vector3.Distance(((PikminTask)this).transform.position, ((Component)nectar).transform.position) <= 1.4f) { hasDrunk = true; ((PikminTask)this).pikmin.PlayAnimation(((PikminTask)this).pikmin.animController.AnimPack.EditorDrinkAnim, 0.25f, 0); ((PikminTask)this).pikmin.PlayAudioOnLocalClient((PikminSoundPackSounds)26, true); nectar.ConsumeServerRpc(); ((PikminTask)this).pikmin.SetGrowthServerRpc(((PikminTask)this).pikmin.MaxGrowthStage); ((PikminTask)this).TaskEnd(true, false); } } public static DrinkNectarTask? TryCreate(PikminAI pikmin) { //IL_005c: 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) if (pikmin.CurrentGrowthStage >= pikmin.MaxGrowthStage) { return null; } Nectar nectar = null; float num = pikmin.pikminType.ItemDetectionRange; foreach (Nectar instance in Nectar.Instances) { if (instance.HasDrinksLeft) { float num2 = Vector3.Distance(((Component)pikmin).transform.position, ((Component)instance).transform.position); if (num2 < num) { num = num2; nectar = instance; } } } return ((Object)(object)nectar != (Object)null) ? new DrinkNectarTask(pikmin, nectar) : null; } } public class Nectar : NetworkBehaviour { [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 start; public Vector3 target; public Nectar <>4__this; private float 5__1; private float 5__2; private float 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0045: 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_008a: 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_00dd: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0.8f; 5__2 = 0f; ((Component)<>4__this).transform.position = start; break; case 1: <>1__state = -1; break; } if (5__2 < 5__1) { 5__2 += Time.deltaTime; 5__3 = 5__2 / 5__1; ((Component)<>4__this).transform.position = Vector3.Lerp(start, target, 5__3 * 5__3); <>2__current = null; <>1__state = 1; return true; } ((Component)<>4__this).transform.position = target; 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(); } } internal static List Instances = new List(); public int DrinksLeft = 10; public AudioSource audioSource = null; public AudioClip spawnSFX = null; private int maxDrinks; private Vector3 originalScale; public bool HasDrinksLeft => DrinksLeft > 0; private void Awake() { Instances.Add(this); } private void OnDestory() { Instances.Remove(this); } public void Start() { //IL_0014: 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) maxDrinks = DrinksLeft; originalScale = ((Component)this).transform.localScale; audioSource.PlayOneShot(spawnSFX); } [ServerRpc(RequireOwnership = false)] public void ConsumeServerRpc() { //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(392338870u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 392338870u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DrinksLeft--; ConsumeClientRpc(DrinksLeft); if (DrinksLeft <= 0) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } } [ClientRpc] private void ConsumeClientRpc(int remaining) { //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) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) 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(3896027134u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, remaining); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3896027134u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DrinksLeft = remaining; float num = ((maxDrinks > 0) ? ((float)remaining / (float)maxDrinks) : 0f); ((Component)this).transform.localScale = originalScale * num; } } } [Rpc(/*Could not decode attribute arguments.*/)] public void StartTweenRpc(Vector3 startPos, Vector3 targetPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1814601693u, val2, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref startPos); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref targetPos); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1814601693u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(TweenToFloor(startPos, targetPos)); } } } [IteratorStateMachine(typeof(d__14))] private IEnumerator TweenToFloor(Vector3 start, Vector3 target) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { <>4__this = this, start = start, target = target }; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(392338870u, new RpcReceiveHandler(__rpc_handler_392338870), "ConsumeServerRpc"); ((NetworkBehaviour)this).__registerRpc(3896027134u, new RpcReceiveHandler(__rpc_handler_3896027134), "ConsumeClientRpc"); ((NetworkBehaviour)this).__registerRpc(1814601693u, new RpcReceiveHandler(__rpc_handler_1814601693), "StartTweenRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_392338870(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; ((Nectar)(object)target).ConsumeServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3896027134(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 remaining = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref remaining); target.__rpc_exec_stage = (__RpcExecStage)1; ((Nectar)(object)target).ConsumeClientRpc(remaining); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1814601693(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 startPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref startPos); Vector3 targetPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((Nectar)(object)target).StartTweenRpc(startPos, targetPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Nectar"; } } public class NectarEgg : NetworkBehaviour, IHittable { public float HP = 20f; public GameObject NectarPrefab = null; public SkinnedMeshRenderer Renderer = null; [SerializeField] private AudioSource audioSource = null; [SerializeField] private AudioClip[] hitSounds = null; private PikminLatchTrigger latchTrigger = null; private bool dead = false; private float maxHP; private int killConfirmCount = 0; public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (((NetworkBehaviour)this).IsOwner) { TakeDamageRpc(HP, force, HitViaPlayer: true); } return true; } public void Start() { maxHP = HP; latchTrigger = ((Component)this).GetComponentInChildren(); latchTrigger.OnPikminHit.AddListener((UnityAction)delegate { if (((NetworkBehaviour)this).IsOwner) { TakeDamageRpc(HP, 1, HitViaPlayer: false); } }); latchTrigger.OnPikminDirectLatch.AddListener((UnityAction)delegate { if (!((NetworkBehaviour)this).IsOwner) { } }); } [Rpc(/*Could not decode attribute arguments.*/)] public void TakeDamageRpc(float ownerHP, int damage, bool HitViaPlayer) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_0083: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2661846769u, val2, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref ownerHP, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val3, damage); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref HitViaPlayer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2661846769u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; HP = ownerHP; TakeDamage(damage, HitViaPlayer); } } } public void TakeDamage(float damage, bool HitViaPlayer) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (!dead) { HP -= damage; if ((Object)(object)Renderer != (Object)null && HP < maxHP * 0.5f) { ((Renderer)Renderer).material.mainTextureOffset = new Vector2(0.5f, 0f); } if (HP <= 0f && ((NetworkBehaviour)this).IsOwner) { KillRpc(); } else if ((Object)(object)audioSource != (Object)null && hitSounds != null) { audioSource.PlayOneShot(hitSounds[Random.Range(0, hitSounds.Length)]); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void KillRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2862365588u, val2, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2862365588u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; Kill(); NotifyKillCompleteServerRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void NotifyKillCompleteServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(362879498u, val2, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 362879498u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; killConfirmCount++; if (killConfirmCount >= NetworkManager.Singleton.ConnectedClientsIds.Count) { SpawnNectarAndDespawn(); } } } private void SpawnNectarAndDespawn() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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) Vector3 position = ((Component)this).transform.position; Vector3 floorPosition = GetFloorPosition(position); GameObject val = Object.Instantiate(NectarPrefab, position, Quaternion.identity); NetworkObject component = val.GetComponent(); component.Spawn(false); Nectar component2 = val.GetComponent(); ((NetworkBehaviour)this).NetworkObject.Despawn(true); } public void Kill() { dead = true; List list = new List(latchTrigger.PikminOnLatch); foreach (PikminAI item in list) { item.SetToIdle(false); item.ApplyPhysics(true); item.DoYay(false, false); } PikminLatchTrigger componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((Component)componentInChildren).gameObject.SetActive(false); } } public Vector3 GetFloorPosition(Vector3 startPosition = default(Vector3)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_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_0017: 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_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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) if (startPosition == Vector3.zero) { startPosition = ((Component)this).transform.position + Vector3.up * 0.15f; } Debug.DrawRay(startPosition, -Vector3.up * 10f, Color.yellow, 5f); RaycastHit val = default(RaycastHit); if (Physics.Raycast(startPosition, -Vector3.up, ref val, 80f, 268437761, (QueryTriggerInteraction)1)) { Debug.DrawRay(((RaycastHit)(ref val)).point + Vector3.up * 0.04f + Vector3.up, Vector3.up * 0.25f, Color.cyan, 5f); return ((RaycastHit)(ref val)).point + Vector3.up * 0.04f + Vector3.up; } Debug.DrawRay(startPosition, Vector3.up * 0.25f, Color.white, 5f); return startPosition; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2661846769u, new RpcReceiveHandler(__rpc_handler_2661846769), "TakeDamageRpc"); ((NetworkBehaviour)this).__registerRpc(2862365588u, new RpcReceiveHandler(__rpc_handler_2862365588), "KillRpc"); ((NetworkBehaviour)this).__registerRpc(362879498u, new RpcReceiveHandler(__rpc_handler_362879498), "NotifyKillCompleteServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2661846769(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float ownerHP = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref ownerHP, default(ForPrimitives)); int damage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref damage); bool hitViaPlayer = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hitViaPlayer, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((NectarEgg)(object)target).TakeDamageRpc(ownerHP, damage, hitViaPlayer); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2862365588(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; ((NectarEgg)(object)target).KillRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_362879498(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; ((NectarEgg)(object)target).NotifyKillCompleteServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "NectarEgg"; } } public class PelletItem : GrabbableObject { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Color startColor; public Color endColor; public float duration; public PelletItem <>4__this; private float 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_00af: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0f; break; case 1: <>1__state = -1; break; } if (5__1 < duration) { ((Renderer)((GrabbableObject)<>4__this).mainObjectRenderer).material.color = Color.Lerp(startColor, endColor, 5__1 / duration); 5__1 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } ((Renderer)((GrabbableObject)<>4__this).mainObjectRenderer).material.color = endColor; 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 void SetColorFromType(PikminType type) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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) PikminItemSettings componentInChildren = ((Component)this).GetComponentInChildren(); componentInChildren.PerferedType = type; ((Component)this).GetComponentInChildren().color = type.PikminPrimaryColor; ((MonoBehaviour)this).StartCoroutine(fadeBetweenColors(((Renderer)base.mainObjectRenderer).material.color, type.PikminPrimaryColor, 0.5f)); } [IteratorStateMachine(typeof(d__1))] private IEnumerator fadeBetweenColors(Color startColor, Color endColor, float duration) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { <>4__this = this, startColor = startColor, endColor = endColor, duration = duration }; } public void DisableLatch() { PikminLatchTrigger componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((Component)componentInChildren).gameObject.SetActive(false); } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((GrabbableObject)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PelletItem"; } } public class PelletPosy : NetworkBehaviour, IHittable { [CompilerGenerated] private sealed class d__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PelletPosy <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__30(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.audioSource.PlayOneShot(<>4__this.bloomASound); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.audioSource.PlayOneShot(<>4__this.bloomBSound); 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(); } } [CompilerGenerated] private sealed class d__28 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PelletPosy <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__28(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(1f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.SpawnPellet(); 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(); } } [FormerlySerializedAs("elletPrefab")] [SerializeField] private GameObject pelletPrefab = null; [SerializeField] private Transform pelletSpawnPoint = null; [SerializeField] private Animator animator = null; [SerializeField] private AudioSource audioSource = null; [SerializeField] private AudioClip[] hitSounds = null; [SerializeField] private AudioClip bloomASound = null; [SerializeField] private AudioClip bloomBSound = null; [SerializeField] private AudioClip deathASound = null; [SerializeField] private AudioClip deathBSound = null; [SerializeField] private int GrowStage = 0; [SerializeField] private int HP = 12; private PelletItem pellet = null; private PikminLatchTrigger latchTrigger = null; private PikminType pelletType = null; private bool disabled = false; private bool dead = false; private float GrowTimer = 5f; private float CycleTimer = 5f; private int CycleIndex; public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (GrowStage < 2) { return false; } if (((NetworkBehaviour)this).IsOwner) { TakeDamageRpc(HP, force, HitViaPlayer: true); } return true; } public void SpawnPellet() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)pellet != (Object)null)) { GameObject val = Object.Instantiate(pelletPrefab, pelletSpawnPoint.position, pelletSpawnPoint.rotation); val.GetComponent().Spawn(false); pellet = val.GetComponent(); latchTrigger = val.GetComponentInChildren(true); List list = LethalMin.RegisteredPikminTypes.Values.Where((PikminType t) => PikChecks.IsPikminValidForPelletSelection(t)).ToList(); pelletType = list[Random.Range(0, list.Count)]; CycleIndex = list.IndexOf(pelletType); SyncPelletRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)pellet).NetworkObject)); SetPelletTypeRpc(pelletType.PikminTypeID); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncPelletRpc(NetworkObjectReference pelletRef) { //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_0134: 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) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2026733955u, val2, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref pelletRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2026733955u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (!((NetworkObjectReference)(ref pelletRef)).TryGet(ref val4, (NetworkManager)null)) { return; } pellet = ((Component)val4).GetComponent(); latchTrigger = ((Component)val4).GetComponentInChildren(true); ((Component)latchTrigger).gameObject.SetActive(true); ((Behaviour)((Component)pellet).GetComponentInChildren()).enabled = true; ((Behaviour)((Component)pellet).GetComponentInChildren()).enabled = true; PositionConstraint componentInChildren = ((Component)pellet).GetComponentInChildren(); ConstraintSource val5 = default(ConstraintSource); ((ConstraintSource)(ref val5)).sourceTransform = pelletSpawnPoint; ((ConstraintSource)(ref val5)).weight = 1f; componentInChildren.AddSource(val5); RotationConstraint componentInChildren2 = ((Component)pellet).GetComponentInChildren(); val5 = default(ConstraintSource); ((ConstraintSource)(ref val5)).sourceTransform = pelletSpawnPoint; ((ConstraintSource)(ref val5)).weight = 1f; componentInChildren2.AddSource(val5); ((Component)pellet).GetComponentInChildren().GrabableToPikmin = false; latchTrigger.OnPikminHit.AddListener((UnityAction)delegate { if (((NetworkBehaviour)this).IsOwner) { TakeDamageRpc(HP, 1, HitViaPlayer: false); } }); latchTrigger.OnPikminDirectLatch.AddListener((UnityAction)delegate { if (((NetworkBehaviour)this).IsOwner) { OnLatchRpc(); } }); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetEnablementRpc(bool enable) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1697153304u, val2, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref enable, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1697153304u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; disabled = !enable; } } } public void Start() { PikminManager.instance.ExtrasSpawnedObjects.Add(((NetworkBehaviour)this).NetworkObject); if (((NetworkBehaviour)this).IsOwner) { GrowTimer = Random.Range(LethalMinExtras.MinPosyGrowTime.InternalValue, LethalMinExtras.MaxPosyGrowTime.InternalValue); CycleTimer = LethalMinExtras.PosyCycleInterval.InternalValue; List list = LethalMin.RegisteredPikminTypes.Values.Where((PikminType t) => PikChecks.IsPikminValidForPelletSelection(t)).ToList(); if (list.Count == 0) { LethalMinExtras.Logger.LogWarning((object)"No valid Pikmin types found for pellet spawning!"); SetEnablementRpc(enable: false); } } } public void Update() { if (!dead) { if (disabled) { CheckToRenable(); return; } UpdateGrowth(); UpdateCycle(); } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnLatchRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2288157493u, val2, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2288157493u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; animator.SetTrigger("Latch"); } } } public void CheckToRenable() { if (((NetworkBehaviour)this).IsOwner && disabled) { List list = LethalMin.RegisteredPikminTypes.Values.Where((PikminType t) => PikChecks.IsPikminValidForPelletSelection(t)).ToList(); if (list.Count > 0) { SetEnablementRpc(enable: true); LethalMinExtras.Logger.LogDebug((object)"PelletPosy re-enabled as valid Pikmin types are now available."); } } } private void UpdateGrowth() { if (!((NetworkBehaviour)this).IsOwner || GrowStage >= 2) { return; } GrowTimer -= Time.deltaTime; if (GrowTimer <= 0f) { GrowStage++; GrowTimer = Random.Range(LethalMinExtras.MinPosyGrowTime.InternalValue, LethalMinExtras.MaxPosyGrowTime.InternalValue); SyncGrowStageRpc(GrowStage); if (GrowStage == 2) { LethalMinExtras.Logger.LogInfo((object)"PelletPosy has fully bloomed and spawned its pellet!"); ((MonoBehaviour)this).StartCoroutine(WaitSpawnPellet()); } } } [IteratorStateMachine(typeof(d__28))] private IEnumerator WaitSpawnPellet() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this }; } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncGrowStageRpc(int growStage) { //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_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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3652360239u, val2, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, growStage); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3652360239u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; GrowStage = growStage; animator.SetInteger("GrowStage", GrowStage); ((MonoBehaviour)this).StartCoroutine(PlayBloomSFX()); } } } [IteratorStateMachine(typeof(d__30))] private IEnumerator PlayBloomSFX() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { <>4__this = this }; } private void UpdateCycle() { if ((Object)(object)pellet == (Object)null || latchTrigger.PikminOnLatch.Count > 0) { return; } CycleTimer -= Time.deltaTime; if (!(CycleTimer <= 0f)) { return; } CycleTimer = LethalMinExtras.PosyCycleInterval.InternalValue; if (((NetworkBehaviour)this).IsOwner) { List list = LethalMin.RegisteredPikminTypes.Values.Where((PikminType t) => PikChecks.IsPikminValidForPelletSelection(t)).ToList(); pelletType = list[CycleIndex]; SetPelletTypeRpc(pelletType.PikminTypeID); CycleIndex = (CycleIndex + 1) % list.Count; } } [Rpc(/*Could not decode attribute arguments.*/)] public void TakeDamageRpc(int ownerHP, int damage, bool HitViaPlayer) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1512032251u, val2, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, ownerHP); BytePacker.WriteValueBitPacked(val3, damage); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref HitViaPlayer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1512032251u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; HP = ownerHP; TakeDamage(damage, HitViaPlayer); } } } public void TakeDamage(int damage, bool HitViaPlayer) { if (!dead) { HP -= damage; if (HP <= 0 && ((NetworkBehaviour)this).IsOwner) { KillRpc(); } else if ((Object)(object)audioSource != (Object)null && hitSounds != null) { audioSource.PlayOneShot(hitSounds[Random.Range(0, hitSounds.Length)]); animator.SetTrigger(HitViaPlayer ? "HitPlayer" : "Hit"); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void KillRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2053771126u, val2, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2053771126u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; Kill(); } } } public void Kill() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) dead = true; ((GrabbableObject)pellet).grabbable = true; ((Component)pellet).GetComponentInChildren().GrabableToPikmin = true; List list = new List(latchTrigger.PikminOnLatch); foreach (PikminAI item in list) { item.SetToIdle(false); item.ApplyPhysics(true); item.DoYay(false, false); } pellet.DisableLatch(); Debug.DrawRay(((Component)pellet).transform.position, Vector3.up * 10f, Color.cyan, 10f); ((GrabbableObject)pellet).startFallingPosition = ((Component)pellet).transform.position; if ((Object)(object)((Component)pellet).transform.parent != (Object)null) { ((GrabbableObject)pellet).startFallingPosition = ((Component)pellet).transform.parent.InverseTransformPoint(((GrabbableObject)pellet).startFallingPosition); } Debug.DrawRay(((Component)pellet).transform.position, Vector3.up * 10f, Color.cyan, 10f); ((GrabbableObject)pellet).FallToGround(false, false, ((GrabbableObject)pellet).startFallingPosition); animator.SetTrigger("Death"); audioSource.PlayOneShot(deathASound); audioSource.PlayOneShot(deathBSound); ((Component)pellet).GetComponent().SetAsArrived(1f, (Vector3?)((GrabbableObject)pellet).targetFloorPosition, 15f); ((Behaviour)((Component)pellet).GetComponentInChildren()).enabled = false; ((Behaviour)((Component)pellet).GetComponentInChildren()).enabled = false; } [Rpc(/*Could not decode attribute arguments.*/)] public void SetPelletTypeRpc(int pelletTypeID) { //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_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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1937654975u, val2, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, pelletTypeID); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1937654975u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; pelletType = LethalMin.GetPikminTypeByID(pelletTypeID); pellet.SetColorFromType(pelletType); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2026733955u, new RpcReceiveHandler(__rpc_handler_2026733955), "SyncPelletRpc"); ((NetworkBehaviour)this).__registerRpc(1697153304u, new RpcReceiveHandler(__rpc_handler_1697153304), "SetEnablementRpc"); ((NetworkBehaviour)this).__registerRpc(2288157493u, new RpcReceiveHandler(__rpc_handler_2288157493), "OnLatchRpc"); ((NetworkBehaviour)this).__registerRpc(3652360239u, new RpcReceiveHandler(__rpc_handler_3652360239), "SyncGrowStageRpc"); ((NetworkBehaviour)this).__registerRpc(1512032251u, new RpcReceiveHandler(__rpc_handler_1512032251), "TakeDamageRpc"); ((NetworkBehaviour)this).__registerRpc(2053771126u, new RpcReceiveHandler(__rpc_handler_2053771126), "KillRpc"); ((NetworkBehaviour)this).__registerRpc(1937654975u, new RpcReceiveHandler(__rpc_handler_1937654975), "SetPelletTypeRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2026733955(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) { NetworkObjectReference pelletRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pelletRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PelletPosy)(object)target).SyncPelletRpc(pelletRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1697153304(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 enablementRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enablementRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PelletPosy)(object)target).SetEnablementRpc(enablementRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2288157493(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; ((PelletPosy)(object)target).OnLatchRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3652360239(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 growStage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref growStage); target.__rpc_exec_stage = (__RpcExecStage)1; ((PelletPosy)(object)target).SyncGrowStageRpc(growStage); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1512032251(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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) //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) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int ownerHP = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref ownerHP); int damage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref damage); bool hitViaPlayer = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hitViaPlayer, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PelletPosy)(object)target).TakeDamageRpc(ownerHP, damage, hitViaPlayer); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2053771126(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; ((PelletPosy)(object)target).KillRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1937654975(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 pelletTypeRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref pelletTypeRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((PelletPosy)(object)target).SetPelletTypeRpc(pelletTypeRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PelletPosy"; } } [RequireComponent(typeof(SkinnedMeshRenderer))] public class SoftBodyPhysics : MonoBehaviour { public float softness = 2f; public float damping = 0.1f; public float stiffness = 0.5f; [Tooltip("Fraction (0–1) of the mesh height from the top whose vertices are pinned. E.g. 0.2 pins the top 20%.")] [Range(0f, 1f)] public float anchorFraction = 0.2f; [Tooltip("Scales how much the parent's acceleration affects the cloth. Lower values keep the cloth more stable during fast movement.")] public float worldAccelerationScale = 0.5f; private void Start() { CreateSoftBodyPhsyics(); } private void CreateSoftBodyPhsyics() { SkinnedMeshRenderer component = ((Component)this).GetComponent(); Vector3[] vertices = component.sharedMesh.vertices; Cloth val = ((Component)this).gameObject.AddComponent(); val.damping = damping; val.bendingStiffness = stiffness; val.stretchingStiffness = stiffness; val.worldAccelerationScale = worldAccelerationScale; val.coefficients = GenerateClothCoefficents(vertices); } private ClothSkinningCoefficient[] GenerateClothCoefficents(Vector3[] vertices) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ClothSkinningCoefficient[] array = (ClothSkinningCoefficient[])(object)new ClothSkinningCoefficient[vertices.Length]; float num = float.MaxValue; float num2 = float.MinValue; foreach (Vector3 val in vertices) { num = Mathf.Min(num, val.y); num2 = Mathf.Max(num2, val.y); } float num3 = Mathf.Lerp(num2, num, anchorFraction); for (int j = 0; j < vertices.Length; j++) { bool flag = vertices[j].y >= num3; array[j].maxDistance = (flag ? 0f : softness); array[j].collisionSphereDistance = 0f; } return array; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "NoteBoxz.LethalMinExtras"; public const string PLUGIN_NAME = "LethalMinExtras"; public const string PLUGIN_VERSION = "0.1.1"; } } namespace LethalMinExtras.Patches { [HarmonyPatch(typeof(GameNetworkManager))] public class GameNetworkManagerPatch { public static bool HasRegistred; [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPostfix(GameNetworkManager __instance) { if (HasRegistred) { LethalMinExtras.Logger.LogWarning((object)"LethalMinExtras: Already registered prefabs to Network."); return; } GameObject[] array = LethalMinExtras.assetBundle.LoadAllAssets(); foreach (GameObject val in array) { if (!((Object)(object)val.GetComponent() == (Object)null) && ((Behaviour)val.GetComponent()).enabled) { ((Component)__instance).GetComponent().AddNetworkPrefab(val); LethalMinExtras.Logger.LogInfo((object)("Registered Prefab to Network: " + ((Object)val).name)); } } HasRegistred = true; } } [HarmonyPatch(typeof(PikminManager))] public class PikminManagerPatch { [HarmonyPatch("SpawnExtras")] [HarmonyPostfix] public static void SpawnExtrasPostfix(PikminManager __instance, ref float ____cachedOverallOutdoorFalloff, ref float ____cachedOverallIndoorFalloff) { SpawnPelletPosies(__instance, ref ____cachedOverallOutdoorFalloff, ref ____cachedOverallIndoorFalloff); SpawnCPBs(__instance, ref ____cachedOverallOutdoorFalloff, ref ____cachedOverallIndoorFalloff); SpawnNectarEggs(__instance, ref ____cachedOverallOutdoorFalloff, ref ____cachedOverallIndoorFalloff); } private static (float outdoor, float indoor) CalcSpawnChances(float baseChance, float outdoorFalloff, float indoorFalloff, float modifier, float typeRatio = 1f) { float item = Mathf.Clamp01(baseChance * typeRatio * (1f - Mathf.Clamp01(outdoorFalloff * modifier))); float item2 = Mathf.Clamp01(baseChance * typeRatio * (1f - Mathf.Clamp01(indoorFalloff * modifier))); return (item, item2); } public static void SpawnPelletPosies(PikminManager __instance, ref float ____cachedOverallOutdoorFalloff, ref float ____cachedOverallIndoorFalloff) { //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) GameObject val = LethalMinExtras.assetBundle.LoadAsset("Assets/LethalMinExtras/Posie.prefab"); if (LethalMin.OnCompany) { LethalMinExtras.Logger.LogInfo((object)"Cannot Spawn pellet posies on company moon!"); return; } if (!PikChecks.IsNavMeshOnMap()) { LethalMinExtras.Logger.LogWarning((object)"Current map does not have a navmesh, cannot spawn pellet posies!"); return; } if (Object.FindObjectsOfType().Length == 0) { LethalMinExtras.Logger.LogInfo((object)"No sprout objects found on the map, skipping pellet posie spawn!"); return; } LethalMinExtras.Logger.LogInfo((object)"-- Spawning Pellet Posies --"); int num = 0; foreach (PikminType value in LethalMin.RegisteredPikminTypes.Values) { if (PikChecks.DoesPikminHaveRegisteredOnion(value) && StartOfRound.Instance.gameStats.daysSpent > value.SpawnAfterDay) { num++; } } if (num == 0) { LethalMinExtras.Logger.LogWarning((object)"No valid max pikmin types for pellet posies, not spawning any!"); return; } int num2 = 0; foreach (PikminType value2 in LethalMin.RegisteredPikminTypes.Values) { if (PikChecks.IsPikminValidForPelletSelection(value2)) { num2++; } } if (num2 == 0) { LethalMinExtras.Logger.LogWarning((object)"No valid pikmin types for pellet posies, not spawning any!"); return; } float num3 = Mathf.Clamp01((float)num2 / (float)num); SpawnLocation internalValue = LethalMinExtras.PosySpawnLocation.InternalValue; float num4 = Mathf.Clamp01(ConfigItem.op_Implicit(LethalMinExtras.PosyOutdoorBias)); (float outdoor, float indoor) tuple = CalcSpawnChances(Mathf.Clamp01(ConfigItem.op_Implicit(LethalMinExtras.PosySpawnRate)), ____cachedOverallOutdoorFalloff, ____cachedOverallIndoorFalloff, ConfigItem.op_Implicit(LethalMinExtras.PosyFalloffModifier), num3); float item = tuple.outdoor; float item2 = tuple.indoor; GameObject[] array = ((internalValue == SpawnLocation.Outdoor || internalValue == SpawnLocation.Both) ? GameObject.FindGameObjectsWithTag("OutsideAINode") : null); GameObject[] array2 = ((internalValue == SpawnLocation.Indoor || internalValue == SpawnLocation.Both) ? GameObject.FindGameObjectsWithTag("AINode") : null); if (internalValue == SpawnLocation.Outdoor && (array == null || array.Length == 0)) { LethalMinExtras.Logger.LogWarning((object)"No outdoor spawn points found, cannot spawn pellet posies!"); return; } if (internalValue == SpawnLocation.Indoor && (array2 == null || array2.Length == 0)) { LethalMinExtras.Logger.LogWarning((object)"No indoor spawn points found, cannot spawn pellet posies!"); return; } LethalMinExtras.Logger.LogInfo((object)($"Location: {internalValue}, PossibleTypes: {num2}/{num} ({num3:P2}), " + $"OutdoorChance: {item:P2}, IndoorChance: {item2:P2}")); Random random = new Random(StartOfRound.Instance.randomMapSeed); LayerMask val2 = LayerMask.op_Implicit(StartOfRound.Instance.collidersAndRoomMaskAndDefault); int num5 = 50; int num6 = 0; RaycastHit val5 = default(RaycastHit); for (int i = 0; i < num5; i++) { bool flag = internalValue switch { SpawnLocation.Both => Random.value < num4, SpawnLocation.Outdoor => true, _ => false, }; GameObject[] array3 = (flag ? array : array2); float num7 = (flag ? item : item2); if (array3 == null || array3.Length == 0 || Random.value > num7) { continue; } Quaternion val3 = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f); Vector3 val4 = RoundManager.Instance.GetRandomNavMeshPositionInRadius(array3[random.Next(0, array3.Length)].transform.position, 100f, default(NavMeshHit)); if (flag) { if (!Physics.Raycast(val4, Vector3.down, ref val5, 50f, LayerMask.op_Implicit(val2), (QueryTriggerInteraction)1)) { LethalMinExtras.Logger.LogWarning((object)$"No ground detected for posie at {val4}."); continue; } val4 = ((RaycastHit)(ref val5)).point; } GameObject val6 = Object.Instantiate(val, val4, val3); val6.GetComponent().Spawn(false); num6++; } LethalMinExtras.Logger.LogInfo((object)$"-- Spawned {num6} posies on the map. --"); } public static void SpawnCPBs(PikminManager __instance, ref float ____cachedOverallOutdoorFalloff, ref float ____cachedOverallIndoorFalloff) { //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) GameObject val = LethalMinExtras.assetBundle.LoadAsset("Assets/LethalMinExtras/CPB.prefab"); if (LethalMin.OnCompany) { LethalMinExtras.Logger.LogInfo((object)"Cannot Spawn Candypop Buds on company moon!"); return; } if (!PikChecks.IsNavMeshOnMap()) { LethalMinExtras.Logger.LogWarning((object)"Current map does not have a navmesh, cannot spawn candypop buds!"); return; } LethalMinExtras.Logger.LogInfo((object)"-- Spawning Candypop Buds --"); SpawnLocation internalValue = LethalMinExtras.CPBSpawnLocation.InternalValue; float num = Mathf.Clamp01(ConfigItem.op_Implicit(LethalMinExtras.CPBOutdoorBias)); (float outdoor, float indoor) tuple = CalcSpawnChances(Mathf.Clamp01(ConfigItem.op_Implicit(LethalMinExtras.CPBSpawnRate)), ____cachedOverallOutdoorFalloff, ____cachedOverallIndoorFalloff, ConfigItem.op_Implicit(LethalMinExtras.CPBFalloffModifier)); float item = tuple.outdoor; float item2 = tuple.indoor; GameObject[] array = ((internalValue == SpawnLocation.Outdoor || internalValue == SpawnLocation.Both) ? GameObject.FindGameObjectsWithTag("OutsideAINode") : null); GameObject[] array2 = ((internalValue == SpawnLocation.Indoor || internalValue == SpawnLocation.Both) ? GameObject.FindGameObjectsWithTag("AINode") : null); if (internalValue == SpawnLocation.Outdoor && (array == null || array.Length == 0)) { LethalMinExtras.Logger.LogWarning((object)"No outdoor spawn points found, cannot spawn candypop buds!"); return; } if (internalValue == SpawnLocation.Indoor && (array2 == null || array2.Length == 0)) { LethalMinExtras.Logger.LogWarning((object)"No indoor spawn points found, cannot spawn candypop buds!"); return; } LethalMinExtras.Logger.LogInfo((object)$"Location: {internalValue}, OutdoorChance: {item:P2}, IndoorChance: {item2:P2}"); Random random = new Random(StartOfRound.Instance.randomMapSeed + 1); LayerMask val2 = LayerMask.op_Implicit(StartOfRound.Instance.collidersAndRoomMaskAndDefault); int num2 = 20; int num3 = 0; RaycastHit val5 = default(RaycastHit); for (int i = 0; i < num2; i++) { bool flag = internalValue switch { SpawnLocation.Both => Random.value < num, SpawnLocation.Outdoor => true, _ => false, }; GameObject[] array3 = (flag ? array : array2); float num4 = (flag ? item : item2); if (array3 == null || array3.Length == 0 || Random.value > num4) { continue; } Quaternion val3 = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f); Vector3 val4 = RoundManager.Instance.GetRandomNavMeshPositionInRadius(array3[random.Next(0, array3.Length)].transform.position, 20f, default(NavMeshHit)); if (flag) { if (!Physics.Raycast(val4, Vector3.down, ref val5, 50f, LayerMask.op_Implicit(val2), (QueryTriggerInteraction)1)) { LethalMinExtras.Logger.LogWarning((object)$"No ground detected for CPB at {val4}."); continue; } val4 = ((RaycastHit)(ref val5)).point; } GameObject val6 = Object.Instantiate(val, val4, val3); val6.GetComponent().Spawn(false); num3++; } LethalMinExtras.Logger.LogInfo((object)$"-- Spawned {num3} candypop buds on the map. --"); } public static void SpawnNectarEggs(PikminManager __instance, ref float ____cachedOverallOutdoorFalloff, ref float ____cachedOverallIndoorFalloff) { //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) GameObject val = LethalMinExtras.assetBundle.LoadAsset("Assets/LethalMinExtras/NectarEgg.prefab"); if (LethalMin.OnCompany) { LethalMinExtras.Logger.LogInfo((object)"Cannot Spawn Nectar Eggs on company moon!"); return; } if (!PikChecks.IsNavMeshOnMap()) { LethalMinExtras.Logger.LogWarning((object)"Current map does not have a navmesh, cannot spawn nectar eggs!"); return; } LethalMinExtras.Logger.LogInfo((object)"-- Spawning Nectar Eggs --"); SpawnLocation internalValue = LethalMinExtras.NectarEggSpawnLocation.InternalValue; float num = Mathf.Clamp01(ConfigItem.op_Implicit(LethalMinExtras.NectarEggOutdoorBias)); (float outdoor, float indoor) tuple = CalcSpawnChances(Mathf.Clamp01(ConfigItem.op_Implicit(LethalMinExtras.NectarEggSpawnRate)), ____cachedOverallOutdoorFalloff, ____cachedOverallIndoorFalloff, ConfigItem.op_Implicit(LethalMinExtras.NectarEggFalloffModifier)); float item = tuple.outdoor; float item2 = tuple.indoor; GameObject[] array = ((internalValue == SpawnLocation.Outdoor || internalValue == SpawnLocation.Both) ? GameObject.FindGameObjectsWithTag("OutsideAINode") : null); GameObject[] array2 = ((internalValue == SpawnLocation.Indoor || internalValue == SpawnLocation.Both) ? GameObject.FindGameObjectsWithTag("AINode") : null); if (internalValue == SpawnLocation.Outdoor && (array == null || array.Length == 0)) { LethalMinExtras.Logger.LogWarning((object)"No outdoor spawn points found, cannot spawn nectar eggs!"); return; } if (internalValue == SpawnLocation.Indoor && (array2 == null || array2.Length == 0)) { LethalMinExtras.Logger.LogWarning((object)"No indoor spawn points found, cannot spawn nectar eggs!"); return; } LethalMinExtras.Logger.LogInfo((object)$"Location: {internalValue}, OutdoorChance: {item:P2}, IndoorChance: {item2:P2}"); Random random = new Random(StartOfRound.Instance.randomMapSeed + 2); LayerMask val2 = LayerMask.op_Implicit(StartOfRound.Instance.collidersAndRoomMaskAndDefault); int num2 = 20; int num3 = 0; RaycastHit val5 = default(RaycastHit); for (int i = 0; i < num2; i++) { bool flag = internalValue switch { SpawnLocation.Both => Random.value < num, SpawnLocation.Outdoor => true, _ => false, }; GameObject[] array3 = (flag ? array : array2); float num4 = (flag ? item : item2); if (array3 == null || array3.Length == 0 || Random.value > num4) { continue; } Quaternion val3 = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f); Vector3 val4 = RoundManager.Instance.GetRandomNavMeshPositionInRadius(array3[random.Next(0, array3.Length)].transform.position, 20f, default(NavMeshHit)); if (flag) { if (!Physics.Raycast(val4, Vector3.down, ref val5, 50f, LayerMask.op_Implicit(val2), (QueryTriggerInteraction)1)) { LethalMinExtras.Logger.LogWarning((object)$"No ground detected for nectar egg at {val4}."); continue; } val4 = ((RaycastHit)(ref val5)).point; } GameObject val6 = Object.Instantiate(val, val4, val3); val6.GetComponent().Spawn(false); num3++; } LethalMinExtras.Logger.LogInfo((object)$"-- Spawned {num3} nectar eggs on the map. --"); } [HarmonyPatch("DespawnExtras")] [HarmonyPostfix] public static void DespawnExtrasPostfix(PikminManager __instance) { if (((NetworkBehaviour)__instance).IsServer) { foreach (NetworkObject extrasSpawnedObject in __instance.ExtrasSpawnedObjects) { if ((Object)(object)extrasSpawnedObject != (Object)null && extrasSpawnedObject.IsSpawned) { extrasSpawnedObject.Despawn(true); } } } __instance.ExtrasSpawnedObjects.Clear(); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace NoteBoxz.LethalMinExtras.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }