using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CodeRebirth.src.Content.Maps; using CodeRebirth.src.Content.Weathers; using DunGen; using ElevatorMod.Patches; using GameNetcodeStuff; using HarmonyLib; using Imperium.Interface.SpawningUI; using Imperium.Patches.Objects; using Imperium.Patches.Systems; using LCOffice.Components; using LethalCompanyInputUtils.Api; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using LethalLevelLoader; using LethalLib.Extras; using LethalLib.Modules; using LethalMin; using LethalMin.ConfigPatches; using LethalMin.HUD; using LethalMin.Library; using LethalMin.Patches; using LethalMin.Patches.AI; using LethalMin.Pikmin; using LethalMin.Routeing; using LethalMin.Utils; using LethalMinLibrary; using LethalModDataLib.Enums; using LethalModDataLib.Features; using LethalModDataLib.Helpers; using LethalMon.Behaviours; using LobbyCompatibility.Enums; using LobbyCompatibility.Features; using Microsoft.CodeAnalysis; using NoteBoxz.LethalMin.NetcodePatcher; using PiggyVarietyMod.Patches; using PiggysVarietyMod.Hazards.TeslaGate; using SellBodies; using TMPro; using Unity.AI.Navigation; using Unity.Mathematics; using Unity.Netcode; using Unity.Netcode.Components; using UnityEngine; using UnityEngine.AI; using UnityEngine.Animations.Rigging; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.Video; using itolib.PlayZone; [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("CodeRebirth")] [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("giosuel.Imperium")] [assembly: IgnoresAccessChecksTo("itolib")] [assembly: IgnoresAccessChecksTo("kite.ZelevatorCode")] [assembly: IgnoresAccessChecksTo("LCOffice")] [assembly: IgnoresAccessChecksTo("LethalCompanyInputUtils")] [assembly: IgnoresAccessChecksTo("LethalConfig")] [assembly: IgnoresAccessChecksTo("LethalLevelLoader")] [assembly: IgnoresAccessChecksTo("LethalLib")] [assembly: IgnoresAccessChecksTo("LethalMon")] [assembly: IgnoresAccessChecksTo("MaxWasUnavailable.LethalModDataLib")] [assembly: IgnoresAccessChecksTo("PiggysVarietyMod")] [assembly: IgnoresAccessChecksTo("PiggyVarietyMod")] [assembly: IgnoresAccessChecksTo("SellBodies")] [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.LethalMin")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0")] [assembly: AssemblyProduct("LethalMin")] [assembly: AssemblyTitle("NoteBoxz.LethalMin")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class InputClassWithUtils : LcInputActions { [InputAction(/*Could not decode attribute arguments.*/)] public InputAction Throw { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction ThrowCancel { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction Charge { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction Whistle { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction Dismiss { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction SwitchWhistleAud { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction SwitchLeft { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction SwitchRight { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction Glowmob { get; set; } = null; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction OnionHudSpeed { get; set; } = null; } public class OnionAnimEvents : MonoBehaviour { public AudioSource audio = null; public AudioSource audioLooped = null; public OnionSoundPack pack = null; public void OnEnable() { audioLooped.mute = true; } public void PlayAudioLooped() { audioLooped.mute = false; audioLooped.Play(); global::LethalMin.LethalMin.Logger.LogInfo((object)("Playing looped audio: " + ((Object)audioLooped.clip).name)); } public void StopAudioLooped() { audioLooped.Stop(); audioLooped.mute = true; global::LethalMin.LethalMin.Logger.LogInfo((object)("Stopping looped audio: " + ((Object)audioLooped.clip).name)); } public void PlayLandingAudio() { audio.PlayOneShot(pack.LandSound); global::LethalMin.LethalMin.Logger.LogInfo((object)("Playing landing audio: " + ((Object)pack.LandSound).name)); } public void PlayExtendLegsAudio() { audio.PlayOneShot(pack.LegsPopOutSound); global::LethalMin.LethalMin.Logger.LogInfo((object)("Playing extend legs audio: " + ((Object)pack.LegsPopOutSound).name)); } public void PlayRetractLegsAudio() { audio.PlayOneShot(pack.LegsPopInSound); global::LethalMin.LethalMin.Logger.LogInfo((object)("Playing retract legs audio: " + ((Object)pack.LegsPopInSound).name)); } public void ShowOnionMesh() { Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(); foreach (Renderer val in componentsInChildren) { val.enabled = true; } } public void HideOnionMesh() { Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(); foreach (Renderer val in componentsInChildren) { val.enabled = false; } } } public enum PikminHazard { Fire, Water, Electricity, Poison, Crush, Bullet, Explosive, Spore, Stab, Sticky, None } namespace Lethalm.Utils { public class LookAtMainCamera : MonoBehaviour { private Camera mainCamera = null; private void Start() { mainCamera = Camera.current; } private void LateUpdate() { //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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) mainCamera = getMainCamera(); if ((Object)(object)mainCamera != (Object)null && 2f * ((Component)this).transform.position - ((Component)mainCamera).transform.position != Vector3.zero) { ((Component)this).transform.LookAt(2f * ((Component)this).transform.position - ((Component)mainCamera).transform.position); } } private Camera getMainCamera() { return ((Object)(object)StartOfRound.Instance == (Object)null) ? Camera.current : StartOfRound.Instance.activeCamera; } } } namespace LethalMin { [BepInPlugin("NoteBoxz.LethalMin", "LethalMin", "1.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class LethalMin : BaseUnityPlugin { public static Dictionary RegisteredFuseRules = new Dictionary(); public static List EnemyIDsOverridenByPiklopedia = new List(); public static LayerMask PikminColideable = LayerMask.op_Implicit(1375734017); public static EnemyType PikminEnemyType = null; public static EnemyType PuffminEnemyType = null; public static PikminSoundPack DefaultSoundPack = null; public static PikminSoundPack Pikmin2DefaultSoundPack = null; public static PikminSoundPack Pikmin3DefaultSoundPack = null; public static GameObject PikminGhostPrefab = null; public static GameObject SproutPrefab = null; public static GameObject OnionPrefab = null; public static GameObject DefultPikminSproutMesh = null; public static GameObject DefultOnionMesh = null; public static AnimationClip PlayerPluckAnim = null; public static GameObject OnionHUDSlotPrefab = null; public static GameObject SingleOnionHUDSlotPrefab = null; public static GameObject OnionItemPrefab = null; public static GameObject DefultOnionItemModel = null; public static GameObject GlowPrefab = null; public static GameObject PikminZapPrefab = null; public static GameObject PikminFirePrefab = null; public static GameObject PikminGasPrefab = null; public static GameObject PlayerSproutPrefab = null; public static GameObject NoticeZonePrefab = null; public static GameObject EnemyItemNode = null; public static GameObject GlowSeedPrefab = null; public static GameObject ItemCounterPrefab = null; public static GameObject GrabPosPrefab = null; public static OnionSoundPack DefaultOnionSoundPack = null; public static OnionType ShipOnionType = null; public static GameObject SSRenviourment = null; public static Vector3 enviormentStartPos = Vector3.zero; public const string FullEnglishAlphabetUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; public const string FullEnglishAlphabetLower = "abcdefghijklmnopqrstuvwxyz"; public const string FullEnglishAlhabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; public const string FullNumbers = "0123456789"; public static object AchivementController = null; private static bool? _isNightlyBuild = null; public static bool InVRMode = false; public static List LibraryTypes = new List(); public static List ConfigPatchTypes = new List(); public static ConfigItem MaxPikmin = null; public static ConfigItem FriendlyFire = null; public static ConfigItem FriendlyerFire = null; public static ConfigItem SkipPluckAnimation = null; public static ConfigItem WhistleVolume = null; public static ConfigItem AllowOnionsToRevivePlayers = null; public static ConfigItem AllowOnionToReviveMaskeds = null; public static ConfigItem AllowOnionFusing = null; public static ConfigItem HideResultsWhenMoreThanFour = null; public static ConfigItem ConvertEnemyBodiesToItems = null; public static ConfigItem ShowOnionsInSpace = null; public static ConfigItem SpaceOnionPosition = null; public static ConfigItem DontUpdateSpaceOnionPosition = null; public static ConfigItem MakeItemsScanable = null; public static ConfigItem MakePikminScanable = null; public static ConfigItem MakeSproutsScanable = null; public static ConfigItem TriggerLandmines = null; public static ConfigItem GlobalGhostSFX = null; public static ConfigItem DieInPlayerDeathZone = null; public static ConfigItem TakeItemsFromPikmin = null; public static ConfigItem TeleportAroundPlayerWhenEnteringBuilding = null; public static ConfigItem PatchShotGunArraySize = null; public static ConfigItem PikminScale = null; public static ConfigItem SproutScale = null; public static ConfigItem CurWhistPack = null; public static ConfigItem BigEyesEnabled = null; public static ConfigItem PikminScanNodeColorType = null; public static ConfigItem PikminSproutScanNodeColorType = null; public static ConfigItem DefaultGeneration = null; public static ConfigItem PikminModelGeneration = null; public static ConfigItem SoulSpriteGeneration = null; public static ConfigItem SproutModelGeneration = null; public static ConfigItem OnionModelGeneration = null; public static ConfigItem OnionItemModelGeneration = null; public static ConfigItem PikminSoundGeneration = null; public static ConfigItem PuffminGeneration = null; public static ConfigItem ThrowAction = null; public static ConfigItem ThrowCancelAction = null; public static ConfigItem SwitchForwardAction = null; public static ConfigItem SwitchBackwawrdsAction = null; public static ConfigItem WhisleAction = null; public static ConfigItem DismissAction = null; public static ConfigItem SwitchWhistleSoundAction = null; public static ConfigItem ChargeAction = null; public static ConfigItem GlowmobAction = null; public static ConfigItem OnionHudSpeedAction = null; public static Dictionary MoonSpawnConfigs = new Dictionary(StringComparer.OrdinalIgnoreCase); public static Dictionary WeatherSpawnConfigs = new Dictionary(StringComparer.OrdinalIgnoreCase); public static ConfigItem UsePowerLVForSprouts = null; public static ConfigItem UseLCSpawnSystem = null; public static ConfigItem IndoorSpawnChance = null; public static ConfigItem OutdoorSpawnChance = null; public static ConfigItem OnionSpawnChance = null; public static ConfigItem UseBetaOnionSpawnSystem = null; public static ConfigItem AvoidWaterForOnionSpawning = null; public static ConfigItem AvoidBehindShipForOnionSpawning = null; public static ConfigItem EnableTypeSpawnFalloff = null; public static ConfigItem TypeSpawnFalloffMaxCount = null; public static ConfigItem TypeSpawnFalloffExponent = null; public static ConfigItem NoOnionGroupSpawnThreshold = null; public static ConfigItem ScaleTypeSpawnAmountBySuppressedTypes = null; public static ConfigItem SuppressedTypeFalloffThreshold = null; public static ConfigItem OutdoorSpawnAmountScaleAtMaxSuppressed = null; public static ConfigItem IndoorSpawnAmountScaleAtMaxSuppressed = null; public static ConfigItem RandomizeByDay = null; public static ConfigItem> AttackBlacklistConfig = null; public static ConfigItem> ItemBlacklistConfig = null; public static ConfigItem> EnemyBodyConvertBlacklistConfig = null; public static ConfigItem UseExitsWhenCarryingItems = null; public static ConfigItem PikminFollowMode = null; public static ConfigItem PikminDontCollideWhenInElevator = null; public static ConfigItem TimeFallingFailSafe = null; public static ConfigItem CarryNonScrapItemsToCompany = null; public static ConfigItem IgnoreNonScrapItemsToCompany = null; public static ConfigItem TakeItemsToOnionOnCompany = null; public static ConfigItem TakeItemsToTheCar = null; public static ConfigItem TakeItemsToTheOnion = null; public static ConfigItem DisperseWhenDismissed = null; public static ConfigItem AllowOnBBtobeGrabed = null; public static ConfigItem DismissWindownTime = null; public static ConfigItem NonWaterResistantAvoidWater = null; public static ConfigItem WildPikminCarry = null; public static ConfigItem WildPikminAttack = null; public static ConfigItem WildPikminAttackDamage = null; public static ConfigItem WildPikminNoDeath = null; public static ConfigItem UseConfigsForEnemies = null; public static ConfigItem ClaySurgeon_SnipCooldown = null; public static ConfigItem ClaySurgeon_SnipLimit = null; public static ConfigItem Crawler_BiteCooldown = null; public static ConfigItem Crawler_BiteLimit = null; public static ConfigItem SandSpider_BiteCooldown = null; public static ConfigItem SandSpider_BiteLimit = null; public static ConfigItem HoarderBug_BiteCooldown = null; public static ConfigItem HoarderBug_BiteLimit = null; public static ConfigItem HoarderBug_AggroWhenPikminTakesItem = null; public static ConfigItem MouthDog_BiteCooldown = null; public static ConfigItem MouthDog_BiteLimit = null; public static ConfigItem Blob_TrapPikmin = null; public static ConfigItem Blob_KillPikmin = null; public static ConfigItem RedLocustBees_ZapCooldown = null; public static ConfigItem RedLocustBees_ZapPikmin = null; public static ConfigItem RedLocustBees_KillPikmin = null; public static ConfigItem CaveDweller_AllowCarry = null; public static ConfigItem CaveDweller_AttackAsBaby = null; public static ConfigItem CaveDweller_BiteCooldown = null; public static ConfigItem CaveDweller_BiteLimit = null; public static ConfigItem RadMech_GrabLimmit = null; public static ConfigItem RadMech_GrabsPikmin = null; public static ConfigItem ForestGiant_GrabLimit = null; public static ConfigItem ForestGiant_GrabsPikmin = null; public static ConfigItem Jester_BiteCooldown = null; public static ConfigItem Jester_BiteLimit = null; public static ConfigItem ButlerEnemy_StabCooldown = null; public static ConfigItem ButlerEnemy_StabLimit = null; public static ConfigItem BaboonBird_BiteCooldown = null; public static ConfigItem Puma_HurtsPikmin = null; public static ConfigItem MaskedPlayerEnemy_ConvertPikmin = null; public static ConfigItem Puffer_CanPoisonPikmin = null; public static ConfigItem Company_GrabsPikmin = null; public static ConfigItem Company_HearsPikmin = null; public static ConfigItem Stingray_HeavyCarriersCanTriggerSpit = null; public static ConfigItem Stingray_CarryStrengthNeededToTriggerSpit = null; public static ConfigItem Stingray_PikminCanSlipOnSlime = null; public static ConfigItem TurnToNormalOnDeath = null; public static ConfigItem HUDPreset = null; public static ConfigItem PikminSelectionPosition = null; public static ConfigItem PikminSelectionRotation = null; public static ConfigItem PikminSelectionScale = null; public static ConfigItem PikminSelectionAlpha = null; public static ConfigItem EnableCurSlot = null; public static ConfigItem EnableNextSlot = null; public static ConfigItem EnablePreviousSlot = null; public static ConfigItem PikminCounterPosition = null; public static ConfigItem PikminCounterRotation = null; public static ConfigItem PikminCounterScale = null; public static ConfigItem PikminCounterAlphaActive = null; public static ConfigItem PikminCounterAlphaIdle = null; public static ConfigItem EnableInExistanceCounter = null; public static ConfigItem EnableInSquadCounter = null; public static ConfigItem EnableInFieldCounter = null; public static ConfigItem HideSelectedWhenScanNotifcation = null; public static ConfigItem DontUpdateHudConfigs = null; public static ConfigItem GrayoutButtonsInOnionHUD = null; public static ConfigItem EnableCarouselEffect = null; public static ConfigItem WhistlePriceConfig = null; public static ConfigItem ShipOnionPriceConfig = null; public static ConfigItem PluckaPhonePriceConfig = null; public static ConfigItem ShipWhistlePriceConfig = null; public static ConfigItem IsWhistleConductive = null; public static ConfigItem LumiknullActivateTime = null; public static ConfigItem LumiknullActivateDistance = null; public static ConfigItem LumiknullSpawnChance = null; public static ConfigItem SpawnLumiknullAfterDays = null; public static ConfigItem GlowOddsToTurnIntoSeed = null; public static ConfigItem GlowsUseableAtCompany = null; public static ConfigItem AttackOwnTamedEnemies = null; public static ConfigItem AttackOthersTamedEnemies = null; public static ConfigItem AllowMetalDetectorToZap = null; public static ConfigItem AddNavLinkToZeranosShip = null; public static ConfigItem BlockEnemiesFromEnteringZeranosShip = null; public static ConfigItem AddNavLinkToZeranosElevator = null; public static ConfigItem AutoSetHudVRPreset = null; public static ConfigItem DontUseInputUtilsForVR = null; public static ConfigItem DisableSproutInteraction = null; public static ConfigItem DisableWhistleFix = null; public static ConfigItem OnionHUDZDistance = null; public static ConfigItem ThrowVRAction = null; public static ConfigItem ThrowCancelVRAction = null; public static ConfigItem SecondaryThrowVRAction = null; public static ConfigItem SwitchForwardVRAction = null; public static ConfigItem SwitchBackwawrdsVRAction = null; public static ConfigItem WhisleVRAction = null; public static ConfigItem UseMouthTriggerForWhistle = null; public static ConfigItem DismissVRAction = null; public static ConfigItem SwitchWhistleSoundVRAction = null; public static ConfigItem ChargeVRAction = null; public static ConfigItem SecondaryChargeVRAction = null; public static ConfigItem DisableChargeMotionBlur = null; public static ConfigItem GlowmobVRAction = null; public static ConfigItem GlowmobDelay = null; public static ConfigItem DontDoAudibleNoiseCalcuationsForPikmin = null; public static ConfigItem DontResimulateOracleOnPikminDeath = null; public static ConfigItem RemovePuffminFromSpawnSearch = null; public static ConfigItem MakeCustomBoundsForWideShip = null; public static ConfigItem CheckNavMesh = null; public static ConfigItem> NavmeshCheckBlacklistConfig = null; public static ConfigEntry UseCommasInVectorConfigs = null; public static ConfigItem GeneratePikminConfigs = null; public static ConfigItem UseModDataLibConfig = null; public static ConfigItem CleanMoonNames = null; public static ConfigItem GenerateMoonSpawnConfigs = null; public static ConfigItem GenerateWeatherSpawnConfigs = null; public static ConfigItem UseBetaItemWeightCalculation = null; public static ConfigItem WhistleMakesNoiseAtNoiceZone = null; public static ConfigItem DontMakeAudibleNoises = null; public static ConfigItem PikminSignalCooldown = null; public static ConfigItem NoKnockBack = null; public static ConfigItem InvinceablePikmin = null; public static ConfigItem UselessBluesMode = null; public static ConfigItem MaxWhistleZoneRadius = null; public static ConfigItem MaxWhistleZoneDistance = null; public static ConfigItem PlayerNoticeZoneSize = null; public static ConfigItem PikminDamageMultipler = null; public static ConfigItem PikminSpeedMultipler = null; public static ConfigItem ChargeCooldown = null; public static ConfigItem ChargeDistance = null; public static ConfigItem DontPurgeAfterFire = null; public static ConfigItem CR_ACUTargetsPikmin = null; public static ConfigItem CR_BulletKnockbackPikmin = null; public static ConfigItem CR_CraneTargetsPikmin = null; public static ConfigItem CR_CraneSquishPikmin = null; public static ConfigItem CR_FanKnockbackPikmin = null; public static ConfigItem CR_FanKnockbackStrengthThreshold = null; public static ConfigItem CR_MicrowaveKnockbackPikmin = null; public static ConfigItem CR_FlashTurretKnockbackPikmin = null; public static ConfigItem CR_LaserTurretKillsPikmin = null; public static ConfigItem CR_TornadoPullsPikmin = null; public static ConfigItem CR_TornadoPullStrengthThreshold = null; public static ConfigItem CR_TobySquishPikmin = null; public static ConfigItem CR_GoToSarahBeforeToby = null; public static ConfigItem YeetAfterLatchOn = null; public static ConfigItem RandomizeGenerationModels = null; public static ConfigItem AddCollisionToGhostSprites = null; public static ConfigItem FuniOnion = null; public static ConfigItem GiantWhistleMode = null; public static ConfigItem RagdollOnKnockback = null; public static LethalMin Instance { get; private set; } = null; internal static ManualLogSource Logger { get; private set; } = null; internal static Harmony? Harmony { get; set; } internal static AssetBundle assetBundle { get; private set; } = null; public static Dictionary RegisteredPikminTypes { get; private set; } = new Dictionary(); public static Dictionary RegisteredOnionTypes { get; private set; } = new Dictionary(); public static List NaturalSpawningTypes { get; private set; } = new List(); public static Dictionary RegisteredEntries { get; private set; } = new Dictionary(); public static InputClass InputClassInstace { get; private set; } = null; public static List EnemyTypes => (from e in Resources.FindObjectsOfTypeAll() where (Object)(object)e.enemyPrefab != (Object)null group e by e.enemyPrefab into g select g.First()).ToList(); public static List ItemTypes => (from i in Resources.FindObjectsOfTypeAll() where (Object)(object)i.spawnPrefab != (Object)null group i by i.spawnPrefab into i select i.First()).ToList(); public static List OnionTypes => RegisteredOnionTypes.Values.Where((OnionType ot) => ot.SpawnsIndoors || ot.SpawnsOutdoors).ToList(); public static bool IsNightlyBuild { get { if (_isNightlyBuild.HasValue) { return _isNightlyBuild.Value; } try { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string path = Path.Combine(directoryName, "manifest.json"); if (File.Exists(path)) { string text = File.ReadAllText(path); _isNightlyBuild = text.Contains("\"name\": \"LethalMinNightly\"") || text.Contains("\"name\":\"LethalMinNightly\""); } else { _isNightlyBuild = false; ManualLogSource logger = Logger; if (logger != null) { logger.LogWarning((object)"LethalMin: manifest.json not found next to assembly — assuming stable build."); } } } catch (Exception ex) { _isNightlyBuild = false; ManualLogSource logger2 = Logger; if (logger2 != null) { logger2.LogError((object)("LethalMin: Failed to read manifest.json for nightly detection: " + ex.Message)); } } return _isNightlyBuild.Value; } } public static bool UseInputUtils => IsDependencyLoaded("com.rune580.LethalCompanyInputUtils") && (!InVRMode || !DontUseInputUtilsForVR || !InVRMode); public static bool UseModDataLib => IsDependencyLoaded("MaxWasUnavailable.LethalModDataLib") && UseModDataLibConfig.InternalValue; public static bool OnCompany => (Object)(object)RoundManager.Instance != (Object)null && (RoundManager.Instance.currentLevel.sceneName == "CompanyBuilding" || RoundManager.Instance.currentLevel.sceneName == "MusemaScene" || RoundManager.Instance.currentLevel.sceneName == "Oxyde"); public static bool WhistleMakesNoiseAtNoticeZoneCheat => (Object)(object)PikminManager.instance != (Object)null && PikminManager.instance.Cheat_WhistleMakesNoiseAtNoticeZone.Value; public static bool DontMakeAudibleNoisesCheat => (Object)(object)PikminManager.instance != (Object)null && PikminManager.instance.Cheat_DontMakeAudibleNoises.Value; public static float PikminSignalCooldownCheat => ((Object)(object)PikminManager.instance != (Object)null) ? PikminManager.instance.Cheat_PikminSingalCooldown.Value : (-1f); public static bool UselessBluesCheat => (Object)(object)PikminManager.instance != (Object)null && PikminManager.instance.Cheat_UselessBluesMode.Value; public static bool InviciblePikminCheat => (Object)(object)PikminManager.instance != (Object)null && PikminManager.instance.Cheat_InvinceablePikmin.Value; public static bool NoKnockbackCheat => (Object)(object)PikminManager.instance != (Object)null && PikminManager.instance.Cheat_NoKnockback.Value; public static float WhistleZoneRadiusCheat => ((Object)(object)PikminManager.instance != (Object)null) ? PikminManager.instance.Cheat_MaxWhistleZoneRadius.Value : (-1f); public static float WhistleZoneDistanceCheat => ((Object)(object)PikminManager.instance != (Object)null) ? PikminManager.instance.Cheat_MaxWhistleZoneDistance.Value : (-1f); public static float PlayerNoticeZoneSizeCheat => ((Object)(object)PikminManager.instance != (Object)null) ? PikminManager.instance.Cheat_PlayerNoticeZoneSize.Value : (-1f); public static float PikminDamageMultiplerCheat => ((Object)(object)PikminManager.instance != (Object)null) ? PikminManager.instance.Cheat_PikminDamageMultipler.Value : (-1f); public static float PikminSpeedMultiplerCheat => ((Object)(object)PikminManager.instance != (Object)null) ? PikminManager.instance.Cheat_PikminSpeedMultipler.Value : (-1f); private void Awake() { //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; Instance = this; InputClassInstace = new InputClass(); Logger.LogInfo((object)"LethalMin: Initializing LethalMin"); Logger.LogInfo((object)"LethalMin: Netcode Patching"); NetcodePatcher(); Logger.LogInfo((object)"LethalMin: Patching"); Patch(); Logger.LogInfo((object)"LethalMin: Binding Configs"); BindConfigs(); Logger.LogInfo((object)"LethalMin: Patching Config Patches"); PatchConfigPatches(); Logger.LogInfo((object)"LethalMin: Loading AssetBundle"); LoadAssetBundle(); Logger.LogInfo((object)"LethalMin: Loading Miscellaneous Assets"); LoadMiscAssets(); Logger.LogInfo((object)"LethalMin: Registering Pikmin As Enemies"); RegisterPikmin(); Logger.LogInfo((object)"LethalMin: Registering Items"); RegisterItems(); Logger.LogInfo((object)"LethalMin: Registering Pikmin Types"); RegisterPikminTypes(); Logger.LogInfo((object)"LethalMin: Loading Default Moon Spawn Configs"); LoadDefaultMoonConfigs(); Logger.LogInfo((object)"LethalMin: Loading Default Weather Spawn Configs"); LoadDefaultWeatherConfigs(); Logger.LogInfo((object)"LethalMin: Registering Onion Types"); RegisterOnionTypes(); Logger.LogInfo((object)"LethalMin: Registering Onion Fuse Rules"); RegisterFuseRules(); Logger.LogInfo((object)"LethalMin: Registering Custom Piklopedia Entries"); RegisterPiklopediaEntries(); if (IsDependencyLoaded("ainavt.lc.lethalconfig")) { BindLCconfigs(); } if (IsDependencyLoaded("BMX.LobbyCompatibility")) { RegisterLobbyCompat(); } GameObject val = new GameObject("PikminGenerationManager"); val.AddComponent(); if (IsNightlyBuild) { Logger.LogInfo((object)"NoteBoxz.LethalMin v1.1.0(NIGHTLY) has loaded!"); } else { Logger.LogInfo((object)"NoteBoxz.LethalMin v1.1.0 has loaded!"); } } public static void RegisterItems() { Item val = assetBundle.LoadAsset("Assets/LethalMin/Whistle/WhisleItem.asset"); val.isConductiveMetal = IsWhistleConductive; TerminalNode val2 = CreateTerminalNodeA("A whistle that can be used to call to your squad Pikmin easier.\n\n", val); Items.RegisterShopItem(val, (TerminalNode)null, (TerminalNode)null, val2, WhistlePriceConfig.InternalValue); UnlockableItemDef val3 = assetBundle.LoadAsset("Assets/LethalMin/OnionAssets/ShipOnionDef.asset"); TerminalNode val4 = CreateTerminalNodeB("Used to keep Purple and White Pikmin between moons.\n\n", val3); Unlockables.RegisterUnlockable(val3, (StoreType)1, (TerminalNode)null, (TerminalNode)null, val4, ShipOnionPriceConfig.InternalValue); UnlockableItemDef val5 = assetBundle.LoadAsset("Assets/LethalMin/Whistle/CallBackControlDef.asset"); float num = 300f; string text = $"{Mathf.FloorToInt(num / 60f):00}:{Mathf.FloorToInt(num % 60f):00}"; TerminalNode val6 = CreateTerminalNodeB("A device that emits a large signal that calls any (non wild) pikmin to the ship. Goes on cooldown for (" + text + ") \n\n", val5); Unlockables.RegisterUnlockable(val5, (StoreType)1, (TerminalNode)null, (TerminalNode)null, val6, ShipWhistlePriceConfig.InternalValue); Item val7 = assetBundle.LoadAsset("Assets/LethalMin/Whistle/PluckAPhoneItem.asset"); TerminalNode val8 = CreateTerminalNodeA("A more powerful whistle that can call pikmin with a bigger radius and pluck Pikmin from the ground. \n\n", val7); Items.RegisterShopItem(val7, (TerminalNode)null, (TerminalNode)null, val8, PluckaPhonePriceConfig.InternalValue); Item val9 = assetBundle.LoadAsset("Assets/LethalMin/Types/Glow Pikmin/GlowSeedItm.asset"); Items.RegisterItem(val9); static TerminalNode CreateTerminalNode(string displayText, string name) { TerminalNode val10 = ScriptableObject.CreateInstance(); ((Object)val10).name = name; val10.clearPreviousText = true; val10.maxCharactersToType = 25; val10.displayText = displayText; return val10; } static TerminalNode CreateTerminalNodeA(string displayText, Item itm) { string name3 = itm.itemName.Replace(" ", "-") + "InfoNode"; return CreateTerminalNode(displayText, name3); } static TerminalNode CreateTerminalNodeB(string displayText, UnlockableItemDef def) { string name2 = def.unlockable.unlockableName.Replace(" ", "-") + "InfoNode"; return CreateTerminalNode(displayText, name2); } } public static void InitCustomDefaultSoundPacks(List soundPacks) { int num = 0; foreach (PikminSoundPack soundPack in soundPacks) { if (soundPack.IsDefaultSoundPack) { soundPack.InitalizeDict(); num++; } } if (num > 0) { Logger.LogInfo((object)$"Initialized {num} custom default sound packs."); } } public static void InitDefaultSoundPacks() { List list = assetBundle.LoadAllAssets().ToList(); foreach (PikminSoundPack item in list) { if (item.IsDefaultSoundPack) { item.InitalizeDict(); } } DefaultSoundPack = assetBundle.LoadAsset("Assets/LethalMin/Types/DeafultSoundPack.asset"); Pikmin2DefaultSoundPack = assetBundle.LoadAsset("Assets/LethalMin/Types/Pik2DeafultSoundPack.asset"); } private static void RegisterTypes(List types, Dictionary registry, string logName, Func nameSelector, Action registerAction) { Func nameSelector2 = nameSelector; if (types.Count == 0) { return; } Logger.LogInfo((object)$"Registering {types.Count} {logName}"); types.Sort((T a, T b) => string.Compare(nameSelector2(a), nameSelector2(b), StringComparison.Ordinal)); int num = registry.Count; foreach (T type in types) { registerAction(type, num); num++; } } private static void RegisterTypesFromAssetBundle(Dictionary registry, string logName, Func nameSelector, Action registerAction) where T : ScriptableObject { List types = assetBundle.LoadAllAssets().ToList(); RegisterTypes(types, registry, logName, nameSelector, registerAction); } public static void RegisterCustomPikminTypes(List CustomTypes) { RegisterTypes(CustomTypes, RegisteredPikminTypes, "Custom Types", (PikminType type) => type.PikminName, RegisterPikminType); } public static void RegisterPikminTypes() { InitDefaultSoundPacks(); RegisterTypesFromAssetBundle(RegisteredPikminTypes, "Pikmin Types", (PikminType type) => type.PikminName, RegisterPikminType); } public static void RegisterPiklopediaEntries() { RegisterTypesFromAssetBundle(RegisteredEntries, "Piklopedia Entries", (PiklopediaEntry entry) => entry.EntryName, RegisterPiklopediaEntry); } public static void RegisterCustomPiklopediaEntries(List loadedEntries) { RegisterTypes(loadedEntries, RegisteredEntries, "Custom Piklopedia Entries", (PiklopediaEntry entry) => entry.EntryName, RegisterPiklopediaEntry); } public static void RegisterOnionTypes() { RegisterTypesFromAssetBundle(RegisteredOnionTypes, "Onion Types", (OnionType type) => type.TypeName, RegisterOnionType); } public static void RegisterCustomOnionTypes(List CustomTypes) { RegisterTypes(CustomTypes, RegisteredOnionTypes, "Custom Onion Types", (OnionType type) => type.TypeName, RegisterOnionType); } public static void RegisterFuseRules() { RegisterTypesFromAssetBundle(RegisteredFuseRules, "Fuse Rules", (OnionFuseRules rules) => ((Object)rules).name, RegisterFuseRule); } public static void RegisterCustomFuseRules(List loadedTypes) { RegisterTypes(loadedTypes, RegisteredFuseRules, "Custom fuse rules", (OnionFuseRules rules) => ((Object)rules).name, RegisterFuseRule); } private static void RegisterPiklopediaEntry(PiklopediaEntry entry, int index) { int num = ((RegisteredEntries.Count > 0) ? (RegisteredEntries.Keys.Max() + 1) : 0); if (RegisteredEntries.ContainsKey(entry.PiklopediaID)) { Logger.LogWarning((object)$"Piklopedia Entry: {entry.EntryName} with ID {entry.PiklopediaID} has already been registered."); return; } if ((Object)(object)entry.PiklopediaKeyword == (Object)null) { entry.PiklopediaKeyword = PikUtils.CreateTerminalKeyword("Piklopedia" + entry.EntryName, entry.EntryName.ToLower().Replace(" ", "") + " info", entry.PiklopediaNode); } entry.PiklopediaID = num; RegisteredEntries[num] = entry; } 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, "lethalminassets"); assetBundle = AssetBundle.LoadFromFile(text); if ((Object)(object)assetBundle == (Object)null) { throw new InvalidOperationException("Failed to load AssetBundle."); } } public void LoadMiscAssets() { PikminGhostPrefab = assetBundle.LoadAsset("Assets/LethalMin/PikminGhost.prefab"); SproutPrefab = assetBundle.LoadAsset("Assets/LethalMin/Sprout.prefab"); DefultPikminSproutMesh = assetBundle.LoadAsset("Assets/LethalMin/Types/DefultSproutMesh.prefab"); PlayerPluckAnim = assetBundle.LoadAsset("Assets/LethalMin/Animations/PlayerPluckNew.anim"); OnionPrefab = assetBundle.LoadAsset("Assets/LethalMin/Onion.prefab"); DefultOnionMesh = assetBundle.LoadAsset("Assets/LethalMin/OnionAssets/DefaultOnionMesh.prefab"); OnionHUDSlotPrefab = assetBundle.LoadAsset("Assets/LethalMin/OnionAssets/TypeSlot.prefab"); SingleOnionHUDSlotPrefab = assetBundle.LoadAsset("Assets/LethalMin/OnionAssets/TypeUI.prefab"); OnionItemPrefab = assetBundle.LoadAsset("Assets/LethalMin/OnionAssets/OnionGrabable.prefab"); DefultOnionItemModel = assetBundle.LoadAsset("Assets/LethalMin/OnionAssets/DefaultOnionItemMesh.prefab"); GlowPrefab = assetBundle.LoadAsset("Assets/LethalMin/IdleGlow.prefab"); PikminZapPrefab = assetBundle.LoadAsset("Assets/LethalMin/Particles/elecpikiparticle/PikminZap.prefab"); PikminFirePrefab = assetBundle.LoadAsset("Assets/LethalMin/Particles/fixed FireGasPrefabs/PikminFire.prefab"); PikminGasPrefab = assetBundle.LoadAsset("Assets/LethalMin/Particles/fixed FireGasPrefabs/PikminGas.prefab"); PlayerSproutPrefab = assetBundle.LoadAsset("Assets/LethalMin/PlayerSprout.prefab"); DefaultOnionSoundPack = assetBundle.LoadAsset("Assets/LethalMin/OnionAssets/DefaultSoundPack.prefab").GetComponent(); NoticeZonePrefab = assetBundle.LoadAsset("Assets/LethalMin/Puffmin/PuffminWhistleZone.prefab"); EnemyItemNode = assetBundle.LoadAsset("Assets/LethalMin/EnemyGrabbableItem.prefab"); GlowSeedPrefab = assetBundle.LoadAsset("Assets/LethalMin/Types/Glow Pikmin/GlowSeed.prefab"); ItemCounterPrefab = assetBundle.LoadAsset("Assets/LethalMin/PikminItemCounter.prefab"); GrabPosPrefab = assetBundle.LoadAsset("Assets/LethalMin/GrabPos.prefab"); ShipOnionType = assetBundle.LoadAsset("Assets/LethalMin/Types/ShipOnion.asset"); } public void RegisterPikmin() { EnemyType val = assetBundle.LoadAsset("Assets/LethalMin/PikminEnemyType.asset"); TerminalNode val2 = assetBundle.LoadAsset("Assets/LethalMin/Pikmin TN.asset"); val.spawningDisabled = ((!UseLCSpawnSystem) ? true : false); Enemies.RegisterEnemy(val, (Dictionary)null, (Dictionary)null, val2, (TerminalKeyword)null); PikminEnemyType = val; PikminAI component = PikminEnemyType.enemyPrefab.GetComponent(); ((Behaviour)component).enabled = false; PikminEnemyType.enemyPrefab.GetComponent().PikminAIs.Add(component); EnemyType val3 = assetBundle.LoadAsset("Assets/LethalMin/Puffmin/PuffminEnemyType.asset"); TerminalNode val4 = assetBundle.LoadAsset("Assets/LethalMin/Puffmin/PuffminTN.asset"); Enemies.RegisterEnemy(val3, (Dictionary)null, (Dictionary)null, val4, (TerminalKeyword)null); PuffminEnemyType = val3; } internal static void RegisterPikminType(PikminType Ptype, int id) { Logger.LogMessage((object)("Registering Pikmin Type: " + Ptype.PikminName)); if (RegisteredPikminTypes.ContainsKey(Ptype.PikminTypeID)) { Logger.LogWarning((object)$"Pikmin Type: {Ptype.PikminName} with ID {Ptype.PikminTypeID} has already been registered."); return; } Ptype.MigrateOldSpawnFields(); if ((bool)GeneratePikminConfigs && Ptype.GenerateConfigFile) { GeneratePikminTypeConfig(Ptype); } ConfigItem configItem = new ConfigItem("Pikmin", Ptype.PikminName, defaultValue: true, "Enable " + Ptype.PikminName + " Pikmin", needsRestart: true, ConfigItemAuthority.Host); if (!configItem) { Logger.LogWarning((object)("Pikmin Type: " + Ptype.PikminName + " is disabled in the config. Skipping registration.")); return; } if (Ptype.DisableRegistration) { Logger.LogWarning((object)("Pikmin Type: " + Ptype.PikminName + " is set to be disabled. Skipping registration.")); return; } if ((Object)(object)Ptype.ModelPrefab == (Object)null) { Logger.LogError((object)("Pikmin Type: " + Ptype.PikminName + " has no model prefab!")); return; } if ((Object)(object)Ptype.modelRefernces == (Object)null) { Logger.LogError((object)("Pikmin Type: " + Ptype.PikminName + " has no model references!")); return; } if ((Object)(object)Ptype.ModelPrefab.GetComponentInChildren() == (Object)null) { Logger.LogWarning((object)("Pikmin Type: " + Ptype.PikminName + " has no animator controller!")); } if ((Object)(object)Ptype.PikminIcon == (Object)null) { Logger.LogWarning((object)("Pikmin Type: " + Ptype.PikminName + " has no icon!")); } if ((Object)(object)Ptype.SoundPack == (Object)null) { Ptype.SoundPack = DefaultSoundPack; Logger.LogWarning((object)("Pikmin Type: " + Ptype.PikminName + " has no Sound Pack! Using default.")); } if ((Object)(object)Ptype.TargetOnion != (Object)null && !Ptype.TargetOnion.TypesCanHold.ToList().Contains(Ptype)) { if (!Ptype.TargetOnion.AllowPikminToBeAddedToOnion) { Logger.LogWarning((object)("Pikmin Type: " + Ptype.PikminName + " has a Target Onion that does not contain this type in its TypesCanHold list! Won't add it.")); } else { Logger.LogWarning((object)("Pikmin Type: " + Ptype.PikminName + " has a Target Onion that does not contain this type in its TypesCanHold list! Adding it now.")); Array.Resize(ref Ptype.TargetOnion.TypesCanHold, Ptype.TargetOnion.TypesCanHold.Length + 1); Ptype.TargetOnion.TypesCanHold[Ptype.TargetOnion.TypesCanHold.Length - 1] = Ptype; } } else if (!Ptype.SoundPack.IsDefaultSoundPack) { Ptype.SoundPack.InitalizeDict(); } if (Ptype.UsesPikminContainer && !ShipOnionType.TypesCanHold.ToList().Contains(Ptype)) { Logger.LogInfo((object)("Pikmin Type: " + Ptype.PikminName + " has UsesPikminContainer set to true, adding it to the Ship Onion's TypesCanHold list.")); Array.Resize(ref ShipOnionType.TypesCanHold, ShipOnionType.TypesCanHold.Length + 1); ShipOnionType.TypesCanHold[ShipOnionType.TypesCanHold.Length - 1] = Ptype; } if (Ptype.UsePiklopedia) { string text = ""; if (Ptype.UsePresetFormatting) { string text2 = ((Ptype.piklopediaName == "") ? Ptype.PikminName : Ptype.piklopediaName); text = text2 + "\n\nSigurd's helpfulness level: " + Ptype.HelpfulLevel + "\n\nScientific name: " + Ptype.ScientificName + "\n\n" + Ptype.piklopediaDescription + "\n\n"; } else { text = Ptype.piklopediaDescription; } if (string.IsNullOrEmpty(Ptype.piklopediaDescription)) { Ptype.piklopediaDescription = $"Type Id {id}, with empty description."; Logger.LogWarning((object)("Pikmin Type: " + Ptype.PikminName + " has no description and uses Piklopedia!")); } TerminalNode val = null; if ((Object)(object)Ptype.OverridePiklopediaNode == (Object)null) { val = PikUtils.CreateTerminalNode("TerminalNode" + Ptype.PikminName, text); val.creatureName = (string.IsNullOrEmpty(Ptype.piklopediaName) ? Ptype.PikminName.Replace(" ", "-") : Ptype.piklopediaName); if (!string.IsNullOrEmpty(Ptype.piklopediaName) && string.IsNullOrWhiteSpace(Ptype.piklopediaName)) { Logger.LogWarning((object)(Ptype.PikminName + " White space counts as the pikolopedia name not being empty, Pikmin name may show as empty in the terminal")); } val.displayVideo = Ptype.piklopediaVideo; val.loadImageSlowly = true; } else { val = Ptype.OverridePiklopediaNode; } TerminalKeyword val2 = null; val2 = (TerminalKeyword)((!((Object)(object)Ptype.OverridePiklopediaKeyword == (Object)null)) ? ((object)Ptype.OverridePiklopediaKeyword) : ((object)PikUtils.CreateTerminalKeyword("TerminalKeyword" + Ptype.PikminName, Ptype.PikminName.ToLower().Replace(" ", "") + " info", val))); PiklopediaEntry piklopediaEntry = ScriptableObject.CreateInstance(); ((Object)piklopediaEntry).name = "PiklopediaEntry" + Ptype.PikminName; piklopediaEntry.EntryName = val.creatureName; Ptype.PiklopediaEntry = piklopediaEntry; piklopediaEntry.PiklopediaID = id; piklopediaEntry.PiklopediaKeyword = val2; piklopediaEntry.PiklopediaNode = val; RegisteredEntries[id] = piklopediaEntry; } for (int i = 0; i < Ptype.SoundPackGenerations.Length; i++) { PikminSoundPack pikminSoundPack = Ptype.SoundPackGenerations[i]; if ((Object)(object)pikminSoundPack == (Object)null) { Logger.LogWarning((object)$"Pikmin Type: {Ptype.PikminName} has a null SoundPack for generation {i}! Defaulting to DefaultSoundPack."); Ptype.SoundPackGenerations[i] = DefaultSoundPack; } else if (!pikminSoundPack.IsDefaultSoundPack) { pikminSoundPack.InitalizeDict(); } } if ((Object)(object)Ptype.CustomTypeScript != (Object)null) { PikminAI customTypeScript = AddCustomScriptToPikminAI(Ptype.CustomTypeScript); Object.Destroy((Object)(object)Ptype.CustomTypeScript); Ptype.CustomTypeScript = customTypeScript; } PikminAnimationPack pikminAnimationPack = Ptype.modelRefernces.AnimatorController?.AnimPack; if ((Object)(object)pikminAnimationPack != (Object)null) { pikminAnimationPack.AddEventsToOneshotIdleAnims(); } PikminModelGeneration[] generations = Ptype.modelRefernces.Generations; foreach (PikminModelGeneration pikminModelGeneration in generations) { PikminAnimationPack pikminAnimationPack2 = pikminModelGeneration.AnimatorController?.AnimPack; if ((Object)(object)pikminAnimationPack2 != (Object)null) { pikminAnimationPack2.AddEventsToOneshotIdleAnims(); } } Ptype.PikminTypeID = id; RegisteredPikminTypes[id] = Ptype; if (Ptype.SpawnsNaturally) { NaturalSpawningTypes.Add(Ptype); } Logger.LogMessage((object)$"Registered Pikmin Type: {Ptype.PikminName} with ID: {id}"); } internal static void RegisterOnionType(OnionType Otype, int id) { Logger.LogMessage((object)("Registering Onion Type: " + Otype.TypeName)); if (RegisteredOnionTypes.ContainsKey(id)) { Logger.LogWarning((object)$"Onion Type with ID {id} has already been registered."); return; } int num = 0; PikminType[] typesCanHold = Otype.TypesCanHold; foreach (PikminType pikminType in typesCanHold) { if (!RegisteredPikminTypes.ContainsKey(pikminType.PikminTypeID)) { Logger.LogDebug((object)("Onion Type: " + Otype.TypeName + " has a type " + pikminType.PikminName + " that is not registered! Skipping registration.")); num++; } } if (num == Otype.TypesCanHold.Length) { Logger.LogWarning((object)("Onion Type: " + Otype.TypeName + " has no registered types! Skipping registration.")); return; } Otype.OnionTypeID = id; RegisteredOnionTypes[id] = Otype; Logger.LogMessage((object)$"Registered Onion Type: {Otype.TypeName} with ID: {id}"); } internal static void RegisterFuseRule(OnionFuseRules FuseR, int id) { Logger.LogMessage((object)("Registering Fuse Rules: " + ((Object)FuseR).name)); if (RegisteredFuseRules.ContainsKey(id)) { Logger.LogWarning((object)$"Fuse Rules with ID {id} has already been registered."); return; } FuseR.FuseRulesTypeID = id; RegisteredFuseRules[id] = FuseR; Logger.LogMessage((object)$"Registered Fuse Rules: {((Object)FuseR).name} with ID: {id}"); } public void RegisterLobbyCompat() { PluginHelper.RegisterPlugin("NoteBoxz.LethalMin", new Version("1.1.0"), (CompatibilityLevel)2, (VersionStrictness)3); } public static PikminAI AddCustomScriptToPikminAI(PikminAI script) { Type type = ((object)script).GetType(); GameObject enemyPrefab = PikminEnemyType.enemyPrefab; PikminAI component = enemyPrefab.GetComponent(); PikminAI pikminAI = (PikminAI)(object)enemyPrefab.AddComponent(type); FieldInfo[] fields = typeof(PikminAI).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { fieldInfo.SetValue(pikminAI, fieldInfo.GetValue(component)); } FieldInfo[] fields2 = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo[] array2 = fields2; foreach (FieldInfo fieldInfo2 in array2) { if (!(typeof(PikminAI).GetField(fieldInfo2.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) != null)) { fieldInfo2.SetValue(pikminAI, fieldInfo2.GetValue(script)); } } PikminEnemyType.enemyPrefab.GetComponent().PikminAIs.Add(pikminAI); ((Behaviour)pikminAI).enabled = false; Logger.LogInfo((object)("Added Custom Script: " + type.Name + " to PikminAI!")); return pikminAI; } public static void GeneratePikminTypeConfig(PikminType pikminType) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown if ((Object)(object)pikminType == (Object)null) { Logger.LogWarning((object)"Cannot generate config for null PikminType"); return; } Logger.LogInfo((object)("Generating config file for Pikmin Type: " + pikminType.PikminName)); string text = Path.Combine(Paths.ConfigPath, "Pikmin"); Directory.CreateDirectory(text); string path = SanitizeFileName(pikminType.PikminName) + ".cfg"; string text2 = Path.Combine(text, path); ConfigFile config = new ConfigFile(text2, true); FieldInfo[] fields = typeof(PikminType).GetFields(BindingFlags.Instance | BindingFlags.Public); string section = "General"; FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { IEnumerable customAttributes = ((MemberInfo)fieldInfo).GetCustomAttributes(); HeaderAttribute val = customAttributes.LastOrDefault(); if (val != null) { section = val.header; } else if (!ShouldSkipField(fieldInfo)) { if (!IsSupportedConfigType(fieldInfo.FieldType)) { Logger.LogDebug((object)$"Skipping unsupported field type: {fieldInfo.Name} ({fieldInfo.FieldType})"); continue; } IEnumerable customAttributes2 = ((MemberInfo)fieldInfo).GetCustomAttributes(); string description = customAttributes2.FirstOrDefault()?.tooltip ?? ("Configuration for " + fieldInfo.Name); object value = fieldInfo.GetValue(pikminType); CreateAndBindConfigEntry(config, fieldInfo, pikminType, section, description, value); } } string directoryName = Path.GetDirectoryName(Path.GetDirectoryName(Paths.ConfigPath)); string relativePath = Path.GetRelativePath(directoryName, text2); Logger.LogInfo((object)("Config file generated for Pikmin Type: " + pikminType.PikminName + " at BepInEx/" + relativePath)); } private static bool ShouldSkipField(FieldInfo field) { HashSet hashSet = new HashSet { "PikminTypeID", "PiklopediaEntry", "modelRefernces", "ModelPrefab", "SoundPack", "SoundPackGenerations", "PikminGhostOverrideTexture", "PikminGhostOverrideModel", "PikminSproutOverrideMaterial", "SproutOverrideModel", "piklopediaVideo", "OverridePiklopediaNode", "OverridePiklopediaKeyword", "CustomTypeScript", "TargetOnion", "piklopediaDescription", "FavoredMoons", "FavoredMoonTags", "FavoredWeathers", "SpawnChanceMultiplier", "AvoidMoons", "AvoidMoonTags", "SpawnChanceDemultiplier" }; IEnumerable customAttributes = ((MemberInfo)field).GetCustomAttributes(); return hashSet.Contains(field.Name) || customAttributes.Any(); } private static bool IsSupportedConfigType(Type type) { if (type == typeof(bool) || type == typeof(int) || type == typeof(float) || type == typeof(string)) { return true; } if (type.IsEnum) { return true; } if (type == typeof(Vector2) || type == typeof(Vector3) || type == typeof(Color)) { return true; } if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(List<>)) { Type type2 = type.GetGenericArguments()[0]; return type2 == typeof(string) || type2 == typeof(int) || type2 == typeof(float) || type2 == typeof(bool) || type2 == typeof(Color) || type2 == typeof(Vector2) || type2 == typeof(Vector3) || type2.IsEnum; } if (type.IsArray) { Type elementType = type.GetElementType(); return elementType == typeof(string) || elementType == typeof(int) || elementType == typeof(float) || elementType == typeof(bool) || elementType == typeof(Color) || elementType == typeof(Vector2) || elementType == typeof(Vector3) || elementType.IsEnum; } return false; } private static void CreateAndBindConfigEntry(ConfigFile config, FieldInfo field, PikminType pikminType, string section, string description, object currentValue) { Type fieldType = field.FieldType; try { Type type = typeof(ConfigItem<>).MakeGenericType(fieldType); object obj = Activator.CreateInstance(type, section, field.Name, currentValue, description, true, ConfigItemAuthority.Client, config, GetItemArgs(fieldType)); if (obj != null) { FieldInfo field2 = type.GetField("InternalValue"); if (field2 != null) { object value = field2.GetValue(obj); field.SetValue(pikminType, value); Logger.LogDebug((object)$"{field.Name} set to {value}"); } } } catch (Exception arg) { Logger.LogError((object)$"Failed to create config entry for field {field.Name}: {arg}"); } } private static void UpdatePikminTypeField(PikminType pikminType, FieldInfo field, object newValue) { try { field.SetValue(pikminType, newValue); Logger.LogDebug((object)$"Updated {pikminType.PikminName}.{field.Name} to: {newValue}"); } catch (Exception arg) { Logger.LogError((object)$"Failed to update field {field.Name}: {arg}"); } } private static string GetItemArgs(Type type) { if (type == typeof(float)) { return ""; } if (type.IsEnum) { return ""; } return ""; } internal static string SanitizeFileName(string fileName) { char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); char[] array = invalidFileNameChars; foreach (char oldChar in array) { fileName = fileName.Replace(oldChar, '_'); } return fileName; } public static string NormalizeMoonName(string planetName) { if (string.IsNullOrEmpty(planetName)) { return planetName; } if (CleanMoonNames != null && CleanMoonNames.InternalValue) { return Regex.Replace(planetName, "^\\d+[\\s\\-]*", "").Trim(); } return planetName.Trim(); } public static void LoadDefaultMoonConfigs() { GetOrCreateMoonSpawnConfig("Embrion", generateFile: false); GetOrCreateMoonSpawnConfig("Adamance", generateFile: false); GetOrCreateMoonSpawnConfig("Vow", generateFile: false); } public static void LoadDefaultWeatherConfigs() { GetOrCreateWeatherSpawnConfig("Rainy", generateFile: false); GetOrCreateWeatherSpawnConfig("Eclipsed", generateFile: false); } public static MoonSpawnConfig GetOrCreateMoonSpawnConfig(string normalizedMoonName, bool generateFile = true) { if (MoonSpawnConfigs.TryGetValue(normalizedMoonName, out MoonSpawnConfig value)) { if (!generateFile || value.HasConfigFile) { return value; } MoonSpawnConfigs.Remove(normalizedMoonName); } int defaultMaxSpawns = -1; float defaultBaseMultiplier = 1f; List defaultBlockedTypes = null; List defaultAllowedTypes = null; List defaultTypeMultipliers = null; switch (normalizedMoonName.ToLower()) { case "embrion": defaultAllowedTypes = new List { "Rock Pikmin" }; break; case "adamance": defaultBaseMultiplier = 1.5f; break; case "vow": defaultBaseMultiplier = 1.25f; break; case "march": defaultBaseMultiplier = 1.25f; break; } MoonSpawnConfig moonSpawnConfig = new MoonSpawnConfig(normalizedMoonName, generateFile, defaultMaxSpawns, defaultBaseMultiplier, defaultBlockedTypes, defaultAllowedTypes, defaultTypeMultipliers); MoonSpawnConfigs[normalizedMoonName] = moonSpawnConfig; return moonSpawnConfig; } public static void GenerateAllMoonSpawnConfigs() { if ((Object)(object)StartOfRound.Instance == (Object)null) { return; } SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { string text = NormalizeMoonName(val.PlanetName); if (!string.IsNullOrEmpty(text)) { GetOrCreateMoonSpawnConfig(text); } } Logger.LogInfo((object)$"Generated moon spawn config files for {MoonSpawnConfigs.Count} moons."); } public static WeatherSpawnConfig GetOrCreateWeatherSpawnConfig(string weatherName, bool generateFile = true) { if (WeatherSpawnConfigs.TryGetValue(weatherName, out WeatherSpawnConfig value)) { if (!generateFile || value.HasConfigFile) { return value; } WeatherSpawnConfigs.Remove(weatherName); } float defaultBaseMultiplier = 1f; List defaultTypeMultipliers = null; if (weatherName.Equals("Rainy", StringComparison.OrdinalIgnoreCase)) { defaultBaseMultiplier = 1.25f; } if (weatherName.Equals("Eclipsed", StringComparison.OrdinalIgnoreCase)) { defaultBaseMultiplier = 0.5f; } WeatherSpawnConfig weatherSpawnConfig = new WeatherSpawnConfig(weatherName, generateFile, defaultBaseMultiplier, defaultTypeMultipliers); WeatherSpawnConfigs[weatherName] = weatherSpawnConfig; return weatherSpawnConfig; } public static void GenerateAllWeatherSpawnConfigs() { string[] names = Enum.GetNames(typeof(LevelWeatherType)); foreach (string weatherName in names) { GetOrCreateWeatherSpawnConfig(weatherName); } Logger.LogInfo((object)$"Generated weather spawn config files for {WeatherSpawnConfigs.Count} weather types."); } public static bool IsDependencyLoaded(string pluginGUID) { return Chainloader.PluginInfos.ContainsKey(pluginGUID); } public static bool GetLeaderViaID(ulong ClientID, out Leader leader) { leader = GetLeaderViaID(ClientID); return (Object)(object)leader != (Object)null; } public static PikminType GetPikminTypeByName(string name) { string name2 = name; return RegisteredPikminTypes.Values.FirstOrDefault((PikminType t) => t.PikminName == name2); } public static PikminType GetPikminTypeByID(int ID) { PikminType value; return RegisteredPikminTypes.TryGetValue(ID, out value) ? value : null; } public static Leader? GetLeaderViaID(ulong ClientID) { foreach (Leader leader in PikminManager.instance.Leaders) { if (((NetworkBehaviour)leader.Controller).OwnerClientId == ClientID && PikChecks.IsPlayerConnected(leader.Controller)) { return leader; } } return null; } public static OnionType GetOnionTypeByID(int ID) { return RegisteredOnionTypes[ID]; } public static bool IsValidPikminTypeID(int ID) { return RegisteredPikminTypes.ContainsKey(ID); } internal void NetcodePatcher() { Type[] typesWithErrorHandling = GetTypesWithErrorHandling(); Type[] array = typesWithErrorHandling; foreach (Type type in array) { try { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { try { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } catch (FileNotFoundException arg) { Logger.LogDebug((object)$"Skipping method {methodInfo.Name} due to missing dependency: {arg}"); } catch (Exception arg2) { Logger.LogWarning((object)$"Error processing method {methodInfo.Name}: {arg2}"); } } } catch (Exception arg3) { Logger.LogWarning((object)$"Error processing type {type.FullName}: {arg3}"); } } } 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.LethalMin"); } Logger.LogDebug((object)"Patching..."); try { Type[] typesWithErrorHandling = GetTypesWithErrorHandling(); Type[] array = typesWithErrorHandling; foreach (Type type in array) { if (type.Namespace == "LethalMin.Library") { LibraryTypes.Add(type); continue; } if (type.Namespace == "LethalMin.ConfigPatches") { ConfigPatchTypes.Add(type); continue; } CompatClassAttribute customAttribute = type.GetCustomAttribute(); if (customAttribute != null) { string modGUID = customAttribute.ModGUID; if (!IsDependencyLoaded(modGUID)) { continue; } Logger.LogMessage((object)(modGUID + " detected, Patching " + type.FullName)); } try { Harmony.PatchAll(type); } catch (Exception ex) { Logger.LogError((object)$"Error patching type {type.FullName}: {ex}"); if (ex.InnerException != null) { Logger.LogError((object)("Inner exception: " + ex.InnerException.Message)); } } } } catch (Exception ex2) { Logger.LogError((object)$"Error during patching process: {ex2}"); if (ex2.InnerException != null) { Logger.LogError((object)("Inner exception: " + ex2.InnerException.Message)); } } Logger.LogDebug((object)"Finished patching!"); } internal static void PatchConfigPatches() { Logger.LogDebug((object)"Patching config-conditional patches..."); foreach (Type configPatchType in ConfigPatchTypes) { bool flag = false; if (configPatchType == typeof(ShotgunItemPatch)) { flag = PatchShotGunArraySize; if (!flag) { Logger.LogDebug((object)("Skipping " + configPatchType.FullName + ": no shotgun exclusion configs are enabled")); continue; } } else { flag = true; } if (!flag) { continue; } try { Harmony? harmony = Harmony; if (harmony != null) { harmony.PatchAll(configPatchType); } Logger.LogDebug((object)("Patched config patch: " + configPatchType.FullName)); } catch (Exception ex) { Logger.LogError((object)$"Error patching config patch type {configPatchType.FullName}: {ex}"); if (ex.InnerException != null) { Logger.LogError((object)("Inner exception: " + ex.InnerException.Message)); } } } Logger.LogDebug((object)"Finished patching config-conditional patches!"); } public static void PatchLibraryTypes() { Logger.LogMessage((object)"LethalMin Recived Library Call! Patching Library Types..."); foreach (Type libraryType in LibraryTypes) { try { Harmony? harmony = Harmony; if (harmony != null) { harmony.PatchAll(libraryType); } } catch (Exception ex) { Logger.LogError((object)$"Error patching type {libraryType.FullName}: {ex}"); if (ex.InnerException != null) { Logger.LogError((object)("Inner exception: " + ex.InnerException.Message)); } } } } internal static Type[] GetTypesWithErrorHandling() { try { return Assembly.GetExecutingAssembly().GetTypes(); } catch (ReflectionTypeLoadException ex) { Logger.LogWarning((object)"ReflectionTypeLoadException caught while getting types. Some types will be skipped."); Exception[] loaderExceptions = ex.LoaderExceptions; foreach (Exception ex2 in loaderExceptions) { Logger.LogDebug((object)("Loader Exception: " + ex2.Message)); if (ex2 is FileNotFoundException ex3) { Logger.LogDebug((object)("Could not load file: " + ex3.FileName)); } } return ex.Types.Where((Type t) => t != null).ToArray(); } catch (Exception arg) { Logger.LogError((object)$"Unexpected error while getting types: {arg}"); return new Type[0]; } } internal static void Unpatch() { Logger.LogDebug((object)"Unpatching..."); Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } Logger.LogDebug((object)"Finished unpatching!"); } public void BindConfigs() { //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_137f: Unknown result type (might be due to invalid IL or missing references) //IL_13b3: Unknown result type (might be due to invalid IL or missing references) //IL_14b5: Unknown result type (might be due to invalid IL or missing references) //IL_14e9: Unknown result type (might be due to invalid IL or missing references) UseCommasInVectorConfigs = ((BaseUnityPlugin)this).Config.Bind("Advanced", "Use Commas In Vector Configs", false, "Whether or not to use commas in vector configs (true = x,y,z | false = x y z)"); MaxPikmin = new ConfigItem("General", "Max Pikmin", 100, "The maximun ammount of pikmin that can be spawned in at once before being despawned or sent to the onion", needsRestart: false, ConfigItemAuthority.Host); FriendlyFire = new ConfigItem("General", "Friendly Fire", defaultValue: false, "Allows for leaders to kill pikmin in their squad", needsRestart: false, ConfigItemAuthority.Client); FriendlyerFire = new ConfigItem("General", "Friendlyer Fire", defaultValue: true, "Allows for leaders to kill pikmin that are not in their squad", needsRestart: false, ConfigItemAuthority.Client); SkipPluckAnimation = new ConfigItem("General", "Skip Pluck Animation", defaultValue: false, "Skip the player's pluck animation when plucking a pikmin", needsRestart: false, ConfigItemAuthority.Client); SkipPluckAnimation.OnValueChanged += delegate { UpdateSyncedConfigs(); }; WhistleVolume = new ConfigItem("General", "Whistle Volume", 1f, "The volume of the whistle sound effect (0.0 - 1.0)", needsRestart: false, ConfigItemAuthority.Local, "slider(0,1)"); AllowOnionsToRevivePlayers = new ConfigItem("General", "Allow Onions To Revive Players", defaultValue: true, "Allow onions to revive players when they are killed", needsRestart: false, ConfigItemAuthority.Host); AllowOnionToReviveMaskeds = new ConfigItem("General", "Allow Onions To Revive Masked Players", defaultValue: true, "Allow onions to revive masked players when they are killed", needsRestart: false, ConfigItemAuthority.Host); AllowOnionFusing = new ConfigItem("General", "Allow Onion Fusing", defaultValue: true, "Allow onions to fuse together after a round", needsRestart: false, ConfigItemAuthority.Host); ConvertEnemyBodiesToItems = new ConfigItem("General", "Convert Enemy Bodies To Items", defaultValue: true, "Convert enemy bodies to items for pikmin to take to the onion", needsRestart: false, ConfigItemAuthority.Client); ShowOnionsInSpace = new ConfigItem("General", "Show Onions In Space", defaultValue: true, "Show onions next to the ship in space when in space (requires ship windows mod)", needsRestart: false, ConfigItemAuthority.Local); SpaceOnionPosition = new ConfigItem("General", "Space Onion Position", new Vector3(-5f, 0f, 20f), "The position of the onion in space", needsRestart: false, ConfigItemAuthority.Local); DontUpdateSpaceOnionPosition = new ConfigItem("General", "Dont Update Space Onion Position", defaultValue: false, "Used for debugging, dont lock the space onion position's to the config position", needsRestart: false, ConfigItemAuthority.Local); MakeItemsScanable = new ConfigItem("General", "Make Items Scanable", defaultValue: true, "Makes pikmin items scanable", needsRestart: false, ConfigItemAuthority.Local); MakePikminScanable = new ConfigItem("General", "Make Pikmin Scanable", defaultValue: true, "Makes pikmin scanable", needsRestart: false, ConfigItemAuthority.Local); MakeSproutsScanable = new ConfigItem("General", "Make Sprouts Scanable", defaultValue: true, "Makes sprouts scanable", needsRestart: false, ConfigItemAuthority.Local); TriggerLandmines = new ConfigItem("General", "Trigger Landmines", defaultValue: true, "Make pikmin trigger landmines", needsRestart: false, ConfigItemAuthority.Local); GlobalGhostSFX = new ConfigItem("General", "Global Ghost SFX", defaultValue: true, "When true, you will be able to hear Pikmin Ghosts no matter where you are on the moon.", needsRestart: false, ConfigItemAuthority.Local); HideResultsWhenMoreThanFour = new ConfigItem("General", "Hide Custom Reports With More Players", defaultValue: true, "Hide the Pikmin raised counters for every player when there are more than four players in the game. To prevent names from being covered.", needsRestart: false, ConfigItemAuthority.Local); DieInPlayerDeathZone = new ConfigItem("General", "Pikmin Die In Player Death Zones", defaultValue: false, "Makes it so pikmin dies when enter death zones that kill players. For example the catwalk jump pit.", needsRestart: false, ConfigItemAuthority.Client); TakeItemsFromPikmin = new ConfigItem("General", "Take Items From Pikmin", defaultValue: false, "Allows players to take items from pikmin", needsRestart: false, ConfigItemAuthority.Client); TeleportAroundPlayerWhenEnteringBuilding = new ConfigItem("General", "Teleport Pikmin Around Player When Entering Building", defaultValue: true, "Teleports pikmin around the player when entering the building to reduce lag when entering", needsRestart: false, ConfigItemAuthority.Client); PatchShotGunArraySize = new ConfigItem("General", "Patch Shotgun Array Size", defaultValue: true, "Patches the size of the shotgun array to prevent pikmin from absorbing shotgun shots. Disable this if you are using another mod that also patches the shotgun array size", needsRestart: false, ConfigItemAuthority.Local); PikminScale = new ConfigItem("Appearances", "Pikmin Scale", 1f, "The scale of the pikmin", needsRestart: false, ConfigItemAuthority.Local); SproutScale = new ConfigItem("Appearances", "Sprout Scale", 1f, "The scale of the sprout", needsRestart: false, ConfigItemAuthority.Local); CurWhistPack = new ConfigItem("Appearances", "Whistle Sound Index", 0, "press ] while holding a whistle to cycle through the available sounds (0-3)", needsRestart: false, ConfigItemAuthority.Client); BigEyesEnabled = new ConfigItem("Appearances", "Big Eyes Enabled", defaultValue: false, "Enables the Big Eyes from the HeyPikmin generation.", needsRestart: false, ConfigItemAuthority.Local); BigEyesEnabled.OnValueChanged += delegate { UpdateCurrentGeneration(1, ref PikminModelGeneration); }; BigEyesEnabled.OnValueChanged += delegate { UpdateCurrentGeneration(7, ref PuffminGeneration); }; PikminScanNodeColorType = new ConfigItem("Appearances", "Pikmin Scan Node Color Type", PikminScanNodeProperties.ScanNodeType.Enemy, "The type of color to use for the scan node (Point of Intrest: Blue, Enemy: Red, Item: Green)", needsRestart: false, ConfigItemAuthority.Local); PikminSproutScanNodeColorType = new ConfigItem("Appearances", "Pikmin Sprout Scan Node Color Type", PikminScanNodeProperties.ScanNodeType.Enemy, "The type of color to use for the scan node (Point of Intrest: Blue, Enemy: Red, Item: Green)", needsRestart: false, ConfigItemAuthority.Local); DefaultGeneration = new ConfigItem("Generations", "Default Generation", PikminGeneration.Pikmin4, "The default generation to use when no specific generation is set", needsRestart: false, ConfigItemAuthority.Local); DefaultGeneration.OnValueChanged += delegate { UpdateDefaultGeneration(); }; PikminModelGeneration = new ConfigItem("Generations", "Pikmin Model Generation", CfgPikminGeneration.Default, "The generation to use for Pikmin models", needsRestart: false, ConfigItemAuthority.Local); PikminModelGeneration.OnValueChanged += delegate { UpdateCurrentGeneration(1, ref PikminModelGeneration); }; SproutModelGeneration = new ConfigItem("Generations", "Sprout Model Generation", CfgPikminGeneration.Default, "The generation to use for Sprout models", needsRestart: false, ConfigItemAuthority.Local); SproutModelGeneration.OnValueChanged += delegate { UpdateCurrentGeneration(2, ref SproutModelGeneration); }; PikminSoundGeneration = new ConfigItem("Generations", "Pikmin Sound Generation", CfgPikminGeneration.Default, "The generation to use for Pikmin sounds", needsRestart: false, ConfigItemAuthority.Local); PikminSoundGeneration.OnValueChanged += delegate { UpdateCurrentGeneration(3, ref PikminSoundGeneration); }; SoulSpriteGeneration = new ConfigItem("Generations", "Soul Sprite Generation", CfgPikminGeneration.Default, "The generation to use for Pikmin Souls", needsRestart: false, ConfigItemAuthority.Local); SoulSpriteGeneration.OnValueChanged += delegate { UpdateCurrentGeneration(4, ref SoulSpriteGeneration); }; OnionModelGeneration = new ConfigItem("Generations", "Onion Model Generation", CfgPikminGeneration.Default, "The generation to use for Onion models", needsRestart: false, ConfigItemAuthority.Local); OnionModelGeneration.OnValueChanged += delegate { UpdateCurrentGeneration(5, ref OnionModelGeneration); }; OnionItemModelGeneration = new ConfigItem("Generations", "Onion Item Model Generation", CfgPikminGeneration.Default, "The generation to use for Onion Item models", needsRestart: false, ConfigItemAuthority.Local); OnionItemModelGeneration.OnValueChanged += delegate { UpdateCurrentGeneration(6, ref OnionItemModelGeneration); }; PuffminGeneration = new ConfigItem("Generations", "Puffmin Generation", CfgPikminGeneration.Default, "The generation to use for Puffmin Models", needsRestart: false, ConfigItemAuthority.Local); PuffminGeneration.OnValueChanged += delegate { UpdateCurrentGeneration(7, ref PuffminGeneration); }; ThrowAction = new ConfigItem("Controls", "Throw Button", "/r", "", needsRestart: true, ConfigItemAuthority.Local); ThrowCancelAction = new ConfigItem("Controls", "Throw Cancel Button", "/q", "", needsRestart: true, ConfigItemAuthority.Local); SwitchForwardAction = new ConfigItem("Controls", "Switch Forward Button", "/3", "", needsRestart: true, ConfigItemAuthority.Local); SwitchBackwawrdsAction = new ConfigItem("Controls", "Switch Backwards Button (hold)", "/2", "", needsRestart: true, ConfigItemAuthority.Local); WhisleAction = new ConfigItem("Controls", "Whistle Button", "/leftButton", "", needsRestart: true, ConfigItemAuthority.Local); DismissAction = new ConfigItem("Controls", "Dismiss Button", "/middleButton", "", needsRestart: true, ConfigItemAuthority.Local); SwitchWhistleSoundAction = new ConfigItem("Controls", "Switch Whistle Sound Button", "/]", "", needsRestart: true, ConfigItemAuthority.Local); ChargeAction = new ConfigItem("Controls", "Charge Button", "/4", "", needsRestart: true, ConfigItemAuthority.Local); GlowmobAction = new ConfigItem("Controls", "Glowmob Button (hold)", "/4", "", needsRestart: true, ConfigItemAuthority.Local); OnionHudSpeedAction = new ConfigItem("Controls", "Onion Menu 10-withdraw Button", "/shift", "", needsRestart: true, ConfigItemAuthority.Local); IndoorSpawnChance = new ConfigItem("Spawning", "Indoor Pikmin Spawn Chance", 0.05f, "The odds for pikmin that spawn inside to spawn", needsRestart: false, ConfigItemAuthority.Host, "slider(0,1)"); OutdoorSpawnChance = new ConfigItem("Spawning", "Outdoor Pikmin Spawn Chance", 0.35f, "The odds for pikmin that spawn outside to spawn", needsRestart: false, ConfigItemAuthority.Host, "slider(0,1)"); OnionSpawnChance = new ConfigItem("Spawning", "Onion Spawn Chance", 0.45f, "The odds for an onion to spawn", needsRestart: false, ConfigItemAuthority.Host, "slider(0,1)"); UseBetaOnionSpawnSystem = new ConfigItem("Spawning", "Use Beta Onion Spawn System", defaultValue: false, "Instead of calculating a spawn center and offsetting, onions are placed at the Nth closest valid outdoor AI node to the ship (1st onion = closest valid node, 2nd onion = next closest, etc.). Avoids clipping into the ship or spawning on rocks.", needsRestart: false, ConfigItemAuthority.Host); AvoidWaterForOnionSpawning = new ConfigItem("Spawning", "Avoid Water For Onion Spawning", defaultValue: true, "When enabled, onion spawn node candidates that sit inside a water trigger are filtered out. Has no effect on Flooded weather moons. Falls back to all nodes if no dry candidates remain.", needsRestart: false, ConfigItemAuthority.Host); AvoidBehindShipForOnionSpawning = new ConfigItem("Spawning", "Avoid Behind-Ship Locations For Onion Spawning", defaultValue: true, "When enabled, onion spawn node candidates that are behind the ship relative to the sun's direction are filtered out. Falls back to all nodes if no non-behind candidates remain.", needsRestart: false, ConfigItemAuthority.Host); UseLCSpawnSystem = new ConfigItem("Spawning", "Use LC Spawn System", defaultValue: true, "Have Pikmin be spawnable using LC's spawning system, the will result on rare occasition for pikmin to randomly spawn on the map", needsRestart: false, ConfigItemAuthority.Host); UsePowerLVForSprouts = new ConfigItem("Spawning", "Use Power Level For Sprouts", defaultValue: false, "Use the Power Level of a moon to determine sprout count (overrides SpawnChance configs for sprout spawning pikmin)", needsRestart: false, ConfigItemAuthority.Host, "slider(0,1)"); EnableTypeSpawnFalloff = new ConfigItem("Spawning", "Enable Wild Spawn Falloff", defaultValue: true, "When enabled, wild pikmin spawn rates are reduced based on how many of that type are stored in onions. Types without an associated onion are not affected (bulbmin) and may benefit from group spawning instead.", needsRestart: false, ConfigItemAuthority.Host); TypeSpawnFalloffMaxCount = new ConfigItem("Spawning", "Wild Spawn Falloff Max Count", 100, "The number of pikmin of a given type stored in onions at which the falloff reaches 1.0 (that type stops spawning in the wild entirely). Values below this scale proportionally.", needsRestart: false, ConfigItemAuthority.Host); TypeSpawnFalloffExponent = new ConfigItem("Spawning", "Wild Spawn Falloff Exponent", 1f, "Controls the falloff curve shape. 1.0 = linear (25 stored → 0.25 falloff), values below 1 make falloff kick in faster, values above 1 make it kick in slower.", needsRestart: false, ConfigItemAuthority.Host, "slider(0.1,3)"); NoOnionGroupSpawnThreshold = new ConfigItem("Spawning", "No-Onion Group Spawn Threshold", 0.5f, "When the average falloff of indoor (or outdoor) onion-holding pikmin types reaches this value, pikmin types without onions (bulbmin) that have CanGroupSpawnWhenFalloffHigh enabled may spawn in groups.", needsRestart: false, ConfigItemAuthority.Host, "slider(0,1)"); ScaleTypeSpawnAmountBySuppressedTypes = new ConfigItem("Spawning", "Scale Wild Spawn Amount By Suppressed Types", defaultValue: true, "When enabled, total wild map spawn volume scales down as more onion-backed pikmin types reach high falloff. This helps avoid late-game over-abundance of a single low-falloff type.", needsRestart: false, ConfigItemAuthority.Host); SuppressedTypeFalloffThreshold = new ConfigItem("Spawning", "Suppressed Type Falloff Threshold", 1f, "A type won't spawn when its current falloff is at or above this value. Total wild spawn amount is scaled separately by the average falloff.", needsRestart: false, ConfigItemAuthority.Host, "slider(0,1)"); OutdoorSpawnAmountScaleAtMaxSuppressed = new ConfigItem("Spawning", "Outdoor Spawn Amount Scale At Max Suppressed Types", 0.25f, "Multiplier applied to outdoor map-spawn volume when all onion-backed outdoor types are suppressed. Example: 0.25 means roughly 40 becomes 10.", needsRestart: false, ConfigItemAuthority.Host, "slider(0.05,1)"); IndoorSpawnAmountScaleAtMaxSuppressed = new ConfigItem("Spawning", "Indoor Spawn Amount Scale At Max Suppressed Types", 1f, "Multiplier applied to indoor map-spawn volume when the average falloff of indoor onion-backed types reaches 1.0. Keep at 1.0 to leave indoor/no-onion types effectively unchanged.", needsRestart: false, ConfigItemAuthority.Host, "slider(0.05,1)"); RandomizeByDay = new ConfigItem("Spawning", "Randomize By Day", defaultValue: false, "When enabled, the pikmin that are spawned by things other than the mod (LC itself or Imperium) the random type selected will be the ones available on the current day.", needsRestart: false, ConfigItemAuthority.Host); AttackBlacklistConfig = new ConfigItem>("Pikmin Behavior", "Attack Blacklist", new List { "Docile Locust Bees", "Manticoil", "Red Locust Bees", "Blob", "Nemo", "InternNPC", "BellCrab", "Nancy", "Transporter", "Janior", "Peace Keeper", "Guardsman", "Tornado", "FireStorm", "Hurricane", "Cabinet" }, "The list of enemy names that pikmin won't attack", needsRestart: true, ConfigItemAuthority.Client); ItemBlacklistConfig = new ConfigItem>("Pikmin Behavior", "Item Blacklist", new List(), "The list of item names that pikmin won't pick up", needsRestart: true, ConfigItemAuthority.Client); EnemyBodyConvertBlacklistConfig = new ConfigItem>("Pikmin Behavior", "Enemy Body Convert Blacklist", new List { "Flowerman", "GiantKiwi" }, "The list of enemy names that the mod won't convert into items", needsRestart: true, ConfigItemAuthority.Host); UseExitsWhenCarryingItems = new ConfigItem("Pikmin Behavior", "Use Exits When Carrying Items", defaultValue: true, "Whether or not Pikmin can path outside directly to the ship when inside, or just leave it at an exit when inside", needsRestart: false, ConfigItemAuthority.Client); PikminFollowMode = new ConfigItem("Pikmin Behavior", "Follow Mode", PfollowMode.LegacyBehind, "The way pikmin follow their leader.\r\n New: Makes the pikmin follow the leader in a formation simular to the pikmin games\r\n LegacyBehind: Makes the pikmin looesly follow the leader\r\n LegacyFollow: Makes the pikmin path directly to the leader (can be buggy)", needsRestart: false, ConfigItemAuthority.Client); PikminFollowMode.OnValueChanged += delegate { SetFollowMode(); }; PikminDontCollideWhenInElevator = new ConfigItem("Pikmin Behavior", "Dont collide with other pikmin in elevators", defaultValue: true, "Makes it so pikmin won't colide with each other and cause lag when pathing to their leader in the elevator", needsRestart: false, ConfigItemAuthority.Client); TimeFallingFailSafe = new ConfigItem("Pikmin Behavior", "Time Falling Fail Safe", 10f, "The time it takes for a pikmin to be concitered falling infintly and teleport back into bounds", needsRestart: false, ConfigItemAuthority.Client); CarryNonScrapItemsToCompany = new ConfigItem("Pikmin Behavior", "Carry Non-Scrap Items To Company", defaultValue: false, "Makes it so pikmin carry Non-Scrap items (Flashlights, Keys, etc.) to the company counter instead of the ship", needsRestart: false, ConfigItemAuthority.Client); IgnoreNonScrapItemsToCompany = new ConfigItem("Pikmin Behavior", "Ignore Non-Scrap Items On Company", defaultValue: false, "Makes it so pikmin ignore Non-Scrap items (Flashlights, Keys, etc.) on the company entirely", needsRestart: false, ConfigItemAuthority.Client); TakeItemsToOnionOnCompany = new ConfigItem("Pikmin Behavior", "Take Items To Onion On Company", defaultValue: true, "Whether or not items can be taken to the onion on company", needsRestart: false, ConfigItemAuthority.Client); TakeItemsToTheCar = new ConfigItem("Pikmin Behavior", "Take Items To The Car", defaultValue: true, "Whether or not Pikmin can take items to the car", needsRestart: false, ConfigItemAuthority.Client); TakeItemsToTheOnion = new ConfigItem("Pikmin Behavior", "Take Items To The Onion", defaultValue: true, "Whether or not Pikmin can take items to the onion", needsRestart: true, ConfigItemAuthority.Client); DisperseWhenDismissed = new ConfigItem("Pikmin Behavior", "Disperse When Dismissed", defaultValue: false, "Whether or not Pikmin disperse into groups when dismissed", needsRestart: false, ConfigItemAuthority.Client); AllowOnBBtobeGrabed = new ConfigItem("Pikmin Behavior", "Allow On BoomBox to be Grabbed", defaultValue: false, "Allows Pikmin to grab the boombox when it is on", needsRestart: false, ConfigItemAuthority.Client); DismissWindownTime = new ConfigItem("Pikmin Behavior", "Dismiss Windown Time", 2f, "The ammount of seconds to wait before pikmin can be assigned a leader again after being dismissed", needsRestart: false, ConfigItemAuthority.Client); NonWaterResistantAvoidWater = new ConfigItem("Pikmin Behavior", "Non-Water Resistant Pikmin Avoid Water", defaultValue: false, "Whether or not non-water resistant pikmin avoid water when pathing has no effect on flooded moons", needsRestart: false, ConfigItemAuthority.Client); WildPikminCarry = new ConfigItem("Pikmin Behavior", "Wild Pikmin Can Carry Items", defaultValue: false, "Whether or not wild pikmin can carry items", needsRestart: false, ConfigItemAuthority.Host); WildPikminAttack = new ConfigItem("Pikmin Behavior", "Wild Pikmin Can Attack Enemies", defaultValue: true, "Whether or not wild pikmin can attack enemies", needsRestart: false, ConfigItemAuthority.Host); WildPikminAttackDamage = new ConfigItem("Pikmin Behavior", "Wild Pikmin Attack Does Damage", defaultValue: false, "Whether or not wild pikmin's attacks do damage", needsRestart: false, ConfigItemAuthority.Host); WildPikminNoDeath = new ConfigItem("Pikmin Behavior", "Wild Pikmin Dont Die", defaultValue: true, "Whether or not wild pikmin can die", needsRestart: false, ConfigItemAuthority.Host); UseConfigsForEnemies = new ConfigItem("Enemy Behavior", "Use Enemy Configs", defaultValue: false, "Enables the use of enemy configs", needsRestart: false, ConfigItemAuthority.Client); ClaySurgeon_SnipCooldown = new ConfigItem("Enemy Behavior", "Barber Snip Cooldown", 1f, "How long the Barber waits between snipping Pikmin (in seconds)", needsRestart: false, ConfigItemAuthority.Client); ClaySurgeon_SnipLimit = new ConfigItem("Enemy Behavior", "Barber Snip Limit", 3, "Maximum number of Pikmin that can be snipped by a Barber at once", needsRestart: false, ConfigItemAuthority.Client); Crawler_BiteCooldown = new ConfigItem("Enemy Behavior", "Thumper Bite Cooldown", 2f, "How long the Thumper waits between biting Pikmin (in seconds)", needsRestart: false, ConfigItemAuthority.Client); Crawler_BiteLimit = new ConfigItem("Enemy Behavior", "Thumper Bite Limit", 3, "Maximum number of Pikmin that can be bitten by a Thumper at once", needsRestart: false, ConfigItemAuthority.Client); SandSpider_BiteCooldown = new ConfigItem("Enemy Behavior", "Bunker Spider Bite Cooldown", 3.5f, "How long the Bunker Spider waits between biting Pikmin (in seconds)", needsRestart: false, ConfigItemAuthority.Client); SandSpider_BiteLimit = new ConfigItem("Enemy Behavior", "Bunker Spider Bite Limit", 2, "Maximum number of Pikmin that can be bitten by a Bunker Spider at once", needsRestart: false, ConfigItemAuthority.Client); HoarderBug_BiteCooldown = new ConfigItem("Enemy Behavior", "Hoarding Bug Bite Cooldown", 3f, "How long the Hoarding Bug waits between biting Pikmin (in seconds)", needsRestart: false, ConfigItemAuthority.Client); HoarderBug_BiteLimit = new ConfigItem("Enemy Behavior", "Hoarding Bug Bite Limit", 1, "Maximum number of Pikmin that can be bitten by a Hoarding Bug at once", needsRestart: false, ConfigItemAuthority.Client); HoarderBug_AggroWhenPikminTakesItem = new ConfigItem("Enemy Behavior", "Hoarding Bug Aggro When Item Taken", defaultValue: true, "Whether Hoarding Bugs becomes aggressive when Pikmin take their items", needsRestart: false, ConfigItemAuthority.Client); MouthDog_BiteCooldown = new ConfigItem("Enemy Behavior", "Eyeless Dog Bite Cooldown", 5.5f, "How long the Eyeless Dog waits between biting Pikmin (in seconds)", needsRestart: false, ConfigItemAuthority.Client); MouthDog_BiteLimit = new ConfigItem("Enemy Behavior", "Eyeless Dog Bite Limit", 7, "Maximum number of Pikmin that can be bitten by a Eyeless Dog at once", needsRestart: false, ConfigItemAuthority.Client); Blob_TrapPikmin = new ConfigItem("Enemy Behavior", "Hydrogere Traps Pikmin", defaultValue: true, "Whether the Hydrogere can trap Pikmin inside it", needsRestart: false, ConfigItemAuthority.Client); Blob_KillPikmin = new ConfigItem("Enemy Behavior", "Hydrogere Kills Pikmin", defaultValue: false, "Whether the Hydrogere can kill trapped Pikmin", needsRestart: false, ConfigItemAuthority.Client); RedLocustBees_ZapCooldown = new ConfigItem("Enemy Behavior", "Circuit Bees Zap Cooldown", 0.25f, "How long the Circuit Bees wait between zapping Pikmin (in seconds)", needsRestart: false, ConfigItemAuthority.Client); RedLocustBees_ZapPikmin = new ConfigItem("Enemy Behavior", "Circuit Bees Zap Pikmin", defaultValue: true, "Whether Circuit Bees can zap Pikmin", needsRestart: false, ConfigItemAuthority.Client); RedLocustBees_KillPikmin = new ConfigItem("Enemy Behavior", "Circuit Bees Kill Pikmin", defaultValue: false, "Whether Circuit Bees can kill Pikmin", needsRestart: false, ConfigItemAuthority.Client); CaveDweller_BiteCooldown = new ConfigItem("Enemy Behavior", "Maneater Bite Cooldown", 1f, "How long the Maneater waits between biting Pikmin (in seconds)", needsRestart: false, ConfigItemAuthority.Client); CaveDweller_BiteLimit = new ConfigItem("Enemy Behavior", "Maneater Bite Limit", 7, "Maximum number of Pikmin that can be bitten by a Maneater at once", needsRestart: false, ConfigItemAuthority.Client); CaveDweller_AllowCarry = new ConfigItem("Enemy Behavior", "Maneater Allow Carry", defaultValue: true, "Whether the Maneater can be carried by Pikmin", needsRestart: false, ConfigItemAuthority.Client); CaveDweller_AttackAsBaby = new ConfigItem("Enemy Behavior", "Maneater Attack As Baby", defaultValue: false, "Whether the Pikmin can attack the Maneater as a baby", needsRestart: false, ConfigItemAuthority.Client); RadMech_GrabLimmit = new ConfigItem("Enemy Behavior", "Old Bird Grab Limit", 10, "Maximum number of Pikmin that can be grabbed by a Old Bird at once", needsRestart: false, ConfigItemAuthority.Client); RadMech_GrabsPikmin = new ConfigItem("Enemy Behavior", "Old Bird Grabs Pikmin", defaultValue: true, "Whether the Old Bird can grab and torch Pikmin", needsRestart: false, ConfigItemAuthority.Client); ForestGiant_GrabLimit = new ConfigItem("Enemy Behavior", "Forest Keeper Grab Limit", 25, "Maximum number of Pikmin that can be grabbed by a Forest Keeper at once", needsRestart: false, ConfigItemAuthority.Client); ForestGiant_GrabsPikmin = new ConfigItem("Enemy Behavior", "Forest Keeper Grabs Pikmin", defaultValue: true, "Whether the Forest Keeper can grab and eat Pikmin", needsRestart: false, ConfigItemAuthority.Client); Jester_BiteCooldown = new ConfigItem("Enemy Behavior", "Jester Bite Cooldown", 5f, "How long the Jester waits between biting Pikmin (in seconds)", needsRestart: false, ConfigItemAuthority.Client); Jester_BiteLimit = new ConfigItem("Enemy Behavior", "Jester Bite Limit", 10, "Maximum number of Pikmin that can be bitten by a Jester at once", needsRestart: false, ConfigItemAuthority.Client); ButlerEnemy_StabCooldown = new ConfigItem("Enemy Behavior", "Butler Stab Cooldown", 1f, "How long the Butler waits between stabbing Pikmin (in seconds)", needsRestart: false, ConfigItemAuthority.Client); ButlerEnemy_StabLimit = new ConfigItem("Enemy Behavior", "Butler Stab Limit", 1, "Maximum number of Pikmin that can be stabbed by a Butler at once", needsRestart: false, ConfigItemAuthority.Client); BaboonBird_BiteCooldown = new ConfigItem("Enemy Behavior", "Baboon Hawk Bite Cooldown", 1.5f, "How long the Baboon Hawk waits between biting Pikmin (in seconds)", needsRestart: false, ConfigItemAuthority.Client); Puma_HurtsPikmin = new ConfigItem("Enemy Behavior", "Feiopar Scratches Pikmin", defaultValue: true, "Whether Feiopar scratch attacks can damage Pikmin", needsRestart: false, ConfigItemAuthority.Client); MaskedPlayerEnemy_ConvertPikmin = new ConfigItem("Enemy Behavior", "Masked Player Enemy Convert Pikmin", defaultValue: true, "Whether the Masked Player Enemy can convert Pikmin into Puffmin", needsRestart: false, ConfigItemAuthority.Client); Puffer_CanPoisonPikmin = new ConfigItem("Enemy Behavior", "Puffer Can Poison Pikmin", defaultValue: true, "Whether the Puffer's smoke can poison Pikmin", needsRestart: false, ConfigItemAuthority.Client); Company_GrabsPikmin = new ConfigItem("Enemy Behavior", "Company Grabs Pikmin", defaultValue: true, "Whether the Company can grab and eat Pikmin", needsRestart: false, ConfigItemAuthority.Client); Company_HearsPikmin = new ConfigItem("Enemy Behavior", "Company Hears Pikmin", defaultValue: false, "Makes it so any sound the pikmin make will agro the company", needsRestart: false, ConfigItemAuthority.Client); Stingray_HeavyCarriersCanTriggerSpit = new ConfigItem("Enemy Behavior", "Backwater Gunkfish Carriers Trigger Spit", defaultValue: true, "Whether heavy item-carrying Pikmin groups can trigger the Backwater Gunkfish spit response", needsRestart: false, ConfigItemAuthority.Client); Stingray_CarryStrengthNeededToTriggerSpit = new ConfigItem("Enemy Behavior", "Backwater Gunkfish Spit Trigger Carry Strength", 10, "Minimum item carry strength needed for a nearby carried item to trigger Backwater Gunkfish spit", needsRestart: false, ConfigItemAuthority.Client); Stingray_PikminCanSlipOnSlime = new ConfigItem("Enemy Behavior", "Backwater Gunkfish Slime Makes Pikmin Slip", defaultValue: true, "Whether Pikmin can slip when moving on Backwater Gunkfish slime decals", needsRestart: false, ConfigItemAuthority.Client); TurnToNormalOnDeath = new ConfigItem("Puffmin Behavior", "Turn To Normal On Death", defaultValue: false, "Whether or not Puffmin turn back into normal pikmin when they die", needsRestart: false, ConfigItemAuthority.Host); HUDPreset = new ConfigItem("HUD", "HUD Layout Preset", PikminHUDManager.HUDLayoutPresets.Default, "The layout preset for the Pikmin HUD elements", needsRestart: false, ConfigItemAuthority.Local); HUDPreset.OnValueChanged += delegate { UpdateHUDLayout(); }; PikminSelectionPosition = new ConfigItem("HUD", "Pikmin Selection Position", new Vector3(0f, -120f, 28f), "The position of the Pikmin selection UI element", needsRestart: false, ConfigItemAuthority.Local); PikminSelectionRotation = new ConfigItem("HUD", "Pikmin Selection Rotation", new Vector3(0f, 0f, 0f), "The rotation of the Pikmin selection UI element", needsRestart: false, ConfigItemAuthority.Local); PikminSelectionScale = new ConfigItem("HUD", "Pikmin Selection Scale", 1f, "The scale of the Pikmin selection UI element", needsRestart: false, ConfigItemAuthority.Local); PikminSelectionAlpha = new ConfigItem("HUD", "Pikmin Selection Alpha", 1f, "The alpha or transparency of the Pikmin selection UI element", needsRestart: false, ConfigItemAuthority.Local); EnableCurSlot = new ConfigItem("HUD", "Enable Current Slot", defaultValue: true, "Whether to show the current Pikmin type slot in the HUD", needsRestart: false, ConfigItemAuthority.Local); EnableNextSlot = new ConfigItem("HUD", "Enable Next Slot", defaultValue: true, "Whether to show the next Pikmin type slot in the HUD", needsRestart: false, ConfigItemAuthority.Local); EnablePreviousSlot = new ConfigItem("HUD", "Enable Previous Slot", defaultValue: true, "Whether to show the previous Pikmin type slot in the HUD", needsRestart: false, ConfigItemAuthority.Local); EnableCarouselEffect = new ConfigItem("HUD", "Enable Carousel Effect", defaultValue: true, "When enabled, switching Pikmin types animates the selection frames sliding across the HUD instead of snapping instantly.", needsRestart: false, ConfigItemAuthority.Local); PikminCounterPosition = new ConfigItem("HUD", "Pikmin Counter Position", new Vector3(8f, -225f, 0f), "The position of the Pikmin counter UI element", needsRestart: false, ConfigItemAuthority.Local); PikminCounterRotation = new ConfigItem("HUD", "Pikmin Counter Rotation", new Vector3(0f, 0f, 0f), "The rotation of the Pikmin counter UI element", needsRestart: false, ConfigItemAuthority.Local); PikminCounterScale = new ConfigItem("HUD", "Pikmin Counter Scale", 1f, "The scale of the Pikmin counter UI element", needsRestart: false, ConfigItemAuthority.Local); PikminCounterAlphaActive = new ConfigItem("HUD", "Pikmin Counter Alpha Active", 1f, "The alpha or transparency of the Pikmin counter UI element when active", needsRestart: false, ConfigItemAuthority.Local); PikminCounterAlphaIdle = new ConfigItem("HUD", "Pikmin Counter Alpha Idle", 0.15f, "The alpha or transparency of the Pikmin counter UI element when idle", needsRestart: false, ConfigItemAuthority.Local); EnableInExistanceCounter = new ConfigItem("HUD", "Enable Pikmin In Existence Counter", defaultValue: true, "Whether to show the total number of Pikmin in existence", needsRestart: false, ConfigItemAuthority.Local); EnableInSquadCounter = new ConfigItem("HUD", "Enable Pikmin In Squad Counter", defaultValue: true, "Whether to show the number of Pikmin in your current squad", needsRestart: false, ConfigItemAuthority.Local); EnableInFieldCounter = new ConfigItem("HUD", "Enable Pikmin In Field Counter", defaultValue: true, "Whether to show the number of Pikmin in the field", needsRestart: false, ConfigItemAuthority.Local); HideSelectedWhenScanNotifcation = new ConfigItem("HUD", "Hide Selected When Scan Notification", defaultValue: true, "Whether to hide the selected Pikmin when a scan notification is shown", needsRestart: false, ConfigItemAuthority.Local); DontUpdateHudConfigs = new ConfigItem("HUD", "Dont Update Hud Configs", defaultValue: false, "For Debugging purposes, dont update the hud configs", needsRestart: false, ConfigItemAuthority.Local); GrayoutButtonsInOnionHUD = new ConfigItem("HUD", "Grayout Buttons In Onion HUD", defaultValue: true, "Whether to gray out the buttons in the Onion HUD when there are no pikmin of that type available", needsRestart: false, ConfigItemAuthority.Local); WhistlePriceConfig = new ConfigItem("Items", "Whistle Price", 15, "", needsRestart: true, ConfigItemAuthority.Client); ShipOnionPriceConfig = new ConfigItem("Items", "Ship Onion Price", 251, "", needsRestart: true, ConfigItemAuthority.Client); PluckaPhonePriceConfig = new ConfigItem("Items", "PluckaPhone Price", 150, "", needsRestart: true, ConfigItemAuthority.Client); ShipWhistlePriceConfig = new ConfigItem("Items", "Ship Whistle Price", 100, "", needsRestart: true, ConfigItemAuthority.Client); IsWhistleConductive = new ConfigItem("Items", "Is Whistle Conductive", defaultValue: false, "Makes it so the whistle is conductive to electricity, making it dangerous on stormy moons.", needsRestart: true, ConfigItemAuthority.Client); LumiknullActivateTime = new ConfigItem("Glow Pikmin", "Activate Time", 660f, "The time in seconds it takes for a Lumiknull to activate when a player is nearby", needsRestart: false, ConfigItemAuthority.Host); LumiknullActivateDistance = new ConfigItem("Glow Pikmin", "Activate Distance", 20f, "The distance in meters at which a Lumiknull will detect and activate when a player approaches", needsRestart: false, ConfigItemAuthority.Host); LumiknullSpawnChance = new ConfigItem("Glow Pikmin", "Spawn Chance", 0.45f, "The chance of a Lumiknull spawning on applicable moons", needsRestart: false, ConfigItemAuthority.Host, "slider(0,1)"); SpawnLumiknullAfterDays = new ConfigItem("Glow Pikmin", "Spawn After Days", 6, "The number of days that must pass before Lumiknulls can start spawning (-1 = can spawn from day 1)", needsRestart: false, ConfigItemAuthority.Host); GlowOddsToTurnIntoSeed = new ConfigItem("Glow Pikmin", "Odds To Turn Into Seed", 0.3f, "The odds of a glow pikmin turning into a glow seed when leaving", needsRestart: false, ConfigItemAuthority.Host, "slider(0,1)"); GlowsUseableAtCompany = new ConfigItem("Glow Pikmin", "Useable At Company", defaultValue: true, "Whether or not glow pikmin are useable at the company", needsRestart: false, ConfigItemAuthority.Host); AttackOwnTamedEnemies = new ConfigItem("LethalMon", "Attack Own Tamed Enemies", defaultValue: false, "Whether or not pikmin will attack their leader's tammed enemies", needsRestart: false, ConfigItemAuthority.Client); AttackOthersTamedEnemies = new ConfigItem("LethalMon", "Attack Others Tamed Enemies", defaultValue: false, "Whether or not pikmin will attack other player's tammed enemies", needsRestart: false, ConfigItemAuthority.Client); AllowMetalDetectorToZap = new ConfigItem("LC-Office", "Allow Metal Detector To Zap", defaultValue: true, "Allows the metal detector to zap pikmin.", needsRestart: false, ConfigItemAuthority.Client); AddNavLinkToZeranosShip = new ConfigItem("Zeranos", "Add NavLink to the ship on Zeranos", defaultValue: true, "Due to a bug in Zeranos at the time of making LethalMin, Entites cannot enter the ship. This adds a navlink to the ship so that entities can enter it.", needsRestart: true, ConfigItemAuthority.Client); BlockEnemiesFromEnteringZeranosShip = new ConfigItem("Zeranos", "Block Enemies From Entering Zeranos Ship", defaultValue: true, "Blocks enemies (aside from pikmin) from entering the ship on Zeranos. Too keep the bugged functionailty of other entites not being able to enter the ship.", needsRestart: false, ConfigItemAuthority.Client); AddNavLinkToZeranosElevator = new ConfigItem("Zeranos", "Add NavLink to the Elevator on Zeranos", defaultValue: true, "Due to a bug in Zeranos at the time of making LethalMin, Entites cannot exit the elevator after it goes back up. This adds a navlink to the ship so that entities can enter it.", needsRestart: true, ConfigItemAuthority.Client); CR_ACUTargetsPikmin = new ConfigItem("CodeRebirth", "ACU Targets Winged Pikmin", defaultValue: true, "Whether the Air Control Unit targets groups of 3+ Winged Pikmin when no players are around", needsRestart: false, ConfigItemAuthority.Client); CR_BulletKnockbackPikmin = new ConfigItem("CodeRebirth", "ACU Bullet Knockbacks Pikmin", defaultValue: true, "Whether ACU bullets knock back Pikmin on hit", needsRestart: false, ConfigItemAuthority.Client); CR_CraneTargetsPikmin = new ConfigItem("CodeRebirth", "Crane Targets Pikmin", defaultValue: true, "Whether the Autonomous Crane targets groups of 10+ Pikmin when no players are available", needsRestart: false, ConfigItemAuthority.Client); CR_CraneSquishPikmin = new ConfigItem("CodeRebirth", "Crane Squishes Pikmin", defaultValue: true, "Whether the Autonomous Crane can squish Pikmin caught in its kill trigger", needsRestart: false, ConfigItemAuthority.Client); CR_FanKnockbackPikmin = new ConfigItem("CodeRebirth", "Fan Knockbacks Pikmin", defaultValue: true, "Whether the Industrial Fan knocks back Pikmin that stand in front of it for too long", needsRestart: false, ConfigItemAuthority.Client); CR_FanKnockbackStrengthThreshold = new ConfigItem("CodeRebirth", "Fan Knockback Strength Threshold", 2, "Pikmin with a carry strength greater than this value will not be knocked back by the Industrial Fan", needsRestart: false, ConfigItemAuthority.Client); CR_MicrowaveKnockbackPikmin = new ConfigItem("CodeRebirth", "Microwave Knockbacks Pikmin", defaultValue: true, "Whether the Functional Microwave knocks back Pikmin and sets them on fire when it opens", needsRestart: false, ConfigItemAuthority.Client); CR_FlashTurretKnockbackPikmin = new ConfigItem("CodeRebirth", "Flash Turret Knockbacks Pikmin", defaultValue: true, "Whether the Flash Turret knocks back Pikmin caught in its flash", needsRestart: false, ConfigItemAuthority.Client); CR_LaserTurretKillsPikmin = new ConfigItem("CodeRebirth", "Laser Turret Kills Pikmin", defaultValue: true, "Whether the Laser Turret instantly kills Pikmin caught in its laser", needsRestart: false, ConfigItemAuthority.Client); CR_TornadoPullsPikmin = new ConfigItem("CodeRebirth", "Tornado Pulls Pikmin", defaultValue: true, "Whether Tornados pull in Pikmin that are not carrying items", needsRestart: false, ConfigItemAuthority.Client); CR_TornadoPullStrengthThreshold = new ConfigItem("CodeRebirth", "Tornado Pull Strength Threshold", 5, "Pikmin with a carry strength less than this value will be pulled in by Tornados", needsRestart: false, ConfigItemAuthority.Client); CR_TobySquishPikmin = new ConfigItem("CodeRebirth", "Compactor Squishes Pikmin", defaultValue: true, "Pikmin inside of the compactor on Oxyde will get squished when on", needsRestart: false, ConfigItemAuthority.Client); CR_GoToSarahBeforeToby = new ConfigItem("CodeRebirth", "Go to the shredder before compactor", defaultValue: true, "Pikmin take items to be shredded on oxydie before taking them to be compacted", needsRestart: false, ConfigItemAuthority.Client); AutoSetHudVRPreset = new ConfigItem("LCVR", "Auto Set Hud Preset", defaultValue: true, "Whether or not to automatically set the HUD preset for LCVR", needsRestart: true, ConfigItemAuthority.Local); DontUseInputUtilsForVR = new ConfigItem("LCVR", "Dont Use Input Utils For VR", defaultValue: true, "Whether or not to use the InputUtils for VR controls due to a bug at the time of making this mod, LCVR breaks input utils.", needsRestart: false, ConfigItemAuthority.Local); DisableSproutInteraction = new ConfigItem("LCVR", "Disable Sprout Interaction", defaultValue: false, "Whether or not to disable the sprout interaction for LCVR", needsRestart: false, ConfigItemAuthority.Local); DisableWhistleFix = new ConfigItem("LCVR", "Disable Whistle Fix", defaultValue: false, "Whether or not to disable the whistle fix for LCVR", needsRestart: false, ConfigItemAuthority.Client); OnionHUDZDistance = new ConfigItem("LCVR", "Onion HUD Z Distance", 100f, "The Z distance of the onion HUD", needsRestart: false, ConfigItemAuthority.Local); ThrowVRAction = new ConfigItem("LCVR", "Throw Button", "{RightHand}/triggerPressed", "", needsRestart: true, ConfigItemAuthority.Local); SecondaryThrowVRAction = new ConfigItem("LCVR", "Secondary Throw Button", "{RightHand}/gripPressed", "", needsRestart: true, ConfigItemAuthority.Local); SwitchForwardVRAction = new ConfigItem("LCVR", "Switch Forward Button", "{LeftHand}/secondaryButton", "", needsRestart: true, ConfigItemAuthority.Local); SwitchBackwawrdsVRAction = new ConfigItem("LCVR", "Switch Backwards Button", "", "", needsRestart: true, ConfigItemAuthority.Local); WhisleVRAction = new ConfigItem("LCVR", "Whistle Button", "{RightHand}/triggerPressed", "", needsRestart: true, ConfigItemAuthority.Local); UseMouthTriggerForWhistle = new ConfigItem("LCVR", "Use Mouth to Dismiss", defaultValue: true, "Makes it so you have to bring the whistle to your mouth and press the dismiss button to dismiss", needsRestart: true, ConfigItemAuthority.Local); DismissVRAction = new ConfigItem("LCVR", "Dismiss Button", "{RightHand}/gripPressed", "", needsRestart: true, ConfigItemAuthority.Local); SwitchWhistleSoundVRAction = new ConfigItem("LCVR", "Switch Whistle Sound Button", "", "", needsRestart: true, ConfigItemAuthority.Local); ChargeVRAction = new ConfigItem("LCVR", "Charge Button", "{RightHand}/gripPressed", "", needsRestart: true, ConfigItemAuthority.Local); SecondaryChargeVRAction = new ConfigItem("LCVR", "Secondary Charge Button", "{LeftHand}/gripPressed", "", needsRestart: true, ConfigItemAuthority.Local); DisableChargeMotionBlur = new ConfigItem("LCVR", "Disable Charge Motion Blur", defaultValue: true, "Whether or not to disable the motion blur when charging", needsRestart: false, ConfigItemAuthority.Local); GlowmobVRAction = new ConfigItem("LCVR", "Glowmob Button (hold)", "{LeftHand}/gripPressed", "", needsRestart: true, ConfigItemAuthority.Local); GlowmobDelay = new ConfigItem("LCVR", "Glowmob Delay", defaultValue: true, "Adds a small delay for holding the glowmob button to prevent accidental activation", needsRestart: false, ConfigItemAuthority.Local); ThrowCancelVRAction = new ConfigItem("LCVR", "Throw Cancel Button", "", "", needsRestart: true, ConfigItemAuthority.Local); DontDoAudibleNoiseCalcuationsForPikmin = new ConfigItem("Imperium", "Dont Do Audible Noise Calculations For Pikmin", defaultValue: true, "Whether or not to ignore audible noise calculations for Pikmin (This Reduces lag when there are tons of pikmin)", needsRestart: false, ConfigItemAuthority.Local); DontResimulateOracleOnPikminDeath = new ConfigItem("Imperium", "Dont Resimulate Oracle On Pikmin Death", defaultValue: true, "Whether or not to ignore resimulating the oracle when a pikmin dies (This Reduces lag when lots of pikmin die)", needsRestart: false, ConfigItemAuthority.Local); RemovePuffminFromSpawnSearch = new ConfigItem("Imperium", "Remove Puffmin From Spawn Search", defaultValue: true, "Whether or not to remove puffmin from the spawn search when pressing f2. This makes it so you wouldn't accidently spawn a puffmin when trying to spawn a pikmin.", needsRestart: true, ConfigItemAuthority.Local); MakeCustomBoundsForWideShip = new ConfigItem("WiderShipMod", "Make Custom Bounds For Wide Ship", defaultValue: true, "Whether or not to make custom bounds for the wider ship mod (auto disabled if the 2story ship mod is installed with wider ship)", needsRestart: true, ConfigItemAuthority.Client); NavmeshCheckBlacklistConfig = new ConfigItem>("Advanced", "Navmesh Check Blacklist", new List(), "The list of moon names that the mod won't check for navmesh", needsRestart: true, ConfigItemAuthority.Host); CheckNavMesh = new ConfigItem("Advanced", "Check Navmesh", defaultValue: true, "Check if the navmesh a moon has a navmesh if it does then it spawns pikmin and onions on the moon", needsRestart: false, ConfigItemAuthority.Host); GeneratePikminConfigs = new ConfigItem("Advanced", "Generate Pikmin Configs", defaultValue: false, "Whether or not to generate configs for each Pikmin type", needsRestart: false, ConfigItemAuthority.Local); UseModDataLibConfig = new ConfigItem("Advanced", "Use ModDataLib", defaultValue: true, "Whether or not to use ModDataLib for saving and loading data", needsRestart: false, ConfigItemAuthority.Host); CleanMoonNames = new ConfigItem("Advanced", "Clean Moon Names", defaultValue: true, "If true, moon names will be cleaned of numbers and special characters for matching (e.g., '41-Experimentation' becomes 'Experimentation'). Turn off to require exact moon names.", needsRestart: true, ConfigItemAuthority.Host); GenerateMoonSpawnConfigs = new ConfigItem("Advanced", "Generate Moon Spawn Configs", defaultValue: false, "Whether or not to generate spawn config files for each moon in the PikminMoonSpawns folder", needsRestart: false, ConfigItemAuthority.Local); GenerateWeatherSpawnConfigs = new ConfigItem("Advanced", "Generate Weather Spawn Configs", defaultValue: false, "Whether or not to generate spawn config files for each weather type in the PikminWeatherSpawns folder (Weather spawn configs always stack with moon spawn configs)", needsRestart: false, ConfigItemAuthority.Local); UseBetaItemWeightCalculation = new ConfigItem("`Cheats`", "Use Beta Item Weight Calculation", defaultValue: false, "Use the beta item weight calculation for pikmin items (overrides the default weight calculation)", needsRestart: false, ConfigItemAuthority.Client); WhistleMakesNoiseAtNoiceZone = new ConfigItem("`Cheats`", "Whistle Makes Noise At Noice Zone", defaultValue: false, "Whether or not the whistle makes noise at the noice zone", needsRestart: false, ConfigItemAuthority.Host); DontMakeAudibleNoises = new ConfigItem("`Cheats`", "Dont Make Audible Noises", defaultValue: false, "Makes it so Pikmin's voices won't be audible to enemies", needsRestart: false, ConfigItemAuthority.Host); PikminSignalCooldown = new ConfigItem("`Cheats`", "Pikmin Signal Cooldown", -1f, "The cooldown for the pikmin signal (in seconds)", needsRestart: false, ConfigItemAuthority.Host); NoKnockBack = new ConfigItem("`Cheats`", "No Knock Back", defaultValue: false, "Whether or not pikmin will be knocked back by enemies", needsRestart: false, ConfigItemAuthority.Host); InvinceablePikmin = new ConfigItem("`Cheats`", "Invinceable Pikmin", defaultValue: false, "Whether or not pikmin are invincible to damage from enemies", needsRestart: false, ConfigItemAuthority.Host); UselessBluesMode = new ConfigItem("`Cheats`", "Useless Blues Mode", defaultValue: false, "Makes it so blues pikmin cannot swim and drown in water", needsRestart: false, ConfigItemAuthority.Host); MaxWhistleZoneRadius = new ConfigItem("`Cheats`", "Max Whistle Zone Radius", -1f, "The maximum radius for the whistle zone (in meters)", needsRestart: false, ConfigItemAuthority.Host); MaxWhistleZoneDistance = new ConfigItem("`Cheats`", "Max Whistle Zone Distance", -1f, "The maximum distance for the whistle zone (in meters)", needsRestart: false, ConfigItemAuthority.Host); PlayerNoticeZoneSize = new ConfigItem("`Cheats`", "Player Notice Zone Size", -1f, "The size of the player notice zone (in meters)", needsRestart: false, ConfigItemAuthority.Host); PikminDamageMultipler = new ConfigItem("`Cheats`", "Pikmin Damage Multiplier", -1f, "The multiplier for pikmin damage to enemies (1.0 = normal, 2.0 = double damage, etc.)", needsRestart: false, ConfigItemAuthority.Host); PikminSpeedMultipler = new ConfigItem("`Cheats`", "Pikmin Speed Multiplier", -1f, "The multiplier for pikmin speed (1.0 = normal, 2.0 = double speed, etc.)", needsRestart: false, ConfigItemAuthority.Host); ChargeDistance = new ConfigItem("`Cheats`", "Charge Distance", -1f, "The distance pikmin can be charged (in units)", needsRestart: false, ConfigItemAuthority.Host); ChargeCooldown = new ConfigItem("`Cheats`", "Charge Cooldown", -1f, "The cooldown for charging pikmin (in seconds)", needsRestart: false, ConfigItemAuthority.Host); DontPurgeAfterFire = new ConfigItem("`Cheats`", "Dont Remove Save After Fire", defaultValue: false, "Makes it so the save file is not cleared after being fired", needsRestart: false, ConfigItemAuthority.Host); YeetAfterLatchOn = new ConfigItem("Funi", "Yeet After Latch On", defaultValue: false, "Whether or not pikmin will be yeeted after latching onto an enemy", needsRestart: false, ConfigItemAuthority.Client); RandomizeGenerationModels = new ConfigItem("Funi", "Randomize Generation Models", defaultValue: false, "Randomizes what generation is used for pikmin/onion models", needsRestart: false, ConfigItemAuthority.Local); AddCollisionToGhostSprites = new ConfigItem("Funi", "Add Collision To Ghost Sprites", defaultValue: false, "Whether or not to add collision to ghost sprites (This really does nothing except make some goofy physics happen in the cars)", needsRestart: false, ConfigItemAuthority.Client); FuniOnion = new ConfigItem("Funi", "Funi Onion", defaultValue: false, "", needsRestart: false, ConfigItemAuthority.Local); GiantWhistleMode = new ConfigItem("Funi", "Giant Whistle With Pikmin Signal", defaultValue: false, "", needsRestart: false, ConfigItemAuthority.Local); RagdollOnKnockback = new ConfigItem("Funi", "Ragdoll On Knockback", defaultValue: false, "[EXPERIMENTAL] Makes it so pikmin go into ragdoll mode when they are knocked back", needsRestart: false, ConfigItemAuthority.Local); } public void BindLCconfigs() { LethalConfigManager.SetModDescription("Adds Functional Pikmin to Lethal Company!"); } public void UpdateSyncedConfigs() { if (!((Object)(object)PikminManager.instance == (Object)null) && !((Object)(object)PikminManager.instance.LocalLeader == (Object)null)) { } } public static void UpdateDefaultGeneration() { Logger.LogInfo((object)$"Current Generation set to: {DefaultGeneration.InternalValue}"); GenerationManager.Instance.SwitchGeneration(DefaultGeneration.InternalValue); ((ConfigEntryBase)PikminModelGeneration.Entry).BoxedValue = -1; ((ConfigEntryBase)SoulSpriteGeneration.Entry).BoxedValue = -1; ((ConfigEntryBase)OnionModelGeneration.Entry).BoxedValue = -1; ((ConfigEntryBase)OnionItemModelGeneration.Entry).BoxedValue = -1; ((ConfigEntryBase)SproutModelGeneration.Entry).BoxedValue = -1; ((ConfigEntryBase)PikminSoundGeneration.Entry).BoxedValue = -1; ((ConfigEntryBase)PuffminGeneration.Entry).BoxedValue = -1; } public static void UpdateCurrentGeneration(int numb, ref ConfigItem itm) { if (1 == 0) { } string text = numb switch { 1 => "Pikmin", 2 => "Sprout", 3 => "PikminSound", 4 => "Soul", 5 => "Onion", 6 => "OnionItem", 7 => "Puffmin", _ => "???", }; if (1 == 0) { } string text2 = text; Logger.LogInfo((object)$"{text2}'s Current Generation set to: {itm.InternalValue}"); PikminGeneration pikminGeneration = PikminGeneration.Pikmin1And2; pikminGeneration = ((itm.InternalValue != CfgPikminGeneration.Default) ? ((PikminGeneration)itm.InternalValue) : DefaultGeneration.InternalValue); switch (text2) { case "Pikmin": { PikminAI[] array4 = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (PikminAI pikminAI2 in array4) { pikminAI2.SwitchGeneration(pikminGeneration); } break; } case "Sprout": { Sprout[] array6 = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (Sprout sprout in array6) { sprout.SwitchGeneration(pikminGeneration); } break; } case "PikminSound": { PikminAI[] array2 = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (PikminAI pikminAI in array2) { pikminAI.SwitchSoundGeneration(pikminGeneration); } break; } case "Soul": break; case "Onion": { BaseOnion[] array5 = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (BaseOnion baseOnion in array5) { baseOnion.SwitchGeneration(pikminGeneration); } if ((Object)(object)PikminManager.instance != (Object)null && (Object)(object)PikminManager.instance.shipPhaseOnionContainer != (Object)null) { PikminManager.instance.shipPhaseOnionContainer.SwitchGeneration(pikminGeneration); } break; } case "OnionItem": { OnionItem[] array3 = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (OnionItem onionItem in array3) { onionItem.SwitchGeneration(pikminGeneration); } break; } case "Puffmin": { PuffminAI[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (PuffminAI puffminAI in array) { puffminAI.SwitchGeneration(pikminGeneration); } break; } } } public void UpdateHUDLayout() { if (!((Object)(object)PikminHUDManager.instance == (Object)null)) { PikminHUDManager.instance.SetLayout(HUDPreset.InternalValue); } } public void SetFollowMode() { if (!((Object)(object)PikminManager.instance == (Object)null) && !((Object)(object)PikminManager.instance.LocalLeader == (Object)null)) { ((Behaviour)PikminManager.instance.LocalLeader.formManager).enabled = PikminFollowMode.InternalValue == PfollowMode.New; } } } public class AssetBundleLoader : MonoBehaviour { private class BundleInfo { public string Path = ""; public string BundleName = ""; public AssetBundle Bundle = null; public Object? ModInfo; public bool IsLibraryBundle; public bool Processed = false; public List Dependencies = new List(); public BundleInfo(string path) { Path = path; BundleName = System.IO.Path.GetFileNameWithoutExtension(path); } } [CompilerGenerated] private sealed class d__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string bundlePath; public AssetBundleLoader <>4__this; private AssetBundleCreateRequest 5__1; private string 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; LethalMin.Logger.LogInfo((object)("Loading bundle: " + Path.GetFileNameWithoutExtension(bundlePath))); 5__1 = AssetBundle.LoadFromFileAsync(bundlePath); <>2__current = 5__1; <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)5__1.assetBundle != (Object)null) { 5__2 = Path.GetFileNameWithoutExtension(bundlePath); <>4__this.loadedBundles[5__2] = 5__1.assetBundle; if (LethalMin.IsDependencyLoaded("NoteBoxz.LethalMinLibrary")) { ((Component)<>4__this).gameObject.GetComponent().ProcessLoadedLibBundle(5__1.assetBundle); } <>4__this.ProcessLoadedBundle(5__1.assetBundle); BundlesProcessed++; LethalMin.Logger.LogInfo((object)$"Ratio: {BundlesToProcess} - {BundlesProcessed}"); 5__2 = null; } else { LethalMin.Logger.LogError((object)("Failed to load bundle: " + bundlePath)); BundlesToProcess--; } 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__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string[] bundleFiles; public AssetBundleLoader <>4__this; private List 5__1; private List 5__2; private List 5__3; private List 5__4; private string[] <>s__5; private int <>s__6; private string 5__7; private BundleInfo 5__8; private Stopwatch 5__9; private AssetBundleCreateRequest 5__10; private LMLmodInfo[] 5__11; private int 5__12; private LMLmodInfo[] <>s__13; private int <>s__14; private LMLmodInfo 5__15; private LMLmodInfo 5__16; private List.Enumerator <>s__17; private LMLmodInfo 5__18; private PikminType[] 5__19; private List.Enumerator <>s__20; private BundleInfo 5__21; private List.Enumerator <>s__22; private BundleInfo 5__23; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { switch (<>1__state) { case -3: case 2: try { } finally { <>m__Finally1(); } break; case -4: case 3: try { } finally { <>m__Finally2(); } break; } 5__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; <>s__5 = null; 5__7 = null; 5__8 = null; 5__9 = null; 5__10 = null; 5__11 = null; <>s__13 = null; 5__15 = null; 5__16 = null; <>s__17 = default(List.Enumerator); 5__18 = null; 5__19 = null; <>s__20 = default(List.Enumerator); 5__21 = null; <>s__22 = default(List.Enumerator); 5__23 = null; <>1__state = -2; } private bool MoveNext() { try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = new List(); <>s__5 = bundleFiles; <>s__6 = 0; goto IL_0437; case 1: <>1__state = -1; 5__9.Stop(); LethalMin.Logger.LogDebug((object)$"Loaded bundle: {Path.GetFileNameWithoutExtension(5__7)} in ({5__9.Elapsed})s"); if ((Object)(object)5__10.assetBundle != (Object)null) { 5__8.Bundle = 5__10.assetBundle; <>4__this.loadedBundles[5__8.BundleName] = 5__10.assetBundle; 5__11 = 5__10.assetBundle.LoadAllAssets(); if (5__11.Length > 1) { 5__12 = 0; <>s__13 = 5__11; for (<>s__14 = 0; <>s__14 < <>s__13.Length; <>s__14++) { 5__15 = <>s__13[<>s__14]; if (5__15.DontLoad) { 5__12++; } 5__15 = null; } <>s__13 = null; if (5__11.Length - 5__12 > 1) { LethalMin.Logger.LogWarning((object)("Bundle " + 5__8.BundleName + " has multiple modInfos. This may cause issues.")); } } if (5__11.Length != 0) { 5__8.ModInfo = (Object?)(object)5__11[0]; 5__16 = 5__11[0]; 5__8.IsLibraryBundle = true; if (5__16.Dependencies != null) { <>s__17 = 5__16.Dependencies.GetEnumerator(); try { while (<>s__17.MoveNext()) { 5__18 = <>s__17.Current; if ((Object)(object)5__18 != (Object)null) { 5__8.Dependencies.Add(((Object)5__18).name); } 5__18 = null; } } finally { ((IDisposable)<>s__17).Dispose(); } <>s__17 = default(List.Enumerator); } LethalMin.Logger.LogDebug((object)$"Found Library bundle: {5__8.BundleName} with {5__8.Dependencies.Count} dependencies"); 5__16 = null; } else { 5__19 = 5__10.assetBundle.LoadAllAssets(); 5__8.IsLibraryBundle = 5__19.Length == 0; 5__19 = null; } 5__11 = null; } else { LethalMin.Logger.LogError((object)("Failed to load bundle: " + 5__7)); 5__1.Remove(5__8); } 5__8 = null; 5__9 = null; 5__10 = null; 5__7 = null; <>s__6++; goto IL_0437; case 2: <>1__state = -3; 5__21 = null; goto IL_054b; case 3: { <>1__state = -4; 5__23 = null; break; } IL_054b: if (<>s__20.MoveNext()) { 5__21 = <>s__20.Current; <>2__current = <>4__this.ProcessBundle(5__21); <>1__state = 2; return true; } <>m__Finally1(); <>s__20 = default(List.Enumerator); <>s__22 = 5__3.GetEnumerator(); <>1__state = -4; break; IL_0437: if (<>s__6 < <>s__5.Length) { 5__7 = <>s__5[<>s__6]; 5__8 = new BundleInfo(5__7); 5__1.Add(5__8); LethalMin.Logger.LogDebug((object)("Loading bundle: " + Path.GetFileNameWithoutExtension(5__7))); 5__9 = Stopwatch.StartNew(); 5__10 = AssetBundle.LoadFromFileAsync(5__7); <>2__current = 5__10; <>1__state = 1; return true; } <>s__5 = null; 5__2 = 5__1.Where((BundleInfo b) => b.IsLibraryBundle).ToList(); 5__3 = 5__1.Where((BundleInfo b) => !b.IsLibraryBundle).ToList(); 5__4 = <>4__this.SortBundlesByDependencies(5__2); BundlesToProcess = 5__1.Count; BundlesProcessed = 0; <>s__20 = 5__4.GetEnumerator(); <>1__state = -3; goto IL_054b; } if (<>s__22.MoveNext()) { 5__23 = <>s__22.Current; <>2__current = <>4__this.ProcessBundle(5__23); <>1__state = 3; return true; } <>m__Finally2(); <>s__22 = default(List.Enumerator); if (BundlesToProcess > 0) { ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.WaitToRegister()); } return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__20).Dispose(); } private void <>m__Finally2() { <>1__state = -1; ((IDisposable)<>s__22).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BundleInfo bundleInfo; public AssetBundleLoader <>4__this; private LMLmodInfo 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)bundleInfo.Bundle != (Object)null && !bundleInfo.Processed) { ref LMLmodInfo reference = ref 5__1; Object? modInfo = bundleInfo.ModInfo; reference = (LMLmodInfo)(object)((modInfo is LMLmodInfo) ? modInfo : null); if ((Object)(object)5__1 == (Object)null) { LethalMin.Logger.LogMessage((object)("Processing bundle [" + bundleInfo.BundleName + "]")); } else { LethalMin.Logger.LogMessage((object)("Processing bundle [" + 5__1.ModName + " " + 5__1.Version + "]")); } if (bundleInfo.IsLibraryBundle && LethalMin.IsDependencyLoaded("NoteBoxz.LethalMinLibrary")) { ((Component)<>4__this).gameObject.GetComponent().ProcessLoadedLibBundle(bundleInfo.Bundle); } else { <>4__this.ProcessLoadedBundle(bundleInfo.Bundle); } bundleInfo.Processed = true; BundlesProcessed++; LethalMin.Logger.LogInfo((object)$"Ratio: {BundlesToProcess} - {BundlesProcessed}"); 5__1 = null; } <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; 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__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AssetBundleLoader <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => BundlesToProcess == BundlesProcessed)); <>1__state = 1; return true; case 1: <>1__state = -1; LethalMin.InitCustomDefaultSoundPacks(<>4__this.customSoundPacks); LethalMin.RegisterCustomPikminTypes(<>4__this.customTypes); LethalMin.RegisterCustomOnionTypes(<>4__this.customOtypes); LethalMin.RegisterCustomFuseRules(<>4__this.customFuseRules); if (LethalMin.IsDependencyLoaded("NoteBoxz.LethalMinLibrary")) { <>4__this.ClearCache(); } LethalMin.Logger.LogMessage((object)$"All bundles processed: {BundlesProcessed}/{BundlesToProcess}"); 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 static AssetBundleLoader instance = null; private const string BUNDLE_EXTENSION = "*.lethalmin"; internal static DirectoryInfo lethalMinFile = new DirectoryInfo(Assembly.GetExecutingAssembly().Location); internal static DirectoryInfo lethalMinFolder = null; internal static DirectoryInfo pluginsFolder = null; private List customTypes = new List(); private List customOtypes = new List(); private List customFuseRules = new List(); public List customSoundPacks = new List(); private Dictionary loadedBundles = new Dictionary(); public static int BundlesToProcess; public static int BundlesProcessed; public void Initialize() { LoadLethalMinBundles(); } private void LoadLethalMinBundles() { lethalMinFolder = lethalMinFile.Parent; pluginsFolder = lethalMinFolder.Parent; if (pluginsFolder == null || !pluginsFolder.Exists) { LethalMin.Logger.LogError((object)("Plugins folder not found: " + pluginsFolder?.FullName)); return; } if (LethalMin.IsDependencyLoaded("NoteBoxz.LethalMinLibrary")) { ((Component)this).gameObject.AddComponent(); } string[] files = Directory.GetFiles(pluginsFolder.FullName, "*.lethalmin", SearchOption.AllDirectories); Array.Sort(files, (string a, string b) => string.Compare(Path.GetFileNameWithoutExtension(a), Path.GetFileNameWithoutExtension(b), StringComparison.Ordinal)); if (LethalMin.IsDependencyLoaded("NoteBoxz.LethalMinLibrary")) { ((MonoBehaviour)this).StartCoroutine(LoadBundlesWithDependencies(files)); } else { BundlesToProcess = files.Length; string[] array = files; foreach (string bundlePath in array) { ((MonoBehaviour)this).StartCoroutine(LoadBundleCoroutine(bundlePath)); } if (BundlesToProcess > 0) { ((MonoBehaviour)this).StartCoroutine(WaitToRegister()); } } switch (files.Length) { case 0: LethalMin.Logger.LogDebug((object)"No LethalMin bundles found in the plugins folder"); break; case 1: LethalMin.Logger.LogInfo((object)"Loaded 1 LethalMin bundle"); break; default: LethalMin.Logger.LogInfo((object)$"Loaded {files.Length} LethalMin bundles"); break; } } [IteratorStateMachine(typeof(d__15))] private IEnumerator LoadBundlesWithDependencies(string[] bundleFiles) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { <>4__this = this, bundleFiles = bundleFiles }; } private List SortBundlesByDependencies(List bundles) { Dictionary bundlesByName = bundles.ToDictionary((BundleInfo b) => b.BundleName); List list = new List(); HashSet hashSet = new HashSet(); HashSet processing = new HashSet(); foreach (BundleInfo bundle in bundles) { if (!hashSet.Contains(bundle.BundleName) && !TopologicalSort(bundle, bundlesByName, hashSet, processing, list)) { LethalMin.Logger.LogFatal((object)("Circular dependency detected involving mod: " + bundle.BundleName)); } } LethalMin.Logger.LogDebug((object)"Sorted bundles by dependencies:"); foreach (BundleInfo item in list) { LethalMin.Logger.LogDebug((object)$"- {item.BundleName} (Library: {item.IsLibraryBundle})"); } return list; } private bool TopologicalSort(BundleInfo bundle, Dictionary bundlesByName, HashSet visited, HashSet processing, List sortedBundles) { if (processing.Contains(bundle.BundleName)) { return false; } if (visited.Contains(bundle.BundleName)) { return true; } processing.Add(bundle.BundleName); foreach (string dependency in bundle.Dependencies) { if (bundlesByName.TryGetValue(dependency, out BundleInfo value)) { if (!TopologicalSort(value, bundlesByName, visited, processing, sortedBundles)) { return false; } continue; } LethalMin.Logger.LogWarning((object)("Bundle " + bundle.BundleName + " depends on " + dependency + ", but it was not found")); } processing.Remove(bundle.BundleName); visited.Add(bundle.BundleName); sortedBundles.Add(bundle); return true; } [IteratorStateMachine(typeof(d__18))] private IEnumerator ProcessBundle(BundleInfo bundleInfo) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { <>4__this = this, bundleInfo = bundleInfo }; } [IteratorStateMachine(typeof(d__19))] private IEnumerator LoadBundleCoroutine(string bundlePath) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { <>4__this = this, bundlePath = bundlePath }; } [IteratorStateMachine(typeof(d__20))] private IEnumerator WaitToRegister() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { <>4__this = this }; } private void ClearCache() { TypeConverter.ClearCache(); } private void ProcessLoadedBundle(AssetBundle bundle) { bool flag = false; PikminSoundPack[] array = bundle.LoadAllAssets(); PikminSoundPack[] array2 = array; foreach (PikminSoundPack pikminSoundPack in array2) { if ((Object)(object)pikminSoundPack != (Object)null) { customSoundPacks.Add(pikminSoundPack); flag = true; } } PikminType[] array3 = bundle.LoadAllAssets(); PikminType[] array4 = array3; foreach (PikminType pikminType in array4) { if ((Object)(object)pikminType != (Object)null) { customTypes.Add(pikminType); flag = true; } } OnionType[] array5 = bundle.LoadAllAssets(); OnionType[] array6 = array5; foreach (OnionType onionType in array6) { if ((Object)(object)onionType != (Object)null) { customOtypes.Add(onionType); flag = true; } } OnionFuseRules[] array7 = bundle.LoadAllAssets(); OnionFuseRules[] array8 = array7; foreach (OnionFuseRules onionFuseRules in array8) { if ((Object)(object)onionFuseRules != (Object)null) { customFuseRules.Add(onionFuseRules); flag = true; } } if (!flag) { } if (!flag && !LethalMin.IsDependencyLoaded("NoteBoxz.LethalMinLibrary")) { LethalMin.Logger.LogWarning((object)("Bundle does not contain any valid LethalMin assets: " + ((Object)bundle).name + " This could be because you are missing the LethalMinLibrary mod")); } } } public struct PikAnimationState { public string name; public AnimationClip clip; public float TransitionDuration; public bool IsOneShot; public PikAnimationState(string name, AnimationClip clip, float transitionDuration) { IsOneShot = false; this.name = name; this.clip = clip; TransitionDuration = transitionDuration; } public PikAnimationState(AnimationClip clip) { IsOneShot = false; name = ((Object)clip).name; this.clip = clip; TransitionDuration = -1f; } } [RequireComponent(typeof(Animator))] public class PikminAnimatorController : MonoBehaviour { public class AnimationCondition { public bool enabled = true; public Func EnterCondition { get; set; } public Func ExitCondition { get; set; } public AnimationClip Animation { get; set; } public int Priority { get; set; } public AnimationCondition(Func condition, AnimationClip animation, int priority) { EnterCondition = condition; ExitCondition = condition; Animation = animation; Priority = priority; } public AnimationCondition(Func enterCondition, Func exitCondition, AnimationClip animation, int priority) { EnterCondition = enterCondition; ExitCondition = exitCondition; Animation = animation; Priority = priority; } } [CompilerGenerated] private sealed class d__38 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PikAnimationState state; public float offset; public PikminAnimatorController <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__38(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(state.clip.length + offset); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)<>4__this.CurrentAnimation == (Object)(object)state.clip && state.IsOneShot) { <>4__this.ResetToIdleAnim(); } <>4__this.AnimCheckCoroutine = null; 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 Animator animator = null; public (int, AnimationClip?) _currentState = default((int, AnimationClip)); public PikminAnimationPack AnimPack = null; public List AnimationStates = new List(); [HideInInspector] public AnimationClip? IdleAnim = null; [HideInInspector] public int RandomIdle = 0; [HideInInspector] public bool IsMoving; [HideInInspector] public bool IsCarrying; [HideInInspector] public bool IsAttacking; [HideInInspector] public bool IsLaying; protected Coroutine? AnimCheckCoroutine; protected Dictionary _animationHashes = new Dictionary(); public AnimationCondition WalkingCondition = null; public AnimationCondition CayingCondition = null; public AnimationCondition AttackingCondition = null; public AnimationCondition LayingCondition = null; private List _animationConditions = new List(); private bool PlayAnimCalled = false; private AnimationClip? lastIdleAnim = null; public AnimationClip? CurrentAnimation { get { AnimatorClipInfo[] currentAnimatorClipInfo = animator.GetCurrentAnimatorClipInfo(0); return (currentAnimatorClipInfo.Length != 0) ? ((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip : null; } } public bool IsPlayingIdleAnim => (Object)(object)CurrentAnimation != (Object)null && AnimPack.EditorIdleAnim.Contains(CurrentAnimation); public bool IsPlayingWalkingAnim => (Object)(object)CurrentAnimation != (Object)null && (Object)(object)CurrentAnimation == (Object)(object)AnimPack.EditorWalkingAnim; public virtual void Awake() { if ((Object)(object)animator == (Object)null) { animator = ((Component)this).GetComponent(); } AnimationStates.Clear(); AnimationClip[] animationClips = animator.runtimeAnimatorController.animationClips; ProcessAnimationClipsAsync(animationClips); SetupDefaultAnimationConditions(); FillNullAnims(); } private void ProcessAnimationClipsAsync(AnimationClip[] clips) { List list = new List(); if ((Object)(object)AnimPack.EditorNoticeAnim != (Object)null) { list.Add(AnimPack.EditorNoticeAnim); } if ((Object)(object)AnimPack.EditorStandingAttackAnim != (Object)null) { list.Add(AnimPack.EditorStandingAttackAnim); } if ((Object)(object)AnimPack.EditorGetUpAnim != (Object)null) { list.Add(AnimPack.EditorGetUpAnim); } if ((Object)(object)AnimPack.EditorPluckedAnim != (Object)null) { list.Add(AnimPack.EditorPluckedAnim); } if ((Object)(object)AnimPack.EditorDrinkAnim != (Object)null) { list.Add(AnimPack.EditorDrinkAnim); } list.AddRange(AnimPack.EditorYayAnim); list.AddRange(AnimPack.EditorMiscOneshotAnim); IdleAnim = ((AnimPack.EditorIdleAnim.Count != 0) ? AnimPack.EditorIdleAnim[0] : null); Dictionary dictionary = new Dictionary(); if ((Object)(object)AnimPack.AnimatorOverrideController != (Object)null) { List> list2 = new List>(); AnimPack.AnimatorOverrideController.GetOverrides(list2); foreach (KeyValuePair item2 in list2) { if ((Object)(object)item2.Value != (Object)null) { dictionary[item2.Value] = item2.Key; } } } foreach (AnimationClip val in clips) { if ((Object)(object)AnimPack.AnimatorOverrideController != (Object)null && dictionary.TryGetValue(val, out var value)) { _animationHashes[((Object)val).name] = Animator.StringToHash(((Object)value).name); } else { _animationHashes[((Object)val).name] = Animator.StringToHash(((Object)val).name); } PikAnimationState item = new PikAnimationState(val); item.IsOneShot = list.Contains(val); if (item.IsOneShot) { item.TransitionDuration = 0f; } AnimationStates.Add(item); } } protected virtual void SetupDefaultAnimationConditions() { if ((Object)(object)AnimPack.EditorLayingAnim != (Object)null) { LayingCondition = new AnimationCondition(() => IsLaying, AnimPack.EditorLayingAnim, 40); AddAnimationCondition(LayingCondition); } if ((Object)(object)AnimPack.EditorLatchedAttackAnim != (Object)null) { AttackingCondition = new AnimationCondition(() => IsAttacking, AnimPack.EditorLatchedAttackAnim, 30); AddAnimationCondition(AttackingCondition); } if ((Object)(object)AnimPack.EditorCarryAnim != (Object)null) { CayingCondition = new AnimationCondition(() => IsCarrying, AnimPack.EditorCarryAnim, 20); AddAnimationCondition(CayingCondition); } if ((Object)(object)AnimPack.EditorWalkingAnim != (Object)null) { WalkingCondition = new AnimationCondition(() => IsMoving && ((Object)(object)_currentState.Item2 == (Object)null || AnimPack.EditorIdleAnim.Contains(_currentState.Item2)), () => IsMoving, AnimPack.EditorWalkingAnim, 10); AddAnimationCondition(WalkingCondition); } _animationConditions = _animationConditions.OrderByDescending((AnimationCondition c) => c.Priority).ToList(); } private void FillNullAnims() { if (!AnimPack.FillEmptyFields) { return; } AnimationClip val = LethalMin.assetBundle.LoadAsset("Assets/LethalMin/EmptyClip.anim"); FieldInfo[] fields = ((object)AnimPack).GetType().GetFields(BindingFlags.Instance | BindingFlags.Public); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { if (fieldInfo.FieldType == typeof(AnimationClip) && fieldInfo.GetValue(AnimPack) == null) { fieldInfo.SetValue(AnimPack, val); LethalMin.Logger.LogInfo((object)("PikminAnimatorController: Assigned empty animation clip to " + fieldInfo.Name)); } else if (fieldInfo.FieldType == typeof(List)) { List list = (List)fieldInfo.GetValue(AnimPack); if (list != null && list.Count == 0) { list.Add(val); LethalMin.Logger.LogInfo((object)("PikminAnimatorController: Assigned empty animation clip to " + fieldInfo.Name)); } } } } public void AddAnimationCondition(AnimationCondition condition) { _animationConditions.Add(condition); _animationConditions = _animationConditions.OrderByDescending((AnimationCondition c) => c.Priority).ToList(); } public void AddAnimationCondition(Func condition, AnimationClip animation, int priority) { _animationConditions.Add(new AnimationCondition(condition, animation, priority)); _animationConditions = _animationConditions.OrderByDescending((AnimationCondition c) => c.Priority).ToList(); } public void AddAnimationCondition(Func enterCondition, Func exitCondition, AnimationClip animation, int priority) { _animationConditions.Add(new AnimationCondition(enterCondition, exitCondition, animation, priority)); _animationConditions = _animationConditions.OrderByDescending((AnimationCondition c) => c.Priority).ToList(); } public void RemoveAnimationCondition(AnimationClip animation) { AnimationClip animation2 = animation; _animationConditions.RemoveAll((AnimationCondition c) => (Object)(object)c.Animation == (Object)(object)animation2); } public virtual void LateUpdate() { if ((Object)(object)animator == (Object)null || !animator.isInitialized) { return; } if (!AnimPack.UseStateMachineForIdleAnims && (Object)(object)_currentState.Item2 != (Object)null && AnimPack.EditorIdleAnim.Contains(_currentState.Item2) && (Object)(object)IdleAnim != (Object)null && (Object)(object)lastIdleAnim != (Object)(object)IdleAnim) { lastIdleAnim = IdleAnim; PlayAnimation(((Object)IdleAnim).name); } if (PlayAnimCalled) { return; } bool flag = false; foreach (AnimationCondition animationCondition in _animationConditions) { if (!animationCondition.enabled || !animationCondition.EnterCondition() || !((Object)(object)_currentState.Item2 != (Object)(object)animationCondition.Animation)) { continue; } PlayAnimation(((Object)animationCondition.Animation).name); flag = true; break; } if (flag) { return; } bool flag2 = false; foreach (AnimationCondition animationCondition2 in _animationConditions) { if (!animationCondition2.enabled || animationCondition2.ExitCondition() || !((Object)(object)_currentState.Item2 == (Object)(object)animationCondition2.Animation)) { continue; } flag2 = true; break; } if (flag2) { ResetToIdleAnim(); } } public void resetRandomIdle() { RandomIdle = 0; if (AnimPack.UseStateMachineForIdleAnims) { animator.CrossFade(AnimPack.IdleAnimStateMachineEntryName, 0.2f); } else if (AnimPack.EditorIdleAnim.Count != 0) { PlayAnimation(((Object)AnimPack.EditorIdleAnim[0]).name); } } public virtual void PlayLandAnim() { if ((Object)(object)CurrentAnimation == (Object)(object)AnimPack.EditorKnockbackAnim) { if ((Object)(object)AnimPack.EditorLayingAnim != (Object)null) { PlayAnimation(((Object)AnimPack.EditorLayingAnim).name); } } else { ResetToIdleAnim(); } } public virtual void PlayAnimation(string animationName, float transitionDuration = 0.25f, int layer = 0) { PlayAnimCalled = true; if ((Object)(object)animator == (Object)null) { PlayAnimCalled = false; return; } if (animationName == "Plucked") { AnimationClip? editorPluckedAnim = AnimPack.EditorPluckedAnim; animationName = ((editorPluckedAnim != null) ? ((Object)editorPluckedAnim).name : null) ?? "Plucked"; } PikAnimationState animationStateFromNameViaHash = GetAnimationStateFromNameViaHash(animationName); if ((Object)(object)animationStateFromNameViaHash.clip == (Object)null) { PlayAnimCalled = false; Debug.LogWarning((object)(((Object)((Component)this).gameObject).name + " Pik Animation State '" + animationName + "' not found")); return; } int value; int num = (_animationHashes.TryGetValue(animationName, out value) ? value : Animator.StringToHash(animationName)); if (animationStateFromNameViaHash.TransitionDuration != -1f) { transitionDuration = animationStateFromNameViaHash.TransitionDuration; } if (HasAnimation(num, layer)) { if ((Object)(object)CurrentAnimation != (Object)null && ((Object)CurrentAnimation).name == animationName) { animator.Play(num, layer, 0f); } else { animator.CrossFade(num, transitionDuration, layer); } _currentState = (layer, animationStateFromNameViaHash.clip); if (AnimCheckCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(AnimCheckCoroutine); AnimCheckCoroutine = null; } AnimCheckCoroutine = ((MonoBehaviour)this).StartCoroutine(CheckIfAnimationHasFinished(animationStateFromNameViaHash)); } else { Debug.LogWarning((object)$"{((Object)((Component)this).gameObject).name}: Animation '{animationName}' not found in layer {layer}. Could the state name be different from the clip name?"); } PlayAnimCalled = false; } [IteratorStateMachine(typeof(d__38))] public virtual IEnumerator CheckIfAnimationHasFinished(PikAnimationState state, float offset = 0f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__38(0) { <>4__this = this, state = state, offset = offset }; } public PikAnimationState GetAnimationStateFromNameViaHash(string animationName) { foreach (PikAnimationState animationState in AnimationStates) { if (Animator.StringToHash(animationState.name) == Animator.StringToHash(animationName)) { return animationState; } } return default(PikAnimationState); } public PikAnimationState GetAnimationStateFromName(string animationName) { foreach (PikAnimationState animationState in AnimationStates) { if (animationState.name == animationName) { return animationState; } } return default(PikAnimationState); } public void ResetToIdleAnim() { if (AnimPack.EditorIdleAnim.Count == 0) { Debug.LogWarning((object)(((Object)((Component)this).gameObject).name + ": No idle animation found in the animation pack.")); } else if (AnimPack.UseStateMachineForIdleAnims) { IdleAnim = AnimPack.EditorIdleAnim[0]; animator.CrossFade(AnimPack.IdleAnimStateMachineEntryName, 0.2f); _currentState = (0, IdleAnim); } else { IdleAnim = AnimPack.EditorIdleAnim[0]; int value; int num = (_animationHashes.TryGetValue(((Object)IdleAnim).name, out value) ? value : Animator.StringToHash(((Object)IdleAnim).name)); animator.CrossFade(num, 0.2f); _currentState = (0, IdleAnim); } } public bool HasAnimation(int animationHash, int layer = 0) { return animator.HasState(layer, animationHash); } } public class BaseOnion : Onion, IGenerationSwitchable { [CompilerGenerated] private sealed class <>c__DisplayClass17_0 { public List renderers; internal bool b__0(Renderer er) { return !renderers.Contains(er); } } [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PikminItem item; public PikminType targetType; public BaseOnion <>4__this; private <>c__DisplayClass17_0 <>8__1; private Transform 5__2; private Vector3 5__3; private Quaternion 5__4; private Vector3 5__5; private float 5__6; private float 5__7; private float 5__8; private float 5__9; private Vector3 5__10; private RagdollGrabbableObject 5__11; private int 5__12; private List.Enumerator <>s__13; private Renderer 5__14; private Material[] <>s__15; private int <>s__16; private Material 5__17; private float 5__18; private float 5__19; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; 5__11 = null; <>s__13 = default(List.Enumerator); 5__14 = null; <>s__15 = null; 5__17 = null; <>1__state = -2; } private bool MoveNext() { //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass17_0(); LethalMin.Logger.LogInfo((object)("LethalMin: Animate item " + ((Object)((Component)item).gameObject).name + " into onion of type " + <>4__this.onionType.TypeName + "!")); item.ItemScript.grabbable = false; item.settings.GrabableToPikmin = false; item.settings.OverrideGrabbableToEnemeis = false; item.ItemScript.grabbableToEnemies = false; ((Behaviour)item.ItemScript).enabled = false; 5__2 = ((Component)item.ItemScript).transform; 5__3 = 5__2.position; 5__4 = 5__2.rotation; 5__5 = 5__2.localScale; <>8__1.renderers = ((Component)item.ItemScript).gameObject.GetComponentsInChildren().ToList(); <>8__1.renderers.AddRange(item.ExtraRenderers.Where((Renderer er) => !<>8__1.renderers.Contains(er))); <>8__1.renderers.RemoveAll((Renderer r) => (Object)(object)r == (Object)null); <>s__13 = <>8__1.renderers.GetEnumerator(); try { while (<>s__13.MoveNext()) { 5__14 = <>s__13.Current; <>s__15 = 5__14.materials; for (<>s__16 = 0; <>s__16 < <>s__15.Length; <>s__16++) { 5__17 = <>s__15[<>s__16]; if (5__17.HasProperty("_EmissiveColor")) { 5__17.SetInt("_UseEmissiveIntensity", 1); 5__17.SetFloat("_EmissiveExposureWeight", 1f); 5__17.SetColor("_EmissiveColor", Color.white); } 5__17 = null; } <>s__15 = null; 5__14 = null; } } finally { ((IDisposable)<>s__13).Dispose(); } <>s__13 = default(List.Enumerator); <>4__this.audioSource.PlayOneShot(<>4__this.pack.VacItemSound); <>4__this.anim.SetTrigger("Inhale"); 5__6 = 0.5f; 5__7 = 0f; 5__8 = 150f; goto IL_0393; case 1: <>1__state = -1; goto IL_0393; case 2: { <>1__state = -1; break; } IL_0393: if (5__7 < 5__6) { 5__2.rotation = Quaternion.Euler(0f, Mathf.Sin(5__7 * 10f) * 5__8, 0f) * 5__4; 5__7 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } 5__9 = 1f; 5__7 = 0f; if ((Object)(object)<>4__this.ItemHoverPosition == (Object)null) { LethalMin.Logger.LogWarning((object)"ItemHoverPosition is null in onion!"); return false; } 5__10 = <>4__this.ItemHoverPosition.position; break; } if (5__7 < 5__9) { 5__18 = 5__7 / 5__9; 5__19 = Mathf.SmoothStep(0f, 1f, 5__18); ((Component)item.ItemScript).transform.position = Vector3.Lerp(5__3, 5__10, 5__19); 5__2.rotation = Quaternion.Slerp(5__4, Quaternion.Euler(0f, 360f * 5__19, 0f) * 5__4, 5__19); 5__2.localScale = Vector3.Lerp(5__5, Vector3.zero, 5__19); 5__7 += Time.deltaTime; <>2__current = null; <>1__state = 2; return true; } 5__2.position = 5__10; 5__2.localScale = Vector3.zero; 5__2.rotation = Quaternion.Euler(0f, 0f, 0f); <>4__this.audioSource.Stop(); <>4__this.audioSource.PlayOneShot(<>4__this.pack.SuckInItemSound); <>4__this.anim.SetTrigger("Suck"); if (((Component)item.ItemScript).TryGetComponent(ref 5__11)) { if (((NetworkBehaviour)<>4__this).IsServer) { <>4__this.SetPlayerToBeRevived(5__11, targetType.PikminTypeID); } return false; } if ((bool)LethalMin.AllowOnionToReviveMaskeds && (Object)(object)item.EnemyGrabbableObject != (Object)null && item.EnemyGrabbableObject.ai is MaskedPlayerEnemy) { if (((NetworkBehaviour)<>4__this).IsServer) { <>4__this.SetEnemyToBeRevived(item.EnemyGrabbableObject); } return false; } 5__12 = item.settings.SproutsToSpawn; if ((Object)(object)item.settings.PerferedType == (Object)(object)targetType && item.settings.PerferedTypeMultipler > 0f) { 5__12 = Mathf.RoundToInt((float)item.settings.SproutsToSpawn * item.settings.PerferedTypeMultipler); } <>4__this.AddSproutsToSpawn(targetType, 5__12); item.IncrumentDestoryCountServerRpc(); 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__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BaseOnion <>4__this; private GameObject 5__1; private List.Enumerator <>s__2; private PikminType 5__3; private int 5__4; private int 5__5; private int 5__6; private Vector3 5__7; private Quaternion 5__8; private Sprout 5__9; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } 5__1 = null; <>s__2 = default(List.Enumerator); 5__3 = null; 5__9 = null; <>1__state = -2; } private bool MoveNext() { //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0309: 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_039a: Expected O, but got Unknown try { int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -3; goto IL_03b1; } <>1__state = -1; 5__1 = LethalMin.SproutPrefab; <>s__2 = <>4__this.TypesToSpawn.Keys.ToList().GetEnumerator(); <>1__state = -3; goto IL_03fc; IL_03fc: if (<>s__2.MoveNext()) { 5__3 = <>s__2.Current; if (<>4__this.TypesToSpawn[5__3] > 0) { 5__4 = <>4__this.TypesToSpawn[5__3]; 5__5 = 0; <>4__this.anim.SetTrigger("Exhale"); <>4__this.audioSource.PlayOneShot(<>4__this.pack.SproutSound); 5__6 = 0; goto IL_03c4; } goto IL_03f4; } <>m__Finally1(); <>s__2 = default(List.Enumerator); <>4__this.SpawnSproutsRoutine = null; return false; IL_03b1: 5__6++; goto IL_03c4; IL_03f4: 5__3 = null; goto IL_03fc; IL_03c4: if (5__6 < 5__4) { if (5__6 + PikminManager.instance.PikminAIs.Count >= LethalMin.MaxPikmin.InternalValue && ((NetworkBehaviour)<>4__this).IsServer) { LethalMin.Logger.LogInfo((object)("Adding sprout directly into onion instead of spawning " + ((Object)((Component)<>4__this).gameObject).name + "!")); <>4__this.AddPikminClientRpc(new PikminData { TypeID = 5__3.PikminTypeID, GrowthStage = 0, DebugName = 5__3.PikminName + "_" + PikUtils.GenerateRandomString(new Random(StartOfRound.Instance.randomMapSeed + 5__6)), BirthDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") }); } else if (((NetworkBehaviour)<>4__this).IsServer) { LethalMin.Logger.LogInfo((object)$"Spawning sprout {5__6} of {5__4} for {5__3.PikminName} from onion {((Object)((Component)<>4__this).gameObject).name}!"); 5__7 = <>4__this.GetPositionToSpawnSprout(8f, ((Component)<>4__this).transform.position.y); 5__8 = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f); 5__9 = Object.Instantiate(5__1, 5__7, Quaternion.identity).GetComponent(); 5__9.pikminType = 5__3; 5__9.IsPersistant = true; ((NetworkBehaviour)5__9).NetworkObject.Spawn(false); 5__9.InitalizeClientRpc(<>4__this.SproutSpawnPos.position, 5__7, 5__8, 5__3.PikminTypeID); 5__9 = null; } 5__5++; if (5__5 >= 2) { 5__5 = 0; <>4__this.anim.SetTrigger("Exhale"); <>4__this.audioSource.PlayOneShot(<>4__this.pack.SproutSound); <>2__current = (object)new WaitForSeconds(0.55f); <>1__state = 1; return true; } goto IL_03b1; } <>4__this.TypesToSpawn[5__3] = 0; goto IL_03f4; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__2).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BaseOnion <>4__this; private List.Enumerator <>s__1; private Renderer 5__2; 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() { <>s__1 = default(List.Enumerator); 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: <>1__state = -1; <>s__1 = <>4__this.renderersToEnable.GetEnumerator(); try { while (<>s__1.MoveNext()) { 5__2 = <>s__1.Current; if ((Object)(object)5__2 != (Object)null) { 5__2.enabled = true; } 5__2 = null; } } finally { ((IDisposable)<>s__1).Dispose(); } <>s__1 = default(List.Enumerator); 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 OnionSoundPack pack = null; public Animator anim = null; public AudioSource audioSource = null; public Transform MeshConatiner = null; public GameObject FuniOnionMesh = null; public GameObject OnionMesh = null; public Transform ItemHoverPosition = null; public InteractTrigger IntTrigger = null; public BaseOnionFusionProperties fusionProperties = null; private float leaveCheckInterval = 0.1f; private bool IsLeavingPlanet; private List renderersToEnable = new List(); public void Awake() { } public override void Start() { base.Start(); if ((Object)(object)audioSource == (Object)null) { audioSource = ((Component)this).GetComponentInChildren(); } if ((Object)(object)onionType.OnionOverrideModelPrefab == (Object)null) { OnionMesh = Object.Instantiate(LethalMin.DefultOnionMesh, MeshConatiner); } else { OnionMesh = Object.Instantiate(onionType.OnionOverrideModelPrefab, MeshConatiner); } Renderer[] componentsInChildren = OnionMesh.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (val.enabled) { renderersToEnable.Add(val); val.enabled = false; } } GenerationManager.Instance.Register(this); SwitchGeneration(PikUtils.ConvertCfgGenerationToPikminGeneration(LethalMin.OnionModelGeneration.InternalValue)); AllClimbLinks = ((Component)this).GetComponentsInChildren(true).ToList(); anim.Play("Land"); ((MonoBehaviour)this).StartCoroutine(WaitToShow()); } [IteratorStateMachine(typeof(d__14))] private IEnumerator WaitToShow() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { <>4__this = this }; } public override void Update() { base.Update(); if (StartOfRound.Instance.shipIsLeaving && !IsLeavingPlanet) { if (leaveCheckInterval >= 0f) { leaveCheckInterval -= Time.deltaTime; } else { LethalMin.Logger.LogDebug((object)$"LethalMin: Checking if we can leave planet {((Object)((Component)this).gameObject).name}! {GetTypesCanHoldNotInsideOnion()}"); if (GetTypesCanHoldNotInsideOnion() == 0) { LeavePlanet(); } leaveCheckInterval = 0.1f; } } if ((bool)LethalMin.FuniOnion) { ((Component)MeshConatiner).gameObject.SetActive(false); FuniOnionMesh.SetActive(true); } else { ((Component)MeshConatiner).gameObject.SetActive(true); FuniOnionMesh.SetActive(false); } } public override void SuckItemIntoOnion(PikminItem item, PikminType targetType = null) { if ((Object)(object)item == (Object)null) { LethalMin.Logger.LogError((object)"LethalMin: null item when sucking into onion!"); } else if ((Object)(object)item.settings == (Object)null) { LethalMin.Logger.LogError((object)"LethalMin: null item settings when sucking into onion!"); } else if (item.settings.CanProduceSprouts) { if (item.settings.SproutsToSpawn <= 0) { LethalMin.Logger.LogWarning((object)("LethalMin: item " + ((Object)((Component)item).gameObject).name + " sprouts to spawn is less than or equal to 0!")); } else if (!onionType.TypesCanHold.ToList().Contains(targetType)) { LethalMin.Logger.LogWarning((object)("LethalMin: item " + ((Object)((Component)item).gameObject).name + " for " + targetType.PikminName + " cannot be sucked into onion of type " + onionType.TypeName + "!")); } else { LethalMin.Logger.LogInfo((object)("LethalMin: Sucking item " + ((Object)((Component)item).gameObject).name + " into onion of type " + onionType.TypeName + "!")); ((MonoBehaviour)this).StartCoroutine(AnimateItemIntoOnion(item, targetType)); } } } [IteratorStateMachine(typeof(d__17))] public IEnumerator AnimateItemIntoOnion(PikminItem item, PikminType targetType) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this, item = item, targetType = targetType }; } public override void SpawnSprouts() { SpawnSproutsRoutine = ((MonoBehaviour)this).StartCoroutine(SproutSpawnRoutine()); LethalMin.Logger.LogInfo((object)("LethalMin: Sprouts spawned from onion " + ((Object)((Component)this).gameObject).name + "!")); } [IteratorStateMachine(typeof(d__19))] private IEnumerator SproutSpawnRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { <>4__this = this }; } public override void RevivePlayerViaOnion(PlayerControllerB player, int TypeID) { base.RevivePlayerViaOnion(player, TypeID); audioSource.PlayOneShot(pack.PlayerReviveSound); } public void LeavePlanet() { anim.Play("TakeOff"); IsLeavingPlanet = true; } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); GenerationManager.Instance.Unregister(this); } public void SwitchGeneration(PikminGeneration generation) { if (LethalMin.RandomizeGenerationModels.InternalValue) { generation = (PikminGeneration)Random.Range(0, Enum.GetValues(typeof(PikminGeneration)).Length); } OnionModelRefernces modelRefernces = ((Component)this).GetComponentInChildren(); bool flag = false; OnionModelGeneration[] generations = modelRefernces.Generations; foreach (OnionModelGeneration onionModelGeneration in generations) { if (!PikChecks.IsGenerationValid(onionModelGeneration)) { LethalMin.Logger.LogError((object)$"Generation {onionModelGeneration.Generation} is not valid for this Onion! Generation: {generation}, Type: {onionType.TypeName}"); continue; } onionModelGeneration.Model.SetActive(onionModelGeneration.Generation == generation); if (onionModelGeneration.Generation == generation) { applyGeneration(onionModelGeneration); flag = true; } } if (!flag) { LethalMin.Logger.LogWarning((object)$"Failed to find a valid generation for Onion! Generation: {generation}, Type: {onionType.TypeName}"); useDefultGeneration(); } void applyGeneration(OnionModelGeneration gen) { //IL_00ec: 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) anim = gen.Animator; MatchBeam(gen.SummonBeam); ClimbLinks = gen.ClimbLinks; ItemDropPos = gen.ItemDropPos; SproutSpawnPos = gen.SproutSpawnPos; ItemHoverPosition = gen.ItemHoverPos; if ((Object)(object)gen.SoundPack == (Object)null) { gen.SoundPack = LethalMin.DefaultOnionSoundPack; } pack = gen.SoundPack; if ((Object)(object)gen.SummonBeam.GetComponent() != (Object)null) { gen.SummonBeam.GetComponent().enabled = false; } gen.SummonBeam.GetComponent().material.color = new Color(onionType.OnionColor.r, onionType.OnionColor.g, onionType.OnionColor.b, gen.SummonBeam.GetComponent().material.color.a); fusionProperties = gen.FusionProperties; fusionProperties.MainOnionRenderer = gen.MainOnionRenderer; fusionProperties.ApplyFusionProperties(onionType, fusedTypes); } void useDefultGeneration() { modelRefernces.Model.SetActive(true); anim = modelRefernces.Animator; MatchBeam(modelRefernces.SummonBeam); ClimbLinks = modelRefernces.ClimbLinks; ItemDropPos = modelRefernces.ItemDropPos; SproutSpawnPos = modelRefernces.SproutSpawnPos; ItemHoverPosition = modelRefernces.ItemHoverPos; if ((Object)(object)modelRefernces.SoundPack == (Object)null) { modelRefernces.SoundPack = LethalMin.DefaultOnionSoundPack; } pack = modelRefernces.SoundPack; if ((Object)(object)modelRefernces.SummonBeam.GetComponent() != (Object)null) { modelRefernces.SummonBeam.GetComponent().enabled = false; } fusionProperties = modelRefernces.FusionProperties; fusionProperties.MainOnionRenderer = modelRefernces.MainOnionRenderer; fusionProperties.ApplyFusionProperties(onionType, fusedTypes); } } public void MatchBeam(GameObject go = null) { //IL_0059: 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_0091: Unknown result type (might be due to invalid IL or missing references) Renderer component = go.GetComponent(); Material material = component.material; Collider component2 = go.GetComponent(); Mesh sharedMesh = null; MeshFilter val = default(MeshFilter); if (go.TryGetComponent(ref val)) { sharedMesh = val.sharedMesh; } SkinnedMeshRenderer val2 = default(SkinnedMeshRenderer); if (go.TryGetComponent(ref val2)) { sharedMesh = val2.sharedMesh; } ((Component)IntTrigger).transform.position = go.transform.position; ((Component)IntTrigger).transform.rotation = go.transform.rotation; ((Component)IntTrigger).transform.localScale = go.transform.lossyScale; ((Component)IntTrigger).GetComponent().material = material; ((Component)IntTrigger).GetComponent().sharedMesh = sharedMesh; } public void OnBeamInteract(PlayerControllerB controller) { OnionHUDManager.instance.SetCurrentOnion(this); OnionHUDManager.instance.OpenMenu(); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BaseOnion"; } } public abstract class BaseOnionFusionProperties : MonoBehaviour { public Renderer MainOnionRenderer = null; public virtual void ApplyFusionProperties(OnionType onionType = null, List fusedTypes = null) { } } public class BoomBoxPikminInteraction : MonoBehaviour { public BoomboxItem boomBoxInstance = null; public float maxDistance = 15f; public float DistanceCheckInterval = 0.2f; private List pikminInRange = new List(); private bool LastIsPlayingMusic = false; private Dictionary CachedAnimIndex = new Dictionary(); public PikminItem PikItm = null; private void Start() { PikItm = ((Component)this).GetComponentInChildren(); } private void Update() { if (boomBoxInstance.isPlayingMusic != LastIsPlayingMusic) { LastIsPlayingMusic = boomBoxInstance.isPlayingMusic; OnBoomBoxToggle(); } PikItm.settings.GrabableToPikmin = (bool)LethalMin.AllowOnBBtobeGrabed || !boomBoxInstance.isPlayingMusic; if (DistanceCheckInterval > 0f) { DistanceCheckInterval -= Time.deltaTime; return; } DistanceCheckInterval = 0.2f; CheckNearbyPikmin(); } private void OnBoomBoxToggle() { pikminInRange.RemoveAll((PikminAI? ai) => (Object)(object)ai == (Object)null); if (boomBoxInstance.isPlayingMusic) { return; } foreach (PikminAI item in pikminInRange) { if (!((Object)(object)item == (Object)null)) { item.animController.RandomIdle = 0; } } pikminInRange.Clear(); } private void CheckNearbyPikmin() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (!boomBoxInstance.isPlayingMusic) { pikminInRange.Clear(); return; } foreach (PikminAI pikminAI in PikminManager.instance.PikminAIs) { float num = Vector3.Distance(((Component)pikminAI).transform.position, ((Component)boomBoxInstance).transform.position); if (num < maxDistance) { if (!pikminInRange.Contains(pikminAI)) { pikminInRange.Add(pikminAI); } } else if (pikminInRange.Contains(pikminAI)) { pikminInRange.Remove(pikminAI); } } foreach (PikminAI item in pikminInRange) { if (!((Object)(object)item == (Object)null)) { if (!CachedAnimIndex.ContainsKey(item.animController.AnimPack)) { CachedAnimIndex[item.animController.AnimPack] = SpecialPikminIdleInteraction.FindIdleIndexForSpecialAnim(item, "dance"); LethalMin.Logger.LogInfo((object)$"BoomBoxPikminInteraction: Cached idle index for {item.DebugID} in pack {((Object)item.animController.AnimPack).name} is {CachedAnimIndex[item.animController.AnimPack]}"); } item.animController.RandomIdle = CachedAnimIndex[item.animController.AnimPack]; } } } } [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] public class CompatClassAttribute : Attribute { public string ModGUID { get; private set; } public CompatClassAttribute(string modGUID) { ModGUID = modGUID; } } public class ConfigItem { public ConfigEntry Entry = null; public string Section = ""; public string Name = ""; public string Description = ""; public T InternalValue = default(T); public string ItemArgs = string.Empty; public bool NeedsRestart = false; public ConfigItemAuthority Authority; private bool _isCollection = false; private Type _elementType = null; public ConfigEntry StringEntry = null; public object? baseConfigItem = null; public static Dictionary InstructionsMap = new Dictionary { { typeof(Vector2), LethalMin.UseCommasInVectorConfigs.Value ? "\n(Vector2), sperated by commas, no spaces (x,y)" : " (Vector2), sperated by spaces, no commas (x y)" }, { typeof(Vector3), LethalMin.UseCommasInVectorConfigs.Value ? "\n(Vector3), sperated by commas, no spaces (x,y,z)" : " (Vector3), sperated by spaces, no commas (x y z)" }, { typeof(Color), "\n(Color), in hex format (RRGGBBAA)" } }; public ConfigFile? OverrideConfigFile = null; private Assembly _callingAssembly = null; private static readonly Dictionary _configFileFallbackCache = new Dictionary(); public T DefaultValue { get; private set; } = default(T); private bool _isPesudoStringType => _isCollection || typeof(T) == typeof(Vector2) || typeof(T) == typeof(Vector3); public event Action OnValueChanged = null; public ConfigItem(string section, string key, T defaultValue, string description, bool needsRestart, ConfigItemAuthority authority, ConfigFile ovrcfg, string args = "") { OverrideConfigFile = ovrcfg; _callingAssembly = Assembly.GetCallingAssembly(); Initialize(section, key, defaultValue, description, needsRestart, authority, args); } public ConfigItem(string section, string key, T defaultValue, string description, bool needsRestart, ConfigItemAuthority authority, string args = "") { _callingAssembly = Assembly.GetCallingAssembly(); Initialize(section, key, defaultValue, description, needsRestart, authority, args); OverrideConfigFile = null; } private void Initialize(string section, string key, T defaultValue, string description, bool needsRestart, ConfigItemAuthority authority, string args) { Section = section; Name = key; DefaultValue = defaultValue; Description = description; ItemArgs = args; NeedsRestart = needsRestart; Authority = authority; Type typeFromHandle = typeof(T); string text = (InstructionsMap.ContainsKey(typeFromHandle) ? InstructionsMap[typeFromHandle] : ""); _isCollection = IsCollectionType(typeFromHandle, out _elementType); if (typeFromHandle.IsGenericType && typeFromHandle.GetGenericTypeDefinition() == typeof(List<>)) { text = "\n(List), separated by commas, no spaces in between (item1,item2,item3)"; } if (typeFromHandle.IsArray) { text = "\n(Array), separated by commas, no spaces in between (item1,item2,item3)"; } Description += text; if (_isCollection && _elementType.IsEnum) { string[] names = Enum.GetNames(_elementType); Description = Description + "\nPossible values: " + string.Join(", ", names); } BindEntry(); try { if (LethalMin.IsDependencyLoaded("ainavt.lc.lethalconfig") && OverrideConfigFile == null) { BindLCEntry(); } } catch (Exception arg) { LethalMin.Logger.LogError((object)$"Error binding LC config item {Name}: {arg}"); } if (_isPesudoStringType) { InternalValue = ConvertFromString(StringEntry.Value); StringEntry.SettingChanged += OnPesudoStringSettingChanged; } else { InternalValue = Entry.Value; Entry.SettingChanged += OnSettingChanged; } } private bool IsCollectionType(Type type, out Type elementType) { elementType = null; if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(List<>)) { elementType = type.GetGenericArguments()[0]; return IsSupportedElementType(elementType); } if (type.IsArray) { elementType = type.GetElementType(); return IsSupportedElementType(elementType); } return false; } public bool IsSupportedElementType(Type type) { return type == typeof(string) || type == typeof(int) || type == typeof(float) || type == typeof(bool) || type == typeof(Color) || type == typeof(Vector2) || type == typeof(Vector3) || type.IsEnum; } private ConfigFile GetConfigFileForAssembly(Assembly assembly) { if (assembly != null) { foreach (PluginInfo value in Chainloader.PluginInfos.Values) { if ((Object)(object)value.Instance != (Object)null && ((object)value.Instance).GetType().Assembly == assembly) { return value.Instance.Config; } } BaseUnityPlugin[] array = Object.FindObjectsOfType(); BaseUnityPlugin[] array2 = array; foreach (BaseUnityPlugin val in array2) { if ((Object)(object)val != (Object)null && ((object)val).GetType().Assembly == assembly) { return val.Config; } } string pluginGuidFromAssembly = GetPluginGuidFromAssembly(assembly); if (!string.IsNullOrEmpty(pluginGuidFromAssembly)) { return GetOrCreateConfigFileByGuid(pluginGuidFromAssembly); } } return ((BaseUnityPlugin)LethalMin.Instance).Config; } private static string? GetPluginGuidFromAssembly(Assembly assembly) { try { Type[] types = assembly.GetTypes(); foreach (Type type in types) { if (!typeof(BaseUnityPlugin).IsAssignableFrom(type)) { continue; } object[] customAttributes = type.GetCustomAttributes(typeof(BepInPlugin), inherit: false); if (customAttributes.Length != 0) { object obj = customAttributes[0]; BepInPlugin val = (BepInPlugin)((obj is BepInPlugin) ? obj : null); if (val != null && !string.IsNullOrEmpty(val.GUID)) { return val.GUID; } } } } catch (ReflectionTypeLoadException) { return null; } return null; } private static ConfigFile GetOrCreateConfigFileByGuid(string guid) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown if (_configFileFallbackCache.TryGetValue(guid, out ConfigFile value)) { return value; } string text = Path.Combine(Paths.ConfigPath, guid + ".cfg"); ConfigFile val = new ConfigFile(text, true); _configFileFallbackCache[guid] = val; return val; } public void BindEntry() { ConfigFile val = OverrideConfigFile ?? GetConfigFileForAssembly(_callingAssembly); if (_isCollection) { string text = ConvertToString(DefaultValue); StringEntry = val.Bind(Section, Name, text, Description); Entry = null; } else if (typeof(T) == typeof(Vector2) || typeof(T) == typeof(Vector3)) { string text2 = ConvertToString(DefaultValue); StringEntry = val.Bind(Section, Name, text2, Description); Entry = null; } else { Entry = val.Bind(Section, Name, DefaultValue, "(" + Authority.ToString() + ") " + Description); } } public string ConvertToString(T value) { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) if (value == null) { return string.Empty; } if (_isCollection) { if (!((object)value is IEnumerable enumerable)) { return string.Empty; } List list = new List(); foreach (object item in enumerable) { list.Add(ConvertItemToString(item)); } return string.Join(",", list); } if (value is Vector2) { object obj = value; Vector2 val = (Vector2)((obj is Vector2) ? obj : null); if (true) { return LethalMin.UseCommasInVectorConfigs.Value ? $"{val.x},{val.y}" : $"{val.x} {val.y}"; } } if (value is Vector3) { object obj2 = value; Vector3 val2 = (Vector3)((obj2 is Vector3) ? obj2 : null); if (true) { return LethalMin.UseCommasInVectorConfigs.Value ? $"{val2.x},{val2.y},{val2.z}" : $"{val2.x} {val2.y} {val2.z}"; } } return value.ToString(); } private string ConvertItemToString(object item) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) if (item == null) { return string.Empty; } if (item is Color val) { return ColorUtility.ToHtmlStringRGBA(val); } if (item is Vector2 val2) { return LethalMin.UseCommasInVectorConfigs.Value ? $"{val2.x},{val2.y}" : $"{val2.x} {val2.y}"; } if (item is Vector3 val3) { return LethalMin.UseCommasInVectorConfigs.Value ? $"{val3.x},{val3.y},{val3.z}" : $"{val3.x} {val3.y} {val3.z}"; } return item.ToString(); } private object ConvertStringToItem(string value, Type targetType) { //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(value)) { return targetType.IsValueType ? Activator.CreateInstance(targetType) : null; } if (targetType == typeof(string)) { return value; } if (targetType == typeof(int)) { if (int.TryParse(value, out var result)) { return result; } return 0; } if (targetType == typeof(float)) { if (float.TryParse(value, out var result2)) { return result2; } return 0f; } if (targetType == typeof(bool)) { if (bool.TryParse(value, out var result3)) { return result3; } return false; } if (targetType == typeof(Color)) { Color val = default(Color); if (ColorUtility.TryParseHtmlString("#" + value, ref val)) { return val; } return Color.white; } if (targetType == typeof(Vector2)) { string[] array = value.Split(LethalMin.UseCommasInVectorConfigs.Value ? ',' : ' '); if (array.Length >= 2 && float.TryParse(array[0], out var result4) && float.TryParse(array[1], out var result5)) { return (object)new Vector2(result4, result5); } return Vector2.zero; } if (targetType == typeof(Vector3)) { string[] array2 = value.Split(LethalMin.UseCommasInVectorConfigs.Value ? ',' : ' '); if (array2.Length >= 3 && float.TryParse(array2[0], out var result6) && float.TryParse(array2[1], out var result7) && float.TryParse(array2[2], out var result8)) { return (object)new Vector3(result6, result7, result8); } return Vector3.zero; } if (targetType.IsEnum) { try { return Enum.Parse(targetType, value); } catch { return Enum.GetValues(targetType).GetValue(0); } } return targetType.IsValueType ? Activator.CreateInstance(targetType) : null; } private T ConvertFromString(string value) { if (string.IsNullOrEmpty(value)) { if (typeof(T).IsGenericType && typeof(T).GetGenericTypeDefinition() == typeof(List<>)) { return (T)Activator.CreateInstance(typeof(T)); } if (typeof(T).IsArray) { return (T)Activator.CreateInstance(typeof(T), 0); } return default(T); } if (typeof(T) == typeof(Vector2) || typeof(T) == typeof(Vector3)) { return (T)ConvertStringToItem(value, typeof(T)); } if (!_isCollection) { return default(T); } string[] array = value.Split(','); if (typeof(T).IsGenericType && typeof(T).GetGenericTypeDefinition() == typeof(List<>)) { object obj = Activator.CreateInstance(typeof(T)); MethodInfo method = typeof(T).GetMethod("Add"); if (obj != null && method != null) { string[] array2 = array; foreach (string value2 in array2) { if (!string.IsNullOrEmpty(value2)) { object obj2 = ConvertStringToItem(value2, _elementType); method.Invoke(obj, new object[1] { obj2 }); } } return (T)obj; } } else if (typeof(T).IsArray) { Array array3 = Array.CreateInstance(_elementType, array.Length); for (int j = 0; j < array.Length; j++) { if (!string.IsNullOrEmpty(array[j])) { array3.SetValue(ConvertStringToItem(array[j], _elementType), j); } } return (T)(object)array3; } return default(T); } public void BindLCEntry() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Expected O, but got Unknown //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Expected O, but got Unknown //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Expected O, but got Unknown //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Expected O, but got Unknown //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Expected O, but got Unknown //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Expected O, but got Unknown //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Expected O, but got Unknown //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Expected O, but got Unknown //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Expected O, but got Unknown //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Expected O, but got Unknown //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Expected O, but got Unknown object? obj = baseConfigItem; BaseConfigItem val = (BaseConfigItem)((obj is BaseConfigItem) ? obj : null); if (_isPesudoStringType) { val = (BaseConfigItem)new TextInputFieldConfigItem(StringEntry, NeedsRestart); LethalConfigManager.AddConfigItem(val); baseConfigItem = val; return; } if (typeof(T) == typeof(int) || typeof(T) == typeof(float)) { if (ItemArgs.Contains("slider(")) { string[] array = ItemArgs.Split('(', ')')[1].Split(','); float num = float.Parse(array[0]); float num2 = float.Parse(array[1]); if (typeof(T) == typeof(int)) { ConfigEntry obj2 = Entry as ConfigEntry; IntSliderOptions val2 = new IntSliderOptions(); ((BaseRangeOptions)val2).Min = (int)num; ((BaseRangeOptions)val2).Max = (int)num2; ((BaseOptions)val2).RequiresRestart = NeedsRestart; val = (BaseConfigItem)new IntSliderConfigItem(obj2, val2); LethalConfigManager.AddConfigItem(val); } else { ConfigEntry obj3 = Entry as ConfigEntry; FloatSliderOptions val3 = new FloatSliderOptions(); ((BaseRangeOptions)val3).Min = num; ((BaseRangeOptions)val3).Max = num2; ((BaseOptions)val3).RequiresRestart = NeedsRestart; val = (BaseConfigItem)new FloatSliderConfigItem(obj3, val3); LethalConfigManager.AddConfigItem(val); } } else if (ItemArgs.Contains("floatstepslider(") && typeof(T) == typeof(float)) { string[] array2 = ItemArgs.Split('(', ')')[1].Split(','); float min = float.Parse(array2[0]); float max = float.Parse(array2[1]); float step = float.Parse(array2[2]); ConfigEntry obj4 = Entry as ConfigEntry; FloatStepSliderOptions val4 = new FloatStepSliderOptions(); ((BaseRangeOptions)val4).Min = min; ((BaseRangeOptions)val4).Max = max; val4.Step = step; ((BaseOptions)val4).RequiresRestart = NeedsRestart; val = (BaseConfigItem)new FloatStepSliderConfigItem(obj4, val4); LethalConfigManager.AddConfigItem(val); } else if (typeof(T) == typeof(int)) { val = (BaseConfigItem)new IntInputFieldConfigItem(Entry as ConfigEntry, NeedsRestart); LethalConfigManager.AddConfigItem(val); } else { val = (BaseConfigItem)new FloatInputFieldConfigItem(Entry as ConfigEntry, NeedsRestart); LethalConfigManager.AddConfigItem(val); } } else if (typeof(T) == typeof(string)) { if (ItemArgs.ToLower().Contains("color")) { val = (BaseConfigItem)new HexColorInputFieldConfigItem(Entry as ConfigEntry, NeedsRestart); LethalConfigManager.AddConfigItem(val); } else { val = (BaseConfigItem)new TextInputFieldConfigItem(Entry as ConfigEntry, NeedsRestart); LethalConfigManager.AddConfigItem(val); } } else if (typeof(T) == typeof(bool)) { val = (BaseConfigItem)new BoolCheckBoxConfigItem(Entry as ConfigEntry, NeedsRestart); LethalConfigManager.AddConfigItem(val); } else if (typeof(T).IsEnum) { if (ItemArgs.ToLower().Contains("boolenum")) { val = (BaseConfigItem)new BoolCheckBoxConfigItem(Entry as ConfigEntry, NeedsRestart); LethalConfigManager.AddConfigItem(val); } else { Type type = typeof(EnumDropDownConfigItem<>).MakeGenericType(typeof(T)); object obj5 = Activator.CreateInstance(type, Entry, NeedsRestart); val = (BaseConfigItem)((obj5 is BaseConfigItem) ? obj5 : null); if (val != null) { LethalConfigManager.AddConfigItem(val); } else { LethalMin.Logger.LogWarning((object)$"Failed to create config item for enum type {typeof(T)}."); } } } else { LethalMin.Logger.LogWarning((object)$"{Name}: Unsupported type {typeof(T)} for LethalConfig binding."); } if (val != null) { baseConfigItem = val; } else { LethalMin.Logger.LogWarning((object)$"Failed to bind config item {Name} of type {typeof(T)} to LethalConfig. No baseConfigItem created."); } } private void OnSettingChanged(object sender, EventArgs e) { InternalValue = Entry.Value; this.OnValueChanged?.Invoke(InternalValue); } private void OnPesudoStringSettingChanged(object sender, EventArgs e) { InternalValue = ConvertFromString(StringEntry.Value); this.OnValueChanged?.Invoke(InternalValue); } public static implicit operator bool(ConfigItem item) { if (typeof(T) != typeof(bool)) { StackTrace arg = new StackTrace(); LethalMin.Logger.LogFatal((object)$"Config {item?.Name} is not a bool, cannot implictly convert. StackTrace: \n {arg}"); } if (typeof(T) == typeof(bool) && item != null && item.InternalValue != null) { return (bool)(object)item.InternalValue; } LethalMin.Logger.LogFatal((object)$"Unable to properly implictly convert config {item?.Name} to bool. Type: {typeof(T)}"); return false; } public static implicit operator float(ConfigItem item) { if (typeof(T) != typeof(float)) { StackTrace arg = new StackTrace(); LethalMin.Logger.LogFatal((object)$"Config {item?.Name} is not a float, cannot implictly convert. StackTrace: \n {arg}"); } if (typeof(T) == typeof(float) && item != null && item.InternalValue != null) { return (float)(object)item.InternalValue; } LethalMin.Logger.LogFatal((object)$"Unable to properly implictly convert config {item?.Name} to float. Type: {typeof(T)}"); return 0f; } public static implicit operator int(ConfigItem item) { if (typeof(T) != typeof(int)) { StackTrace arg = new StackTrace(); LethalMin.Logger.LogFatal((object)$"Config {item?.Name} is not a int, cannot implictly convert. StackTrace: \n {arg}"); } if (typeof(T) == typeof(int) && item != null && item.InternalValue != null) { return (int)(object)item.InternalValue; } LethalMin.Logger.LogFatal((object)$"Unable to properly implictly convert config {item?.Name} to int. Type: {typeof(T)}"); return 0; } public static implicit operator string(ConfigItem item) { if (typeof(T) != typeof(string)) { StackTrace arg = new StackTrace(); LethalMin.Logger.LogFatal((object)$"Config {item?.Name} is not a string, cannot implictly convert. StackTrace: \n {arg}"); } if (typeof(T) == typeof(string) && item != null && item.InternalValue != null) { return (string)(object)item.InternalValue; } LethalMin.Logger.LogFatal((object)$"Unable to properly implictly convert config {item?.Name} to string. Type: {typeof(T)}"); return string.Empty; } } public enum ConfigItemAuthority { None = -1, Host, Client, Local, DoNotSync } public class ConfigItemAuthorityManager : NetworkBehaviour { protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ConfigItemAuthorityManager"; } } public class CustomPlayerAnimationManager : MonoBehaviour { private struct AnimationInfo { public string stateName; public float normalizedTime; } [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float time; public CustomPlayerAnimationManager <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(time); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)<>4__this.anim.runtimeAnimatorController == (Object)(object)<>4__this.OverrideController) { LethalMin.Logger.LogWarning((object)"Auto Reverted Animator to Original Controller"); <>4__this.RevertAnimator(); } <>4__this.revertCoroutine = null; 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 Animator anim = null; public AnimatorOverrideController OverrideController = null; public RuntimeAnimatorController OriginalController = null; public bool AllowOverlap = false; public bool CheckforAnimControllerChange = true; private float[] storedParameters = new float[0]; private bool[] storedBools = new bool[0]; private int[] storedInts = new int[0]; private AnimationInfo[] storedAnimations = new AnimationInfo[0]; private Coroutine? revertCoroutine = null; private RuntimeAnimatorController previousRAC = null; private string m_originalAnimationName = ""; private AnimationClip m_replacementClip = null; public void SetUpCustomAnimation(Animator Animator, string OriginalAnimationName, AnimationClip ReplacementClip) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown if (!Animator.runtimeAnimatorController.animationClips.Select((AnimationClip Clip) => ((Object)Clip).name).ToList().Contains(OriginalAnimationName)) { LethalMin.Logger.LogError((object)("Animator (" + ((Object)Animator).name + ") does not contain the animation " + OriginalAnimationName)); return; } anim = Animator; OriginalController = anim.runtimeAnimatorController; previousRAC = anim.runtimeAnimatorController; OverrideController = new AnimatorOverrideController(anim.runtimeAnimatorController); ((Object)OverrideController).name = ((Object)anim.runtimeAnimatorController).name + " Override Controller"; OverrideController[OriginalAnimationName] = ReplacementClip; m_originalAnimationName = OriginalAnimationName; m_replacementClip = ReplacementClip; } public void Update() { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown if (CheckforAnimControllerChange && (Object)(object)anim != (Object)null && (Object)(object)previousRAC != (Object)null && (Object)(object)OverrideController != (Object)null && (Object)(object)anim.runtimeAnimatorController != (Object)(object)previousRAC && (Object)(object)anim.runtimeAnimatorController != (Object)(object)OverrideController) { LethalMin.Logger.LogDebug((object)("Animator Controller changed from " + ((Object)previousRAC).name + " to " + ((Object)anim.runtimeAnimatorController).name)); previousRAC = anim.runtimeAnimatorController; OriginalController = anim.runtimeAnimatorController; Object.Destroy((Object)(object)OverrideController); OverrideController = new AnimatorOverrideController(anim.runtimeAnimatorController); ((Object)OverrideController).name = ((Object)anim.runtimeAnimatorController).name + " Override Controller"; OverrideController[m_originalAnimationName] = m_replacementClip; } } public void ReplaceAnimatorWithOverride(float AutoRevertTimer = 2f) { if (revertCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(revertCoroutine); revertCoroutine = null; } revertCoroutine = ((MonoBehaviour)this).StartCoroutine(AutoRevert(AutoRevertTimer)); if ((Object)(object)anim.runtimeAnimatorController == (Object)(object)OverrideController && !AllowOverlap) { LethalMin.Logger.LogWarning((object)"Animator is already the Override Controller"); return; } StoreParameters(); anim.runtimeAnimatorController = (RuntimeAnimatorController)(object)OverrideController; RestoreParameters(); LethalMin.Logger.LogInfo((object)("Replaced " + ((Object)((Component)this).gameObject).name + " Animator with Override Controller")); } [IteratorStateMachine(typeof(d__17))] private IEnumerator AutoRevert(float time) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this, time = time }; } public void RevertAnimator() { if (revertCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(revertCoroutine); revertCoroutine = null; } if ((Object)(object)anim == (Object)null) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + " Animator is null when reverting")); return; } if ((Object)(object)OriginalController == (Object)null) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + " Original Controller is null when reverting")); return; } StoreParameters(); anim.runtimeAnimatorController = OriginalController; RestoreParameters(); LethalMin.Logger.LogInfo((object)("Reverted " + ((Object)((Component)this).gameObject).name + " Animator to Original Controller")); } private void StoreParameters() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected I4, but got Unknown //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) AnimatorControllerParameter[] parameters = anim.parameters; storedParameters = new float[parameters.Length]; storedBools = new bool[parameters.Length]; storedInts = new int[parameters.Length]; storedAnimations = new AnimationInfo[anim.layerCount]; for (int i = 0; i < parameters.Length; i++) { AnimatorControllerParameter val = parameters[i]; AnimatorControllerParameterType type = val.type; AnimatorControllerParameterType val2 = type; switch (val2 - 1) { case 0: storedParameters[i] = anim.GetFloat(val.name); break; case 3: storedBools[i] = anim.GetBool(val.name); break; case 2: storedInts[i] = anim.GetInteger(val.name); break; } } for (int j = 0; j < anim.layerCount; j++) { AnimatorStateInfo currentAnimatorStateInfo = anim.GetCurrentAnimatorStateInfo(j); AnimationInfo animationInfo = default(AnimationInfo); animationInfo.stateName = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).fullPathHash.ToString(); animationInfo.normalizedTime = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime; AnimationInfo animationInfo2 = animationInfo; storedAnimations[j] = animationInfo2; } } private void RestoreParameters() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_003c: Expected I4, but got Unknown AnimatorControllerParameter[] parameters = anim.parameters; for (int i = 0; i < parameters.Length; i++) { AnimatorControllerParameter val = parameters[i]; AnimatorControllerParameterType type = val.type; AnimatorControllerParameterType val2 = type; switch (val2 - 1) { case 0: LethalMin.Logger.LogDebug((object)$"Restoring {val.name} to {storedParameters[i]}"); anim.SetFloat(val.name, storedParameters[i]); break; case 3: LethalMin.Logger.LogDebug((object)$"Restoring {val.name} to {storedBools[i]}"); anim.SetBool(val.name, storedBools[i]); break; case 2: LethalMin.Logger.LogDebug((object)$"Restoring {val.name} to {storedInts[i]}"); anim.SetInteger(val.name, storedInts[i]); break; } } for (int j = 0; j < anim.layerCount; j++) { AnimationInfo animationInfo = storedAnimations[j]; LethalMin.Logger.LogDebug((object)$"Restoring {animationInfo.stateName} to {animationInfo.normalizedTime}"); anim.Play(int.Parse(animationInfo.stateName), j, animationInfo.normalizedTime); } } } public class DirectlyPathZone : MonoBehaviour { private bool _isInZone; private void OnTriggerEnter(Collider other) { Leader leader = default(Leader); if (((Component)other).CompareTag("Player") && ((Component)other).TryGetComponent(ref leader) && ((NetworkBehaviour)leader).IsOwner) { _isInZone = true; leader.DirectPikminPath = true; } } private void OnTriggerExit(Collider other) { Leader leader = default(Leader); if (((Component)other).CompareTag("Player") && ((Component)other).TryGetComponent(ref leader) && ((NetworkBehaviour)leader).IsOwner) { _isInZone = false; leader.DirectPikminPath = false; } } private void OnDisable() { if (_isInZone) { _isInZone = false; PikminManager.instance.LocalLeader.DirectPikminPath = false; } } private void OnDestroy() { if (_isInZone) { _isInZone = false; PikminManager.instance.LocalLeader.DirectPikminPath = false; } } } public class BaboonBirdPikminEnemy : PikminEnemy { private BaboonBirdAI baboonBirdAI = null; private float BiteCooldown = 1.5f; public float BiteResetCooldown = 1.5f; protected override void Start() { base.Start(); ref BaboonBirdAI reference = ref baboonBirdAI; EnemyAI obj = enemyScript; reference = (BaboonBirdAI)(object)(((obj is BaboonBirdAI) ? obj : null) ?? throw new Exception("BaboonBirdPE: enemyScript is not a BaboonBirdAI")); if ((Object)(object)baboonBirdAI == (Object)null) { ((Behaviour)this).enabled = false; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteCooldown = LethalMin.BaboonBird_BiteCooldown.InternalValue; } } private void LateUpdate() { if (BiteCooldown > 0f) { BiteCooldown -= Time.deltaTime; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteResetCooldown = LethalMin.BaboonBird_BiteCooldown.InternalValue; } } public void OnColideWithPikmin(PikminAI Pikmin) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled && !(BiteCooldown > 0f) && !Pikmin.IsDeadOrDying && !Pikmin.IsAirborn && (!((Object)(object)Pikmin.CurrentLatchTrigger != (Object)null) || !LatchTriggers.Contains(Pikmin.CurrentLatchTrigger))) { BitePikminServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)Pikmin).NetworkObject)); BitePikmin(Pikmin); BiteCooldown = BiteResetCooldown; } } [ServerRpc(RequireOwnership = false)] public void BitePikminServerRpc(NetworkObjectReference Pikref) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2083416163u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Pikref, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2083416163u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BitePikminClientRpc(Pikref); } } } [ClientRpc] public void BitePikminClientRpc(NetworkObjectReference Pikref) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1807882219u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Pikref, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1807882219u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); PikminAI pikminAI = default(PikminAI); if (!((NetworkBehaviour)this).IsOwner && ((NetworkObjectReference)(ref Pikref)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref pikminAI)) { BitePikmin(pikminAI); } } } public void BitePikmin(PikminAI pikminAI) { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogInfo((object)("LethalMin: BaboonBirdPikminEnemy.BitePikmin: " + ((Object)((Component)pikminAI).gameObject).name + " is being bitten by " + ((Object)((Component)this).gameObject).name)); BiteCooldown = BiteResetCooldown; GrabbedPikmin.Add(pikminAI); pikminAI.GrabPikmin(baboonBirdAI.deadBodyPoint, 0.5f, 1); ((EnemyAI)baboonBirdAI).creatureAnimator.ResetTrigger("Hit"); ((EnemyAI)baboonBirdAI).creatureAnimator.SetTrigger("Hit"); ((EnemyAI)baboonBirdAI).creatureSFX.PlayOneShot(((EnemyAI)baboonBirdAI).enemyType.audioClips[5]); WalkieTalkie.TransmitOneShotAudio(((EnemyAI)baboonBirdAI).creatureSFX, ((EnemyAI)baboonBirdAI).enemyType.audioClips[5], 1f); RoundManager.Instance.PlayAudibleNoise(((Component)((EnemyAI)baboonBirdAI).creatureSFX).transform.position, 8f, 0.7f, 0, false, 0); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2083416163u, new RpcReceiveHandler(__rpc_handler_2083416163), "BitePikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(1807882219u, new RpcReceiveHandler(__rpc_handler_1807882219), "BitePikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2083416163(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 pikref = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikref, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BaboonBirdPikminEnemy)(object)target).BitePikminServerRpc(pikref); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1807882219(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 pikref = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikref, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BaboonBirdPikminEnemy)(object)target).BitePikminClientRpc(pikref); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BaboonBirdPikminEnemy"; } } public class BlobLatchTrigger : PikminLatchTrigger { public BlobPikminEnemy blobPikminEnemy = null; public void OnTriggerEnter(Collider other) { //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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) PikminCollisionDetect pikminCollisionDetect = default(PikminCollisionDetect); if (!((NetworkBehaviour)blobPikminEnemy).IsOwner || !((Component)other).TryGetComponent(ref pikminCollisionDetect) || PikChecks.IsPikminResistantToHazard(pikminCollisionDetect.mainPikmin, PikminHazard.Sticky)) { return; } if ((bool)LethalMin.UseConfigsForEnemies && LethalMin.Blob_KillPikmin.InternalValue) { pikminCollisionDetect.mainPikmin.DeathSnapToPos = ((Component)this).transform; ((EnemyAI)pikminCollisionDetect.mainPikmin).KillEnemyServerRpc(false); } else { if ((bool)LethalMin.UseConfigsForEnemies && !LethalMin.Blob_TrapPikmin.InternalValue) { return; } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Random.Range(-0.5f, 0.5f), 0f, Random.Range(-0.5f, 0.5f)); Vector3 val2 = ((Component)this).transform.position + val; if (TryLatch(pikminCollisionDetect.mainPikmin, val2, IsDirectHit: true, DoCheckOnly: true)) { if (blobPikminEnemy.PikminTrapped.Contains(pikminCollisionDetect.mainPikmin)) { blobPikminEnemy.PikminTrapped.Remove(pikminCollisionDetect.mainPikmin); LethalMin.Logger.LogInfo((object)("BlobPE: Pikmin " + pikminCollisionDetect.mainPikmin.DebugID + " skipping latch because it is already trapped")); } else { blobPikminEnemy.StickPikminServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)pikminCollisionDetect.mainPikmin).NetworkObject), val2, blobPikminEnemy.LatchTriggers.IndexOf(this)); blobPikminEnemy.StickPikmin(pikminCollisionDetect.mainPikmin, val2, this); } } } } public override bool TryLatch(PikminAI pikmin, Vector3 Point, bool IsDirectHit = true, bool DoCheckOnly = false) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (blobPikminEnemy.StickCoolDown > 0f) { return false; } if (blobPikminEnemy.IsFrozen) { return false; } if (PikChecks.IsPikminResistantToHazard(pikmin, PikminHazard.Sticky)) { return false; } if ((bool)LethalMin.UseConfigsForEnemies && !LethalMin.Blob_TrapPikmin.InternalValue) { return false; } return base.TryLatch(pikmin, Point, IsDirectHit, DoCheckOnly); } public override void LatchPikmin(PikminAI pikmin, Vector3 LandPos, bool IsDirectHit = true) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (!PikChecks.IsPikminResistantToHazard(pikmin, PikminHazard.Sticky)) { pikmin.CallResetMethods(); base.LatchPikmin(pikmin, LandPos, IsDirectHit); pikmin.Laying = true; ((EnemyAI)pikmin).creatureAnimator.Play("Pikmin_Lay"); pikmin.PlayAudioOnLocalClient(PikminSoundPackSounds.Hurt); } } public override void UnlatchPikmin(PikminAI pikmin) { if (pikmin is IcePikminAI item && blobPikminEnemy.IcePikminTrapped.Contains(item)) { blobPikminEnemy.IcePikminTrapped.Remove(item); } blobPikminEnemy.StickCoolDown = 1f; base.UnlatchPikmin(pikmin); } } public class BlobPikminEnemy : PikminEnemy { private BlobAI blobAI = null; public List PikminTrapped = new List(); public List IcePikminTrapped = new List(); public float StickCoolDown = 0f; protected override void Start() { base.Start(); ref BlobAI reference = ref blobAI; EnemyAI obj = enemyScript; reference = (BlobAI)(object)(((obj is BlobAI) ? obj : null) ?? throw new Exception("BlobPE: enemyScript is not a BlobAI")); if ((Object)(object)blobAI == (Object)null) { ((Behaviour)this).enabled = false; return; } CanShakeOffPikmin = false; PikminLatchTrigger[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren(true); LatchTriggers.Clear(); PikminLatchTrigger[] array = componentsInChildren; foreach (PikminLatchTrigger pikminLatchTrigger in array) { BlobLatchTrigger blobLatchTrigger = ((Component)pikminLatchTrigger).gameObject.AddComponent(); blobLatchTrigger.StateCondisions.AddRange(Enum.GetValues(typeof(Pintent)).Cast()); blobLatchTrigger.StateCondisions.Remove(Pintent.Stuck); blobLatchTrigger.StateCondisions.Remove(Pintent.LatchedOn); blobLatchTrigger.StateCondisions.Remove(Pintent.Dead); blobLatchTrigger.StateToSet = LatchTriggerStateToSet.Stuck; blobLatchTrigger.WhistleTime = 0.5f; blobLatchTrigger.blobPikminEnemy = this; blobLatchTrigger.AllowBaseLatchOn = false; LatchTriggers.Add(blobLatchTrigger); Object.Destroy((Object)(object)pikminLatchTrigger); } LatchTriggers.RemoveAll((PikminLatchTrigger x) => (Object)(object)x == (Object)null); } private void LateUpdate() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00af: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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) FreezeCounter = (float)IcePikminTrapped.Count * 0.1f; if (FreezeCounter >= 1f) { FreezeDuration = 10f; blobAI.timeSinceHittingLocalPlayer = 0f; } if (StickCoolDown > 0f) { StickCoolDown -= Time.deltaTime; } if (((NetworkBehaviour)this).IsOwner && FreezeCounter >= 1f && !IsFrozen) { Vector3 position = ((Component)this).transform.position; Quaternion rotation = ((Component)this).transform.rotation; FreezeEnemyServerRpc(position, ((Quaternion)(ref rotation)).eulerAngles); Vector3 position2 = ((Component)this).transform.position; rotation = ((Component)this).transform.rotation; FreezeEnemy(position2, ((Quaternion)(ref rotation)).eulerAngles); LethalMin.Logger.LogInfo((object)$"{((Object)((Component)enemyScript).gameObject).name} frozen by Ice Pikmin due to freeze counter: {FreezeCounter}"); } } public override void HitEnemy(float Damage, PikminAI? pikminWhoHit = null) { } [ServerRpc] public void StickPikminServerRpc(NetworkObjectReference PikRef, Vector3 StickPos, int Index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Invalid comparison between Unknown and I4 //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1609355138u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref StickPos); BytePacker.WriteValueBitPacked(val2, Index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1609355138u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StickPikminClientRpc(PikRef, StickPos, Index); } } [ClientRpc] public void StickPikminClientRpc(NetworkObjectReference PikRef, Vector3 StickPos, int Index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3143553144u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref StickPos); BytePacker.WriteValueBitPacked(val2, Index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3143553144u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { NetworkObject val3 = default(NetworkObject); PikminAI pikmin = default(PikminAI); if (((NetworkObjectReference)(ref PikRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref pikmin) && !PikUtils.IsOutOfRange(LatchTriggers, Index)) { BlobLatchTrigger trigger = (BlobLatchTrigger)LatchTriggers[Index]; StickPikmin(pikmin, StickPos, trigger); } else { LethalMin.Logger.LogError((object)$"BlobPE: Failed to get pikmin from network object reference {PikRef}"); } } } public void StickPikmin(PikminAI pikmin, Vector3 StickPos, BlobLatchTrigger trigger) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (!PikChecks.IsPikminResistantToHazard(pikmin, PikminHazard.Sticky)) { PikminTrapped.Add(pikmin); if (pikmin is IcePikminAI item) { IcePikminTrapped.Add(item); } trigger.TryLatch(pikmin, StickPos); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1609355138u, new RpcReceiveHandler(__rpc_handler_1609355138), "StickPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(3143553144u, new RpcReceiveHandler(__rpc_handler_3143553144), "StickPikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1609355138(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); Vector3 stickPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref stickPos); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((BlobPikminEnemy)(object)target).StickPikminServerRpc(pikRef, stickPos, index); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_3143553144(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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); Vector3 stickPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref stickPos); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((BlobPikminEnemy)(object)target).StickPikminClientRpc(pikRef, stickPos, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BlobPikminEnemy"; } } public class BushWolfPikminEnemy : PikminEnemy { private BushWolfEnemy bushWolfAI = null; private float tongueCheckInterval = 0.2f; private float nestCheckInterval = 2f; private float nestLingerTime = 8f; private int maxTongueGrab = 5; private List pikminGrabbedByTongue = new List(); private Dictionary pikminNestTimers = new Dictionary(); protected override void Start() { base.Start(); ref BushWolfEnemy reference = ref bushWolfAI; EnemyAI obj = enemyScript; reference = (BushWolfEnemy)(object)(((obj is BushWolfEnemy) ? obj : null) ?? throw new Exception("BushWolfPE: enemyScript is not a BushWolfEnemy")); if ((Object)(object)bushWolfAI == (Object)null) { ((Behaviour)this).enabled = false; } } protected override void Update() { base.Update(); if (enemyScript.isEnemyDead) { ReleaseTonguePikmin(); return; } if ((Object)(object)bushWolfAI.draggingPlayer != (Object)null && (Object)(object)bushWolfAI.tongue != (Object)null && ((Component)bushWolfAI.tongue).gameObject.activeSelf) { if (tongueCheckInterval > 0f) { tongueCheckInterval -= Time.deltaTime; } else { tongueCheckInterval = 0.2f; CheckPikminNearTongue(); } UpdateGrabbedPikminPositions(); } else if (pikminGrabbedByTongue.Count > 0) { ReleaseTonguePikmin(); } if (((NetworkBehaviour)this).IsOwner) { if (nestCheckInterval > 0f) { nestCheckInterval -= Time.deltaTime; } else { nestCheckInterval = 2f; } } } private void CheckPikminNearTongue() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bushWolfAI.tongue == (Object)null || (Object)(object)bushWolfAI.tongueStartPoint == (Object)null) { return; } Vector3 position = bushWolfAI.tongueStartPoint.position; Vector3 lineEnd = bushWolfAI.tongue.position + bushWolfAI.tongue.forward * bushWolfAI.tongue.localScale.z; foreach (PikminAI item in GetNearbyPikmin()) { if (pikminGrabbedByTongue.Count >= maxTongueGrab) { break; } if (!item.IsDeadOrDying && !item.IsAirborn && !pikminGrabbedByTongue.Contains(item) && !((Object)(object)item.CurrentLatchTrigger != (Object)null)) { float num = DistanceToLineSegment(((Component)item).transform.position, position, lineEnd); if (num < 2f && ((NetworkBehaviour)this).IsOwner) { GrabPikminWithTongueServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)item).NetworkObject)); } } } } [ServerRpc(RequireOwnership = false)] public void GrabPikminWithTongueServerRpc(NetworkObjectReference pikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3323309140u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3323309140u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GrabPikminWithTongueClientRpc(pikRef); } } } [ClientRpc] public void GrabPikminWithTongueClientRpc(NetworkObjectReference pikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1493517660u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1493517660u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); PikminAI pikmin = default(PikminAI); if (((NetworkObjectReference)(ref pikRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref pikmin)) { GrabPikminWithTongue(pikmin); } } } private void GrabPikminWithTongue(PikminAI pikmin) { if (!pikminGrabbedByTongue.Contains(pikmin) && !pikmin.IsDeadOrDying) { pikminGrabbedByTongue.Add(pikmin); pikmin.ApplyPhysics(Use3: false); LethalMin.Logger.LogInfo((object)("BushWolfPE: Pikmin " + ((Object)((Component)pikmin).gameObject).name + " grabbed by tongue!")); } } private void UpdateGrabbedPikminPositions() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bushWolfAI.tongue == (Object)null || (Object)(object)bushWolfAI.tongueStartPoint == (Object)null) { return; } Vector3 position = bushWolfAI.tongueStartPoint.position; Vector3 val = bushWolfAI.tongue.position + bushWolfAI.tongue.forward * bushWolfAI.tongue.localScale.z; for (int num = pikminGrabbedByTongue.Count - 1; num >= 0; num--) { PikminAI pikminAI = pikminGrabbedByTongue[num]; if ((Object)(object)pikminAI == (Object)null || pikminAI.IsDeadOrDying) { pikminGrabbedByTongue.RemoveAt(num); } else { float num2 = (float)(num + 1) / (float)(pikminGrabbedByTongue.Count + 1); Vector3 val2 = Vector3.Lerp(position, val, num2); Vector3 val3 = val2 - ((Component)pikminAI).transform.position; Vector3 normalized = ((Vector3)(ref val3)).normalized; float num3 = Vector3.Distance(((Component)pikminAI).transform.position, val2); if (num3 > 0.5f && ((NetworkBehaviour)pikminAI).IsOwner) { Rigidbody component = ((Component)pikminAI).GetComponent(); if ((Object)(object)component != (Object)null) { component.AddForce(normalized * Mathf.Min(num3 * 3f, 12f), (ForceMode)0); } } } } } private void ReleaseTonguePikmin() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) foreach (PikminAI item in pikminGrabbedByTongue) { if (!((Object)(object)item == (Object)null) && !item.IsDeadOrDying) { Vector3 val = ((Component)item).transform.position - ((Component)bushWolfAI).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; normalized.y = 0.4f; normalized = ((Vector3)(ref normalized)).normalized; item.ApplyKnockBack(normalized, 5f); } } pikminGrabbedByTongue.Clear(); } private void CheckPikminInNestRange() { //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_0107: 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_01b3: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)bushWolfAI).currentBehaviourStateIndex == 2) { return; } List list = pikminNestTimers.Keys.Where((PikminAI p) => (Object)(object)p == (Object)null || p.IsDeadOrDying).ToList(); foreach (PikminAI item in list) { pikminNestTimers.Remove(item); } Vector3 position = ((Component)bushWolfAI).transform.position; float nestRange = bushWolfAI.nestRange; foreach (PikminAI pikminAI in PikminManager.instance.PikminAIs) { if ((Object)(object)pikminAI == (Object)null || pikminAI.IsDeadOrDying || pikminAI.IsAirborn || (Object)(object)pikminAI.CurrentLatchTrigger != (Object)null) { continue; } float num = Vector3.Distance(position, ((Component)pikminAI).transform.position); if (num < nestRange) { if (!pikminNestTimers.ContainsKey(pikminAI)) { pikminNestTimers[pikminAI] = 0f; } pikminNestTimers[pikminAI] += nestCheckInterval; if (pikminNestTimers[pikminAI] >= nestLingerTime) { pikminNestTimers[pikminAI] = 0f; KnockbackPikminFromNestServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)pikminAI).NetworkObject)); } } else { pikminNestTimers.Remove(pikminAI); } } } [ServerRpc(RequireOwnership = false)] public void KnockbackPikminFromNestServerRpc(NetworkObjectReference pikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3051814546u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3051814546u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; KnockbackPikminFromNestClientRpc(pikRef); } } } [ClientRpc] public void KnockbackPikminFromNestClientRpc(NetworkObjectReference pikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2747964686u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2747964686u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); PikminAI pikminAI = default(PikminAI); if (((NetworkObjectReference)(ref pikRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref pikminAI) && !pikminAI.IsDeadOrDying) { Vector3 val4 = ((Component)pikminAI).transform.position - ((Component)bushWolfAI).transform.position; Vector3 normalized = ((Vector3)(ref val4)).normalized; normalized.y = 0.5f; normalized = ((Vector3)(ref normalized)).normalized; pikminAI.ApplyKnockBack(normalized, 6f); LethalMin.Logger.LogInfo((object)("BushWolfPE: Pikmin " + ((Object)((Component)pikminAI).gameObject).name + " knocked back from nest!")); } } } private static float DistanceToLineSegment(Vector3 point, Vector3 lineStart, Vector3 lineEnd) { //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_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 val = lineEnd - lineStart; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.001f) { return Vector3.Distance(point, lineStart); } val /= magnitude; float num = Mathf.Clamp(Vector3.Dot(point - lineStart, val), 0f, magnitude); Vector3 val2 = lineStart + val * num; return Vector3.Distance(point, val2); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3323309140u, new RpcReceiveHandler(__rpc_handler_3323309140), "GrabPikminWithTongueServerRpc"); ((NetworkBehaviour)this).__registerRpc(1493517660u, new RpcReceiveHandler(__rpc_handler_1493517660), "GrabPikminWithTongueClientRpc"); ((NetworkBehaviour)this).__registerRpc(3051814546u, new RpcReceiveHandler(__rpc_handler_3051814546), "KnockbackPikminFromNestServerRpc"); ((NetworkBehaviour)this).__registerRpc(2747964686u, new RpcReceiveHandler(__rpc_handler_2747964686), "KnockbackPikminFromNestClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3323309140(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 pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BushWolfPikminEnemy)(object)target).GrabPikminWithTongueServerRpc(pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1493517660(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 pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BushWolfPikminEnemy)(object)target).GrabPikminWithTongueClientRpc(pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3051814546(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 pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BushWolfPikminEnemy)(object)target).KnockbackPikminFromNestServerRpc(pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2747964686(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 pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BushWolfPikminEnemy)(object)target).KnockbackPikminFromNestClientRpc(pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BushWolfPikminEnemy"; } } public class ButlerEnemyPikminEnemy : PikminEnemy { private List PikminRefs = new List(); private ButlerEnemyAI butlerEnemyAI = null; private float CheckInterval = 0.25f; private float StabCooldown = 1.5f; public float StabResetCooldown = 1f; public int StabLimmit = 1; protected override void Start() { base.Start(); ref ButlerEnemyAI reference = ref butlerEnemyAI; EnemyAI obj = enemyScript; reference = (ButlerEnemyAI)(object)(((obj is ButlerEnemyAI) ? obj : null) ?? throw new Exception("ButlerEnemyPE: enemyScript is not a ButlerEnemyAI")); if ((Object)(object)butlerEnemyAI == (Object)null) { ((Behaviour)this).enabled = false; } if ((bool)LethalMin.UseConfigsForEnemies) { StabCooldown = LethalMin.ButlerEnemy_StabCooldown.InternalValue; } } private void LateUpdate() { if (!((NetworkBehaviour)this).IsOwner || enemyScript.isEnemyDead || ((EnemyAI)butlerEnemyAI).currentBehaviourStateIndex != 2) { return; } if (StabCooldown > 0f) { StabCooldown -= Time.deltaTime; return; } if ((bool)LethalMin.UseConfigsForEnemies) { StabResetCooldown = LethalMin.ButlerEnemy_StabCooldown.InternalValue; StabLimmit = LethalMin.ButlerEnemy_StabLimit.InternalValue; } if (CheckInterval > 0f) { CheckInterval -= Time.deltaTime; return; } DoCheckInterval(); CheckInterval = ((EnemyAI)butlerEnemyAI).AIIntervalTime + Random.Range(-0.015f, 0.015f); } public void DoCheckInterval() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) PikminRefs.Clear(); foreach (PikminAI item in GetNearbyPikmin()) { if (!item.IsAirborn && !((Object)(object)item.CurrentLatchTrigger != (Object)null)) { PikminRefs.Add(NetworkObjectReference.op_Implicit(((NetworkBehaviour)item).NetworkObject)); if (PikminRefs.Count >= StabLimmit) { break; } } } if (PikminRefs.Count > 0) { StabCooldown = StabResetCooldown; StabNearbyPikminServerRpc(PikminRefs.ToArray()); } } [ServerRpc] public void StabNearbyPikminServerRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Invalid comparison between Unknown and I4 //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3105564123u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3105564123u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StabNearbyPikminClientRpc(Pikmins); } } [ClientRpc] public void StabNearbyPikminClientRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(365584200u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 365584200u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; List list = new List(); NetworkObject val4 = default(NetworkObject); PikminAI item = default(PikminAI); for (int i = 0; i < Pikmins.Length; i++) { NetworkObjectReference val3 = Pikmins[i]; if (((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref item)) { list.Add(item); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in StabNearbyPikminClientRpc"); } } if (list.Count > 0) { StabNearbyPikmin(list); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in StabNearbyPikminClientRpc"); } } public void StabNearbyPikmin(List Pikmins) { StabCooldown = StabResetCooldown; foreach (PikminAI Pikmin in Pikmins) { if (!PikChecks.IsPikminResistantToHazard(Pikmin, PikminHazard.Stab)) { ((EnemyAI)Pikmin).HitEnemy(1, (PlayerControllerB)null, false, -1); } } ((EnemyAI)butlerEnemyAI).creatureAnimator.SetTrigger("Stab"); ((EnemyAI)butlerEnemyAI).creatureSFX.PlayOneShot(((EnemyAI)butlerEnemyAI).enemyType.audioClips[0]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3105564123u, new RpcReceiveHandler(__rpc_handler_3105564123), "StabNearbyPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(365584200u, new RpcReceiveHandler(__rpc_handler_365584200), "StabNearbyPikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3105564123(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((ButlerEnemyPikminEnemy)(object)target).StabNearbyPikminServerRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_365584200(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((ButlerEnemyPikminEnemy)(object)target).StabNearbyPikminClientRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ButlerEnemyPikminEnemy"; } } public class CaveDwellerPikminEnemy : PikminEnemy { private List PikminRefs = new List(); private CaveDwellerAI caveDwellerAI = null; private CaveDwellerPikminItem pikminItem = null; private float CheckInterval = 0.25f; public float BiteCooldown; public float BiteCooldownRest = 1f; public int BiteLimmit = 7; public override void OnAddedToEnemy(EnemyAI enemy) { base.OnAddedToEnemy(enemy); GameObject val = LethalMin.assetBundle.LoadAsset("Assets/LethalMin/PikminItemNode.prefab"); PikminItem component = val.GetComponent(); pikminItem = ((Component)this).gameObject.AddComponent(); FieldInfo[] fields = typeof(PikminItem).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { fieldInfo.SetValue(pikminItem, fieldInfo.GetValue(component)); } pikminItem.HasOwnNetworkObject = false; pikminItem.settings = ((Component)this).gameObject.AddComponent(); pikminItem.settings.CarryStrength = 5; pikminItem.settings.OverrideGrabbableToEnemeis = true; pikminItem.settings.RouteToPlayer = true; pikminItem.settings.ChangeOwnershipOnCarry = false; } protected override void Start() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) base.Start(); ref CaveDwellerAI reference = ref caveDwellerAI; EnemyAI obj = enemyScript; reference = (CaveDwellerAI)(object)(((obj is CaveDwellerAI) ? obj : null) ?? throw new Exception("CaveDwellerPE: enemyScript is not a CaveDwellerAI")); pikminItem = ((Component)this).GetComponent(); pikminItem.caveDwellerAI = caveDwellerAI; pikminItem.caveDwellerPikminEnemy = this; if ((Object)(object)caveDwellerAI == (Object)null) { ((Behaviour)this).enabled = false; return; } if (((NetworkBehaviour)this).IsServer) { pikminItem.InitalizeClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)this).NetworkObject), "CaveDwellerPikminEnemy"); } if ((bool)LethalMin.UseConfigsForEnemies) { BiteCooldown = LethalMin.CaveDweller_BiteCooldown.InternalValue; } } private void LateUpdate() { CanBeAttacked = ((EnemyAI)caveDwellerAI).currentBehaviourStateIndex != 0 || (bool)LethalMin.CaveDweller_AttackAsBaby; if (!((NetworkBehaviour)this).IsOwner || caveDwellerAI.inKillAnimation || ((EnemyAI)caveDwellerAI).inSpecialAnimation || enemyScript.isEnemyDead || caveDwellerAI.leapTimer < 0.02f || ((EnemyAI)caveDwellerAI).currentBehaviourStateIndex != 3) { return; } if (BiteCooldown > 0f) { BiteCooldown -= Time.deltaTime; return; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteCooldownRest = LethalMin.CaveDweller_BiteCooldown.InternalValue; BiteLimmit = LethalMin.CaveDweller_BiteLimit.InternalValue; } if (CheckInterval > 0f) { CheckInterval -= Time.deltaTime; return; } DoCheckInterval(); CheckInterval = ((EnemyAI)caveDwellerAI).AIIntervalTime + Random.Range(-0.015f, 0.015f); } public void DoCheckInterval() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) PikminRefs.Clear(); foreach (PikminAI item in GetNearbyPikmin()) { if (!item.IsAirborn && !((Object)(object)item.CurrentLatchTrigger != (Object)null)) { PikminRefs.Add(NetworkObjectReference.op_Implicit(((NetworkBehaviour)item).NetworkObject)); if (PikminRefs.Count >= BiteLimmit) { break; } } } if (PikminRefs.Count > 0) { BiteCooldown = BiteCooldownRest; BiteNearbyPikminServerRpc(PikminRefs.ToArray()); } } [ServerRpc] public void BiteNearbyPikminServerRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Invalid comparison between Unknown and I4 //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1861949405u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1861949405u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BiteNearbyPikminClientRpc(Pikmins); } } [ClientRpc] public void BiteNearbyPikminClientRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3915017348u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3915017348u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; List list = new List(); NetworkObject val4 = default(NetworkObject); PikminAI item = default(PikminAI); for (int i = 0; i < Pikmins.Length; i++) { NetworkObjectReference val3 = Pikmins[i]; if (((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref item)) { list.Add(item); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in BiteNearbyPikminClientRpc"); } } if (list.Count > 0) { BiteNearbyPikmin(list); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in BiteNearbyPikminClientRpc"); } } public void BiteNearbyPikmin(List Pikmins) { BiteCooldown = BiteCooldownRest; foreach (PikminAI Pikmin in Pikmins) { GrabbedPikmin.Add(Pikmin); Pikmin.GrabPikmin(caveDwellerAI.bodyRagdollPoint, 0.45f, 7); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1861949405u, new RpcReceiveHandler(__rpc_handler_1861949405), "BiteNearbyPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(3915017348u, new RpcReceiveHandler(__rpc_handler_3915017348), "BiteNearbyPikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1861949405(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((CaveDwellerPikminEnemy)(object)target).BiteNearbyPikminServerRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_3915017348(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((CaveDwellerPikminEnemy)(object)target).BiteNearbyPikminClientRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CaveDwellerPikminEnemy"; } } public class CaveDwellerPikminItem : PikminItem { public CaveDwellerPikminEnemy caveDwellerPikminEnemy = null; public CaveDwellerAI caveDwellerAI = null; private bool lastLeaderInsideFactory = false; public override void Update() { settings.GrabableToPikmin = LethalMin.CaveDweller_AllowCarry; base.Update(); if (!((Object)(object)PrimaryLeader == (Object)null) && !((Object)(object)PrimaryPikminOnItem == (Object)null) && PrimaryLeader.Controller.isInsideFactory != lastLeaderInsideFactory) { lastLeaderInsideFactory = PrimaryLeader.Controller.isInsideFactory; ((EnemyAI)caveDwellerAI).isOutside = !PrimaryLeader.Controller.isInsideFactory; } } public override void GrabPikminItemOnLocalClient() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Invalid comparison between Unknown and I4 //IL_00bf: Unknown result type (might be due to invalid IL or missing references) PrimaryLeader = PikUtils.GetLeaderFromMultiplePikmin(PikminOnItem); ((EnemyAI)caveDwellerAI).ChangeOwnershipOfEnemy(PrimaryLeader.Controller.playerClientId); ((EnemyAI)caveDwellerAI).currentOwnershipOnThisClient = (int)PrimaryLeader.Controller.playerClientId; ((EnemyAI)caveDwellerAI).inSpecialAnimation = true; ((Behaviour)((EnemyAI)caveDwellerAI).agent).enabled = false; caveDwellerAI.holdingBaby = true; if (caveDwellerAI.dropBabyCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(caveDwellerAI.dropBabyCoroutine); } if (((NetworkBehaviour)this).IsServer && (int)caveDwellerAI.babyState == 2) { caveDwellerAI.babyState = (BabyState)0; } caveDwellerAI.SetRolledOverLocalClient(false, false); caveDwellerAI.playerHolding = PrimaryLeader.Controller; base.GrabPikminItemOnLocalClient(); } public override void DiscardPikminItem() { DropBabyServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); DropBabyLocalClient(); } [ServerRpc] public void DropBabyServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(622181158u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 622181158u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DropBabyClientRpc(playerId); } } [ClientRpc] public void DropBabyClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1169189803u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1169189803u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerId != (int)GameNetworkManager.Instance.localPlayerController.playerClientId) { DropBabyLocalClient(); } } } public void DropBabyLocalClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020a: 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_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) IsBeingCarried = false; lastPrimaryPikminOnItem = null; PikminCounter.SetCounterColor(DefultColor); ClearCurrentRoute(); if (soundRoutine != null) { ((MonoBehaviour)this).StopCoroutine(soundRoutine); soundRoutine = null; } foreach (PikminAI item in PikminOnItem) { item.UnsetAsCarryingItem(); } caveDwellerAI.propScript.previousPlayerHeldBy = caveDwellerAI.playerHolding; caveDwellerAI.holdingBaby = false; caveDwellerAI.rockingBaby = 0; caveDwellerAI.playerHolding = null; LethalMin.Logger.LogInfo((object)"Drop baby A"); if (((EnemyAI)caveDwellerAI).currentBehaviourStateIndex != 0) { LethalMin.Logger.LogWarning((object)$"Drop baby B; currentBehaviourStateIndex: {((EnemyAI)caveDwellerAI).currentBehaviourStateIndex}"); return; } if (((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogInfo((object)$"Set ownership of creature. Currentownershiponthisclient: {((EnemyAI)caveDwellerAI).currentOwnershipOnThisClient}"); ((EnemyAI)caveDwellerAI).ChangeOwnershipOfEnemy(StartOfRound.Instance.allPlayerScripts[0].actualClientId); } ((EnemyAI)caveDwellerAI).serverPosition = ((Component)this).transform.position; bool flag = true; Vector3 itemFloorPosition = ((GrabbableObject)caveDwellerAI.propScript).GetItemFloorPosition(((Component)this).transform.position + Vector3.up * 0.5f); Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(itemFloorPosition, default(NavMeshHit), 10f, -1); LethalMin.Logger.LogInfo((object)$"Drop on position: {navMeshPosition}"); Debug.DrawRay(((GrabbableObject)caveDwellerAI.propScript).startFallingPosition, Vector3.up * 1f, Color.white, 10f); Debug.DrawRay(navMeshPosition, Vector3.up * 0.75f, Color.red, 10f); if (!RoundManager.Instance.GotNavMeshPositionResult || ((EnemyAI)caveDwellerAI).DebugEnemy) { flag = false; itemFloorPosition = ((GrabbableObject)caveDwellerAI.propScript).startFallingPosition; LethalMin.Logger.LogInfo((object)$"Drop Baby C; {((GrabbableObject)caveDwellerAI.propScript).startFallingPosition}"); if ((Object)(object)((Component)caveDwellerAI.propScript).transform.parent != (Object)null) { itemFloorPosition = ((Component)caveDwellerAI.propScript).transform.parent.TransformPoint(((GrabbableObject)caveDwellerAI.propScript).startFallingPosition); } LethalMin.Logger.LogInfo((object)$"Drop Baby C global; {((GrabbableObject)caveDwellerAI.propScript).startFallingPosition}"); Transform val = caveDwellerAI.ChooseClosestNodeToPositionNoPathCheck(itemFloorPosition); navMeshPosition = RoundManager.Instance.GetNavMeshPosition(((Component)val).transform.position, default(NavMeshHit), 5f, -1); LethalMin.Logger.LogInfo((object)$"Got nav mesh position : {RoundManager.Instance.GotNavMeshPositionResult}; {navMeshPosition}; dist: {Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position)}"); Debug.DrawRay(navMeshPosition, Vector3.up * 1.2f, Color.magenta, 10f); } LethalMin.Logger.LogInfo((object)"Drop baby D"); if ((Object)(object)((Component)caveDwellerAI.propScript).transform.parent == (Object)null) { ((GrabbableObject)caveDwellerAI.propScript).targetFloorPosition = navMeshPosition; } else { ((GrabbableObject)caveDwellerAI.propScript).targetFloorPosition = ((Component)caveDwellerAI.propScript).transform.parent.InverseTransformPoint(navMeshPosition); } Debug.DrawRay(((GrabbableObject)caveDwellerAI.propScript).targetFloorPosition, Vector3.up * 2f, Color.yellow, 5f); if (flag) { if (caveDwellerAI.dropBabyCoroutine != null) { ((MonoBehaviour)caveDwellerAI).StopCoroutine(caveDwellerAI.dropBabyCoroutine); } caveDwellerAI.dropBabyCoroutine = ((MonoBehaviour)caveDwellerAI).StartCoroutine(caveDwellerAI.DropBabyAnimation(navMeshPosition)); } else { LethalMin.Logger.LogInfo((object)$"Drop baby F; got no floor target; drop pos: {navMeshPosition}"); ((Component)this).transform.position = navMeshPosition; ((EnemyAI)caveDwellerAI).inSpecialAnimation = false; } ItemScript.isHeld = false; ItemScript.isPocketed = false; ItemScript.parentObject = null; ItemScript.isHeldByEnemy = false; ItemScript.DiscardItemFromEnemy(); ItemScript.EnablePhysics(true); ItemScript.EnableItemMeshes(true); OnItemDropped.Invoke((PikminItem)this); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(622181158u, new RpcReceiveHandler(__rpc_handler_622181158), "DropBabyServerRpc"); ((NetworkBehaviour)this).__registerRpc(1169189803u, new RpcReceiveHandler(__rpc_handler_1169189803), "DropBabyClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_622181158(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CaveDwellerPikminItem)(object)target).DropBabyServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1169189803(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CaveDwellerPikminItem)(object)target).DropBabyClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CaveDwellerPikminItem"; } } public class ClaySurgeonPikminEnemy : PikminEnemy { private List PikminRefs = new List(); private ClaySurgeonAI claySurgeonAI = null; private float CheckInterval = 0.2f; private float SnippingCooldown = 1.5f; public float SnipResetCooldown = 1f; public int SnipLimmit = 3; protected override void Start() { base.Start(); ref ClaySurgeonAI reference = ref claySurgeonAI; EnemyAI obj = enemyScript; reference = (ClaySurgeonAI)(object)(((obj is ClaySurgeonAI) ? obj : null) ?? throw new InvalidOperationException("ClaySurgeonPE: enemyScript is not a ClaySurgeonAI")); if ((Object)(object)claySurgeonAI == (Object)null) { ((Behaviour)this).enabled = false; } if ((bool)LethalMin.UseConfigsForEnemies) { SnippingCooldown = LethalMin.ClaySurgeon_SnipCooldown.InternalValue; } } private void LateUpdate() { if (!((NetworkBehaviour)this).IsOwner) { return; } if (SnippingCooldown > 0f) { SnippingCooldown -= Time.deltaTime; return; } if ((bool)LethalMin.UseConfigsForEnemies) { SnipResetCooldown = LethalMin.ClaySurgeon_SnipCooldown.InternalValue; SnipLimmit = LethalMin.ClaySurgeon_SnipLimit.InternalValue; } if (CheckInterval > 0f) { CheckInterval -= Time.deltaTime; return; } DoCheckInterval(); CheckInterval = ((EnemyAI)claySurgeonAI).AIIntervalTime + Random.Range(-0.015f, 0.015f); } public void DoCheckInterval() { //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) PikminRefs.Clear(); foreach (PikminAI item in GetNearbyPikmin()) { if (!item.IsAirborn && item.CurrentGrowthStage != 0 && !((Object)(object)item.CurrentLatchTrigger != (Object)null)) { PikminRefs.Add(NetworkObjectReference.op_Implicit(((NetworkBehaviour)item).NetworkObject)); if (PikminRefs.Count >= SnipLimmit) { break; } } } if (PikminRefs.Count > 0) { SnippingCooldown = SnipResetCooldown; SnipNearbyPikminServerRpc(((Component)this).transform.position, PikminRefs.ToArray()); } } [ServerRpc] public void SnipNearbyPikminServerRpc(Vector3 position, NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Invalid comparison between Unknown and I4 //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2378882116u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2378882116u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SnipNearbyPikminClientRpc(position, Pikmins); } } [ClientRpc] public void SnipNearbyPikminClientRpc(Vector3 position, NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_00b9: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2389404858u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2389404858u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; List list = new List(); NetworkObject val4 = default(NetworkObject); PikminAI item = default(PikminAI); for (int i = 0; i < Pikmins.Length; i++) { NetworkObjectReference val3 = Pikmins[i]; if (((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref item)) { list.Add(item); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in SnipNearbyPikminClientRpc"); } } if (list.Count > 0) { SnipNearbyPikmin(position, list); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in SnipNearbyPikminClientRpc"); } } public void SnipNearbyPikmin(Vector3 position, List Pikmins) { //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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_003b: 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_004a: 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_0051: Unknown result type (might be due to invalid IL or missing references) SnippingCooldown = SnipResetCooldown; foreach (PikminAI Pikmin in Pikmins) { Vector3 val = ((Component)Pikmin).transform.position - position; Vector3 normalized = ((Vector3)(ref val)).normalized; normalized += Vector3.up * 2f; Pikmin.ApplyKnockBack(normalized, 5f); Pikmin.SetGrowth(0); Pikmin.LandBuffer = 0.1f; } ((EnemyAI)claySurgeonAI).creatureAnimator.SetTrigger("snip"); ((EnemyAI)claySurgeonAI).creatureSFX.PlayOneShot(claySurgeonAI.snipScissors); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2378882116u, new RpcReceiveHandler(__rpc_handler_2378882116), "SnipNearbyPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(2389404858u, new RpcReceiveHandler(__rpc_handler_2389404858), "SnipNearbyPikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2378882116(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_00b8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaySurgeonPikminEnemy)(object)target).SnipNearbyPikminServerRpc(position, pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_2389404858(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((ClaySurgeonPikminEnemy)(object)target).SnipNearbyPikminClientRpc(position, pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ClaySurgeonPikminEnemy"; } } public class CompanyPikminEnemy : NetworkBehaviour { public List Detects = new List(); private void Start() { Detects = Object.FindObjectsOfType().ToList(); Detects = Detects.OrderBy((CompanyMonsterCollisionDetect x) => ((Object)x).name).ToList(); } [ServerRpc(RequireOwnership = false)] public void KillPikminServerRpc(NetworkObjectReference PikRef, int DetectIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3460283478u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, DetectIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3460283478u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; KillPikminClientRpc(PikRef, DetectIndex); } } } [ClientRpc] public void KillPikminClientRpc(NetworkObjectReference PikRef, int DetectIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4128217404u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, DetectIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4128217404u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); PikminAI pikminAI = default(PikminAI); if (((NetworkObjectReference)(ref PikRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).gameObject.TryGetComponent(ref pikminAI)) { pikminAI.DeathSnapToPos = ((Component)Detects[DetectIndex]).transform; pikminAI.OverrideDelay = 0.75f; ((EnemyAI)pikminAI).KillEnemy(false); } else { LethalMin.Logger.LogError((object)$"Failed to get PikminAI from {PikRef} in {((Object)Detects[DetectIndex]).name}"); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3460283478u, new RpcReceiveHandler(__rpc_handler_3460283478), "KillPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(4128217404u, new RpcReceiveHandler(__rpc_handler_4128217404), "KillPikminClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3460283478(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); int detectIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref detectIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((CompanyPikminEnemy)(object)target).KillPikminServerRpc(pikRef, detectIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4128217404(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); int detectIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref detectIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((CompanyPikminEnemy)(object)target).KillPikminClientRpc(pikRef, detectIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CompanyPikminEnemy"; } } public class CrawlerPikminEnemy : PikminEnemy { private List PikminRefs = new List(); private CrawlerAI crawlerAI = null; private float CheckInterval = 0.25f; private float BiteCooldown = 1.5f; public float BiteResetCooldown = 2f; public int BiteLimmit = 3; protected override void Start() { base.Start(); ref CrawlerAI reference = ref crawlerAI; EnemyAI obj = enemyScript; reference = (CrawlerAI)(object)(((obj is CrawlerAI) ? obj : null) ?? throw new Exception("CrawlerPE: enemyScript is not a CrawlerAI")); if ((Object)(object)crawlerAI == (Object)null) { ((Behaviour)this).enabled = false; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteCooldown = LethalMin.Crawler_BiteCooldown.InternalValue; } } private void LateUpdate() { if (!((NetworkBehaviour)this).IsOwner || enemyScript.isEnemyDead) { return; } if (BiteCooldown > 0f) { BiteCooldown -= Time.deltaTime; return; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteResetCooldown = LethalMin.Crawler_BiteCooldown.InternalValue; BiteLimmit = LethalMin.Crawler_BiteLimit.InternalValue; } if (CheckInterval > 0f) { CheckInterval -= Time.deltaTime; return; } DoCheckInterval(); CheckInterval = ((EnemyAI)crawlerAI).AIIntervalTime + Random.Range(-0.015f, 0.015f); } public void DoCheckInterval() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) PikminRefs.Clear(); foreach (PikminAI item in GetNearbyPikmin()) { if (!item.IsAirborn && !((Object)(object)item.CurrentLatchTrigger != (Object)null)) { PikminRefs.Add(NetworkObjectReference.op_Implicit(((NetworkBehaviour)item).NetworkObject)); if (PikminRefs.Count >= BiteLimmit) { break; } } } if (PikminRefs.Count > 0) { BiteCooldown = BiteResetCooldown; BiteNearbyPikminServerRpc(PikminRefs.ToArray()); } } [ServerRpc] public void BiteNearbyPikminServerRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Invalid comparison between Unknown and I4 //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4017625870u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4017625870u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BiteNearbyPikminClientRpc(Pikmins); } } [ClientRpc] public void BiteNearbyPikminClientRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1133863542u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1133863542u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; List list = new List(); NetworkObject val4 = default(NetworkObject); PikminAI item = default(PikminAI); for (int i = 0; i < Pikmins.Length; i++) { NetworkObjectReference val3 = Pikmins[i]; if (((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref item)) { list.Add(item); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in BiteNearbyPikminClientRpc"); } } if (list.Count > 0) { BiteNearbyPikmin(list); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in BiteNearbyPikminClientRpc"); } } public void BiteNearbyPikmin(List Pikmins) { BiteCooldown = BiteResetCooldown; foreach (PikminAI Pikmin in Pikmins) { GrabbedPikmin.Add(Pikmin); Pikmin.GrabPikmin(crawlerAI.mouthTarget, 0.75f, 3); } if (!((EnemyAI)crawlerAI).inSpecialAnimation) { ((EnemyAI)crawlerAI).creatureAnimator.SetTrigger("HitPlayer"); } ((EnemyAI)crawlerAI).creatureVoice.PlayOneShot(crawlerAI.bitePlayerSFX); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4017625870u, new RpcReceiveHandler(__rpc_handler_4017625870), "BiteNearbyPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(1133863542u, new RpcReceiveHandler(__rpc_handler_1133863542), "BiteNearbyPikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_4017625870(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((CrawlerPikminEnemy)(object)target).BiteNearbyPikminServerRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_1133863542(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((CrawlerPikminEnemy)(object)target).BiteNearbyPikminClientRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CrawlerPikminEnemy"; } } public class CustomMaskedAnimationManager : MonoBehaviour { [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CustomMaskedAnimationManager <>4__this; private float 5__1; private float 5__2; private float 5__3; private float 5__4; private float 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.IsOverriding = false; 5__1 = 0.5f; 5__2 = 0f; 5__3 = ((RigConstraint>)(object)<>4__this.WhistleConstraint).weight; 5__4 = ((RigConstraint>)(object)<>4__this.OriginalConstraint).weight; break; case 1: <>1__state = -1; break; } if (5__2 < 5__1) { 5__2 += Time.deltaTime; 5__5 = Mathf.Clamp01(5__2 / 5__1); ((RigConstraint>)(object)<>4__this.WhistleConstraint).weight = Mathf.Lerp(5__3, 0f, 5__5); ((RigConstraint>)(object)<>4__this.OriginalConstraint).weight = Mathf.Lerp(5__4, 1f, 5__5); <>2__current = null; <>1__state = 1; return true; } ((RigConstraint>)(object)<>4__this.WhistleConstraint).weight = 0f; ((RigConstraint>)(object)<>4__this.OriginalConstraint).weight = 1f; 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__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CustomMaskedAnimationManager <>4__this; private float 5__1; private float 5__2; private float 5__3; private float 5__4; private float 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.IsOverriding = true; 5__1 = 0.5f; 5__2 = 0f; 5__3 = ((RigConstraint>)(object)<>4__this.OriginalConstraint).weight; 5__4 = ((RigConstraint>)(object)<>4__this.WhistleConstraint).weight; break; case 1: <>1__state = -1; break; } if (5__2 < 5__1) { 5__2 += Time.deltaTime; 5__5 = Mathf.Clamp01(5__2 / 5__1); ((RigConstraint>)(object)<>4__this.OriginalConstraint).weight = Mathf.Lerp(5__3, 0f, 5__5); ((RigConstraint>)(object)<>4__this.WhistleConstraint).weight = Mathf.Lerp(5__4, 1f, 5__5); <>2__current = null; <>1__state = 1; return true; } ((RigConstraint>)(object)<>4__this.OriginalConstraint).weight = 0f; ((RigConstraint>)(object)<>4__this.WhistleConstraint).weight = 1f; 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 MaskedPlayerEnemy maskedPlayerEnemy = null; public ChainIKConstraint WhistleConstraint = null; public ChainIKConstraint OriginalConstraint = null; public Transform WhistleTarget = null; public Transform OverrideHandBone = null; public bool IsOverriding = false; public void Start() { if ((Object)(object)WhistleConstraint == (Object)null) { CreateWhistleConstraint(); } if ((Object)(object)OverrideHandBone == (Object)null) { CreateOverrideHandBone(); } } public void CreateWhistleConstraint() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) Rig[] componentsInChildren = ((Component)maskedPlayerEnemy).gameObject.GetComponentsInChildren(); foreach (Rig val in componentsInChildren) { ChainIKConstraint[] componentsInChildren2 = ((Component)val).GetComponentsInChildren(); foreach (ChainIKConstraint val2 in componentsInChildren2) { if (((Object)((Component)val2).gameObject).name.ToLower() == "rightarm") { ChainIKConstraint val3 = Object.Instantiate(val2); ((Object)val3).name = "WhistleConstraint"; ((Component)val3).transform.SetParent(((Component)val2).transform.parent); GameObject gameObject = ((Component)((ChainIKConstraintData)(ref ((RigConstraint>)(object)val2).data)).target).gameObject; GameObject val4 = new GameObject("WhistleTarget"); val4.transform.position = gameObject.transform.position; val4.transform.rotation = gameObject.transform.rotation; val4.transform.SetParent(gameObject.transform.parent); val4.transform.localPosition = new Vector3(-0.0025f, 0.2861f, 0.2635f); ((ChainIKConstraintData)(ref ((RigConstraint>)(object)val3).m_Data)).target = val4.transform; ((RigConstraint>)(object)val3).weight = 0f; WhistleConstraint = val3; WhistleTarget = val4.transform; OriginalConstraint = val2; LethalMin.Logger.LogInfo((object)("Created a new ChainIKConstraint from " + ((Object)((Component)val).gameObject).name + " - " + ((Object)((Component)val2).gameObject).name + " for the whistle animation on " + ((Object)((Component)maskedPlayerEnemy).gameObject).name)); break; } } if ((Object)(object)WhistleConstraint == (Object)null) { break; } } } public void CreateOverrideHandBone() { } [IteratorStateMachine(typeof(d__9))] public IEnumerator SetWhistleToOverride() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__10))] public IEnumerator DeSetWhistleToOverride() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { <>4__this = this }; } } public class CustomPikminEnemyOverrideDef : MonoBehaviour { public Type CustomPikminEnemyOverrideType = null; } public class ForestGiantLatchTrigger : PikminLatchTrigger { public ForestGiantPikminEnemy forestGiantPikminEnemy = null; public override bool TryLatch(PikminAI pikmin, Vector3 Point, bool IsDirectHit = true, bool DoCheckOnly = false) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (pikmin.IsInShip) { return false; } if (pikmin.IsDeadOrDying || pikmin.IsAirborn || (Object)(object)pikmin.CurrentLatchTrigger != (Object)null) { return false; } return base.TryLatch(pikmin, Point, IsDirectHit, DoCheckOnly); } public override void LatchPikmin(PikminAI pikmin, Vector3 LandPos, bool IsDirectHit = true) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) pikmin.CallResetMethods(); base.LatchPikmin(pikmin, LandPos, IsDirectHit); if (!forestGiantPikminEnemy.PikminGrabbed.Contains(pikmin)) { forestGiantPikminEnemy.PikminGrabbed.Add(pikmin); } pikmin.PlayAudioOnLocalClient(PikminSoundPackSounds.Hurt); } } public class ForestGiantPikminEnemy : PikminEnemy { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ForestGiantPikminEnemy <>4__this; private List.Enumerator <>s__1; private PikminAI 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 4) { try { } finally { <>m__Finally1(); } } <>s__1 = default(List.Enumerator); 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.099999994f); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (object)new WaitForSeconds(4.4f); <>1__state = 3; return true; case 3: <>1__state = -1; LethalMin.Logger.LogInfo((object)$"EatPikminAnimation: {<>4__this.PikminGrabbed.Count} Pikmin grabbed"); <>s__1 = <>4__this.PikminGrabbed.GetEnumerator(); <>1__state = -3; goto IL_0164; case 4: <>1__state = -3; if ((Object)(object)5__2 != (Object)null) { ((EnemyAI)5__2).KillEnemy(true); } 5__2 = null; goto IL_0164; case 5: { <>1__state = -1; <>4__this.DropAnyPikminLeft(); <>4__this.eatPikminCoroutine = null; return false; } IL_0164: if (<>s__1.MoveNext()) { 5__2 = <>s__1.Current; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 4; return true; } <>m__Finally1(); <>s__1 = default(List.Enumerator); <>2__current = (object)new WaitForSeconds(3f); <>1__state = 5; return true; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__1).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public List PikminGrabbed = new List(); private ForestGiantAI forestGiantAI = null; public ForestGiantLatchTrigger handTrigger = null; public int GrabLimmit = 25; public Coroutine? eatPikminCoroutine = null; protected override void Start() { base.Start(); ref ForestGiantAI reference = ref forestGiantAI; EnemyAI obj = enemyScript; reference = (ForestGiantAI)(object)(((obj is ForestGiantAI) ? obj : null) ?? throw new Exception("ForestGiantPE: enemyScript is not a ForestGiantAI")); if ((Object)(object)forestGiantAI == (Object)null) { ((Behaviour)this).enabled = false; return; } ForestGiantLatchTrigger forestGiantLatchTrigger = ((Component)forestGiantAI.holdPlayerPoint).gameObject.AddComponent(); forestGiantLatchTrigger.StateCondisions.AddRange(Enum.GetValues(typeof(Pintent)).Cast()); forestGiantLatchTrigger.StateCondisions.Remove(Pintent.Stuck); forestGiantLatchTrigger.StateCondisions.Remove(Pintent.LatchedOn); forestGiantLatchTrigger.StateCondisions.Remove(Pintent.Dead); forestGiantLatchTrigger.StateToSet = LatchTriggerStateToSet.Stuck; forestGiantLatchTrigger.WhistleTime = -255f; forestGiantLatchTrigger.forestGiantPikminEnemy = this; forestGiantLatchTrigger.AllowBaseLatchOn = false; forestGiantLatchTrigger.OverrideLatchObject = forestGiantAI.holdPlayerPoint; handTrigger = forestGiantLatchTrigger; } public void LateUpdate() { if ((bool)LethalMin.UseConfigsForEnemies) { GrabLimmit = LethalMin.ForestGiant_GrabLimit.InternalValue; } } [IteratorStateMachine(typeof(d__7))] public IEnumerator EatPikminAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this }; } private void DropAnyPikminLeft() { foreach (PikminAI item in PikminGrabbed) { if ((Object)(object)item != (Object)null && !item.IsDeadOrDying) { item.ApplyPhysics(Use3: true); } } PikminGrabbed.Clear(); } public void StopKillAnimation() { if (eatPikminCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(eatPikminCoroutine); eatPikminCoroutine = null; } DropAnyPikminLeft(); } [ServerRpc(RequireOwnership = false)] public void GrabPikminServerRpc(NetworkObjectReference[] Pref) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(954374763u, val, (RpcDelivery)0); bool flag = Pref != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pref, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 954374763u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GrabPikminClientRpc(Pref); } } [ClientRpc] public void GrabPikminClientRpc(NetworkObjectReference[] Prefs) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1789421098u, val, (RpcDelivery)0); bool flag = Prefs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Prefs, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1789421098u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; List list = new List(); NetworkObject val4 = default(NetworkObject); PikminAI item = default(PikminAI); for (int i = 0; i < Prefs.Length; i++) { NetworkObjectReference val3 = Prefs[i]; if (((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref item)) { list.Add(item); } else { LethalMin.Logger.LogError((object)$"GrabPikminClientRpc: Failed to get PikminAI from {val3}"); } } if (list.Count > 0) { GrabPikmin(list.ToArray()); } else { LethalMin.Logger.LogError((object)("GrabPikminClientRpc: No valid PikminAI found in " + PikUtils.ParseListToString(Prefs))); } } public void GrabPikmin(PikminAI[] pikmins) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) foreach (PikminAI pikminAI in pikmins) { PikminGrabbed.Add(pikminAI); handTrigger.LatchPikmin(pikminAI, forestGiantAI.holdPlayerPoint.position); } if (eatPikminCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(eatPikminCoroutine); eatPikminCoroutine = null; } eatPikminCoroutine = ((MonoBehaviour)this).StartCoroutine(EatPikminAnimation()); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(954374763u, new RpcReceiveHandler(__rpc_handler_954374763), "GrabPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(1789421098u, new RpcReceiveHandler(__rpc_handler_1789421098), "GrabPikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_954374763(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pref = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pref, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((ForestGiantPikminEnemy)(object)target).GrabPikminServerRpc(pref); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1789421098(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] prefs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref prefs, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((ForestGiantPikminEnemy)(object)target).GrabPikminClientRpc(prefs); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ForestGiantPikminEnemy"; } } public class HoarderBugPikminEnemy : PikminEnemy { private List PikminRefs = new List(); private HoarderBugAI hoarderBugAI = null; private float CheckInterval = 0.25f; private float BiteCooldown = 1.5f; public float BiteResetCooldown = 3f; public int BiteLimmit = 1; protected override void Start() { base.Start(); ref HoarderBugAI reference = ref hoarderBugAI; EnemyAI obj = enemyScript; reference = (HoarderBugAI)(object)(((obj is HoarderBugAI) ? obj : null) ?? throw new Exception("HoarderBugPE: enemyScript is not a HoarderBugAI")); if ((Object)(object)hoarderBugAI == (Object)null) { ((Behaviour)this).enabled = false; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteCooldown = LethalMin.HoarderBug_BiteCooldown.InternalValue; } } private void LateUpdate() { if (!((NetworkBehaviour)this).IsOwner || enemyScript.isEnemyDead) { return; } if (BiteCooldown > 0f) { BiteCooldown -= Time.deltaTime; return; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteResetCooldown = LethalMin.HoarderBug_BiteCooldown.InternalValue; BiteLimmit = LethalMin.HoarderBug_BiteLimit.InternalValue; } if (CheckInterval > 0f) { CheckInterval -= Time.deltaTime; return; } DoCheckInterval(); CheckInterval = ((EnemyAI)hoarderBugAI).AIIntervalTime + Random.Range(-0.015f, 0.015f); } public void DoCheckInterval() { //IL_0069: 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_0168: 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_00e4: Unknown result type (might be due to invalid IL or missing references) if (!hoarderBugAI.inChase && (!LethalMin.UseConfigsForEnemies.InternalValue || LethalMin.HoarderBug_AggroWhenPikminTakesItem.InternalValue)) { for (int i = 0; i < HoarderBugAI.HoarderBugItems.Count; i++) { HoarderBugItem val = HoarderBugAI.HoarderBugItems[i]; if (!((Object)(object)val.itemGrabbableObject == (Object)null) && !(Vector3.Distance(((Component)val.itemGrabbableObject).transform.position, ((Component)this).transform.position) > 30f)) { PikminItem componentInChildren = ((Component)val.itemGrabbableObject).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.IsBeingCarried && (Object)(object)componentInChildren.PrimaryLeader != (Object)null) { BiteCooldown = BiteResetCooldown; GetAngryAtPikminItemServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)componentInChildren).NetworkObject), NetworkObjectReference.op_Implicit(((NetworkBehaviour)componentInChildren.PrimaryLeader).NetworkObject)); break; } } } return; } PikminRefs.Clear(); foreach (PikminAI item in GetNearbyPikmin()) { if (!item.IsAirborn && !((Object)(object)item.CurrentLatchTrigger != (Object)null)) { PikminRefs.Add(NetworkObjectReference.op_Implicit(((NetworkBehaviour)item).NetworkObject)); if (PikminRefs.Count >= BiteLimmit) { break; } } } if (PikminRefs.Count > 0) { BiteCooldown = BiteResetCooldown; BiteNearbyPikminServerRpc(PikminRefs.ToArray()); } } [ServerRpc] public void GetAngryAtPikminItemServerRpc(NetworkObjectReference itemRef, NetworkObjectReference leaderRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Invalid comparison between Unknown and I4 //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3037749952u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref itemRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref leaderRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3037749952u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GetAngryAtPikminItemClientRpc(itemRef, leaderRef); } } [ClientRpc] public void GetAngryAtPikminItemClientRpc(NetworkObjectReference itemRef, NetworkObjectReference leaderRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3800975872u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref itemRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref leaderRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3800975872u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); PikminItem itm = default(PikminItem); NetworkObject val4 = default(NetworkObject); Leader leaderToBeMadAt = default(Leader); if (((NetworkObjectReference)(ref itemRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref itm) && ((NetworkObjectReference)(ref leaderRef)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref leaderToBeMadAt)) { GetAngryAtPikminItem(itm, leaderToBeMadAt); } else { LethalMin.Logger.LogError((object)"Failed to get PikminItem from NetworkObjectReference in GetAngryAtPikminItemClientRpc"); } } } public void GetAngryAtPikminItem(PikminItem itm, Leader leaderToBeMadAt) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) PikminItem itm2 = itm; LethalMin.Logger.LogInfo((object)("HoarderBugPE: GetAngryAtPikminItem called for " + ((Object)((Component)itm2).gameObject).name + " at " + leaderToBeMadAt.Controller.playerUsername)); HoarderBugItem val = HoarderBugAI.HoarderBugItems.Find((HoarderBugItem x) => (Object)(object)x.itemGrabbableObject == (Object)(object)itm2.ItemScript); itm2.hoarderBugItem = val; val.status = (HoarderBugItemStatus)1; hoarderBugAI.angryAtPlayer = leaderToBeMadAt.Controller; hoarderBugAI.angryTimer = 4f; ((EnemyAI)hoarderBugAI).SwitchToBehaviourStateOnLocalClient(2); } [ServerRpc] public void BiteNearbyPikminServerRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Invalid comparison between Unknown and I4 //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4093114400u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4093114400u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BiteNearbyPikminClientRpc(Pikmins); } } [ClientRpc] public void BiteNearbyPikminClientRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3148405217u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3148405217u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; List list = new List(); NetworkObject val4 = default(NetworkObject); PikminAI item = default(PikminAI); for (int i = 0; i < Pikmins.Length; i++) { NetworkObjectReference val3 = Pikmins[i]; if (((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref item)) { list.Add(item); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in BiteNearbyPikminClientRpc"); } } if (list.Count > 0) { BiteNearbyPikmin(list); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in BiteNearbyPikminClientRpc"); } } public void BiteNearbyPikmin(List Pikmins) { BiteCooldown = BiteResetCooldown; foreach (PikminAI Pikmin in Pikmins) { GrabbedPikmin.Add(Pikmin); Pikmin.GrabPikmin(hoarderBugAI.grabTarget, 0.5f, 1); } ((EnemyAI)hoarderBugAI).creatureAnimator.SetTrigger("HitPlayer"); ((EnemyAI)hoarderBugAI).creatureSFX.PlayOneShot(hoarderBugAI.hitPlayerSFX); WalkieTalkie.TransmitOneShotAudio(((EnemyAI)hoarderBugAI).creatureSFX, hoarderBugAI.hitPlayerSFX, 1f); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3037749952u, new RpcReceiveHandler(__rpc_handler_3037749952), "GetAngryAtPikminItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(3800975872u, new RpcReceiveHandler(__rpc_handler_3800975872), "GetAngryAtPikminItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(4093114400u, new RpcReceiveHandler(__rpc_handler_4093114400), "BiteNearbyPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(3148405217u, new RpcReceiveHandler(__rpc_handler_3148405217), "BiteNearbyPikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3037749952(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference itemRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemRef, default(ForNetworkSerializable)); NetworkObjectReference leaderRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HoarderBugPikminEnemy)(object)target).GetAngryAtPikminItemServerRpc(itemRef, leaderRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3800975872(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_004a: 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) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemRef, default(ForNetworkSerializable)); NetworkObjectReference leaderRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HoarderBugPikminEnemy)(object)target).GetAngryAtPikminItemClientRpc(itemRef, leaderRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4093114400(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((HoarderBugPikminEnemy)(object)target).BiteNearbyPikminServerRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_3148405217(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((HoarderBugPikminEnemy)(object)target).BiteNearbyPikminClientRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "HoarderBugPikminEnemy"; } } public class JesterPikminEnemy : PikminEnemy { private List PikminRefs = new List(); private JesterAI jesterAI = null; private float CheckInterval = 0.25f; private float BiteCooldown = 1.5f; public float BiteResetCooldown = 5f; public int BiteLimmit = 10; protected override void Start() { base.Start(); ref JesterAI reference = ref jesterAI; EnemyAI obj = enemyScript; reference = (JesterAI)(object)(((obj is JesterAI) ? obj : null) ?? throw new Exception("JesterPE: enemyScript is not a JesterAI")); if ((Object)(object)jesterAI == (Object)null) { ((Behaviour)this).enabled = false; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteCooldown = LethalMin.Jester_BiteCooldown.InternalValue; } } private void LateUpdate() { if (!((NetworkBehaviour)this).IsOwner || enemyScript.isEnemyDead || jesterAI.inKillAnimation || ((EnemyAI)jesterAI).currentBehaviourStateIndex != 2) { return; } if (BiteCooldown > 0f) { BiteCooldown -= Time.deltaTime; return; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteResetCooldown = LethalMin.Jester_BiteCooldown.InternalValue; BiteLimmit = LethalMin.Jester_BiteLimit.InternalValue; } if (CheckInterval > 0f) { CheckInterval -= Time.deltaTime; return; } DoCheckInterval(); CheckInterval = ((EnemyAI)jesterAI).AIIntervalTime + Random.Range(-0.015f, 0.015f); } public void DoCheckInterval() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) PikminRefs.Clear(); foreach (PikminAI item in GetNearbyPikmin()) { if (!item.IsAirborn && !((Object)(object)item.CurrentLatchTrigger != (Object)null)) { PikminRefs.Add(NetworkObjectReference.op_Implicit(((NetworkBehaviour)item).NetworkObject)); if (PikminRefs.Count >= BiteLimmit) { break; } } } if (PikminRefs.Count > 0) { BiteCooldown = BiteResetCooldown; BiteNearbyPikminServerRpc(PikminRefs.ToArray()); } } [ServerRpc] public void BiteNearbyPikminServerRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Invalid comparison between Unknown and I4 //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2948855529u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2948855529u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BiteNearbyPikminClientRpc(Pikmins); } } [ClientRpc] public void BiteNearbyPikminClientRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(475812140u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 475812140u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; List list = new List(); NetworkObject val4 = default(NetworkObject); PikminAI item = default(PikminAI); for (int i = 0; i < Pikmins.Length; i++) { NetworkObjectReference val3 = Pikmins[i]; if (((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref item)) { list.Add(item); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in BiteNearbyPikminClientRpc"); } } if (list.Count > 0) { BiteNearbyPikmin(list); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in BiteNearbyPikminClientRpc"); } } public void BiteNearbyPikmin(List Pikmins) { BiteCooldown = BiteResetCooldown; foreach (PikminAI Pikmin in Pikmins) { Pikmin.DeathSnapToPos = jesterAI.grabBodyPoint; Pikmin.OverrideDelay = 1f + (float)Pikmin.enemyRandom.Next(80) * 0.01f; ((EnemyAI)Pikmin).HitEnemy(999, (PlayerControllerB)null, false, -1); } ((EnemyAI)jesterAI).creatureAnimator.SetTrigger("KillPlayer"); ((EnemyAI)jesterAI).creatureSFX.PlayOneShot(jesterAI.killPlayerSFX); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2948855529u, new RpcReceiveHandler(__rpc_handler_2948855529), "BiteNearbyPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(475812140u, new RpcReceiveHandler(__rpc_handler_475812140), "BiteNearbyPikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2948855529(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((JesterPikminEnemy)(object)target).BiteNearbyPikminServerRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_475812140(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((JesterPikminEnemy)(object)target).BiteNearbyPikminClientRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "JesterPikminEnemy"; } } public class MaskedPlayerPikminEnemy : PikminEnemy { [CompilerGenerated] private sealed class <>c__DisplayClass10_0 { public MaskedPlayerPikminEnemy <>4__this; public float startTime; internal bool b__0() { return (Object)(object)<>4__this.maskedPlayerEnemy.mimickingPlayer != (Object)null || Time.realtimeSinceStartup - startTime > 20f; } } [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MaskedPlayerPikminEnemy <>4__this; private CustomMaskedAnimationManager 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = ((Component)<>4__this).GetComponent(); <>4__this.leader.IsWhistleing = true; <>2__current = 5__1.SetWhistleToOverride(); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.leader.StartWhistleingOnLocalClient(); <>2__current = (object)new WaitForSeconds(3f); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = <>4__this.leader.TweenSize(Reversed: true); <>1__state = 3; return true; case 3: <>1__state = -1; <>4__this.leader.StopWhistleingOnLocalClient(); ((MonoBehaviour)<>4__this).StartCoroutine(5__1.DeSetWhistleToOverride()); 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__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MaskedPlayerPikminEnemy <>4__this; private <>c__DisplayClass10_0 <>8__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass10_0(); <>8__1.<>4__this = <>4__this; <>8__1.startTime = Time.realtimeSinceStartup; <>2__current = (object)new WaitUntil((Func)(() => (Object)(object)<>8__1.<>4__this.maskedPlayerEnemy.mimickingPlayer != (Object)null || Time.realtimeSinceStartup - <>8__1.startTime > 20f)); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)<>4__this.maskedPlayerEnemy.mimickingPlayer != (Object)null) { <>4__this.SpawnSproutOnMaskedServerRpc(((NetworkBehaviour)<>4__this.maskedPlayerEnemy.mimickingPlayer).OwnerClientId); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private float CheckInterval = 0.25f; public PuffminLeader leader = null; public MaskedPlayerEnemy maskedPlayerEnemy = null; public bool IsLeafling = false; public int DespawnCount = 0; protected override void Start() { base.Start(); if ((Object)(object)maskedPlayerEnemy == (Object)null) { ref MaskedPlayerEnemy reference = ref maskedPlayerEnemy; EnemyAI obj = enemyScript; reference = (MaskedPlayerEnemy)(object)(((obj is MaskedPlayerEnemy) ? obj : null) ?? throw new Exception("maskedPlayerPE: enemyScript is not a maskedPlayerEnemy")); } if ((Object)(object)maskedPlayerEnemy == (Object)null) { ((Behaviour)this).enabled = false; } else if (((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)maskedPlayerEnemy).StartCoroutine(WaitForMimicToSpawn()); } } private void LateUpdate() { if (((NetworkBehaviour)this).IsOwner && !enemyScript.isEnemyDead) { if (CheckInterval > 0f) { CheckInterval -= Time.deltaTime; return; } DoCheckInterval(); CheckInterval = ((EnemyAI)maskedPlayerEnemy).AIIntervalTime + Random.Range(-0.015f, 0.015f); } } public void DoCheckInterval() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) if (!LethalMin.MaskedPlayerEnemy_ConvertPikmin || ((EnemyAI)maskedPlayerEnemy).isEnemyDead) { return; } if (!maskedPlayerEnemy.inKillAnimation && !maskedPlayerEnemy.handsOut && !leader.IsWhistleing && AreThereValidPikminNearby(((Component)maskedPlayerEnemy).transform.position, 10f)) { DoWhistleAnimServerRpc(); LethalMin.Logger.LogDebug((object)(((Object)((Component)maskedPlayerEnemy).gameObject).name + ": Found pikmin to whistle at")); } switch (((EnemyAI)maskedPlayerEnemy).currentBehaviourStateIndex) { case 0: if ((Object)(object)leader.PuffminHolding != (Object)null) { leader.DoThrow(); LethalMin.Logger.LogDebug((object)(((Object)((Component)maskedPlayerEnemy).gameObject).name + ": dropping held puffmin after exiting attack state")); } if (!maskedPlayerEnemy.inKillAnimation && !leader.IsWhistleing && AreThereValidPuffminNearby(((Component)maskedPlayerEnemy).transform.position, 10f)) { DoWhistleAnimServerRpc(); LethalMin.Logger.LogDebug((object)(((Object)((Component)maskedPlayerEnemy).gameObject).name + ": Found puffmin to whistle at")); } break; case 1: if (leader.PuffminInSquad.Count > 0 && (Object)(object)leader.PuffminHolding == (Object)null) { leader.StartThrow(); } if (maskedPlayerEnemy.handsOut && (Object)(object)leader.PuffminHolding != (Object)null) { Vector3 val = ((Component)((EnemyAI)maskedPlayerEnemy).targetPlayer).transform.position - ((Component)leader).transform.position; leader.OverrideThrowDirection = ((Vector3)(ref val)).normalized; leader.DoThrow(); } break; } } [ServerRpc] public void DoWhistleAnimServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3336601211u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3336601211u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DoWhistleAnimClientRpc(); } } [ClientRpc] public void DoWhistleAnimClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3673525531u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3673525531u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(DoWhistle()); } } } [IteratorStateMachine(typeof(d__9))] public IEnumerator DoWhistle() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__10))] public IEnumerator WaitForMimicToSpawn() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { <>4__this = this }; } public bool AreThereValidPikminNearby(Vector3 Pos, float range) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) foreach (PikminAI pikminAI in PikminManager.instance.PikminAIs) { if (Vector3.Distance(Pos, ((Component)pikminAI).transform.position) > range || !((Object)(object)pikminAI != (Object)null) || ((EnemyAI)pikminAI).currentBehaviourStateIndex != 0 || pikminAI.IsDeadOrDying || PikChecks.IsPikminResistantToHazard(pikminAI, PikminHazard.Spore, CallOnResist: false)) { continue; } return true; } return false; } public bool AreThereValidPuffminNearby(Vector3 Pos, float range) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) foreach (PuffminAI puffminAI in PikminManager.instance.PuffminAIs) { if (Vector3.Distance(Pos, ((Component)puffminAI).transform.position) > range || !((Object)(object)puffminAI != (Object)null) || ((EnemyAI)puffminAI).currentBehaviourStateIndex != 0 || puffminAI.IsDeadOrDying || !(puffminAI.WhistleBuffer <= 0f) || !((Object)(object)puffminAI.Leader == (Object)null)) { continue; } return true; } return false; } [ServerRpc(RequireOwnership = false)] public void SpawnSproutOnMaskedServerRpc(ulong PlayerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2847926377u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, PlayerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2847926377u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SpawnSproutOnMaskedClientRpc(PlayerID); } } } [ClientRpc] public void SpawnSproutOnMaskedClientRpc(ulong PlayerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2891527043u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, PlayerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2891527043u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SpawnSproutOnMasked(PlayerID); } } } public void SpawnSproutOnMasked(ulong PlayerThatWasMaskedID) { if (IsLeafling) { LethalMin.Logger.LogWarning((object)("Attempted to spawn a sprout on " + ((Object)((Component)maskedPlayerEnemy).gameObject).name + " but it is already a Leafling!")); return; } Leader leaderViaID = LethalMin.GetLeaderViaID(PlayerThatWasMaskedID); if ((Object)(object)leaderViaID == (Object)null) { LethalMin.Logger.LogWarning((object)("SpawnSproutOnMasked: Leader for " + ((Object)((Component)maskedPlayerEnemy).gameObject).name + " not found!")); } else if (leaderViaID.wasLeaflingBeforeDeath || leaderViaID.IsLeafling) { leaderViaID.wasLeaflingBeforeDeath = false; SetAsLeafling(); } } public void SetAsLeafling() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) IsLeafling = true; GameObject val = Object.Instantiate(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/MaskedSprout.prefab")); val.transform.SetParent(maskedPlayerEnemy.headTransform); val.transform.localPosition = new Vector3(0f, 0.3f, 0f); val.transform.localScale = new Vector3(0.65f, 0.65f, 0.65f); val.transform.localRotation = new Quaternion(0.2164f, 0f, 0f, -0.9763f); LethalMin.Logger.LogInfo((object)("Spawned Leafling Sprout on " + ((Object)((Component)this).gameObject).name)); } [ServerRpc(RequireOwnership = false)] public void IncrumentDestoryCountServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(270806546u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 270806546u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DespawnCount++; if (DespawnCount >= StartOfRound.Instance.connectedPlayersAmount + 1) { LethalMin.Logger.LogInfo((object)("All Clients marked to despawn " + ((Object)((Component)this).gameObject).name)); ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SpawnLeaflingGhostRpc() { //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) //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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2195499377u, val2, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2195499377u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GameObject val4 = Object.Instantiate(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/PlayerGhostPrefab.prefab"), ((Component)this).transform.position, Quaternion.identity); PlayerGhost component = val4.GetComponent(); Renderer componentInChildren = ((Component)component).GetComponentInChildren(); componentInChildren.material.color = new Color(16f / 85f, 5f / 51f, 0.20392157f, 0.75f); AudioSource componentInChildren2 = ((Component)component).GetComponentInChildren(); componentInChildren2.pitch = 0.8f; IncrumentDestoryCountServerRpc(); LethalMin.Logger.LogInfo((object)$"Spawned ghost for Leafling {((Object)((Component)this).gameObject).name} at {val4.transform.position}"); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3336601211u, new RpcReceiveHandler(__rpc_handler_3336601211), "DoWhistleAnimServerRpc"); ((NetworkBehaviour)this).__registerRpc(3673525531u, new RpcReceiveHandler(__rpc_handler_3673525531), "DoWhistleAnimClientRpc"); ((NetworkBehaviour)this).__registerRpc(2847926377u, new RpcReceiveHandler(__rpc_handler_2847926377), "SpawnSproutOnMaskedServerRpc"); ((NetworkBehaviour)this).__registerRpc(2891527043u, new RpcReceiveHandler(__rpc_handler_2891527043), "SpawnSproutOnMaskedClientRpc"); ((NetworkBehaviour)this).__registerRpc(270806546u, new RpcReceiveHandler(__rpc_handler_270806546), "IncrumentDestoryCountServerRpc"); ((NetworkBehaviour)this).__registerRpc(2195499377u, new RpcReceiveHandler(__rpc_handler_2195499377), "SpawnLeaflingGhostRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3336601211(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((MaskedPlayerPikminEnemy)(object)target).DoWhistleAnimServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3673525531(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; ((MaskedPlayerPikminEnemy)(object)target).DoWhistleAnimClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2847926377(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((MaskedPlayerPikminEnemy)(object)target).SpawnSproutOnMaskedServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2891527043(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((MaskedPlayerPikminEnemy)(object)target).SpawnSproutOnMaskedClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_270806546(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; ((MaskedPlayerPikminEnemy)(object)target).IncrumentDestoryCountServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2195499377(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; ((MaskedPlayerPikminEnemy)(object)target).SpawnLeaflingGhostRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "MaskedPlayerPikminEnemy"; } } public class MouthDogPikminEnemy : PikminEnemy { [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MouthDogPikminEnemy <>4__this; private float 5__1; private Quaternion 5__2; private Quaternion 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (((NetworkBehaviour)<>4__this.mouthDogAI).IsOwner) { ((EnemyAI)<>4__this.mouthDogAI).agent.speed = Mathf.Clamp(((EnemyAI)<>4__this.mouthDogAI).agent.speed, 2f, 0f); } Debug.Log((object)"killing pikmin A"); ((EnemyAI)<>4__this.mouthDogAI).creatureVoice.pitch = Random.Range(0.96f, 1.04f); ((EnemyAI)<>4__this.mouthDogAI).creatureVoice.PlayOneShot(<>4__this.mouthDogAI.killPlayerSFX, 1f); ((EnemyAI)<>4__this.mouthDogAI).creatureAnimator.SetTrigger("EndLungeKill"); <>4__this.mouthDogAI.inKillAnimation = true; Debug.Log((object)"killing pikmin B"); 5__1 = Time.timeSinceLevelLoad; 5__2 = Quaternion.Euler(new Vector3(0f, RoundManager.Instance.YRotationThatFacesTheFarthestFromPosition(((Component)<>4__this).transform.position + Vector3.up * 0.6f, 25f, 6), 0f)); 5__3 = ((Component)<>4__this).transform.rotation; goto IL_01e5; case 1: <>1__state = -1; if (((NetworkBehaviour)<>4__this.mouthDogAI).IsOwner) { ((Component)<>4__this.mouthDogAI).transform.rotation = Quaternion.RotateTowards(5__3, 5__2, 60f * Time.deltaTime); } goto IL_01e5; case 2: { <>1__state = -1; <>4__this.mouthDogAI.suspicionLevel = 2; ((EnemyAI)<>4__this.mouthDogAI).SwitchToBehaviourStateOnLocalClient(2); <>4__this.mouthDogAI.inKillAnimation = false; <>4__this.mouthDogAI.endingLunge = true; <>4__this.mouthDogAI.inLunge = false; <>4__this.mouthDogAI.lungeCooldown = 0.1f; return false; } IL_01e5: if (Time.timeSinceLevelLoad - 5__1 < 2f) { <>2__current = null; <>1__state = 1; return true; } <>2__current = (object)new WaitForSeconds(3.01f); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private List PikminRefs = new List(); private MouthDogAI mouthDogAI = null; private float CheckInterval = 0.25f; private float BiteCooldown = 1.5f; public float BiteResetCooldown = 5.5f; public int BiteLimmit = 7; protected override void Start() { base.Start(); ref MouthDogAI reference = ref mouthDogAI; EnemyAI obj = enemyScript; reference = (MouthDogAI)(object)(((obj is MouthDogAI) ? obj : null) ?? throw new Exception("MouthDogPE: enemyScript is not a MouthDogAI")); if ((Object)(object)mouthDogAI == (Object)null) { ((Behaviour)this).enabled = false; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteCooldown = LethalMin.MouthDog_BiteCooldown.InternalValue; } } private void LateUpdate() { if (!((NetworkBehaviour)this).IsOwner || !mouthDogAI.inLunge || mouthDogAI.inKillAnimation || enemyScript.isEnemyDead) { return; } if (BiteCooldown > 0f) { BiteCooldown -= Time.deltaTime; return; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteResetCooldown = LethalMin.MouthDog_BiteCooldown.InternalValue; BiteLimmit = LethalMin.MouthDog_BiteLimit.InternalValue; } if (CheckInterval > 0f) { CheckInterval -= Time.deltaTime; return; } DoCheckInterval(); CheckInterval = ((EnemyAI)mouthDogAI).AIIntervalTime + Random.Range(-0.015f, 0.015f); } public void DoCheckInterval() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) PikminRefs.Clear(); foreach (PikminAI item in GetNearbyPikmin()) { if (!item.IsAirborn && !((Object)(object)item.CurrentLatchTrigger != (Object)null)) { PikminRefs.Add(NetworkObjectReference.op_Implicit(((NetworkBehaviour)item).NetworkObject)); if (PikminRefs.Count >= BiteLimmit) { break; } } } if (PikminRefs.Count > 0) { BiteCooldown = BiteResetCooldown; BiteNearbyPikminServerRpc(PikminRefs.ToArray()); } } [ServerRpc] public void BiteNearbyPikminServerRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Invalid comparison between Unknown and I4 //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1037271452u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1037271452u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BiteNearbyPikminClientRpc(Pikmins); } } [ClientRpc] public void BiteNearbyPikminClientRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2151664476u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2151664476u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; List list = new List(); NetworkObject val4 = default(NetworkObject); PikminAI item = default(PikminAI); for (int i = 0; i < Pikmins.Length; i++) { NetworkObjectReference val3 = Pikmins[i]; if (((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref item)) { list.Add(item); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in BiteNearbyPikminClientRpc"); } } if (list.Count > 0) { BiteNearbyPikmin(list); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in BiteNearbyPikminClientRpc"); } } public void BiteNearbyPikmin(List Pikmins) { LethalMin.Logger.LogMessage((object)$"Biting {Pikmins.Count} Pikmin"); BiteCooldown = BiteResetCooldown; foreach (PikminAI Pikmin in Pikmins) { GrabbedPikmin.Add(Pikmin); Pikmin.GrabPikmin(mouthDogAI.mouthGrip, 2.5f, 5); } ((MonoBehaviour)this).StartCoroutine(DoBiteAnim()); } [IteratorStateMachine(typeof(d__12))] private IEnumerator DoBiteAnim() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { <>4__this = this }; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1037271452u, new RpcReceiveHandler(__rpc_handler_1037271452), "BiteNearbyPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(2151664476u, new RpcReceiveHandler(__rpc_handler_2151664476), "BiteNearbyPikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1037271452(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((MouthDogPikminEnemy)(object)target).BiteNearbyPikminServerRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_2151664476(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((MouthDogPikminEnemy)(object)target).BiteNearbyPikminClientRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "MouthDogPikminEnemy"; } } public class PumaPikminEnemy : PikminEnemy { private PumaAI pumaAI = null; private float scratchCheckInterval = 0.3f; private float scratchCooldown = 0f; private float scratchCooldownDuration = 1.5f; private int maxScratchHits = 3; protected override void Start() { base.Start(); ref PumaAI reference = ref pumaAI; EnemyAI obj = enemyScript; reference = (PumaAI)(object)(((obj is PumaAI) ? obj : null) ?? throw new Exception("PumaPE: enemyScript is not a PumaAI")); if ((Object)(object)pumaAI == (Object)null) { ((Behaviour)this).enabled = false; } } protected override void Update() { base.Update(); if (enemyScript.isEnemyDead) { return; } if (scratchCooldown > 0f) { scratchCooldown -= Time.deltaTime; } if (((EnemyAI)pumaAI).currentBehaviourStateIndex == 2) { if (scratchCheckInterval > 0f) { scratchCheckInterval -= Time.deltaTime; return; } scratchCheckInterval = 0.3f; CheckScratchNearbyPikmin(); } } private void CheckScratchNearbyPikmin() { //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner || scratchCooldown > 0f) { return; } Transform val = pumaAI.pushPoint; if ((Object)(object)val == (Object)null) { val = ((Component)pumaAI).transform; } List list = new List(); foreach (PikminAI item in GetNearbyPikmin()) { if (list.Count >= maxScratchHits) { break; } if (!item.IsDeadOrDying && !item.IsAirborn) { list.Add(NetworkObjectReference.op_Implicit(((NetworkBehaviour)item).NetworkObject)); } } if (list.Count > 0) { scratchCooldown = scratchCooldownDuration; ScratchNearbyPikminServerRpc(list.ToArray(), val.position); } } [ServerRpc(RequireOwnership = false)] public void ScratchNearbyPikminServerRpc(NetworkObjectReference[] pikRefs, Vector3 scratchPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2610963359u, val, (RpcDelivery)0); bool flag = pikRefs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(pikRefs, default(ForNetworkSerializable)); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref scratchPos); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2610963359u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ScratchNearbyPikminClientRpc(pikRefs, scratchPos); } } [ClientRpc] public void ScratchNearbyPikminClientRpc(NetworkObjectReference[] pikRefs, Vector3 scratchPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_00ac: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: 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_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3248477683u, val, (RpcDelivery)0); bool flag = pikRefs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(pikRefs, default(ForNetworkSerializable)); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref scratchPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3248477683u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); PikminAI pikminAI = default(PikminAI); for (int i = 0; i < pikRefs.Length; i++) { NetworkObjectReference val3 = pikRefs[i]; if (!((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null) || !((Component)val4).TryGetComponent(ref pikminAI) || pikminAI.IsDeadOrDying) { continue; } Vector3 val5 = ((Component)pikminAI).transform.position - scratchPos; Vector3 val6 = ((Vector3)(ref val5)).normalized; val6 += Vector3.up * 0.3f; val6 += Random.onUnitSphere * 0.2f; val6 = ((Vector3)(ref val6)).normalized; float num = pumaAI.scratchPushForce + Random.Range(0f, 2f); if (!PikChecks.IsPikminResistantToHazard(pikminAI, PikminHazard.Stab)) { pikminAI.ApplyKnockBack(val6 * num, 0.5f); if (!LethalMin.UseConfigsForEnemies.InternalValue || LethalMin.Puma_HurtsPikmin.InternalValue) { ((EnemyAI)pikminAI).HitEnemy(1, (PlayerControllerB)null, false, -1); } } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2610963359u, new RpcReceiveHandler(__rpc_handler_2610963359), "ScratchNearbyPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(3248477683u, new RpcReceiveHandler(__rpc_handler_3248477683), "ScratchNearbyPikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2610963359(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_007b: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikRefs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRefs, default(ForNetworkSerializable)); } Vector3 scratchPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scratchPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((PumaPikminEnemy)(object)target).ScratchNearbyPikminServerRpc(pikRefs, scratchPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3248477683(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_007b: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikRefs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRefs, default(ForNetworkSerializable)); } Vector3 scratchPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scratchPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((PumaPikminEnemy)(object)target).ScratchNearbyPikminClientRpc(pikRefs, scratchPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PumaPikminEnemy"; } } public class RadMechLatchTrigger : PikminLatchTrigger { public RadMechPikminEnemy radMechPikminEnemy = null; public override bool TryLatch(PikminAI pikmin, Vector3 Point, bool IsDirectHit = true, bool DoCheckOnly = false) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (!radMechPikminEnemy.attemptingPikminGrab) { return false; } if (pikmin.IsInShip) { return false; } if (pikmin.IsDeadOrDying || pikmin.IsAirborn || (Object)(object)pikmin.CurrentLatchTrigger != (Object)null) { return false; } return base.TryLatch(pikmin, Point, IsDirectHit, DoCheckOnly); } public override void LatchPikmin(PikminAI pikmin, Vector3 LandPos, bool IsDirectHit = true) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) pikmin.CallResetMethods(); base.LatchPikmin(pikmin, LandPos, IsDirectHit); if (!radMechPikminEnemy.PikminGrabbed.Contains(pikmin)) { radMechPikminEnemy.PikminGrabbed.Add(pikmin); } pikmin.PlayAudioOnLocalClient(PikminSoundPackSounds.Hurt); } } public class RadMechPikminEnemy : PikminEnemy { [CompilerGenerated] private sealed class <>c__DisplayClass19_0 { public RadMechPikminEnemy <>4__this; public float startTime; internal bool b__0() { return <>4__this.radMechAI.blowtorchActivated || Time.realtimeSinceStartup - startTime > 6f; } } [CompilerGenerated] private sealed class d__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public RadMechPikminEnemy <>4__this; private <>c__DisplayClass19_0 <>8__1; private List 5__2; private int 5__3; private float 5__4; private List.Enumerator <>s__5; private PikminAI 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 2) { try { } finally { <>m__Finally1(); } } <>8__1 = null; 5__2 = null; <>s__5 = default(List.Enumerator); 5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass19_0(); <>8__1.<>4__this = <>4__this; ((EnemyAI)<>4__this.radMechAI).creatureAnimator.SetBool("AttemptingGrab", true); ((EnemyAI)<>4__this.radMechAI).creatureAnimator.SetBool("GrabSuccessful", true); ((EnemyAI)<>4__this.radMechAI).creatureAnimator.SetBool("GrabUnsuccessful", false); <>8__1.startTime = Time.realtimeSinceStartup; <>2__current = (object)new WaitUntil((Func)(() => <>8__1.<>4__this.radMechAI.blowtorchActivated || Time.realtimeSinceStartup - <>8__1.startTime > 6f)); <>1__state = 1; return true; case 1: <>1__state = -1; <>8__1.startTime = Time.realtimeSinceStartup; 5__2 = new List(<>4__this.PikminGrabbed); 5__3 = 0; 5__4 = 0.25f / (float)5__2.Count; <>s__5 = 5__2.GetEnumerator(); <>1__state = -3; goto IL_022d; case 2: <>1__state = -3; if (!((Object)(object)5__6 == (Object)null) && !5__6.IsDeadOrDying) { if (!PikChecks.IsPikminResistantToHazard(5__6, PikminHazard.Fire)) { ((EnemyAI)5__6).KillEnemy(true); } 5__3++; LethalMin.Logger.LogDebug((object)$"RadMechPE: TorchPikminAnimation: Pikmin {((Object)((Component)5__6).gameObject).name} killed by torch. {5__3}-{5__2.Count} remaining."); 5__6 = null; } goto IL_022d; case 3: { <>1__state = -1; <>4__this.CancelTorchPikminAnimation(); if (((NetworkBehaviour)<>4__this).IsServer) { <>4__this.radMechAI.inTorchPlayerAnimation = false; ((EnemyAI)<>4__this.radMechAI).inSpecialAnimation = false; ((Behaviour)((EnemyAI)<>4__this.radMechAI).agent).enabled = true; } <>4__this.torchPikminCoroutine = null; return false; } IL_022d: if (<>s__5.MoveNext()) { 5__6 = <>s__5.Current; <>2__current = (object)new WaitForSeconds(5__4); <>1__state = 2; return true; } <>m__Finally1(); <>s__5 = default(List.Enumerator); LethalMin.Logger.LogInfo((object)$"RadMechPE: TorchPikminAnimation: Torch animation finished. {5__3} Pikmin killed."); <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 3; return true; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__5).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public List PikminGrabbed = new List(); private RadMechAI radMechAI = null; private RadMechLatchTrigger handTrigger = null; public int GrabLimmit = 10; public bool waitingToAttemptPikminGrab = false; public bool attemptingPikminGrab = false; public float attemptPikminGrabTimer = 0.4f; private float grabCheckInterval = 0.1f; private Coroutine? torchPikminCoroutine = null; protected override void Start() { base.Start(); ref RadMechAI reference = ref radMechAI; EnemyAI obj = enemyScript; reference = (RadMechAI)(object)(((obj is RadMechAI) ? obj : null) ?? throw new Exception("RadMechPE: enemyScript is not a RadMechAI")); if ((Object)(object)radMechAI == (Object)null) { ((Behaviour)this).enabled = false; return; } PikminLatchTrigger pikminLatchTrigger = LatchTriggers[0]; RadMechLatchTrigger radMechLatchTrigger = ((Component)pikminLatchTrigger).gameObject.AddComponent(); radMechLatchTrigger.StateCondisions.AddRange(Enum.GetValues(typeof(Pintent)).Cast()); radMechLatchTrigger.StateCondisions.Remove(Pintent.Stuck); radMechLatchTrigger.StateCondisions.Remove(Pintent.LatchedOn); radMechLatchTrigger.StateCondisions.Remove(Pintent.Dead); radMechLatchTrigger.StateToSet = LatchTriggerStateToSet.Stuck; radMechLatchTrigger.WhistleTime = -255f; radMechLatchTrigger.radMechPikminEnemy = this; radMechLatchTrigger.AllowBaseLatchOn = false; radMechLatchTrigger.OverrideLatchObject = radMechAI.holdPlayerPoint; handTrigger = radMechLatchTrigger; LatchTriggers.Remove(pikminLatchTrigger); LatchTriggers.Add(radMechLatchTrigger); Object.Destroy((Object)(object)pikminLatchTrigger); } public void LateUpdate() { if (((EnemyAI)radMechAI).isEnemyDead || StartOfRound.Instance.allPlayersDead || !((EnemyAI)radMechAI).ventAnimationFinished || !((NetworkBehaviour)radMechAI).IsServer || (((EnemyAI)radMechAI).currentBehaviourStateIndex == 2 && radMechAI.finishingFlight && (!radMechAI.inSky || radMechAI.flyTimer > 10f)) || ((bool)LethalMin.UseConfigsForEnemies && !LethalMin.RadMech_GrabsPikmin)) { return; } if ((bool)LethalMin.UseConfigsForEnemies) { GrabLimmit = LethalMin.RadMech_GrabLimmit.InternalValue; } if (attemptingPikminGrab) { if (grabCheckInterval > 0f) { grabCheckInterval -= Time.deltaTime; } else { grabCheckInterval = 0.1f + Random.Range(-0.015f, 0.015f); GrabClosePikmin(); } } if (!((EnemyAI)radMechAI).inSpecialAnimation) { AttemptPikminGrabIfClose(); } } public void AttemptPikminGrabIfClose() { //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)radMechAI).IsServer || ((EnemyAI)radMechAI).inSpecialAnimation || ((EnemyAI)radMechAI).currentBehaviourStateIndex == 2 || radMechAI.waitingToAttemptGrab || radMechAI.inTorchPlayerAnimation || (radMechAI.attemptingGrab && !attemptingPikminGrab)) { waitingToAttemptPikminGrab = false; } else if (attemptingPikminGrab) { attemptPikminGrabTimer -= Time.deltaTime; LethalMin.Logger.LogInfo((object)$"RadMechPE: Attempting Pikmin Grab Timer: {attemptPikminGrabTimer}"); if (PikminGrabbed.Count > 0 && attemptPikminGrabTimer < 0.75f) { BeginTorchPikminServerRpc(); } if (attemptPikminGrabTimer < 0f) { FinishAttemptPikminGrab(); } } else if (waitingToAttemptPikminGrab) { if (!radMechAI.takingStep) { waitingToAttemptPikminGrab = false; StartPikminGrabAttempt(); } } else if (attemptPikminGrabTimer < 0f) { foreach (PikminAI pikminAI in PikminManager.instance.PikminAIs) { if ((double)Vector3.Distance(((Component)this).transform.position, ((Component)pikminAI).transform.position) >= 5.2 || pikminAI.IsDeadOrDying || pikminAI.IsAirborn || (Object)(object)pikminAI.CurrentLatchTrigger != (Object)null || PikChecks.IsPikminResistantToHazard(pikminAI, PikminHazard.Fire, CallOnResist: false)) { continue; } waitingToAttemptPikminGrab = true; radMechAI.disableWalking = true; break; } attemptPikminGrabTimer = 0.4f; } else { attemptPikminGrabTimer -= Time.deltaTime; } } public void GrabClosePikmin() { //IL_0046: 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_00d3: 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) foreach (PikminAI pikminAI in PikminManager.instance.PikminAIs) { if (PikminGrabbed.Count >= GrabLimmit) { break; } if (!(Vector3.Distance(((Component)this).transform.position, ((Component)pikminAI).transform.position) >= 7f) && !PikminGrabbed.Contains(pikminAI) && !pikminAI.IsDeadOrDying && !pikminAI.IsAirborn && !((Object)(object)pikminAI.CurrentLatchTrigger != (Object)null) && handTrigger.TryLatch(pikminAI, ((Component)handTrigger).transform.position, IsDirectHit: true, DoCheckOnly: true)) { GrabPikminServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)pikminAI).NetworkObject)); } } } [ServerRpc(RequireOwnership = false)] public void GrabPikminServerRpc(NetworkObjectReference PikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3371547430u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3371547430u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GrabPikminClientRpc(PikRef); } } } [ClientRpc] public void GrabPikminClientRpc(NetworkObjectReference PikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3150535532u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3150535532u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); PikminAI pikminAI = default(PikminAI); if (((NetworkObjectReference)(ref PikRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref pikminAI)) { GrabPikmin(pikminAI); } else { LethalMin.Logger.LogError((object)"RadMechPE: GrabPikminClientRpc: PikminAI not found or invalid reference."); } } } public void GrabPikmin(PikminAI pikminAI) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (!PikminGrabbed.Contains(pikminAI)) { LethalMin.Logger.LogInfo((object)("RadMechPE: GrabPikmin: Pikmin " + ((Object)((Component)pikminAI).gameObject).name + " grabbed by Rad Mech.")); PikminGrabbed.Add(pikminAI); handTrigger.LatchPikmin(pikminAI, ((Component)handTrigger).transform.position); } } [ServerRpc] private void BeginTorchPikminServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_01a8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(60166926u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 60166926u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; radMechAI.inTorchPlayerAnimation = true; ((EnemyAI)radMechAI).inSpecialAnimation = true; ((Behaviour)((EnemyAI)radMechAI).agent).enabled = false; radMechAI.attemptingGrab = false; attemptingPikminGrab = false; int num = (int)((Component)this).transform.eulerAngles.y; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(radMechAI.centerPosition.position, radMechAI.centerPosition.forward, ref val3, 6f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { num = (int)RoundManager.Instance.YRotationThatFacesTheFarthestFromPosition(radMechAI.centerPosition.position, 20f, 5); } BeginTorchPikminClientRpc(); } } [ClientRpc] public void BeginTorchPikminClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1140841333u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1140841333u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BeginTorchPikmin(); } } } private void BeginTorchPikmin() { foreach (PikminAI item in PikminGrabbed) { } LethalMin.Logger.LogInfo((object)"RadMechPE: BeginTorchPikminClientRpc: Starting torch animation."); if (torchPikminCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(torchPikminCoroutine); torchPikminCoroutine = null; } torchPikminCoroutine = ((MonoBehaviour)this).StartCoroutine(TorchPikminAnimation()); } [IteratorStateMachine(typeof(d__19))] private IEnumerator TorchPikminAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { <>4__this = this }; } public void CancelTorchPikminAnimation() { LethalMin.Logger.LogInfo((object)"RadMechPE: CancelTorchPikminAnimation: Cancelling torch animation."); radMechAI.inTorchPlayerAnimation = false; ((EnemyAI)radMechAI).inSpecialAnimation = false; radMechAI.disableWalking = false; radMechAI.attemptGrabTimer = 5f; attemptPikminGrabTimer = 5f; if (((NetworkBehaviour)this).IsServer) { ((Behaviour)((EnemyAI)radMechAI).agent).enabled = true; } ((EnemyAI)radMechAI).creatureAnimator.SetBool("GrabSuccessful", false); ((EnemyAI)radMechAI).creatureAnimator.SetBool("AttemptingGrab", false); ((EnemyAI)radMechAI).creatureAnimator.SetBool("GrabUnsuccessful", false); foreach (PikminAI item in PikminGrabbed) { if (!((Object)(object)item == (Object)null)) { item.ApplyPhysics(Use3: true); item.LandBuffer = 0.5f; } } PikminGrabbed.Clear(); if (radMechAI.blowtorchActivated) { radMechAI.DisableBlowtorch(); } if (torchPikminCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(torchPikminCoroutine); } } public void StartPikminGrabAttempt() { LethalMin.Logger.LogInfo((object)"RadMechPE: StartPikminGrabAttemptClientRpc:(Server) Starting Pikmin grab attempt."); attemptingPikminGrab = true; radMechAI.attemptingGrab = true; radMechAI.attemptGrabTimer = 1.5f; attemptPikminGrabTimer = 1.5f; ((EnemyAI)radMechAI).creatureAnimator.SetBool("AttemptingGrab", true); ((EnemyAI)radMechAI).creatureAnimator.SetBool("GrabUnsuccessful", false); ((EnemyAI)radMechAI).creatureAnimator.SetBool("GrabSuccessful", false); radMechAI.disableWalking = true; StartPikminGrabAttemptClientRpc(); } [ClientRpc] public void StartPikminGrabAttemptClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1293342839u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1293342839u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LethalMin.Logger.LogInfo((object)"RadMechPE: StartPikminGrabAttemptClientRpc: Starting Pikmin grab attempt."); attemptingPikminGrab = true; radMechAI.attemptingGrab = true; ((EnemyAI)radMechAI).creatureAnimator.SetBool("AttemptingGrab", true); ((EnemyAI)radMechAI).creatureAnimator.SetBool("GrabUnsuccessful", false); ((EnemyAI)radMechAI).creatureAnimator.SetBool("GrabSuccessful", false); radMechAI.disableWalking = true; } } } public void FinishAttemptPikminGrab() { LethalMin.Logger.LogInfo((object)"RadMechPE: StartPikminGrabAttemptClientRpc:(Server) Finished Pikmin grab attempt."); attemptingPikminGrab = false; radMechAI.attemptingGrab = false; radMechAI.disableWalking = false; radMechAI.attemptGrabTimer = 5f; attemptPikminGrabTimer = 5f; ((EnemyAI)radMechAI).creatureAnimator.SetBool("GrabUnsuccessful", true); ((EnemyAI)radMechAI).creatureAnimator.SetBool("AttemptingGrab", false); FinishAttemptingPikminGrabClientRpc(); } [ClientRpc] public void FinishAttemptingPikminGrabClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(753648926u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 753648926u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LethalMin.Logger.LogInfo((object)"RadMechPE: StartPikminGrabAttemptClientRpc: Finished Pikmin grab attempt."); attemptingPikminGrab = false; radMechAI.attemptingGrab = false; radMechAI.disableWalking = false; ((EnemyAI)radMechAI).creatureAnimator.SetBool("GrabUnsuccessful", true); ((EnemyAI)radMechAI).creatureAnimator.SetBool("AttemptingGrab", false); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3371547430u, new RpcReceiveHandler(__rpc_handler_3371547430), "GrabPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(3150535532u, new RpcReceiveHandler(__rpc_handler_3150535532), "GrabPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(60166926u, new RpcReceiveHandler(__rpc_handler_60166926), "BeginTorchPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(1140841333u, new RpcReceiveHandler(__rpc_handler_1140841333), "BeginTorchPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(1293342839u, new RpcReceiveHandler(__rpc_handler_1293342839), "StartPikminGrabAttemptClientRpc"); ((NetworkBehaviour)this).__registerRpc(753648926u, new RpcReceiveHandler(__rpc_handler_753648926), "FinishAttemptingPikminGrabClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3371547430(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 pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RadMechPikminEnemy)(object)target).GrabPikminServerRpc(pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3150535532(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 pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RadMechPikminEnemy)(object)target).GrabPikminClientRpc(pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_60166926(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((RadMechPikminEnemy)(object)target).BeginTorchPikminServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1140841333(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; ((RadMechPikminEnemy)(object)target).BeginTorchPikminClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1293342839(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; ((RadMechPikminEnemy)(object)target).StartPikminGrabAttemptClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_753648926(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; ((RadMechPikminEnemy)(object)target).FinishAttemptingPikminGrabClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "RadMechPikminEnemy"; } } public class RedLocustBeesPikminEnemy : PikminEnemy { private RedLocustBees redLocustBees = null; public static int ChasePikminStateIndex = -1; public PikminAI? TargetPikmin = null; public Leader? TargetLeader = null; private float CheckInterval = 0.25f; private float ZapCooldown = 1.5f; public float ZapResetCooldown = 0.25f; public override void OnAddedToEnemy(EnemyAI enemy) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown ref RedLocustBees reference = ref redLocustBees; EnemyAI obj = enemyScript; reference = (RedLocustBees)(object)(((obj is RedLocustBees) ? obj : null) ?? throw new Exception("RedLocustBeesPE: enemyScript is not a RedLocustBees")); if ((Object)(object)redLocustBees == (Object)null) { ((Behaviour)this).enabled = false; return; } int num = 0; for (int i = 0; i < ((EnemyAI)redLocustBees).enemyBehaviourStates.Length; i++) { EnemyBehaviourState val = ((EnemyAI)redLocustBees).enemyBehaviourStates[i]; LethalMin.Logger.LogInfo((object)("Found RedLocustBee state: " + val.name)); num = i; } num++; EnemyBehaviourState val2 = new EnemyBehaviourState(); val2.name = "pikmin_defending"; EnemyBehaviourState[] array = ((EnemyAI)redLocustBees).enemyBehaviourStates; Array.Resize(ref array, array.Length + 1); array[^1] = val2; ((EnemyAI)redLocustBees).enemyBehaviourStates = array; ChasePikminStateIndex = num; LethalMin.Logger.LogInfo((object)$"Added state: {val2.name} to RedLocustBees enemy behaviour states index {num}"); } protected override void Start() { base.Start(); ref RedLocustBees reference = ref redLocustBees; EnemyAI obj = enemyScript; reference = (RedLocustBees)(object)(((obj is RedLocustBees) ? obj : null) ?? throw new Exception("RedLocustBeesPE: enemyScript is not a RedLocustBees")); if ((Object)(object)redLocustBees == (Object)null) { ((Behaviour)this).enabled = false; } } public void SetToChasePikmin(PlayerControllerB ownerPlayer, PikminAI targetPikmin) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) TargetPikmin = targetPikmin; SyncTargetPikminServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)targetPikmin).NetworkObject), ((NetworkBehaviour)ownerPlayer).OwnerClientId); ((EnemyAI)redLocustBees).SwitchToBehaviourState(ChasePikminStateIndex); redLocustBees.SwitchOwnershipOfBeesToClient(ownerPlayer); LethalMin.Logger.LogInfo((object)("Bees are now chasing " + targetPikmin.DebugID + " owned by " + ownerPlayer.playerUsername)); } private void LateUpdate() { //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) if (StartOfRound.Instance.allPlayersDead || ((EnemyAI)redLocustBees).daytimeEnemyLeaving) { return; } if ((bool)LethalMin.UseConfigsForEnemies) { ZapResetCooldown = LethalMin.RedLocustBees_ZapCooldown.InternalValue; if (!LethalMin.RedLocustBees_ZapPikmin.InternalValue && !LethalMin.RedLocustBees_KillPikmin.InternalValue) { return; } } if (((EnemyAI)redLocustBees).currentBehaviourStateIndex == ChasePikminStateIndex) { float num = Time.deltaTime * 0.7f; if (redLocustBees.previousState != ((EnemyAI)redLocustBees).currentBehaviourStateIndex) { redLocustBees.previousState = ((EnemyAI)redLocustBees).currentBehaviourStateIndex; redLocustBees.ResetBeeZapTimer(); redLocustBees.SetBeeParticleMode(1); if (!redLocustBees.overrideBeeParticleTarget) { redLocustBees.beeParticlesTarget.position = ((Component)this).transform.position + Vector3.up * 1.5f; } } if (redLocustBees.attackZapModeTimer > 3f) { redLocustBees.beesZappingMode = 1; redLocustBees.ResetBeeZapTimer(); } ((EnemyAI)redLocustBees).agent.speed = 6f; ((EnemyAI)redLocustBees).agent.acceleration = 13f; redLocustBees.beesIdle.volume = Mathf.Max(redLocustBees.beesIdle.volume - num, 0f); if (redLocustBees.beesIdle.isPlaying && redLocustBees.beesIdle.volume <= 0f) { redLocustBees.beesIdle.Stop(); } redLocustBees.beesDefensive.volume = Mathf.Min(redLocustBees.beesDefensive.volume + num, 1f); if (!redLocustBees.beesDefensive.isPlaying) { redLocustBees.beesDefensive.Play(); } redLocustBees.beesAngry.volume = Mathf.Max(redLocustBees.beesAngry.volume - num, 0f); if (redLocustBees.beesAngry.isPlaying && redLocustBees.beesAngry.volume <= 0f) { redLocustBees.beesAngry.Stop(); } } if (((NetworkBehaviour)this).IsOwner) { if (ZapCooldown > 0f) { ZapCooldown -= Time.deltaTime; } if (CheckInterval > 0f) { CheckInterval -= Time.deltaTime; return; } DoCheckInterval(); CheckInterval = ((EnemyAI)redLocustBees).AIIntervalTime + Random.Range(-0.015f, 0.015f); } } public void DoCheckInterval() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: 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) if (((EnemyAI)redLocustBees).currentBehaviourStateIndex == ChasePikminStateIndex) { if ((Object)(object)TargetPikmin == (Object)null || !RedLocustBeesPatch.PikminIsZappable(TargetPikmin) || Vector3.Distance(((Component)TargetPikmin).transform.position, ((Component)redLocustBees.hive).transform.position) > (float)redLocustBees.defenseDistance + 5f) { StopChasePikmin(); if (redLocustBees.IsHiveMissing()) { ((EnemyAI)redLocustBees).SwitchToBehaviourState(2); } else { ((EnemyAI)redLocustBees).SwitchToBehaviourState(0); } } else if ((Object)(object)TargetLeader != (Object)null && (Object)(object)TargetLeader.Controller.currentlyHeldObjectServer == (Object)(object)redLocustBees.hive) { ((EnemyAI)redLocustBees).SwitchToBehaviourState(2); } else { ((EnemyAI)redLocustBees).SetDestinationToPosition(((Component)TargetPikmin).transform.position, false); } } if (!(ZapCooldown > 0f) && (((EnemyAI)redLocustBees).currentBehaviourStateIndex == 1 || ((EnemyAI)redLocustBees).currentBehaviourStateIndex == 2 || ((EnemyAI)redLocustBees).currentBehaviourStateIndex == ChasePikminStateIndex)) { PikminAI zappablePikmin = RedLocustBeesPatch.GetZappablePikmin(redLocustBees, 3.5f); if (!((Object)(object)zappablePikmin == (Object)null)) { ZapCooldown = ZapResetCooldown; ZapPikminServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)zappablePikmin).NetworkObject)); } } } [ServerRpc] public void ZapPikminServerRpc(NetworkObjectReference PikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2226828302u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2226828302u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ZapPikminClientRpc(PikRef); } } [ClientRpc] public void ZapPikminClientRpc(NetworkObjectReference PikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2956911958u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2956911958u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); PikminAI targetPikmin = default(PikminAI); if (((NetworkObjectReference)(ref PikRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref targetPikmin)) { ZapPikmin(targetPikmin); } else { LethalMin.Logger.LogError((object)$"Failed to zap target pikmin {PikRef} for RedLocustBees {((Object)((Component)redLocustBees).gameObject).name}"); } } } public void ZapPikmin(PikminAI targetPikmin) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0035: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) if (!PikChecks.IsPikminResistantToHazard(targetPikmin, PikminHazard.Electricity)) { Vector3 val = ((Component)targetPikmin).transform.position - ((Component)redLocustBees).transform.position; val += Vector3.up * 2f; if ((bool)LethalMin.UseConfigsForEnemies && (bool)LethalMin.RedLocustBees_KillPikmin) { targetPikmin.DoZapDeath(); } else { targetPikmin.ApplyKnockBack(val, 5f); } if (redLocustBees.beesZappingMode != 3) { redLocustBees.beesZappingMode = 3; } } } public void StopChasePikmin() { LethalMin.Logger.LogInfo((object)("Stopped chasing " + TargetPikmin?.DebugID + " owned by " + TargetLeader?.Controller.playerUsername)); TargetPikmin = null; TargetLeader = null; redLocustBees.wasInChase = false; ResetTargetPikminServerRpc(); } [ServerRpc(RequireOwnership = false)] public void SyncTargetPikminServerRpc(NetworkObjectReference PikRef, ulong OwnerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1896936883u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, OwnerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1896936883u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyncTargetPikminClientRpc(PikRef, OwnerID); } } } [ClientRpc] public void SyncTargetPikminClientRpc(NetworkObjectReference PikRef, ulong OwnerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2590892551u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, OwnerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2590892551u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Leader leaderViaID = LethalMin.GetLeaderViaID(OwnerID); if ((Object)(object)leaderViaID == (Object)null) { LethalMin.Logger.LogWarning((object)$"Failed to sync Leader {PikRef} for RedLocustBees {((Object)((Component)redLocustBees).gameObject).name} owned by {OwnerID}"); } NetworkObject val3 = default(NetworkObject); PikminAI targetPikmin = default(PikminAI); if (((NetworkObjectReference)(ref PikRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref targetPikmin)) { TargetPikmin = targetPikmin; TargetLeader = leaderViaID; } else { LethalMin.Logger.LogError((object)$"Failed to sync target pikmin {PikRef} for RedLocustBees {((Object)((Component)redLocustBees).gameObject).name} owned by {OwnerID}"); } } } [ServerRpc(RequireOwnership = false)] public void ResetTargetPikminServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2818726231u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2818726231u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ResetTargetPikminClientRpc(); } } } [ClientRpc] public void ResetTargetPikminClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2999023007u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2999023007u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TargetPikmin = null; TargetLeader = null; } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2226828302u, new RpcReceiveHandler(__rpc_handler_2226828302), "ZapPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(2956911958u, new RpcReceiveHandler(__rpc_handler_2956911958), "ZapPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(1896936883u, new RpcReceiveHandler(__rpc_handler_1896936883), "SyncTargetPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(2590892551u, new RpcReceiveHandler(__rpc_handler_2590892551), "SyncTargetPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(2818726231u, new RpcReceiveHandler(__rpc_handler_2818726231), "ResetTargetPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(2999023007u, new RpcReceiveHandler(__rpc_handler_2999023007), "ResetTargetPikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2226828302(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RedLocustBeesPikminEnemy)(object)target).ZapPikminServerRpc(pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2956911958(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 pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RedLocustBeesPikminEnemy)(object)target).ZapPikminClientRpc(pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1896936883(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); ulong ownerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref ownerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((RedLocustBeesPikminEnemy)(object)target).SyncTargetPikminServerRpc(pikRef, ownerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2590892551(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); ulong ownerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref ownerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((RedLocustBeesPikminEnemy)(object)target).SyncTargetPikminClientRpc(pikRef, ownerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2818726231(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; ((RedLocustBeesPikminEnemy)(object)target).ResetTargetPikminServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2999023007(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; ((RedLocustBeesPikminEnemy)(object)target).ResetTargetPikminClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "RedLocustBeesPikminEnemy"; } } public class SandSpiderPikminEnemy : PikminEnemy { private List PikminRefs = new List(); private SandSpiderAI sandSpiderAI = null; private float CheckInterval = 0.25f; private float BiteCooldown = 1.5f; public float BiteResetCooldown = 3.5f; public int BiteLimmit = 2; protected override void Start() { base.Start(); ref SandSpiderAI reference = ref sandSpiderAI; EnemyAI obj = enemyScript; reference = (SandSpiderAI)(object)(((obj is SandSpiderAI) ? obj : null) ?? throw new Exception("SandSpiderPE: enemyScript is not a SandSpiderAI")); if ((Object)(object)sandSpiderAI == (Object)null) { ((Behaviour)this).enabled = false; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteCooldown = LethalMin.SandSpider_BiteCooldown.InternalValue; } } private void LateUpdate() { if (!((NetworkBehaviour)this).IsOwner || sandSpiderAI.onWall || enemyScript.isEnemyDead || enemyScript.currentBehaviourStateIndex != 2) { return; } if (BiteCooldown > 0f) { BiteCooldown -= Time.deltaTime; return; } if ((bool)LethalMin.UseConfigsForEnemies) { BiteResetCooldown = LethalMin.SandSpider_BiteCooldown.InternalValue; BiteLimmit = LethalMin.SandSpider_BiteLimit.InternalValue; } if (CheckInterval > 0f) { CheckInterval -= Time.deltaTime; return; } DoCheckInterval(); CheckInterval = ((EnemyAI)sandSpiderAI).AIIntervalTime + Random.Range(-0.015f, 0.015f); } public void DoCheckInterval() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) PikminRefs.Clear(); foreach (PikminAI item in GetNearbyPikmin()) { if (!item.IsAirborn && !((Object)(object)item.CurrentLatchTrigger != (Object)null)) { PikminRefs.Add(NetworkObjectReference.op_Implicit(((NetworkBehaviour)item).NetworkObject)); if (PikminRefs.Count >= BiteLimmit) { break; } } } if (PikminRefs.Count > 0) { BiteCooldown = BiteResetCooldown; BiteNearbyPikminServerRpc(PikminRefs.ToArray()); } } [ServerRpc] public void BiteNearbyPikminServerRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Invalid comparison between Unknown and I4 //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1715452637u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1715452637u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BiteNearbyPikminClientRpc(Pikmins); } } [ClientRpc] public void BiteNearbyPikminClientRpc(NetworkObjectReference[] Pikmins) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(881145350u, val, (RpcDelivery)0); bool flag = Pikmins != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikmins, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 881145350u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; List list = new List(); NetworkObject val4 = default(NetworkObject); PikminAI item = default(PikminAI); for (int i = 0; i < Pikmins.Length; i++) { NetworkObjectReference val3 = Pikmins[i]; if (((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref item)) { list.Add(item); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in BiteNearbyPikminClientRpc"); } } if (list.Count > 0) { BiteNearbyPikmin(list); } else { LethalMin.Logger.LogError((object)"Failed to get PikminAI from NetworkObjectReference in BiteNearbyPikminClientRpc"); } } public void BiteNearbyPikmin(List Pikmins) { BiteCooldown = BiteResetCooldown; foreach (PikminAI Pikmin in Pikmins) { Pikmin.DeathSnapToPos = sandSpiderAI.mouthTarget; Pikmin.OverrideDelay = 0.8f; ((EnemyAI)Pikmin).HitEnemy(1, (PlayerControllerB)null, false, -1); } ((EnemyAI)sandSpiderAI).creatureAnimator.SetTrigger("attack"); sandSpiderAI.overrideAnimation = 0.8f; ((EnemyAI)sandSpiderAI).creatureSFX.PlayOneShot(sandSpiderAI.attackSFX); WalkieTalkie.TransmitOneShotAudio(((EnemyAI)sandSpiderAI).creatureSFX, sandSpiderAI.attackSFX, 1f); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1715452637u, new RpcReceiveHandler(__rpc_handler_1715452637), "BiteNearbyPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(881145350u, new RpcReceiveHandler(__rpc_handler_881145350), "BiteNearbyPikminClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1715452637(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((SandSpiderPikminEnemy)(object)target).BiteNearbyPikminServerRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_881145350(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikmins = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikmins, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((SandSpiderPikminEnemy)(object)target).BiteNearbyPikminClientRpc(pikmins); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SandSpiderPikminEnemy"; } } public class StingrayPikminEnemy : PikminEnemy { private StingrayAI stingrayAI = null; private MethodInfo? createSlimeMethod; private float heavyItemCheckInterval = 0.5f; private float slimeSlipCheckInterval = 5f; private float slimeSlipChance = 0.15f; private float spitCooldown = 0f; private float spitCooldownDuration = 8f; protected override void Start() { base.Start(); ref StingrayAI reference = ref stingrayAI; EnemyAI obj = enemyScript; reference = (StingrayAI)(object)(((obj is StingrayAI) ? obj : null) ?? throw new Exception("StingrayPE: enemyScript is not a StingrayAI")); if ((Object)(object)stingrayAI == (Object)null) { ((Behaviour)this).enabled = false; } createSlimeMethod = typeof(StingrayAI).GetMethod("CreateSlime", BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[1] { typeof(Vector3) }, null); } protected override void Update() { base.Update(); if (!enemyScript.isEnemyDead && stingrayAI.mainAI) { if (spitCooldown > 0f) { spitCooldown -= Time.deltaTime; } if (heavyItemCheckInterval > 0f) { heavyItemCheckInterval -= Time.deltaTime; } else { heavyItemCheckInterval = 0.5f; CheckHeavyPikminCarriers(); } if (slimeSlipCheckInterval > 0f) { slimeSlipCheckInterval -= Time.deltaTime; return; } slimeSlipCheckInterval = 3f; CheckPikminOnSlime(); } } private void CheckHeavyPikminCarriers() { //IL_0117: Unknown result type (might be due to invalid IL or missing references) if ((LethalMin.UseConfigsForEnemies.InternalValue && !LethalMin.Stingray_HeavyCarriersCanTriggerSpit.InternalValue) || !((NetworkBehaviour)this).IsOwner || spitCooldown > 0f) { return; } int num = (LethalMin.UseConfigsForEnemies.InternalValue ? Mathf.Max(0, LethalMin.Stingray_CarryStrengthNeededToTriggerSpit.InternalValue) : 10); foreach (PikminAI item in GetNearbyPikmin()) { if (item.IsDeadOrDying || item.IsAirborn || !((Object)(object)item.TargetItem != (Object)null) || item.TargetItem.CarryStrengthNeeded < num) { continue; } spitCooldown = spitCooldownDuration; LethalMin.Logger.LogMessage((object)$"StingrayPE: Triggering spit response due to {item.DebugID} carrying item with carry strength {item.TargetItem.CarryStrengthNeeded} (threshold {num})"); TriggerSpitResponseServerRpc(((Component)stingrayAI).transform.position); break; } } [ServerRpc(RequireOwnership = false)] public void TriggerSpitResponseServerRpc(Vector3 spitOrigin) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2513596840u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref spitOrigin); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2513596840u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((EnemyAI)stingrayAI).currentBehaviourStateIndex == 1) { ((EnemyAI)stingrayAI).SwitchToBehaviourState(0); } Vector3[] array = (Vector3[])(object)new Vector3[5] { spitOrigin, spitOrigin + Vector3.right * 1.75f, spitOrigin + Vector3.right * -1.75f, spitOrigin + Vector3.forward * 1.75f, spitOrigin + Vector3.forward * -1.75f }; Vector3[] array2 = array; foreach (Vector3 val3 in array2) { stingrayAI.CreateSlimeRpc(val3); createSlimeMethod?.Invoke(stingrayAI, new object[1] { val3 }); } TriggerSpitResponseClientRpc(spitOrigin); } } [ClientRpc] public void TriggerSpitResponseClientRpc(Vector3 spitOrigin) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1345283010u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref spitOrigin); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1345283010u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)stingrayAI).creatureSFX.PlayOneShot(stingrayAI.spitSFX); WalkieTalkie.TransmitOneShotAudio(((EnemyAI)stingrayAI).creatureSFX, stingrayAI.spitSFX, 1f); stingrayAI.spitParticle.Play(true); KnockbackNearbyPikminFromSpit(spitOrigin); } } } private void KnockbackNearbyPikminFromSpit(Vector3 spitOrigin) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b1: Unknown result type (might be due to invalid IL or missing references) float spitRadius = stingrayAI.spitRadius; foreach (PikminAI pikminAI in PikminManager.instance.PikminAIs) { if (!((Object)(object)pikminAI == (Object)null) && !pikminAI.IsDeadOrDying && !pikminAI.IsAirborn) { float num = Vector3.Distance(spitOrigin, ((Component)pikminAI).transform.position); if (num < spitRadius) { Vector3 val = ((Component)pikminAI).transform.position - spitOrigin; Vector3 normalized = ((Vector3)(ref val)).normalized; normalized.y = 2f; normalized = ((Vector3)(ref normalized)).normalized; float force = Mathf.Lerp(6f, 2f, num / spitRadius); pikminAI.ApplyKnockBack(normalized, force); } } } } private void CheckPikminOnSlime() { //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) if ((LethalMin.UseConfigsForEnemies.InternalValue && !LethalMin.Stingray_PikminCanSlipOnSlime.InternalValue) || StartOfRound.Instance.slimeDecals == null || StartOfRound.Instance.slimeDecals.Count == 0) { return; } foreach (PikminAI pikminAI in PikminManager.instance.PikminAIs) { if ((Object)(object)pikminAI == (Object)null || !((NetworkBehaviour)pikminAI).IsOwner || pikminAI.IsDeadOrDying || pikminAI.IsAirborn || pikminAI.Laying || pikminAI.CurrentIntention == Pintent.Knockedback || pikminAI.CurrentIntention == Pintent.LatchedOn || (Object)(object)pikminAI.CurrentLatchTrigger != (Object)null) { continue; } bool flag = false; int num = Mathf.Min(30, StartOfRound.Instance.slimeDecals.Count); for (int i = 0; i < num; i++) { int index = i % StartOfRound.Instance.slimeDecals.Count; GameObject val = StartOfRound.Instance.slimeDecals[index]; if (!((Object)(object)val == (Object)null)) { float num2 = Vector3.Distance(((Component)pikminAI).transform.position, val.transform.position); if (num2 < 2.55f && ((Component)pikminAI).transform.position.y < val.transform.position.y + 0.3f) { flag = true; break; } } } if (flag && Random.value < slimeSlipChance) { Vector3 val2 = new Vector3(Random.Range(-0.3f, 0.3f), 1f, Random.Range(-0.3f, 0.3f)); Vector3 normalized = ((Vector3)(ref val2)).normalized; pikminAI.ApplyKnockBackServerRpc(normalized, 5f); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2513596840u, new RpcReceiveHandler(__rpc_handler_2513596840), "TriggerSpitResponseServerRpc"); ((NetworkBehaviour)this).__registerRpc(1345283010u, new RpcReceiveHandler(__rpc_handler_1345283010), "TriggerSpitResponseClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2513596840(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 spitOrigin = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spitOrigin); target.__rpc_exec_stage = (__RpcExecStage)1; ((StingrayPikminEnemy)(object)target).TriggerSpitResponseServerRpc(spitOrigin); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1345283010(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 spitOrigin = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spitOrigin); target.__rpc_exec_stage = (__RpcExecStage)1; ((StingrayPikminEnemy)(object)target).TriggerSpitResponseClientRpc(spitOrigin); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "StingrayPikminEnemy"; } } public class EnemyGrabbableObject : MonoBehaviour { public EnemyAI ai = null; public GrabbableObject grabbableObject = null; private Vector3 InitalScale = Vector3.one; public void Awake() { //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) ai = ((Component)this).GetComponent(); InitalScale = ((Component)this).transform.localScale; } public void FixedUpdate() { //IL_0039: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)grabbableObject == (Object)null)) { ((Behaviour)ai.agent).enabled = false; ((Behaviour)ai).enabled = false; ((Component)this).transform.localScale = Vector3.Scale(InitalScale, ((Component)grabbableObject).transform.localScale); ((Component)this).transform.localPosition = ((Component)grabbableObject).transform.position; ((Component)this).transform.localRotation = ((Component)grabbableObject).transform.rotation; } } private void LateUpdate() { if (((NetworkBehaviour)ai).IsServer && (Object)(object)grabbableObject == (Object)null) { LethalMin.Logger.LogInfo((object)("EnemyGrabbableObject: " + ((Object)((Component)this).gameObject).name + " has deteached from grabbableOBJ! (lateUpdated)")); ((NetworkBehaviour)ai).NetworkObject.Despawn(true); } } private void OnDestroy() { if (((NetworkBehaviour)ai).IsServer && (Object)(object)grabbableObject != (Object)null && ((NetworkBehaviour)grabbableObject).NetworkObject.IsSpawned) { LethalMin.Logger.LogInfo((object)("EnemyGrabbableObject: " + ((Object)((Component)this).gameObject).name + " has deteached from grabbableOBJ!")); ((NetworkBehaviour)grabbableObject).NetworkObject.Despawn(true); } } } public class GenerationManager : MonoBehaviour { private static GenerationManager _instance; private readonly List _switchables = new List(); public static GenerationManager Instance => _instance; private void Awake() { if ((Object)(object)_instance != (Object)null && (Object)(object)_instance != (Object)(object)this) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } _instance = this; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); } public void Register(IGenerationSwitchable switchable) { if (!_switchables.Contains(switchable)) { _switchables.Add(switchable); } } public void Unregister(IGenerationSwitchable switchable) { _switchables.Remove(switchable); } public void SwitchGeneration(PikminGeneration generation) { LethalMin.Logger.LogDebug((object)$"Switching to generation: {generation}"); foreach (IGenerationSwitchable switchable in _switchables) { switchable.SwitchGeneration(generation); } } } public class Glowmob : NetworkBehaviour { [CompilerGenerated] private sealed class d__62 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CallbackContext context; public Glowmob <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__62(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 //IL_005c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: <>1__state = -1; if (!<>4__this.IsGMAheld) { return false; } <>4__this.OnGlowmobStarted(context); 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__78 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Glowmob <>4__this; private Vector3 5__1; private Vector3 5__2; private Vector3 5__3; private float 5__4; private float 5__5; private WaitForEndOfFrame 5__6; private float 5__7; private float 5__8; private Vector3 5__9; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__78(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_012e: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)<>4__this.enemyHomingTarget == (Object)null) { return false; } 5__1 = ((Component)<>4__this).transform.position; 5__2 = ((Component)<>4__this.enemyHomingTarget).transform.position; 5__3 = new Vector3(5__2.x, 5__2.y + <>4__this.enemyHomingTarget.enemyScript.agent.height / 2f, 5__2.z); 5__4 = Mathf.Min(Vector3.Distance(5__1, 5__3) * 0.1f, 3f); 5__5 = 0f; 5__6 = new WaitForEndOfFrame(); break; case 1: <>1__state = -1; break; } if (5__5 < 5__4) { 5__7 = 5__5 / 5__4; 5__8 = Mathf.Sin(5__5 * 5f) * 2f; 5__9 = Vector3.Lerp(5__1, 5__3, 5__7); 5__9.y += 5__8; ((Component)<>4__this).transform.position = 5__9; 5__5 += Time.deltaTime; <>2__current = 5__6; <>1__state = 1; return true; } <>4__this.enemyHomingTarget = null; if (!((NetworkBehaviour)<>4__this).IsOwner || !<>4__this.IsThrown) { <>4__this.HomeingRoutine = null; return false; } <>4__this.BurstServerRpc(); <>4__this.Burst(); <>4__this.HomeingRoutine = null; 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__68 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Glowmob <>4__this; private int 5__1; private List.Enumerator <>s__2; private PikminAI 5__3; private GlowPikminAI 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__68(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <>s__2 = default(List.Enumerator); 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown try { int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -3; goto IL_00ce; } <>1__state = -1; 5__1 = <>4__this.GetNumberOfGlowsInSquad; <>s__2 = <>4__this.leaderScript.PikminInSquad.GetEnumerator(); <>1__state = -3; goto IL_00dd; IL_00ce: 5__4 = null; 5__3 = null; goto IL_00dd; IL_00dd: if (<>s__2.MoveNext()) { 5__3 = <>s__2.Current; 5__4 = 5__3 as GlowPikminAI; if (5__4 != null) { 5__4.SetToGlowMod(<>4__this); <>2__current = (object)new WaitForSeconds((float)5__1 * 5E-05f); <>1__state = 1; return true; } goto IL_00ce; } <>m__Finally1(); <>s__2 = default(List.Enumerator); return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__2).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public PikminType GlowPikminType = null; public GameObject Visualizer = null; public InputAction glowMobAction = null; public Leader leaderScript = null; public List PikminInGlowmob = new List(); public AudioClip HitBig = null; public AudioClip HitMid = null; public AudioClip HitSml = null; public AudioClip ThrowBig = null; public AudioClip ThrowMid = null; public AudioClip ThrowSml = null; public AudioClip ReadyBig = null; public AudioClip ReadyMid = null; public AudioClip ReadySml = null; public AudioClip ChargeBig = null; public AudioClip ChargeMid = null; public AudioClip ChargeSml = null; public AudioClip HoldBig = null; public AudioClip HoldMid = null; public AudioClip HoldSml = null; public AudioSource GlowmobLoop = null; public AudioSource SFXSource = null; public Animator BurstFX = null; public Light VisLight = null; public bool IsDoingGlowmob = false; public bool IsThrown = false; public float GlowMobProgress = 0f; public const float MaxGlowMobProgress = 1f; public float Cooldown = 0f; public float MaxCooldown = 5f; public int ExcpectedStrength = 1; public int ActualStrength = 1; private Coroutine SetToRouteine = null; public Transform holdPosition = null; private float flyingTimer = 0f; private PikminEnemy? enemyHomingTarget = null; private Rigidbody rb = null; private SphereCollider sphereCollider = null; private Coroutine? HeldRoutine = null; private Coroutine? HomeingRoutine = null; public bool IsOwnedAndConnected => ((NetworkBehaviour)this).IsOwner && (Object)(object)leaderScript == (Object)(object)PikminManager.instance.LocalLeader; public bool IsOnCooldown => Cooldown > 0f; public bool IsReady => GlowMobProgress >= 1f; private Vector3 TargetPos => holdPosition.position + holdPosition.forward * forwardOffset; private bool HasGlowInSquad => leaderScript.PikminInSquad.Any((PikminAI pikmin) => pikmin is GlowPikminAI); private float forwardOffset { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = ((Component)this).transform.localScale; return 4f + ((Vector3)(ref localScale)).magnitude; } } private int GetNumberOfGlowsInSquad => leaderScript.PikminInSquad.Count((PikminAI pikmin) => pikmin is GlowPikminAI); private bool IsGMAheld => glowMobAction.IsPressed(); [ServerRpc] public void SetLeaderServerRpc(NetworkObjectReference reff) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1339219469u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref reff, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1339219469u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetLeaderClientRpc(reff); } } [ClientRpc] public void SetLeaderClientRpc(NetworkObjectReference reff) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(210713416u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref reff, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 210713416u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); Leader leader = default(Leader); if (((NetworkObjectReference)(ref reff)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).gameObject.TryGetComponent(ref leader)) { SetLeader(leader); } else { LethalMin.Logger.LogError((object)$"Glowmob: {((NetworkBehaviour)this).OwnerClientId} tried to set a null leader"); } } } public void SetLeader(Leader leader) { leader.glowmob = this; leaderScript = leader; holdPosition = leaderScript.holdPosition; ((Object)((Component)this).gameObject).name = leaderScript.Controller.playerUsername + "'s Glowmob"; } public void Start() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) rb = ((Component)this).GetComponent(); sphereCollider = ((Component)this).GetComponent(); SwitchCollisionMode(); LethalMin.Logger.LogInfo((object)"Binding input actions for GlowMobObject"); if (!LethalMin.UseInputUtils) { string text = (LethalMin.InVRMode ? LethalMin.GlowmobVRAction.InternalValue : LethalMin.GlowmobAction.InternalValue); glowMobAction = new InputAction("Glowmob", (InputActionType)0, (string)null, (string)null, (string)null, (string)null); InputActionSetupExtensions.AddBinding(glowMobAction, text, (string)null, (string)null, (string)null); glowMobAction.started -= GlowmobStartedCheck; glowMobAction.canceled -= OnGlowmobCanceled; glowMobAction.started += GlowmobStartedCheck; glowMobAction.canceled += OnGlowmobCanceled; glowMobAction.Enable(); } else { glowMobAction = LethalMin.InputClassInstace.Glowmob; glowMobAction.started -= GlowmobStartedCheck; glowMobAction.canceled -= OnGlowmobCanceled; glowMobAction.started += GlowmobStartedCheck; glowMobAction.canceled += OnGlowmobCanceled; glowMobAction.Enable(); } } public void Update() { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00eb: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) Visualizer.SetActive(IsDoingGlowmob || IsThrown); VisLight.intensity = PikminInGlowmob.Count; VisLight.range = (float)PikminInGlowmob.Count * 0.5f; if (IsDoingGlowmob && !IsThrown) { int getNumberOfGlowsInSquad = GetNumberOfGlowsInSquad; if ((IsOwnedAndConnected && leaderScript.Controller.isPlayerDead) || getNumberOfGlowsInSquad == 0) { StopGlowmobServerRpc(); StopGlowmob(); return; } ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, TargetPos, Time.deltaTime * 5f); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, Quaternion.LookRotation(holdPosition.forward), Time.deltaTime * 25f); if (leaderScript.PikminInSquad.Count > 0) { float num = 0f; float num2 = (float)PikminInGlowmob.Count * 0.05f; float num3 = num + num2; ((Component)this).transform.localScale = Vector3.Lerp(((Component)this).transform.localScale, Vector3.one * num3, Time.deltaTime * 7f); } else { ((Component)this).transform.localScale = Vector3.one; } GlowMobProgress = (float)PikminInGlowmob.Count / (float)getNumberOfGlowsInSquad; } else { GlowMobProgress = 0f; } if (Cooldown > 0f) { Cooldown -= Time.deltaTime; } if (IsThrown && ((NetworkBehaviour)this).IsOwner) { if (flyingTimer > 0f) { flyingTimer -= Time.deltaTime; return; } LethalMin.Logger.LogWarning((object)$"Glowmob: {((NetworkBehaviour)this).OwnerClientId} is out of time to burst, bursting now"); BurstServerRpc(); Burst(); } else { flyingTimer = 10f; } } public void GlowmobStartedCheck(CallbackContext context) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (leaderScript.Controller.currentlyHeldObjectServer is WhistleItem || (LethalMin.InVRMode && (bool)LethalMin.GlowmobDelay)) { if (HeldRoutine != null) { ((MonoBehaviour)this).StopCoroutine(HeldRoutine); HeldRoutine = null; } HeldRoutine = ((MonoBehaviour)this).StartCoroutine(GlowmobHold(context)); } else { OnGlowmobStarted(context); } } [IteratorStateMachine(typeof(d__62))] private IEnumerator GlowmobHold(CallbackContext context) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__62(0) { <>4__this = this, context = context }; } public void OnGlowmobStarted(CallbackContext context) { if (IsOwnedAndConnected && HasGlowInSquad && !IsOnCooldown && !IsThrown && !IsDoingGlowmob && !((Object)(object)leaderScript.GetSelectedType() != (Object)(object)GlowPikminType)) { StartGlowmobServerRpc(); StartGlowmob(); HeldRoutine = null; } } public void OnGlowmobCanceled(CallbackContext context) { //IL_0078: 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_006e: Unknown result type (might be due to invalid IL or missing references) if (IsOwnedAndConnected && HeldRoutine != null) { ((MonoBehaviour)this).StopCoroutine(HeldRoutine); HeldRoutine = null; } if (IsOwnedAndConnected && IsDoingGlowmob) { if (IsReady) { PikminEnemy pikminEnemy = FindEnemyToHomeon(); ThrowGlowmobServerRpc((NetworkObjectReference)(((Object)(object)pikminEnemy != (Object)null) ? NetworkObjectReference.op_Implicit(((NetworkBehaviour)pikminEnemy).NetworkObject) : default(NetworkObjectReference))); ThrowGlowmob(pikminEnemy); } else { StopGlowmobServerRpc(); StopGlowmob(); } } } [ServerRpc] public void StartGlowmobServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2186251232u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2186251232u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StartGlowmobClientRpc(); } } [ClientRpc] public void StartGlowmobClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3805024118u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3805024118u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { StartGlowmob(); } } } public void StartGlowmob() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) if (IsDoingGlowmob) { LethalMin.Logger.LogWarning((object)$"Glowmob: {((NetworkBehaviour)this).OwnerClientId} is already doing glowmob"); return; } if (SetToRouteine != null) { ((MonoBehaviour)this).StopCoroutine(SetToRouteine); } LethalMin.Logger.LogInfo((object)$"Glowmob: {((NetworkBehaviour)this).OwnerClientId} is doing glowmob"); GlowMobProgress = 0f; IsDoingGlowmob = true; ((Component)this).transform.position = TargetPos; ((Component)this).transform.rotation = Quaternion.LookRotation(holdPosition.forward); ((Component)this).transform.localScale = Vector3.zero; int num = (ExcpectedStrength = GetNumberOfGlowsInSquad); if (num < 25) { SFXSource.PlayOneShot(ChargeSml); } else if (num < 50) { SFXSource.PlayOneShot(ChargeMid); } else { SFXSource.PlayOneShot(ChargeBig); } SetToRouteine = ((MonoBehaviour)this).StartCoroutine(SetPikminInSquadToMob()); } [IteratorStateMachine(typeof(d__68))] private IEnumerator SetPikminInSquadToMob() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__68(0) { <>4__this = this }; } [ServerRpc] public void OnReadyServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(980882960u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 980882960u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; OnReadyClientRpc(); } } [ClientRpc] public void OnReadyClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4033356779u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4033356779u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { OnReady(); } } } public void OnReady() { LethalMin.Logger.LogInfo((object)$"Glowmob: {((NetworkBehaviour)this).OwnerClientId} is ready to throw glowmob"); int count = PikminInGlowmob.Count; if (count < 25) { GlowmobLoop.clip = HoldSml; SFXSource.PlayOneShot(ReadySml); } else if (count < 50) { GlowmobLoop.clip = HoldMid; SFXSource.PlayOneShot(ReadyMid); } else { GlowmobLoop.clip = HoldBig; SFXSource.PlayOneShot(ReadyBig); } GlowmobLoop.Play(); } [ServerRpc] public void StopGlowmobServerRpc(bool DoingThrow = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1236629046u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref DoingThrow, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1236629046u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StopGlowmobClientRpc(DoingThrow); } } [ClientRpc] public void StopGlowmobClientRpc(bool DoThrow = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(412468020u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref DoThrow, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 412468020u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { StopGlowmob(DoThrow); } } } public void StopGlowmob(bool DoingThrow = false) { if (!IsDoingGlowmob) { LethalMin.Logger.LogWarning((object)$"Glowmob: {((NetworkBehaviour)this).OwnerClientId} is not doing glowmob"); return; } LethalMin.Logger.LogInfo((object)$"Glowmob: {((NetworkBehaviour)this).OwnerClientId} has stopped doing glowmob"); if (SetToRouteine != null) { ((MonoBehaviour)this).StopCoroutine(SetToRouteine); } GlowmobLoop.Stop(); GlowMobProgress = 0f; IsDoingGlowmob = false; if (DoingThrow) { return; } SFXSource.Stop(); List list = new List(PikminInGlowmob); list.AddRange(leaderScript.PikminInSquad.Where((PikminAI pikmin) => !PikminInGlowmob.Contains(pikmin))); foreach (PikminAI item in list) { if (item is GlowPikminAI glowPikminAI) { glowPikminAI.CancleGlowmob(SetCollisionMod: false, KeepLeader: true); } } } [ServerRpc] public void ThrowGlowmobServerRpc(NetworkObjectReference reff) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2642234169u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref reff, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2642234169u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ThrowGlowmobClientRpc(reff); } } [ClientRpc] public void ThrowGlowmobClientRpc(NetworkObjectReference reff) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3031651194u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref reff, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3031651194u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { NetworkObject val3 = default(NetworkObject); PikminEnemy enemy = default(PikminEnemy); if (((NetworkObjectReference)(ref reff)).Equals(default(NetworkObjectReference))) { ThrowGlowmob(null); } else if (((NetworkObjectReference)(ref reff)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).gameObject.TryGetComponent(ref enemy)) { ThrowGlowmob(enemy); } } } public void ThrowGlowmob(PikminEnemy? enemy) { //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogInfo((object)$"Glowmob: {((NetworkBehaviour)this).OwnerClientId} is throwing glowmob"); StopGlowmob(DoingThrow: true); IsThrown = true; MaxCooldown = (float)PikminInGlowmob.Count * 0.1f; Cooldown = MaxCooldown; int num = (ActualStrength = PikminInGlowmob.Count); if (num < 25) { SFXSource.PlayOneShot(ThrowSml); } else if (num < 50) { SFXSource.PlayOneShot(ThrowMid); } else { SFXSource.PlayOneShot(ThrowBig); } if ((Object)(object)enemy == (Object)null) { LethalMin.Logger.LogInfo((object)("Glowmob: " + ((Object)((Component)this).gameObject).name + " is thrown without homing")); SwitchCollisionMode(useRB: true); rb.AddForce(holdPosition.forward * 10f, (ForceMode)1); } else { LethalMin.Logger.LogMessage((object)("Glowmob: " + ((Object)((Component)this).gameObject).name + " is homing on " + ((Object)((Component)enemy).gameObject).name)); SwitchCollisionMode(); enemyHomingTarget = enemy; HomeingRoutine = ((MonoBehaviour)this).StartCoroutine(HomingAnim()); } } [IteratorStateMachine(typeof(d__78))] private IEnumerator HomingAnim() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__78(0) { <>4__this = this }; } public void OnTriggerEnter(Collider other) { if (!((NetworkBehaviour)this).IsOwner || !IsThrown) { return; } PikminEnemy pikminEnemy = ((Component)other).gameObject.GetComponentInParent(); if ((Object)(object)pikminEnemy == (Object)null) { pikminEnemy = ((Component)other).gameObject.GetComponentInChildren(); } if ((Object)(object)pikminEnemy != (Object)null && (Object)(object)pikminEnemy == (Object)(object)enemyHomingTarget) { LethalMin.Logger.LogInfo((object)("Glowmob: " + ((Object)((Component)this).gameObject).name + " has hit " + ((Object)((Component)pikminEnemy).gameObject).name)); if (HomeingRoutine != null) { ((MonoBehaviour)this).StopCoroutine(HomeingRoutine); } HomeingRoutine = null; enemyHomingTarget = null; BurstServerRpc(); Burst(); } } public void OnCollisionEnter(Collision collision) { if (((NetworkBehaviour)this).IsOwner && IsThrown) { BurstServerRpc(); Burst(); } } [ServerRpc] public void BurstServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1066230013u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1066230013u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; BurstClientRpc(); } } [ClientRpc] public void BurstClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1010250393u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1010250393u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { Burst(); } } } public void Burst() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) IsThrown = false; int count = PikminInGlowmob.Count; PikUtils.StunNearbyEnemies(((Component)this).transform.position, count / 2, (float)count * 0.5f); SwitchCollisionMode(); if (count < 25) { SFXSource.PlayOneShot(HitSml); } else if (count < 50) { SFXSource.PlayOneShot(HitMid); } else { SFXSource.PlayOneShot(HitBig); } BurstFX.Play("BurstAnim"); List list = new List(PikminInGlowmob); foreach (PikminAI item in list) { if (item is GlowPikminAI glowPikminAI) { glowPikminAI.BurstFromGlowMob(); } } } public PikminEnemy? FindEnemyToHomeon() { //IL_0080: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) PikminEnemy result = null; float num = float.MaxValue; float num2 = 50f; float num3 = 90f; PikminEnemy[] array = Object.FindObjectsOfType(); foreach (PikminEnemy pikminEnemy in array) { if ((Object)(object)pikminEnemy == (Object)null || pikminEnemy.enemyScript.isEnemyDead || LethalMin.AttackBlacklistConfig.InternalValue.Contains(pikminEnemy.enemyScript.enemyType.enemyName)) { continue; } Vector3 val = ((Component)pikminEnemy).transform.position - ((Component)this).transform.position; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude > num2)) { float num4 = Vector3.Angle(((Component)this).transform.forward, val); if (num4 <= num3 && magnitude < num) { num = magnitude; result = pikminEnemy; } } } return result; } public void SwitchCollisionMode(bool useRB = false) { if (useRB) { rb.isKinematic = false; rb.useGravity = true; ((Collider)sphereCollider).isTrigger = false; } else { rb.isKinematic = true; rb.useGravity = false; ((Collider)sphereCollider).isTrigger = true; } } 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 //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1339219469u, new RpcReceiveHandler(__rpc_handler_1339219469), "SetLeaderServerRpc"); ((NetworkBehaviour)this).__registerRpc(210713416u, new RpcReceiveHandler(__rpc_handler_210713416), "SetLeaderClientRpc"); ((NetworkBehaviour)this).__registerRpc(2186251232u, new RpcReceiveHandler(__rpc_handler_2186251232), "StartGlowmobServerRpc"); ((NetworkBehaviour)this).__registerRpc(3805024118u, new RpcReceiveHandler(__rpc_handler_3805024118), "StartGlowmobClientRpc"); ((NetworkBehaviour)this).__registerRpc(980882960u, new RpcReceiveHandler(__rpc_handler_980882960), "OnReadyServerRpc"); ((NetworkBehaviour)this).__registerRpc(4033356779u, new RpcReceiveHandler(__rpc_handler_4033356779), "OnReadyClientRpc"); ((NetworkBehaviour)this).__registerRpc(1236629046u, new RpcReceiveHandler(__rpc_handler_1236629046), "StopGlowmobServerRpc"); ((NetworkBehaviour)this).__registerRpc(412468020u, new RpcReceiveHandler(__rpc_handler_412468020), "StopGlowmobClientRpc"); ((NetworkBehaviour)this).__registerRpc(2642234169u, new RpcReceiveHandler(__rpc_handler_2642234169), "ThrowGlowmobServerRpc"); ((NetworkBehaviour)this).__registerRpc(3031651194u, new RpcReceiveHandler(__rpc_handler_3031651194), "ThrowGlowmobClientRpc"); ((NetworkBehaviour)this).__registerRpc(1066230013u, new RpcReceiveHandler(__rpc_handler_1066230013), "BurstServerRpc"); ((NetworkBehaviour)this).__registerRpc(1010250393u, new RpcReceiveHandler(__rpc_handler_1010250393), "BurstClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1339219469(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference leaderServerRpc = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderServerRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Glowmob)(object)target).SetLeaderServerRpc(leaderServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_210713416(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 leaderClientRpc = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderClientRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Glowmob)(object)target).SetLeaderClientRpc(leaderClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2186251232(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((Glowmob)(object)target).StartGlowmobServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3805024118(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; ((Glowmob)(object)target).StartGlowmobClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_980882960(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((Glowmob)(object)target).OnReadyServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4033356779(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; ((Glowmob)(object)target).OnReadyClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1236629046(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { bool doingThrow = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref doingThrow, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Glowmob)(object)target).StopGlowmobServerRpc(doingThrow); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_412468020(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 doThrow = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref doThrow, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Glowmob)(object)target).StopGlowmobClientRpc(doThrow); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2642234169(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference reff = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref reff, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Glowmob)(object)target).ThrowGlowmobServerRpc(reff); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3031651194(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 reff = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref reff, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Glowmob)(object)target).ThrowGlowmobClientRpc(reff); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1066230013(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((Glowmob)(object)target).BurstServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1010250393(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; ((Glowmob)(object)target).BurstClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Glowmob"; } } public class GlowPikminAI : PikminAI { [CompilerGenerated] private sealed class d__37 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GlowPikminAI <>4__this; private Vector3 5__1; private Vector3 5__2; private Vector3 5__3; private Vector3 5__4; private float 5__5; private float 5__6; private WaitForEndOfFrame 5__7; private PikminEnemy 5__8; private PikminLatchTrigger 5__9; private int 5__10; private Vector3 5__11; private float 5__12; private float 5__13; private float 5__14; private Vector3 5__15; private Vector3 5__16; private float 5__17; private Vector3 5__18; private List.Enumerator <>s__19; private PikminLatchTrigger 5__20; private float 5__21; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__37(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__7 = null; 5__8 = null; 5__9 = null; <>s__19 = default(List.Enumerator); 5__20 = null; <>1__state = -2; } private bool MoveNext() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_0724: Unknown result type (might be due to invalid IL or missing references) //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_0744: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Expected O, but got Unknown //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0649: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Expected O, but got Unknown //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0594: 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 = <>4__this.GetBurstFlyPos(); 5__2 = ((Component)<>4__this).transform.position; 5__3 = ((Component)<>4__this.modelContainer).transform.localScale; 5__4 = Vector3.one; 5__5 = 0.5f; 5__6 = 0f; 5__7 = new WaitForEndOfFrame(); <>4__this.SetOffGlowMob(SetCollisionMod: false); ((Component)<>4__this.modelContainer).gameObject.SetActive(true); goto IL_0254; case 1: <>1__state = -1; goto IL_0254; case 2: <>1__state = -1; if (!((NetworkBehaviour)<>4__this).IsOwner) { <>4__this.SetCollisionMode(1); return false; } ((Behaviour)<>4__this.transform2).enabled = true; 5__8 = <>4__this.GetClosestEnemy(25f); if ((Object)(object)5__8 == (Object)null) { <>4__this.ApplyPhysics(Use3: true); <>4__this.ShouldReturnToPreviousLeader = true; <>4__this.LeaderAssesmentDelay = 0.5f; return false; } if (!<>4__this.pikminType.CanLatchOnToObjects || !((Object)(object)5__8 != (Object)null) || !((Object)(object)5__8.enemyScript.enemyType != (Object)(object)((EnemyAI)<>4__this).enemyType) || 5__8.enemyScript.isEnemyDead) { <>4__this.ApplyPhysics(Use3: true); <>4__this.ShouldReturnToPreviousLeader = true; <>4__this.LeaderAssesmentDelay = 0.5f; LethalMin.Logger.LogWarning((object)(((Object)((Component)<>4__this).gameObject).name + ": enemy is not latchable, applying physics")); return false; } 5__9 = null; <>s__19 = 5__8.LatchTriggers.GetEnumerator(); try { while (<>s__19.MoveNext()) { 5__20 = <>s__19.Current; if ((Object)(object)5__9 == (Object)null || Vector3.Distance(((Component)5__20).transform.position, ((Component)<>4__this).transform.position) < Vector3.Distance(((Component)5__9).transform.position, ((Component)<>4__this).transform.position)) { 5__9 = 5__20; } 5__20 = null; } } finally { ((IDisposable)<>s__19).Dispose(); } <>s__19 = default(List.Enumerator); if ((Object)(object)5__9 == (Object)null) { <>4__this.ApplyPhysics(Use3: true); <>4__this.ShouldReturnToPreviousLeader = true; <>4__this.LeaderAssesmentDelay = 0.5f; LethalMin.Logger.LogWarning((object)(((Object)((Component)<>4__this).gameObject).name + ": no latch trigger found, applying physics")); return false; } 5__10 = 5__8.LatchTriggers.IndexOf(5__9); 5__11 = ((Component)5__9).GetComponent().ClosestPoint(5__1); if ((Object)(object)5__8 == (Object)null || !5__9.TryLatch(<>4__this, 5__11, IsDirectHit: true, DoCheckOnly: true)) { <>4__this.ApplyPhysics(Use3: true); <>4__this.ShouldReturnToPreviousLeader = true; <>4__this.LeaderAssesmentDelay = 0.5f; LethalMin.Logger.LogWarning((object)(((Object)((Component)<>4__this).gameObject).name + ": latch failed, applying physics")); return false; } 5__12 = 0.5f; 5__13 = 0f; goto IL_069a; case 3: <>1__state = -1; goto IL_069a; case 4: { <>1__state = -1; <>4__this.LatchPikminOnToEnemy(5__8, ((Component)5__9).GetComponent().ClosestPoint(((Component)<>4__this).transform.position), 5__10); <>4__this.LatchPikminOnToEnemyServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)5__8).NetworkObject), ((Component)5__9).GetComponent().ClosestPoint(((Component)<>4__this).transform.position), 5__10); return false; } IL_069a: if (5__13 < 5__12) { 5__21 = 5__13 / 5__12; ((Component)<>4__this).transform.position = Vector3.Lerp(5__1, 5__11, 5__21); ((Component)<>4__this).transform.LookAt(5__2); 5__13 += Time.deltaTime; <>2__current = 5__7; <>1__state = 3; return true; } <>2__current = (object)new WaitForSeconds(Random.Range(0f, 0.1f)); <>1__state = 4; return true; IL_0254: if (5__6 < 5__5) { 5__14 = 5__6 / 5__5; Vector3 val = 5__1 - 5__2; 5__15 = ((Vector3)(ref val)).normalized; 5__15.y = 0f; 5__16 = Vector3.Lerp(5__2, 5__1, 0.5f) + 5__15 * 7.5f; 5__17 = 1f - 5__14; 5__18 = 5__17 * 5__17 * 5__2 + 2f * 5__17 * 5__14 * 5__16 + 5__14 * 5__14 * 5__1; ((Component)<>4__this).transform.LookAt(5__2); ((Component)<>4__this).transform.position = 5__18; ((Component)<>4__this.modelContainer).transform.localScale = Vector3.Lerp(5__3, 5__4, 5__14 * 2f); 5__6 += Time.deltaTime; <>2__current = 5__7; <>1__state = 1; return true; } <>4__this.HasDoneGlowMobAnim = false; ((Component)<>4__this.modelContainer).transform.localScale = Vector3.one; <>2__current = (object)new WaitForSeconds(0.15f - (float)<>4__this.enemyRandom.Next(0, 10) * 0.01f); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__39 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GlowPikminAI <>4__this; private Vector3 5__1; private Vector3 5__2; private float 5__3; private float 5__4; private WaitForEndOfFrame 5__5; private float 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__39(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_0030: 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_004a: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.HasDoneGlowMobAnim = true; 5__1 = Vector3.one; 5__2 = new Vector3(0.001f, 0.001f, 0.001f); 5__3 = 1f; 5__4 = 0f; 5__5 = new WaitForEndOfFrame(); break; case 1: <>1__state = -1; break; } if (5__4 < 5__3) { 5__6 = 5__4 / 5__3; ((Component)<>4__this.modelContainer).transform.localScale = Vector3.Lerp(5__1, 5__2, 5__6); 5__4 += Time.deltaTime; <>2__current = 5__5; <>1__state = 1; return true; } ((Component)<>4__this.modelContainer).gameObject.SetActive(false); ((Component)<>4__this.modelContainer).transform.localScale = 5__2; <>4__this.SetToRouteine = null; 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__50 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 pos; public GlowPikminAI <>4__this; private AudioClip 5__1; private AudioClip 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__50(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; LethalMin.Logger.LogInfo((object)$"{((Object)((Component)<>4__this).gameObject).name}: teleporting to {pos}"); <>4__this.animController.WalkingCondition.enabled = false; <>4__this.animController.PlayAnimation(((Object)<>4__this.WarpInAnim).name); 5__1 = <>4__this.WarpStartSFX[<>4__this.enemyRandom.Next(0, <>4__this.WarpStartSFX.Length)]; ((EnemyAI)<>4__this).creatureVoice.PlayOneShot(5__1); <>2__current = (object)new WaitForSeconds(Mathf.Max(5__1.length, <>4__this.WarpInAnim.length) + 0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; if (((NetworkBehaviour)<>4__this).IsOwner) { ((EnemyAI)<>4__this).agent.Warp(pos); } else { <>4__this.transform2.TeleportOnLocalClient(pos); } <>4__this.animController.PlayAnimation(((Object)<>4__this.WarpOutAnim).name); 5__2 = <>4__this.WarpEndSFX[<>4__this.enemyRandom.Next(0, <>4__this.WarpEndSFX.Length)]; ((EnemyAI)<>4__this).creatureVoice.PlayOneShot(5__2); <>2__current = (object)new WaitForSeconds(Mathf.Max(5__2.length, <>4__this.WarpOutAnim.length) + 0.1f); <>1__state = 2; return true; case 2: <>1__state = -1; <>4__this.animController.WalkingCondition.enabled = true; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__46 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GlowPikminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__46(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(2f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.IncrumentDestoryCountServerRpc(); 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__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GlowPikminAI <>4__this; private SelectableLevel 5__1; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(Random.Range(0.1f, 1f)); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = StartOfRound.Instance.currentLevel; 5__2 = LethalMin.GlowOddsToTurnIntoSeed; if (((object)(LevelWeatherType)(ref 5__1.currentWeather)).ToString().Equals("Eclipsed", StringComparison.OrdinalIgnoreCase) && 5__2 != 0f) { 5__2 *= 1.5f; LethalMin.Logger.LogDebug((object)$"Eclipsed weather detected, increasing glow pikmin seed transformation chance to {5__2}"); } if (Random.value <= 5__2 || LethalMin.OnCompany) { <>4__this.ShouldTurnintoSeed = true; } else { <>4__this.ShouldTurnintoSeed = false; } <>4__this.SetShouldTurnintoSeedClientRpc(<>4__this.ShouldTurnintoSeed); 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__31 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GlowPikminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__31(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; if ((Object)(object)<>4__this.leader == (Object)null && (Object)(object)<>4__this.previousLeader != (Object)null && <>4__this.previousLeader.Controller.isPlayerControlled) { <>4__this.ShouldReturnToPreviousLeader = true; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Glowmob? TargetGlowMob = null; public AudioClip TransformSeedSFX = null; public AnimationClip ToGlowMobAnim = null; public AnimationClip FromGlowMobAnim = null; public AnimationClip WarpInAnim = null; public AnimationClip WarpOutAnim = null; public AudioClip[] FlashBangStartVoice = null; public AudioClip[] BornBallVoice = null; public AudioClip[] WarpStartSFX = null; public AudioClip[] WarpEndSFX = null; public bool HasDoneGlowMobAnim = false; public bool ShouldReturnToPreviousLeader = false; public bool ShouldTurnintoSeed = false; private Coroutine? SetToRouteine = null; private Coroutine? BurstRoutine = null; private float initalGlowmobDistance = 10f; public override void CallResetMethods(bool RemoveLeader = true, bool DropItem = true, bool RemoveEnemy = true, int CollisionMode = 1, bool Unlatch = true, bool RemoveTask = true, bool RemoveOverridePositions = true, bool SetLayingFalse = true) { base.CallResetMethods(RemoveLeader, DropItem, RemoveEnemy, CollisionMode, Unlatch, RemoveTask, RemoveOverridePositions); if (CollisionMode >= 0) { CancleGlowmob(); } } public override void StartThrow() { base.StartThrow(); CancleGlowmob(); } public override void OnNetworkDespawn() { base.OnNetworkDespawn(); if ((Object)(object)TargetGlowMob != (Object)null) { TargetGlowMob.PikminInGlowmob.Remove(this); } TargetGlowMob = null; } public override void Start() { base.Start(); animController.AddAnimationCondition(() => Object.op_Implicit((Object)(object)TargetGlowMob), ToGlowMobAnim, 50); if (SpawnProps.SpawnSound == "BornB") { ((EnemyAI)this).creatureVoice.PlayOneShot(BornBallVoice[enemyRandom.Next(0, BornBallVoice.Length)]); } if (((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).StartCoroutine(WaitForSpawn()); } } [IteratorStateMachine(typeof(d__20))] private IEnumerator WaitForSpawn() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { <>4__this = this }; } [ClientRpc] public void SetShouldTurnintoSeedClientRpc(bool Val) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(24476713u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Val, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 24476713u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ShouldTurnintoSeed = Val; } } } public override void Update() { base.Update(); base.Unselectable = Object.op_Implicit((Object)(object)TargetGlowMob); if (!Object.op_Implicit((Object)(object)TargetGlowMob) && HasDoneGlowMobAnim) { RevertGlowMobAnim(); } } public override void UpdateLocalSnapping() { //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) base.UpdateLocalSnapping(); if (((Behaviour)((EnemyAI)this).agent).enabled || !((Object)(object)TargetGlowMob != (Object)null)) { return; } if ((Object)(object)leader == (Object)null) { CancleGlowmob(); } else if (!TargetGlowMob.PikminInGlowmob.Contains(this)) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)TargetGlowMob).transform.position); float num2 = Mathf.Lerp(50f, 10f, Mathf.Clamp01(num / initalGlowmobDistance)); ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, ((Component)TargetGlowMob).transform.position, Time.deltaTime * num2); ((Component)this).transform.LookAt(((Component)TargetGlowMob).transform); if (Vector3.Distance(((Component)this).transform.position, ((Component)TargetGlowMob).transform.position) < 5f && !HasDoneGlowMobAnim && SetToRouteine == null) { SetToRouteine = ((MonoBehaviour)this).StartCoroutine(GlowMobAnim()); } if (Vector3.Distance(((Component)this).transform.position, ((Component)TargetGlowMob).transform.position) < 1f) { TargetGlowMob.PikminInGlowmob.Add(this); LethalMin.Logger.LogDebug((object)(((Object)((Component)this).gameObject).name + ": added to " + ((Object)((Component)TargetGlowMob).gameObject).name)); } } else { ((Component)this).transform.position = ((Component)TargetGlowMob).transform.position; ((Component)this).transform.rotation = ((Component)TargetGlowMob).transform.rotation; } } public override void HandleIdleStateOnOwnerClient() { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) if (CurrentIntention == Pintent.Idle && ShouldReturnToPreviousLeader && (Object)(object)previousLeader != (Object)null) { if ((Object)(object)leader != (Object)null) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + ": " + ((Object)((Component)leader).gameObject).name + " is not null, setting ShouldReturnToPreviousLeader to false")); ShouldReturnToPreviousLeader = false; base.HandleIdleStateOnOwnerClient(); } else if (!Lumiknull.TimeForGlowPikminToExist && !previousLeader.Controller.isInsideFactory) { LethalMin.Logger.LogWarning((object)$"{((Object)((Component)this).gameObject).name}: Glow pikmin follow outside before {LethalMin.LumiknullActivateTime.InternalValue} outside"); ShouldReturnToPreviousLeader = false; base.HandleIdleStateOnOwnerClient(); } else { ReassignLeaderServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)previousLeader).NetworkObject)); ReassignLeader(previousLeader); } } else { base.HandleIdleStateOnOwnerClient(); } } public override PikminItem? GetClosestPikminItem(float overrideDetectionRadius = -1f) { PikminItem closestPikminItem = base.GetClosestPikminItem(overrideDetectionRadius); if (Lumiknull.TimeForGlowPikminToExist) { return closestPikminItem; } return null; } public override void AssignLeader(Leader leader, bool SwitchState = true, bool PlayAnim = true) { base.AssignLeader(leader, SwitchState, PlayAnim); ShouldReturnToPreviousLeader = false; if ((Object)(object)base.leader != (Object)null && (Object)(object)base.leader.glowmob == (Object)null && ((NetworkBehaviour)this).IsServer) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + ": " + ((Object)((Component)base.leader).gameObject).name + " has no glowmob, spawning one")); base.leader.SpawnGlowMob(((NetworkBehaviour)leader).OwnerClientId); } if ((Object)(object)base.leader != (Object)null && (Object)(object)base.leader.glowmob != (Object)null && base.leader.glowmob.IsDoingGlowmob) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + ": " + ((Object)((Component)base.leader).gameObject).name + " has glowmob active after assign, setting to glowmod")); SetToGlowMod(base.leader.glowmob); } } [ServerRpc(RequireOwnership = false)] public void ReassignLeaderServerRpc(NetworkObjectReference LeaderRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3807166906u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref LeaderRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3807166906u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Leader leader = null; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref LeaderRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref leader) && (Object)(object)leader != (Object)null) { if (((NetworkBehaviour)leader).OwnerClientId != ((NetworkBehaviour)this).OwnerClientId) { ((EnemyAI)this).ChangeOwnershipOfEnemy(((NetworkBehaviour)leader).OwnerClientId); } ReassignLeaderClientRpc(LeaderRef); return; } LethalMin.Logger.LogError((object)(DebugID + ": Failed to Reassign leader to " + ((val3 != null) ? ((Object)val3).name : null))); if ((Object)(object)leader == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Leader is null")); } if ((Object)(object)val3 == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": LeaderObj is null")); } } [ClientRpc] public void ReassignLeaderClientRpc(NetworkObjectReference LeaderRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(93114712u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref LeaderRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 93114712u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsOwner) { return; } Leader leader = null; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref LeaderRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref leader) && (Object)(object)leader != (Object)null) { ReassignLeader(leader); return; } LethalMin.Logger.LogError((object)(DebugID + ": Failed to Reassign leader to " + ((val3 != null) ? ((Object)val3).name : null))); if ((Object)(object)leader == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Leader is null")); } if ((Object)(object)val3 == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": LeaderObj is null")); } } public virtual void ReassignLeader(Leader leader) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StartCoroutine(TeleportTo(RoundManager.Instance.GetRandomNavMeshPositionInRadius(((Component)leader).transform.position, 5f, default(NavMeshHit)))); AssignLeader(leader, SwitchState: true, PlayAnim: false); ShouldReturnToPreviousLeader = false; ((EnemyAI)this).isOutside = !leader.Controller.isInsideFactory; } public override void SetToIdle(bool keepLaying = false) { base.SetToIdle(keepLaying); if (PreviousIntention != 0 && PreviousIntention != Pintent.Thrown) { ((MonoBehaviour)this).StartCoroutine(WaitToReturn()); } } [IteratorStateMachine(typeof(d__31))] public IEnumerator WaitToReturn() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__31(0) { <>4__this = this }; } public override void WarpToMatchLeaderDoors(bool isInside) { if (!Lumiknull.TimeForGlowPikminToExist && !isInside) { LethalMin.Logger.LogWarning((object)$"{((Object)((Component)this).gameObject).name}: Glow pikmin follow outside before {LethalMin.LumiknullActivateTime.InternalValue} outside"); CancleGlowmob(); SetToIdle(); } else { base.WarpToMatchLeaderDoors(isInside); } } public override void UseEntranceOnLocalClient(EntranceTeleport entrance, bool Inside, bool PlaySFX = true) { if (!Lumiknull.TimeForGlowPikminToExist && !Inside) { LethalMin.Logger.LogWarning((object)$"{((Object)((Component)this).gameObject).name}: Glow pikmin carry item outside before {LethalMin.LumiknullActivateTime.InternalValue} outside"); SetToIdle(); } else { base.UseEntranceOnLocalClient(entrance, Inside, PlaySFX); } } public void SetToGlowMod(Glowmob mob) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) Invincible = true; TargetGlowMob = mob; SetCollisionMode(0); ((EnemyAI)this).creatureVoice.PlayOneShot(FlashBangStartVoice[enemyRandom.Next(0, FlashBangStartVoice.Length)]); initalGlowmobDistance = Vector3.Distance(((Component)this).transform.position, ((Component)TargetGlowMob).transform.position); LethalMin.Logger.LogDebug((object)(((Object)((Component)this).gameObject).name + ": set to " + ((Object)((Component)TargetGlowMob).gameObject).name)); } public void BurstFromGlowMob() { ManualLogSource logger = LethalMin.Logger; string name = ((Object)((Component)this).gameObject).name; Glowmob? targetGlowMob = TargetGlowMob; logger.LogDebug((object)(name + ": burst from " + ((targetGlowMob != null) ? ((Object)((Component)targetGlowMob).gameObject).name : null))); if (BurstRoutine != null) { ((MonoBehaviour)this).StopCoroutine(BurstRoutine); BurstRoutine = null; } animController.PlayAnimation(((Object)FromGlowMobAnim).name); SetToIdle(); SetCollisionMode(0); ChangeIntent(Pintent.Thrown); SetGrowth(0); BurstRoutine = ((MonoBehaviour)this).StartCoroutine(GlowBurstAnim()); } public void SetOffGlowMob(bool SetCollisionMod = true, bool KeepLeader = false) { if (SetCollisionMod) { ApplyPhysics(Use3: false); ShouldReturnToPreviousLeader = true; } else if (KeepLeader) { SetCollisionMode(1); } Invincible = false; if ((Object)(object)TargetGlowMob != (Object)null) { TargetGlowMob.PikminInGlowmob.Remove(this); } TargetGlowMob = null; LethalMin.Logger.LogDebug((object)(((Object)((Component)this).gameObject).name + ": set off glowmob")); } [IteratorStateMachine(typeof(d__37))] public IEnumerator GlowBurstAnim() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__37(0) { <>4__this = this }; } public Vector3 GetBurstFlyPos(float radius = 5f) { //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)TargetGlowMob == (Object)null) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": TargetGlowMob is null, cannot calculate burst position.")); return new Vector3(((Component)this).transform.position.x, ((Component)this).transform.position.y + 5f, ((Component)this).transform.position.z); } float num = 30f; float num2 = enemyRandom.Next(0, 360); float num3 = num2 + 100f * num % 360f; float num4 = num3 * (MathF.PI / 180f); float num5 = Mathf.Sin(num4) * radius; float num6 = Mathf.Cos(num4) * radius; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(((Component)TargetGlowMob).transform.position.x + num5, ((Component)TargetGlowMob).transform.position.y + 5f, ((Component)TargetGlowMob).transform.position.z + num6); RaycastHit val2 = default(RaycastHit); if (Physics.Linecast(((Component)this).transform.position, val, ref val2, 8)) { val = ((RaycastHit)(ref val2)).point + Vector3.down * 2f; } return val; } [IteratorStateMachine(typeof(d__39))] public IEnumerator GlowMobAnim() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__39(0) { <>4__this = this }; } public void RevertGlowMobAnim() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (HasDoneGlowMobAnim && BurstRoutine == null) { if (SetToRouteine != null) { ((MonoBehaviour)this).StopCoroutine(SetToRouteine); SetToRouteine = null; } HasDoneGlowMobAnim = false; ((Component)modelContainer).gameObject.SetActive(true); ((Component)modelContainer).transform.localScale = Vector3.one; } } public void CancleGlowmob(bool SetCollisionMod = false, bool KeepLeader = false) { SetOffGlowMob(SetCollisionMod, KeepLeader); if (SetToRouteine != null) { ((MonoBehaviour)this).StopCoroutine(SetToRouteine); SetToRouteine = null; } if (BurstRoutine != null) { ((MonoBehaviour)this).StopCoroutine(BurstRoutine); BurstRoutine = null; } RevertGlowMobAnim(); } public override void SetPikminToLeaving(Onion? onion = null) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) CallResetMethods(); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(4); ChangeIntent(Pintent.Leave); if (LethalMin.OnCompany && ShouldTurnintoSeed) { ((EnemyAI)this).agent.Warp(((Component)StartOfRound.Instance.shipInnerRoomBounds).transform.position); transform2.TeleportOnLocalClient(((Component)StartOfRound.Instance.shipInnerRoomBounds).transform.position); } if ((IsInShip || LethalMin.OnCompany) && ShouldTurnintoSeed) { SetCollisionMode(0); if (((NetworkBehaviour)this).IsOwner) { TurnIntoGlowSeedServerRpc(); } } else { base.SetPikminToLeaving(onion); } } [ServerRpc] public void TurnIntoGlowSeedServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(257483591u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 257483591u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GlowSeed component = Object.Instantiate(LethalMin.GlowSeedPrefab, ((Component)this).transform.position + Vector3.up * 2f, Quaternion.identity).GetComponent(); ((NetworkBehaviour)component).NetworkObject.Spawn(false); TurnIntoGlowSeedClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)component).NetworkObject)); } } [ClientRpc] public void TurnIntoGlowSeedClientRpc(NetworkObjectReference seedInstance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2699032570u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref seedInstance, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2699032570u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); GlowSeed seed = default(GlowSeed); if (((NetworkObjectReference)(ref seedInstance)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).gameObject.TryGetComponent(ref seed)) { TurnIntoGlowSeed(seed); } else { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": Failed to turn into glow seed, seedInstance is null or does not have GlowSeed component")); } } } public void TurnIntoGlowSeed(GlowSeed seed) { //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) PikminModelRefernces componentInChildren = ((Component)this).GetComponentInChildren(); GameObject gameObject = ((Component)((Component)componentInChildren).transform.Find("P4")).gameObject; GameObject gameObject2 = ((Component)((Component)componentInChildren).transform.Find("BurstFX")).gameObject; gameObject.SetActive(false); gameObject2.SetActive(true); ((EnemyAI)this).creatureSFX.PlayOneShot(TransformSeedSFX); Leader leader = null; leader = (((Object)(object)base.leader != (Object)null) ? base.leader : ((!((Object)(object)previousLeader != (Object)null)) ? ((Component)StartOfRound.Instance.allPlayerScripts[0]).GetComponent() : previousLeader)); if (IsInShip || LethalMin.OnCompany) { leader.Controller.SetItemInElevator(IsInShip, IsInShip, (GrabbableObject)(object)seed); ((GrabbableObject)seed).EnablePhysics(true); ((GrabbableObject)seed).EnableItemMeshes(true); ((GrabbableObject)seed).isHeld = false; ((GrabbableObject)seed).isPocketed = false; ((GrabbableObject)seed).fallTime = 0f; ((GrabbableObject)seed).startFallingPosition = (((Object)(object)((Component)this).transform.parent == (Object)null) ? ((Component)this).transform.position : ((Component)this).transform.parent.InverseTransformPoint(((Component)this).transform.position)); Vector3 itemFloorPosition = ((GrabbableObject)seed).GetItemFloorPosition(default(Vector3)); itemFloorPosition = StartOfRound.Instance.elevatorTransform.InverseTransformPoint(itemFloorPosition); ((GrabbableObject)seed).targetFloorPosition = itemFloorPosition; ((Component)seed).transform.SetParent(StartOfRound.Instance.elevatorTransform, true); } ((MonoBehaviour)this).StartCoroutine(WaitForBurst()); } [IteratorStateMachine(typeof(d__46))] private IEnumerator WaitForBurst() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__46(0) { <>4__this = this }; } public override void SetCurrentTask(string TaskID) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (TaskID == "ReturnToShip") { SetToIdle(); ((EnemyAI)this).isOutside = true; ((MonoBehaviour)this).StartCoroutine(TeleportTo(((Component)StartOfRound.Instance.shipInnerRoomBounds).transform.position)); } else { base.SetCurrentTask(TaskID); } } [ServerRpc] public void TeleportToServerRpc(Vector3 pos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(528976868u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 528976868u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TeleportToClientRpc(pos); } } [ClientRpc] public void TeleportToClientRpc(Vector3 pos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(113403745u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 113403745u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(TeleportTo(pos)); } } } [IteratorStateMachine(typeof(d__50))] public IEnumerator TeleportTo(Vector3 pos) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__50(0) { <>4__this = this, pos = pos }; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //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(24476713u, new RpcReceiveHandler(__rpc_handler_24476713), "SetShouldTurnintoSeedClientRpc"); ((NetworkBehaviour)this).__registerRpc(3807166906u, new RpcReceiveHandler(__rpc_handler_3807166906), "ReassignLeaderServerRpc"); ((NetworkBehaviour)this).__registerRpc(93114712u, new RpcReceiveHandler(__rpc_handler_93114712), "ReassignLeaderClientRpc"); ((NetworkBehaviour)this).__registerRpc(257483591u, new RpcReceiveHandler(__rpc_handler_257483591), "TurnIntoGlowSeedServerRpc"); ((NetworkBehaviour)this).__registerRpc(2699032570u, new RpcReceiveHandler(__rpc_handler_2699032570), "TurnIntoGlowSeedClientRpc"); ((NetworkBehaviour)this).__registerRpc(528976868u, new RpcReceiveHandler(__rpc_handler_528976868), "TeleportToServerRpc"); ((NetworkBehaviour)this).__registerRpc(113403745u, new RpcReceiveHandler(__rpc_handler_113403745), "TeleportToClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_24476713(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 shouldTurnintoSeedClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref shouldTurnintoSeedClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GlowPikminAI)(object)target).SetShouldTurnintoSeedClientRpc(shouldTurnintoSeedClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3807166906(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 leaderRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GlowPikminAI)(object)target).ReassignLeaderServerRpc(leaderRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_93114712(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 leaderRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GlowPikminAI)(object)target).ReassignLeaderClientRpc(leaderRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_257483591(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((GlowPikminAI)(object)target).TurnIntoGlowSeedServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2699032570(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 seedInstance = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref seedInstance, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GlowPikminAI)(object)target).TurnIntoGlowSeedClientRpc(seedInstance); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_528976868(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); target.__rpc_exec_stage = (__RpcExecStage)1; ((GlowPikminAI)(object)target).TeleportToServerRpc(pos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_113403745(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); target.__rpc_exec_stage = (__RpcExecStage)1; ((GlowPikminAI)(object)target).TeleportToClientRpc(pos); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "GlowPikminAI"; } } public class GlowSeed : GrabbableObject { [CompilerGenerated] private sealed class d__23 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GlowSeed <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__23(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(2f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.IncrumentDestoryCountServerRpc(); 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 GlowSeed <>4__this; private PikminGhost 5__1; 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() { 5__1 = null; <>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 //IL_0071: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 1; return true; case 1: <>1__state = -1; LethalMin.Logger.LogInfo((object)("Glowseed despawned due to selling on counter " + ((Object)((Component)<>4__this).gameObject).name)); 5__1 = Object.Instantiate(LethalMin.PikminGhostPrefab, <>4__this.sellPosition, ((Component)<>4__this).transform.rotation).GetComponent(); 5__1.LostType = <>4__this.GlowType; 5__1.InMemoryof = $"glowseed ({(int)((NetworkBehaviour)<>4__this).NetworkObjectId})"; 5__1.ghostRandom = new Random(StartOfRound.Instance.randomMapSeed + (int)((NetworkBehaviour)<>4__this).NetworkObjectId); 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 PikminType GlowType = null; public Renderer mainRenderer = null; public Material OnMat = null; public Material OffMat = null; public GameObject BaseMesh = null; public Animator BurstAnimator = null; public AudioClip BurstSFX = null; public AnimationCurve grenadeFallCurve = null; public AnimationCurve grenadeVerticalFallCurve = null; public AnimationCurve grenadeVerticalFallCurveNoBounce = null; public RaycastHit grenadeHit; public Ray grenadeThrowRay; private int stunGrenadeMask = 268437761; private PlayerControllerB playerThrownBy = null; private ScanNodeProperties sNode = null; public int DespawnCount = 0; private Vector3 sellPosition = Vector3.zero; public void Awake() { sNode = ((Component)this).GetComponentInChildren(); } public override void LateUpdate() { ((GrabbableObject)this).LateUpdate(); ((Component)sNode).gameObject.SetActive((bool)LethalMin.MakeItemsScanable && !base.isHeld && !base.isHeldByEnemy); bool flag = StartOfRound.Instance.shipIsLeaving || StartOfRound.Instance.inShipPhase || PikminManager.IsTooManyPikminOnMap || ((Object)(object)base.playerHeldBy != (Object)null && !base.playerHeldBy.isInsideFactory && !Lumiknull.TimeForGlowPikminToExist) || ((Object)(object)base.playerHeldBy == (Object)null && !Lumiknull.TimeForGlowPikminToExist); Material[] sharedMaterials = mainRenderer.sharedMaterials; sharedMaterials[0] = ((!flag) ? OnMat : OffMat); mainRenderer.sharedMaterials = sharedMaterials; } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); playerThrownBy = base.playerHeldBy; if (((NetworkBehaviour)this).IsOwner) { base.playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, GetGrenadeThrowDestination(), true); ((Component)this).GetComponentInChildren().PlayOneShot(base.itemProperties.throwSFX); } } public override void FallWithCurve() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = base.startFallingPosition - base.targetFloorPosition; float magnitude = ((Vector3)(ref val)).magnitude; ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(base.itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, base.itemProperties.restingRotation.z), 14f * Time.deltaTime / magnitude); ((Component)this).transform.localPosition = Vector3.Lerp(base.startFallingPosition, base.targetFloorPosition, grenadeFallCurve.Evaluate(base.fallTime)); if (magnitude > 5f) { ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, base.startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, base.targetFloorPosition.y, ((Component)this).transform.localPosition.z), grenadeVerticalFallCurveNoBounce.Evaluate(base.fallTime)); } else { ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, base.startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, base.targetFloorPosition.y, ((Component)this).transform.localPosition.z), grenadeVerticalFallCurve.Evaluate(base.fallTime)); } base.fallTime += Mathf.Abs(Time.deltaTime * 12f / magnitude); } public Vector3 GetGrenadeThrowDestination() { //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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Debug.DrawRay(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward, Color.yellow, 15f); grenadeThrowRay = new Ray(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward); position = ((!Physics.Raycast(grenadeThrowRay, ref grenadeHit, 12f, stunGrenadeMask, (QueryTriggerInteraction)1)) ? ((Ray)(ref grenadeThrowRay)).GetPoint(10f) : ((Ray)(ref grenadeThrowRay)).GetPoint(((RaycastHit)(ref grenadeHit)).distance - 0.05f)); Debug.DrawRay(position, Vector3.down, Color.blue, 15f); grenadeThrowRay = new Ray(position, Vector3.down); if (Physics.Raycast(grenadeThrowRay, ref grenadeHit, 30f, stunGrenadeMask, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref grenadeHit)).point + Vector3.up * 0.05f; } return ((Ray)(ref grenadeThrowRay)).GetPoint(30f); } public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); if (((NetworkBehaviour)this).IsOwner && (Object)(object)playerThrownBy != (Object)null && !StartOfRound.Instance.shipIsLeaving && !StartOfRound.Instance.inShipPhase) { if (PikminManager.IsTooManyPikminOnMap) { LethalMin.Logger.LogWarning((object)$"Glow pikmin can't spawn, max amount of pikmin reached {LethalMin.MaxPikmin.InternalValue}"); } else if (!playerThrownBy.isInsideFactory && !Lumiknull.TimeForGlowPikminToExist) { LethalMin.Logger.LogWarning((object)$"Glow pikmin can't spawn before {LethalMin.LumiknullActivateTime} outside"); } else { SpawnGlowPikminServerRpc(((NetworkBehaviour)this).OwnerClientId); } } } [ServerRpc(RequireOwnership = false)] public void SpawnGlowPikminServerRpc(ulong ThrowerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2056057628u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ThrowerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2056057628u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SpawnGlowPikminClientRpc(ThrowerID); } } } [ClientRpc] public void SpawnGlowPikminClientRpc(ulong ThrowerID) { //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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2375863504u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ThrowerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2375863504u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } Leader leaderViaID = LethalMin.GetLeaderViaID(ThrowerID); if ((Object)(object)leaderViaID != (Object)null) { playerThrownBy = leaderViaID.Controller; base.grabbable = false; BaseMesh.SetActive(false); BurstAnimator.Play("GBBurstAnim"); ((Component)this).GetComponentInChildren().PlayOneShot(BurstSFX); if (((NetworkBehaviour)this).IsServer) { PikminSpawnProps props = new PikminSpawnProps(); props.SpawnAnimation = "PluckedGseed"; props.SpawnSound = "BornB"; props.IsOutside = !playerThrownBy.isInsideFactory; props.PlayerID = ((NetworkBehaviour)playerThrownBy).OwnerClientId; PikminManager.instance.SpawnPikminOnServer(GlowType, ((Component)this).transform.position, ((Component)this).transform.rotation, props); } ((MonoBehaviour)this).StartCoroutine(WaitForBurst()); } else { LethalMin.Logger.LogWarning((object)$"Glow pikmin can't spawn, thrower not found {ThrowerID}"); } } [IteratorStateMachine(typeof(d__23))] public IEnumerator WaitForBurst() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__23(0) { <>4__this = this }; } [ServerRpc(RequireOwnership = false)] public void IncrumentDestoryCountServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2613495864u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2613495864u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DespawnCount++; if (DespawnCount >= StartOfRound.Instance.connectedPlayersAmount + 1) { LethalMin.Logger.LogInfo((object)("All Clients marked to despawn " + ((Object)((Component)this).gameObject).name)); ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } } public override void ReactToSellingItemOnCounter() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ReactToSellingItemOnCounter(); ((Component)this).GetComponentInChildren().PlayOneShot(GlowType.SoundPack.HurtVoice[0]); sellPosition = ((Component)this).transform.position; ((MonoBehaviour)this).StartCoroutine(WaitToSpawnGhost()); } [IteratorStateMachine(typeof(d__28))] private IEnumerator WaitToSpawnGhost() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this }; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2056057628u, new RpcReceiveHandler(__rpc_handler_2056057628), "SpawnGlowPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(2375863504u, new RpcReceiveHandler(__rpc_handler_2375863504), "SpawnGlowPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(2613495864u, new RpcReceiveHandler(__rpc_handler_2613495864), "IncrumentDestoryCountServerRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_2056057628(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong throwerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref throwerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((GlowSeed)(object)target).SpawnGlowPikminServerRpc(throwerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2375863504(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong throwerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref throwerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((GlowSeed)(object)target).SpawnGlowPikminClientRpc(throwerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2613495864(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; ((GlowSeed)(object)target).IncrumentDestoryCountServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "GlowSeed"; } } public class Lumiknull : NetworkBehaviour { [CompilerGenerated] private sealed class d__26 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int AmmountToSpawn; public ulong LeaderID; public Lumiknull <>4__this; private PikminSpawnProps 5__1; private int 5__2; private int 5__3; private Vector3 5__4; private Vector3 5__5; private Quaternion 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__26(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = default(PikminSpawnProps); <>1__state = -2; } private bool MoveNext() { //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Expected O, but got Unknown //IL_00f3: 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_00ff: 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) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = new PikminSpawnProps(); 5__1.SpawnAnimation = "LumikSpawn"; 5__1.SpawnSound = "Born"; 5__1.PlayerID = LeaderID; 5__1.MovementBuffer = 0.5f; 5__2 = 0; 5__3 = 0; goto IL_01cd; case 1: <>1__state = -1; goto IL_0181; case 2: { <>1__state = -1; goto IL_01bc; } IL_01cd: if (5__3 < AmmountToSpawn) { 5__2++; <>4__this.anim.SetTrigger("Exhale"); <>4__this.Source.PlayOneShot(<>4__this.SpidSound); if (((NetworkBehaviour)<>4__this).IsServer) { 5__4 = <>4__this.GetPositionToSpawnSprout(); Vector3 val = 5__4 - ((Component)<>4__this).transform.position; 5__5 = ((Vector3)(ref val)).normalized; 5__6 = Quaternion.LookRotation(5__5); PikminManager.instance.SpawnPikminOnServer(<>4__this.GlowPikminType, 5__4, 5__6, 5__1); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } goto IL_0181; } return false; IL_0181: if (5__2 >= 2) { 5__2 = 0; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 2; return true; } goto IL_01bc; IL_01bc: 5__3++; goto IL_01cd; } } 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__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Lumiknull <>4__this; private Color 5__1; private Color 5__2; private float 5__3; private float 5__4; private float 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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 = <>4__this.RendToGlow.materials[0].GetColor("_EmissiveColor"); 5__2 = new Color(0.25f, 1f, 0.25f, 1f) * 2f; 5__3 = 1f; 5__4 = 0f; break; case 1: <>1__state = -1; break; } if (5__4 < 5__3) { 5__5 = 5__4 / 5__3; <>4__this.RendToGlow.materials[0].SetColor("_EmissiveColor", Color.Lerp(5__1, 5__2, 5__5)); <>4__this.RendToGlow.materials[0].SetFloat("_EmissiveIntensity", Mathf.Lerp(0f, 2f, 5__5)); 5__4 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__21 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Lumiknull <>4__this; private Color 5__1; private Color 5__2; private float 5__3; private float 5__4; private float 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00bc: 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 = <>4__this.RendToGlow.materials[0].GetColor("_EmissiveColor"); 5__2 = new Color(0f, 0f, 0f, 1f); 5__3 = 1f; 5__4 = 0f; break; case 1: <>1__state = -1; break; } if (5__4 < 5__3) { 5__5 = 5__4 / 5__3; <>4__this.RendToGlow.materials[0].SetColor("_EmissiveColor", Color.Lerp(5__1, 5__2, 5__5)); <>4__this.RendToGlow.materials[0].SetFloat("_EmissiveIntensity", Mathf.Lerp(2f, 0f, 5__5)); 5__4 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public PikminType GlowPikminType = null; public Transform GlowSpawnPosition = null; public Animator anim = null; public InteractTrigger[] triggers = (InteractTrigger[])(object)new InteractTrigger[5]; public Renderer RendToGlow = null; public AudioClip OnSound = null; public AudioClip SpidSound = null; public AudioSource Source = null; public SpriteRenderer RadarSprite = null; public Sprite ActiveSprite = null; public Sprite InactiveSprite = null; public bool ShouldActivate = true; public bool IsActive = false; public static bool TimeForGlowPikminToExist => TimeOfDay.Instance.globalTime >= LethalMin.LumiknullActivateTime.InternalValue || (int)StartOfRound.Instance.currentLevel.currentWeather == 5 || (LethalMin.OnCompany && (bool)LethalMin.GlowsUseableAtCompany); private void LateUpdate() { //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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer && TimeForGlowPikminToExist && ShouldActivate && !IsActive) { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) < LethalMin.LumiknullActivateDistance.InternalValue) { ActivateLumiknullClientRpc(); break; } } } if (((NetworkBehaviour)this).IsServer && !TimeForGlowPikminToExist && IsActive) { DeactivateLumiknullClientRpc(); } RadarSprite.sprite = (IsActive ? ActiveSprite : InactiveSprite); if (Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position) > 50f) { return; } for (int j = 0; j < triggers.Length; j++) { InteractTrigger val2 = triggers[j]; if (!IsActive) { val2.hoverTip = "Inactive"; } else if ((Object)(object)StartOfRound.Instance.localPlayerController.currentlyHeldObjectServer == (Object)null) { val2.hoverTip = "No Item to deposit"; } else { val2.hoverTip = "Deposit Item"; } } } [ClientRpc] public void ActivateLumiknullClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3842021760u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3842021760u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ActivateLumiknull(); } } } public void ActivateLumiknull() { ((MonoBehaviour)this).StartCoroutine(TweenMaterial()); Source.PlayOneShot(OnSound); IsActive = true; } [IteratorStateMachine(typeof(d__18))] private IEnumerator TweenMaterial() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { <>4__this = this }; } [ClientRpc] public void DeactivateLumiknullClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2349807296u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2349807296u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DeactivateLumiknull(); } } } public void DeactivateLumiknull() { ((MonoBehaviour)this).StartCoroutine(TweenMaterialDeactive()); IsActive = false; } [IteratorStateMachine(typeof(d__21))] private IEnumerator TweenMaterialDeactive() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0) { <>4__this = this }; } public void AttemptDepsoitItem(PlayerControllerB playerDepositing) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 if (!IsActive) { return; } GrabbableObject currentlyHeldObjectServer = playerDepositing.currentlyHeldObjectServer; if ((Object)(object)currentlyHeldObjectServer == (Object)null) { LethalMin.Logger.LogWarning((object)$"Lumiknull: {((NetworkBehaviour)playerDepositing).OwnerClientId} tried to deposit an item that is not held!"); return; } PikminItem componentInChildren = ((Component)currentlyHeldObjectServer).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { LethalMin.Logger.LogWarning((object)$"Lumiknull: {((NetworkBehaviour)playerDepositing).OwnerClientId} tried to deposit an item that is not a PikminItem!"); return; } float carryWeight = (((int)StartOfRound.Instance.currentLevel.currentWeather != 5 || !(TimeOfDay.Instance.globalTime < LethalMin.LumiknullActivateTime.InternalValue)) ? ((float)componentInChildren.CarryStrengthNeeded) : Mathf.Max(1f, (float)componentInChildren.CarryStrengthNeeded / 2f)); currentlyHeldObjectServer.grabbable = false; playerDepositing.DespawnHeldObject(); AttemptDepositItemServerRpc(((NetworkBehaviour)playerDepositing).OwnerClientId, carryWeight); } [ServerRpc(RequireOwnership = false)] public void AttemptDepositItemServerRpc(ulong playerDepositing, float CarryWeight) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3505008190u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerDepositing); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref CarryWeight, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3505008190u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; AttemptDepositItemClientRpc(playerDepositing, CarryWeight); } } } [ClientRpc] public void AttemptDepositItemClientRpc(ulong playerDepositing, float CarryWeight) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(26905647u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerDepositing); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref CarryWeight, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 26905647u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (LethalMin.GetLeaderViaID(playerDepositing, out Leader leader)) { DepositeItem(CarryWeight, leader); } } } public void DepositeItem(float CarryWeight, Leader LeaderDepoit) { PikminSpawnProps pikminSpawnProps = new PikminSpawnProps(); pikminSpawnProps.PlayerID = ((NetworkBehaviour)LeaderDepoit).OwnerClientId; ((MonoBehaviour)this).StartCoroutine(DoGlowSpawn(Mathf.RoundToInt(CarryWeight), ((NetworkBehaviour)LeaderDepoit).OwnerClientId)); } [IteratorStateMachine(typeof(d__26))] private IEnumerator DoGlowSpawn(int AmmountToSpawn, ulong LeaderID) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__26(0) { <>4__this = this, AmmountToSpawn = AmmountToSpawn, LeaderID = LeaderID }; } [ContextMenu("TestSpawn")] public void TestSpawn() { //IL_0009: 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_0016: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) Vector3 positionToSpawnSprout = GetPositionToSpawnSprout(8f, 100); Vector3 val = positionToSpawnSprout - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Quaternion val2 = Quaternion.LookRotation(normalized); Debug.Log((object)$"Vector3{positionToSpawnSprout}, Direction: {normalized}, Quaternion{val2}"); } public virtual Vector3 GetPositionToSpawnSprout(float radius = 8f, int overrideMax = -1) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00df: 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)((overrideMax == -1) ? LethalMin.MaxPikmin.InternalValue : overrideMax) * num % 360f; float num4 = num3 * (MathF.PI / 180f); float num5 = Mathf.Sin(num4) * radius; float num6 = Mathf.Cos(num4) * radius; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(GlowSpawnPosition.position.x + num5, GlowSpawnPosition.position.y, GlowSpawnPosition.position.z + num6); RaycastHit val2 = default(RaycastHit); Vector3 point = default(Vector3); if (Physics.Raycast(val, Vector3.down, ref val2, float.PositiveInfinity, LayerMask.op_Implicit(LethalMin.PikminColideable))) { point = ((RaycastHit)(ref val2)).point; return point; } ((Vector3)(ref point))..ctor(val.x, 0f, val.z); return point; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3842021760u, new RpcReceiveHandler(__rpc_handler_3842021760), "ActivateLumiknullClientRpc"); ((NetworkBehaviour)this).__registerRpc(2349807296u, new RpcReceiveHandler(__rpc_handler_2349807296), "DeactivateLumiknullClientRpc"); ((NetworkBehaviour)this).__registerRpc(3505008190u, new RpcReceiveHandler(__rpc_handler_3505008190), "AttemptDepositItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(26905647u, new RpcReceiveHandler(__rpc_handler_26905647), "AttemptDepositItemClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3842021760(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; ((Lumiknull)(object)target).ActivateLumiknullClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2349807296(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; ((Lumiknull)(object)target).DeactivateLumiknullClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3505008190(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerDepositing = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerDepositing); float carryWeight = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carryWeight, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Lumiknull)(object)target).AttemptDepositItemServerRpc(playerDepositing, carryWeight); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_26905647(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerDepositing = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerDepositing); float carryWeight = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref carryWeight, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Lumiknull)(object)target).AttemptDepositItemClientRpc(playerDepositing, carryWeight); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Lumiknull"; } } public class OnionHUDAnimEvents : MonoBehaviour { public GameObject OBJtoDeactivate = null; public void DeactivateOBJ() { OBJtoDeactivate.SetActive(false); } } public class FreezeableWater : MonoBehaviour { public TMP_Text InWaterText = null; public TMP_Text NeededInText = null; public TMP_Text DeviderText = null; public List PikminInWater = new List(); public GameObject WaterCounter = null; public GameObject FrozenWater = null; public QuicksandTrigger waterTrigger = null; public NavMeshSurface FrozenWaterSurface = null; public Collider FrozenWaterColider = null; public PikminEffectTrigger WaterEffectTrigger = null; public AudioSource audioSource = null; public int FreezeStrengthRequired = 5; public bool IsFrozen = false; public bool IsServer = false; public float FrozenTimer = 0f; public FloodWeather? flood = null; public Vector3 FrozePos = Vector3.zero; public int CurrentFreezeStrength => (PikminInWater.Count > 0) ? PikminInWater.Select((PikminAI pikmin) => pikmin.CurrentCarryStrength).Sum() : 0; private void Start() { //IL_00b5: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) SpawnWaterCounter(); audioSource = ((Component)this).gameObject.AddComponent(); audioSource.playOnAwake = false; audioSource.spatialBlend = 1f; audioSource.rolloffMode = (AudioRolloffMode)0; audioSource.minDistance = 5f; audioSource.maxDistance = 15f; flood = ((Component)this).GetComponentInParent(); if ((Object)(object)flood != (Object)null) { FreezeStrengthRequired = 100; LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " is under flood weather")); } else { Vector3 localScale = ((Component)this).transform.localScale; float num = Mathf.Max(new float[3] { localScale.x, localScale.y, localScale.z }); float num2 = num / 2.5f; int num3 = Mathf.CeilToInt(num2); FreezeStrengthRequired = Mathf.Clamp(num3, 1, 100); } waterTrigger = ((Component)this).GetComponent(); WaterEffectTrigger = ((Component)waterTrigger).GetComponent(); FrozenWaterColider = ((Component)waterTrigger).GetComponent(); FrozenWater = Object.Instantiate(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/Types/Ice Pikmin/FrozenWater.prefab"), ((Component)this).transform); FrozenWaterSurface = FrozenWater.GetComponentInChildren(); FrozenWaterSurface.BuildNavMesh(); FrozenWater.SetActive(false); IsServer = ((NetworkBehaviour)PikminManager.instance).IsServer; } private void Update() { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) if (IsServer && !IsFrozen && CurrentFreezeStrength >= FreezeStrengthRequired) { PikminManager.instance.FreezeWaterAtIndexServerRpc(PikminManager.instance.FreezeableWaters.IndexOf(this)); } if (IsServer && IsFrozen && CurrentFreezeStrength < FreezeStrengthRequired) { if (FrozenTimer > 0f) { FrozenTimer -= Time.deltaTime; } else { PikminManager.instance.UnfreezeWaterAtIndexServerRpc(PikminManager.instance.FreezeableWaters.IndexOf(this)); } } if (IsFrozen && (Object)(object)flood != (Object)null) { ((Component)flood).transform.position = FrozePos; } WaterCounter.SetActive(PikminInWater.Count > 0); if (!WaterCounter.activeSelf) { return; } Vector3 val = Vector3.zero; PikminInWater.RemoveAll((PikminAI pikmin) => (Object)(object)pikmin == (Object)null); foreach (PikminAI item in PikminInWater) { val += ((Component)item).transform.position; } val /= (float)PikminInWater.Count; WaterCounter.transform.position = val + Vector3.up * 3f; InWaterText.text = CurrentFreezeStrength.ToString(); NeededInText.text = FreezeStrengthRequired.ToString(); } public void FreezeWater() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_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_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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) if (IsFrozen) { return; } LethalMin.Logger.LogInfo((object)$"Freezing water at {((Object)((Component)this).gameObject).name} with {CurrentFreezeStrength} strength (required: {FreezeStrengthRequired})"); if ((Object)(object)flood == (Object)null) { FrozePos = ((Component)this).transform.position; } else { FrozePos = ((Component)flood).transform.position; } FrozenTimer = 5f; IsFrozen = true; FrozenWater.SetActive(true); Bounds bounds = FrozenWaterColider.bounds; Vector3 max = ((Bounds)(ref bounds)).max; NavMeshAgent[] array = Object.FindObjectsOfType(); Vector3 val2 = default(Vector3); foreach (NavMeshAgent val in array) { bounds = FrozenWaterColider.bounds; if (((Bounds)(ref bounds)).Contains(((Component)val).transform.position)) { ((Vector3)(ref val2))..ctor(((Component)val).transform.position.x, max.y + val.height, ((Component)val).transform.position.z); val.Warp(val2); } } NavMeshHit val4 = default(NavMeshHit); foreach (PikminAI item in PikminInWater) { item.SetToIdle(); GameObject val3 = new GameObject("(" + ((Object)((Component)item).gameObject).name + ")SnapPos"); val3.transform.position = ((Component)item).transform.position; if (NavMesh.SamplePosition(val3.transform.position, ref val4, 10f, -1)) { val3.transform.position = ((NavMeshHit)(ref val4)).position; } if (item is IcePikminAI icePikminAI) { icePikminAI.IceSnapPos = val3.transform; } ((Behaviour)((EnemyAI)item).agent).enabled = false; item.Invincible = true; item.ChangeIntent(Pintent.MoveableStuck); } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; Vector3 position = default(Vector3); foreach (PlayerControllerB val5 in allPlayerScripts) { bounds = FrozenWaterColider.bounds; if (((Bounds)(ref bounds)).Contains(((Component)val5).transform.position)) { ((Vector3)(ref position))..ctor(((Component)val5).transform.position.x, max.y + val5.thisController.height, ((Component)val5).transform.position.z); ((Component)val5).transform.position = position; } } PikminCollisionDetect[] array2 = Object.FindObjectsOfType(); foreach (PikminCollisionDetect pikminCollisionDetect in array2) { if (pikminCollisionDetect.CurFXtriggers.Contains(WaterEffectTrigger)) { pikminCollisionDetect.CurFXtriggers.Remove(WaterEffectTrigger); pikminCollisionDetect.mainPikmin.StopPanicingOnLocalClient(); } } ((Behaviour)WaterEffectTrigger).enabled = false; ((Behaviour)waterTrigger).enabled = false; audioSource.PlayOneShot(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/wav_bnk_AkB_Ambience_CaveAquarium/Amb_CaveAquariumSwamp_WaterBox(14).wav")); } public void UnfreezeWater() { //IL_006f: 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_0079: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00b5: 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_013a: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) if (!IsFrozen) { return; } LethalMin.Logger.LogInfo((object)$"Unthawing water at {((Object)((Component)this).gameObject).name} with {CurrentFreezeStrength} strength (required: {FreezeStrengthRequired})"); FrozenTimer = 5f; IsFrozen = false; FrozenWater.SetActive(false); Bounds bounds = FrozenWaterColider.bounds; ((Bounds)(ref bounds)).SetMinMax(((Bounds)(ref bounds)).min, new Vector3(((Bounds)(ref bounds)).max.x, ((Bounds)(ref bounds)).max.y + 1f, ((Bounds)(ref bounds)).max.z)); Vector3 min = ((Bounds)(ref bounds)).min; foreach (PikminAI item in new List(PikminInWater)) { if (item is IcePikminAI icePikminAI) { icePikminAI.RemoveFromCurWater(); } item.SetToIdle(); } NavMeshAgent[] array = Object.FindObjectsOfType(); foreach (NavMeshAgent val in array) { if (((Bounds)(ref bounds)).Contains(((Component)val).transform.position)) { Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(((Component)val).transform.position, default(NavMeshHit), 25f, -1); val.Warp(navMeshPosition); } } ((Behaviour)WaterEffectTrigger).enabled = true; ((Behaviour)waterTrigger).enabled = true; audioSource.PlayOneShot(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/wav_bnk_AkB_Ambience_CaveAquarium/Amb_CaveAquarium_WaterBox_UnFreeze.wav")); } public void SpawnWaterCounter() { WaterCounter = Object.Instantiate(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/Types/Ice Pikmin/IceWaterCounter.prefab")); TMP_Text[] componentsInChildren = WaterCounter.GetComponentsInChildren(); foreach (TMP_Text val in componentsInChildren) { if (((Object)val).name == "InWaterText") { InWaterText = val; } else if (((Object)val).name == "NeededInText") { NeededInText = val; } else if (((Object)val).name == "DeviderText") { DeviderText = val; } } } } public class IcePikminAI : PikminAI { public FreezeableWater? CurWaterIn = null; public Transform? IceSnapPos = null; public AnimationClip FloatingAnim = null; public AnimationClip FrozenAnim = null; public bool Floating => (Object)(object)CurWaterIn != (Object)null && !CurWaterIn.IsFrozen; public bool Frozen => (Object)(object)CurWaterIn != (Object)null && CurWaterIn.IsFrozen && CurWaterIn.PikminInWater.Contains(this); public override void Start() { base.Start(); GameObject gameObject = ((Component)((Component)this).GetComponentInChildren()).gameObject; animController.AddAnimationCondition(() => Floating, FloatingAnim, 45); animController.AddAnimationCondition(() => Frozen, FrozenAnim, 49); if ((Object)(object)gameObject != (Object)null) { gameObject.AddComponent().mainPikmin = this; } else { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": PikminCollisionDetect not found in children!")); } } public override void Update() { base.Update(); ForceSproutGlow = Frozen; UpdateIceSnapRegistration(); } private void UpdateIceSnapRegistration() { if ((Object)(object)IceSnapPos != (Object)null) { Transform pos = IceSnapPos; SetSnapPoint(new PikminSnapPoint("Ice", 55, () => pos.position)); } else { ClearSnapPoint("Ice"); } } public override void KillEnemy(bool destroy = false) { //IL_004e: 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) base.KillEnemy(destroy); if (Invincible || (destroy && ((NetworkBehaviour)this).IsServer)) { return; } foreach (PikminEnemy pikminEnemy in PikminManager.instance.PikminEnemies) { if (Vector3.Distance(((Component)this).transform.position, ((Component)pikminEnemy).transform.position) < 5f) { pikminEnemy.FreezeCounter += 1f; } } } public override void DoAIInterval() { if ((Object)(object)CurWaterIn == (Object)null) { base.DoAIInterval(); return; } if (((EnemyAI)this).currentBehaviourStateIndex == 0 && !base.IsDeadOrDying && !base.IsAirborn) { if (!CurWaterIn.IsFrozen && !CurWaterIn.PikminInWater.Contains(this)) { AddToWaterServerRpc(PikminManager.instance.FreezeableWaters.IndexOf(CurWaterIn)); } return; } if (CurWaterIn.PikminInWater.Contains(this)) { if (CurWaterIn.IsFrozen) { RemoveFromCurWaterServerRpc(PikminManager.instance.FreezeableWaters.IndexOf(CurWaterIn)); } else { RemoveFromWaterServerRpc(PikminManager.instance.FreezeableWaters.IndexOf(CurWaterIn)); } } base.DoAIInterval(); } [ServerRpc] public void AddToWaterServerRpc(int WaterID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(775333335u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, WaterID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 775333335u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AddToWaterClientRpc(WaterID); } } [ClientRpc] public void AddToWaterClientRpc(int WaterID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1908908538u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, WaterID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1908908538u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AddToWater(WaterID); } } } public void AddToWater(int WaterID) { if (!PikminManager.instance.FreezeableWaters[WaterID].PikminInWater.Contains(this)) { PikminManager.instance.FreezeableWaters[WaterID].PikminInWater.Add(this); } } [ServerRpc] public void RemoveFromWaterServerRpc(int WaterID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3689606637u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, WaterID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3689606637u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RemoveFromWaterClientRpc(WaterID); } } [ClientRpc] public void RemoveFromWaterClientRpc(int WaterID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1136413458u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, WaterID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1136413458u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RemoveFromWater(WaterID); } } } public void RemoveFromWater(int WaterID) { if (PikminManager.instance.FreezeableWaters[WaterID].PikminInWater.Contains(this)) { PikminManager.instance.FreezeableWaters[WaterID].PikminInWater.Remove(this); } Invincible = false; } public void EnterWater(FreezeableWater water) { CurWaterIn = water; } public void ExitWater() { if (!Frozen) { RemoveFromCurWater(); } } [ServerRpc] public void RemoveFromCurWaterServerRpc(int WaterID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2524330096u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, WaterID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2524330096u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RemoveFromCurWaterClientRpc(WaterID); } } [ClientRpc] public void RemoveFromCurWaterClientRpc(int WaterID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1703290925u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, WaterID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1703290925u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RemoveFromCurWater(WaterID); } } } public void RemoveFromCurWater(int WaterID = 0) { if (((NetworkBehaviour)this).IsOwner) { if ((Object)(object)CurWaterIn != (Object)null) { if (CurWaterIn.PikminInWater.Contains(this)) { CurWaterIn.PikminInWater.Remove(this); } LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + ": Removed from water " + ((Object)CurWaterIn).name + " on owner client.")); } } else { FreezeableWater freezeableWater = PikminManager.instance.FreezeableWaters[WaterID]; if (freezeableWater.PikminInWater.Contains(this)) { freezeableWater.PikminInWater.Remove(this); } LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + ": Removed from water " + ((Object)freezeableWater).name + " on non-owner client.")); } if ((Object)(object)IceSnapPos != (Object)null) { SetCollisionMode(1); Object.Destroy((Object)(object)((Component)IceSnapPos).gameObject); } Invincible = false; CurWaterIn = null; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(775333335u, new RpcReceiveHandler(__rpc_handler_775333335), "AddToWaterServerRpc"); ((NetworkBehaviour)this).__registerRpc(1908908538u, new RpcReceiveHandler(__rpc_handler_1908908538), "AddToWaterClientRpc"); ((NetworkBehaviour)this).__registerRpc(3689606637u, new RpcReceiveHandler(__rpc_handler_3689606637), "RemoveFromWaterServerRpc"); ((NetworkBehaviour)this).__registerRpc(1136413458u, new RpcReceiveHandler(__rpc_handler_1136413458), "RemoveFromWaterClientRpc"); ((NetworkBehaviour)this).__registerRpc(2524330096u, new RpcReceiveHandler(__rpc_handler_2524330096), "RemoveFromCurWaterServerRpc"); ((NetworkBehaviour)this).__registerRpc(1703290925u, new RpcReceiveHandler(__rpc_handler_1703290925), "RemoveFromCurWaterClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_775333335(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int waterID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref waterID); target.__rpc_exec_stage = (__RpcExecStage)1; ((IcePikminAI)(object)target).AddToWaterServerRpc(waterID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1908908538(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 waterID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref waterID); target.__rpc_exec_stage = (__RpcExecStage)1; ((IcePikminAI)(object)target).AddToWaterClientRpc(waterID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3689606637(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int waterID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref waterID); target.__rpc_exec_stage = (__RpcExecStage)1; ((IcePikminAI)(object)target).RemoveFromWaterServerRpc(waterID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1136413458(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 waterID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref waterID); target.__rpc_exec_stage = (__RpcExecStage)1; ((IcePikminAI)(object)target).RemoveFromWaterClientRpc(waterID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2524330096(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int waterID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref waterID); target.__rpc_exec_stage = (__RpcExecStage)1; ((IcePikminAI)(object)target).RemoveFromCurWaterServerRpc(waterID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1703290925(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 waterID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref waterID); target.__rpc_exec_stage = (__RpcExecStage)1; ((IcePikminAI)(object)target).RemoveFromCurWaterClientRpc(waterID); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "IcePikminAI"; } } public class IcePikminCollisionDetect : MonoBehaviour { public IcePikminAI mainPikmin = null; private void Start() { if ((Object)(object)mainPikmin == (Object)null) { mainPikmin = ((Component)this).GetComponentInParent(); } } public void OnTriggerEnter(Collider other) { FreezeableWater water = default(FreezeableWater); if (((Component)other).TryGetComponent(ref water)) { mainPikmin.EnterWater(water); } } public void OnTriggerExit(Collider other) { FreezeableWater freezeableWater = default(FreezeableWater); if (((Component)other).TryGetComponent(ref freezeableWater)) { mainPikmin.ExitWater(); } } } public interface IGenerationSwitchable { void SwitchGeneration(PikminGeneration generation); } public class InputClass { private static bool _isUtilsLoaded; private static Type _inputClassWithUtilsType; private static object _instance; public InputAction Throw => GetInputAction("Throw"); public InputAction ThrowCancel => GetInputAction("ThrowCancel"); public InputAction Whistle => GetInputAction("Whistle"); public InputAction Dismiss => GetInputAction("Dismiss"); public InputAction SwitchWhistleAud => GetInputAction("SwitchWhistleAud"); public InputAction SwitchLeft => GetInputAction("SwitchLeft"); public InputAction SwitchRight => GetInputAction("SwitchRight"); public InputAction Charge => GetInputAction("Charge"); public InputAction Glowmob => GetInputAction("Glowmob"); public InputAction OnionHudSpeed => GetInputAction("OnionHudSpeed"); static InputClass() { _inputClassWithUtilsType = null; _instance = null; _isUtilsLoaded = LethalMin.IsDependencyLoaded("com.rune580.LethalCompanyInputUtils"); if (_isUtilsLoaded) { _inputClassWithUtilsType = Type.GetType("InputClassWithUtils"); if (_inputClassWithUtilsType != null) { _instance = Activator.CreateInstance(_inputClassWithUtilsType); } } } private InputAction GetInputAction(string name) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown if (_isUtilsLoaded && _instance != null) { return (InputAction)_inputClassWithUtilsType.GetProperty(name).GetValue(_instance); } return new InputAction(name, (InputActionType)0, (string)null, (string)null, (string)null, (string)null); } } public class ItemArrivalZone : MonoBehaviour { public enum ArrivalZoneType { Exit, Ship, Crusier, Counter, MineElevator, OfficeElvator, Zelevator, Forever } private ArrivalZoneType zoneType; private Transform positionCheck = null; private Collider zoneCollider = null; private float checkDistance = 0.1f; private EntranceTeleport entranceTeleport = null; private DepositItemsDesk desk = null; private PikminVehicleController vehicleController = null; private MineshaftElevatorController mineShaftElevator = null; private Object piggyElevatorSystem = null; public static ItemArrivalZone CreateZoneOnObject(GameObject obj, ArrivalZoneType type) { ItemArrivalZone itemArrivalZone = obj.AddComponent(); itemArrivalZone.zoneType = type; LethalMin.Logger.LogInfo((object)$"Created Item Arrival Zone of type {type} on object {((Object)obj).name}"); return itemArrivalZone; } public void Start() { PikminManager.instance.ItemArrivalZones.Add(this); switch (zoneType) { case ArrivalZoneType.Exit: entranceTeleport = ((Component)this).GetComponent(); positionCheck = entranceTeleport.entrancePoint; checkDistance = 5f; break; case ArrivalZoneType.Ship: zoneCollider = StartOfRound.Instance.shipInnerRoomBounds; break; case ArrivalZoneType.Crusier: vehicleController = ((Component)this).GetComponent(); positionCheck = ((Component)vehicleController).transform; break; case ArrivalZoneType.Counter: desk = ((Component)this).GetComponent(); positionCheck = ((Component)desk.triggerCollider).transform; checkDistance = 10f; break; case ArrivalZoneType.MineElevator: mineShaftElevator = ((Component)this).GetComponent(); zoneCollider = ((Component)((Component)this).GetComponentInChildren()).GetComponent(); break; case ArrivalZoneType.OfficeElvator: GetPiggyCompents(); break; } } private void GetPiggyCompents() { piggyElevatorSystem = (Object)(object)((Component)this).GetComponentInParent(); zoneCollider = ((Component)this).GetComponent(); } public bool CanBeMovedOutofZone(PikminItem itemChecking) { return zoneType switch { ArrivalZoneType.Exit => LethalMin.UseExitsWhenCarryingItems, ArrivalZoneType.Ship => ((bool)LethalMin.TakeItemsToTheOnion && (!LethalMin.OnCompany || (bool)LethalMin.TakeItemsToOnionOnCompany) && itemChecking.settings.CanProduceSprouts && PikminManager.instance.Onions.Count > 0) || ((bool)LethalMin.TakeItemsToOnionOnCompany && LethalMin.OnCompany && itemChecking.ItemScript.itemProperties.isScrap), ArrivalZoneType.Crusier => vehicleController.IsNearByShip() || vehicleController.controller.carDestroyed, ArrivalZoneType.MineElevator => !mineShaftElevator.elevatorMovingDown && mineShaftElevator.elevatorFinishedMoving && LethalMin.UseExitsWhenCarryingItems.InternalValue, ArrivalZoneType.Counter => !itemChecking.ItemScript.itemProperties.isScrap, ArrivalZoneType.OfficeElvator => LCOFFICE_CBMOOZ(itemChecking), ArrivalZoneType.Zelevator => ZENEROS_CBMOOZ(itemChecking), ArrivalZoneType.Forever => false, _ => true, }; } public bool LCOFFICE_CBMOOZ(PikminItem itemChecking) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) return ElevatorSystem.elevatorFloor == 1 && !((ElevatorSystem)piggyElevatorSystem).elevatorMoving; } public bool ZENEROS_CBMOOZ(PikminItem itemChecking) { return !StartOfRound.Instance.localPlayerController.isInsideFactory; } public bool IsItemInZone(PikminItem item) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0050: Unknown result type (might be due to invalid IL or missing references) int num; if (!((Object)(object)zoneCollider == (Object)null)) { Bounds bounds = zoneCollider.bounds; num = (((Bounds)(ref bounds)).Contains(((Component)item).transform.position) ? 1 : 0); } else { num = 0; } bool flag = (byte)num != 0; bool flag2 = !((Object)(object)positionCheck == (Object)null) && Vector3.Distance(((Component)item).transform.position, positionCheck.position) <= checkDistance; return (flag || flag2) && !CanBeMovedOutofZone(item); } public void OnDestroy() { PikminManager.instance.ItemArrivalZones.Remove(this); } } public class Leader : NetworkBehaviour { [CompilerGenerated] private sealed class d__77 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CallbackContext context; public Leader <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__77(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => !<>4__this.IsStartThrowRpcCalled)); <>1__state = 1; return true; case 1: <>1__state = -1; LethalMin.Logger.LogInfo((object)"Finished waiting for Start throw RPC, starting Do throw RPC"); <>4__this.OnThrowCanceled(context); <>4__this.bufferedThrowCoroutine = null; 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__95 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Leader <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__95(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: <>1__state = -1; if (<>4__this.pikminRemoveCoroutine == null) { return false; } <>4__this.RemovePikminFromSquadServerRpc(<>4__this.PikminRemoveQueue.ToArray()); <>4__this.pikminRemoveCoroutine = null; 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 PlayerControllerB Controller = null; public PikminNoticeZone NoticeZone = null; public List PikminInSquad = new List(); public Queue PikminRemoveQueue = new Queue(); public Dictionary PuffminLatchedOn = new Dictionary(); public InputAction throwAction = null; public InputAction secondaryThrowAction = null; public InputAction switchPikminTypeAction = null; public InputAction switchPikminPrevTypeAction = null; public InputAction throwCancelAction = null; public Transform ThrowOrigin = null; public Transform holdPosition = null; private Camera mainCamera = null; private GUIStyle debugTextStyle = null; private Coroutine pikminRemoveCoroutine = null; public PikminAI? pikminHolding; public TrajectoryPredictor predictor = null; public CustomPlayerAnimationManager CustomAnimController = null; public GameObject LeaflingSprout = null; public Renderer LeaflingSproutMesh = null; public Renderer LeaflingLeafMesh = null; public LeaderFormationManager formManager = null; public Glowmob? glowmob; public GameObject? LeaflingGhostInstance = null; public NetworkVariable FriendlyFire = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1); public NetworkVariable FriendlyerFire = new NetworkVariable(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1); private bool HasAttemptedToBindActions; public int CurrentWhistleIndex = 0; private bool LastIsInsideValue = false; public bool IsLeafling = false; public bool wasLeaflingBeforeDeath = false; public bool DidHaveConnectedPlayer = false; public PikminType? LeaflingType = null; private readonly List _cachedPikminTypes = new List(); private readonly Dictionary _cachedTypeCounts = new Dictionary(); public int CurrentTypeIndex = 0; [HideInInspector] public Queue PendingSwitchDirections = new Queue(); public bool DirectPikminPath = false; public PikminType typeRevivedAs = null; private bool IsStartThrowRpcCalled; public bool IsDoThrowRpcCalled; public Coroutine bufferedThrowCoroutine = null; private Vector3 lastRotationEuler; private float totalRotationChange = 0f; private float wiggleThreshold = 20f; private float wiggleResetTime = 0.5f; private float lastWiggleTime = 0f; private int wiggleCount = 0; private int requiredWiggles = 10; public List GetPikminTypesInSquad() { _cachedPikminTypes.Clear(); PikminInSquad.RemoveAll((PikminAI p) => (Object)(object)p == (Object)null); foreach (PikminAI item in PikminInSquad) { PikminType pikminType = item.pikminType; if (!_cachedPikminTypes.Contains(pikminType)) { _cachedPikminTypes.Add(pikminType); } } _cachedPikminTypes.Sort((PikminType a, PikminType b) => a.PikminTypeID.CompareTo(b.PikminTypeID)); return _cachedPikminTypes; } public Dictionary GetPikminTypesInSquadWithCount() { _cachedTypeCounts.Clear(); PikminInSquad.RemoveAll((PikminAI p) => (Object)(object)p == (Object)null); foreach (PikminAI item in PikminInSquad) { if (_cachedTypeCounts.ContainsKey(item.pikminType)) { _cachedTypeCounts[item.pikminType]++; } else { _cachedTypeCounts[item.pikminType] = 1; } } return _cachedTypeCounts; } public void SetAsLeafling(int TypeIDToBecome = -1) { IsLeafling = true; Material val = LethalMin.assetBundle.LoadAsset("Assets/LethalMin/Types/Red Pikmin/Models/MI_chr_Pikmin_Red_00_M00.mat"); PikminType pikminType = (LeaflingType = LethalMin.GetPikminTypeByID(TypeIDToBecome)); Renderer[] componentsInChildren = LeaflingSprout.GetComponentsInChildren(); foreach (Renderer val2 in componentsInChildren) { val2.enabled = true; if (!((Object)((Component)val2).gameObject).name.Contains("Sprou")) { continue; } if ((Object)(object)pikminType == (Object)null || pikminType.PikminSproutOverrideMaterial == null || pikminType.PikminSproutOverrideMaterial.Length == 0) { Material[] sharedMaterials = val2.sharedMaterials; sharedMaterials[0] = val; val2.sharedMaterials = sharedMaterials; continue; } Material[] sharedMaterials2 = val2.sharedMaterials; Material val3 = pikminType.PikminSproutOverrideMaterial[0]; if (!PikUtils.IsOutOfRange(pikminType.PikminSproutOverrideMaterial, (int)LethalMin.SproutModelGeneration.InternalValue)) { val3 = pikminType.PikminSproutOverrideMaterial[(int)LethalMin.SproutModelGeneration.InternalValue]; } sharedMaterials2[0] = val3; val2.sharedMaterials = sharedMaterials2; } LethalMin.Logger.LogDebug((object)$"Leader {Controller.playerUsername} is now a Leafling! TypeID: {TypeIDToBecome}"); UpdateLeafingShadowMode(); } public bool UpdateLeafingShadowMode() { if (!IsLeafling) { return ((NetworkBehaviour)this).IsOwner; } if (((NetworkBehaviour)this).IsOwner) { LeaflingSproutMesh.shadowCastingMode = (ShadowCastingMode)3; LeaflingLeafMesh.shadowCastingMode = (ShadowCastingMode)3; return true; } LeaflingSproutMesh.shadowCastingMode = (ShadowCastingMode)1; LeaflingLeafMesh.shadowCastingMode = (ShadowCastingMode)1; return false; } public void Awake() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) Controller = ((Component)this).GetComponent(); CurrentWhistleIndex = LethalMin.CurWhistPack.InternalValue; debugTextStyle = new GUIStyle(); debugTextStyle.fontSize = 20; debugTextStyle.normal.textColor = Color.white; } public void Start() { InitializeThrowOrigin(); InitializeHoldPosition(); InitializeTrajectoryPredictor(); InitalizePluckAnimation(); InitalizeSprout(); InitalizeFormationManager(); PikminManager.instance.AddLeader(this); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsServer) { SpawnNoticeZone(); } } public void SpawnNoticeZone() { GameObject val = LethalMin.assetBundle.LoadAsset("Assets/LethalMin/PikminNoticeZone.prefab"); PikminNoticeZone component = Object.Instantiate(val, ((Component)this).transform).GetComponent(); ((NetworkBehaviour)component).NetworkObject.Spawn(false); ((NetworkBehaviour)component).NetworkObject.TrySetParent(((Component)this).transform, true); } public void SpawnGlowMob(ulong ID) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) GameObject val = LethalMin.assetBundle.LoadAsset("Assets/LethalMin/Types/Glow Pikmin/GlowMob/GlowMob.prefab"); glowmob = Object.Instantiate(val, ((Component)this).transform).GetComponent(); ((NetworkBehaviour)glowmob).NetworkObject.SpawnWithOwnership(ID, false); glowmob.SetLeaderClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)this).NetworkObject)); } private void InitializeThrowOrigin() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) mainCamera = Controller.gameplayCamera; GameObject val = new GameObject("ThrowOrigin"); ThrowOrigin = val.transform; ((Component)ThrowOrigin).transform.SetParent(((Component)mainCamera).transform, true); ThrowOrigin.localPosition = new Vector3(0.1f, 0f, 0f); } private void InitializeHoldPosition() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("PikminHoldPosition"); holdPosition = val.transform; holdPosition.SetParent(ThrowOrigin); holdPosition.localPosition = new Vector3(0.5f, -0.3f, 0.5f); } private void InitializeTrajectoryPredictor() { predictor = Object.Instantiate(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/TrajectoryPredictor.prefab"), ((Component)this).transform).GetComponent(); predictor.throwOrigin = ThrowOrigin; } private void InitalizeSprout() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) LeaflingSprout = Object.Instantiate(LethalMin.PlayerSproutPrefab, ((Component)Controller.headCostumeContainer).transform.parent); LeaflingSprout.transform.localPosition = new Vector3(0f, 0.3f, 0f); LeaflingSprout.transform.localScale = new Vector3(0.65f, 0.65f, 0.65f); LeaflingSprout.transform.localRotation = new Quaternion(0.2164f, 0f, 0f, -0.9763f); Renderer[] componentsInChildren = LeaflingSprout.GetComponentsInChildren(); foreach (Renderer val in componentsInChildren) { if (((Object)((Component)val).gameObject).name == "Sprout") { SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(object)((val is SkinnedMeshRenderer) ? val : null); if (val2 != null) { LeaflingSproutMesh = (Renderer)(object)val2; } } if (((Object)((Component)val).gameObject).name == "Leaf") { MeshRenderer val3 = (MeshRenderer)(object)((val is MeshRenderer) ? val : null); if (val3 != null) { LeaflingLeafMesh = (Renderer)(object)val3; } } } } private void InitalizeFormationManager() { formManager = ((Component)this).gameObject.AddComponent(); formManager.leader = this; ((Behaviour)formManager).enabled = false; } private void InitializeInputAction() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Expected O, but got Unknown //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Expected O, but got Unknown //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Expected O, but got Unknown //IL_0314: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogInfo((object)("Binding input actions for " + Controller.playerUsername)); if (!LethalMin.UseInputUtils) { string text = (LethalMin.InVRMode ? LethalMin.ThrowVRAction.InternalValue : LethalMin.ThrowAction.InternalValue); LethalMin.Logger.LogInfo((object)("ThrowActionPath: " + text)); throwAction = new InputAction("Throw", (InputActionType)0, (string)null, (string)null, (string)null, (string)null); InputActionSetupExtensions.AddBinding(throwAction, text, (string)null, (string)null, (string)null); throwAction.performed -= OnThrowStarted; throwAction.canceled -= OnThrowCanceled; throwAction.performed += OnThrowStarted; throwAction.canceled += OnThrowCanceled; throwAction.Enable(); string text2 = (LethalMin.InVRMode ? LethalMin.ThrowCancelVRAction.InternalValue : LethalMin.ThrowCancelAction.InternalValue); throwCancelAction = new InputAction("Throw Cancel", (InputActionType)0, (string)null, (string)null, (string)null, (string)null); InputActionSetupExtensions.AddBinding(throwCancelAction, text2, (string)null, (string)null, (string)null); throwCancelAction.performed -= OnThrowCancelCanceled; throwCancelAction.performed += OnThrowCancelCanceled; throwCancelAction.Enable(); string text3 = (LethalMin.InVRMode ? LethalMin.SecondaryThrowVRAction.InternalValue : ""); if (!string.IsNullOrEmpty(text3) && !string.IsNullOrWhiteSpace(text3)) { LethalMin.Logger.LogInfo((object)("SecondaryThrowActionPath: " + text3)); secondaryThrowAction = new InputAction("SecondaryThrow", (InputActionType)0, (string)null, (string)null, (string)null, (string)null); InputActionSetupExtensions.AddBinding(secondaryThrowAction, text3, (string)null, (string)null, (string)null); secondaryThrowAction.performed -= OnThrowStarted; secondaryThrowAction.canceled -= OnThrowCanceled; secondaryThrowAction.performed += OnThrowStarted; secondaryThrowAction.canceled += OnThrowCanceled; secondaryThrowAction.Enable(); } string text4 = (LethalMin.InVRMode ? LethalMin.SwitchForwardVRAction.InternalValue : LethalMin.SwitchForwardAction.InternalValue); switchPikminTypeAction = new InputAction("SwitchPikminType", (InputActionType)0, (string)null, (string)null, (string)null, (string)null); InputActionSetupExtensions.AddBinding(switchPikminTypeAction, text4, (string)null, (string)null, (string)null); switchPikminTypeAction.canceled -= OnSwitchPikminType; switchPikminTypeAction.canceled += OnSwitchPikminType; switchPikminTypeAction.Enable(); string text5 = (LethalMin.InVRMode ? LethalMin.SwitchBackwawrdsVRAction.InternalValue : LethalMin.SwitchBackwawrdsAction.InternalValue); switchPikminPrevTypeAction = new InputAction("SwitchPikminTypeBack", (InputActionType)0, (string)null, (string)null, (string)null, (string)null); InputActionSetupExtensions.AddBinding(switchPikminPrevTypeAction, text5, (string)null, (string)null, (string)null); switchPikminPrevTypeAction.canceled -= OnSwitchPrevPikminType; switchPikminPrevTypeAction.canceled += OnSwitchPrevPikminType; switchPikminPrevTypeAction.Enable(); } else { throwAction = LethalMin.InputClassInstace.Throw; throwAction.performed -= OnThrowStarted; throwAction.canceled -= OnThrowCanceled; throwAction.performed += OnThrowStarted; throwAction.canceled += OnThrowCanceled; throwAction.Enable(); throwCancelAction = LethalMin.InputClassInstace.ThrowCancel; throwCancelAction.performed -= OnThrowCancelCanceled; throwCancelAction.performed += OnThrowCancelCanceled; throwCancelAction.Enable(); switchPikminTypeAction = LethalMin.InputClassInstace.SwitchRight; switchPikminTypeAction.canceled -= OnSwitchPikminType; switchPikminTypeAction.canceled += OnSwitchPikminType; switchPikminTypeAction.Enable(); switchPikminPrevTypeAction = LethalMin.InputClassInstace.SwitchLeft; switchPikminPrevTypeAction.canceled -= OnSwitchPrevPikminType; switchPikminPrevTypeAction.canceled += OnSwitchPrevPikminType; switchPikminPrevTypeAction.Enable(); } } public void InitalizePluckAnimation() { CustomAnimController = ((Component)this).gameObject.AddComponent(); CustomAnimController.SetUpCustomAnimation(Controller.playerBodyAnimator, "PullLever", LethalMin.PlayerPluckAnim); } public void HandlePlayerConnected() { DidHaveConnectedPlayer = true; ((Behaviour)formManager).enabled = ((NetworkBehaviour)this).IsOwner && LethalMin.PikminFollowMode.InternalValue == PfollowMode.New; UpdateLeafingShadowMode(); LethalMin.Logger.LogInfo((object)"Leader connection detected!"); if (((NetworkBehaviour)this).IsServer && (Object)(object)NoticeZone != (Object)null && ((NetworkBehaviour)NoticeZone).OwnerClientId != ((NetworkBehaviour)this).OwnerClientId) { LethalMin.Logger.LogInfo((object)$"Set NoticeZone OwnerClientId: {((NetworkBehaviour)NoticeZone).OwnerClientId} to OwnerClientId: {((NetworkBehaviour)this).OwnerClientId}"); ((NetworkBehaviour)NoticeZone).NetworkObject.ChangeOwnership(((NetworkBehaviour)this).OwnerClientId); } if (((NetworkBehaviour)this).IsServer && (Object)(object)glowmob != (Object)null && ((NetworkBehaviour)glowmob).OwnerClientId != ((NetworkBehaviour)this).OwnerClientId) { LethalMin.Logger.LogInfo((object)$"Set Glowmob OwnerClientId: {((NetworkBehaviour)glowmob).OwnerClientId} to OwnerClientId: {((NetworkBehaviour)this).OwnerClientId}"); ((NetworkBehaviour)glowmob).NetworkObject.ChangeOwnership(((NetworkBehaviour)this).OwnerClientId); } } public void HandlePlayerDisconnected() { DidHaveConnectedPlayer = false; ((Behaviour)formManager).enabled = false; if (((NetworkBehaviour)this).IsServer && (Object)(object)NoticeZone != (Object)null && ((NetworkBehaviour)NoticeZone).OwnerClientId != 0) { LethalMin.Logger.LogInfo((object)"Leader is no longer controlled, setting noticezone ownership to server"); ((NetworkBehaviour)NoticeZone).NetworkObject.ChangeOwnership(0uL); } if (((NetworkBehaviour)this).IsServer && (Object)(object)glowmob != (Object)null && ((NetworkBehaviour)glowmob).OwnerClientId != 0) { LethalMin.Logger.LogInfo((object)"Leader is no longer controlled, setting glowmob ownership to server"); ((NetworkBehaviour)glowmob).NetworkObject.ChangeOwnership(0uL); } if ((Object)(object)glowmob != (Object)null && glowmob.IsDoingGlowmob) { LethalMin.Logger.LogInfo((object)"Leader is no longer controlled, stopping glow mob"); glowmob.StopGlowmob(); } } private void Update() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) LeaflingSprout.SetActive(IsLeafling); if (LethalMin.PlayerNoticeZoneSizeCheat != -1f) { float playerNoticeZoneSizeCheat = LethalMin.PlayerNoticeZoneSizeCheat; ((Component)NoticeZone).transform.localScale = new Vector3(playerNoticeZoneSizeCheat, playerNoticeZoneSizeCheat, playerNoticeZoneSizeCheat); } if (((NetworkBehaviour)this).IsOwner) { FriendlyFire.Value = LethalMin.FriendlyFire.InternalValue; FriendlyerFire.Value = LethalMin.FriendlyerFire.InternalValue; } if ((Object)(object)pikminHolding != (Object)null) { predictor.PredictTrajectory(pikminHolding.ProjectileProps); } if (((NetworkBehaviour)this).IsOwner && Controller.isInsideFactory != LastIsInsideValue && !Controller.isPlayerDead) { LastIsInsideValue = Controller.isInsideFactory; SetPikminToEntrance(Controller.isInsideFactory); SetPikminToEntranceServerRpc(Controller.isInsideFactory); } if (!HasAttemptedToBindActions && (Object)(object)StartOfRound.Instance.localPlayerController != (Object)null && (Object)(object)StartOfRound.Instance.localPlayerController == (Object)(object)Controller) { InitializeInputAction(); HasAttemptedToBindActions = true; } if (PuffminLatchedOn.Count > 0) { UpdatePuffminWiggleDetection(); } ((Component)ThrowOrigin).transform.rotation = ((Component)Controller.gameplayCamera).transform.rotation; } private void LateUpdate() { if (IsLeafling) { Controller.sprintMeter = Mathf.Clamp(Controller.sprintMeter, 0f, 25f); } if (!DidHaveConnectedPlayer && PikChecks.IsPlayerConnected(Controller)) { HandlePlayerConnected(); } if (DidHaveConnectedPlayer && !PikChecks.IsPlayerConnected(Controller)) { HandlePlayerDisconnected(); } } public void OnSwitchPikminType(CallbackContext callbackContext) { if (((NetworkBehaviour)this).IsOwner && !StartOfRound.Instance.localPlayerController.quickMenuManager.isMenuOpen) { SwitchPikminType(1); } } public void OnSwitchPrevPikminType(CallbackContext callbackContext) { if (((NetworkBehaviour)this).IsOwner && !StartOfRound.Instance.localPlayerController.quickMenuManager.isMenuOpen) { SwitchPikminType(-1); } } [ServerRpc] public void SwitchPikminTypeServerRpc(int Direction) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3745238282u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, Direction); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3745238282u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SwitchPikminTypeClientRpc(Direction); } } [ClientRpc] public void SwitchPikminTypeClientRpc(int Direction) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1234986946u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, Direction); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1234986946u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { SwitchPikminType(Direction); } } } public void SwitchPikminType(int Direction) { //IL_0187: Unknown result type (might be due to invalid IL or missing references) if (PikminInSquad.Count == 0) { CurrentTypeIndex = 0; return; } List pikminTypesInSquad = GetPikminTypesInSquad(); if (pikminTypesInSquad.Count == 0) { CurrentTypeIndex = 0; return; } PikminHUDManager.instance._cacheNeedsRefresh = true; PikminType selectedType = GetSelectedType(); MoveIndexIntoBounds(pikminTypesInSquad); if (Direction == 1 && pikminTypesInSquad.Count > 0) { CurrentTypeIndex = (CurrentTypeIndex + 1) % pikminTypesInSquad.Count; } if (Direction == -1 && pikminTypesInSquad.Count > 0) { CurrentTypeIndex = (CurrentTypeIndex - 1 + pikminTypesInSquad.Count) % pikminTypesInSquad.Count; } formManager.RecalculateFormation(); if ((Object)(object)GetSelectedType() != (Object)(object)selectedType) { PendingSwitchDirections.Enqueue(Direction); } if (((NetworkBehaviour)this).IsOwner && Direction != 0 && (Object)(object)pikminHolding != (Object)null && !StartOfRound.Instance.localPlayerController.quickMenuManager.isMenuOpen && !((Object)(object)GetSelectedType() == (Object)(object)selectedType)) { PikminAI closestPikminInSquadOfType = GetClosestPikminInSquadOfType(GetSelectedType()); if ((Object)(object)closestPikminInSquadOfType != (Object)null) { closestPikminInSquadOfType.StartThrow(); StartThrow(closestPikminInSquadOfType); IsStartThrowRpcCalled = true; StartThrowServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)closestPikminInSquadOfType).NetworkObject)); } } } public void MoveIndexIntoBounds(List list) { if (list.Count > 0) { CurrentTypeIndex = Mathf.Clamp(CurrentTypeIndex, 0, list.Count - 1); } else { CurrentTypeIndex = 0; } } public PikminType? GetSelectedType(List list = null) { if (list == null) { list = GetPikminTypesInSquad(); } if (list.Count > 0 && !PikUtils.IsOutOfRange(list, CurrentTypeIndex)) { return list[CurrentTypeIndex]; } return null; } public PikminType? GetPreviousType(List list = null) { if (list == null) { list = GetPikminTypesInSquad(); } if (list.Count > 0) { int index = (CurrentTypeIndex - 1 + list.Count) % list.Count; return list[index]; } return null; } public PikminType? GetNextType(List list = null) { if (list == null) { list = GetPikminTypesInSquad(); } if (list.Count > 0) { int index = (CurrentTypeIndex + 1) % list.Count; return list[index]; } return null; } public bool IsAllOfTypeUnslectable(PikminType Ptype, Dictionary typesWithCounts) { int num = typesWithCounts[Ptype]; int num2 = 0; PikminInSquad.RemoveAll((PikminAI p) => (Object)(object)p == (Object)null); foreach (PikminAI item in PikminInSquad) { if (item.Unselectable && (Object)(object)item.pikminType == (Object)(object)Ptype) { num2++; } } return num == num2; } [ServerRpc] public void SetPikminToEntranceServerRpc(bool isInside) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2437906923u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isInside, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2437906923u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetPikminToEntranceClientRpc(isInside); } } [ClientRpc] public void SetPikminToEntranceClientRpc(bool isInside) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3368602337u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isInside, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3368602337u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetPikminToEntrance(isInside); } } } public void SetPikminToEntrance(bool isInside) { LethalMin.Logger.LogDebug((object)$"Setting pikmin to entrance: {isInside}"); List list = new List(PikminInSquad); foreach (PikminAI item in list) { item.WarpToMatchLeaderDoors(isInside); } } public void OnThrowStarted(CallbackContext context) { //IL_013e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)pikminHolding)) { LethalMin.Logger.LogDebug((object)"Cannot start throw while holding a pikmin"); } else { if (!((NetworkBehaviour)this).IsOwner || Controller.quickMenuManager.isMenuOpen || Controller.isTypingChat || Controller.inTerminalMenu || OnionHUDManager.instance.IsMenuOpen) { return; } if (LethalMin.InVRMode && secondaryThrowAction != null && ((((CallbackContext)(ref context)).action == throwAction && !secondaryThrowAction.IsPressed()) || (((CallbackContext)(ref context)).action == secondaryThrowAction && !throwAction.IsPressed()))) { LethalMin.Logger.LogDebug((object)"Awaiting Second Throw Input"); return; } PikminAI closestPikminInSquadOfType = GetClosestPikminInSquadOfType(GetSelectedType()); if ((Object)(object)closestPikminInSquadOfType != (Object)null) { closestPikminInSquadOfType.StartThrow(); StartThrow(closestPikminInSquadOfType); IsStartThrowRpcCalled = true; StartThrowServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)closestPikminInSquadOfType).NetworkObject)); } } } public void OnThrowCanceled(CallbackContext context) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)pikminHolding)) { LethalMin.Logger.LogDebug((object)"Cannot do throw while not holding a pikmin"); } else if (((NetworkBehaviour)this).IsOwner && !Controller.quickMenuManager.isMenuOpen && !Controller.isTypingChat) { IsDoThrowRpcCalled = true; DoThrowServerRpc(((Component)holdPosition).transform.forward); pikminHolding?.ThrowPikmin(((Component)holdPosition).transform.forward); DoThrow(); } } [IteratorStateMachine(typeof(d__77))] private IEnumerator OnThrowCancledBuffer(CallbackContext context) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__77(0) { <>4__this = this, context = context }; } public PikminAI GetClosestPikminInSquad() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) PikminAI result = null; float num = float.MaxValue; PikminInSquad.RemoveAll((PikminAI p) => (Object)(object)p == (Object)null); foreach (PikminAI item in PikminInSquad) { if (((EnemyAI)item).currentBehaviourStateIndex == 1) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)item).transform.position); if (num2 < num) { num = num2; result = item; } } } return result; } public PikminAI? GetClosestPikminInSquadOfType(PikminType? type) { //IL_00a3: 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) if ((Object)(object)type == (Object)null) { return null; } PikminAI result = null; float num = float.MaxValue; PikminInSquad.RemoveAll((PikminAI p) => (Object)(object)p == (Object)null); foreach (PikminAI item in PikminInSquad) { if (!((Object)(object)item.pikminType != (Object)(object)type) && ((EnemyAI)item).currentBehaviourStateIndex == 1 && !item.Unselectable) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)item).transform.position); if (num2 < num) { num = num2; result = item; } } } return result; } [ServerRpc] public void StartThrowServerRpc(NetworkObjectReference PikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2621695876u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2621695876u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StartThrowClientRpc(PikRef); } } [ClientRpc] public void StartThrowClientRpc(NetworkObjectReference PikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2590319553u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2590319553u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); PikminAI pikminAI = default(PikminAI); if (!((NetworkBehaviour)this).IsOwner && ((NetworkObjectReference)(ref PikRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref pikminAI)) { pikminAI.StartThrow(); StartThrow(pikminAI); if (((NetworkBehaviour)this).IsOwner) { IsStartThrowRpcCalled = false; } } } public void StartThrow(PikminAI pik) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pikminHolding != (Object)null) { ((EnemyAI)pikminHolding).creatureVoice.Stop(); StopThrow(); } pik.ProjectileProps.direction = ((Component)holdPosition).transform.forward; pikminHolding = pik; ((Renderer)predictor.trajectoryLine).material.SetColor("_ColorA", pik.pikminType.PikminPrimaryColor); ((Renderer)predictor.trajectoryLine).material.SetColor("_ColorB", pik.pikminType.PikminSecondaryColor); ((Component)predictor.hitMarker).GetComponentInChildren().material.color = pik.pikminType.PikminSecondaryColor; } [ServerRpc] public void DoThrowServerRpc(Vector3 Dir) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1767305831u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Dir); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1767305831u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DoThrowClientRpc(Dir); } } [ClientRpc] public void DoThrowClientRpc(Vector3 Direct) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2737539601u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Direct); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2737539601u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { pikminHolding?.ThrowPikmin(Direct); DoThrow(); if (((NetworkBehaviour)this).IsOwner) { IsDoThrowRpcCalled = false; } } } public void DoThrow() { if ((Object)(object)pikminHolding != (Object)null) { pikminHolding.RemoveLeader(); } pikminHolding = null; predictor.SetTrajectoryVisible(visible: false); } [ServerRpc] public void StopThrowServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(942719263u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 942719263u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StopThrowClientRpc(); } } [ClientRpc] public void StopThrowClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2207137234u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2207137234u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { PikminAI? pikminAI = pikminHolding; if (pikminAI != null) { ((EnemyAI)pikminAI).creatureVoice.Stop(); } StopThrow(); } } public void StopThrow(bool SetCollisionMode = true) { if (SetCollisionMode) { pikminHolding?.SetCollisionMode(1); pikminHolding?.ChangeIntent(Pintent.Idle); pikminHolding?.animController.ResetToIdleAnim(); } pikminHolding = null; predictor.SetTrajectoryVisible(visible: false); } public void OnThrowCancelCanceled(CallbackContext context) { if (!((Object)(object)pikminHolding == (Object)null) && ((NetworkBehaviour)this).IsOwner && !Controller.quickMenuManager.isMenuOpen && !Controller.isTypingChat) { ((EnemyAI)pikminHolding).creatureVoice.Stop(); StopThrowServerRpc(); StopThrow(); } } public void OnPikminAdded(PikminAI ai) { SwitchPikminType(0); } [ServerRpc] public void RemoveAllPikminFromSquadServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3550365214u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3550365214u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RemoveAllPikminFromSquadClientRpc(); } } [ClientRpc] public void RemoveAllPikminFromSquadClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2097565937u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2097565937u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { RemoveAllPikminFromSquadOnLocalClient(); } } } public void RemoveAllPikminFromSquadOnLocalClient() { List list = new List(PikminInSquad); foreach (PikminAI item in list) { if ((Object)(object)item != (Object)null) { item.PlayAudioOnLocalClient(PikminSoundPackSounds.Lost); item.SetToIdle(); } } } public void AddToRemoveQueue(PikminAI pikmin) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (pikminRemoveCoroutine != null) { pikminRemoveCoroutine = null; } PikminRemoveQueue.Enqueue(NetworkObjectReference.op_Implicit(((NetworkBehaviour)pikmin).NetworkObject)); pikminRemoveCoroutine = ((MonoBehaviour)this).StartCoroutine(RemovePikminsFromSquad()); } [IteratorStateMachine(typeof(d__95))] private IEnumerator RemovePikminsFromSquad() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__95(0) { <>4__this = this }; } [ServerRpc] public void RemovePikminFromSquadServerRpc(NetworkObjectReference PikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(630702978u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 630702978u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RemovePikminFromSquadClientRpc(PikRef); } } [ClientRpc] public void RemovePikminFromSquadClientRpc(NetworkObjectReference PikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3410751063u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3410751063u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); PikminAI pikminAI = default(PikminAI); if (((NetworkObjectReference)(ref PikRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref pikminAI) && (Object)(object)pikminAI != (Object)null) { LethalMin.Logger.LogDebug((object)("Removing Pikmin from Squad: " + pikminAI.DebugID)); RemovePikminFromSquad(pikminAI); } else { LethalMin.Logger.LogError((object)$"Failed to remove Pikmin from Squad: {PikRef}"); } } } [ServerRpc] public void RemovePikminFromSquadServerRpc(NetworkObjectReference[] PikRefs) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Invalid comparison between Unknown and I4 //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(10818973u, val, (RpcDelivery)0); bool flag = PikRefs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(PikRefs, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 10818973u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; LethalMin.Logger.LogInfo((object)$"Sending batch: {PikRefs.Length} to be removed Pikmin from Squad"); RemovePikminFromSquadClientRpc(PikRefs); } } [ClientRpc] public void RemovePikminFromSquadClientRpc(NetworkObjectReference[] PikRefs) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3930158659u, val, (RpcDelivery)0); bool flag = PikRefs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(PikRefs, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3930158659u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; LethalMin.Logger.LogInfo((object)$"Received batch: {PikRefs.Length} to be removed Pikmin from Squad"); NetworkObject val4 = default(NetworkObject); PikminAI pikminAI = default(PikminAI); for (int i = 0; i < PikRefs.Length; i++) { NetworkObjectReference val3 = PikRefs[i]; if (((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref pikminAI) && (Object)(object)pikminAI != (Object)null) { pikminAI.SetToIdle(); } else { LethalMin.Logger.LogError((object)$"Failed to remove Pikmin from Squad: {val3}"); } } LethalMin.Logger.LogInfo((object)$"Prosessed batch, current que: {PikminRemoveQueue.Count}"); } public void RemovePikminFromSquad(PikminAI Pikmin) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) PikminInSquad.Remove(Pikmin); SwitchPikminType(0); if (((NetworkBehaviour)this).IsOwner && PikminRemoveQueue.Contains(NetworkObjectReference.op_Implicit(((NetworkBehaviour)Pikmin).NetworkObject))) { PikminRemoveQueue.Dequeue(); } } private void UpdatePuffminWiggleDetection() { //IL_002e: 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_0113: 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) if (!((NetworkBehaviour)this).IsOwner || PuffminLatchedOn.Count == 0) { return; } Vector3 eulerAngles = ((Component)mainCamera).transform.eulerAngles; float num = Mathf.Abs(Mathf.DeltaAngle(eulerAngles.y, lastRotationEuler.y)); if (Time.time - lastWiggleTime > wiggleResetTime) { totalRotationChange = 0f; } totalRotationChange += num; if (totalRotationChange >= wiggleThreshold) { wiggleCount++; totalRotationChange = 0f; lastWiggleTime = Time.time; LethalMin.Logger.LogDebug((object)$"Wiggle detected! Count: {wiggleCount}/{requiredWiggles}"); if (wiggleCount >= requiredWiggles) { TryShakeOffPuffmin(); wiggleCount = 0; } } lastRotationEuler = eulerAngles; } private void TryShakeOffPuffmin() { if (PuffminLatchedOn.Count != 0) { ShakePuffminOffServerRpc(); LethalMin.Logger.LogDebug((object)"Shaking off Puffmin!"); } } [ServerRpc] private void ShakePuffminOffServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3678902836u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3678902836u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ShakePuffminOffClientRpc(); } } [ClientRpc] private void ShakePuffminOffClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3835444004u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3835444004u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; foreach (PuffminAI item in new List(PuffminLatchedOn.Keys)) { Vector3 val3 = ((Component)item).transform.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val3)).normalized; item.ApplyKnockBack(normalized, wiggleCount); } } private void OnGUI() { if (!((Object)(object)Controller == (Object)null) && Controller.isPlayerControlled && !((Object)(object)Controller != (Object)(object)StartOfRound.Instance.localPlayerController)) { } } protected override void __initializeVariables() { if (FriendlyFire == null) { throw new Exception("Leader.FriendlyFire cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)FriendlyFire).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)FriendlyFire, "FriendlyFire"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)FriendlyFire); if (FriendlyerFire == null) { throw new Exception("Leader.FriendlyerFire cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)FriendlyerFire).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)FriendlyerFire, "FriendlyerFire"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)FriendlyerFire); ((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 //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3745238282u, new RpcReceiveHandler(__rpc_handler_3745238282), "SwitchPikminTypeServerRpc"); ((NetworkBehaviour)this).__registerRpc(1234986946u, new RpcReceiveHandler(__rpc_handler_1234986946), "SwitchPikminTypeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2437906923u, new RpcReceiveHandler(__rpc_handler_2437906923), "SetPikminToEntranceServerRpc"); ((NetworkBehaviour)this).__registerRpc(3368602337u, new RpcReceiveHandler(__rpc_handler_3368602337), "SetPikminToEntranceClientRpc"); ((NetworkBehaviour)this).__registerRpc(2621695876u, new RpcReceiveHandler(__rpc_handler_2621695876), "StartThrowServerRpc"); ((NetworkBehaviour)this).__registerRpc(2590319553u, new RpcReceiveHandler(__rpc_handler_2590319553), "StartThrowClientRpc"); ((NetworkBehaviour)this).__registerRpc(1767305831u, new RpcReceiveHandler(__rpc_handler_1767305831), "DoThrowServerRpc"); ((NetworkBehaviour)this).__registerRpc(2737539601u, new RpcReceiveHandler(__rpc_handler_2737539601), "DoThrowClientRpc"); ((NetworkBehaviour)this).__registerRpc(942719263u, new RpcReceiveHandler(__rpc_handler_942719263), "StopThrowServerRpc"); ((NetworkBehaviour)this).__registerRpc(2207137234u, new RpcReceiveHandler(__rpc_handler_2207137234), "StopThrowClientRpc"); ((NetworkBehaviour)this).__registerRpc(3550365214u, new RpcReceiveHandler(__rpc_handler_3550365214), "RemoveAllPikminFromSquadServerRpc"); ((NetworkBehaviour)this).__registerRpc(2097565937u, new RpcReceiveHandler(__rpc_handler_2097565937), "RemoveAllPikminFromSquadClientRpc"); ((NetworkBehaviour)this).__registerRpc(630702978u, new RpcReceiveHandler(__rpc_handler_630702978), "RemovePikminFromSquadServerRpc"); ((NetworkBehaviour)this).__registerRpc(3410751063u, new RpcReceiveHandler(__rpc_handler_3410751063), "RemovePikminFromSquadClientRpc"); ((NetworkBehaviour)this).__registerRpc(10818973u, new RpcReceiveHandler(__rpc_handler_10818973), "RemovePikminFromSquadServerRpc"); ((NetworkBehaviour)this).__registerRpc(3930158659u, new RpcReceiveHandler(__rpc_handler_3930158659), "RemovePikminFromSquadClientRpc"); ((NetworkBehaviour)this).__registerRpc(3678902836u, new RpcReceiveHandler(__rpc_handler_3678902836), "ShakePuffminOffServerRpc"); ((NetworkBehaviour)this).__registerRpc(3835444004u, new RpcReceiveHandler(__rpc_handler_3835444004), "ShakePuffminOffClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3745238282(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int direction = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref direction); target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).SwitchPikminTypeServerRpc(direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1234986946(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 direction = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref direction); target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).SwitchPikminTypeClientRpc(direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2437906923(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { bool pikminToEntranceServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikminToEntranceServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).SetPikminToEntranceServerRpc(pikminToEntranceServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3368602337(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 pikminToEntranceClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikminToEntranceClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).SetPikminToEntranceClientRpc(pikminToEntranceClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2621695876(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).StartThrowServerRpc(pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2590319553(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 pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).StartThrowClientRpc(pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1767305831(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 dir = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dir); target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).DoThrowServerRpc(dir); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2737539601(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 direct = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direct); target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).DoThrowClientRpc(direct); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_942719263(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).StopThrowServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2207137234(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; ((Leader)(object)target).StopThrowClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3550365214(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).RemoveAllPikminFromSquadServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2097565937(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; ((Leader)(object)target).RemoveAllPikminFromSquadClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_630702978(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).RemovePikminFromSquadServerRpc(pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3410751063(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 pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).RemovePikminFromSquadClientRpc(pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_10818973(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikRefs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRefs, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).RemovePikminFromSquadServerRpc(pikRefs); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_3930158659(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikRefs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRefs, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).RemovePikminFromSquadClientRpc(pikRefs); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3678902836(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((Leader)(object)target).ShakePuffminOffServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3835444004(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; ((Leader)(object)target).ShakePuffminOffClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Leader"; } } public class LeaderFormationManager : MonoBehaviour { [Header("Formation Target")] public Transform targetTransform = null; [Header("Formation Settings")] public float boxWidth = 10f; public float boxDepth = 10f; public float spacing = 1f; public float noiseFactor = 0.3f; public float UpdateInterval = 0.5f; public Leader leader = null; private Dictionary formationPositions = new Dictionary(); private float recalculateTimer = 0f; private void OnEnable() { if ((Object)(object)targetTransform == (Object)null) { GameObject val = LethalMin.assetBundle.LoadAsset("Assets/LethalMin/PikminFormationTarget.prefab"); targetTransform = Object.Instantiate(val, (Transform)null).transform; ((Component)targetTransform).gameObject.GetComponent().formationManager = this; leader = ((Component)this).GetComponent(); ((Object)((Component)targetTransform).gameObject).name = leader.Controller.playerUsername + "'s Formation Target"; } ((Behaviour)((Component)targetTransform).gameObject.GetComponent()).enabled = true; } private void OnDisable() { ((Behaviour)((Component)targetTransform).gameObject.GetComponent()).enabled = false; } public Vector3 GetFormationPosition(PikminAI ai) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0046: Unknown result type (might be due to invalid IL or missing references) if (formationPositions.ContainsKey(ai)) { return formationPositions[ai]; } return Object.op_Implicit((Object)(object)targetTransform) ? targetTransform.position : ((Component)this).transform.position; } public void RecalculateFormation() { //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled && ((NetworkBehaviour)leader).IsOwner && !((Object)(object)targetTransform == (Object)null) && leader.PikminInSquad.Count != 0) { formationPositions.Clear(); int num = Mathf.CeilToInt(Mathf.Sqrt((float)leader.PikminInSquad.Count)); for (int i = 0; i < leader.PikminInSquad.Count; i++) { int num2 = i / num; int num3 = i % num; float num4 = ((float)num3 - (float)(num - 1) / 2f) * spacing; float num5 = ((float)num2 - (float)(Mathf.CeilToInt((float)leader.PikminInSquad.Count / (float)num) - 1) / 2f) * spacing; num4 = Mathf.Clamp(num4, (0f - boxWidth) / 2f, boxWidth / 2f); num5 = Mathf.Clamp(num5, (0f - boxDepth) / 2f, boxDepth / 2f); float num6 = Random.Range(0f - noiseFactor, noiseFactor); float num7 = Random.Range(0f - noiseFactor, noiseFactor); Vector3 value = targetTransform.position + targetTransform.right * (num4 + num6) + targetTransform.forward * (num5 + num7); formationPositions[leader.PikminInSquad[i]] = value; } } } private void Update() { if (recalculateTimer > 0f) { recalculateTimer -= Time.deltaTime; return; } recalculateTimer = UpdateInterval; if (leader.PikminInSquad.Count > 0 && (Object)(object)targetTransform != (Object)null && targetTransform.hasChanged) { RecalculateFormation(); targetTransform.hasChanged = false; } } } public class LeaderFormationTarget : MonoBehaviour { public NavMeshAgent agent = null; public LeaderFormationManager formationManager = null; private float CalcualtionTimer = 0f; private void Start() { agent.speed = 50f; agent.angularSpeed = 1000f; agent.acceleration = 1000f; } private void Update() { if (CalcualtionTimer > 0f) { CalcualtionTimer -= Time.deltaTime; return; } CalcualtionTimer = formationManager.UpdateInterval; CheckToMove(); } private void CheckToMove() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_0136: Unknown result type (might be due to invalid IL or missing references) if (StartOfRound.Instance.inShipPhase || formationManager.leader.Controller.isPlayerDead || !PikminManager.CanPathOnMoonGlobal) { ((Behaviour)agent).enabled = false; return; } ((Behaviour)agent).enabled = true; if (!agent.isOnNavMesh) { ((Behaviour)agent).enabled = false; ((Component)this).transform.position = ((Component)formationManager).transform.position; return; } agent.stoppingDistance = Mathf.Lerp(4f, 9f, (float)formationManager.leader.PikminInSquad.Count / (float)LethalMin.MaxPikmin.InternalValue); agent.SetDestination(((Component)formationManager).transform.position); if (Vector3.Distance(((Component)this).transform.position, ((Component)formationManager).transform.position) > 20f + agent.stoppingDistance) { agent.Warp(((Component)formationManager).transform.position); } } } public class MoonSpawnConfig { private ConfigItem? _maxPikminSpawnsConfig; private ConfigItem? _baseSpawnMultiplierConfig; private ConfigItem? _overrideTypeSettingsConfig; private ConfigItem>? _blockedTypesConfig; private ConfigItem>? _allowedTypesConfig; private ConfigItem>? _typeSpawnMultipliersConfig; private readonly int _defaultMaxPikminSpawns; private readonly float _defaultBaseSpawnMultiplier; private readonly bool _defaultOverrideTypeSettings; private readonly List _defaultBlockedTypes; private readonly List _defaultAllowedTypes; private readonly List _defaultTypeSpawnMultipliers; public string MoonName { get; private set; } public int MaxPikminSpawns => _maxPikminSpawnsConfig?.InternalValue ?? _defaultMaxPikminSpawns; public float BaseSpawnMultiplier => _baseSpawnMultiplierConfig?.InternalValue ?? _defaultBaseSpawnMultiplier; public bool OverrideTypeSettings => _overrideTypeSettingsConfig?.InternalValue ?? _defaultOverrideTypeSettings; public List BlockedTypesList => _blockedTypesConfig?.InternalValue ?? _defaultBlockedTypes; public List AllowedTypesList => _allowedTypesConfig?.InternalValue ?? _defaultAllowedTypes; public List TypeSpawnMultipliersList => _typeSpawnMultipliersConfig?.InternalValue ?? _defaultTypeSpawnMultipliers; public bool HasConfigFile => _maxPikminSpawnsConfig != null; public MoonSpawnConfig(string moonName, bool generateFile, int defaultMaxSpawns = -1, float defaultBaseMultiplier = 1f, List? defaultBlockedTypes = null, List? defaultAllowedTypes = null, List? defaultTypeMultipliers = null) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown MoonName = moonName; _defaultMaxPikminSpawns = defaultMaxSpawns; _defaultBaseSpawnMultiplier = defaultBaseMultiplier; _defaultOverrideTypeSettings = false; _defaultBlockedTypes = defaultBlockedTypes ?? new List(); _defaultAllowedTypes = defaultAllowedTypes ?? new List(); _defaultTypeSpawnMultipliers = defaultTypeMultipliers ?? new List(); if (generateFile) { string text = Path.Combine(Paths.ConfigPath, "PikminMoonSpawns"); Directory.CreateDirectory(text); string path = LethalMin.SanitizeFileName(moonName) + ".cfg"; string text2 = Path.Combine(text, path); ConfigFile ovrcfg = new ConfigFile(text2, true); _maxPikminSpawnsConfig = new ConfigItem("Spawning", "Max Pikmin Spawns", defaultMaxSpawns, "Maximum number of pikmin that can spawn on this moon. Set to -1 for no limit (uses default).", needsRestart: true, ConfigItemAuthority.Host, ovrcfg); _baseSpawnMultiplierConfig = new ConfigItem("Spawning", "Base Spawn Multiplier", defaultBaseMultiplier, "Base multiplier applied to all pikmin spawn chances on this moon.", needsRestart: true, ConfigItemAuthority.Host, ovrcfg); _overrideTypeSettingsConfig = new ConfigItem("Spawning", "Override Type Settings", defaultValue: false, "If true, the moon's Type Spawn Multipliers will replace the type-level multipliers instead of stacking with them.", needsRestart: true, ConfigItemAuthority.Host, ovrcfg); _blockedTypesConfig = new ConfigItem>("Type Restrictions", "Blocked Types", _defaultBlockedTypes, "Pikmin type names that cannot spawn on this moon.", needsRestart: true, ConfigItemAuthority.Host, ovrcfg); _allowedTypesConfig = new ConfigItem>("Type Restrictions", "Allowed Types", _defaultAllowedTypes, "If not empty, ONLY these pikmin types can spawn on this moon. Takes priority over Blocked Types.", needsRestart: true, ConfigItemAuthority.Host, ovrcfg); _typeSpawnMultipliersConfig = new ConfigItem>("Type Spawn Multipliers", "Type Multipliers", _defaultTypeSpawnMultipliers, "Per-type spawn chance multipliers on this moon. Format: TypeName:Multiplier (e.g., Red Pikmin:1.5).", needsRestart: true, ConfigItemAuthority.Host, ovrcfg); string directoryName = Path.GetDirectoryName(Path.GetDirectoryName(Paths.ConfigPath)); string relativePath = Path.GetRelativePath(directoryName, text2); LethalMin.Logger.LogInfo((object)("Moon spawn config file created for: " + moonName + " at BepInEx/" + relativePath)); } else { LethalMin.Logger.LogDebug((object)("Moon spawn config loaded in memory (no file) for: " + moonName)); } } public Dictionary GetTypeMultipliers() { return PikminType.ParseMultiplierList(TypeSpawnMultipliersList); } public bool IsTypeBlocked(string typeName) { string typeName2 = typeName; if (AllowedTypesList.Count > 0) { return !AllowedTypesList.Any((string t) => t.Trim().Equals(typeName2, StringComparison.OrdinalIgnoreCase)); } if (BlockedTypesList.Count > 0) { return BlockedTypesList.Any((string t) => t.Trim().Equals(typeName2, StringComparison.OrdinalIgnoreCase)); } return false; } } public class NoticeZoneOnlyDetect : MonoBehaviour { public PikminAI mainPikmin = null; private void Start() { if ((Object)(object)mainPikmin == (Object)null) { mainPikmin = ((Component)this).GetComponentInParent(); } } private void OnTriggerEnter(Collider other) { } private void OnTriggerStay(Collider other) { } private void OnTriggerExit(Collider other) { } } public abstract class Onion : NetworkBehaviour { [CompilerGenerated] private sealed class <>c__DisplayClass26_0 { public PikminType type; internal bool b__1(global::<>f__AnonymousType0 p) { return (Object)(object)LethalMin.GetPikminTypeByID(p.Pikmin.TypeID) == (Object)(object)type; } } [CompilerGenerated] private sealed class d__25 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public List types; public int[] quantities; public Leader leader; public Onion <>4__this; private int 5__1; private PikminType 5__2; private int 5__3; private int 5__4; private PikminAI 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__25(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; 5__5 = null; 5__4++; goto IL_017a; } <>1__state = -1; 5__1 = 0; goto IL_01a9; IL_01a9: if (5__1 < types.Count) { if (quantities[5__1] >= 0) { goto IL_0199; } 5__2 = types[5__1]; 5__3 = -quantities[5__1]; 5__4 = 0; goto IL_017a; } return false; IL_0199: 5__1++; goto IL_01a9; IL_017a: if (5__4 < 5__3) { 5__5 = leader.GetClosestPikminInSquadOfType(5__2); if ((Object)(object)5__5 != (Object)null) { LethalMin.Logger.LogInfo((object)("Setting " + 5__5.DebugID + " to the onion")); 5__5.SetPikminToLeavingClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)<>4__this).NetworkObject)); <>2__current = (object)new WaitForSeconds(0.01f); <>1__state = 1; return true; } LethalMin.Logger.LogWarning((object)("Failed to find " + 5__2.PikminName + " in " + leader.Controller.playerUsername + "'s squad")); } 5__2 = null; goto IL_0199; } 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__24 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public List typesWithdrawing; public int[] QuantityValues; public Leader Leader; public Onion <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__24(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 1) <= 1u) { try { } finally { <>m__Finally1(); } } <>1__state = -2; } private bool MoveNext() { try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>1__state = -3; <>2__current = <>4__this.SendPikminToOnion(typesWithdrawing, QuantityValues, Leader); <>1__state = 1; return true; case 1: <>1__state = -3; <>2__current = <>4__this.WithdrawPikminFromOnion(typesWithdrawing, QuantityValues, Leader); <>1__state = 2; return true; case 2: <>1__state = -3; <>m__Finally1(); return false; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; <>4__this.SpawnedPikminRoutines[((NetworkBehaviour)Leader.Controller).OwnerClientId] = null; } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__48 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Onion <>4__this; private GameObject 5__1; private List.Enumerator <>s__2; private PikminType 5__3; private int 5__4; private int 5__5; private int 5__6; private Vector3 5__7; private Quaternion 5__8; private Sprout 5__9; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__48(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 1) <= 1u) { try { } finally { <>m__Finally1(); } } 5__1 = null; <>s__2 = default(List.Enumerator); 5__3 = null; 5__9 = null; <>1__state = -2; } private bool MoveNext() { //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Expected O, but got Unknown //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = LethalMin.SproutPrefab; <>s__2 = <>4__this.TypesToSpawn.Keys.ToList().GetEnumerator(); <>1__state = -3; goto IL_0316; case 1: <>1__state = -3; goto IL_02cc; case 2: { <>1__state = -3; goto IL_02c4; } IL_0316: if (<>s__2.MoveNext()) { 5__3 = <>s__2.Current; if (<>4__this.TypesToSpawn[5__3] > 0) { 5__4 = <>4__this.TypesToSpawn[5__3]; 5__5 = 0; 5__6 = 0; goto IL_02de; } goto IL_030e; } <>m__Finally1(); <>s__2 = default(List.Enumerator); <>4__this.SpawnSproutsRoutine = null; return false; IL_02c4: 5__9 = null; goto IL_02cc; IL_030e: 5__3 = null; goto IL_0316; IL_02de: if (5__6 < 5__4) { if (PikminManager.IsTooManyPikminOnMap) { LethalMin.Logger.LogInfo((object)("Adding sprout directly into onion instead of spawning " + ((Object)((Component)<>4__this).gameObject).name + "!")); <>4__this.AddPikminClientRpc(new PikminData { TypeID = <>4__this.onionType.TypesCanHold[0].PikminTypeID, GrowthStage = 0, DebugName = "Sprout", BirthDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") }); 5__5++; if (5__5 >= 2) { 5__5 = 0; <>2__current = (object)new WaitForSeconds(0.55f); <>1__state = 1; return true; } goto IL_02cc; } 5__7 = <>4__this.GetPositionToSpawnSprout(); 5__8 = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f); 5__9 = Object.Instantiate(5__1, 5__7, Quaternion.identity).GetComponent(); 5__9.pikminType = 5__3; 5__9.IsPersistant = true; ((NetworkBehaviour)5__9).NetworkObject.Spawn(false); 5__9.InitalizeClientRpc(5__7, 5__8, 5__3.PikminTypeID); 5__5++; if (5__5 >= 2) { 5__5 = 0; <>2__current = (object)new WaitForSeconds(0.55f); <>1__state = 2; return true; } goto IL_02c4; } <>4__this.TypesToSpawn[5__3] = 0; goto IL_030e; IL_02cc: 5__6++; goto IL_02de; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__2).Dispose(); } [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 int neededSpace; public Onion <>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__28(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; LethalMin.Logger.LogInfo((object)$"Field at max capacity ({PikminManager.instance.PikminAICounter.Count}+{neededSpace}/{LethalMin.MaxPikmin.InternalValue}). Waiting for space..."); 5__1 = Time.time; break; case 1: <>1__state = -1; break; } if (Time.time - 5__1 < 10f) { if (PikminManager.instance.PikminAICounter.Count + neededSpace <= LethalMin.MaxPikmin.InternalValue) { LethalMin.Logger.LogInfo((object)"Space available, continuing with spawn"); return false; } <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; } LethalMin.Logger.LogInfo((object)"Waited 10 seconds, spawning Pikmin anyway"); 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__26 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public List types; public int[] quantities; public Leader leader; public Onion <>4__this; private int 5__1; private <>c__DisplayClass26_0 <>8__2; private int 5__3; private Listf__AnonymousType0> 5__4; private int 5__5; private int 5__6; private int 5__7; private int 5__8; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__26(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__2 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Expected O, but got Unknown //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0; goto IL_02d3; case 1: <>1__state = -1; if (<>4__this.IsFieldAtMaxCapacity()) { <>2__current = <>4__this.WaitForFieldCapacity(5__3 - 5__5); <>1__state = 2; return true; } goto IL_01f3; case 2: <>1__state = -1; goto IL_01f3; case 3: { <>1__state = -1; 5__7++; goto IL_0275; } IL_01f3: 5__7 = 0; goto IL_0275; IL_0275: if (5__7 < 5__6) { 5__8 = 5__5 + 5__7; <>4__this.SpawnPikmin(5__4[5__8].Pikmin, ((NetworkBehaviour)leader.Controller).OwnerClientId); <>2__current = (object)new WaitForSeconds(0.01f); <>1__state = 3; return true; } 5__5 += 3; goto IL_029b; IL_02c1: 5__1++; goto IL_02d3; IL_029b: if (5__5 < 5__3) { 5__6 = Mathf.Min(3, 5__3 - 5__5); <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 1; return true; } <>8__2 = null; 5__4 = null; goto IL_02c1; IL_02d3: if (5__1 < types.Count) { <>8__2 = new <>c__DisplayClass26_0(); if (quantities[5__1] > 0) { <>8__2.type = types[5__1]; 5__3 = quantities[5__1]; 5__4 = (from p in <>4__this.PikminInOnion.Select((PikminData pikmin, int index) => new { Pikmin = pikmin, Index = index }) where (Object)(object)LethalMin.GetPikminTypeByID(p.Pikmin.TypeID) == (Object)(object)<>8__2.type orderby p.Pikmin.GrowthStage descending select p).ToList(); if (5__4.Count >= 5__3) { 5__5 = 0; goto IL_029b; } LethalMin.Logger.LogWarning((object)$"Not enough {<>8__2.type.PikminName} in onion. Requested: {5__3}, Available: {5__4.Count}"); } goto IL_02c1; } 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 OnionType onionType = null; public List fusedTypes = new List(); public List PikminInOnion = new List(); public bool DontChooseRandomType = false; public bool DontDespawnOnGameEnd = false; public Dictionary TypesToExchange = new Dictionary(); public Transform PikminSpawnPos = null; public Transform SproutSpawnPos = null; public Transform ItemDropPos = null; public List ClimbLinks = null; public List AllClimbLinks = null; public Dictionary TypesToSpawn = new Dictionary(); public float SproutSpawnTimer = 1f; public Coroutine? SpawnSproutsRoutine = null; public Dictionary SpawnedPikminRoutines = new Dictionary(); private bool CreatedFusedInstance = false; private float sTimer; public virtual void Start() { if ((Object)(object)onionType == (Object)null && !DontChooseRandomType) { Random random = new Random(StartOfRound.Instance.randomMapSeed + PikminManager.instance.Onions.Count); onionType = LethalMin.RegisteredOnionTypes[random.Next(0, LethalMin.RegisteredOnionTypes.Count)]; LethalMin.Logger.LogInfo((object)("Onion " + ((Object)((Component)this).gameObject).name + " has been assigned a random type: " + ((Object)onionType).name)); } if ((Object)(object)onionType == (Object)null) { LethalMin.Logger.LogError((object)("Onion type " + ((Object)((Component)this).gameObject).name + " is some how null????????????!?!?!??!??!?!")); return; } ((Object)((Component)this).gameObject).name = onionType.TypeName ?? ""; foreach (PikminType value in LethalMin.RegisteredPikminTypes.Values) { TypesToSpawn.Add(value, 0); } PikminType[] typesCanHold = onionType.TypesCanHold; foreach (PikminType key in typesCanHold) { TypesToExchange.Add(key, 0); } TypesToExchange = TypesToExchange.OrderBy, string>((KeyValuePair x) => x.Key.PikminName).ToDictionary((KeyValuePair x) => x.Key, (KeyValuePair x) => x.Value); PikminManager.instance.AddOnion(this); } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkDespawn(); PikminManager.instance.RemoveOnion(this); if (CreatedFusedInstance) { Object.Destroy((Object)(object)onionType); } } public virtual void Update() { if (((NetworkBehaviour)this).IsServer && sTimer > 0f && SpawnSproutsRoutine == null) { sTimer -= Time.deltaTime; if (sTimer <= 0f) { SpawnSproutsClientRpc(); } } } [ClientRpc] public void InitalizeTypeClientRpc(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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2627862821u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, TypeID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2627862821u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; OnionType onionTypeByID = LethalMin.GetOnionTypeByID(TypeID); if ((Object)(object)onionTypeByID != (Object)null) { onionType = onionTypeByID; return; } LethalMin.Logger.LogError((object)$"Invalid onion type: {TypeID} when initalizeing type!"); DontChooseRandomType = false; } } [ClientRpc] public void InitalizeTypeClientRpc(int[] TypeIDs) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3400849515u, val, (RpcDelivery)0); bool flag = TypeIDs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(TypeIDs, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3400849515u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; OnionType onionType = (OnionType)(object)ScriptableObject.CreateInstance(typeof(OnionType)); onionType.OnionTypeID = -1; List list = new List(); onionType.TypeName = "FusedType: " + PikUtils.ParseListToString(TypeIDs); ((Object)onionType).name = "FusedType: " + PikUtils.ParseListToString(TypeIDs); for (int i = 0; i < TypeIDs.Length; i++) { OnionType onionTypeByID = LethalMin.GetOnionTypeByID(TypeIDs[i]); if ((Object)(object)onionTypeByID == (Object)null) { LethalMin.Logger.LogError((object)$"Invalid onion type: {TypeIDs[i]} when initalizeing type!"); DontChooseRandomType = false; return; } fusedTypes.Add(onionTypeByID); list.AddRange(onionTypeByID.TypesCanHold); } CreatedFusedInstance = true; onionType.TypesCanHold = list.ToArray(); this.onionType = onionType; } [ServerRpc(RequireOwnership = false)] public virtual void WithdrawTypesServerRpc(NetworkObjectReference onionRef, ulong playerID, int[] PikIDkeys, int[] QuantityValues) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_017f: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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(2521938402u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref onionRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, playerID); bool flag = PikIDkeys != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(PikIDkeys, default(ForPrimitives)); } bool flag2 = QuantityValues != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe(QuantityValues, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2521938402u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; Leader leaderViaID = LethalMin.GetLeaderViaID(playerID); if ((Object)(object)leaderViaID == (Object)null) { LethalMin.Logger.LogError((object)$"Unable to get player from ID: {playerID}"); ReturnErrorWhenWithdrawingClientRpc("Unable to get player from ID."); return; } NetworkObject val3 = default(NetworkObject); Onion onion = default(Onion); if (!((NetworkObjectReference)(ref onionRef)).TryGet(ref val3, (NetworkManager)null) && !((Component)val3).TryGetComponent(ref onion)) { LethalMin.Logger.LogError((object)"Unable to get onion!"); ReturnErrorWhenWithdrawingClientRpc("Unable to get onion."); return; } try { List list = new List(); foreach (int iD in PikIDkeys) { list.Add(LethalMin.GetPikminTypeByID(iD)); } LethalMin.Logger.LogInfo((object)(leaderViaID.Controller.playerUsername + ": withdrawing (" + PikUtils.ParseListToString(QuantityValues) + "), of (" + PikUtils.ParseListToString(list.Select((PikminType p) => p.PikminName).ToList()) + ")")); if (SpawnedPikminRoutines.ContainsKey(playerID) && SpawnedPikminRoutines[playerID] != null) { ((MonoBehaviour)this).StopCoroutine(SpawnedPikminRoutines[playerID]); SpawnedPikminRoutines[playerID] = null; } SpawnedPikminRoutines[playerID] = ((MonoBehaviour)this).StartCoroutine(SpawnedInterval(list, QuantityValues, leaderViaID)); } catch (Exception ex) { LethalMin.Logger.LogError((object)("Error withdrawing types: " + ex.Message)); ReturnErrorWhenWithdrawingClientRpc(ex.Message); } } [ClientRpc] public void ReturnErrorWhenWithdrawingClientRpc(string issue) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4159161247u, val, (RpcDelivery)0); bool flag = issue != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(issue, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4159161247u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { LethalMin.Logger.LogError((object)("Error from server withdrawing types: " + issue)); } } } [IteratorStateMachine(typeof(d__24))] public virtual IEnumerator SpawnedInterval(List typesWithdrawing, int[] QuantityValues, Leader Leader) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__24(0) { <>4__this = this, typesWithdrawing = typesWithdrawing, QuantityValues = QuantityValues, Leader = Leader }; } [IteratorStateMachine(typeof(d__25))] private IEnumerator SendPikminToOnion(List types, int[] quantities, Leader leader) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__25(0) { <>4__this = this, types = types, quantities = quantities, leader = leader }; } [IteratorStateMachine(typeof(d__26))] private IEnumerator WithdrawPikminFromOnion(List types, int[] quantities, Leader leader) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__26(0) { <>4__this = this, types = types, quantities = quantities, leader = leader }; } private bool IsFieldAtMaxCapacity() { return PikminManager.instance.PikminAICounter.Count >= LethalMin.MaxPikmin.InternalValue; } [IteratorStateMachine(typeof(d__28))] private IEnumerator WaitForFieldCapacity(int neededSpace) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this, neededSpace = neededSpace }; } public virtual void SpawnPikmin(PikminData data, ulong PlayerSpawning) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) PikminSpawnProps props = new PikminSpawnProps(); props.GrowthStage = data.GrowthStage; props.PlayerID = PlayerSpawning; props.SpawnSound = "ExitOnion"; props.OverrideVolume = 1f; props.OverrideDebugID = data.DebugName; props.OverrideBirthDate = data.BirthDate; PikminType pikminTypeByID = LethalMin.GetPikminTypeByID(data.TypeID); PikminSpawnPos = ((Component)this).transform; RemovePikminDataClientRpc(data); PikminManager.instance.SpawnPikminOnServer(pikminTypeByID, PikminSpawnPos.position, ((Component)this).transform.rotation, props, this); } public void ResetWithDrawAmmount() { List list = TypesToExchange.Keys.ToList(); foreach (PikminType item in list) { TypesToExchange[item] = 0; } } [ClientRpc] public void SetPikminClientRpc(PikminData[] dats) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(970720398u, val, (RpcDelivery)0); bool flag = dats != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(dats, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 970720398u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PikminInOnion.Clear(); foreach (PikminData data in dats) { AddPikmin(data); } } } [ClientRpc] public void AddPikminClientRpc(PikminData[] dats) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(468025285u, val, (RpcDelivery)0); bool flag = dats != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(dats, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 468025285u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; foreach (PikminData data in dats) { AddPikmin(data); } } } [ClientRpc] public void AddPikminClientRpc(PikminData dats) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(687857175u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref dats, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 687857175u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; AddPikmin(dats); } } } public virtual void AddPikmin(PikminAI pikmin) { PikminData pikminData = pikmin.GetPikminData(); AddPikmin(pikminData); } public virtual void AddPikmin(PikminData data) { if (PikminInOnion.Any((PikminData p) => p.DataID() == data.DataID())) { LethalMin.Logger.LogWarning((object)("PikminData (" + data.DataID() + ") is already in the Onion. Not adding again.")); } else { PikminInOnion.Add(data); } } [ClientRpc] public void RemovePikminDataClientRpc(PikminData data) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2784990147u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref data, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2784990147u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RemovePikmin(data); } } } public virtual void RemovePikmin(int Index) { if (Index >= 0 && Index < PikminInOnion.Count) { PikminData data = PikminInOnion[Index]; RemovePikmin(data); } } public virtual void RemovePikmin(PikminData data) { PikminData item = PikminInOnion.FirstOrDefault((PikminData p) => p.DebugName == data.DebugName); if (item.Equals(default(PikminData))) { LethalMin.Logger.LogWarning((object)("Pikmin " + data.DebugName + " is not in the Onion. Not removing.")); } else { PikminInOnion.Remove(item); } } public static bool IsPikminInOnion(PikminAI ai, Onion onion) { PikminAI ai2 = ai; return onion.PikminInOnion.Any((PikminData p) => p.DataID() == ai2.GetPikminData().DataID()); } public virtual void SuckItemIntoOnion(PikminItem item, PikminType targetType = null) { if ((Object)(object)item == (Object)null) { LethalMin.Logger.LogError((object)"LethalMin: null item when sucking into onion!"); } else if ((Object)(object)item.settings == (Object)null) { LethalMin.Logger.LogError((object)"LethalMin: null item settings when sucking into onion!"); } else { if (!item.settings.CanProduceSprouts) { return; } RagdollGrabbableObject ragdoll = default(RagdollGrabbableObject); if (item.settings.SproutsToSpawn <= 0) { LethalMin.Logger.LogWarning((object)("LethalMin: item " + ((Object)((Component)item).gameObject).name + " sprouts to spawn is less than or equal to 0!")); } else if (!onionType.TypesCanHold.ToList().Contains(targetType)) { LethalMin.Logger.LogWarning((object)("LethalMin: item " + ((Object)((Component)item).gameObject).name + " for " + targetType.PikminName + " cannot be sucked into onion of type " + onionType.TypeName + "!")); } else if ((Object)(object)item.ItemScript != (Object)null && ((Component)item.ItemScript).TryGetComponent(ref ragdoll)) { if (((NetworkBehaviour)this).IsServer) { SetPlayerToBeRevived(ragdoll, targetType.PikminTypeID); } } else if ((bool)LethalMin.AllowOnionToReviveMaskeds && (Object)(object)item.EnemyGrabbableObject != (Object)null && item.EnemyGrabbableObject.ai is MaskedPlayerEnemy) { if (((NetworkBehaviour)this).IsServer) { SetEnemyToBeRevived(item.EnemyGrabbableObject); } } else { int numberToAdd = item.settings.SproutsToSpawn; if ((Object)(object)item.settings.PerferedType == (Object)(object)targetType && item.settings.PerferedTypeMultipler > 0f) { numberToAdd = Mathf.RoundToInt((float)item.settings.SproutsToSpawn * item.settings.PerferedTypeMultipler); } AddSproutsToSpawn(targetType, numberToAdd); item.IncrumentDestoryCountServerRpc(); } } } public virtual void SetPlayerToBeRevived(RagdollGrabbableObject ragdoll, int TypeID = -1) { //IL_00d7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ragdoll == (Object)null) { LethalMin.Logger.LogError((object)"LethalMin: null ragdoll when setting player to be revived!"); return; } DeadBodyInfo ragdoll2 = ragdoll.ragdoll; if ((Object)(object)ragdoll2 == (Object)null) { LethalMin.Logger.LogError((object)"LethalMin: null info when setting player to be revived!"); } else if ((Object)(object)ragdoll2.playerScript == (Object)null) { LethalMin.Logger.LogError((object)"LethalMin: null player script when setting player to be revived!"); } else if (!LethalMin.AllowOnionsToRevivePlayers.InternalValue) { LethalMin.Logger.LogWarning((object)"LethalMin: Reviving players via onions is disabled!"); } else if (StartOfRound.Instance.allPlayersDead) { LethalMin.Logger.LogWarning((object)("LethalMin: all players are dead, not reviving player " + ragdoll2.playerScript.playerUsername + "!")); } else { RevivePlayerViaOnionClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)ragdoll2.playerScript).NetworkObject), TypeID); } } [ClientRpc] public void RevivePlayerViaOnionClientRpc(NetworkObjectReference PlayerRef, int TypeID = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1606738610u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PlayerRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, TypeID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1606738610u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); PlayerControllerB player = default(PlayerControllerB); if (!((NetworkObjectReference)(ref PlayerRef)).TryGet(ref val3, (NetworkManager)null)) { LethalMin.Logger.LogError((object)"LethalMin: null object when reviving player via onion!"); } else if (!((Component)val3).TryGetComponent(ref player)) { LethalMin.Logger.LogError((object)"LethalMin: null player when reviving player via onion!"); } else { RevivePlayerViaOnion(player, TypeID); } } } public virtual void RevivePlayerViaOnion(PlayerControllerB player, int TypeID = -1) { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if (!LethalMin.AllowOnionsToRevivePlayers.InternalValue) { LethalMin.Logger.LogWarning((object)"LethalMin: Reviving players via onions is disabled!"); return; } if (StartOfRound.Instance.allPlayersDead) { LethalMin.Logger.LogWarning((object)("LethalMin: all players are dead, not reviving player " + player.playerUsername + "!")); return; } LethalMin.Logger.LogMessage((object)("LethalMin: reviving player " + player.playerUsername + " via onion " + ((Object)((Component)this).gameObject).name + "!")); PikUtils.RevivePlayer(player, ((Component)this).transform.position); ((Component)player).GetComponent().SetAsLeafling(TypeID); } public virtual void SetEnemyToBeRevived(EnemyGrabbableObject enemyGrab) { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)enemyGrab == (Object)null) { LethalMin.Logger.LogError((object)"LethalMin: null enemy grab when setting enemy to be revived!"); return; } if ((Object)(object)enemyGrab.ai == (Object)null) { LethalMin.Logger.LogError((object)"LethalMin: null ai when setting enemy to be revived!"); return; } if (StartOfRound.Instance.allPlayersDead) { LethalMin.Logger.LogWarning((object)("LethalMin: all players are dead, not reviving enemy " + ((Object)((Component)enemyGrab.ai).gameObject).name + "!")); return; } LethalMin.Logger.LogMessage((object)("LethalMin: reviving enemy " + ((Object)((Component)enemyGrab.ai).gameObject).name + " via onion " + ((Object)((Component)this).gameObject).name + "!")); EnemyAI val = PikUtils.ReviveEnemy(enemyGrab.ai, ((Component)this).transform.position); MaskedPlayerPikminEnemy maskedPlayerPikminEnemy = default(MaskedPlayerPikminEnemy); if (((Component)val).TryGetComponent(ref maskedPlayerPikminEnemy)) { maskedPlayerPikminEnemy.SetAsLeafling(); } } public virtual void AddSproutsToSpawn(PikminType typeToAdd, int numberToAdd) { if (TypesToSpawn.ContainsKey(typeToAdd)) { TypesToSpawn[typeToAdd] += numberToAdd; sTimer = SproutSpawnTimer; LethalMin.Logger.LogInfo((object)$"LethalMin: {numberToAdd} sprouts of {typeToAdd.PikminName} added to onion {((Object)((Component)this).gameObject).name}!"); return; } LethalMin.Logger.LogError((object)("LethalMin: onion " + ((Object)((Component)this).gameObject).name + " does not contain type " + typeToAdd.PikminName + "!")); } [ClientRpc] public void SpawnSproutsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2342080906u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2342080906u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SpawnSprouts(); } } } public virtual void SpawnSprouts() { if (((NetworkBehaviour)this).IsServer) { SpawnSproutsRoutine = ((MonoBehaviour)this).StartCoroutine(SproutSpawnRoutine()); LethalMin.Logger.LogInfo((object)("LethalMin: Sprouts spawned from onion " + ((Object)((Component)this).gameObject).name + "!")); } } [IteratorStateMachine(typeof(d__48))] private IEnumerator SproutSpawnRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__48(0) { <>4__this = this }; } public virtual Vector3 GetPositionToSpawnSprout(float radius = 8f, float fallbackY = 0f) { //IL_0051: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_015d: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017c: 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)LethalMin.MaxPikmin.InternalValue * num % 360f; float num4 = num3 * (MathF.PI / 180f); float num5 = Mathf.Sin(num4) * radius; float num6 = Mathf.Cos(num4) * radius; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(SproutSpawnPos.position.x + num5, SproutSpawnPos.position.y, SproutSpawnPos.position.z + num6); RaycastHit val2 = default(RaycastHit); Vector3 result = default(Vector3); if (Physics.Raycast(val, Vector3.down, ref val2, float.PositiveInfinity, StartOfRound.Instance.collidersAndRoomMask)) { LethalMin.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}"); result = ((RaycastHit)(ref val2)).point; return result; } NavMeshHit val3 = default(NavMeshHit); if (NavMesh.SamplePosition(new Vector3(val.x, fallbackY, val.z), ref val3, radius, -1)) { LethalMin.Logger.LogDebug((object)$"Found ground position for sprout spawn at {((NavMeshHit)(ref val3)).position} using NavMesh sample from {val}"); result = ((NavMeshHit)(ref val3)).position; return result; } LethalMin.Logger.LogWarning((object)"Failed to find ground position for sprout spawn. Spawning at air position instead."); ((Vector3)(ref result))..ctor(val.x, 0f, val.z); return result; } public int GetTypesCanHoldNotInsideOnion() { int num = 0; foreach (PikminAI pikminAI in PikminManager.instance.PikminAIs) { if (!pikminAI.IsWildPikmin && !pikminAI.IsLeftBehind && onionType.TypesCanHold.Contains(pikminAI.pikminType)) { num++; } } return num; } public static Onion? GetOnionOfPikmin(PikminAI pikmin, bool ExcludeNonSproutProducing = false) { if ((Object)(object)pikmin.pikminType.TargetOnion != (Object)null) { foreach (Onion onion in PikminManager.instance.Onions) { if ((!ExcludeNonSproutProducing || onion.onionType.CanCreateSprouts) && ((Object)(object)onion.onionType == (Object)(object)pikmin.pikminType.TargetOnion || onion.fusedTypes.Contains(pikmin.pikminType.TargetOnion))) { if (!onion.onionType.TypesCanHold.Contains(pikmin.pikminType)) { LethalMin.Logger.LogWarning((object)("Pikmin, " + pikmin.DebugID + ", is trying to go to its target onion, but the onion " + onion.onionType.TypeName + " cannot hold this type of pikmin: " + pikmin.pikminType.PikminName)); } return onion; } } } foreach (Onion onion2 in PikminManager.instance.Onions) { if ((!ExcludeNonSproutProducing || onion2.onionType.CanCreateSprouts) && onion2.onionType.TypesCanHold.Contains(pikmin.pikminType)) { return onion2; } } return null; } 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 //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2627862821u, new RpcReceiveHandler(__rpc_handler_2627862821), "InitalizeTypeClientRpc"); ((NetworkBehaviour)this).__registerRpc(3400849515u, new RpcReceiveHandler(__rpc_handler_3400849515), "InitalizeTypeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2521938402u, new RpcReceiveHandler(__rpc_handler_2521938402), "WithdrawTypesServerRpc"); ((NetworkBehaviour)this).__registerRpc(4159161247u, new RpcReceiveHandler(__rpc_handler_4159161247), "ReturnErrorWhenWithdrawingClientRpc"); ((NetworkBehaviour)this).__registerRpc(970720398u, new RpcReceiveHandler(__rpc_handler_970720398), "SetPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(468025285u, new RpcReceiveHandler(__rpc_handler_468025285), "AddPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(687857175u, new RpcReceiveHandler(__rpc_handler_687857175), "AddPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(2784990147u, new RpcReceiveHandler(__rpc_handler_2784990147), "RemovePikminDataClientRpc"); ((NetworkBehaviour)this).__registerRpc(1606738610u, new RpcReceiveHandler(__rpc_handler_1606738610), "RevivePlayerViaOnionClientRpc"); ((NetworkBehaviour)this).__registerRpc(2342080906u, new RpcReceiveHandler(__rpc_handler_2342080906), "SpawnSproutsClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2627862821(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 typeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref typeID); target.__rpc_exec_stage = (__RpcExecStage)1; ((Onion)(object)target).InitalizeTypeClientRpc(typeID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3400849515(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); int[] typeIDs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref typeIDs, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Onion)(object)target).InitalizeTypeClientRpc(typeIDs); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2521938402(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_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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_00cb: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference onionRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref onionRef, default(ForNetworkSerializable)); ulong playerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); int[] pikIDkeys = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikIDkeys, default(ForPrimitives)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); int[] quantityValues = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref quantityValues, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Onion)(object)target).WithdrawTypesServerRpc(onionRef, playerID, pikIDkeys, quantityValues); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4159161247(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string issue = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref issue, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Onion)(object)target).ReturnErrorWhenWithdrawingClientRpc(issue); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_970720398(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); PikminData[] pikminClientRpc = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikminClientRpc, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Onion)(object)target).SetPikminClientRpc(pikminClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_468025285(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); PikminData[] dats = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref dats, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Onion)(object)target).AddPikminClientRpc(dats); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_687857175(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) { PikminData dats = default(PikminData); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dats, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Onion)(object)target).AddPikminClientRpc(dats); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2784990147(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) { PikminData data = default(PikminData); ((FastBufferReader)(ref reader)).ReadValueSafe(ref data, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Onion)(object)target).RemovePikminDataClientRpc(data); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1606738610(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference playerRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerRef, default(ForNetworkSerializable)); int typeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref typeID); target.__rpc_exec_stage = (__RpcExecStage)1; ((Onion)(object)target).RevivePlayerViaOnionClientRpc(playerRef, typeID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2342080906(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; ((Onion)(object)target).SpawnSproutsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Onion"; } } public class OnionItem : GrabbableObject, IGenerationSwitchable { [CompilerGenerated] private sealed class d__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public OnionItem <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(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_0049: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_008f: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(<>4__this.onionType.ActivationTime); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy != (Object)null) { ((GrabbableObject)<>4__this).playerHeldBy.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3)); } ((GrabbableObject)<>4__this).grabbable = false; <>4__this.IsDoingCollectAnim = true; ((GrabbableObject)<>4__this).grabbableToEnemies = false; <>4__this.anim.Play("Collect"); <>2__current = (object)new WaitForSeconds(4f); <>1__state = 2; return true; case 2: <>1__state = -1; if (!PikminManager.instance.OnionsCollected.Contains(<>4__this.onionType.OnionTypeID)) { PikminManager.instance.OnionsCollected.Add(<>4__this.onionType.OnionTypeID); } if (((NetworkBehaviour)<>4__this).IsServer) { PikminManager.instance.SpawnOnionOnServer(<>4__this.onionType.OnionTypeID); ((NetworkBehaviour)<>4__this).NetworkObject.Despawn(true); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public OnionType onionType = null; public bool DontChooseRandomType = false; public Transform ModelContainer = null; public Animator anim = null; public bool IsDoingCollectAnim = false; public Renderer triangleRender = null; private float DistanceCheckTimer = 0f; private ScanNodeProperties sNode = null; private bool StartCalled = false; public void Awake() { sNode = ((Component)this).GetComponentInChildren(); } public override void Start() { //IL_00ec: Unknown result type (might be due to invalid IL or missing references) if (StartCalled) { LethalMin.Logger.LogWarning((object)("OnionItem " + ((Object)((Component)this).gameObject).name + " has already been started!")); return; } StartCalled = true; ((GrabbableObject)this).Start(); if ((Object)(object)onionType == (Object)null && !DontChooseRandomType) { onionType = GetRandomOnionType(); LethalMin.Logger.LogInfo((object)("Onion Item " + ((Object)((Component)this).gameObject).name + " has been assigned a random type: " + ((Object)onionType).name)); } if ((Object)(object)onionType == (Object)null) { LethalMin.Logger.LogError((object)("Onion type " + ((Object)((Component)this).gameObject).name + " is some how null????????????!?!?!??!??!?!")); return; } triangleRender.material.color = onionType.OnionColor; if ((Object)(object)onionType.OnionItemOverrideModelPrefab == (Object)null) { LethalMin.Logger.LogInfo((object)("Onion " + onionType.TypeName + " does not have an override model, using default model instead.")); GameObject val = Object.Instantiate(LethalMin.DefultOnionItemModel, ModelContainer); } else { LethalMin.Logger.LogInfo((object)("Onion " + onionType.TypeName + " has an override model, using it instead.")); GameObject val2 = Object.Instantiate(onionType.OnionItemOverrideModelPrefab, ModelContainer); } GenerationManager.Instance.Register(this); SwitchGeneration(PikUtils.ConvertCfgGenerationToPikminGeneration(LethalMin.OnionItemModelGeneration.InternalValue)); if (((NetworkBehaviour)this).IsServer && PikminManager.instance.OnionsCollected.Contains(onionType.OnionTypeID)) { LethalMin.Logger.LogFatal((object)("Onion " + onionType.TypeName + " was already collected, despawning it!")); ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } public override void OnDestroy() { ((GrabbableObject)this).OnDestroy(); GenerationManager.Instance.Unregister(this); } public void SwitchGeneration(PikminGeneration generation) { if (LethalMin.RandomizeGenerationModels.InternalValue) { generation = (PikminGeneration)Random.Range(0, Enum.GetValues(typeof(PikminGeneration)).Length); } OnionItemModelRefernces modelRefernces = ((Component)this).GetComponentInChildren(); bool flag = false; OnionItemModelGeneration[] generations = modelRefernces.Generations; foreach (OnionItemModelGeneration onionItemModelGeneration in generations) { if (!PikChecks.IsGenerationValid(onionItemModelGeneration)) { LethalMin.Logger.LogError((object)$"Generation {onionItemModelGeneration.Generation} of type {onionType.TypeName} is invaild for an onion item!"); continue; } onionItemModelGeneration.Model.SetActive(onionItemModelGeneration.Generation == generation); if (onionItemModelGeneration.Generation == generation) { applyGeneration(onionItemModelGeneration); flag = true; } } if (!flag) { applyDefaultGeneration(); LethalMin.Logger.LogWarning((object)$"Failed to find a valid generation for {onionType.TypeName}! Generation: {generation}"); } void applyDefaultGeneration() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) modelRefernces.Model.SetActive(true); anim = modelRefernces.Animator; if ((Object)(object)modelRefernces.MainRenderer != (Object)null) { modelRefernces.MainRenderer.material.color = onionType.OnionColor; } } void applyGeneration(OnionItemModelGeneration gen) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) anim = gen.Animator; if ((Object)(object)gen.MainRenderer != (Object)null) { gen.MainRenderer.material.color = onionType.OnionColor; } } } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); } public override void Update() { ((GrabbableObject)this).Update(); ((Component)sNode).gameObject.SetActive((bool)LethalMin.MakeItemsScanable && !base.isHeld && !base.isHeldByEnemy); sNode.headerText = onionType.TypeName; if (((NetworkBehaviour)this).IsOwner && onionType.ActivatesWhenBroughtOutside && !IsDoingCollectAnim && (Object)(object)base.playerHeldBy != (Object)null && !base.playerHeldBy.isInsideFactory) { IsDoingCollectAnim = true; StartCollectingSequnceServerRpc(); } if (((NetworkBehaviour)this).IsOwner && base.isInShipRoom && !IsDoingCollectAnim) { IsDoingCollectAnim = true; StartCollectingSequnceServerRpc(); } if (((NetworkBehaviour)this).IsOwner && onionType.ActivatesWhenPlayerIsNear && !IsDoingCollectAnim) { DistanceCheckTimer -= Time.deltaTime; if (DistanceCheckTimer <= 0f) { DistanceCheckTimer = 1f; CheckForPlayers(); } } } public void CheckForPlayers() { //IL_002a: 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) PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!((Object)(object)val == (Object)null) && Vector3.Distance(((Component)val).transform.position, ((Component)this).transform.position) <= onionType.ActivationDistance) { IsDoingCollectAnim = true; StartCollectingSequnceServerRpc(); break; } } } [ClientRpc] public void InitalizeTypeClientRpc(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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(533722082u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, TypeID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 533722082u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OnionType onionTypeByID = LethalMin.GetOnionTypeByID(TypeID); if ((Object)(object)onionTypeByID != (Object)null) { onionType = onionTypeByID; return; } LethalMin.Logger.LogError((object)$"Invalid onion type: {TypeID} when initalizeing type!"); DontChooseRandomType = false; } } public OnionType GetRandomOnionType() { Random random = new Random(StartOfRound.Instance.randomMapSeed + PikminManager.instance.Onions.Count); List list = new List(); foreach (OnionType value in LethalMin.RegisteredOnionTypes.Values) { if ((!value.SpawnsIndoors && !value.SpawnsOutdoors) || (LethalMin.RandomizeByDay.InternalValue && StartOfRound.Instance.gameStats.daysSpent <= value.SpawnAfterDay)) { continue; } List list2 = Object.FindObjectsOfType().ToList(); bool flag = false; foreach (OnionItem item in list2) { if ((Object)(object)item.onionType == (Object)(object)value) { flag = true; } } Onion[] array = Object.FindObjectsOfType(); foreach (Onion onion in array) { if ((Object)(object)onion.onionType != (Object)null) { if ((Object)(object)onion.onionType == (Object)(object)value) { flag = true; } if (onion.fusedTypes.Contains(value)) { flag = true; } } } if (!flag) { list.Add(value); } } if (list.Count == 0) { LethalMin.Logger.LogError((object)("No valid onion types found for " + ((Object)((Component)this).gameObject).name + ", falling back to a random type: " + onionType.TypeName)); return LethalMin.RegisteredOnionTypes[random.Next(0, LethalMin.RegisteredOnionTypes.Count)]; } return list[random.Next(0, list.Count)]; } [ServerRpc] public void StartCollectingSequnceServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2382958399u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2382958399u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartCollectingSequnceClientRpc(); } } [ClientRpc] public void StartCollectingSequnceClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(225936018u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 225936018u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(DoCollectAnim()); } } } [IteratorStateMachine(typeof(d__20))] private IEnumerator DoCollectAnim() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { <>4__this = this }; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(533722082u, new RpcReceiveHandler(__rpc_handler_533722082), "InitalizeTypeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2382958399u, new RpcReceiveHandler(__rpc_handler_2382958399), "StartCollectingSequnceServerRpc"); ((NetworkBehaviour)this).__registerRpc(225936018u, new RpcReceiveHandler(__rpc_handler_225936018), "StartCollectingSequnceClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_533722082(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 typeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref typeID); target.__rpc_exec_stage = (__RpcExecStage)1; ((OnionItem)(object)target).InitalizeTypeClientRpc(typeID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2382958399(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((OnionItem)(object)target).StartCollectingSequnceServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_225936018(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; ((OnionItem)(object)target).StartCollectingSequnceClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "OnionItem"; } } public class OnionSoundPack : MonoBehaviour { public AudioClip MenuOpenSound = null; public AudioClip MenuCloseSound = null; public AudioClip MenuDenyUpSound = null; public AudioClip MenuDenyDownSound = null; public AudioClip MenuUpSound = null; public AudioClip MenuDownSound = null; public AudioClip MenuConfirmSound = null; public AudioClip FlyingInSound = null; public AudioClip LegsPopOutSound = null; public AudioClip LandSound = null; public AudioClip LegsPopInSound = null; public AudioClip FlyingOutSound = null; public AudioClip VacItemSound = null; public AudioClip SuckInItemSound = null; public AudioClip SproutSound = null; public AudioClip PlayerReviveSound = null; } public class OwnerNetworkAnimator : NetworkAnimator { public override bool OnIsServerAuthoritative() { return false; } protected override void __initializeVariables() { ((NetworkAnimator)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkAnimator)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "OwnerNetworkAnimator"; } } public class P2FusionProperties : BaseOnionFusionProperties { public override void ApplyFusionProperties(OnionType onionType = null, List fusedTypes = null) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) base.ApplyFusionProperties(onionType, fusedTypes); if (fusedTypes.Count != 0) { MainOnionRenderer.material.mainTexture = (Texture)(object)GradientTextureGenerator.GenerateRadialGradient(fusedTypes.Select((OnionType ot) => ot.OnionColor).ToList(), 0.1f); } else { MainOnionRenderer.material.color = onionType.OnionColor; } } } public class P3FusionProperties : BaseOnionFusionProperties { public SkinnedMeshRenderer[] SMRs = (SkinnedMeshRenderer[])(object)new SkinnedMeshRenderer[0]; public Texture[] FusionTextures = (Texture[])(object)new Texture[0]; public SkinnedMeshRenderer SymbolRenderer = null; public override void ApplyFusionProperties(OnionType onionType = null, List fusedTypes = null) { //IL_0098: 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) base.ApplyFusionProperties(onionType, fusedTypes); int num = Mathf.Clamp(fusedTypes.Count - 1, 0, FusionTextures.Length - 1); ((Renderer)SymbolRenderer).material.mainTexture = FusionTextures[num]; Texture2D val = null; val = ((fusedTypes.Count <= 0) ? GradientTextureGenerator.GenerateHorizontalGradient(new List { onionType.TypesCanHold[0].PikminPrimaryColor, onionType.TypesCanHold[0].PikminSecondaryColor }, 1f) : GradientTextureGenerator.GenerateHorizontalGradient(fusedTypes.Select((OnionType ot) => ot.OnionColor).ToList(), 1f)); ((Texture)val).wrapMode = (TextureWrapMode)2; MainOnionRenderer.material.SetTexture("_BaseColorMap", (Texture)(object)val); OnionFuseRules onionFuseRules = null; foreach (OnionFuseRules value in LethalMin.RegisteredFuseRules.Values) { int num2 = 0; foreach (OnionType fusedType in fusedTypes) { if (value.OnionsToFuse.ToList().Contains(fusedType)) { num2++; } } if (num2 == fusedTypes.Count) { onionFuseRules = value; LethalMin.Logger.LogInfo((object)$"Found a possible fuse rule: {value}"); break; } } if ((Object)(object)onionFuseRules == (Object)null) { LethalMin.Logger.LogError((object)"No possible fuse rules found"); return; } SkinnedMeshRenderer[] sMRs = SMRs; foreach (SkinnedMeshRenderer val2 in sMRs) { if ((Object)(object)val2 == (Object)null) { LethalMin.Logger.LogError((object)"SkinnedMeshRenderer is null"); continue; } try { float num3 = (float)fusedTypes.Count / (float)onionFuseRules.OnionsToFuse.Length * 150f; val2.SetBlendShapeWeight(0, num3); LethalMin.Logger.LogInfo((object)$"Set blend shape weight on {((Object)((Component)val2).gameObject).name} to {num3}"); } catch (Exception arg) { LethalMin.Logger.LogError((object)$"Error setting blend shape weight on {((Object)((Component)val2).gameObject).name}: {arg}"); } } } } public class P4FusionProperties : BaseOnionFusionProperties { public Mesh[] FusionMeshes = (Mesh[])(object)new Mesh[0]; public override void ApplyFusionProperties(OnionType onionType = null, List fusedTypes = null) { //IL_00c8: Unknown result type (might be due to invalid IL or missing references) base.ApplyFusionProperties(onionType, fusedTypes); int num = Mathf.Clamp(fusedTypes.Count - 1, 0, FusionMeshes.Length - 1); Mesh sharedMesh = FusionMeshes[num]; Renderer mainOnionRenderer = MainOnionRenderer; SkinnedMeshRenderer val = (SkinnedMeshRenderer)(object)((mainOnionRenderer is SkinnedMeshRenderer) ? mainOnionRenderer : null); if ((Object)(object)val == (Object)null) { LethalMin.Logger.LogError((object)"MainOnionRenderer is not a SkinnedMeshRenderer!"); return; } val.sharedMesh = sharedMesh; if (fusedTypes.Count != 0) { ((Renderer)val).material.SetTexture("_GraidentOverlay", (Texture)(object)GradientTextureGenerator.Generate90DegreeGradient(fusedTypes.Select((OnionType ot) => ot.OnionColor).ToList(), 0.1f)); } else { ((Renderer)val).material.SetColor("_MainColor", onionType.OnionColor); } } } public class PHeyFusionProperties : BaseOnionFusionProperties { public override void ApplyFusionProperties(OnionType onionType = null, List fusedTypes = null) { //IL_0066: 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) base.ApplyFusionProperties(onionType, fusedTypes); Texture2D val = null; val = ((fusedTypes.Count <= 0) ? GradientTextureGenerator.GenerateHorizontalGradient(new List { onionType.TypesCanHold[0].PikminPrimaryColor, onionType.TypesCanHold[0].PikminSecondaryColor }, 1f) : GradientTextureGenerator.GenerateHorizontalGradient(fusedTypes.Select((OnionType ot) => ot.OnionColor).ToList(), 1f)); ((Texture)val).filterMode = (FilterMode)0; ((Texture)val).wrapMode = (TextureWrapMode)2; MainOnionRenderer.material.SetTexture("_BaseColorMap", (Texture)(object)val); } } public class PikCaller : NetworkBehaviour { [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Leader leaderCalled; public PikCaller <>4__this; private HashSet.Enumerator <>s__1; private PikminAI 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <>s__1 = default(HashSet.Enumerator); 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>s__1 = PikminManager.instance.PikminAIs.GetEnumerator(); <>1__state = -3; break; case 1: <>1__state = -3; 5__2 = null; break; } while (<>s__1.MoveNext()) { 5__2 = <>s__1.Current; if ((Object)(object)5__2.leader != (Object)null || 5__2.IsWildPikmin) { continue; } 5__2.CallResetMethods(); 5__2.ChangeIntent(Pintent.Idle); 5__2.SetCurrentTask("ReturnToShip"); ((EnemyAI)5__2).SwitchToBehaviourStateOnLocalClient(2); <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; } <>m__Finally1(); <>s__1 = default(HashSet.Enumerator); return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__1).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public string OverrideCooldownText = "Ready"; public InteractTrigger button = null; public AudioSource CallSound = null; public TMP_Text CooldownText = null; public TMP_Text VersionText = null; public GameObject? WhistleInstance; public Animator FXAnimator = null; public UnlockableItemDef def = null; public float Cooldown; private string formerInteractTip = ""; public bool SpedUp => StartOfRound.Instance.inShipPhase; private void Start() { formerInteractTip = button.hoverTip; if (LethalMin.IsNightlyBuild) { VersionText.text = "(V1.1.0) (NIGHTLY)"; } else { VersionText.text = "(V1.1.0)"; } } public void OnInteract(PlayerControllerB controller) { if (!(Cooldown > 0f) && !StartOfRound.Instance.inShipPhase) { OverrideCooldownText = "Syncing..."; if (!((NetworkBehaviour)this).IsServer) { CallPikminToBase(LethalMin.GetLeaderViaID(((NetworkBehaviour)controller).OwnerClientId)); CallPikminToBaseServerRpc(((NetworkBehaviour)StartOfRound.Instance.localPlayerController).OwnerClientId); } else { CallPikminToBase(LethalMin.GetLeaderViaID(((NetworkBehaviour)controller).OwnerClientId)); CallPikminToBaseClientRpc(((NetworkBehaviour)StartOfRound.Instance.localPlayerController).OwnerClientId); } } } [ServerRpc(RequireOwnership = false)] public void CallPikminToBaseServerRpc(ulong clientId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(979217159u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 979217159u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; OverrideCooldownText = "Server Syncing..."; CallPikminToBaseClientRpc(clientId); } } } [ClientRpc] public void CallPikminToBaseClientRpc(ulong clientId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(608864688u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 608864688u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (clientId != ((NetworkBehaviour)StartOfRound.Instance.localPlayerController).OwnerClientId) { OverrideCooldownText = "Client Syncing..."; CallPikminToBase(LethalMin.GetLeaderViaID(clientId)); } } } public void CallPikminToBase(Leader? leaderCalled) { if (!(Cooldown > 0f)) { CallSound.Play(); FXAnimator.SetTrigger("doburst"); Cooldown = ((LethalMin.PikminSignalCooldownCheat == -1f) ? 300f : LethalMin.PikminSignalCooldownCheat); OverrideCooldownText = ""; button.hoverTip = "On Cooldown"; ((MonoBehaviour)this).StartCoroutine(CallPikminToBaseCoroutine(leaderCalled)); } } [IteratorStateMachine(typeof(d__17))] private IEnumerator CallPikminToBaseCoroutine(Leader? leaderCalled) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this, leaderCalled = leaderCalled }; } private void Update() { //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) if (Cooldown > 0f) { if (SpedUp) { Cooldown -= Time.deltaTime * 100f; } else { Cooldown -= Time.deltaTime; } } else if (string.IsNullOrEmpty(OverrideCooldownText)) { OverrideCooldownText = "Ready"; button.hoverTip = formerInteractTip; } if ((Object)(object)CooldownText != (Object)null) { if (string.IsNullOrEmpty(OverrideCooldownText)) { CooldownText.text = ((Cooldown > 0f) ? $"{Mathf.FloorToInt(Cooldown / 60f):00}:{Mathf.FloorToInt(Cooldown % 60f):00}" : ""); } else { CooldownText.text = OverrideCooldownText; } } if ((bool)LethalMin.GiantWhistleMode) { if ((Object)(object)WhistleInstance == (Object)null) { GameObject val = LethalMin.assetBundle.LoadAsset("Assets/LethalMin/Whistle/FuniShipWhile.prefab"); WhistleInstance = Object.Instantiate(val, ((Component)this).transform.position, Quaternion.identity); WhistleInstance.transform.SetParent(((Component)StartOfRound.Instance.shipBounds).transform.parent); WhistleInstance.transform.localPosition = new Vector3(-0.4155f, 5.9281f, -7.174f); WhistleInstance.transform.rotation = Quaternion.Euler(22f, 270f, 0f); WhistleInstance.transform.localScale = new Vector3(3f, 3f, 3f); } WhistleInstance.SetActive(!def.unlockable.inStorage); } else if ((Object)(object)WhistleInstance != (Object)null) { WhistleInstance.SetActive(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 ((NetworkBehaviour)this).__registerRpc(979217159u, new RpcReceiveHandler(__rpc_handler_979217159), "CallPikminToBaseServerRpc"); ((NetworkBehaviour)this).__registerRpc(608864688u, new RpcReceiveHandler(__rpc_handler_608864688), "CallPikminToBaseClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_979217159(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong clientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikCaller)(object)target).CallPikminToBaseServerRpc(clientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_608864688(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong clientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikCaller)(object)target).CallPikminToBaseClientRpc(clientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PikCaller"; } } [CreateAssetMenu(fileName = "CustomPiklopediaEntry", menuName = "Pikmin/CustomPiklopediaEntry", order = 0)] public class PiklopediaEntry : ScriptableObject { [Tooltip("The Piklopedia entry name that will show on the Piklopedia page")] public string EntryName = ""; [Tooltip("The terminal node for the piklopedia")] public TerminalNode PiklopediaNode = null; [Tooltip("The terminal keyword for the piklopedia (can be null)")] public TerminalKeyword? PiklopediaKeyword = null; [HideInInspector] public int PiklopediaID = -1; } public enum Pintent { Idle, RunTowards, StandingAttack, Attack, Waiting, Carry, LatchedOn, Leave, BeingHeld, Thrown, Dead, Knockedback, MoveableStuck, Panicing, Stuck, Fall } public enum PfollowMode { New, LegacyBehind, LegacyFollow } public class PikminAI : EnemyAI, IGenerationSwitchable { [CompilerGenerated] private sealed class d__232 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PikminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__232(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; if (((NetworkBehaviour)<>4__this).IsOwner) { <>4__this.HitCurLatchTriggerOnLocalClient(); <>4__this.HitCurLatchTriggerServerRpc(); } <>4__this.PlayAudioOnLocalClient(PikminSoundPackSounds.HitSFX, PlayOnVoice: false); break; } if (<>4__this.CurrentIntention == Pintent.Attack && (Object)(object)<>4__this.CurrentLatchTrigger != (Object)null) { <>4__this.PlayAudioOnLocalClient(PikminSoundPackSounds.Attack); <>2__current = (object)new WaitForSeconds(<>4__this.pikminType.AttackRate); <>1__state = 1; return true; } <>4__this.animController.ResetToIdleAnim(); <>4__this.attackRoutine = null; 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__294 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float val; public PikminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__294(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((EnemyAI)<>4__this).agent.updateRotation = false; ((EnemyAI)<>4__this).agent.isStopped = true; <>2__current = (object)new WaitForSeconds(val); <>1__state = 1; return true; case 1: <>1__state = -1; ((EnemyAI)<>4__this).agent.updateRotation = true; ((EnemyAI)<>4__this).agent.isStopped = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__299 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool OverrideVol; public PikminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__299(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => <>4__this.attackRoutine == null)); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.DoYay(OverrideVol, RecursiveCall: true); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__300 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool OverrideVol; public PikminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__300(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => !<>4__this.IsAirborn)); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; <>4__this.DoYay(OverrideVol, RecursiveCall: true); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__208 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float timer; public PikminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__208(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.Pcollider.enabled = false; <>2__current = (object)new WaitForSeconds(timer); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.Pcollider.enabled = true; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__145 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float time; public PikminAI <>4__this; private float 5__1; private float 5__2; private float 5__3; private float 5__4; private PikminItem 5__5; private PikminEnemy 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__145(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__5 = null; 5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Expected O, but got Unknown //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: 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 = ((EnemyAI)<>4__this).agent.stoppingDistance; ((EnemyAI)<>4__this).agent.stoppingDistance = 0f; ((EnemyAI)<>4__this).agent.obstacleAvoidanceType = (ObstacleAvoidanceType)0; 5__2 = 0f; goto IL_00c1; case 1: <>1__state = -1; goto IL_00c1; case 2: { <>1__state = -1; break; } IL_00c1: if (5__2 < 0.15f) { 5__2 += Time.deltaTime; ((EnemyAI)<>4__this).agent.speed = 0f; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; } 5__3 = 0f; 5__4 = 0f; break; } if (5__3 < time) { ((EnemyAI)<>4__this).agent.speed = <>4__this.pikminType.GetSpeed(<>4__this.CurrentGrowthStage, <>4__this.ShouldRun) * 3.5f; 5__3 += Time.deltaTime; 5__4 += Time.deltaTime; if (<>4__this.OverrideFollowPosition.HasValue) { if (5__4 >= 0.2f + Random.Range(0.01f, 0.05f)) { if (!Object.op_Implicit((Object)(object)<>4__this.CurrentLatchTrigger)) { 5__5 = <>4__this.GetClosestPikminItem(); if ((Object)(object)5__5 != (Object)null) { LethalMin.Logger.LogInfo((object)(<>4__this.DebugID + ": Found item (Charge): " + ((Object)5__5).name)); <>4__this.TargetItem = 5__5; <>4__this.TargetItemPoint = 5__5.GetNearestGrabPosition(((Component)<>4__this).transform.position); if ((Object)(object)<>4__this.TargetItem != (Object)null && (Object)(object)<>4__this.TargetItemPoint != (Object)null) { <>4__this.FindItemViaChargeServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)<>4__this.TargetItem).NetworkObject), <>4__this.TargetItem.GrabToPositions.IndexOf(<>4__this.TargetItemPoint)); <>4__this.PathToPosition(((Component)<>4__this.TargetItem).transform.position); <>4__this.OverrideFollowPosition = null; <>4__this.chargeRoutine = null; return false; } <>4__this.TargetItem = null; <>4__this.TargetItemPoint = null; } 5__5 = null; } if (!Object.op_Implicit((Object)(object)<>4__this.CurrentLatchTrigger)) { 5__6 = <>4__this.GetClosestEnemy(); if ((Object)(object)5__6 != (Object)null) { LethalMin.Logger.LogInfo((object)(<>4__this.DebugID + ": Found enemy (Charge): " + ((Object)5__6).name)); <>4__this.TargetEnemy = 5__6; if (Object.op_Implicit((Object)(object)<>4__this.TargetEnemy)) { <>4__this.FindEnemyViaChargeServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)<>4__this.TargetEnemy).NetworkObject)); <>4__this.PathToPosition(((Component)<>4__this.TargetEnemy).transform.position); <>4__this.OverrideFollowPosition = null; <>4__this.chargeRoutine = null; return false; } <>4__this.TargetEnemy = null; } 5__6 = null; } 5__4 = 0f; } <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 2; return true; } } ((EnemyAI)<>4__this).agent.stoppingDistance = 5__1; ((EnemyAI)<>4__this).agent.speed = <>4__this.pikminType.GetSpeed(<>4__this.CurrentGrowthStage, <>4__this.ShouldRun); ((EnemyAI)<>4__this).agent.obstacleAvoidanceType = (ObstacleAvoidanceType)1; LethalMin.Logger.LogInfo((object)$"{<>4__this.DebugID}: Charge finished after {5__3} seconds. Stopping charge."); <>4__this.OverrideFollowPosition = null; <>4__this.chargeRoutine = null; 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__227 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PikminEnemy Penemy; public PikminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__227(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_0115: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.PlayAnimation(<>4__this.animController.AnimPack.EditorStandingAttackAnim); <>2__current = (object)new WaitForSeconds(<>4__this.pikminType.AttackRate / 2f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)Penemy == (Object)null) { LethalMin.Logger.LogWarning((object)(<>4__this.DebugID + ": Attempted to hit a null enemy")); return false; } if (((NetworkBehaviour)<>4__this).IsOwner && (!<>4__this.IsWildPikmin || (<>4__this.IsWildPikmin && (bool)LethalMin.WildPikminAttackDamage))) { Penemy.HitEnemyServerRpc(<>4__this.pikminType.GetAttackStrength(<>4__this.CurrentGrowthStage), NetworkObjectReference.op_Implicit(((NetworkBehaviour)<>4__this).NetworkObject)); } <>4__this.PlayAudioOnLocalClient(PikminSoundPackSounds.HitSFX, PlayOnVoice: false); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__295 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string animationName; public float delay; public PikminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__295(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.animController.PlayAnimation(animationName, 0f); 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__291 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string soundName; public float delay; public PikminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__291(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.PlayAudioOnLocalClient(soundName); 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__221 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PikminSoundPackSounds sound; public (int, int) interval; public PikminAI <>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__221(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; <>4__this.PlayAudioOnLocalClient(sound); break; } 5__1 = <>4__this.enemyRandom.Next(interval.Item1, interval.Item2) / 10; <>2__current = (object)new WaitForSeconds(5__1); <>1__state = 1; 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(); } } [CompilerGenerated] private sealed class d__258 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public PikminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__258(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; delay += (float)<>4__this.enemyRandom.Next(1, 10) / 10f; LethalMin.Logger.LogDebug((object)$"{<>4__this.DebugID}: Spawning Ghost after, {delay} seconds"); <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.SpawnGhost(); 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 const int IDLE = 0; public const int FOLLOW = 1; public const int WORK = 2; public const int PANIC = 3; public const int LEAVING = 4; public static int PikminSoundID = 0; [Header("Pikmin AI")] public PikminType pikminType = null; public PikminNetworkTransfrom transform2 = null; public PikminSoundPack CurrentSoundPack = null; public PikminAnimatorController animController = null; public Onion TargetOnion = null; public PikminManager Pmanager = null; public Pintent CurrentIntention; public Pintent PreviousIntention; public PikminTask? CurrentTask = null; public ProjectileProperties ProjectileProps; public Leader? leader; public Leader? previousLeader; public PikminSpawnProps SpawnProps = default(PikminSpawnProps); public bool HasBeenInitalized = false; public bool IsWildPikmin = true; public string DebugID = ""; public Rigidbody rb = null; public Collider Pcollider = null; public Transform HoldPosition = null; public AudioSource DrowningAudioSource = null; public int CurrentGrowthStage = 0; public int MaxGrowthStage = 2; public Transform SproutTop = null; public PikminItem? TargetItem = null; public BoolValue TargetItemPoint = null; public int CurrentCarryStrength = 1; public Transform? AgentLookTarget = null; public Random enemyRandom = null; public bool IsInShip; public PikminLatchTrigger? CurrentLatchTrigger = null; public PikminEnemy? TargetEnemy = null; public Leader? LeaderWhistling; public PikminNoticeZone? LeaderWhistlingZone; public List TempObjects = new List(); public Transform? DeathSnapToPos = null; public Coroutine attackRoutine = null; public ITrajectoryModifier? trajectoryModifier = null; public bool Invincible = false; public float OverrideDelay = -1f; public string CurPanicAnim = ""; public bool IsLeftBehind; public bool IsGoingToOnion; public bool DontAddToOnion = false; public bool ForceSproutGlow = false; public bool Laying = false; public bool IsGrabbedByEnemy = false; public bool CanGetBackUp = false; public float LeaderAssesmentDelay = 0f; public float LandBuffer = 0.5f; public OverridePikminPosition? OverrideIdlePosition = null; public OverridePikminPosition? OverrideFollowPosition = null; private readonly Dictionary _externalSnapPoints = new Dictionary(); public Vector3? SpecialIdlePosition = null; public Quaternion? SpecialIdleRotation = null; public Vector3 StoredSpawnPosition = Vector3.zero; [HideInInspector] public bool UnselectableChanged = false; public Coroutine? chargeRoutine = null; [SerializeField] protected Transform modelContainer = null; private static float maxAudioClusterDistance = 2.5f; private static int maxAudioClusterPikmin = 10; private bool _unselectable; private Coroutine panicSoundRoutine = null; private string BirthDate = ""; private int randomSeed = 0; private bool IsOnShip; private PikminLinkAnimation CurrentLinkAnim = null; private PikminVehicleController? CurrentVehicle = null; private Transform? CurrentVehiclePoint = null; private List DeathTimerAffecters = new List(); private float DeathTimer = 1f; private float grabDeathTimer = -1f; private int CurrentCollisionMode = 1; private Vector3 PanicPosition; private float PanicInterval = 10f; private bool CanBeWhistledOutOfPanic; private float timeSinceLastVehicleCheck = 0f; private bool IsDoingOnionAnimation; private string CurrentPlayingKey = ""; private bool AddToRaisedOnInitAssign = false; private float GrowTimer = 100f; private float StuckEscapeTimer = 0f; private Vector3 LatchTriggerOffset; private Quaternion RandomDeathRotaion; private PikminScanNodeProperties scanNodeProperties = null; private GameObject LatchRefPoint = null; private Vector3 LeavingPos = Vector3.zero; private bool playLinkedAnimReversed = false; private int targetOnionLinkIndex; private float timeOffNavMesh = 4f; private float timeIdel = 0f; private float tmeFalling = 0f; private float timeLaying = 0f; private bool hitBeforeKillWasCalled = false; private float deadStateFailsafeTimer = 0f; private bool wasInvisCheatOn; private int destoryCounter = 0; private bool HasNoGrowthStages; private Dictionary> growthObjects = new Dictionary>(); private float IdleAnimTimer = 0f; private List ragdollBones = new List(); private List ragdollComponents = new List(); private List<(Transform bone, Vector3 pos, Quaternion rot, Vector3 scale, int layer)> ragdollBonePoses = new List<(Transform, Vector3, Quaternion, Vector3, int)>(); private bool isRagdolled = false; public PikminSnapPoint? CurrentSnapPoint { get; private set; } public bool IsAirborn => CurrentIntention == Pintent.Thrown || CurrentIntention == Pintent.Knockedback || CurrentIntention == Pintent.Fall; public bool IsDeadOrDying => CurrentIntention == Pintent.Dead || base.isEnemyDead; public bool ShouldRun => CurrentIntention == Pintent.Attack || CurrentIntention == Pintent.Panicing || CurrentIntention == Pintent.RunTowards; public bool Unselectable { get { return _unselectable; } set { if (_unselectable != value) { _unselectable = value; UnselectableChanged = true; } } } private bool friednlyFire => ((Object)(object)leader == (Object)null) ? ((bool)LethalMin.FriendlyFire) : leader.FriendlyFire.Value; public void SpawnFromOnion(int Index, Onion onion) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0071: Unknown result type (might be due to invalid IL or missing references) Vector3 position = default(Vector3); ((Vector3)(ref position))..ctor(((Component)this).transform.position.x + 999f, ((Component)this).transform.position.y + 999f, ((Component)this).transform.position.z + 999f); if (!PikUtils.IsOutOfRange(onion.ClimbLinks, Index)) { ((Component)this).transform.position = position; transform2.TeleportOnLocalClient(position); SetPikminOnToAnimLink(onion.ClimbLinks[Index]); } } public override void Start() { //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); randomSeed = StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex + (int)((NetworkBehaviour)this).NetworkObjectId; enemyRandom = new Random(randomSeed); DebugID = "_" + PikUtils.GenerateRandomString(enemyRandom); BirthDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); Pmanager = PikminManager.instance; IsWildPikmin = true; PikminSoundID = StartOfRound.Instance.randomMapSeed + LethalMin.RegisteredPikminTypes.Count; if ((Object)(object)rb == (Object)null) { rb = ((Component)this).GetComponent(); } if ((Object)(object)Pcollider == (Object)null) { Pcollider = (Collider)(object)((Component)this).GetComponent(); } if ((Object)(object)transform2 == (Object)null) { transform2 = ((Component)this).GetComponent(); } if ((Object)(object)pikminType == (Object)null) { LethalMin.Logger.LogFatal((object)(DebugID + " has no Pikmin type! Make sure it is set in the TypeResover before enableing!!!")); if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } return; } GenerationManager.Instance.Register(this); InitalizePikminType(pikminType); if (!string.IsNullOrEmpty(SpawnProps.SpawnAnimation)) { ((EnemyAI)this).EnableEnemyMesh(false, false, false); } GrowTimer = Random.Range(60, 600); GetGrowthObjects(); SetGrowth(0); scanNodeProperties = ((Component)this).GetComponentInChildren(); ((ScanNodeProperties)scanNodeProperties).headerText = pikminType.PikminName ?? ""; scanNodeProperties.PiklopediaEntry = pikminType.PiklopediaEntry; Pmanager.AddPikminAI(this); if (!SpawnProps.Equals(default(PikminSpawnProps))) { base.isOutside = SpawnProps.IsOutside; Leader leaderViaID = LethalMin.GetLeaderViaID(SpawnProps.PlayerID); if (!string.IsNullOrEmpty(SpawnProps.OverrideDebugID)) { DebugID = SpawnProps.OverrideDebugID; } if (!string.IsNullOrEmpty(SpawnProps.OverrideBirthDate)) { BirthDate = SpawnProps.OverrideBirthDate; } if ((Object)(object)leaderViaID != (Object)null) { if (leaderViaID.Controller.isPlayerControlled) { if (SpawnProps.AddToSpawnCount) { PikminManager.instance.EndOfGameStats.PikminRaised[leaderViaID]++; } AssignLeader(leaderViaID, SwitchState: true, PlayAnim: false); } else { LethalMin.Logger.LogDebug((object)(DebugID + ": Leader (" + leaderViaID.Controller.playerUsername + ") is not controlled, not assigning")); } } if (SpawnProps.AddToSpawnCount) { PikminManager.instance.FiredStats.TotalPikminRaised++; } if (SpawnProps.AddToSpawnCountForWild) { AddToRaisedOnInitAssign = true; } if (SpawnProps.SpawnAnimationDelay > 0f) { ((MonoBehaviour)this).StartCoroutine(PlayDelayedAnimation(SpawnProps.SpawnAnimation, SpawnProps.SpawnAnimationDelay)); } else { animController.PlayAnimation(SpawnProps.SpawnAnimation, 0f); } if (SpawnProps.MovementBuffer > 0f) { ((MonoBehaviour)this).StartCoroutine(DelayMovement(SpawnProps.MovementBuffer)); } if (SpawnProps.SpawnSoundDelay > 0f) { ((MonoBehaviour)this).StartCoroutine(PlayDelayedSound(SpawnProps.SpawnSound, SpawnProps.SpawnSoundDelay)); } else if (CurrentSoundPack.LookUpDict.ContainsKey(SpawnProps.SpawnSound)) { PlayAudioOnLocalClient(SpawnProps.SpawnSound, PlayOnVoice: false, SpawnProps.OverrideVolume); } SetGrowth(SpawnProps.GrowthStage); ((EnemyAI)this).EnableEnemyMesh(true, false, false); } LethalMin.Logger.LogDebug((object)($"{DebugID} spawned with type {pikminType.PikminName} and ID: {DebugID} At: {((Component)this).transform.position} " + $"random seed: {randomSeed} index: {base.thisEnemyIndex}")); if (((NetworkBehaviour)this).IsOwner) { base.agent.Warp(StoredSpawnPosition); } ((Object)((Component)this).gameObject).name = DebugID; HasBeenInitalized = true; } public void InitalizePikminType(PikminType type) { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) if (HasBeenInitalized) { LethalMin.Logger.LogError((object)(DebugID + " already Initalized!")); return; } pikminType = type; Object.Instantiate(type.ModelPrefab, modelContainer); CurrentCarryStrength = type.CarryStrength; base.enemyHP = type.HP; CurrentSoundPack = type.SoundPack; ProjectileProps = new ProjectileProperties { pikminAI = this, mass = rb.mass, drag = rb.drag, throwForce = pikminType.ThrowForce }; SwitchGeneration(PikUtils.ConvertCfgGenerationToPikminGeneration(LethalMin.PikminModelGeneration.InternalValue)); SwitchSoundGeneration(PikUtils.ConvertCfgGenerationToPikminGeneration(LethalMin.PikminSoundGeneration.InternalValue)); ((Component)((Component)this).transform.Find("MapDot (1)")).GetComponent().material.color = pikminType.PikminPrimaryColor; DebugID = type.PikminName + DebugID; LethalMin.Logger.LogDebug((object)("InitalizedPikmin Type: " + type.PikminName + " with ID: " + DebugID)); } public void SwitchGeneration(PikminGeneration generation) { if (LethalMin.RandomizeGenerationModels.InternalValue) { generation = (PikminGeneration)Random.Range(0, Enum.GetValues(typeof(PikminGeneration)).Length); } PikminModelRefernces modelRefernces = ((Component)this).GetComponentInChildren(); bool flag = false; PikminModelGeneration[] generations = modelRefernces.Generations; foreach (PikminModelGeneration pikminModelGeneration in generations) { if (!PikChecks.IsGenerationValid(pikminModelGeneration)) { if ((Object)(object)pikminModelGeneration != (Object)null) { LethalMin.Logger.LogError((object)$"Generation {pikminModelGeneration.Generation} of type {pikminType.PikminName} is invaild for a Pikmin!"); } continue; } pikminModelGeneration.Model.SetActive(pikminModelGeneration.Generation == generation); if (pikminModelGeneration.Generation == generation) { applyGeneration(pikminModelGeneration); flag = true; } } if (!flag) { LethalMin.Logger.LogWarning((object)$"Failed to find a valid generation for {DebugID} Generation: {generation}"); useDefultGeneration(); } void applyGeneration(PikminModelGeneration gen) { base.creatureAnimator = gen.Animator; animController = gen.AnimatorController; base.skinnedMeshRenderers = gen.Model.GetComponentsInChildren().ToArray(); base.meshRenderers = gen.Model.GetComponentsInChildren().ToArray(); SproutTop = gen.SproutTop.transform; if (Object.op_Implicit((Object)(object)gen.HeyPikminBigEyes)) { gen.HeyPikminBigEyes.SetActive(LethalMin.BigEyesEnabled.InternalValue); } if ((Object)(object)gen.OverrideSFX != (Object)null) { base.creatureSFX = gen.OverrideSFX; } if ((Object)(object)gen.OverrideVoice != (Object)null) { base.creatureVoice = gen.OverrideVoice; } PikminSproutFXManager pikminSproutFXManager2 = null; if (!((Component)SproutTop).gameObject.TryGetComponent(ref pikminSproutFXManager2)) { pikminSproutFXManager2 = ((Component)SproutTop).gameObject.AddComponent(); } pikminSproutFXManager2.minmin = this; pikminSproutFXManager2.Top = SproutTop; } void useDefultGeneration() { modelRefernces.Model.SetActive(true); base.creatureAnimator = modelRefernces.Animator; animController = modelRefernces.AnimatorController; base.skinnedMeshRenderers = modelRefernces.Model.GetComponentsInChildren().ToArray(); base.meshRenderers = modelRefernces.Model.GetComponentsInChildren().ToArray(); SproutTop = modelRefernces.SproutTop.transform; if (Object.op_Implicit((Object)(object)modelRefernces.HeyPikminBigEyes)) { modelRefernces.HeyPikminBigEyes.SetActive(LethalMin.BigEyesEnabled.InternalValue); } if ((Object)(object)modelRefernces.OverrideSFX != (Object)null) { base.creatureSFX = modelRefernces.OverrideSFX; } if ((Object)(object)modelRefernces.OverrideVoice != (Object)null) { base.creatureVoice = modelRefernces.OverrideVoice; } PikminSproutFXManager pikminSproutFXManager = null; if (!((Component)SproutTop).gameObject.TryGetComponent(ref pikminSproutFXManager)) { pikminSproutFXManager = ((Component)SproutTop).gameObject.AddComponent(); } pikminSproutFXManager.minmin = this; pikminSproutFXManager.Top = SproutTop; } } public void SwitchSoundGeneration(PikminGeneration generation) { if (LethalMin.RandomizeGenerationModels.InternalValue) { generation = (PikminGeneration)Random.Range(0, Enum.GetValues(typeof(PikminGeneration)).Length); } CurrentSoundPack = pikminType.GetSoundPackByGeneration(generation); } public PikminData GetPikminData() { int lastOnionID = -1; if ((Object)(object)TargetOnion != (Object)null) { if (TargetOnion.fusedTypes.Count == 0) { lastOnionID = TargetOnion.onionType.OnionTypeID; } else { foreach (OnionType fusedType in TargetOnion.fusedTypes) { if (fusedType.TypesCanHold.Contains(pikminType)) { lastOnionID = fusedType.OnionTypeID; } } } } return new PikminData(pikminType.PikminTypeID, lastOnionID, CurrentGrowthStage, DebugID, BirthDate); } public override void OnDestroy() { ((EnemyAI)this).OnDestroy(); GenerationManager.Instance.Unregister(this); } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkDespawn(); foreach (GameObject tempObject in TempObjects) { if ((Object)(object)tempObject != (Object)null) { Object.Destroy((Object)(object)tempObject); } } if (IsGoingToOnion && !base.isEnemyDead && (Object)(object)TargetOnion != (Object)null) { LethalMin.Logger.LogWarning((object)(DebugID + ": Despawned while going to onion! adding anyways...")); TargetOnion.AddPikmin(this); } CallResetMethods(RemoveLeader: true, DropItem: true, RemoveEnemy: true, -1); Pmanager.RemovePikminAI(this); } public override void Update() { //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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Invalid comparison between Unknown and I4 //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0752: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Unknown result type (might be due to invalid IL or missing references) //IL_0762: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_0775: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0788: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) //IL_078f: Unknown result type (might be due to invalid IL or missing references) //IL_079d: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) ModifiedUpdate(); UpdateLocalSnapping(); UpdateIdleAnimation(); if (CurrentTask != null) { CurrentTask.Update(); } if (LethalMin.InviciblePikminCheat) { Invincible = true; wasInvisCheatOn = true; } else if (wasInvisCheatOn) { Invincible = false; wasInvisCheatOn = false; } if (((NetworkBehaviour)this).IsOwner) { CheckIfOnNavmesh(); } Vector3 velocity; if (((NetworkBehaviour)this).IsOwner && ((Behaviour)base.agent).enabled) { velocity = base.agent.velocity; if (((Vector3)(ref velocity)).magnitude <= 0.05f) { timeIdel += Time.deltaTime; } else { timeIdel = 0f; } } if (((NetworkBehaviour)this).IsOwner) { int num = 1 << NavMesh.GetAreaFromName("Water"); if (!LethalMin.NonWaterResistantAvoidWater.InternalValue || (int)StartOfRound.Instance.currentLevel.currentWeather == 4 || PikChecks.IsPikminResistantToHazard(pikminType, PikminHazard.Water)) { NavMeshAgent agent = base.agent; agent.areaMask |= num; } else { NavMeshAgent agent2 = base.agent; agent2.areaMask &= ~num; } } ((Component)scanNodeProperties).gameObject.SetActive(LethalMin.MakePikminScanable.InternalValue); if (((NetworkBehaviour)this).IsOwner && IsAirborn) { tmeFalling += Time.deltaTime; if (tmeFalling >= LethalMin.TimeFallingFailSafe.InternalValue) { Vector3 val = FindPositionToGetIntoBounds(); LethalMin.Logger.LogWarning((object)(DebugID + ": Falling for too long! Auto Landing")); LandPikminServerRpc(); tmeFalling = 0f; } } else { tmeFalling = 0f; } ProjectileProps.direction = ((Component)this).transform.forward; if (CurrentIntention == Pintent.Idle && Pmanager.Vehicles.Count > 0 && base.currentBehaviourStateIndex == 1 && (Object)(object)leader != (Object)null) { if (timeSinceLastVehicleCheck >= 0f) { timeSinceLastVehicleCheck -= Time.deltaTime; } else { timeSinceLastVehicleCheck = 0.25f + (float)enemyRandom.Next(-10, 10) * 0.005f; CheckToSetVehicle(); } } else if ((Object)(object)CurrentVehicle != (Object)null) { LethalMin.Logger.LogDebug((object)(DebugID + ": Setting off vehicle auto")); SetOffVehicle(); } animController.IsAttacking = attackRoutine != null; if (base.currentBehaviourStateIndex == 3 && ((NetworkBehaviour)this).IsOwner) { HandlePanicStateOnOwnerClientConstant(); } if (((NetworkBehaviour)this).IsOwner) { PikminAnimatorController pikminAnimatorController = animController; int isMoving; if (((Behaviour)base.agent).enabled) { velocity = base.agent.velocity; isMoving = ((((Vector3)(ref velocity)).magnitude > 0.1f) ? 1 : 0); } else { isMoving = 0; } pikminAnimatorController.IsMoving = (byte)isMoving != 0; } else { animController.IsMoving = ((Behaviour)transform2).enabled && ((Vector3)(ref transform2.tempVelocity)).magnitude > 0.1f; } animController.IsCarrying = CurrentIntention == Pintent.Carry; animController.IsLaying = Laying || (IsDeadOrDying && !IsAirborn); if (DeathTimerAffecters.Count > 0) { DeathTimer -= Time.deltaTime * (float)DeathTimerAffecters.Count; OverrideDelay = 0.1f; if (DeathTimer <= 0f && ((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogDebug((object)(DebugID + ": Death timer ran out!")); DeathTimer = 999999f; ((EnemyAI)this).KillEnemyOnOwnerClient(true); DeathTimerAffecters.Clear(); } } if (IsGrabbedByEnemy && grabDeathTimer > 0f) { grabDeathTimer -= Time.deltaTime; if (grabDeathTimer <= 0f && ((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogDebug((object)(DebugID + ": Grab death timer ran out, killing pikmin!")); grabDeathTimer = -1f; ((EnemyAI)this).KillEnemyOnOwnerClient(true); } } if (((NetworkBehaviour)this).IsOwner && base.isEnemyDead && ((NetworkBehaviour)this).NetworkObject.IsSpawned) { deadStateFailsafeTimer += Time.deltaTime; if (deadStateFailsafeTimer > 10f) { LethalMin.Logger.LogWarning((object)$"{DebugID}: Dead state failsafe triggered! Forcing despawn after {deadStateFailsafeTimer}s stuck dead."); deadStateFailsafeTimer = -999f; IncrumentDestoryCountServerRpc(); } } if (((NetworkBehaviour)this).IsServer && CurrentGrowthStage < MaxGrowthStage) { GrowTimer -= Time.deltaTime * pikminType.GrowSpeedMultiplier; if (GrowTimer <= 0f) { GrowTimer = Random.Range(60, 600); SetGrowthClientRpc(CurrentGrowthStage + 1); } } if (LeaderAssesmentDelay >= 0f) { LeaderAssesmentDelay -= Time.deltaTime; } if (OverrideIdlePosition.HasValue && OverrideIdlePosition.Value.ShouldRemove(this)) { OverrideIdlePosition = null; } if (OverrideFollowPosition.HasValue && OverrideFollowPosition.Value.ShouldRemove(this)) { OverrideFollowPosition = null; } if (CanGetBackUp && Laying) { timeLaying -= Time.deltaTime; if (timeLaying <= 0f) { CanGetBackUp = false; PlayAnimation(animController.AnimPack.EditorGetUpAnim); PlayAudioOnLocalClient(PikminSoundPackSounds.GetUp); CallResetMethods(); LethalMin.Logger.LogDebug((object)(DebugID + ": Pikmin got back up!")); } } if (((NetworkBehaviour)this).IsOwner && (Object)(object)AgentLookTarget != (Object)null) { base.agent.updateRotation = false; Vector3 val2 = AgentLookTarget.position - ((Component)this).transform.position; val2.y = 0f; if (val2 != Vector3.zero) { Quaternion val3 = Quaternion.LookRotation(val2); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, val3, 15f * Time.deltaTime); } } if (((NetworkBehaviour)this).IsOwner && !base.agent.updateRotation && (Object)(object)AgentLookTarget != (Object)null) { base.agent.updateRotation = true; } } public void ModifiedUpdate() { //IL_004a: 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) if (base.inSpecialAnimation || !((Behaviour)base.agent).enabled || !base.agent.isOnNavMesh || Time.realtimeSinceStartup - base.refreshDestinationInterval > 15f) { base.refreshDestinationInterval = Time.realtimeSinceStartup; base.prevDestination = Vector3.zero; } if (base.enemyType.isDaytimeEnemy && !base.daytimeEnemyLeaving) { ((EnemyAI)this).CheckTimeOfDayToLeave(); } if (base.stunnedIndefinitely <= 0) { if (base.stunNormalizedTimer >= 0f) { base.stunNormalizedTimer -= Time.deltaTime / base.enemyType.stunTimeMultiplier; } else { base.stunnedByPlayer = null; if (base.postStunInvincibilityTimer >= 0f) { base.postStunInvincibilityTimer -= Time.deltaTime * 5f; } } } if (!base.ventAnimationFinished && base.timeSinceSpawn < base.exitVentAnimationTime + 0.005f * (float)RoundManager.Instance.numberOfEnemiesInScene) { base.timeSinceSpawn += Time.deltaTime; return; } if (!base.inSpecialAnimation && !base.ventAnimationFinished) { base.ventAnimationFinished = true; if ((Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.SetBool("inSpawningAnimation", false); } } ((EnemyAI)this).DisableAnimatorWhenNotVisible(); if (!((NetworkBehaviour)this).IsOwner) { if (base.currentSearch.inProgress) { ((EnemyAI)this).StopSearch(base.currentSearch, true); } base.timeSinceSpawn += Time.deltaTime; return; } if (base.isEnemyDead) { ((Behaviour)base.agent).enabled = false; return; } if (base.movingTowardsTargetPlayer && (Object)(object)base.targetPlayer != (Object)null) { ((EnemyAI)this).NavigateTowardsTargetPlayer(); } if (!base.inSpecialAnimation) { if (base.updateDestinationInterval >= 0f) { base.updateDestinationInterval -= Time.deltaTime; return; } ((EnemyAI)this).DoAIInterval(); base.updateDestinationInterval = base.AIIntervalTime + Random.Range(-0.015f, 0.015f); } } public void LateUpdate() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //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_0042: 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) Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; IsInShip = ((Bounds)(ref bounds)).Contains(((Component)this).transform.position); bounds = StartOfRound.Instance.shipBounds.bounds; IsOnShip = ((Bounds)(ref bounds)).Contains(((Component)this).transform.position); scanNodeProperties.VisualNodeType = (int)LethalMin.PikminScanNodeColorType.InternalValue; Vector3 localScale = default(Vector3); ((Vector3)(ref localScale))..ctor(LethalMin.PikminScale.InternalValue, LethalMin.PikminScale.InternalValue, LethalMin.PikminScale.InternalValue); ((Component)this).transform.localScale = localScale; } public virtual void PathToPosition(Vector3 position) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)base.agent).enabled && (base.agent.isOnNavMesh || base.agent.isOnOffMeshLink)) { base.agent.SetDestination(position); } } public virtual void PathToSelf(bool UseOverride = false) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (UseOverride && OverrideIdlePosition.HasValue) { base.agent.speed = pikminType.GetSpeed(CurrentGrowthStage, ShouldRun) * 2.5f; PathToPosition(OverrideIdlePosition.Value.position); } else if (base.agent.hasPath) { base.agent.ResetPath(); } } public override void DoAIInterval() { if (base.currentBehaviourStateIndex != 2) { base.agent.speed = pikminType.GetSpeed(CurrentGrowthStage, ShouldRun); } switch (base.currentBehaviourStateIndex) { case 0: HandleIdleStateOnOwnerClient(); break; case 1: HandleFollowStateOnOwnerClient(); break; case 2: HandleWorkStateOnOwnerClient(); break; case 3: HandlePanicStateOnOwnerClient(); break; case 4: HandleLeavingStateOnOwnerClient(); break; } } public virtual void CallResetMethods(bool RemoveLeader = true, bool DropItem = true, bool RemoveEnemy = true, int CollisionMode = 1, bool Unlatch = true, bool RemoveTask = true, bool RemoveOverridePositions = true, bool SetLayingFalse = true) { if (RemoveEnemy) { RemoveTargetEnemy(); } if (DropItem) { DropItemOnLocalClient(); } if (RemoveLeader) { this.RemoveLeader(); } if ((Object)(object)CurrentVehicle != (Object)null) { SetOffVehicle(SetCollMode: false); } if (Unlatch) { TryUnlatchPikmin(); } if (RemoveTask) { CurrentTask = null; } if (RemoveOverridePositions) { OverrideIdlePosition = null; OverrideFollowPosition = null; } if (SetLayingFalse) { Laying = false; if (isRagdolled) { CleanupRagdoll(); } } if (CollisionMode >= 0) { SetCollisionMode(CollisionMode); } } public virtual void HandleIdleStateOnOwnerClient() { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) base.agent.obstacleAvoidanceType = (ObstacleAvoidanceType)1; base.agent.stoppingDistance = 0f; PathToSelf(UseOverride: true); if (CurrentIntention != 0 || Laying) { return; } if (!Object.op_Implicit((Object)(object)CurrentLatchTrigger) && (!IsWildPikmin || (IsWildPikmin && (bool)LethalMin.WildPikminCarry)) && pikminType.CanCarryObjects) { PikminItem closestPikminItem = GetClosestPikminItem(); if ((Object)(object)closestPikminItem != (Object)null) { LethalMin.Logger.LogInfo((object)(DebugID + ": Found item: " + ((Object)closestPikminItem).name)); TargetItem = closestPikminItem; TargetItemPoint = closestPikminItem.GetNearestGrabPosition(((Component)this).transform.position); if (Object.op_Implicit((Object)(object)TargetItem) && Object.op_Implicit((Object)(object)TargetItemPoint)) { SetPikminToItemServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)TargetItem).NetworkObject), TargetItem.GrabToPositions.IndexOf(TargetItemPoint)); SetPikminToItemLocalClient(TargetItem, TargetItem.GrabToPositions.IndexOf(TargetItemPoint)); PathToPosition(((Component)TargetItem).transform.position); return; } TargetItem = null; TargetItemPoint = null; } } if (!Object.op_Implicit((Object)(object)CurrentLatchTrigger) && (!IsWildPikmin || (IsWildPikmin && (bool)LethalMin.WildPikminAttack))) { PikminEnemy closestEnemy = GetClosestEnemy(); if ((Object)(object)closestEnemy != (Object)null) { LethalMin.Logger.LogInfo((object)(DebugID + ": Found enemy: " + ((Object)closestEnemy).name)); TargetEnemy = closestEnemy; if (Object.op_Implicit((Object)(object)TargetEnemy)) { SetPikminToEnemyServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)TargetEnemy).NetworkObject)); SetPikminToEnemyLocalClient(TargetEnemy); PathToPosition(((Component)TargetEnemy).transform.position); return; } TargetEnemy = null; } } PikminTask pikminTask = PikminTaskRegistry.FindIdleTask(this); if (pikminTask != null) { CurrentTask = pikminTask; ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2); } } public virtual void HandleFollowStateOnOwnerClient() { //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: 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_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: 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) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) if (PikChecks.IsLeaderInvalid(leader) || ((Object)(object)leader != (Object)null && leader.Controller.isPlayerDead)) { if ((Object)(object)leader == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Leader is null when following")); RemoveLeaderServerRpc(); return; } if (leader.Controller.isPlayerDead) { LethalMin.Logger.LogInfo((object)(DebugID + ": Leader is dead when following")); } leader.AddToRemoveQueue(this); return; } if ((Object)(object)TargetItem != (Object)null) { LethalMin.Logger.LogWarning((object)(DebugID + ": TargetItem is not null while in follow state! Dropping...")); DropItemServerRpc(); } if (CurrentIntention == Pintent.BeingHeld || (Object)(object)leader == (Object)null) { return; } if (OverrideFollowPosition.HasValue) { PathToPosition(OverrideFollowPosition.Value.position); return; } if (leader.DirectPikminPath) { PathToPosition(((Component)leader).transform.position); if ((bool)LethalMin.PikminDontCollideWhenInElevator) { base.agent.obstacleAvoidanceType = (ObstacleAvoidanceType)0; } return; } switch (LethalMin.PikminFollowMode.InternalValue) { case PfollowMode.New: base.agent.obstacleAvoidanceType = (ObstacleAvoidanceType)0; base.agent.stoppingDistance = 0f; PathToPosition(leader.formManager.GetFormationPosition(this)); break; case PfollowMode.LegacyFollow: base.agent.obstacleAvoidanceType = (ObstacleAvoidanceType)1; base.agent.stoppingDistance = 2f; PathToPosition(((Component)leader).transform.position); break; case PfollowMode.LegacyBehind: { base.agent.obstacleAvoidanceType = (ObstacleAvoidanceType)1; base.agent.stoppingDistance = 2f; Vector3 val = ((Component)this).transform.position - ((Component)leader).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = ((Component)leader).transform.position + normalized * base.agent.stoppingDistance; NavMeshHit val3 = default(NavMeshHit); if (NavMesh.SamplePosition(val2, ref val3, base.agent.stoppingDistance, -1)) { PathToPosition(((NavMeshHit)(ref val3)).position); } break; } } } public virtual void HandleWorkStateOnOwnerClient() { if (CurrentTask != null) { CurrentTask.IntervaledUpdate(); } else { LethalMin.Logger.LogWarning((object)(DebugID + ": Work state with no task assigned!")); } } public virtual void HandlePanicStateOnOwnerClient() { //IL_016f: 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_015c: 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_01d0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LeaderWhistling != (Object)null && (Object)(object)LeaderWhistlingZone != (Object)null && ((Object)(object)LeaderWhistlingZone.LeaderScript == (Object)null || !LeaderWhistlingZone.Active)) { LethalMin.Logger.LogInfo((object)(DebugID + " saving player stopped whistling")); LeaderWhistling = null; } switch (CurrentIntention) { case Pintent.MoveableStuck: if ((Object)(object)LeaderWhistling != (Object)null) { if (CanBeWhistledOutOfPanic) { LethalMin.Logger.LogWarning((object)("Leader whistling: " + ((Object)LeaderWhistling).name)); StopPanicingServerRpc(); } else { PathToPosition(((Component)LeaderWhistling).transform.position); } } else { PathToSelf(); } break; case Pintent.Stuck: break; case Pintent.Panicing: base.agent.speed = pikminType.GetSpeed(CurrentGrowthStage, Running: true); PanicInterval += 1f; if (PanicInterval >= 1f) { PanicPosition = GetRandomPositionOnNavMesh(); PanicInterval = 0f; } PathToPosition(PanicPosition); if ((Object)(object)LeaderWhistling != (Object)null) { if (CanBeWhistledOutOfPanic) { LethalMin.Logger.LogInfo((object)("Leader whistling: " + ((Object)LeaderWhistling).name)); StopPanicingServerRpc(); } else { PathToPosition(((Component)LeaderWhistling).transform.position); } } break; default: StopPanicingServerRpc(); LethalMin.Logger.LogWarning((object)$"{DebugID}: is not in valid panic intention: {CurrentIntention}"); break; } } public virtual void HandlePanicStateOnOwnerClientConstant() { switch (CurrentIntention) { case Pintent.MoveableStuck: break; case Pintent.Stuck: if ((Object)(object)LeaderWhistling != (Object)null && StuckEscapeTimer != -255f) { StuckEscapeTimer -= Time.deltaTime; if (StuckEscapeTimer <= 0f) { LethalMin.Logger.LogWarning((object)("Leader whistling: " + ((Object)LeaderWhistling).name)); StopPanicingServerRpc(); } } break; case Pintent.Panicing: break; } } public virtual void HandleLeavingStateOnOwnerClient() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0057: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_0079: Unknown result type (might be due to invalid IL or missing references) if (IsLeftBehind && base.isOutside) { if (LeavingPos == Vector3.zero) { LeavingPos = GetRandomPositionOnNavMesh(150f); } PathToPosition(LeavingPos); if (Vector3.Distance(((Component)this).transform.position, LeavingPos) < 5f) { LeavingPos = GetRandomPositionOnNavMesh(150f); } } if (!((Object)(object)TargetOnion == (Object)null)) { base.agent.stoppingDistance = 0f; base.agent.obstacleAvoidanceType = (ObstacleAvoidanceType)0; Vector3 position = TargetOnion.ClimbLinks[targetOnionLinkIndex].EndPoint.position; base.agent.speed = CalculateDynamicSpeed(position); PathToPosition(position); if (!IsDoingOnionAnimation && (PikUtils.HorizontalDistance(((Component)this).transform.position, position) < 1f + base.agent.stoppingDistance || pikminType.InstaEnterOnion || TargetOnion is ShipOnion || timeIdel >= 5f)) { EnterOnionServerRpc(targetOnionLinkIndex); IsDoingOnionAnimation = true; } } } public virtual void SetCurrentTask(string TaskID) { LethalMin.Logger.LogInfo((object)(DebugID + ": Setting current task to " + TaskID)); if (CurrentTask != null) { LethalMin.Logger.LogWarning((object)(DebugID + ": Current task is not null when setting new task! Intercepting current task: (" + CurrentTask.GetType().Name + ")")); CurrentTask.TaskIntercepted(); } switch (TaskID) { case "CarryItem": CurrentTask = new CarryItemTask(this); break; case "ReturnToShip": CurrentTask = new ReturnToShipTask(this); break; case "AttackEnemy": CurrentTask = new AttackEnemyTask(this); break; } } [ServerRpc] public void FinishTaskServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(604708755u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 604708755u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; FinishTaskClientRpc(); } } [ClientRpc] public void FinishTaskClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4009197585u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4009197585u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; FinishTask(); } } } public virtual void FinishTask() { LethalMin.Logger.LogInfo((object)(DebugID + ": Task finished")); if (CurrentTask != null) { CurrentTask.TaskEnd(callRpc: false); CurrentTask = null; } } public virtual void RemoveCurrentTask() { LethalMin.Logger.LogInfo((object)(DebugID + ": Removing current task")); CurrentTask = null; } public void CheckToSetVehicle() { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: 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_0156: Unknown result type (might be due to invalid IL or missing references) PikminVehicleController leaderInCar = PikUtils.GetLeaderInCar(leader); if (((NetworkBehaviour)this).IsOwner && (Object)(object)leaderInCar == (Object)null && (Object)(object)CurrentVehicle == (Object)null && OverrideFollowPosition.HasValue && OverrideFollowPosition.Value.ID == "MoveToVPoint") { OverrideFollowPosition = null; LethalMin.Logger.LogDebug((object)(DebugID + ": Vehicle moving to point cancelled, no vehicle found")); } if ((Object)(object)leaderInCar == (Object)(object)CurrentVehicle) { return; } if ((Object)(object)leaderInCar == (Object)null) { if ((Object)(object)CurrentVehicle != (Object)null) { SetOffVehicle(); } return; } Transform avaiblePikminPoint = leaderInCar.GetAvaiblePikminPoint(this); if (((NetworkBehaviour)this).IsOwner && Vector3.Distance(avaiblePikminPoint.position, ((Component)base.agent).transform.position) > 1f && (Object)(object)CurrentVehiclePoint == (Object)null) { base.agent.stoppingDistance = 0f; base.agent.obstacleAvoidanceType = (ObstacleAvoidanceType)0; if (!OverrideFollowPosition.HasValue) { LethalMin.Logger.LogDebug((object)$"{DebugID}: Moving to vehicle point: {avaiblePikminPoint.position}"); } OverrideFollowPosition = new OverridePikminPosition("MoveToVPoint", avaiblePikminPoint.position, useTimer: false); if (chargeRoutine != null) { ((MonoBehaviour)this).StopCoroutine(chargeRoutine); chargeRoutine = null; } } else if (((NetworkBehaviour)this).IsOwner) { SetCollisionMode(0); CurrentVehiclePoint = avaiblePikminPoint; OverrideFollowPosition = null; CurrentVehicle = leaderInCar; GetInVehicleRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)leaderInCar.controller).NetworkObject)); LethalMin.Logger.LogDebug((object)(DebugID + ": Got in to vehicle: " + ((Object)leaderInCar).name)); } } [Rpc(/*Could not decode attribute arguments.*/)] public void GetInVehicleRpc(NetworkObjectReference vehicleRef) { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2913971389u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref vehicleRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2913971389u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); PikminVehicleController pikminVehicleController = default(PikminVehicleController); if (((NetworkObjectReference)(ref vehicleRef)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref pikminVehicleController)) { Transform avaiblePikminPoint = pikminVehicleController.GetAvaiblePikminPoint(this); SetCollisionMode(0); CurrentVehiclePoint = avaiblePikminPoint; OverrideFollowPosition = null; CurrentVehicle = pikminVehicleController; LethalMin.Logger.LogDebug((object)(DebugID + ": Got in to vehicle (synced): " + ((Object)pikminVehicleController).name)); } } } public void SetOffVehicle(bool SetCollMode = true) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) bool flag = (Object)(object)CurrentVehicle != (Object)null; CurrentVehicle?.RemovePikminPoint(this); CurrentVehiclePoint = null; CurrentVehicle = null; transform2.TeleportOnLocalClient(((Component)this).transform.position, ((Component)this).transform.rotation); if (((NetworkBehaviour)this).IsOwner && OverrideFollowPosition.HasValue && OverrideFollowPosition.Value.ID == "MoveToVPoint") { OverrideFollowPosition = null; } if (SetCollMode) { SetCollisionMode(1); } if (flag) { LethalMin.Logger.LogInfo((object)(DebugID + ": Set off vehicle")); } } [IteratorStateMachine(typeof(d__145))] public IEnumerator DoCharge(float time) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__145(0) { <>4__this = this, time = time }; } [ServerRpc] public void FindItemViaChargeServerRpc(NetworkObjectReference ItemRef, int grabIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Invalid comparison between Unknown and I4 //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1723618909u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref ItemRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, grabIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1723618909u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; FindItemViaChargeClientRpc(ItemRef, grabIndex); } } [ClientRpc] public void FindItemViaChargeClientRpc(NetworkObjectReference ItemRef, int grabIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(604646442u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref ItemRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, grabIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 604646442u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); PikminItem itm = default(PikminItem); if (((NetworkObjectReference)(ref ItemRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref itm)) { FindItemViaCharge(itm, grabIndex); } } } public void FindItemViaCharge(PikminItem itm, int grabIndex) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) CallResetMethods(); TargetItem = itm; TargetItemPoint = itm.GetNearestGrabPosition(((Component)this).transform.position); SetPikminToItemLocalClient(itm, grabIndex); } [ServerRpc] public void FindEnemyViaChargeServerRpc(NetworkObjectReference EnemyRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3979919198u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref EnemyRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3979919198u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; FindEnemyViaChargeClientRpc(EnemyRef); } } [ClientRpc] public void FindEnemyViaChargeClientRpc(NetworkObjectReference EnemyRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2838210814u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref EnemyRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2838210814u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); PikminEnemy enm = default(PikminEnemy); if (((NetworkObjectReference)(ref EnemyRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref enm)) { FindEnemyViaCharge(enm); } } } public void FindEnemyViaCharge(PikminEnemy enm) { CallResetMethods(); TargetEnemy = enm; SetPikminToEnemyLocalClient(enm); } private float CalculateDynamicSpeed(Vector3 targetPosition) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) float speed = pikminType.GetSpeed(CurrentGrowthStage, ShouldRun); float num = Vector3.Distance(((Component)this).transform.position, targetPosition); float num2 = 50f; float num3 = Mathf.Clamp(num / 10f, 1f, num2); return speed + 10f * num3; } public Vector3 GetRandomPositionOnNavMesh(float sampleRadius = 10f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3 val = Random.insideUnitSphere * sampleRadius; val += ((Component)this).transform.position; Vector3 zero = Vector3.zero; NavMeshHit val2 = default(NavMeshHit); if (NavMesh.SamplePosition(val, ref val2, sampleRadius, -1)) { return ((NavMeshHit)(ref val2)).position; } return ((Component)this).transform.position; } public override void OnGainedOwnership() { ((NetworkBehaviour)this).OnGainedOwnership(); if (CurrentCollisionMode == 1) { SetCollisionMode(1); } if (CurrentCollisionMode == 3) { SetCollisionMode(3); } } [ServerRpc] public void SetToIdleServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1514843108u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1514843108u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetToIdleClientRpc(); } } [ClientRpc] public void SetToIdleClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3765545145u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3765545145u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetToIdle(); } } } public virtual void SetToIdle(bool keepLaying = false) { LethalMin.Logger.LogDebug((object)(DebugID + ": Setting to idle on local client")); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); ChangeIntent(Pintent.Idle); CallResetMethods(RemoveLeader: true, DropItem: true, RemoveEnemy: true, -1, Unlatch: true, RemoveTask: true, RemoveOverridePositions: true, !keepLaying); } [ServerRpc] public void ChangeIntentServerRpc(int newIntention) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3697017969u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, newIntention); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3697017969u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ChangeIntentClientRpc(newIntention); } } [ClientRpc] public void ChangeIntentClientRpc(int newIntention) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4111438502u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, newIntention); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4111438502u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ChangeIntent((Pintent)newIntention); } } } public virtual void ChangeIntent(Pintent newIntention) { PreviousIntention = CurrentIntention; CurrentIntention = newIntention; } [ServerRpc] public void SetPikminToLeavingServerRpc(NetworkObjectReference OnionRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2484908225u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref OnionRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2484908225u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetPikminToLeavingClientRpc(OnionRef); } } [ClientRpc] public void SetPikminToLeavingClientRpc(NetworkObjectReference OnionRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2728408294u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref OnionRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2728408294u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); Onion pikminToLeaving = default(Onion); if (((NetworkObjectReference)(ref OnionRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref pikminToLeaving)) { SetPikminToLeaving(pikminToLeaving); } else { LethalMin.Logger.LogError((object)(DebugID + ": Failed to get Target Onion when setting leave!")); } } } public virtual void SetPikminToLeaving(Onion? onion = null) { timeIdel = 0f; CallResetMethods(); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(4); ChangeIntent(Pintent.Leave); if ((Object)(object)onion != (Object)null) { IsGoingToOnion = true; SetTargetOnion(onion); } LethalMin.Logger.LogDebug((object)($"{DebugID}: Set to leaving state. IsGoingToOnion: {IsGoingToOnion}. " + "TargetOnion: " + (((Object)(object)TargetOnion != (Object)null) ? ((Object)TargetOnion).name : "null"))); } [ServerRpc] public void SetTargetOnionServerRpc(NetworkObjectReference OnionRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3239111308u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref OnionRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3239111308u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetTargetOnionClientRpc(OnionRef); } } [ClientRpc] public void SetTargetOnionClientRpc(NetworkObjectReference OnionRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(255507921u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref OnionRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 255507921u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); Onion targetOnion = default(Onion); if (((NetworkObjectReference)(ref OnionRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref targetOnion)) { SetTargetOnion(targetOnion); } else { LethalMin.Logger.LogError((object)(DebugID + ": Failed to get Target Onion!")); } } } public void SetTargetOnion(Onion onion) { TargetOnion = onion; targetOnionLinkIndex = enemyRandom.Next(0, TargetOnion.ClimbLinks.Count); } [ServerRpc] public void EnterOnionServerRpc(int linkIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(274790213u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, linkIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 274790213u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EnterOnionClientRpc(linkIndex); } } [ClientRpc] public void EnterOnionClientRpc(int linkIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1238071101u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, linkIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1238071101u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EnterOnionOnLocalClient(linkIndex); } } } public void EnterOnionOnLocalClient(int linkIndex) { if (!DontAddToOnion) { TargetOnion.AddPikmin(this); } IsGoingToOnion = false; PlayAudioOnLocalClient(PikminSoundPackSounds.EnterOnion.ToString(), PlayOnVoice: true, 1f); SetPikminOnToAnimLink(TargetOnion.ClimbLinks[linkIndex], Reversed: true); } [ServerRpc(RequireOwnership = false)] public void AssignLeaderServerRpc(NetworkObjectReference LeaderRef, bool SwitchToFollowingState = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3024175915u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref LeaderRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref SwitchToFollowingState, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3024175915u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Leader leader = null; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref LeaderRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref leader) && (Object)(object)leader != (Object)null) { if (((NetworkBehaviour)leader).OwnerClientId != ((NetworkBehaviour)this).OwnerClientId) { ((EnemyAI)this).ChangeOwnershipOfEnemy(((NetworkBehaviour)leader).OwnerClientId); } AssignLeaderClientRpc(LeaderRef, SwitchToFollowingState); return; } LethalMin.Logger.LogError((object)(DebugID + ": Failed to assign leader to " + ((val3 != null) ? ((Object)val3).name : null))); if ((Object)(object)leader == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Leader is null")); } if ((Object)(object)val3 == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": LeaderObj is null")); } } [ClientRpc] public void AssignLeaderClientRpc(NetworkObjectReference LeaderRef, bool SwitchState = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4055462510u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref LeaderRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref SwitchState, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4055462510u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Leader leader = null; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref LeaderRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref leader) && (Object)(object)leader != (Object)null) { AssignLeader(leader, SwitchState); return; } LethalMin.Logger.LogError((object)(DebugID + ": Failed to assign leader to " + ((val3 != null) ? ((Object)val3).name : null))); if ((Object)(object)leader == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Leader is null")); } if ((Object)(object)val3 == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": LeaderObj is null")); } } public virtual void AssignLeader(Leader leader, bool SwitchState = true, bool PlayAnim = true) { if ((Object)(object)leader == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Leader Assigning to is null when assigning leader")); } else { if (base.currentBehaviourStateIndex == 3 || (leader.PikminInSquad.Contains(this) && (Object)(object)leader == (Object)(object)this.leader)) { return; } if ((Object)(object)this.leader != (Object)null) { previousLeader = this.leader; } else { previousLeader = leader; } CallResetMethods(); this.leader = leader; base.isOutside = !leader.Controller.isInsideFactory; leader.PikminInSquad.Add(this); leader.OnPikminAdded(this); if (IsWildPikmin) { Pmanager.PikminAICounter.Add(this); if (AddToRaisedOnInitAssign) { PikminManager.instance.EndOfGameStats.PikminRaised[leader]++; PikminManager.instance.FiredStats.TotalPikminRaised++; } IsWildPikmin = false; } if (SwitchState) { ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); ChangeIntent(Pintent.Idle); } if (PlayAnim) { if (PreviousIntention == Pintent.Knockedback || CurrentIntention == Pintent.Knockedback) { PlayAnimation(animController.AnimPack.EditorGetUpAnim); } else { PlayAnimation(animController.AnimPack.EditorNoticeAnim); } PlayAudioOnLocalClient(PikminSoundPackSounds.Notice); } LethalMin.Logger.LogInfo((object)(DebugID + ": Assigned Leader: " + leader.Controller.playerUsername + $" ({((NetworkBehaviour)leader.Controller).OwnerClientId})")); } } [ServerRpc(RequireOwnership = false)] public void RemoveLeaderServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1265877939u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1265877939u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RemoveLeaderClientRpc(); } } } [ClientRpc] public void RemoveLeaderClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3812565402u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3812565402u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RemoveLeader(); } } } public virtual void RemoveLeader() { if ((Object)(object)leader != (Object)null) { leader.RemovePikminFromSquad(this); if ((Object)(object)leader.pikminHolding == (Object)(object)this) { leader.StopThrow(SetCollisionMode: false); } } if ((Object)(object)leader != (Object)null && !PikChecks.IsPlayerConnected(leader.Controller)) { previousLeader = leader; if (((NetworkBehaviour)this).IsServer) { ((EnemyAI)this).ChangeOwnershipOfEnemy(0uL); } } StopThrow(); leader = null; LethalMin.Logger.LogDebug((object)(DebugID + ": Removed Leader")); } public virtual void SetCollisionMode(int Mode) { //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_02de: 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_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0305: 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_02ad: 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_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogDebug((object)$"{DebugID}: Setting collision mode to {Mode}"); CurrentCollisionMode = Mode; switch (Mode) { case 0: ((Behaviour)base.agent).enabled = false; ((Behaviour)transform2).enabled = false; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; base.updatePositionThreshold = 9000f; base.syncMovementSpeed = 0f; rb.isKinematic = true; rb.useGravity = false; Pcollider.enabled = false; rb.collisionDetectionMode = (CollisionDetectionMode)0; rb.detectCollisions = false; rb.constraints = (RigidbodyConstraints)126; rb.interpolation = (RigidbodyInterpolation)0; rb.sleepThreshold = 0.005f; rb.excludeLayers = LayerMask.op_Implicit(0); rb.Sleep(); break; case 1: if (((NetworkBehaviour)this).IsOwner) { ((Behaviour)base.agent).enabled = true; } else { ((Behaviour)base.agent).enabled = false; } ((Behaviour)transform2).enabled = true; base.updatePositionThreshold = 1f; base.syncMovementSpeed = 0.22f; rb.isKinematic = true; rb.useGravity = false; Pcollider.enabled = false; rb.collisionDetectionMode = (CollisionDetectionMode)0; rb.detectCollisions = true; rb.constraints = (RigidbodyConstraints)126; rb.interpolation = (RigidbodyInterpolation)0; rb.sleepThreshold = 0.005f; rb.excludeLayers = LayerMask.op_Implicit(0); rb.Sleep(); break; case 2: ((Behaviour)base.agent).enabled = false; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; base.updatePositionThreshold = 9000f; base.syncMovementSpeed = 0f; rb.isKinematic = false; rb.useGravity = true; rb.detectCollisions = true; rb.constraints = (RigidbodyConstraints)0; rb.constraints = (RigidbodyConstraints)80; rb.interpolation = (RigidbodyInterpolation)1; rb.collisionDetectionMode = (CollisionDetectionMode)1; rb.sleepThreshold = 0f; if (((NetworkBehaviour)this).IsOwner) { Pcollider.excludeLayers = LayerMask.op_Implicit(~LayerMask.op_Implicit(LethalMin.PikminColideable)); rb.excludeLayers = LayerMask.op_Implicit(~LayerMask.op_Implicit(LethalMin.PikminColideable)); } else { Pcollider.excludeLayers = LayerMask.op_Implicit(~LayerMask.op_Implicit(LethalMin.PikminColideable)); rb.excludeLayers = LayerMask.op_Implicit(~LayerMask.op_Implicit(LethalMin.PikminColideable)); } Pcollider.enabled = true; rb.WakeUp(); break; case 3: ((Behaviour)base.agent).enabled = false; if (((NetworkBehaviour)this).IsOwner) { Pcollider.enabled = true; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; base.updatePositionThreshold = 9000f; base.syncMovementSpeed = 0f; rb.isKinematic = false; rb.useGravity = true; rb.detectCollisions = true; rb.constraints = (RigidbodyConstraints)0; rb.constraints = (RigidbodyConstraints)80; rb.interpolation = (RigidbodyInterpolation)1; rb.collisionDetectionMode = (CollisionDetectionMode)1; Pcollider.excludeLayers = LayerMask.op_Implicit(~LayerMask.op_Implicit(LethalMin.PikminColideable)); rb.excludeLayers = LayerMask.op_Implicit(~LayerMask.op_Implicit(LethalMin.PikminColideable)); rb.sleepThreshold = 0f; rb.WakeUp(); } else { Pcollider.enabled = false; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; base.updatePositionThreshold = 9000f; base.syncMovementSpeed = 0f; rb.isKinematic = true; rb.useGravity = false; rb.detectCollisions = false; rb.constraints = (RigidbodyConstraints)126; rb.interpolation = (RigidbodyInterpolation)0; rb.excludeLayers = LayerMask.op_Implicit(0); rb.sleepThreshold = 0.005f; rb.Sleep(); } ((Behaviour)transform2).enabled = true; break; } } public void SetSnapPoint(PikminSnapPoint snap) { _externalSnapPoints[snap.ID] = snap; } public void ClearSnapPoint(string id) { _externalSnapPoints.Remove(id); } public virtual void UpdateLocalSnapping() { //IL_0079: 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) PikminSnapPoint pikminSnapPoint = GatherBuiltInSnapPoint(); foreach (PikminSnapPoint value in _externalSnapPoints.Values) { if (pikminSnapPoint == null || value.Priority > pikminSnapPoint.Priority) { pikminSnapPoint = value; } } CurrentSnapPoint = pikminSnapPoint; if (pikminSnapPoint != null) { ((Component)this).transform.position = pikminSnapPoint.GetPosition(); if (pikminSnapPoint.GetRotation != null) { ((Component)this).transform.rotation = pikminSnapPoint.GetRotation(); } } if ((Object)(object)CurrentLinkAnim != (Object)null) { AnimateOnLink(); } } protected virtual Vector3 GetCarrySnapPosition() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_004e: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)TargetItemPoint).transform.position; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val + Vector3.up * 0.3f, Vector3.down, ref val2, 3f, LayerMask.op_Implicit(LethalMin.PikminColideable))) { val = ((RaycastHit)(ref val2)).point; } return val; } private PikminSnapPoint? GatherBuiltInSnapPoint() { PikminSnapPoint best = null; if ((Object)(object)DeathSnapToPos != (Object)null) { Transform deathPos = DeathSnapToPos; Consider(new PikminSnapPoint("BuiltIn.Death", 100, () => deathPos.position, () => RandomDeathRotaion)); } if (CurrentIntention == Pintent.BeingHeld && (Object)(object)leader != (Object)null) { Leader heldLeader = leader; Consider(new PikminSnapPoint("BuiltIn.Held", 90, () => ((Component)heldLeader.holdPosition).transform.position, () => ((Component)heldLeader.holdPosition).transform.rotation)); } if ((Object)(object)CurrentLatchTrigger != (Object)null) { PikminLatchTrigger trig = CurrentLatchTrigger; Consider(new PikminSnapPoint("BuiltIn.Latch", 80, () => LatchRefPoint.transform.position, delegate { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_004d: 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) Vector3 target = (((Object)(object)trig.OverrideLookAtObject != (Object)null) ? ((Component)trig.OverrideLookAtObject).transform.position : ((Component)trig).transform.position); return LookAtTarget(target); })); } if ((Object)(object)CurrentVehicle != (Object)null && (Object)(object)CurrentVehiclePoint != (Object)null) { Transform vehiclePoint = CurrentVehiclePoint; Consider(new PikminSnapPoint("BuiltIn.Vehicle", 70, () => vehiclePoint.position)); } if (CurrentIntention == Pintent.Carry && (Object)(object)TargetItem != (Object)null && (Object)(object)TargetItemPoint != (Object)null && (Object)(object)TargetItem.PrimaryPikminOnItem != (Object)(object)this) { PikminItem carryItem = TargetItem; Consider(new PikminSnapPoint("BuiltIn.Carry", 60, GetCarrySnapPosition, delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0038: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)carryItem).transform.position - ((Component)this).transform.position; val.y = 0f; if (val == Vector3.zero) { return ((Component)this).transform.rotation; } Quaternion val2 = Quaternion.LookRotation(val); return Quaternion.Slerp(((Component)this).transform.rotation, val2, 15f * Time.deltaTime); })); } if (CurrentIntention == Pintent.Idle && (SpecialIdlePosition.HasValue || SpecialIdleRotation.HasValue)) { Vector3? specialPos = SpecialIdlePosition; Quaternion? specialRot = SpecialIdleRotation; Consider(new PikminSnapPoint("BuiltIn.SpecialIdle", 50, () => (Vector3)(((??)specialPos) ?? ((Component)this).transform.position), specialRot.HasValue ? ((Func)(() => specialRot.Value)) : null)); } return best; void Consider(PikminSnapPoint candidate) { if (best == null || candidate.Priority > best.Priority) { best = candidate; } } } public virtual void StartThrow() { if ((Object)(object)leader == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Leader is null when starting throw")); return; } ChangeIntent(Pintent.BeingHeld); SetCollisionMode(0); RemoveFromLink(); PlayAnimation(animController.AnimPack.EditorHoldAnim, 0f); PlayAudioOnLocalClient(PikminSoundPackSounds.Prepare); } public virtual void ThrowPikmin(Vector3 Direction) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_00a3: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)leader == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Leader is null when throwing pikmin")); if (CurrentIntention == Pintent.BeingHeld) { SetToIdle(); } return; } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Direction.x * pikminType.ThrowForce.x, Direction.y * pikminType.ThrowForce.y, Direction.z * pikminType.ThrowForce.z); LethalMin.Logger.LogDebug((object)$"{DebugID}: Thrown with force: {val}"); ChangeIntent(Pintent.Thrown); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); SetCollisionMode(2); rb.position = leader.ThrowOrigin.position; ((Component)this).transform.position = leader.ThrowOrigin.position; ((Component)this).transform.rotation = leader.ThrowOrigin.rotation; rb.AddForce(val, (ForceMode)1); base.creatureVoice.Stop(); PlayAudioOnLocalClient(PikminSoundPackSounds.ThrownSFX); PlayAudioOnLocalClient(PikminSoundPackSounds.Thrown); PlayAnimation(animController.AnimPack.EditorThrowAnim); } public virtual void OnCollisionEnter(Collision collision) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_005e: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner || CurrentIntention != Pintent.Thrown) { return; } if (pikminType.CanLatchOnToObjects) { PikminLatchTrigger component = collision.gameObject.GetComponent(); if ((Object)(object)component != (Object)null && component.AllowBaseLatchOn && component.TryLatch(this, ((ContactPoint)(ref collision.contacts[0])).point)) { return; } } LethalMin.Logger.LogInfo((object)(DebugID + ": Collision with " + ((Object)collision.gameObject).name)); base.agent.Warp(((Component)this).transform.position); transform2.Teleport(((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.localScale); LandPikminServerRpc(); } public override void OnCollideWithEnemy(Collider other, EnemyAI collidedEnemy = null) { ((EnemyAI)this).OnCollideWithEnemy(other, collidedEnemy); PikminEnemy pikminEnemy = default(PikminEnemy); PikminLatchTrigger latchTrigger = default(PikminLatchTrigger); if (((NetworkBehaviour)this).IsOwner && CurrentIntention == Pintent.Thrown && pikminType.CanLatchOnToObjects && ((Component)collidedEnemy).TryGetComponent(ref pikminEnemy) && ((Component)other).TryGetComponent(ref latchTrigger) && PikChecks.IsEnemyVaildToAttack(pikminEnemy)) { LethalMin.Logger.LogInfo((object)(DebugID + ": Landed on enemy " + ((Object)((Component)other).gameObject).name)); LandPikminOnEnemy(other, latchTrigger, pikminEnemy); } } public virtual void OnCollisionStay(Collision collision) { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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) if (!((NetworkBehaviour)this).IsOwner) { return; } if (LandBuffer > 0f) { LandBuffer -= Time.deltaTime; return; } Pintent currentIntention = CurrentIntention; if (1 == 0) { } string text = currentIntention switch { Pintent.Knockedback => "Knockback", Pintent.Fall => "Fall", _ => "Persistent", }; if (1 == 0) { } string text2 = text; LethalMin.Logger.LogInfo((object)(DebugID + ": " + text2 + " Collision with " + ((Object)collision.gameObject).name)); base.agent.Warp(((Component)this).transform.position); transform2.Teleport(((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.localScale); LandPikminServerRpc(); LandBuffer = 0.5f; } [ServerRpc] public void LandPikminServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1734909243u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1734909243u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LandPikminClientRpc(); } } [ClientRpc] public void LandPikminClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(858704u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 858704u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LandPikmin(); } } } public virtual void LandPikmin() { if (!IsDeadOrDying) { SetCollisionMode(1); bool flag = CurrentIntention == Pintent.Knockedback; SetToIdle(flag); if (flag) { timeLaying = (float)enemyRandom.Next(1, 25) * 0.1f; LethalMin.Logger.LogInfo((object)$"g{DebugID}: Laying for {timeLaying} seconds"); Laying = true; } } else if (base.isEnemyDead && CurrentIntention == Pintent.Knockedback) { CurrentIntention = Pintent.Dead; PreviousIntention = Pintent.Dead; } animController.PlayLandAnim(); } public virtual void LandPikminOnEnemy(Collider hitbox, PikminLatchTrigger latchTrigger, PikminEnemy enemy) { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) if (!pikminType.CanLatchOnToObjects || !((Object)(object)enemy != (Object)null) || !((Object)(object)enemy.enemyScript.enemyType != (Object)(object)base.enemyType) || !((Object)(object)CurrentLatchTrigger == (Object)null) || enemy.enemyScript.isEnemyDead) { return; } if (!enemy.LatchTriggers.Contains(latchTrigger)) { LethalMin.Logger.LogError((object)(DebugID + ": Latch trigger " + ((Object)((Component)latchTrigger).gameObject).name + " not found in " + ((Object)((Component)enemy).gameObject).name + "'s list")); } else { int index = enemy.LatchTriggers.IndexOf(latchTrigger); Vector3 val = hitbox.ClosestPoint(((Component)this).transform.position); if ((Object)(object)enemy != (Object)null && latchTrigger.TryLatch(this, val)) { LatchPikminOnToEnemyServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)enemy).NetworkObject), val, index); } } } [ServerRpc] public void LatchPikminOnToEnemyServerRpc(NetworkObjectReference enemyRef, Vector3 LandPos, int Index = 0) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Invalid comparison between Unknown and I4 //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3521607430u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemyRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref LandPos); BytePacker.WriteValueBitPacked(val2, Index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3521607430u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LatchPikminOnToEnemyClientRpc(enemyRef, LandPos, Index); } } [ClientRpc] public void LatchPikminOnToEnemyClientRpc(NetworkObjectReference enemyRef, Vector3 LandPos, int Index = 0) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2890995472u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemyRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref LandPos); BytePacker.WriteValueBitPacked(val2, Index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2890995472u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { NetworkObject val3 = default(NetworkObject); PikminEnemy enemy = default(PikminEnemy); if (!((NetworkObjectReference)(ref enemyRef)).TryGet(ref val3, (NetworkManager)null) || !((Component)val3).TryGetComponent(ref enemy)) { LethalMin.Logger.LogError((object)(DebugID + ": Failed to get enemy for latching!")); } else { LatchPikminOnToEnemy(enemy, LandPos, Index); } } } public virtual void LatchPikminOnToEnemy(PikminEnemy enemy, Vector3 LandPos, int Index = 0) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) enemy.LatchTriggers[Index].LatchPikmin(this, LandPos); } public void StopThrow(bool PlayAnim = true) { if (CurrentIntention == Pintent.BeingHeld) { if ((Object)(object)leader != (Object)null) { leader.StopThrow(SetCollisionMode: false); } if (PlayAnim) { SetCollisionMode(1); ChangeIntent(Pintent.Idle); animController.ResetToIdleAnim(); } } } [ServerRpc] public void ApplyKnockBackServerRpc(Vector3 direction, float force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Invalid comparison between Unknown and I4 //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3427082973u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3427082973u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ApplyKnockBackClientRpc(direction, force); } } [ClientRpc] public void ApplyKnockBackClientRpc(Vector3 direction, float force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3572780680u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3572780680u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ApplyKnockBack(direction, force); } } } public void ApplyKnockBack(Vector3 direction, float force) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_00bf: 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_00d1: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogDebug((object)$"{DebugID}: Knockback with force: {force} and direction: {direction}"); StopThrow(PlayAnim: false); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); ChangeIntent(Pintent.Knockedback); CallResetMethods(RemoveLeader: true, DropItem: true, RemoveEnemy: true, 3); if (((NetworkBehaviour)this).IsOwner) { rb.rotation = Quaternion.LookRotation(-direction); rb.AddForce(direction * force, (ForceMode)1); rb.constraints = (RigidbodyConstraints)80; } if (LethalMin.RagdollOnKnockback.InternalValue) { Vector3 initialVelocity = ((rb.mass > 0f) ? (direction * force / rb.mass) : (direction * force)); SetupRagdoll(initialVelocity); } else { PlayAnimation(animController.AnimPack.EditorKnockbackAnim); } PlayAudioOnLocalClient(PikminSoundPackSounds.Knockback); } [ServerRpc] public void ApplyPhysicsServerRpc(bool Use3) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4197872781u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Use3, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4197872781u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ApplyPhysicsClientRpc(Use3); } } [ClientRpc] public void ApplyPhysicsClientRpc(bool Use3) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1199057414u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Use3, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1199057414u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ApplyPhysics(Use3); } } } public void ApplyPhysics(bool Use3) { LethalMin.Logger.LogDebug((object)(DebugID + ": Applying Physics")); LandBuffer = 0.25f; StopThrow(PlayAnim: false); ChangeIntent(Pintent.Fall); SetCollisionMode(Use3 ? 3 : 2); TryUnlatchPikmin(); } public void LatchPikmin(PikminLatchTrigger latchTrigger, Vector3 LandPos = default(Vector3)) { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_0185: 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) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogInfo((object)(DebugID + ": Latching onto " + ((Object)latchTrigger).name)); SetCollisionMode(0); StuckEscapeTimer = latchTrigger.WhistleTime; if (latchTrigger.StateToSet == LatchTriggerStateToSet.Attack) { SetCurrentTask("AttackEnemy"); } ChangeIntent(latchTrigger.GetPikminState().Item1); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(latchTrigger.GetPikminState().Item2); if (latchTrigger.KillTimer > 0f) { EditAffecters($"{((Object)((Component)latchTrigger).gameObject).GetInstanceID()}", latchTrigger.KillTimer); } ((Component)this).transform.position = LandPos; if ((Object)(object)LatchRefPoint == (Object)null) { GameObject val = new GameObject(((Object)((Component)this).gameObject).name + "LATCH"); TempObjects.Add(val); LatchRefPoint = val; } LatchRefPoint.transform.SetParent((Transform)null); LatchRefPoint.transform.position = ((Component)this).transform.position; if ((Object)(object)latchTrigger.OverrideLatchObject == (Object)null) { LatchRefPoint.transform.SetParent(((Component)latchTrigger).transform, true); } else { LatchRefPoint.transform.SetParent(((Component)latchTrigger.OverrideLatchObject).transform, true); } LatchTriggerOffset = LatchRefPoint.transform.localPosition; CurrentLatchTrigger = latchTrigger; ((Component)this).transform.position = LatchRefPoint.transform.position; ((Component)this).transform.rotation = LatchRefPoint.transform.rotation; } public bool TryUnlatchPikmin() { if ((Object)(object)CurrentLatchTrigger != (Object)null) { CurrentLatchTrigger.UnlatchPikmin(this); return true; } UnlatchPikmin(); return false; } public void UnlatchPikmin() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)CurrentLatchTrigger != (Object)null) { EditAffecters($"{((Object)((Component)CurrentLatchTrigger).gameObject).GetInstanceID()}", 0f, remove: true); if (PreviousIntention != Pintent.Knockedback && PreviousIntention != Pintent.Dead) { animController.ResetToIdleAnim(); } } CurrentLatchTrigger = null; LatchTriggerOffset = Vector3.zero; if (attackRoutine != null) { ((MonoBehaviour)this).StopCoroutine(attackRoutine); attackRoutine = null; } } public void DoJump(Vector3? Direction = null, Vector3? Target = null) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner) { return; } if (!Direction.HasValue && !Target.HasValue) { LethalMin.Logger.LogError((object)(DebugID + ": DoJump called with no direction or target!")); return; } if (Target.HasValue) { Vector3 val = Target.Value - ((Component)this).transform.position; Direction = ((Vector3)(ref val)).normalized; } if (!Direction.HasValue) { LethalMin.Logger.LogError((object)(DebugID + ": Direction is null after calculation!")); } else { DoJumpServerRpc(Direction.Value); } } [ServerRpc] public void DoJumpServerRpc(Vector3 Direciton) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2367074961u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Direciton); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2367074961u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DoJumpClientRpc(Direciton); } } [ClientRpc] public void DoJumpClientRpc(Vector3 Direction) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4001181276u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Direction); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4001181276u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DoJumpOnLocalClient(Direction); } } } public virtual void DoJumpOnLocalClient(Vector3 Direction) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Direction.x * pikminType.ThrowForce.x, Direction.y * pikminType.ThrowForce.y, Direction.z * pikminType.ThrowForce.z); val += ((Component)this).transform.up * 3f; LethalMin.Logger.LogDebug((object)$"{DebugID}: jumped with force: {val}"); ChangeIntent(Pintent.Thrown); SetCollisionMode(2); ((MonoBehaviour)this).StartCoroutine(DisableColiderAfterJump(0.1f)); Rigidbody obj = rb; obj.position += ((Component)this).transform.up * 1f; ((Component)this).transform.rotation = Quaternion.LookRotation(Direction); rb.AddForce(val, (ForceMode)1); base.creatureVoice.Stop(); PlayAudioOnLocalClient(PikminSoundPackSounds.Thrown); PlayAnimation(animController.AnimPack.EditorThrowAnim); } [IteratorStateMachine(typeof(d__208))] protected IEnumerator DisableColiderAfterJump(float timer) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__208(0) { <>4__this = this, timer = timer }; } public void CheckIfOnNavmesh() { //IL_0070: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)base.agent).enabled && !base.agent.isOnNavMesh && !base.agent.isOnOffMeshLink && !((Object)(object)CurrentLinkAnim != (Object)null)) { if (timeOffNavMesh > 0f) { timeOffNavMesh -= Time.deltaTime; return; } timeOffNavMesh = 4f; Vector3 val = FindPositionToGetIntoBounds(); base.agent.Warp(val); LethalMin.Logger.LogWarning((object)$"{DebugID}: Warped to {val} due to being off navmesh"); } } [ServerRpc] public void WarpIntoBoundsServerRpc(Vector3 Pos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(898356688u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Pos); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 898356688u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; WarpIntoBoundsClientRpc(Pos); } } [ClientRpc] public void WarpIntoBoundsClientRpc(Vector3 Pos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2292476525u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Pos); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2292476525u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; WarpIntoBoundsOnLocalClient(Pos); } } } public virtual void WarpIntoBoundsOnLocalClient(Vector3 Pos) { //IL_0027: 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) LandPikmin(); if (((NetworkBehaviour)this).IsOwner) { base.agent.Warp(Pos); } transform2.TeleportOnLocalClient(Pos); } private Vector3 FindPositionToGetIntoBounds() { //IL_0044: 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_0058: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)leader != (Object)null && !PikChecks.IsLeaderInvalid(leader) && leader.Controller.isPlayerControlled) { Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(((Component)leader).transform.position, default(NavMeshHit), 5f, -1); LethalMin.Logger.LogInfo((object)$"{DebugID}: Found position to get into bounds (leader): {navMeshPosition}"); return navMeshPosition; } if ((Object)(object)previousLeader != (Object)null && !PikChecks.IsLeaderInvalid(previousLeader) && previousLeader.Controller.isPlayerControlled) { Vector3 navMeshPosition2 = RoundManager.Instance.GetNavMeshPosition(((Component)previousLeader).transform.position, default(NavMeshHit), 5f, -1); LethalMin.Logger.LogInfo((object)$"{DebugID}: Found position to get into bounds (previous leader): {navMeshPosition2}"); return navMeshPosition2; } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)this).transform.position, ref val, 100f, -1)) { LethalMin.Logger.LogInfo((object)$"{DebugID}: Found position to get into bounds (navmesh): {((NavMeshHit)(ref val)).position}"); return ((NavMeshHit)(ref val)).position; } LethalMin.Logger.LogWarning((object)(DebugID + ": Could not find position to get into bounds, using local leader's position")); return ((Component)PikminManager.instance.LocalLeader).transform.position; } public Quaternion LookAtTarget(Vector3 target) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_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_0013: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = target - ((Component)this).transform.position; if (val != Vector3.zero) { return Quaternion.LookRotation(val); } return ((Component)this).transform.rotation; } [ServerRpc] public void StartPanicingServerRpc(int mode, int type, string PanicAnim) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Invalid comparison between Unknown and I4 //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_011a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2181149881u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, mode); BytePacker.WriteValueBitPacked(val2, type); bool flag = PanicAnim != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(PanicAnim, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2181149881u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartPanicingClientRpc(mode, type, PanicAnim); } } [ClientRpc] public void StartPanicingClientRpc(int mode, int type, string PanicAnim) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_007e: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1288514242u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, mode); BytePacker.WriteValueBitPacked(val2, type); bool flag = PanicAnim != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(PanicAnim, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1288514242u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PanicOnLocalClient((PikminEffectMode)mode, (PikminEffectType)type, PanicAnim); } } public virtual void PanicOnLocalClient(PikminEffectMode mode, PikminEffectType type, string PanicAnim) { if (CanBeWhistledOutOfPanic && base.currentBehaviourStateIndex == 3 && type == PikminEffectType.Paralized) { LethalMin.Logger.LogWarning((object)(DebugID + ": Overriding current panic state!!!!")); } else if (base.currentBehaviourStateIndex == 3) { LethalMin.Logger.LogWarning((object)(DebugID + ": Panicking while already in panic state")); return; } if (panicSoundRoutine != null) { ((MonoBehaviour)this).StopCoroutine(panicSoundRoutine); panicSoundRoutine = null; } CallResetMethods(); CanBeWhistledOutOfPanic = mode == PikminEffectMode.Limited; ChangeIntent((type == PikminEffectType.Paralized) ? Pintent.MoveableStuck : Pintent.Panicing); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(3); EditAffecters("PANICSTA_" + type, enemyRandom.Next(5, 15)); CurPanicAnim = PanicAnim; switch (PanicAnim) { case "WaterPanic": PlayAnimation(animController.AnimPack.EditorDrowingAnim); DrowningAudioSource.clip = CurrentSoundPack.PullSoundFromDict(PikminSoundPackSounds.Drowning, enemyRandom); DrowningAudioSource.Play(); break; case "PoisonPanic": PlayAnimation(animController.AnimPack.EditorPosionFlopAnim); panicSoundRoutine = ((MonoBehaviour)this).StartCoroutine(PlayRandomPanicSoundOnInterval(PikminSoundPackSounds.Cough, (7, 15))); break; case "FirePanic": PlayAnimation(animController.AnimPack.EditorBurnAnim); panicSoundRoutine = ((MonoBehaviour)this).StartCoroutine(PlayRandomPanicSoundOnInterval(PikminSoundPackSounds.Burn, (7, 15))); break; } LethalMin.Logger.LogInfo((object)$"{DebugID}: Started panicking on local client ({mode}, {type}) = ({CanBeWhistledOutOfPanic},{CurrentIntention})"); } [ServerRpc] public void StopPanicingServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2922207785u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2922207785u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StopPanicingClientRpc(); } } [ClientRpc] public void StopPanicingClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1964685205u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1964685205u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StopPanicingOnLocalClient(); } } } public virtual void StopPanicingOnLocalClient() { //IL_00ef: Unknown result type (might be due to invalid IL or missing references) animController.ResetToIdleAnim(); DrowningAudioSource.Stop(); CurPanicAnim = ""; if (panicSoundRoutine != null) { ((MonoBehaviour)this).StopCoroutine(panicSoundRoutine); panicSoundRoutine = null; } SetToIdle(); List list = new List(DeathTimerAffecters); foreach (string item in list) { if (item.Contains("PANICSTA_")) { EditAffecters(item, 0f, remove: true); } } if (((NetworkBehaviour)this).IsOwner && (Object)(object)LeaderWhistling != (Object)null) { LethalMin.Logger.LogInfo((object)(DebugID + ": Automatically assigning leader after panicking")); AssignLeaderServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)LeaderWhistling).NetworkObject)); LeaderWhistling = null; } } [IteratorStateMachine(typeof(d__221))] private IEnumerator PlayRandomPanicSoundOnInterval(PikminSoundPackSounds sound, (int, int) interval) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__221(0) { <>4__this = this, sound = sound, interval = interval }; } public virtual PikminEnemy? GetClosestEnemy(float overrideDetectionRadius = -1f) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) float num = ((overrideDetectionRadius == -1f) ? pikminType.EnemyDetectionRange : overrideDetectionRadius); PikminEnemy result = null; float num2 = float.MaxValue; foreach (PikminEnemy pikminEnemy in Pmanager.PikminEnemies) { if ((Object)(object)pikminEnemy == (Object)null) { continue; } if (IsInShip) { Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; if (!((Bounds)(ref bounds)).Contains(((Component)pikminEnemy).transform.position)) { continue; } } float num3 = Vector3.Distance(((Component)pikminEnemy).transform.position, ((Component)this).transform.position); if (!(num3 >= num)) { if ((bool)LethalMin.ConvertEnemyBodiesToItems && !LethalMin.EnemyBodyConvertBlacklistConfig.InternalValue.Contains(pikminEnemy.enemyScript.enemyType.enemyName) && !LethalMin.IsDependencyLoaded("Entity378.sellbodies") && pikminEnemy.enemyScript.isEnemyDead && !pikminEnemy.enemyScript.enemyType.destroyOnDeath && !PikminManager.instance.ConvertedAIs.Contains(pikminEnemy.enemyScript)) { LethalMin.Logger.LogMessage((object)(DebugID + ": Converting " + ((Object)((Component)pikminEnemy).gameObject).name + " to grabbable object")); PikminManager.instance.ConvertedAIs.Add(pikminEnemy.enemyScript); PikminManager.instance.ConvertEnemyToGrabbableObjectServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)pikminEnemy).NetworkObject)); } else if (PikChecks.IsEnemyVaildToAttack(pikminEnemy) && num3 < num2) { result = pikminEnemy; num2 = num3; } } } return result; } [ServerRpc] public void SetPikminToEnemyServerRpc(NetworkObjectReference Ref) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(867929509u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Ref, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 867929509u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetPikminToEnemyClientRpc(Ref); } } [ClientRpc] public void SetPikminToEnemyClientRpc(NetworkObjectReference Ref) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3806258439u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Ref, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3806258439u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { NetworkObject val3 = default(NetworkObject); PikminEnemy pikminToEnemyLocalClient = default(PikminEnemy); if (((NetworkObjectReference)(ref Ref)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref pikminToEnemyLocalClient)) { SetPikminToEnemyLocalClient(pikminToEnemyLocalClient); } else { LethalMin.Logger.LogError((object)(DebugID + ": Could not find enemy")); } } } public void SetPikminToEnemyLocalClient(PikminEnemy enemy) { TargetEnemy = enemy; AgentLookTarget = ((Component)enemy).transform; ChangeIntent(Pintent.Attack); SetCurrentTask("AttackEnemy"); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2); } public virtual void AttackEnemyWhenNear() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)TargetEnemy == (Object)null)) { float num = pikminType.AttackDistance + TargetEnemy.enemyScript.agent.radius + TargetEnemy.enemyScript.agent.radius; if (Vector3.Distance(((Component)this).transform.position, ((Component)TargetEnemy).transform.position) < num) { PlayAudioOnLocalClient(PikminSoundPackSounds.Attack); ((MonoBehaviour)this).StartCoroutine(HitEnemyStanding(TargetEnemy)); } } } [IteratorStateMachine(typeof(d__227))] public virtual IEnumerator HitEnemyStanding(PikminEnemy Penemy) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__227(0) { <>4__this = this, Penemy = Penemy }; } public void RemoveTargetEnemy() { if ((Object)(object)TargetEnemy != (Object)null && (Object)(object)AgentLookTarget == (Object)(object)((Component)TargetEnemy).transform) { AgentLookTarget = null; } TargetEnemy = null; if (CurrentTask != null && CurrentTask is AttackEnemyTask) { RemoveCurrentTask(); } } [ServerRpc] public void StartAttackServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1428713689u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1428713689u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartAttackClientRpc(); } } [ClientRpc] public void StartAttackClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1474051394u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1474051394u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner || attackRoutine == null) { StartAttackOnLocalClient(); } } } public void StartAttackOnLocalClient() { LethalMin.Logger.LogInfo((object)(DebugID + ": Started attack on local client")); if (attackRoutine != null) { ((MonoBehaviour)this).StopCoroutine(attackRoutine); attackRoutine = null; } if (attackRoutine == null) { attackRoutine = ((MonoBehaviour)this).StartCoroutine(AttackRoutine()); } } [IteratorStateMachine(typeof(d__232))] private IEnumerator AttackRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__232(0) { <>4__this = this }; } [ServerRpc] public void HitCurLatchTriggerServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3199461236u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3199461236u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitCurLatchTriggerClientRpc(); } } [ClientRpc] public void HitCurLatchTriggerClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1920566672u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1920566672u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { HitCurLatchTriggerOnLocalClient(); } } } public void HitCurLatchTriggerOnLocalClient() { if ((Object)(object)CurrentLatchTrigger != (Object)null) { CurrentLatchTrigger.InvokePikminHit(this); } } public virtual void OnAvoidHazard(PikminHazard hazard, Object? instance = null) { } public void EditAffecters(string val, float timerAddition = 0f, bool remove = false) { if (DeathTimerAffecters.Contains(val)) { if (remove) { LethalMin.Logger.LogInfo((object)(DebugID + ": Remvoing " + val + " to deathtimers")); DeathTimerAffecters.Remove(val); } } else if (!remove) { LethalMin.Logger.LogInfo((object)(DebugID + ": Adding " + val + " to deathtimers")); DeathTimer += timerAddition; DeathTimerAffecters.Add(val); } OverrideDelay = -1f; } [ServerRpc] public void SetInvincibiltyServerRpc(bool val) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendServerRpc(4228624778u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref val, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val3, 4228624778u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetInvincibiltyClientRpc(val); } } [ClientRpc] public void SetInvincibiltyClientRpc(bool val) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendClientRpc(1813866373u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref val, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val3, 1813866373u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Invincible = val; } } } public void SetRandomRotation() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) RandomDeathRotaion = Quaternion.Euler((float)enemyRandom.Next(0, 360), (float)enemyRandom.Next(0, 360), (float)enemyRandom.Next(0, 360)); } public void GrabPikmin(Transform snapPos, float deathDelay, int damage) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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) if (!IsDeadOrDying && !IsGrabbedByEnemy) { if (base.enemyHP - damage > 0) { LethalMin.Logger.LogInfo((object)(DebugID + ": Grabbed by enemy but survived due to damage not being enough to kill")); Vector3 val = ((Component)this).transform.position - ((Component)snapPos).transform.position; ApplyKnockBack(-val, 3f); CanGetBackUp = true; DeathSnapToPos = null; base.enemyHP -= damage; } else { IsGrabbedByEnemy = true; grabDeathTimer = deathDelay; DeathSnapToPos = snapPos; SetRandomRotation(); Laying = true; CallResetMethods(RemoveLeader: true, DropItem: true, RemoveEnemy: true, -1, Unlatch: true, RemoveTask: true, RemoveOverridePositions: true, SetLayingFalse: false); ChangeIntent(Pintent.Stuck); PlayAnimation(animController.AnimPack.EditorLayingAnim); PlayAudioOnLocalClient(PikminSoundPackSounds.Hurt); LethalMin.Logger.LogInfo((object)$"{DebugID}: Grabbed by enemy, will die in {deathDelay}s if not released."); } } } public void ReleaseFromGrab() { //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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (!IsGrabbedByEnemy) { return; } IsGrabbedByEnemy = false; grabDeathTimer = -1f; DeathSnapToPos = null; Laying = false; if (isRagdolled) { CleanupRagdoll(); } if (!IsDeadOrDying) { LethalMin.Logger.LogInfo((object)(DebugID + ": Released from enemy grab — surviving!")); SetToIdle(); ApplyPhysics(Use3: true); if (((NetworkBehaviour)this).IsOwner) { Vector3 val = new Vector3(Random.Range(-1f, 1f), 3f, Random.Range(-1f, 1f)); Vector3 normalized = ((Vector3)(ref val)).normalized; ApplyKnockBackServerRpc(normalized, 3f); } } } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_0359: 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_0251: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: 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_0215: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03af: 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_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) if (Invincible) { LethalMin.Logger.LogInfo((object)(DebugID + ": Has Invincible mode when hit")); DeathSnapToPos = null; return; } if (IsDeadOrDying) { LethalMin.Logger.LogInfo((object)(DebugID + ": Hit While Dead or Dying")); return; } if ((Object)(object)previousLeader != (Object)null && (Object)(object)playerWhoHit == (Object)(object)previousLeader.Controller && CurrentIntention == Pintent.Attack && !friednlyFire) { LethalMin.Logger.LogInfo((object)(DebugID + ": Hit by previous leader in attack state, ignoring hit")); DeathSnapToPos = null; return; } if ((Object)(object)this.leader != (Object)null && (Object)(object)playerWhoHit != (Object)null && (Object)(object)playerWhoHit == (Object)(object)this.leader.Controller && !friednlyFire) { LethalMin.Logger.LogInfo((object)(DebugID + ": FriendlyFire mode")); DeathSnapToPos = null; return; } Leader leader = default(Leader); if ((Object)(object)playerWhoHit != (Object)null && (Object)(object)playerWhoHit != (Object)null && ((Component)playerWhoHit).TryGetComponent(ref leader) && !leader.FriendlyerFire.Value) { LethalMin.Logger.LogInfo((object)(DebugID + ": FriendlyerFire mode")); DeathSnapToPos = null; return; } ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (IsWildPikmin && (bool)LethalMin.WildPikminNoDeath) { Vector3 direction = default(Vector3); ((Vector3)(ref direction))..ctor((0f - ((Component)this).transform.forward.x) * 2f, 3f, (0f - ((Component)this).transform.forward.z) * 2f); if ((Object)(object)playerWhoHit != (Object)null) { Vector3 val = ((Component)this).transform.position - ((Component)playerWhoHit).transform.position; ((Vector3)(ref direction))..ctor(((Vector3)(ref val)).normalized.x * 2f, 3f, ((Vector3)(ref val)).normalized.z * 2f); } DeathSnapToPos = null; CanGetBackUp = true; ApplyKnockBack(direction, 3 + force); return; } if ((Object)(object)DeathSnapToPos != (Object)null) { LethalMin.Logger.LogInfo((object)(DebugID + ": is snapped to position")); base.enemyHP -= force; if (base.enemyHP <= 0) { hitBeforeKillWasCalled = true; ((EnemyAI)this).KillEnemy(false); PlayAnimation(animController.AnimPack.EditorLayingAnim); PlayAudioOnLocalClient(PikminSoundPackSounds.Hurt); } else { Vector3 val2 = ((Component)this).transform.position - ((Component)DeathSnapToPos).transform.position; ApplyKnockBack(-val2, 3f); DeathSnapToPos = null; } return; } LethalMin.Logger.LogInfo((object)$"{DebugID} was hit: {force}"); Vector3 direction2 = default(Vector3); ((Vector3)(ref direction2))..ctor((0f - ((Component)this).transform.forward.x) * 2f, 3f, (0f - ((Component)this).transform.forward.z) * 2f); if ((Object)(object)playerWhoHit != (Object)null) { Vector3 val3 = ((Component)this).transform.position - ((Component)playerWhoHit).transform.position; ((Vector3)(ref direction2))..ctor(((Vector3)(ref val3)).normalized.x * 2f, 3f, ((Vector3)(ref val3)).normalized.z * 2f); } LandBuffer = 0.25f; base.enemyHP -= force; LethalMin.Logger.LogInfo((object)$"{DebugID} HP left: {base.enemyHP}"); if (base.enemyHP > 0) { ApplyKnockBack(direction2, 3 + force); return; } LandBuffer = 0.1f; ApplyKnockBack(direction2, force); hitBeforeKillWasCalled = true; ((EnemyAI)this).KillEnemy(false); } public void HitFromExplosionAndSync(Vector3 explosionPosition, float killRange = 1f, float damageRange = 1f, int nonLethalDamage = 50, float physicsForce = 0f) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer) { HitFromExplosionClientRpc(explosionPosition, killRange, damageRange, nonLethalDamage, physicsForce); } else { HitFromExplosionServerRpc(explosionPosition, killRange, damageRange, nonLethalDamage, physicsForce); } } [ServerRpc] public void HitFromExplosionServerRpc(Vector3 explosionPosition, float killRange = 1f, float damageRange = 1f, int nonLethalDamage = 50, float physicsForce = 0f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Invalid comparison between Unknown and I4 //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1180021914u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref explosionPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref killRange, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref damageRange, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, nonLethalDamage); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref physicsForce, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1180021914u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitFromExplosionClientRpc(explosionPosition, killRange, damageRange, nonLethalDamage, physicsForce); } } [ClientRpc] public void HitFromExplosionClientRpc(Vector3 explosionPosition, float killRange = 1f, float damageRange = 1f, int nonLethalDamage = 50, float physicsForce = 0f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00d3: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1651300942u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref explosionPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref killRange, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref damageRange, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, nonLethalDamage); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref physicsForce, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1651300942u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitFromExplosion(explosionPosition, killRange, damageRange, nonLethalDamage, physicsForce); } } } public void HitFromExplosion(Vector3 explosionPosition, float killRange = 1f, float damageRange = 1f, int nonLethalDamage = 50, float physicsForce = 0f) { //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) if (Invincible) { LethalMin.Logger.LogInfo((object)(DebugID + ": Has Invincible mode when hit from explosion")); if (PikminManager.instance.Cheat_InvinceablePikmin.Value && !PikminManager.instance.Cheat_NoKnockback.Value) { LethalMin.Logger.LogInfo((object)(DebugID + ": Applying knockback despite invincibility due to configs")); Vector3 val = ((Component)this).transform.position - explosionPosition; ((Vector3)(ref val)).Normalize(); ((Vector3)(ref val))..ctor(val.x * 3f, 3f, val.z * 3f); LandBuffer = 0.25f; ApplyKnockBack(val, physicsForce + 4f); } } else { if (IsDeadOrDying) { return; } if (PikChecks.IsPikminResistantToHazard(pikminType, PikminHazard.Explosive)) { LethalMin.Logger.LogInfo((object)(DebugID + ": Pikmin is resistant to explosive hazard, avoiding damage")); OnAvoidHazard(PikminHazard.Explosive); return; } float num = Vector3.Distance(((Component)this).transform.position, explosionPosition); Vector3 val2 = ((Component)this).transform.position - explosionPosition; ((Vector3)(ref val2)).Normalize(); Vector3 direction = default(Vector3); ((Vector3)(ref direction))..ctor(val2.x * 3f, 3f, val2.z * 3f); LandBuffer = 0.25f; if (num < killRange) { LethalMin.Logger.LogInfo((object)$"{DebugID}: Killed instantly by explosion - within kill range ({num}/{killRange})"); base.enemyHP = 0; ApplyKnockBack(direction, physicsForce + 4f); hitBeforeKillWasCalled = true; ((EnemyAI)this).KillEnemy(false); } else if (num <= damageRange) { float num2 = num / damageRange; int num3 = Mathf.CeilToInt((1f - num2) * ((float)nonLethalDamage / 100f) * 5f); if (num3 <= 0) { num3 = 0; } base.enemyHP -= num3; LethalMin.Logger.LogInfo((object)($"{DebugID}: Hit from explosion (HP: {base.enemyHP}, Damage: {num3}, " + $"Distance: {num}, NDist: {num2} pForce: {physicsForce})")); float force = physicsForce + 5f * (1f - num2); if (base.enemyHP > 0) { ApplyKnockBack(direction, force); return; } ApplyKnockBack(direction, force); hitBeforeKillWasCalled = true; ((EnemyAI)this).KillEnemy(false); } } } [ServerRpc] public void DoSquishDeathServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4048339311u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4048339311u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DoSquishDeathClientRpc(); } } [ClientRpc] public void DoSquishDeathClientRpc(bool DoOwnerCheck = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2649897065u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref DoOwnerCheck, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2649897065u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner || !DoOwnerCheck) { DoSquishDeath(); } } } public void DoSquishDeath() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_007a: 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) if (Invincible) { LethalMin.Logger.LogInfo((object)(DebugID + ": Has Invincible mode when doing squish death")); } else if (!IsDeadOrDying) { if (IsWildPikmin && (bool)LethalMin.WildPikminNoDeath) { Vector3 direction = default(Vector3); ((Vector3)(ref direction))..ctor((0f - ((Component)this).transform.forward.x) * 2f, 3f, (0f - ((Component)this).transform.forward.z) * 2f); DeathSnapToPos = null; CanGetBackUp = true; ApplyKnockBack(direction, 3f); } else { LethalMin.Logger.LogInfo((object)(DebugID + ": Squished to death")); hitBeforeKillWasCalled = true; PlayAudioOnLocalClient(PikminSoundPackSounds.Crush); PlayAudioOnLocalClient(PikminSoundPackSounds.CrushSFX, PlayOnVoice: false); ((Component)modelContainer).transform.localScale = new Vector3(((Component)modelContainer).transform.localScale.x, 0.1f, ((Component)modelContainer).transform.localScale.z); ((EnemyAI)this).KillEnemy(false); } } } [ServerRpc] public void DoZapDeathServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2705545787u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2705545787u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DoZapDeathClientRpc(); } } [ClientRpc] public void DoZapDeathClientRpc(bool DoOwnerCheck = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3834188207u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref DoOwnerCheck, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3834188207u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner || !DoOwnerCheck) { DoZapDeath(); } } } public void DoZapDeath() { //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_009f: Unknown result type (might be due to invalid IL or missing references) if (Invincible) { LethalMin.Logger.LogInfo((object)(DebugID + ": Has Invincible mode when doing zap death")); } else { if (IsDeadOrDying) { return; } if (IsWildPikmin && (bool)LethalMin.WildPikminNoDeath) { Vector3 direction = default(Vector3); ((Vector3)(ref direction))..ctor((0f - ((Component)this).transform.forward.x) * 2f, 3f, (0f - ((Component)this).transform.forward.z) * 2f); DeathSnapToPos = null; CanGetBackUp = true; ApplyKnockBack(direction, 3f); return; } LethalMin.Logger.LogInfo((object)(DebugID + ": Zapped to death")); hitBeforeKillWasCalled = true; PikminZap component = Object.Instantiate(LethalMin.PikminZapPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation).GetComponent(); ((EnemyAI)this).EnableEnemyMesh(false, true, false); component.LostType = pikminType; component.InMemoryof = DebugID; component.ghostRandom = enemyRandom; base.isEnemyDead = true; base.enemyHP = 0; CurrentIntention = Pintent.Dead; PreviousIntention = Pintent.Dead; CallResetMethods(RemoveLeader: true, DropItem: true, RemoveEnemy: true, -1, Unlatch: true, RemoveTask: true, RemoveOverridePositions: true, SetLayingFalse: false); ((Behaviour)base.agent).enabled = false; Pmanager.EndOfGameStats.PikminKilled++; Pmanager.FiredStats.TotalPikminLost++; if (((NetworkBehaviour)this).NetworkObject.IsSpawned) { IncrumentDestoryCountServerRpc(); } } } public override void KillEnemy(bool destroy = false) { //IL_0079: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) if (Invincible) { LethalMin.Logger.LogInfo((object)(DebugID + ": Has Invincible mode when trying to kill")); return; } if (IsDeadOrDying) { LethalMin.Logger.LogInfo((object)(DebugID + ": KillEnemy called but already dead or dying, ignoring")); return; } if (IsWildPikmin && (bool)LethalMin.WildPikminNoDeath) { Vector3 direction = default(Vector3); ((Vector3)(ref direction))..ctor((0f - ((Component)this).transform.forward.x) * 2f, 3f, (0f - ((Component)this).transform.forward.z) * 2f); DeathSnapToPos = null; CanGetBackUp = true; ApplyKnockBack(direction, 3f); return; } if (destroy && ((NetworkBehaviour)this).IsServer) { LethalMin.Logger.LogInfo((object)(DebugID + ": Died, but due to the way zeekees programmed it we need to do dis first")); base.isEnemyDead = true; CurrentIntention = Pintent.Dead; PreviousIntention = Pintent.Dead; CallResetMethods(RemoveLeader: true, DropItem: true, RemoveEnemy: true, -1, Unlatch: true, RemoveTask: true, RemoveOverridePositions: true, SetLayingFalse: false); SpawnGhostClientRpc(); ((EnemyAI)this).KillEnemy(destroy); return; } ((EnemyAI)this).KillEnemy(destroy); if (!base.isEnemyDead) { LethalMin.Logger.LogWarning((object)(DebugID + ": base.KillEnemy did not set isEnemyDead, forcing it")); base.isEnemyDead = true; } LethalMin.Logger.LogInfo((object)(DebugID + ": Died")); if (pikminType.DamageDeltUponDeath > 0f) { foreach (PikminEnemy pikminEnemy in PikminManager.instance.PikminEnemies) { if (Vector3.Distance(((Component)this).transform.position, ((Component)pikminEnemy).transform.position) < pikminType.DeathDamageRange) { pikminEnemy.HitEnemy(pikminType.DamageDeltUponDeath * pikminType.GetAttackStrength(CurrentGrowthStage)); } } } CallResetMethods(RemoveLeader: true, DropItem: true, RemoveEnemy: true, -1, Unlatch: true, RemoveTask: true, RemoveOverridePositions: true, SetLayingFalse: false); if (!hitBeforeKillWasCalled) { PlayAnimation(animController.AnimPack.EditorLayingAnim); PlayAudioOnLocalClient(PikminSoundPackSounds.Hurt); CurrentIntention = Pintent.Dead; PreviousIntention = Pintent.Dead; } if (OverrideDelay > 0f) { ((MonoBehaviour)this).StartCoroutine(SpawnGhostAfterDelay(OverrideDelay)); } else { ((MonoBehaviour)this).StartCoroutine(SpawnGhostAfterDelay()); } } [ServerRpc] public void SpawnGhostServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(817792021u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 817792021u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SpawnGhostClientRpc(); } } [ClientRpc] public void SpawnGhostClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3201010991u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3201010991u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SpawnGhost(); } } } public void SpawnGhost() { //IL_0028: 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) LethalMin.Logger.LogInfo((object)(DebugID + ": Spawning Ghost")); try { PikminGhost component = Object.Instantiate(LethalMin.PikminGhostPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation).GetComponent(); component.LostType = pikminType; component.InMemoryof = DebugID; component.ghostRandom = enemyRandom; Pmanager.EndOfGameStats.PikminKilled++; Pmanager.FiredStats.TotalPikminLost++; } catch (Exception arg) { LethalMin.Logger.LogError((object)$"{DebugID}: Error spawning ghost: {arg}"); } if (((NetworkBehaviour)this).NetworkObject.IsSpawned) { IncrumentDestoryCountServerRpc(); } } [IteratorStateMachine(typeof(d__258))] private IEnumerator SpawnGhostAfterDelay(float delay = 2f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__258(0) { <>4__this = this, delay = delay }; } [ServerRpc(RequireOwnership = false)] public void IncrumentDestoryCountServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2663682730u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2663682730u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; destoryCounter++; LethalMin.Logger.LogDebug((object)$"{DebugID}: {destoryCounter} - {StartOfRound.Instance.connectedPlayersAmount + 1}"); if (destoryCounter >= StartOfRound.Instance.connectedPlayersAmount + 1) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } } public void GetGrowthObjects() { PikminModelRefernces componentInChildren = ((Component)this).GetComponentInChildren(); Dictionary> growthObjectsf; if ((Object)(object)componentInChildren.growthObjectsCache == (Object)null) { growthObjects = new Dictionary>(); growthObjectsf = new Dictionary>(); growthObjects.Clear(); MaxGrowthStage = 0; ProcessPlants(componentInChildren.Plants); PikminModelGeneration[] generations = componentInChildren.Generations; foreach (PikminModelGeneration pikminModelGeneration in generations) { ProcessPlants(pikminModelGeneration.Plants); } HasNoGrowthStages = growthObjects.Count == 0; if (HasNoGrowthStages) { LethalMin.Logger.LogWarning((object)(DebugID + ": No growth stages found")); return; } if (pikminType.CachePlantObjectRefernces) { LethalMin.Logger.LogDebug((object)(DebugID + ": Caching growth objects")); PikminModelRefernces modelRefernces = pikminType.modelRefernces; ProcessPlants2(modelRefernces.Plants); PikminModelGeneration[] generations2 = modelRefernces.Generations; foreach (PikminModelGeneration pikminModelGeneration2 in generations2) { ProcessPlants2(pikminModelGeneration2.Plants); } modelRefernces.SetGrowthObjects(growthObjectsf); LethalMin.Logger.LogDebug((object)(DebugID + ": Caching growth objects done")); } LethalMin.Logger.LogDebug((object)$"{DebugID}: Found {growthObjects.Count} plants across {MaxGrowthStage + 1} stages"); } else { growthObjects = componentInChildren.GetGrowthObjects(); LethalMin.Logger.LogDebug((object)(DebugID + ": Using Cached growth objects")); } void ProcessPlants(List plants, int generationOffset = 0) { foreach (GameObject plant in plants) { if ((Object)(object)plant == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Growth object is null")); } else { int num = plants.IndexOf(plant); if (!growthObjects.ContainsKey(num)) { growthObjects[num] = new List(); } growthObjects[num].Add(plant); if (num > MaxGrowthStage) { MaxGrowthStage = num; } LethalMin.Logger.LogDebug((object)$"{DebugID}: Found plant {((Object)plant).name} at index {num}"); } } } void ProcessPlants2(List plants, int generationOffset = 0) { foreach (GameObject plant2 in plants) { if ((Object)(object)plant2 == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Growth object is null in prefab")); } else { int key = plants.IndexOf(plant2); if (!growthObjectsf.ContainsKey(key)) { growthObjectsf[key] = new List(); } growthObjectsf[key].Add(plant2); } } } } public void SetGrowth(int Stage) { if (HasNoGrowthStages) { return; } if (Stage < 0 || Stage > MaxGrowthStage) { LethalMin.Logger.LogWarning((object)$"{DebugID}: Invalid growth stage {Stage}"); return; } LethalMin.Logger.LogInfo((object)$"{DebugID}: Setting growth stage to {Stage}"); CurrentGrowthStage = Stage; CurrentCarryStrength = pikminType.GetCarryStrength(Stage); foreach (KeyValuePair> growthObject in growthObjects) { foreach (GameObject item in growthObject.Value) { item.SetActive(growthObject.Key == Stage); } } } [ServerRpc] public void SetGrowthServerRpc(int Stage) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2085065388u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, Stage); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2085065388u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetGrowthClientRpc(Stage); } } [ClientRpc] public void SetGrowthClientRpc(int Stage) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2717484314u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, Stage); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2717484314u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!HasNoGrowthStages) { SetGrowth(Stage); } } } public virtual PikminItem? GetClosestPikminItem(float overrideDetectionRadius = -1f) { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) float num = ((overrideDetectionRadius == -1f) ? pikminType.ItemDetectionRange : overrideDetectionRadius); PikminItem result = null; float num2 = float.MaxValue; bool flag = false; foreach (PikminItem pikminItem in Pmanager.PikminItems) { if ((Object)(object)pikminItem == (Object)null || (Object)(object)pikminItem.ItemScript == (Object)null || pikminItem.settings.ExcludeFromGetItemsCheck || !pikminItem.settings.GrabableToPikmin || (LethalMin.OnCompany && (bool)LethalMin.IgnoreNonScrapItemsToCompany && !pikminItem.ItemScript.itemProperties.isScrap) || LethalMin.ItemBlacklistConfig.InternalValue.Contains(pikminItem.ItemScript.itemProperties.itemName)) { continue; } float num3 = Vector3.Distance(((Component)this).transform.position, ((Component)pikminItem.ItemScript).transform.position); if (!(num3 > num) && PikChecks.IsPikminItemValid(pikminItem)) { bool flag2 = !pikminItem.IsBeingCarried; if ((flag2 && !flag) || (flag2 == flag && num3 < num2)) { result = pikminItem; num2 = num3; flag = flag2; } } } return result; } [ServerRpc] public void SetPikminToItemServerRpc(NetworkObjectReference Ref, int GrabPosIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Invalid comparison between Unknown and I4 //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2261270484u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Ref, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, GrabPosIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2261270484u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetPikminToItemClientRpc(Ref, GrabPosIndex); } } [ClientRpc] public void SetPikminToItemClientRpc(NetworkObjectReference Ref, int GrabPosIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3666518037u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Ref, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, GrabPosIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3666518037u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsOwner) { return; } NetworkObject val3 = default(NetworkObject); if (!((NetworkObjectReference)(ref Ref)).TryGet(ref val3, (NetworkManager)null)) { LethalMin.Logger.LogError((object)$"{DebugID}: Failed to get NetworkObject from reference {Ref}. Cannot set pikmin to item."); return; } PikminItem componentInChildren = ((Component)val3).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { SetPikminToItemLocalClient(componentInChildren, GrabPosIndex); } else { LethalMin.Logger.LogError((object)$"{DebugID}: Item is null when trying to set to it from reference {Ref}"); } } public void SetPikminToItemLocalClient(PikminItem itm, int GrabPosIndex) { if ((Object)(object)itm == (Object)null) { SetToIdle(); LethalMin.Logger.LogError((object)(DebugID + ": Item is null when trying to set to it")); return; } BoolValue boolValue = itm.GrabToPositions[GrabPosIndex]; if ((Object)(object)boolValue == (Object)null) { SetToIdle(); LethalMin.Logger.LogError((object)(DebugID + ": Item grab pos is null when trying to set to it")); return; } LethalMin.Logger.LogInfo((object)(DebugID + ": targeting item " + ((Object)((Component)itm).gameObject).name + " at " + ((Object)((Component)boolValue).gameObject).name)); boolValue.value = true; TargetItem = itm; AgentLookTarget = ((Component)itm).transform; TargetItemPoint = boolValue; SetCurrentTask("CarryItem"); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2); ChangeIntent(Pintent.RunTowards); } [ServerRpc] public void GrabItemServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1054655244u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1054655244u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GrabItemClientRpc(); } } [ClientRpc] public void GrabItemClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1838956985u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1838956985u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { GrabItemOnLocalClient(TargetItem); } } } public void GrabItemOnLocalClient(PikminItem itm) { if ((Object)(object)itm == (Object)null) { SetToIdle(); LethalMin.Logger.LogError((object)(DebugID + ": Item is null when trying to grab it")); return; } itm.PikminOnItem.Add(this); TargetItem = itm; ChangeIntent(Pintent.Waiting); if (itm.IsBeingCarried) { SetAsCarryingItem(cullAudio: false); } LethalMin.Logger.LogInfo((object)$"{DebugID}: Grabbed item {((Object)((Component)itm).gameObject).name} Speed is now: {itm.GetSpeed(OverrideCarryCheck: true)}"); } public void SetAsCarryingItem(bool cullAudio = true) { if ((Object)(object)TargetItem.PrimaryPikminOnItem != (Object)(object)this) { SetCollisionMode(0); } AgentLookTarget = null; ChangeIntent(Pintent.Carry); float overrideVolume = ((TargetItem.PikminOnItem.Count == 0 || !cullAudio) ? 1f : (1f / (float)TargetItem.PikminOnItem.Count)); PlayAudioOnLocalClient("ItemLift", PlayOnVoice: true, overrideVolume); } public void UnsetAsCarryingItem() { if ((Object)(object)TargetItem == (Object)null) { DropItemOnLocalClient(); return; } SetCollisionMode(1); AgentLookTarget = ((Component)TargetItem).transform; ChangeIntent(Pintent.Waiting); } [ServerRpc] public void DropItemServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1674497089u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1674497089u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DropItemClientRpc(); } } [ClientRpc] public void DropItemClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(792549318u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 792549318u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DropItemOnLocalClient(); } } } public void DropItemOnLocalClient() { //IL_00d3: 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) //IL_00e0: 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_00ae: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)TargetItem != (Object)null && (Object)(object)AgentLookTarget == (Object)(object)((Component)TargetItem).transform) { AgentLookTarget = null; } if ((Object)(object)TargetItem != (Object)null && TargetItem.PikminOnItem.Contains(this)) { LethalMin.Logger.LogInfo((object)(DebugID + ": Dropped item " + ((Object)((Component)TargetItem).gameObject).name)); SetCollisionMode(1); if (((NetworkBehaviour)this).IsOwner) { base.agent.Warp(((Component)TargetItemPoint).transform.position); } else { transform2.TeleportOnLocalClient(RoundManager.Instance.GetNavMeshPosition(((Component)TargetItemPoint).transform.position, default(NavMeshHit), 5f, -1)); } TargetItem.PikminOnItem.Remove(this); if (CurrentIntention != Pintent.Carry && CurrentIntention != Pintent.Waiting) { } } TargetItem = null; if ((Object)(object)TargetItemPoint != (Object)null) { TargetItemPoint.value = false; } TargetItemPoint = null; } [ServerRpc] public void UseEntranceServerRpc(NetworkObjectReference Ref, bool Inside, bool PlaySFX = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Invalid comparison between Unknown and I4 //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3535002757u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Ref, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Inside, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PlaySFX, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3535002757u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UseEntranceClientRpc(Ref, Inside, PlaySFX); } } [ClientRpc] public void UseEntranceClientRpc(NetworkObjectReference Ref, bool Inside, bool PlaySFX = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_0112: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2963825920u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Ref, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Inside, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PlaySFX, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2963825920u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); EntranceTeleport entrance = default(EntranceTeleport); if (((NetworkObjectReference)(ref Ref)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref entrance)) { UseEntranceOnLocalClient(entrance, Inside, PlaySFX); } else { LethalMin.Logger.LogError((object)(DebugID + ": Could not find entrance")); } } } public virtual void UseEntranceOnLocalClient(EntranceTeleport entrance, bool Inside, bool PlaySFX = true) { //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)entrance == (Object)null) { LethalMin.Logger.LogWarning((object)(DebugID + ": Entrance is null")); return; } LethalMin.Logger.LogInfo((object)(DebugID + ": Using entrance " + ((Object)entrance).name)); if ((Object)(object)entrance.exitScript == (Object)null) { entrance.FindExitPoint(); LethalMin.Logger.LogWarning((object)(DebugID + ": Entrance exit point was null, trying to find it again")); } if ((Object)(object)entrance.exitScript == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Entrance exit point is null, cannot use entrance (blocked???)")); return; } if (PlaySFX) { entrance.PlayAudioAtTeleportPositions(); } if (((NetworkBehaviour)this).IsOwner && ((Behaviour)base.agent).enabled) { base.agent.Warp(entrance.exitScript.entrancePoint.position); } transform2.TeleportOnLocalClient(entrance.exitScript.entrancePoint.position); base.isOutside = !Inside; } public virtual void WarpToMatchLeaderDoors(bool isInside) { //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)leader == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Leader is null when trying to warp to match leader doors")); return; } if (((NetworkBehaviour)this).IsOwner) { if ((bool)LethalMin.TeleportAroundPlayerWhenEnteringBuilding) { int num = leader.PikminInSquad.IndexOf(this); int count = leader.PikminInSquad.Count; float num2 = ((count != 1) ? (-90f + 180f / (float)(count - 1) * (float)num) : 0f); float num3 = 1f; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Mathf.Sin(num2 * (MathF.PI / 180f)) * num3, 0f, Mathf.Cos(num2 * (MathF.PI / 180f)) * num3); Vector3 val2 = ((Component)leader).transform.TransformDirection(val); Vector3 val3 = ((Component)leader).transform.position + val2; LethalMin.Logger.LogInfo((object)$"{DebugID}: Warping to position around leader at angle {num2} degrees"); base.agent.Warp(RoundManager.Instance.GetNavMeshPosition(val3, default(NavMeshHit), 5f, -1)); } else { base.agent.Warp(RoundManager.Instance.GetNavMeshPosition(((Component)leader).transform.position, default(NavMeshHit), 5f, -1)); } } else { transform2.TeleportOnLocalClient(((Component)leader).transform.position, ((Component)leader).transform.rotation); } SetOutsideBool(!isInside); } public void SetOutsideBool(bool value) { base.isOutside = value; } public void PlayAndSyncAudio(PikminSoundPackSounds sound, bool PlayOnVoice = true) { PlayAndSyncAudio(sound.ToString(), PlayOnVoice); } public void PlayAndSyncAudio(string Name, bool PlayOnVoice = true) { if (!((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogError((object)(DebugID + ": Attempted to play and sync audio on a client")); return; } if (!CurrentSoundPack.IsKeyValid(Name)) { LethalMin.Logger.LogError((object)(DebugID + ": attmpted to play an invalid sound")); return; } PlayAudioOnLocalClient(Name, PlayOnVoice); if (((NetworkBehaviour)this).IsServer) { PlayAudioClientRpc(Name, PlayOnVoice); } else { PlayAudioServerRpc(Name, PlayOnVoice); } } [ServerRpc] public void PlayAudioServerRpc(string Name, bool PlayOnVoice) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Invalid comparison between Unknown and I4 //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_0101: 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_011b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3446476118u, val, (RpcDelivery)0); bool flag = Name != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Name, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PlayOnVoice, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3446476118u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayAudioClientRpc(Name, PlayOnVoice); } } [ClientRpc] public void PlayAudioClientRpc(string Name, bool PlayOnVoice) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00d5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(340066622u, val, (RpcDelivery)0); bool flag = Name != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Name, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PlayOnVoice, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 340066622u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { PlayAudioOnLocalClient(Name, PlayOnVoice); } } } public void PlayAudioOnLocalClient(PikminSoundPackSounds sounds, bool PlayOnVoice = true) { PlayAudioOnLocalClient(sounds.ToString(), PlayOnVoice); } public void PlayAudioOnLocalClient(string Name, bool PlayOnVoice = true, float overrideVolume = -1f) { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if (!CurrentSoundPack.IsKeyValid(Name, logWarnings: false)) { LethalMin.Logger.LogWarning((object)(DebugID + ": attempted to play an invalid sound (" + Name + "), most likely due to having no sounds for it.")); CurrentPlayingKey = ""; return; } CurrentPlayingKey = Name; float num = ((overrideVolume == -1f) ? CalculateAdjustedVolume(Name) : overrideVolume); AudioSource val = (PlayOnVoice ? base.creatureVoice : base.creatureSFX); AudioClip val2 = CurrentSoundPack.PullSoundFromDict(Name, enemyRandom); val.PlayOneShot(val2, num); WalkieTalkie.TransmitOneShotAudio(val, val2, num); if (!LethalMin.DontMakeAudibleNoisesCheat) { RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 10f, num, 0, IsInShip && StartOfRound.Instance.hangarDoorsClosed, PikminSoundID); } } private float CalculateAdjustedVolume(string soundName) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) int num = 0; foreach (PikminAI pikminAI in Pmanager.PikminAIs) { if (!((Object)(object)pikminAI == (Object)null) && (Object)(object)pikminAI != (Object)(object)this && Vector3.Distance(((Component)this).transform.position, ((Component)pikminAI).transform.position) <= maxAudioClusterDistance && (((EnemyAI)pikminAI).creatureSFX.isPlaying || ((EnemyAI)pikminAI).creatureVoice.isPlaying) && pikminAI.CurrentPlayingKey == soundName) { num++; } } return Mathf.Clamp01(1f - (float)num / (float)maxAudioClusterPikmin); } [IteratorStateMachine(typeof(d__291))] private IEnumerator PlayDelayedSound(string soundName, float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__291(0) { <>4__this = this, soundName = soundName, delay = delay }; } public void PlaySingingAudio(bool isLeadSinger) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) if (CurrentSoundPack.IsKeyValid("Singing", logWarnings: false) && isLeadSinger) { AudioClip val = CurrentSoundPack.PullSoundFromDict("Singing", enemyRandom); base.creatureVoice.PlayOneShot(val, 0.5f); WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, val, 0.5f); if (!LethalMin.DontMakeAudibleNoisesCheat) { RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 10f, 0.5f, 0, IsInShip && StartOfRound.Instance.hangarDoorsClosed, PikminSoundID); } } } public void PlayAnimation(AnimationClip? animation, float transitionDuration = 0.25f, int layer = 0) { if ((Object)(object)animation == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Attempted to play a null animation")); } else { animController.PlayAnimation(((Object)animation).name, transitionDuration, layer); } } [IteratorStateMachine(typeof(d__294))] private IEnumerator DelayMovement(float val) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__294(0) { <>4__this = this, val = val }; } [IteratorStateMachine(typeof(d__295))] private IEnumerator PlayDelayedAnimation(string animationName, float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__295(0) { <>4__this = this, animationName = animationName, delay = delay }; } public void UpdateIdleAnimation() { if (animController.AnimPack.UseStateMachineForIdleAnims) { base.creatureAnimator.SetInteger("RandomIdle", animController.RandomIdle); } else if (!PikUtils.IsOutOfRange(animController.AnimPack.EditorIdleAnim, animController.RandomIdle)) { animController.IdleAnim = animController.AnimPack.EditorIdleAnim[animController.RandomIdle]; } else { LethalMin.Logger.LogWarning((object)$"{DebugID}: RandomIdle is out of range: {animController.RandomIdle} / {animController.AnimPack.EditorIdleAnim.Count}"); } if (base.currentBehaviourStateIndex != 0 || CurrentIntention != 0) { if (animController.AnimPack.EditorIdleAnim.Count != 0) { animController.IdleAnim = animController.AnimPack.EditorIdleAnim[0]; } animController.RandomIdle = 0; } else if (IdleAnimTimer > 0f) { IdleAnimTimer -= Time.deltaTime; } else { IdleAnimTimer = enemyRandom.Next(5, 60); animController.RandomIdle = enemyRandom.Next(animController.AnimPack.EditorIdleAnim.Count); } } public virtual void DoYay(bool OverrideVol = false, bool RecursiveCall = false) { if (attackRoutine != null) { ((MonoBehaviour)this).StartCoroutine(DelayedYay(OverrideVol)); return; } if (!RecursiveCall && IsAirborn) { ((MonoBehaviour)this).StartCoroutine(DelayedYayUntilGrounded(OverrideVol)); return; } if (OverrideVol) { PlayAudioOnLocalClient("Yay", PlayOnVoice: true, 1f); } else { PlayAudioOnLocalClient(PikminSoundPackSounds.Yay); } if (animController.AnimPack.EditorYayAnim != null && animController.AnimPack.EditorYayAnim.Count != 0) { PlayAnimation(animController.AnimPack.EditorYayAnim[enemyRandom.Next(animController.AnimPack.EditorYayAnim.Count)]); } } [IteratorStateMachine(typeof(d__299))] private IEnumerator DelayedYay(bool OverrideVol) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__299(0) { <>4__this = this, OverrideVol = OverrideVol }; } [IteratorStateMachine(typeof(d__300))] private IEnumerator DelayedYayUntilGrounded(bool OverrideVol) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__300(0) { <>4__this = this, OverrideVol = OverrideVol }; } public void SetPikminOnToAnimLink(PikminLinkAnimation anim, bool Reversed = false) { if ((Object)(object)CurrentLinkAnim != (Object)null) { LethalMin.Logger.LogWarning((object)(DebugID + ": is attempting to link onto " + ((Object)((Component)anim).gameObject).name + " while already linked onto " + ((Object)((Component)CurrentLinkAnim).gameObject).name)); } else { LethalMin.Logger.LogDebug((object)(DebugID + ": Is linking onto " + ((Object)((Component)anim).gameObject).name)); anim.PikminOnLink.Add(this, 0f); CurrentLinkAnim = anim; playLinkedAnimReversed = Reversed; SetCollisionMode(0); } } public void AnimateOnLink() { //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_00e7: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) if (!CurrentLinkAnim.PikminOnLink.ContainsKey(this)) { LethalMin.Logger.LogWarning((object)(DebugID + ": Is on link that does not contain it!")); RemoveFromLink(); return; } CurrentLinkAnim.PikminOnLink[this] += Time.deltaTime * CurrentLinkAnim.AnimSpeedMultiplier; float num = CurrentLinkAnim.PikminOnLink[this]; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(LethalMin.PikminScale.InternalValue, LethalMin.PikminScale.InternalValue, LethalMin.PikminScale.InternalValue); if (playLinkedAnimReversed) { float t = 1f - num; ((Component)this).transform.position = CurrentLinkAnim.GetPointOnPath(t); ((Component)this).transform.rotation = CurrentLinkAnim.GetRotationOnPath(t); ((Component)this).transform.localScale = Vector3.Lerp(val, CurrentLinkAnim.StartPoint.localScale, num * 0.5f); } else { ((Component)this).transform.position = CurrentLinkAnim.GetPointOnPath(num); ((Component)this).transform.rotation = CurrentLinkAnim.GetRotationOnPath(num); ((Component)this).transform.localScale = Vector3.Lerp(CurrentLinkAnim.StartPoint.localScale, val, num * 2f); } if (CurrentLinkAnim.PikminOnLink[this] >= 1f) { RemoveFromLink(); } } public void RemoveFromLink() { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer && (Object)(object)TargetOnion != (Object)null && TargetOnion.AllClimbLinks.Contains(CurrentLinkAnim)) { Pmanager.DespawnPikmin(this); } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(LethalMin.PikminScale.InternalValue, LethalMin.PikminScale.InternalValue, LethalMin.PikminScale.InternalValue); if (!((Object)(object)CurrentLinkAnim == (Object)null)) { SetCollisionMode(1); if (((NetworkBehaviour)this).IsOwner) { ((Component)this).transform.localScale = val; base.agent.Warp(CurrentLinkAnim.EndPoint.position); } else { transform2.TeleportOnLocalClient(CurrentLinkAnim.EndPoint.position, CurrentLinkAnim.EndPoint.rotation, val); } CurrentLinkAnim.PikminOnLink.Remove(this); CurrentLinkAnim = null; } } [ServerRpc(RequireOwnership = false)] public void TransformIntoPuffminServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2801719520u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2801719520u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PuffminAI component = Object.Instantiate(LethalMin.PuffminEnemyType.enemyPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation).GetComponent(); ((NetworkBehaviour)component).NetworkObject.Spawn(false); component.SetPuffminDataClientRpc(GetPikminData()); ((NetworkBehaviour)this).NetworkObject.Despawn(Object.op_Implicit((Object)(object)this)); } } } [ClientRpc] public void TransformIntoPuffminClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1896093749u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1896093749u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TransformIntoPuffmin(); } } } public void TransformIntoPuffmin() { } private void SetupRagdoll(Vector3 initialVelocity) { //IL_00f7: Unknown result type (might be due to invalid IL or missing references) if (isRagdolled || (Object)(object)modelContainer == (Object)null) { return; } LethalMin.Logger.LogInfo((object)(DebugID + ": Setting up ragdoll")); isRagdolled = true; if ((Object)(object)animController != (Object)null && (Object)(object)animController.animator != (Object)null) { ((Behaviour)animController.animator).enabled = false; } int num = LayerMask.NameToLayer("PlayerRagdoll"); if (num < 0) { LethalMin.Logger.LogWarning((object)(DebugID + ": 'PlayerRagdoll' layer not found; ragdoll bones will collide with nothing instead.")); } List list = ((Component)modelContainer).gameObject.GetComponentsInChildren(true).ToList(); List list2 = new List(); foreach (SkinnedMeshRenderer item in list) { if (!((Object)(object)item.rootBone == (Object)null)) { SetupRagdollForRenderer(item, initialVelocity, num, list2); } } ResolveSelfOverlaps(list2); LethalMin.Logger.LogInfo((object)$"{DebugID}: Ragdoll setup complete with {ragdollBones.Count} simulated bones and {list2.Count} colliders across {list.Count} renderers"); } private void SetupRagdollForRenderer(SkinnedMeshRenderer renderer, Vector3 initialVelocity, int ragdollLayer, List builtColliders) { //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033c: 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) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_05b8: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_062b: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_0635: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Unknown result type (might be due to invalid IL or missing references) //IL_075a: Unknown result type (might be due to invalid IL or missing references) //IL_0769: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_0698: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_082e: Unknown result type (might be due to invalid IL or missing references) //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06c3: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Unknown result type (might be due to invalid IL or missing references) Transform rootBone = renderer.rootBone; LethalMin.Logger.LogDebug((object)(DebugID + ": Setting up ragdoll for renderer: " + ((Object)((Component)renderer).gameObject).name)); HashSet boneSet = new HashSet { rootBone }; Transform[] bones = renderer.bones; foreach (Transform val in bones) { if ((Object)(object)val != (Object)null) { boneSet.Add(val); } } Dictionary> dictionary = new Dictionary>(); foreach (Transform item in boneSet) { dictionary[item] = new List(); } foreach (Transform item2 in boneSet) { Transform val2 = ParentInSet(item2); if ((Object)(object)val2 != (Object)null) { dictionary[val2].Add(item2); } } Bounds bounds = ((Renderer)renderer).bounds; Vector3 val3 = ((Bounds)(ref bounds)).size; float num = ((Vector3)(ref val3)).magnitude * 0.08f; HashSet hashSet = new HashSet { rootBone }; Dictionary dictionary2 = new Dictionary(); Dictionary dictionary3 = new Dictionary(); Queue queue = new Queue(); dictionary3[rootBone] = null; queue.Enqueue(rootBone); while (queue.Count > 0) { Transform val4 = queue.Dequeue(); Transform val5 = (hashSet.Contains(val4) ? val4 : dictionary3[val4]); foreach (Transform item3 in dictionary[val4]) { dictionary3[item3] = val5; if (dictionary[item3].Count >= 2 || Vector3.Distance(item3.position, val5.position) >= num) { hashSet.Add(item3); dictionary2[item3] = val5; } queue.Enqueue(item3); } } Dictionary> dictionary4 = new Dictionary>(); foreach (Transform item4 in hashSet) { dictionary4[item4] = new List(); } foreach (Transform item5 in hashSet) { if (dictionary2.TryGetValue(item5, out var value) && (Object)(object)value != (Object)null) { dictionary4[value].Add(item5); } } foreach (Transform item6 in hashSet) { ragdollBones.Add(((Component)item6).gameObject); ragdollBonePoses.Add((item6, item6.localPosition, item6.localRotation, item6.localScale, ((Component)item6).gameObject.layer)); if (ragdollLayer >= 0) { ((Component)item6).gameObject.layer = ragdollLayer; } Rigidbody val6 = ((Component)item6).gameObject.GetComponent(); if ((Object)(object)val6 == (Object)null) { val6 = ((Component)item6).gameObject.AddComponent(); val6.mass = 0.1f; val6.drag = rb.drag; val6.angularDrag = 0.05f; ragdollComponents.Add((Object)(object)val6); } val6.velocity = initialVelocity * Random.Range(1f, 1.5f); } foreach (Transform item7 in hashSet) { if ((Object)(object)item7 == (Object)(object)rootBone) { FixedJoint component = ((Component)item7).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { component = ((Component)item7).gameObject.AddComponent(); ((Joint)component).connectedBody = rb; ((Joint)component).enableCollision = false; ragdollComponents.Add((Object)(object)component); } continue; } Rigidbody component2 = ((Component)dictionary2[item7]).GetComponent(); if (!((Object)(object)component2 == (Object)null)) { CharacterJoint val7 = ((Component)item7).gameObject.GetComponent(); if ((Object)(object)val7 == (Object)null) { val7 = ((Component)item7).gameObject.AddComponent(); ragdollComponents.Add((Object)(object)val7); } ((Joint)val7).connectedBody = component2; ((Joint)val7).enableCollision = false; CharacterJoint obj = val7; SoftJointLimit val8 = default(SoftJointLimit); ((SoftJointLimit)(ref val8)).limit = -30f; obj.lowTwistLimit = val8; CharacterJoint obj2 = val7; val8 = default(SoftJointLimit); ((SoftJointLimit)(ref val8)).limit = 30f; obj2.highTwistLimit = val8; CharacterJoint obj3 = val7; val8 = default(SoftJointLimit); ((SoftJointLimit)(ref val8)).limit = 45f; obj3.swing1Limit = val8; CharacterJoint obj4 = val7; val8 = default(SoftJointLimit); ((SoftJointLimit)(ref val8)).limit = 45f; obj4.swing2Limit = val8; } } foreach (Transform item8 in hashSet) { float num2 = (Mathf.Abs(item8.lossyScale.x) + Mathf.Abs(item8.lossyScale.y) + Mathf.Abs(item8.lossyScale.z)) / 3f; if (num2 < 1E-05f) { num2 = 1f; } float num3; if (!dictionary2.TryGetValue(item8, out var value2) || !((Object)(object)value2 != (Object)null)) { num3 = 0f; } else { val3 = item8.InverseTransformPoint(value2.position); num3 = ((Vector3)(ref val3)).magnitude; } float num4 = num3; float num5 = NearestSiblingDistance(item8, dictionary4, dictionary2) / num2; List list = dictionary4[item8]; Vector3 val9 = Vector3.zero; if (list.Count > 0) { foreach (Transform item9 in list) { val9 += item8.InverseTransformPoint(item9.position); } val9 /= (float)list.Count; } float magnitude = ((Vector3)(ref val9)).magnitude; Collider val11; if (magnitude > 0.0001f) { float num6 = magnitude * 0.25f; num6 = Mathf.Min(new float[3] { num6, 0.45f * num5, 0.45f * magnitude }); if (num4 > 0f) { num6 = Mathf.Min(num6, 0.45f * num4); } num6 = Mathf.Max(num6, magnitude * 0.05f); CapsuleCollider val10 = ((Component)item8).gameObject.AddComponent(); val10.direction = LargestAxis(val9); val10.center = val9 * 0.5f; val10.radius = num6; val10.height = Mathf.Max(magnitude, num6 * 2f); val11 = (Collider)(object)val10; } else { float num7 = Mathf.Max(num4 * 0.25f, 0.01f); num7 = Mathf.Min(num7, 0.45f * num5); if (num4 > 0f) { num7 = Mathf.Min(num7, 0.45f * num4); } num7 = Mathf.Max(num7, 0.005f); SphereCollider val12 = ((Component)item8).gameObject.AddComponent(); val12.center = Vector3.zero; val12.radius = num7; val11 = (Collider)(object)val12; } if (ragdollLayer < 0) { val11.excludeLayers = LayerMask.op_Implicit(-1); } ragdollComponents.Add((Object)(object)val11); builtColliders.Add(val11); } LethalMin.Logger.LogDebug((object)$"{DebugID}: Renderer '{((Object)((Component)renderer).gameObject).name}': kept {hashSet.Count}/{boneSet.Count} bones"); Transform? ParentInSet(Transform b) { Transform parent = b.parent; while ((Object)(object)parent != (Object)null && !boneSet.Contains(parent)) { parent = parent.parent; } return parent; } } private void CleanupRagdoll() { //IL_0060: 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_025b: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) if (!isRagdolled) { return; } LethalMin.Logger.LogInfo((object)(DebugID + ": Cleaning up ragdoll")); isRagdolled = false; foreach (Object ragdollComponent in ragdollComponents) { Rigidbody val = (Rigidbody)(object)((ragdollComponent is Rigidbody) ? ragdollComponent : null); if (val != null) { val.velocity = Vector3.zero; val.angularVelocity = Vector3.zero; val.isKinematic = true; } } foreach (Object ragdollComponent2 in ragdollComponents) { if (ragdollComponent2 != (Object)null && (ragdollComponent2 is FixedJoint || ragdollComponent2 is CharacterJoint)) { LethalMin.Logger.LogDebug((object)(DebugID + ": Destroying ragdoll joint " + ((object)ragdollComponent2).GetType().Name)); Object.Destroy(ragdollComponent2); } } foreach (Object ragdollComponent3 in ragdollComponents) { if (ragdollComponent3 != (Object)null && ragdollComponent3 is Collider) { LethalMin.Logger.LogDebug((object)(DebugID + ": Destroying ragdoll collider " + ((object)ragdollComponent3).GetType().Name)); Object.Destroy(ragdollComponent3); } } foreach (Object ragdollComponent4 in ragdollComponents) { if (ragdollComponent4 != (Object)null && ragdollComponent4 is Rigidbody) { LethalMin.Logger.LogDebug((object)(DebugID + ": Destroying ragdoll rigidbody")); Object.Destroy(ragdollComponent4); } } foreach (var ragdollBonePose in ragdollBonePoses) { if ((Object)(object)ragdollBonePose.bone != (Object)null) { ragdollBonePose.bone.localPosition = ragdollBonePose.pos; ragdollBonePose.bone.localRotation = ragdollBonePose.rot; ragdollBonePose.bone.localScale = ragdollBonePose.scale; ((Component)ragdollBonePose.bone).gameObject.layer = ragdollBonePose.layer; } } ragdollBones.Clear(); ragdollComponents.Clear(); ragdollBonePoses.Clear(); if ((Object)(object)animController != (Object)null && (Object)(object)animController.animator != (Object)null) { ((Behaviour)animController.animator).enabled = true; } LethalMin.Logger.LogInfo((object)(DebugID + ": Ragdoll cleanup complete")); } private static float NearestSiblingDistance(Transform bone, Dictionary> keptChildren, Dictionary keptParent) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (!keptParent.TryGetValue(bone, out Transform value) || (Object)(object)value == (Object)null || !keptChildren.TryGetValue(value, out List value2)) { return float.MaxValue; } float num = float.MaxValue; foreach (Transform item in value2) { if (!((Object)(object)item == (Object)(object)bone)) { num = Mathf.Min(num, Vector3.Distance(bone.position, item.position)); } } return num; } private static int LargestAxis(Vector3 v) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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) float num = Mathf.Abs(v.x); float num2 = Mathf.Abs(v.y); float num3 = Mathf.Abs(v.z); if (num >= num2 && num >= num3) { return 0; } if (num2 >= num3) { return 1; } return 2; } private static void ResolveSelfOverlaps(List colliders) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) Vector3 val3 = default(Vector3); float num = default(float); for (int i = 0; i < colliders.Count; i++) { Collider val = colliders[i]; if ((Object)(object)val == (Object)null) { continue; } for (int j = i + 1; j < colliders.Count; j++) { Collider val2 = colliders[j]; if (!((Object)(object)val2 == (Object)null) && !AreJointConnected(val, val2) && Physics.ComputePenetration(val, ((Component)val).transform.position, ((Component)val).transform.rotation, val2, ((Component)val2).transform.position, ((Component)val2).transform.rotation, ref val3, ref num)) { Physics.IgnoreCollision(val, val2, true); } } } } private static bool AreJointConnected(Collider a, Collider b) { Rigidbody attachedRigidbody = a.attachedRigidbody; Rigidbody attachedRigidbody2 = b.attachedRigidbody; if ((Object)(object)attachedRigidbody == (Object)null || (Object)(object)attachedRigidbody2 == (Object)null) { return false; } Joint[] components = ((Component)a).GetComponents(); foreach (Joint val in components) { if ((Object)(object)val.connectedBody == (Object)(object)attachedRigidbody2) { return true; } } Joint[] components2 = ((Component)b).GetComponents(); foreach (Joint val2 in components2) { if ((Object)(object)val2.connectedBody == (Object)(object)attachedRigidbody) { return true; } } return false; } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Expected O, but got Unknown //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Expected O, but got Unknown //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Expected O, but got Unknown //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Expected O, but got Unknown //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Expected O, but got Unknown //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Expected O, but got Unknown //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Expected O, but got Unknown //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Expected O, but got Unknown //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Expected O, but got Unknown //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Expected O, but got Unknown //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Expected O, but got Unknown //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Expected O, but got Unknown //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Expected O, but got Unknown //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Expected O, but got Unknown //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Expected O, but got Unknown //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Expected O, but got Unknown //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Expected O, but got Unknown //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Expected O, but got Unknown //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Expected O, but got Unknown //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Expected O, but got Unknown //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Expected O, but got Unknown //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Expected O, but got Unknown //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Expected O, but got Unknown //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Expected O, but got Unknown //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Expected O, but got Unknown //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Expected O, but got Unknown //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Expected O, but got Unknown //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Expected O, but got Unknown //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Expected O, but got Unknown //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_0604: Expected O, but got Unknown //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Expected O, but got Unknown //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Expected O, but got Unknown //IL_0649: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Expected O, but got Unknown //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Expected O, but got Unknown //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_06ac: Expected O, but got Unknown //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Expected O, but got Unknown //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Expected O, but got Unknown //IL_070d: Unknown result type (might be due to invalid IL or missing references) //IL_071c: Expected O, but got Unknown //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_0738: Expected O, but got Unknown //IL_0745: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Expected O, but got Unknown //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(604708755u, new RpcReceiveHandler(__rpc_handler_604708755), "FinishTaskServerRpc"); ((NetworkBehaviour)this).__registerRpc(4009197585u, new RpcReceiveHandler(__rpc_handler_4009197585), "FinishTaskClientRpc"); ((NetworkBehaviour)this).__registerRpc(2913971389u, new RpcReceiveHandler(__rpc_handler_2913971389), "GetInVehicleRpc"); ((NetworkBehaviour)this).__registerRpc(1723618909u, new RpcReceiveHandler(__rpc_handler_1723618909), "FindItemViaChargeServerRpc"); ((NetworkBehaviour)this).__registerRpc(604646442u, new RpcReceiveHandler(__rpc_handler_604646442), "FindItemViaChargeClientRpc"); ((NetworkBehaviour)this).__registerRpc(3979919198u, new RpcReceiveHandler(__rpc_handler_3979919198), "FindEnemyViaChargeServerRpc"); ((NetworkBehaviour)this).__registerRpc(2838210814u, new RpcReceiveHandler(__rpc_handler_2838210814), "FindEnemyViaChargeClientRpc"); ((NetworkBehaviour)this).__registerRpc(1514843108u, new RpcReceiveHandler(__rpc_handler_1514843108), "SetToIdleServerRpc"); ((NetworkBehaviour)this).__registerRpc(3765545145u, new RpcReceiveHandler(__rpc_handler_3765545145), "SetToIdleClientRpc"); ((NetworkBehaviour)this).__registerRpc(3697017969u, new RpcReceiveHandler(__rpc_handler_3697017969), "ChangeIntentServerRpc"); ((NetworkBehaviour)this).__registerRpc(4111438502u, new RpcReceiveHandler(__rpc_handler_4111438502), "ChangeIntentClientRpc"); ((NetworkBehaviour)this).__registerRpc(2484908225u, new RpcReceiveHandler(__rpc_handler_2484908225), "SetPikminToLeavingServerRpc"); ((NetworkBehaviour)this).__registerRpc(2728408294u, new RpcReceiveHandler(__rpc_handler_2728408294), "SetPikminToLeavingClientRpc"); ((NetworkBehaviour)this).__registerRpc(3239111308u, new RpcReceiveHandler(__rpc_handler_3239111308), "SetTargetOnionServerRpc"); ((NetworkBehaviour)this).__registerRpc(255507921u, new RpcReceiveHandler(__rpc_handler_255507921), "SetTargetOnionClientRpc"); ((NetworkBehaviour)this).__registerRpc(274790213u, new RpcReceiveHandler(__rpc_handler_274790213), "EnterOnionServerRpc"); ((NetworkBehaviour)this).__registerRpc(1238071101u, new RpcReceiveHandler(__rpc_handler_1238071101), "EnterOnionClientRpc"); ((NetworkBehaviour)this).__registerRpc(3024175915u, new RpcReceiveHandler(__rpc_handler_3024175915), "AssignLeaderServerRpc"); ((NetworkBehaviour)this).__registerRpc(4055462510u, new RpcReceiveHandler(__rpc_handler_4055462510), "AssignLeaderClientRpc"); ((NetworkBehaviour)this).__registerRpc(1265877939u, new RpcReceiveHandler(__rpc_handler_1265877939), "RemoveLeaderServerRpc"); ((NetworkBehaviour)this).__registerRpc(3812565402u, new RpcReceiveHandler(__rpc_handler_3812565402), "RemoveLeaderClientRpc"); ((NetworkBehaviour)this).__registerRpc(1734909243u, new RpcReceiveHandler(__rpc_handler_1734909243), "LandPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(858704u, new RpcReceiveHandler(__rpc_handler_858704), "LandPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(3521607430u, new RpcReceiveHandler(__rpc_handler_3521607430), "LatchPikminOnToEnemyServerRpc"); ((NetworkBehaviour)this).__registerRpc(2890995472u, new RpcReceiveHandler(__rpc_handler_2890995472), "LatchPikminOnToEnemyClientRpc"); ((NetworkBehaviour)this).__registerRpc(3427082973u, new RpcReceiveHandler(__rpc_handler_3427082973), "ApplyKnockBackServerRpc"); ((NetworkBehaviour)this).__registerRpc(3572780680u, new RpcReceiveHandler(__rpc_handler_3572780680), "ApplyKnockBackClientRpc"); ((NetworkBehaviour)this).__registerRpc(4197872781u, new RpcReceiveHandler(__rpc_handler_4197872781), "ApplyPhysicsServerRpc"); ((NetworkBehaviour)this).__registerRpc(1199057414u, new RpcReceiveHandler(__rpc_handler_1199057414), "ApplyPhysicsClientRpc"); ((NetworkBehaviour)this).__registerRpc(2367074961u, new RpcReceiveHandler(__rpc_handler_2367074961), "DoJumpServerRpc"); ((NetworkBehaviour)this).__registerRpc(4001181276u, new RpcReceiveHandler(__rpc_handler_4001181276), "DoJumpClientRpc"); ((NetworkBehaviour)this).__registerRpc(898356688u, new RpcReceiveHandler(__rpc_handler_898356688), "WarpIntoBoundsServerRpc"); ((NetworkBehaviour)this).__registerRpc(2292476525u, new RpcReceiveHandler(__rpc_handler_2292476525), "WarpIntoBoundsClientRpc"); ((NetworkBehaviour)this).__registerRpc(2181149881u, new RpcReceiveHandler(__rpc_handler_2181149881), "StartPanicingServerRpc"); ((NetworkBehaviour)this).__registerRpc(1288514242u, new RpcReceiveHandler(__rpc_handler_1288514242), "StartPanicingClientRpc"); ((NetworkBehaviour)this).__registerRpc(2922207785u, new RpcReceiveHandler(__rpc_handler_2922207785), "StopPanicingServerRpc"); ((NetworkBehaviour)this).__registerRpc(1964685205u, new RpcReceiveHandler(__rpc_handler_1964685205), "StopPanicingClientRpc"); ((NetworkBehaviour)this).__registerRpc(867929509u, new RpcReceiveHandler(__rpc_handler_867929509), "SetPikminToEnemyServerRpc"); ((NetworkBehaviour)this).__registerRpc(3806258439u, new RpcReceiveHandler(__rpc_handler_3806258439), "SetPikminToEnemyClientRpc"); ((NetworkBehaviour)this).__registerRpc(1428713689u, new RpcReceiveHandler(__rpc_handler_1428713689), "StartAttackServerRpc"); ((NetworkBehaviour)this).__registerRpc(1474051394u, new RpcReceiveHandler(__rpc_handler_1474051394), "StartAttackClientRpc"); ((NetworkBehaviour)this).__registerRpc(3199461236u, new RpcReceiveHandler(__rpc_handler_3199461236), "HitCurLatchTriggerServerRpc"); ((NetworkBehaviour)this).__registerRpc(1920566672u, new RpcReceiveHandler(__rpc_handler_1920566672), "HitCurLatchTriggerClientRpc"); ((NetworkBehaviour)this).__registerRpc(4228624778u, new RpcReceiveHandler(__rpc_handler_4228624778), "SetInvincibiltyServerRpc"); ((NetworkBehaviour)this).__registerRpc(1813866373u, new RpcReceiveHandler(__rpc_handler_1813866373), "SetInvincibiltyClientRpc"); ((NetworkBehaviour)this).__registerRpc(1180021914u, new RpcReceiveHandler(__rpc_handler_1180021914), "HitFromExplosionServerRpc"); ((NetworkBehaviour)this).__registerRpc(1651300942u, new RpcReceiveHandler(__rpc_handler_1651300942), "HitFromExplosionClientRpc"); ((NetworkBehaviour)this).__registerRpc(4048339311u, new RpcReceiveHandler(__rpc_handler_4048339311), "DoSquishDeathServerRpc"); ((NetworkBehaviour)this).__registerRpc(2649897065u, new RpcReceiveHandler(__rpc_handler_2649897065), "DoSquishDeathClientRpc"); ((NetworkBehaviour)this).__registerRpc(2705545787u, new RpcReceiveHandler(__rpc_handler_2705545787), "DoZapDeathServerRpc"); ((NetworkBehaviour)this).__registerRpc(3834188207u, new RpcReceiveHandler(__rpc_handler_3834188207), "DoZapDeathClientRpc"); ((NetworkBehaviour)this).__registerRpc(817792021u, new RpcReceiveHandler(__rpc_handler_817792021), "SpawnGhostServerRpc"); ((NetworkBehaviour)this).__registerRpc(3201010991u, new RpcReceiveHandler(__rpc_handler_3201010991), "SpawnGhostClientRpc"); ((NetworkBehaviour)this).__registerRpc(2663682730u, new RpcReceiveHandler(__rpc_handler_2663682730), "IncrumentDestoryCountServerRpc"); ((NetworkBehaviour)this).__registerRpc(2085065388u, new RpcReceiveHandler(__rpc_handler_2085065388), "SetGrowthServerRpc"); ((NetworkBehaviour)this).__registerRpc(2717484314u, new RpcReceiveHandler(__rpc_handler_2717484314), "SetGrowthClientRpc"); ((NetworkBehaviour)this).__registerRpc(2261270484u, new RpcReceiveHandler(__rpc_handler_2261270484), "SetPikminToItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(3666518037u, new RpcReceiveHandler(__rpc_handler_3666518037), "SetPikminToItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(1054655244u, new RpcReceiveHandler(__rpc_handler_1054655244), "GrabItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(1838956985u, new RpcReceiveHandler(__rpc_handler_1838956985), "GrabItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(1674497089u, new RpcReceiveHandler(__rpc_handler_1674497089), "DropItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(792549318u, new RpcReceiveHandler(__rpc_handler_792549318), "DropItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(3535002757u, new RpcReceiveHandler(__rpc_handler_3535002757), "UseEntranceServerRpc"); ((NetworkBehaviour)this).__registerRpc(2963825920u, new RpcReceiveHandler(__rpc_handler_2963825920), "UseEntranceClientRpc"); ((NetworkBehaviour)this).__registerRpc(3446476118u, new RpcReceiveHandler(__rpc_handler_3446476118), "PlayAudioServerRpc"); ((NetworkBehaviour)this).__registerRpc(340066622u, new RpcReceiveHandler(__rpc_handler_340066622), "PlayAudioClientRpc"); ((NetworkBehaviour)this).__registerRpc(2801719520u, new RpcReceiveHandler(__rpc_handler_2801719520), "TransformIntoPuffminServerRpc"); ((NetworkBehaviour)this).__registerRpc(1896093749u, new RpcReceiveHandler(__rpc_handler_1896093749), "TransformIntoPuffminClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_604708755(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).FinishTaskServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4009197585(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; ((PikminAI)(object)target).FinishTaskClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2913971389(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 vehicleRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref vehicleRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).GetInVehicleRpc(vehicleRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1723618909(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference itemRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemRef, default(ForNetworkSerializable)); int grabIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref grabIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).FindItemViaChargeServerRpc(itemRef, grabIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_604646442(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemRef, default(ForNetworkSerializable)); int grabIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref grabIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).FindItemViaChargeClientRpc(itemRef, grabIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3979919198(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference enemyRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).FindEnemyViaChargeServerRpc(enemyRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2838210814(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 enemyRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).FindEnemyViaChargeClientRpc(enemyRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1514843108(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetToIdleServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3765545145(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; ((PikminAI)(object)target).SetToIdleClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3697017969(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int newIntention = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newIntention); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).ChangeIntentServerRpc(newIntention); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4111438502(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 newIntention = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newIntention); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).ChangeIntentClientRpc(newIntention); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2484908225(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference pikminToLeavingServerRpc = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikminToLeavingServerRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetPikminToLeavingServerRpc(pikminToLeavingServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2728408294(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 pikminToLeavingClientRpc = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikminToLeavingClientRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetPikminToLeavingClientRpc(pikminToLeavingClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3239111308(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference targetOnionServerRpc = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetOnionServerRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetTargetOnionServerRpc(targetOnionServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_255507921(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 targetOnionClientRpc = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetOnionClientRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetTargetOnionClientRpc(targetOnionClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_274790213(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int linkIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref linkIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).EnterOnionServerRpc(linkIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1238071101(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 linkIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref linkIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).EnterOnionClientRpc(linkIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3024175915(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_004a: 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) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference leaderRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderRef, default(ForNetworkSerializable)); bool switchToFollowingState = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref switchToFollowingState, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).AssignLeaderServerRpc(leaderRef, switchToFollowingState); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4055462510(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_004a: 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) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference leaderRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderRef, default(ForNetworkSerializable)); bool switchState = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref switchState, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).AssignLeaderClientRpc(leaderRef, switchState); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1265877939(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; ((PikminAI)(object)target).RemoveLeaderServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3812565402(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; ((PikminAI)(object)target).RemoveLeaderClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1734909243(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).LandPikminServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_858704(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; ((PikminAI)(object)target).LandPikminClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3521607430(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } NetworkObjectReference enemyRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyRef, default(ForNetworkSerializable)); Vector3 landPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref landPos); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).LatchPikminOnToEnemyServerRpc(enemyRef, landPos, index); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_2890995472(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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemyRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyRef, default(ForNetworkSerializable)); Vector3 landPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref landPos); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).LatchPikminOnToEnemyClientRpc(enemyRef, landPos, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3427082973(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); float force = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).ApplyKnockBackServerRpc(direction, force); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3572780680(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); float force = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).ApplyKnockBackClientRpc(direction, force); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4197872781(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { bool use = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref use, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).ApplyPhysicsServerRpc(use); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1199057414(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 use = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref use, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).ApplyPhysicsClientRpc(use); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2367074961(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 direciton = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direciton); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).DoJumpServerRpc(direciton); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4001181276(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).DoJumpClientRpc(direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_898356688(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).WarpIntoBoundsServerRpc(pos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2292476525(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).WarpIntoBoundsClientRpc(pos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2181149881(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } int mode = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mode); int type = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref type); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string panicAnim = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref panicAnim, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).StartPanicingServerRpc(mode, type, panicAnim); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_1288514242(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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int mode = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mode); int type = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref type); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string panicAnim = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref panicAnim, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).StartPanicingClientRpc(mode, type, panicAnim); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2922207785(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).StopPanicingServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1964685205(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; ((PikminAI)(object)target).StopPanicingClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_867929509(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference pikminToEnemyServerRpc = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikminToEnemyServerRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetPikminToEnemyServerRpc(pikminToEnemyServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3806258439(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 pikminToEnemyClientRpc = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikminToEnemyClientRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetPikminToEnemyClientRpc(pikminToEnemyClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1428713689(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).StartAttackServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1474051394(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; ((PikminAI)(object)target).StartAttackClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3199461236(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).HitCurLatchTriggerServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1920566672(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; ((PikminAI)(object)target).HitCurLatchTriggerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4228624778(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { bool invincibiltyServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref invincibiltyServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetInvincibiltyServerRpc(invincibiltyServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1813866373(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 invincibiltyClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref invincibiltyClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetInvincibiltyClientRpc(invincibiltyClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1180021914(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } Vector3 explosionPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref explosionPosition); float killRange = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref killRange, default(ForPrimitives)); float damageRange = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref damageRange, default(ForPrimitives)); int nonLethalDamage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref nonLethalDamage); float physicsForce = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref physicsForce, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).HitFromExplosionServerRpc(explosionPosition, killRange, damageRange, nonLethalDamage, physicsForce); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_1651300942(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00be: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 explosionPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref explosionPosition); float killRange = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref killRange, default(ForPrimitives)); float damageRange = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref damageRange, default(ForPrimitives)); int nonLethalDamage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref nonLethalDamage); float physicsForce = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref physicsForce, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).HitFromExplosionClientRpc(explosionPosition, killRange, damageRange, nonLethalDamage, physicsForce); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4048339311(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).DoSquishDeathServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2649897065(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 doOwnerCheck = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref doOwnerCheck, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).DoSquishDeathClientRpc(doOwnerCheck); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2705545787(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).DoZapDeathServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3834188207(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 doOwnerCheck = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref doOwnerCheck, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).DoZapDeathClientRpc(doOwnerCheck); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_817792021(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SpawnGhostServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3201010991(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; ((PikminAI)(object)target).SpawnGhostClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2663682730(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; ((PikminAI)(object)target).IncrumentDestoryCountServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2085065388(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int growthServerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref growthServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetGrowthServerRpc(growthServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2717484314(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 growthClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref growthClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetGrowthClientRpc(growthClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2261270484(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference @ref = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref @ref, default(ForNetworkSerializable)); int grabPosIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref grabPosIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetPikminToItemServerRpc(@ref, grabPosIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3666518037(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference @ref = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref @ref, default(ForNetworkSerializable)); int grabPosIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref grabPosIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).SetPikminToItemClientRpc(@ref, grabPosIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1054655244(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).GrabItemServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1838956985(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; ((PikminAI)(object)target).GrabItemClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1674497089(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).DropItemServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_792549318(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; ((PikminAI)(object)target).DropItemClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3535002757(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } NetworkObjectReference @ref = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref @ref, default(ForNetworkSerializable)); bool inside = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inside, default(ForPrimitives)); bool playSFX = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playSFX, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).UseEntranceServerRpc(@ref, inside, playSFX); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_2963825920(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_004a: 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) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference @ref = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref @ref, default(ForNetworkSerializable)); bool inside = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inside, default(ForPrimitives)); bool playSFX = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playSFX, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).UseEntranceClientRpc(@ref, inside, playSFX); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3446476118(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00b4: 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_00c9: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string name = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref name, false); } bool playOnVoice = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playOnVoice, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).PlayAudioServerRpc(name, playOnVoice); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_340066622(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_0067: 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_009a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string name = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref name, false); } bool playOnVoice = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playOnVoice, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminAI)(object)target).PlayAudioClientRpc(name, playOnVoice); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2801719520(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; ((PikminAI)(object)target).TransformIntoPuffminServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1896093749(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; ((PikminAI)(object)target).TransformIntoPuffminClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PikminAI"; } } public class PikminBridgeTrigger : MonoBehaviour { public List pikminOnBridge = new List(); public void OnTriggerEnter(Collider other) { PikminCollisionDetect pikminCollisionDetect = default(PikminCollisionDetect); if (((Component)other).CompareTag("Enemy") && ((Component)other).gameObject.TryGetComponent(ref pikminCollisionDetect)) { PikminAI mainPikmin = pikminCollisionDetect.mainPikmin; if (!pikminOnBridge.Contains(mainPikmin)) { pikminOnBridge.Add(mainPikmin); } } } public void OnTriggerExit(Collider other) { PikminCollisionDetect pikminCollisionDetect = default(PikminCollisionDetect); if (((Component)other).CompareTag("Enemy") && ((Component)other).gameObject.TryGetComponent(ref pikminCollisionDetect)) { PikminAI mainPikmin = pikminCollisionDetect.mainPikmin; if (pikminOnBridge.Contains(mainPikmin)) { pikminOnBridge.Remove(mainPikmin); } } } public void KnockoffPikmin() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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) List list = new List(); foreach (PikminAI item in pikminOnBridge) { if (((NetworkBehaviour)item).IsOwner && !item.IsDeadOrDying) { list.Add(NetworkObjectReference.op_Implicit(((NetworkBehaviour)item).NetworkObject)); } } if (list.Count > 0) { LethalMin.Logger.LogInfo((object)$"Knockoff ({list.Count} out of {pikminOnBridge.Count}) owned pikmin from bridge"); PikminManager.instance.ApplyKnockbackServalPikminServerRpc(list.ToArray(), Vector3.up * 2f, 2f); } } } public class PikminCollisionDetect : EnemyAICollisionDetect { public PikminAI mainPikmin = null; public List CurFXtriggers = new List(); public float TriggerBuffer = 0.5f; private void Start() { if ((Object)(object)base.mainScript == (Object)null) { base.mainScript = ((Component)this).GetComponentInParent(); } if ((Object)(object)mainPikmin == (Object)null) { mainPikmin = ((Component)base.mainScript).GetComponent(); } } public virtual void OnTriggerStay(Collider other) { ((EnemyAICollisionDetect)this).OnTriggerStay(other); if (!((NetworkBehaviour)mainPikmin).IsOwner) { return; } PikminNoticeZone pikminNoticeZone = default(PikminNoticeZone); if (((EnemyAI)mainPikmin).currentBehaviourStateIndex == 3 && (Object)(object)mainPikmin.LeaderWhistling == (Object)null && ((Component)other).TryGetComponent(ref pikminNoticeZone) && (Object)(object)pikminNoticeZone.LeaderScript != (Object)null && pikminNoticeZone.CanSavePikmin && pikminNoticeZone.Active) { mainPikmin.LeaderWhistling = pikminNoticeZone.LeaderScript; mainPikmin.LeaderWhistlingZone = pikminNoticeZone; } if (TriggerBuffer >= 0f) { TriggerBuffer -= Time.deltaTime; return; } PikminEffectTrigger pikminEffectTrigger = default(PikminEffectTrigger); if (((Behaviour)((EnemyAI)mainPikmin).agent).enabled && ((Component)other).TryGetComponent(ref pikminEffectTrigger) && pikminEffectTrigger.Mode == PikminEffectMode.Persitant && !CurFXtriggers.Contains(pikminEffectTrigger) && !pikminEffectTrigger.IsPikminResistantToTrigger(mainPikmin)) { if (pikminEffectTrigger.GetAnimString() == "WaterPanic" && LethalMin.UselessBluesCheat) { return; } CurFXtriggers.Add(pikminEffectTrigger); mainPikmin.StartPanicingServerRpc((int)pikminEffectTrigger.Mode, (int)pikminEffectTrigger.EffectType, pikminEffectTrigger.GetAnimString()); } TriggerBuffer = 0.5f; } public virtual void OnTriggerEnter(Collider other) { PikminEnemyCollisionDetector pikminEnemyCollisionDetector = default(PikminEnemyCollisionDetector); if (((Component)other).CompareTag("Enemy") && ((Component)other).TryGetComponent(ref pikminEnemyCollisionDetector) && ((NetworkBehaviour)pikminEnemyCollisionDetector.enemy).IsOwner) { pikminEnemyCollisionDetector.AddPikmin(mainPikmin); } PikminEffectTrigger pikminEffectTrigger = default(PikminEffectTrigger); if (((NetworkBehaviour)mainPikmin).IsOwner && mainPikmin.CurrentIntention != Pintent.Panicing && ((Component)other).TryGetComponent(ref pikminEffectTrigger) && pikminEffectTrigger.Mode == PikminEffectMode.Limited && !pikminEffectTrigger.IsPikminResistantToTrigger(mainPikmin) && (!(pikminEffectTrigger.GetAnimString() == "WaterPanic") || !LethalMin.UselessBluesCheat)) { mainPikmin.StartPanicingServerRpc((int)pikminEffectTrigger.Mode, (int)pikminEffectTrigger.EffectType, pikminEffectTrigger.GetAnimString()); } } public virtual void OnTriggerExit(Collider other) { PikminEnemyCollisionDetector pikminEnemyCollisionDetector = default(PikminEnemyCollisionDetector); if (((Component)other).CompareTag("Enemy") && ((Component)other).TryGetComponent(ref pikminEnemyCollisionDetector) && ((NetworkBehaviour)pikminEnemyCollisionDetector.enemy).IsOwner) { pikminEnemyCollisionDetector.RemovePikmin(mainPikmin); } if (((NetworkBehaviour)mainPikmin).IsOwner) { PikminNoticeZone pikminNoticeZone = default(PikminNoticeZone); if (((EnemyAI)mainPikmin).currentBehaviourStateIndex == 3 && (Object)(object)mainPikmin.LeaderWhistling != (Object)null && ((Component)other).TryGetComponent(ref pikminNoticeZone) && (Object)(object)mainPikmin.LeaderWhistling == (Object)(object)pikminNoticeZone.LeaderScript && pikminNoticeZone.Active) { mainPikmin.LeaderWhistling = null; mainPikmin.LeaderWhistlingZone = null; } PikminEffectTrigger pikminEffectTrigger = default(PikminEffectTrigger); if (((Behaviour)((EnemyAI)mainPikmin).agent).enabled && ((Component)other).TryGetComponent(ref pikminEffectTrigger) && pikminEffectTrigger.Mode == PikminEffectMode.Persitant && CurFXtriggers.Contains(pikminEffectTrigger)) { CurFXtriggers.Remove(pikminEffectTrigger); mainPikmin.StopPanicingServerRpc(); } } } } public enum PikminHarmTriggerDeathType { Default, Zap, Squish } public class PikminDamageTrigger : MonoBehaviour { public PikminHarmTriggerDeathType deathType = PikminHarmTriggerDeathType.Default; [Tooltip("If true, the pikmin will die instantly on hit.")] public bool InstaDeath = false; [Tooltip("If true, the pikmin will be destroyed on death. Causing the ghost to spawn instantly.")] public bool DestoryOnDeath = true; [Tooltip("The ammount of damage to deal to the pikmin on hit. (1 is basicly an insta-kill)")] public int DamageDelt = 1; [Tooltip("Leave empty to have all types be affected.")] public List HazardTypes = new List(); public bool CallOnHazardResist = true; public bool DontKillInShip = false; public void OnTriggerEnter(Collider other) { //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) PikminCollisionDetect pikminCollisionDetect = default(PikminCollisionDetect); if (!((Component)other).CompareTag("Enemy") || !((Component)other).TryGetComponent(ref pikminCollisionDetect) || !((NetworkBehaviour)pikminCollisionDetect.mainPikmin).IsOwner) { return; } foreach (PikminHazard hazardType in HazardTypes) { if (PikChecks.IsPikminResistantToHazard(pikminCollisionDetect.mainPikmin, hazardType, CallOnHazardResist)) { return; } } if (DontKillInShip && pikminCollisionDetect.mainPikmin.IsInShip) { return; } switch (deathType) { case PikminHarmTriggerDeathType.Default: if (InstaDeath) { ((EnemyAI)pikminCollisionDetect.mainPikmin).KillEnemyOnOwnerClient(DestoryOnDeath); } else { ((EnemyAI)pikminCollisionDetect.mainPikmin).HitEnemyOnLocalClient(DamageDelt, default(Vector3), (PlayerControllerB)null, false, -1); } break; case PikminHarmTriggerDeathType.Zap: if (InstaDeath || ((EnemyAI)pikminCollisionDetect.mainPikmin).enemyHP - DamageDelt <= 0) { pikminCollisionDetect.mainPikmin.DoZapDeath(); pikminCollisionDetect.mainPikmin.DoZapDeathServerRpc(); } else { ((EnemyAI)pikminCollisionDetect.mainPikmin).HitEnemyOnLocalClient(DamageDelt, default(Vector3), (PlayerControllerB)null, false, -1); } break; case PikminHarmTriggerDeathType.Squish: if (InstaDeath || ((EnemyAI)pikminCollisionDetect.mainPikmin).enemyHP - DamageDelt <= 0) { pikminCollisionDetect.mainPikmin.DoSquishDeath(); pikminCollisionDetect.mainPikmin.DoSquishDeathServerRpc(); } else { ((EnemyAI)pikminCollisionDetect.mainPikmin).HitEnemyOnLocalClient(DamageDelt, default(Vector3), (PlayerControllerB)null, false, -1); } break; } } } public struct PikminData : INetworkSerializable { public int TypeID; public int LastOnionID; public int GrowthStage; public string DebugName; public string BirthDate; public PikminData(int typeID, int lastOnionID, int growthStage, string debugName, string birthDate) { DebugName = ""; BirthDate = ""; TypeID = typeID; LastOnionID = lastOnionID; GrowthStage = growthStage; DebugName = debugName; BirthDate = birthDate; } public PikminData() { DebugName = ""; BirthDate = ""; TypeID = 0; LastOnionID = 0; GrowthStage = 0; DebugName = ""; BirthDate = ""; } public unsafe void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_003f: Unknown result type (might be due to invalid IL or missing references) ((BufferSerializer*)(&serializer))->SerializeValue(ref TypeID, default(ForPrimitives)); ((BufferSerializer*)(&serializer))->SerializeValue(ref LastOnionID, default(ForPrimitives)); ((BufferSerializer*)(&serializer))->SerializeValue(ref GrowthStage, default(ForPrimitives)); serializer.SerializeValue(ref DebugName, false); serializer.SerializeValue(ref BirthDate, false); } public string DataID() { return $"{TypeID}_{DebugName}_{BirthDate}"; } } public enum PikminEffectType { Paralized, Scatter } public enum PikminEffectMode { Persitant, Limited } public class PikminEffectTrigger : MonoBehaviour { public float KillTimer = 5f; public PikminHazard HazardType = PikminHazard.Water; public PikminEffectMode Mode = PikminEffectMode.Persitant; public PikminEffectType EffectType = PikminEffectType.Paralized; public string OverridePanicAnim = ""; public bool IsPikminResistantToTrigger(PikminAI ai) { return PikChecks.IsPikminResistantToHazard(ai.pikminType, HazardType); } public string GetAnimString() { if (!string.IsNullOrEmpty(OverridePanicAnim)) { return OverridePanicAnim; } return HazardType switch { PikminHazard.Water => "WaterPanic", PikminHazard.Fire => "FirePanic", PikminHazard.Poison => "PoisonPanic", _ => "Panic", }; } } public class PikminEnemy : NetworkBehaviour { [CompilerGenerated] private sealed class d__47 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject obj; public float delay; public PikminEnemy <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__47(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)obj != (Object)null) { Object.Destroy((Object)(object)obj); } 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__18 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private PikminAI <>2__current; private int <>l__initialThreadId; public PikminEnemy <>4__this; private HashSet 5__1; private List.Enumerator <>s__2; private PikminEnemyCollisionDetector 5__3; private HashSet.Enumerator <>s__4; private PikminAI 5__5; PikminAI IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if ((uint)(num - -4) <= 1u || num == 1) { try { if (num == -4 || num == 1) { try { } finally { <>m__Finally2(); } } } finally { <>m__Finally1(); } } 5__1 = null; <>s__2 = default(List.Enumerator); 5__3 = null; <>s__4 = default(HashSet.Enumerator); 5__5 = null; <>1__state = -2; } private bool MoveNext() { try { int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -4; goto IL_0122; } <>1__state = -1; 5__1 = new HashSet(); <>s__2 = <>4__this.ProximityDetectors.GetEnumerator(); <>1__state = -3; goto IL_0152; IL_0152: if (<>s__2.MoveNext()) { 5__3 = <>s__2.Current; 5__3.PikminInCollider.RemoveWhere((PikminAI p) => (Object)(object)p == (Object)null); <>s__4 = 5__3.PikminInCollider.GetEnumerator(); <>1__state = -4; goto IL_012a; } <>m__Finally1(); <>s__2 = default(List.Enumerator); return false; IL_012a: while (<>s__4.MoveNext()) { 5__5 = <>s__4.Current; if ((Object)(object)5__5 == (Object)null || 5__5.IsDeadOrDying) { continue; } goto IL_00ee; } <>m__Finally2(); <>s__4 = default(HashSet.Enumerator); 5__3 = null; goto IL_0152; IL_0122: 5__5 = null; goto IL_012a; IL_00ee: if (5__1.Add(5__5)) { <>2__current = 5__5; <>1__state = 1; return true; } goto IL_0122; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__2).Dispose(); } private void <>m__Finally2() { <>1__state = -3; ((IDisposable)<>s__4).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__18 result; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; result = this; } else { result = new d__18(0) { <>4__this = <>4__this }; } return result; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } public EnemyAI enemyScript = null; public List LatchTriggers = null; public List ProximityDetectors = new List(); public float DamageCounter = 0f; public bool IsDead = false; public bool CanBeAttacked = true; public bool OverrideCanDie = false; public bool CanShakeOffPikmin = true; public float MaxShakeOffVelocity = 2f; private float ShakeCooldown = 0.5f; public UnityEvent OnHit = new UnityEvent(); protected List GrabbedPikmin = new List(); public float FreezeCounter = 0f; public bool IsFrozen = false; public bool HasShattered = false; public float FreezeDuration = 3f; private Dictionary originalMaterials = new Dictionary(); private Vector3 OOB = new Vector3(0f, -1000f, 0f); [IteratorStateMachine(typeof(d__18))] protected IEnumerable GetNearbyPikmin() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(-2) { <>4__this = this }; } protected virtual void Start() { foreach (PikminLatchTrigger latchTrigger in LatchTriggers) { latchTrigger.OnPikminHit.AddListener((UnityAction)delegate(PikminAI pikmin) { HitEnemy(pikmin.pikminType.GetAttackStrength(pikmin.CurrentGrowthStage), pikmin); }); latchTrigger.OnPikminDirectLatch.AddListener((UnityAction)HandleDirectHit); } if ((Object)(object)enemyScript == (Object)null) { LethalMin.Logger.LogWarning((object)("EnemyAI component not found on the GameObject (" + ((Object)((Component)this).gameObject).name + ")")); enemyScript = ((Component)this).GetComponent(); } if ((Object)(object)enemyScript == (Object)null) { LethalMin.Logger.LogFatal((object)("EnemyAI component not found on the GameObject fallback failed (" + ((Object)((Component)this).gameObject).name + ")")); ((Behaviour)this).enabled = false; } else { PikminManager.instance.PikminEnemies.Add(this); } } public override void OnDestroy() { PikminManager.instance.PikminEnemies.Remove(this); } protected virtual void Update() { //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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_015a: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) if (enemyScript.isEnemyDead && !IsDead) { RemoveAndDisableTriggers(); if (((NetworkBehaviour)this).IsOwner && IsFrozen) { ShatterServerRpc(); } foreach (PikminAI item2 in GrabbedPikmin) { if ((Object)(object)item2 != (Object)null) { item2.ReleaseFromGrab(); } } GrabbedPikmin.Clear(); IsDead = true; ((Behaviour)this).enabled = false; } if (IsFrozen) { enemyScript.inSpecialAnimation = true; enemyScript.SetClientCalculatingAI(false); } ShakeCooldown -= Time.deltaTime; if (MaxShakeOffVelocity > 1f) { MaxShakeOffVelocity -= Time.deltaTime * 0.5f; } if (!LethalMin.NoKnockbackCheat && CanShakeOffPikmin && ((NetworkBehaviour)enemyScript).IsOwner && ShakeCooldown <= 0f && (Object)(object)enemyScript.agent != (Object)null) { Vector3 velocity = enemyScript.agent.velocity; if (((Vector3)(ref velocity)).magnitude > MaxShakeOffVelocity) { ShakeCooldown = Random.Range(1f, 5f); float maxShakeOffVelocity; if (!((Object)(object)enemyScript.agent != (Object)null)) { maxShakeOffVelocity = 0f; } else { velocity = enemyScript.agent.velocity; maxShakeOffVelocity = ((Vector3)(ref velocity)).magnitude - 1.5f; } MaxShakeOffVelocity = maxShakeOffVelocity; if (MaxShakeOffVelocity < 0.5f) { MaxShakeOffVelocity = 0.5f; } bool flag = false; foreach (PikminLatchTrigger latchTrigger in LatchTriggers) { if (latchTrigger.PikminOnLatch.Count > 0) { flag = true; break; } } if (flag) { HashSet hashSet = new HashSet(); List<(NetworkObjectReference, PikminAI, float)> list = new List<(NetworkObjectReference, PikminAI, float)>(); foreach (PikminLatchTrigger latchTrigger2 in LatchTriggers) { foreach (PikminAI item3 in latchTrigger2.PikminOnLatch) { if (!hashSet.Contains(item3)) { hashSet.Add(item3); float item = Random.Range(0f, 1f); list.Add((NetworkObjectReference.op_Implicit(((NetworkBehaviour)item3).NetworkObject), item3, item)); } } } list.Sort(((NetworkObjectReference netRef, PikminAI pikmin, float rngValue) a, (NetworkObjectReference netRef, PikminAI pikmin, float rngValue) b) => a.rngValue.CompareTo(b.rngValue)); NetworkObjectReference[] pikRef = list.Select<(NetworkObjectReference, PikminAI, float), NetworkObjectReference>(((NetworkObjectReference netRef, PikminAI pikmin, float rngValue) data) => data.netRef).ToArray(); float[] rNG = list.Select<(NetworkObjectReference, PikminAI, float), float>(((NetworkObjectReference netRef, PikminAI pikmin, float rngValue) data) => data.rngValue).ToArray(); Dictionary pikminRNG = list.ToDictionary<(NetworkObjectReference, PikminAI, float), PikminAI, float>(((NetworkObjectReference netRef, PikminAI pikmin, float rngValue) data) => data.pikmin, ((NetworkObjectReference netRef, PikminAI pikmin, float rngValue) data) => data.rngValue); ShakePikminServerRpc(MaxShakeOffVelocity, pikRef, rNG); ShakePikmin(pikminRNG); } } } if (HasShattered) { ((Component)enemyScript).transform.position = OOB; } if (!IsDead && ((NetworkBehaviour)this).IsOwner && IsFrozen) { if (FreezeDuration > 0f) { FreezeDuration -= Time.deltaTime; } else { UnfreezeEnemyServerRpc(); FreezeDuration = 3f; } if (!enemyScript.inSpecialAnimation) { UnfreezeEnemyServerRpc(); FreezeDuration = 3f; } } } public virtual void HandleDirectHit(PikminAI? pikminWhoHit = null) { if ((Object)(object)pikminWhoHit != (Object)null && pikminWhoHit.pikminType.DamageDeltUpLanding > 0f) { float num = pikminWhoHit.pikminType.DamageDeltUpLanding * pikminWhoHit.pikminType.GetAttackStrength(pikminWhoHit.CurrentGrowthStage); HitEnemy(num, pikminWhoHit); LethalMin.Logger.LogInfo((object)$"{pikminWhoHit.DebugID}: landed on enemy with: {num}"); } } [ServerRpc(RequireOwnership = false)] public void HitEnemyServerRpc(float Damage, NetworkObjectReference PikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2381649363u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Damage, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2381649363u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; HitEnemyClientRpc(Damage, PikRef); } } } [ServerRpc(RequireOwnership = false)] public void HitEnemyServerRpc(float Damage) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3716079594u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Damage, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3716079594u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; HitEnemyClientRpc(Damage); } } } [ClientRpc] public void HitEnemyClientRpc(float Damage, NetworkObjectReference PikRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(686511168u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Damage, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 686511168u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref PikRef)).TryGet(ref val3, (NetworkManager)null)) { PikminAI pikminWhoHit = default(PikminAI); if (((Component)val3).TryGetComponent(ref pikminWhoHit)) { HitEnemy(Damage, pikminWhoHit); } else { LethalMin.Logger.LogWarning((object)$"Failed to get PikminAI from reference: {PikRef}"); } } else { LethalMin.Logger.LogWarning((object)$"Failed to get NetworkObject from reference: {PikRef}"); } } [ClientRpc] public void HitEnemyClientRpc(float Damage) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2627269985u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Damage, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2627269985u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; HitEnemy(Damage); } } } public virtual void HitEnemy(float Damage, PikminAI? pikminWhoHit = null) { //IL_01a6: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogDebug((object)$"{pikminWhoHit?.DebugID}: Hitting enemy with: {Damage}"); OnHit.Invoke(Damage); DamageCounter += Damage; if ((Object)(object)pikminWhoHit != (Object)null && pikminWhoHit is IcePikminAI) { int num = (EnemyAIPatch.EnemyHPs.ContainsKey(enemyScript.enemyType) ? EnemyAIPatch.EnemyHPs[enemyScript.enemyType] : enemyScript.enemyHP); FreezeCounter += 0.05f; if (((NetworkBehaviour)this).IsOwner && FreezeCounter >= (float)num && !IsFrozen) { Vector3 position = ((Component)this).transform.position; Quaternion rotation = ((Component)this).transform.rotation; FreezeEnemyServerRpc(position, ((Quaternion)(ref rotation)).eulerAngles); Vector3 position2 = ((Component)this).transform.position; rotation = ((Component)this).transform.rotation; FreezeEnemy(position2, ((Quaternion)(ref rotation)).eulerAngles); LethalMin.Logger.LogInfo((object)$"{((Object)((Component)enemyScript).gameObject).name} frozen by Ice Pikmin due to freeze counter: {FreezeCounter}"); return; } } if (DamageCounter >= 1f && ((NetworkBehaviour)this).IsOwner) { Leader leader = null; if ((Object)(object)pikminWhoHit != (Object)null) { leader = pikminWhoHit.previousLeader; } if ((Object)(object)leader != (Object)null) { DamageEnemyServerRpc(DamageCounter, NetworkObjectReference.op_Implicit(((NetworkBehaviour)leader).NetworkObject)); } else { DamageEnemyServerRpc(DamageCounter); } DamageEnemy(DamageCounter, leader); } } [ServerRpc] public void DamageEnemyServerRpc(float Counter) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1755230192u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Counter, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1755230192u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DamageEnemyClientRpc(Counter); } } [ServerRpc] public void DamageEnemyServerRpc(float Counter, NetworkObjectReference leaderRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Invalid comparison between Unknown and I4 //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(843076122u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Counter, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref leaderRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 843076122u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DamageEnemyClientRpc(Counter, leaderRef); } } [ClientRpc] public void DamageEnemyClientRpc(float Counter) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1013583790u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Counter, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1013583790u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { DamageEnemy(Counter); } } } [ClientRpc] public void DamageEnemyClientRpc(float Counter, NetworkObjectReference leaderRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(441066522u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Counter, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref leaderRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 441066522u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsOwner) { return; } NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref leaderRef)).TryGet(ref val3, (NetworkManager)null)) { Leader pikminLeader = default(Leader); if (((Component)val3).TryGetComponent(ref pikminLeader)) { DamageEnemy(Counter, pikminLeader); } else { LethalMin.Logger.LogWarning((object)$"Failed to get Leader from reference: {leaderRef}"); } } else { LethalMin.Logger.LogWarning((object)$"Failed to get NetworkObject from reference: {leaderRef}"); } } public void DamageEnemy(float Counter, Leader? pikminLeader = null) { DamageCounter = Counter; int num = Mathf.FloorToInt(DamageCounter); enemyScript.HitEnemy(num, ((Object)(object)pikminLeader == (Object)null) ? null : pikminLeader.Controller, true, -1); DamageCounter -= num; LethalMin.Logger.LogDebug((object)$"Applied {num} damage to {((Object)((Component)enemyScript).gameObject).name}, remaining counter: {DamageCounter}"); } [ServerRpc] public void ShakePikminServerRpc(float MaxShakeOffVelocity, NetworkObjectReference[] PikRef, float[] RNG) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Invalid comparison between Unknown and I4 //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015e: 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)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2240681561u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref MaxShakeOffVelocity, default(ForPrimitives)); bool flag = PikRef != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(PikRef, default(ForNetworkSerializable)); } bool flag2 = RNG != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe(RNG, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2240681561u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ShakePikminClientRpc(MaxShakeOffVelocity, PikRef, RNG); } } [ClientRpc] public void ShakePikminClientRpc(float MaxShakeOffVelocity, NetworkObjectReference[] PikRef, float[] RNG) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //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_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1045625192u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref MaxShakeOffVelocity, default(ForPrimitives)); bool flag = PikRef != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(PikRef, default(ForNetworkSerializable)); } bool flag2 = RNG != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe(RNG, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1045625192u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)enemyScript).IsOwner) { return; } if (PikRef.Length != RNG.Length) { LethalMin.Logger.LogWarning((object)$"PikRef and RNG arrays have different lengths: {PikRef.Length} != {RNG.Length}"); } this.MaxShakeOffVelocity = MaxShakeOffVelocity; Dictionary dictionary = new Dictionary(); NetworkObject val4 = default(NetworkObject); PikminAI key = default(PikminAI); for (int i = 0; i < PikRef.Length; i++) { NetworkObjectReference val3 = PikRef[i]; if (((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null)) { if (((Component)val4).TryGetComponent(ref key)) { dictionary.Add(key, RNG[i]); } else { LethalMin.Logger.LogWarning((object)$"Failed to get PikminAI from reference: {val3}"); } } else { LethalMin.Logger.LogWarning((object)$"Failed to get NetworkObject from reference: {val3}"); } } ShakePikmin(dictionary.OrderBy((KeyValuePair pair) => pair.Value).ToDictionary((KeyValuePair pair) => pair.Key, (KeyValuePair pair) => pair.Value)); } public virtual void ShakePikmin(Dictionary PikminRNG) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair item in PikminRNG) { if (item.Value > item.Key.pikminType.ShakeEndurance) { item.Key.TryUnlatchPikmin(); Vector3 val = -((Component)item.Key).transform.forward; Vector3 val2 = val + Vector3.up * 0.5f; Vector3 normalized = ((Vector3)(ref val2)).normalized; item.Key.ApplyKnockBack(normalized, MaxShakeOffVelocity / 2f); item.Key.CanGetBackUp = true; } LethalMin.Logger.LogInfo((object)$"{item.Key.DebugID}: Shooken with {item.Key.pikminType.ShakeEndurance}/{item.Value} at {MaxShakeOffVelocity} velocity"); } } public virtual void RemoveAndDisableTriggers() { List list = new List(LatchTriggers); foreach (PikminLatchTrigger item in list) { if ((Object)(object)item.networkAddon != (Object)null) { if (((NetworkBehaviour)item.networkAddon).IsOwner) { item.networkAddon.RemoveAllPikminServerRpc(3); } } else { item.RemoveAllPikmin(3); } ((UnityEventBase)item.OnPikminHit).RemoveAllListeners(); ((Behaviour)item).enabled = false; } } public virtual void OnAddedToEnemy(EnemyAI enemy) { } [ServerRpc] public void FreezeEnemyServerRpc(Vector3 freezePosition, Vector3 freezeRotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Invalid comparison between Unknown and I4 //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2681646306u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref freezePosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref freezeRotation); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2681646306u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; FreezeEnemyClientRpc(freezePosition, freezeRotation); } } [ClientRpc] public void FreezeEnemyClientRpc(Vector3 freezePosition, Vector3 freezeRotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(893237368u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref freezePosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref freezeRotation); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 893237368u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; FreezeEnemy(freezePosition, freezeRotation); } } } public virtual void FreezeEnemy(Vector3 freezePosition, Vector3 freezeRotation) { //IL_0043: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (IsFrozen || enemyScript.isEnemyDead) { return; } FreezeDuration = 12f; IsFrozen = true; FreezeCounter = 0f; enemyScript.serverPosition = freezePosition; enemyScript.serverRotation = freezeRotation; if (((NetworkBehaviour)this).IsOwner) { enemyScript.agent.Warp(freezePosition); } enemyScript.creatureSFX.PlayOneShot(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/wav_bnk_AkB_Ambience_CaveAquarium/Amb_CaveAquarium_WaterBox_FreezePikminAdd.wav")); originalMaterials.Clear(); Renderer[] componentsInChildren = ((Component)enemyScript).GetComponentsInChildren(true); Material val = LethalMin.assetBundle.LoadAsset("Assets/LethalMin/Types/Ice Pikmin/IceMat.mat"); val.color = new Color(val.color.r, val.color.g, val.color.b, 1f); Renderer[] array = componentsInChildren; foreach (Renderer val2 in array) { Material[] array2 = (Material[])(object)new Material[val2.sharedMaterials.Length]; for (int j = 0; j < val2.sharedMaterials.Length; j++) { array2[j] = val2.sharedMaterials[j]; } originalMaterials[val2] = array2; Material[] array3 = (Material[])(object)new Material[val2.sharedMaterials.Length]; for (int k = 0; k < val2.sharedMaterials.Length; k++) { array3[k] = val; } val2.sharedMaterials = array3; } LethalMin.Logger.LogInfo((object)$"{((Object)((Component)enemyScript).gameObject).name} frozen for {FreezeDuration} seconds."); } [ServerRpc] public void UnfreezeEnemyServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1781494340u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1781494340u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UnfreezeEnemyClientRpc(); } } [ClientRpc] public void UnfreezeEnemyClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(899335541u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 899335541u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UnfreezeEnemy(); } } } public virtual void UnfreezeEnemy() { if (!IsFrozen || enemyScript.isEnemyDead) { return; } FreezeDuration = 12f; IsFrozen = false; FreezeCounter = 0f; enemyScript.inSpecialAnimation = false; enemyScript.SetClientCalculatingAI(true); enemyScript.creatureSFX.PlayOneShot(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/wav_bnk_AkB_Ambience_CaveAquarium/Amb_CaveAquariumSwamp_WaterBox(14).wav")); foreach (KeyValuePair originalMaterial in originalMaterials) { Renderer key = originalMaterial.Key; Material[] value = originalMaterial.Value; if ((Object)(object)key != (Object)null && value != null) { key.sharedMaterials = value; } } originalMaterials.Clear(); LethalMin.Logger.LogInfo((object)$"{((Object)((Component)enemyScript).gameObject).name} unfrozen after {FreezeDuration} seconds."); } [ServerRpc] public void ShatterServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3231459992u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3231459992u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ShatterClientRpc(); } } [ClientRpc] public void ShatterClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3475203886u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3475203886u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Shatter(); } } } public virtual void Shatter() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Expected O, but got Unknown //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Expected O, but got Unknown //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Expected O, but got Unknown //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) if (HasShattered) { return; } HasShattered = true; if ((Object)(object)enemyScript.creatureSFX != (Object)null) { } GameObject val = new GameObject(((Object)((Component)enemyScript).gameObject).name + "_IceShards"); AudioSource val2 = val.AddComponent(); val2.spatialBlend = 1f; val2.rolloffMode = (AudioRolloffMode)1; val2.minDistance = 5f; val2.maxDistance = 15f; AudioClip val3 = LethalMin.assetBundle.LoadAsset("Assets/LethalMin/wav_bnk_AkB_Ambience_CaveAquarium/Amb_CaveAquarium_WaterBox_UnFreeze.wav"); val2.PlayOneShot(val3); List list = new List(); if (enemyScript.meshRenderers != null) { list.AddRange((IEnumerable)(object)enemyScript.meshRenderers); } if (enemyScript.skinnedMeshRenderers != null) { list.AddRange((IEnumerable)(object)enemyScript.skinnedMeshRenderers); } Material val4 = LethalMin.assetBundle.LoadAsset("Assets/LethalMin/Types/Ice Pikmin/IceMat.mat"); foreach (Renderer item in list) { if ((Object)(object)item == (Object)null || !((Component)item).gameObject.activeSelf) { continue; } Mesh val5 = null; if (item is MeshRenderer) { MeshFilter component = ((Component)item).GetComponent(); if ((Object)(object)component != (Object)null) { val5 = component.mesh; } } else { SkinnedMeshRenderer val6 = (SkinnedMeshRenderer)(object)((item is SkinnedMeshRenderer) ? item : null); if (val6 != null) { val5 = new Mesh(); val6.BakeMesh(val5); } } if ((Object)(object)val5 == (Object)null || !val5.canAccess) { continue; } int num = 10; Vector3[] vertices = val5.vertices; int[] triangles = val5.triangles; Vector2[] uv = val5.uv; int num2 = triangles.Length / num; if (num2 < 3) { num2 = 3; } for (int i = 0; i < num && i * num2 < triangles.Length; i++) { Mesh val7 = new Mesh(); List list2 = new List(); List list3 = new List(); List list4 = new List(); int num3 = i * num2; int num4 = Mathf.Min(num3 + num2, triangles.Length); Dictionary dictionary = new Dictionary(); for (int j = num3; j < num4 && j + 2 < triangles.Length; j += 3) { for (int k = 0; k < 3; k++) { int num5 = triangles[j + k]; if (!dictionary.ContainsKey(num5)) { dictionary[num5] = list2.Count; list2.Add(vertices[num5]); if (uv.Length > num5) { list4.Add(uv[num5]); } else if (uv.Length != 0) { list4.Add(uv[0]); } } list3.Add(dictionary[num5]); } } if (list3.Count >= 3 && list2.Count >= 3) { val7.vertices = list2.ToArray(); val7.triangles = list3.ToArray(); if (list4.Count == list2.Count) { val7.uv = list4.ToArray(); } val7.RecalculateNormals(); val7.RecalculateBounds(); GameObject val8 = new GameObject($"Chunk_{i}"); val8.transform.parent = val.transform; val8.transform.position = ((Component)item).transform.position; val8.transform.rotation = ((Component)item).transform.rotation; val8.transform.localScale = ((Component)item).transform.lossyScale; MeshFilter val9 = val8.AddComponent(); val9.mesh = val7; MeshRenderer val10 = val8.AddComponent(); if ((Object)(object)val4 != (Object)null) { ((Renderer)val10).material = val4; } else if ((Object)(object)item.sharedMaterial != (Object)null) { ((Renderer)val10).material = item.sharedMaterial; } MeshCollider val11 = val8.AddComponent(); val11.convex = true; Rigidbody val12 = val8.AddComponent(); LayerMask excludeLayers = (((Collider)val11).excludeLayers = LayerMask.op_Implicit(8)); val12.excludeLayers = excludeLayers; Bounds bounds = item.bounds; Vector3 center = ((Bounds)(ref bounds)).center; float num6 = Random.Range(5f, 10f); bounds = item.bounds; Vector3 size = ((Bounds)(ref bounds)).size; val12.AddExplosionForce(num6, center, ((Vector3)(ref size)).magnitude, 0.2f, (ForceMode)1); val12.AddTorque(Random.Range(-5f, 5f), Random.Range(-5f, 5f), Random.Range(-5f, 5f), (ForceMode)1); } } } ((Component)enemyScript).transform.position = OOB; Object.Destroy((Object)(object)val, 30f); LethalMin.Logger.LogInfo((object)(((Object)((Component)enemyScript).gameObject).name + " has shattered into mesh chunks and is now out of bounds.")); } [IteratorStateMachine(typeof(d__47))] protected virtual IEnumerator DestroyAfterDelay(GameObject obj, float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__47(0) { <>4__this = this, obj = obj, delay = delay }; } 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 //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2381649363u, new RpcReceiveHandler(__rpc_handler_2381649363), "HitEnemyServerRpc"); ((NetworkBehaviour)this).__registerRpc(3716079594u, new RpcReceiveHandler(__rpc_handler_3716079594), "HitEnemyServerRpc"); ((NetworkBehaviour)this).__registerRpc(686511168u, new RpcReceiveHandler(__rpc_handler_686511168), "HitEnemyClientRpc"); ((NetworkBehaviour)this).__registerRpc(2627269985u, new RpcReceiveHandler(__rpc_handler_2627269985), "HitEnemyClientRpc"); ((NetworkBehaviour)this).__registerRpc(1755230192u, new RpcReceiveHandler(__rpc_handler_1755230192), "DamageEnemyServerRpc"); ((NetworkBehaviour)this).__registerRpc(843076122u, new RpcReceiveHandler(__rpc_handler_843076122), "DamageEnemyServerRpc"); ((NetworkBehaviour)this).__registerRpc(1013583790u, new RpcReceiveHandler(__rpc_handler_1013583790), "DamageEnemyClientRpc"); ((NetworkBehaviour)this).__registerRpc(441066522u, new RpcReceiveHandler(__rpc_handler_441066522), "DamageEnemyClientRpc"); ((NetworkBehaviour)this).__registerRpc(2240681561u, new RpcReceiveHandler(__rpc_handler_2240681561), "ShakePikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(1045625192u, new RpcReceiveHandler(__rpc_handler_1045625192), "ShakePikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(2681646306u, new RpcReceiveHandler(__rpc_handler_2681646306), "FreezeEnemyServerRpc"); ((NetworkBehaviour)this).__registerRpc(893237368u, new RpcReceiveHandler(__rpc_handler_893237368), "FreezeEnemyClientRpc"); ((NetworkBehaviour)this).__registerRpc(1781494340u, new RpcReceiveHandler(__rpc_handler_1781494340), "UnfreezeEnemyServerRpc"); ((NetworkBehaviour)this).__registerRpc(899335541u, new RpcReceiveHandler(__rpc_handler_899335541), "UnfreezeEnemyClientRpc"); ((NetworkBehaviour)this).__registerRpc(3231459992u, new RpcReceiveHandler(__rpc_handler_3231459992), "ShatterServerRpc"); ((NetworkBehaviour)this).__registerRpc(3475203886u, new RpcReceiveHandler(__rpc_handler_3475203886), "ShatterClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2381649363(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_004a: 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) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float damage = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref damage, default(ForPrimitives)); NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).HitEnemyServerRpc(damage, pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3716079594(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float damage = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref damage, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).HitEnemyServerRpc(damage); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_686511168(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_004a: 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) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float damage = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref damage, default(ForPrimitives)); NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).HitEnemyClientRpc(damage, pikRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2627269985(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float damage = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref damage, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).HitEnemyClientRpc(damage); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1755230192(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { float counter = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref counter, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).DamageEnemyServerRpc(counter); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_843076122(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { float counter = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref counter, default(ForPrimitives)); NetworkObjectReference leaderRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).DamageEnemyServerRpc(counter, leaderRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1013583790(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float counter = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref counter, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).DamageEnemyClientRpc(counter); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_441066522(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_004a: 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) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float counter = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref counter, default(ForPrimitives)); NetworkObjectReference leaderRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).DamageEnemyClientRpc(counter, leaderRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2240681561(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } float maxShakeOffVelocity = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref maxShakeOffVelocity, default(ForPrimitives)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikRef = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); float[] rNG = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref rNG, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).ShakePikminServerRpc(maxShakeOffVelocity, pikRef, rNG); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_1045625192(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_004a: 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) //IL_008f: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float maxShakeOffVelocity = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref maxShakeOffVelocity, default(ForPrimitives)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikRef = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); float[] rNG = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref rNG, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).ShakePikminClientRpc(maxShakeOffVelocity, pikRef, rNG); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2681646306(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 freezePosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref freezePosition); Vector3 freezeRotation = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref freezeRotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).FreezeEnemyServerRpc(freezePosition, freezeRotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_893237368(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 freezePosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref freezePosition); Vector3 freezeRotation = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref freezeRotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).FreezeEnemyClientRpc(freezePosition, freezeRotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1781494340(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).UnfreezeEnemyServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_899335541(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; ((PikminEnemy)(object)target).UnfreezeEnemyClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3231459992(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminEnemy)(object)target).ShatterServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3475203886(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; ((PikminEnemy)(object)target).ShatterClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PikminEnemy"; } } public class PikminGhost : MonoBehaviour { public PikminType LostType = null; public Renderer renderer = null; public Collider collider = null; public Random ghostRandom = null; public string InMemoryof = ""; public Color? overrideColor = null; public Texture2D[] GhostTextures = (Texture2D[])(object)new Texture2D[0]; private Vector3 StartingPosition; private Color StartingColor; private float RemoveTimer; private AudioSource audioSource = null; private int animationTimer = 0; private int animationframe = 0; private void Start() { //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: 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_0246: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LostType == (Object)null) { LethalMin.Logger.LogError((object)(InMemoryof + ": No pikmin type assinged to ghost")); Object.Destroy((Object)(object)((Component)this).gameObject); return; } if ((Object)(object)LostType.PikminGhostOverrideModel != (Object)null) { Object.Destroy((Object)(object)((Component)((Component)this).transform.Find("Plane")).gameObject); Object.Instantiate(LostType.PikminGhostOverrideModel, ((Component)this).transform); } if (ghostRandom == null) { ghostRandom = new Random(Random.Range(0, 10000)); } audioSource = ((Component)this).GetComponent(); audioSource.rolloffMode = (AudioRolloffMode)((!LethalMin.GlobalGhostSFX) ? 1 : 0); if (LostType.SoundPack.GhostSound.Length != 0) { audioSource.clip = LostType.SoundPack.PullSoundFromDict(PikminSoundPackSounds.GhostSFX, ghostRandom); } renderer = ((Component)this).GetComponentInChildren(); if ((Object)(object)LostType.PikminGhostOverrideTexture != (Object)null) { renderer.material.SetTexture("_MainTex", (Texture)(object)LostType.PikminGhostOverrideTexture); } else if (LostType.AnimatedPikminGhostTexture != null && LostType.AnimatedPikminGhostTexture.Length != 0) { renderer.material.SetTexture("_MainTex", (Texture)(object)LostType.AnimatedPikminGhostTexture[0]); } else { renderer.material.SetTexture("_MainTex", (Texture)(object)GhostTextures[(int)PikUtils.ConvertCfgGenerationToPikminGeneration(LethalMin.SoulSpriteGeneration.InternalValue)]); } renderer.material.SetTextureScale("_MainTex", LostType.OverrideGhostTextureTileing); renderer.material.SetTextureOffset("_MainTex", LostType.OverrideGhostTextureOffset); if (LostType.SetGhostColor) { renderer.material.color = ((!overrideColor.HasValue) ? LostType.PikminPrimaryColor : overrideColor.Value); } StartingColor = renderer.material.color; StartingPosition = ((Component)this).transform.position; audioSource.Play(); } public void Update() { //IL_0023: 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_004f: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) collider.enabled = LethalMin.AddCollisionToGhostSprites; ((Component)this).transform.position = new Vector3(((Component)this).transform.position.x, ((Component)this).transform.position.y + Time.deltaTime * 1.5f, ((Component)this).transform.position.z); audioSource.rolloffMode = (AudioRolloffMode)((!LethalMin.GlobalGhostSFX) ? 1 : 0); if (Vector3.Distance(StartingPosition, ((Component)this).transform.position) > 10f) { renderer.material.color = new Color(renderer.material.color.r, renderer.material.color.g, renderer.material.color.b, renderer.material.color.a - Time.deltaTime * 0.5f); RemoveTimer += Time.deltaTime * 0.5f; } if (RemoveTimer > 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); } if (LostType.AnimatedPikminGhostTexture != null && LostType.AnimatedPikminGhostTexture.Length != 0) { UpdateAnimatedGhost(); } } private void UpdateAnimatedGhost() { if (LostType.AnimatedPikminGhostTexture == null) { return; } animationTimer++; if (animationTimer >= LostType.AnimatedPikminGhostFrameHold) { renderer.material.SetTexture("_MainTex", (Texture)(object)LostType.AnimatedPikminGhostTexture[animationframe]); animationTimer = 0; animationframe++; if (PikUtils.IsOutOfRange(LostType.AnimatedPikminGhostTexture, animationframe)) { animationframe = 0; } } } } public class PikminItem : NetworkBehaviour { [CompilerGenerated] private sealed class d__70 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PikminItem <>4__this; private float 5__1; private PikminGeneration 5__2; private PikminGeneration <>s__3; private float 5__4; private List.Enumerator <>s__5; private PikminAI 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__70(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__5 = default(List.Enumerator); 5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__1 = 0.1f; 5__2 = PikUtils.ConvertCfgGenerationToPikminGeneration(LethalMin.PikminSoundGeneration.InternalValue); PikminGeneration pikminGeneration = 5__2; <>s__3 = pikminGeneration; switch (<>s__3) { case PikminGeneration.Pikmin1And2: 5__1 = 0.75f; break; case PikminGeneration.Pikmin3: case PikminGeneration.HeyPikmin: case PikminGeneration.Pikmin4: 5__1 = 0.5f; break; } break; } case 1: <>1__state = -1; 5__4 = ((<>4__this.PikminOnItem.Count == 0) ? 1f : (1f / (float)<>4__this.PikminOnItem.Count)); <>s__5 = <>4__this.PikminOnItem.GetEnumerator(); try { while (<>s__5.MoveNext()) { 5__6 = <>s__5.Current; 5__6.PlayAudioOnLocalClient("ItemCarry", PlayOnVoice: true, 5__4); 5__6 = null; } } finally { ((IDisposable)<>s__5).Dispose(); } <>s__5 = default(List.Enumerator); break; } if (<>4__this.PikminOnItem.Count > 0) { <>2__current = (object)new WaitForSeconds(5__1); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__68 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PikminItem <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__68(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)((NetworkBehaviour)<>4__this).NetworkObject != (Object)null && ((NetworkBehaviour)<>4__this).NetworkObject.IsSpawned) { ((NetworkBehaviour)<>4__this).NetworkObject.Despawn(true); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__83 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public List ais; public PikminItem <>4__this; private List 5__1; private List.Enumerator <>s__2; private PikminAI 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__83(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } 5__1 = null; <>s__2 = default(List.Enumerator); 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown try { int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -3; goto IL_00d6; } <>1__state = -1; 5__1 = new List(ais); <>s__2 = 5__1.GetEnumerator(); <>1__state = -3; goto IL_00de; IL_00d6: 5__3 = null; goto IL_00de; IL_00de: if (<>s__2.MoveNext()) { 5__3 = <>s__2.Current; if ((Object)(object)5__3 != (Object)null) { 5__3.DoYay(OverrideVol: true); <>2__current = (object)new WaitForSeconds(0.02f); <>1__state = 1; return true; } LethalMin.Logger.LogError((object)(((Object)((Component)<>4__this).gameObject).name + " has a null pikmin in its list when doing yays")); goto IL_00d6; } <>m__Finally1(); <>s__2 = default(List.Enumerator); return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__2).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public GrabbableObject ItemScript = null; public Transform GrabPositionContainer = null; public List GrabToPositions = new List(); public int CarryStrengthNeeded = -1; public int TotalCarryStrength = 0; public List PikminOnItem = new List(); public PikminAI? PrimaryPikminOnItem; public PikminItemCounter PikminCounter = null; public PikminItemSettings settings = null; public bool IsBeingCarried; public bool HasInitalized; public bool HasArrived; public Color DefultColor = new Color(1f, 0.1176471f, 0f, 1f); public HoarderBugItem? hoarderBugItem; public PikminRoute CurrentRoute = null; public UnityEvent OnItemGrabbed = new UnityEvent(); public UnityEvent OnItemDropped = new UnityEvent(); public bool HasOwnNetworkObject = true; public Leader? PrimaryLeader = null; public List ExtraRenderers = new List(); public bool DontUseInitClientRpc = false; public bool AlreadyPartalInitalized = false; public EnemyGrabbableObject? EnemyGrabbableObject = null; protected PikminAI? previousPrimaryPikmin; protected PikminAI lastPrimaryPikminOnItem = null; protected Coroutine soundRoutine = null; private Vector3 arrivePosition = Vector3.zero; private float timeSinceArrived = 0f; private PikminType targetPikminTypeOnion = null; private Onion? targetOnion = null; private float routeRecallInterval = 0.2f; private bool hadItemScript = false; private bool isRegeneratingRoute = false; private float arrivedTurnOffDelay = 2f; private float arrivedDistanceCheck = 5f; public int DespawnCount = 0; private bool shouldGrab => !ItemScript.isHeld && TotalCarryStrength >= CarryStrengthNeeded && !IsBeingCarried && ((NetworkBehaviour)this).IsOwner; public void Start() { if (DontUseInitClientRpc) { ItemScript = ((Component)this).GetComponent(); Initalize(); } } [ClientRpc] public void InitalizeClientRpc(NetworkObjectReference Ref, string itemName = "") { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1815125574u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Ref, default(ForNetworkSerializable)); bool flag = itemName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(itemName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1815125574u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (HasInitalized) { LethalMin.Logger.LogWarning((object)("PikminItem " + ((Object)((Component)this).gameObject).name + " has already been initialized. Skipping re-initialization.")); } else if ((Object)(object)ItemScript != (Object)null) { LethalMin.Logger.LogWarning((object)("PikminItem " + ((Object)((Component)this).gameObject).name + " already has an ItemScript")); Initalize(); } else if (!((NetworkObjectReference)(ref Ref)).TryGet(ref val3, (NetworkManager)null)) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + " Failed to get NetworkObject")); if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } else if (!((Component)val3).TryGetComponent(ref ItemScript)) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + " Failed to get ItemScript")); if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } else { Initalize(); } } public void Initalize() { //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogDebug((object)$"Initializing PikminItem {((Object)((Component)this).gameObject).name} with item {((Object)((Component)this).gameObject).name} ({HasOwnNetworkObject})"); GrabbableObject val = default(GrabbableObject); if (((Component)this).TryGetComponent(ref val) && (Object)(object)val == (Object)(object)ItemScript) { HasOwnNetworkObject = false; } else { HasOwnNetworkObject = true; } GetorCreateSettings(); if (HasOwnNetworkObject || ((Object)((Component)this).gameObject).name == "PikminItemNode(Clone)") { LethalMin.Logger.LogDebug((object)string.Format("A {0}, B {1} rename reasons", HasOwnNetworkObject, ((Object)((Component)this).gameObject).name == "PikminItemNode(Clone)")); ((Object)((Component)this).gameObject).name = ItemScript.itemProperties.itemName + " (PikminItem Node)"; } CarryStrengthNeeded = settings.CarryStrength; ExtraRenderers = settings.ExtraRenderers; if (AlreadyPartalInitalized) { GrabPositionContainer.SetParent((Transform)null); ((Component)PikminCounter).transform.SetParent((Transform)null); ((Component)GrabPositionContainer).gameObject.SetActive(true); ((Component)PikminCounter).gameObject.SetActive(true); } else { CreateGrabPositions(); } if ((Object)(object)EnemyGrabbableObject != (Object)null && (Object)(object)EnemyGrabbableObject.ai != (Object)null && EnemyGrabbableObject.ai is MaskedPlayerEnemy) { SetAsArrived(7f, ((Component)EnemyGrabbableObject.ai).transform.position); LethalMin.Logger.LogMessage((object)$"PikminItem {((Object)((Component)this).gameObject).name} has arrived at {arrivePosition} ({timeSinceArrived}) because it was spawned from a masked"); } else if ((Object)(object)EnemyGrabbableObject != (Object)null && (Object)(object)EnemyGrabbableObject.ai != (Object)null) { SetAsArrived(1f, ((Component)EnemyGrabbableObject.ai).transform.position); } PikminManager.instance.AddPikminItem(this); HasInitalized = true; } public void CreateGrabPositions() { //IL_007e: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) int num = CarryStrengthNeeded * 2; float num2 = 1f; Collider val = null; val = (Collider)((!((Object)(object)settings.OverrideGrabPostionColider != (Object)null)) ? ((object)((Component)ItemScript).GetComponentInChildren()) : ((object)settings.OverrideGrabPostionColider)); LethalMin.Logger.LogDebug((object)$"({((Object)((Component)this).gameObject).name}) Colider: {val}"); ManualLogSource logger = LethalMin.Logger; string name = ((Object)((Component)this).gameObject).name; Bounds bounds = val.bounds; logger.LogDebug((object)$"({name}) Center: {((Bounds)(ref bounds)).center}"); if ((Object)(object)val == (Object)null) { LethalMin.Logger.LogWarning((object)("PikminItem " + ((Object)((Component)this).gameObject).name + " has no collider")); return; } if ((Object)(object)GrabPositionContainer == (Object)null) { GrabPositionContainer = new GameObject(((Object)((Component)this).gameObject).name + "'s GrabPositions").transform; ((Component)GrabPositionContainer).transform.rotation = quaternion.op_Implicit(quaternion.identity); GrabPositionContainer.localPosition = ((Component)ItemScript).transform.position; } Vector3 position = ((Component)ItemScript).transform.position; bounds = val.bounds; float x = ((Bounds)(ref bounds)).extents.x; bounds = val.bounds; num2 = Mathf.Max(x, ((Bounds)(ref bounds)).extents.z) + 0.5f; GrabToPositions.Clear(); for (int i = 0; i < num; i++) { float angleDegrees = (float)i * (360f / (float)num); Vector3 position2 = CalculatePositionOnCircle(position, num2, angleDegrees); GameObject val2 = Object.Instantiate(LethalMin.GrabPosPrefab); ((Object)val2).name = $"GrabPosition_{i}"; val2.transform.position = position2; val2.transform.SetParent(GrabPositionContainer); GrabToPositions.Add(val2.GetComponent()); } GrabToPositions.Sort((BoolValue a, BoolValue b) => ((Object)((Component)a).gameObject).name.CompareTo(((Object)((Component)b).gameObject).name)); } private Vector3 CalculatePositionOnCircle(Vector3 center, float radius, float angleDegrees) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) float num = angleDegrees * (MathF.PI / 180f); float num2 = center.x + radius * Mathf.Cos(num); float num3 = center.z + radius * Mathf.Sin(num); return new Vector3(num2, center.y, num3); } public void CreateCounter() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)PikminCounter != (Object)null)) { LethalMin.Logger.LogDebug((object)("Creating counter for " + ((Object)((Component)this).gameObject).name)); PikminCounter = Object.Instantiate(LethalMin.ItemCounterPrefab).GetComponent(); PikminCounter.item = this; PikminCounter.SetCounterColor(DefultColor); ((Object)PikminCounter).name = ((Object)((Component)this).gameObject).name + "'s Counter"; } } public void GetorCreateSettings() { if (AlreadyPartalInitalized) { return; } bool flag = false; if (LethalMin.IsDependencyLoaded("Entity378.sellbodies")) { flag = PikChecks.IsGrabbableBodieFixed(ItemScript); } if ((bool)LethalMin.AllowOnionsToRevivePlayers && !StartOfRound.Instance.allPlayersDead && (Object)(object)((Component)ItemScript).GetComponent() != (Object)null) { flag = true; } if (!((Component)ItemScript).gameObject.TryGetComponent(ref settings)) { settings = ((Component)ItemScript).gameObject.AddComponent(); if (flag) { LethalMin.Logger.LogDebug((object)("GrabbableObject " + ((Object)((Component)ItemScript).gameObject).name + " is a grabbable body!")); settings.CanProduceSprouts = true; settings.OverrideGrabbableToEnemeis = true; settings.SproutsToSpawn = settings.CarryStrength; } } if (settings.CarryStrength == -1) { LethalMin.Logger.LogInfo((object)("PikminItem " + ((Object)((Component)this).gameObject).name + " has no carry strength set, setting to default")); int num = PikUtils.CalculatePikminItemWeight(ItemScript); settings.CarryStrength = num; settings.SproutsToSpawn = num; } } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkDespawn(); PikminManager.instance.RemovePikminItem(this); if (((NetworkBehaviour)this).IsOwner) { RemoveAllPikminFromItemServerRpc(); } ClearCurrentRoute(); if ((Object)(object)GrabPositionContainer != (Object)null) { Object.Destroy((Object)(object)((Component)GrabPositionContainer).gameObject); } if ((Object)(object)PikminCounter != (Object)null) { Object.Destroy((Object)(object)((Component)PikminCounter).gameObject); } } public BoolValue GetNearestGrabPosition(Vector3 Position) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) float num = float.MaxValue; BoolValue result = null; foreach (BoolValue grabToPosition in GrabToPositions) { if (!grabToPosition.value) { float num2 = Vector3.Distance(((Component)grabToPosition).transform.position, Position); if (num2 < num) { num = num2; result = grabToPosition; } } } return result; } [ServerRpc] public void GrabPikminItemServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2246398377u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2246398377u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (settings.ChangeOwnershipOnCarry && ((NetworkBehaviour)this).OwnerClientId != ((NetworkBehaviour)PikminOnItem[0]).OwnerClientId) { if (HasOwnNetworkObject) { ((NetworkBehaviour)ItemScript).NetworkObject.ChangeOwnership(((NetworkBehaviour)PikminOnItem[0]).OwnerClientId); } ((NetworkBehaviour)this).NetworkObject.ChangeOwnership(((NetworkBehaviour)PikminOnItem[0]).OwnerClientId); } GrabPikminItemClientRpc(); } [ClientRpc] public void GrabPikminItemClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2324520482u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2324520482u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { GrabPikminItemOnLocalClient(); } } } public virtual void GrabPikminItemOnLocalClient() { //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " is grabbing an item on local client")); if ((Object)(object)PrimaryPikminOnItem == (Object)null) { return; } if (soundRoutine != null) { ((MonoBehaviour)this).StopCoroutine(soundRoutine); soundRoutine = null; } soundRoutine = ((MonoBehaviour)this).StartCoroutine(CarryNumerator()); ItemScript.parentObject = PrimaryPikminOnItem.HoldPosition; ItemScript.hasHitGround = false; ItemScript.isHeldByEnemy = true; ItemScript.GrabItemFromEnemy((EnemyAI)(object)PrimaryPikminOnItem); ItemScript.EnablePhysics(false); PrimaryPikminOnItem.SetCollisionMode(1); bool flag = true; if ((bool)LethalMin.TakeItemsFromPikmin) { Collider[] propColliders = ItemScript.propColliders; foreach (Collider val in propColliders) { val.enabled = true; } } if (LethalMin.OnCompany && !LethalMin.TakeItemsToOnionOnCompany.InternalValue) { flag = false; } if (settings.CanProduceSprouts && flag) { (PikminType, Onion)? priotizedPikminType = GetPriotizedPikminType(); if (priotizedPikminType.HasValue) { targetPikminTypeOnion = priotizedPikminType.Value.Item1; targetOnion = priotizedPikminType.Value.Item2; LethalMin.Logger.LogInfo((object)$"{((Object)((Component)this).gameObject).name}: Target Pikmin Type: {targetPikminTypeOnion}, Target Onion: {targetOnion}"); PikminCounter.SetCounterColor(priotizedPikminType.Value.Item1.PikminPrimaryColor * 0.75f, priotizedPikminType.Value.Item1.PikminSecondaryColor * 0.75f); } else { LethalMin.Logger.LogWarning((object)("No valid onions found for " + ((Object)((Component)this).gameObject).name + " when grabbing item")); targetPikminTypeOnion = null; targetOnion = null; PikminCounter.SetCounterColor(DefultColor); } } else { targetPikminTypeOnion = null; targetOnion = null; PikminCounter.SetCounterColor(DefultColor); } foreach (PikminAI item in PikminOnItem) { item.SetAsCarryingItem(); } IsBeingCarried = true; CreateRoute(); OnItemGrabbed.Invoke(this); } public (PikminType, Onion)? GetPriotizedPikminType() { if (PikminOnItem.Count == 0) { return null; } Dictionary dictionary = new Dictionary(); foreach (PikminAI item4 in PikminOnItem) { if ((Object)(object)item4.pikminType != (Object)null) { if (!dictionary.ContainsKey(item4.pikminType)) { dictionary[item4.pikminType] = 0; } dictionary[item4.pikminType]++; } } if (dictionary.Count == 0) { return null; } int maxFrequency = dictionary.Values.Max(); List list = (from kv in dictionary where kv.Value == maxFrequency select kv.Key).ToList(); Dictionary dictionary2 = new Dictionary(); foreach (PikminType type2 in list) { PikminAI pikminAI = PikminOnItem.FirstOrDefault((PikminAI p) => (Object)(object)p.pikminType == (Object)(object)type2); if (!((Object)(object)pikminAI != (Object)null)) { continue; } Onion onionOfPikmin = Onion.GetOnionOfPikmin(pikminAI, ExcludeNonSproutProducing: true); if ((Object)(object)onionOfPikmin != (Object)null && onionOfPikmin.onionType.CanCreateSprouts) { int item = onionOfPikmin.PikminInOnion.Count((PikminData p) => p.TypeID == type2.PikminTypeID); dictionary2[type2] = (onionOfPikmin, item); } } if (dictionary2.Count > 0) { KeyValuePair keyValuePair = dictionary2.OrderBy((KeyValuePair kv) => kv.Value.Item2).First(); return (keyValuePair.Key, keyValuePair.Value.Item1); } foreach (KeyValuePair item5 in dictionary) { PikminType type = item5.Key; PikminAI pikminAI2 = PikminOnItem.FirstOrDefault((PikminAI p) => (Object)(object)p.pikminType == (Object)(object)type); if (!((Object)(object)pikminAI2 != (Object)null)) { continue; } Onion onionOfPikmin2 = Onion.GetOnionOfPikmin(pikminAI2, ExcludeNonSproutProducing: true); if ((Object)(object)onionOfPikmin2 != (Object)null && onionOfPikmin2.onionType.CanCreateSprouts) { int item2 = onionOfPikmin2.PikminInOnion.Count((PikminData p) => p.TypeID == type.PikminTypeID); dictionary2[type] = (onionOfPikmin2, item2); } } if (dictionary2.Count > 0) { KeyValuePair keyValuePair2 = dictionary2.OrderBy((KeyValuePair kv) => kv.Value.Item2).First(); return (keyValuePair2.Key, keyValuePair2.Value.Item1); } if ((Object)(object)PikminManager.instance != (Object)null && PikminManager.instance.Onions.Count > 0) { LethalMin.Logger.LogInfo((object)"Trying to find any available onion as fallback"); List<(PikminType, Onion, int)> list2 = new List<(PikminType, Onion, int)>(); foreach (Onion onion in PikminManager.instance.Onions) { if (!((Object)(object)onion != (Object)null) || !((Object)(object)onion.onionType != (Object)null) || !onion.onionType.CanCreateSprouts) { continue; } for (int i = 0; i < onion.onionType.TypesCanHold.Length; i++) { PikminType onionPikminType = onion.onionType.TypesCanHold[i]; if ((Object)(object)onionPikminType != (Object)null) { int item3 = onion.PikminInOnion.Count((PikminData p) => p.TypeID == onionPikminType.PikminTypeID); list2.Add((onionPikminType, onion, item3)); } } } if (list2.Count > 0) { (PikminType, Onion, int) tuple = list2.OrderBy<(PikminType, Onion, int), int>(((PikminType type, Onion onion, int count) info) => info.count).First(); LethalMin.Logger.LogInfo((object)$"Found fallback onion with {tuple.Item3} pikmin inside"); return (tuple.Item1, tuple.Item2); } } return null; } public void OnPrimaryChange() { if ((Object)(object)PrimaryPikminOnItem == (Object)null) { return; } LethalMin.Logger.LogMessage((object)(((Object)((Component)this).gameObject).name + " Switched Primary Pikmin to " + PrimaryPikminOnItem.DebugID)); if (IsBeingCarried) { ItemScript.parentObject = PrimaryPikminOnItem.HoldPosition; ItemScript.GrabItemFromEnemy((EnemyAI)(object)PrimaryPikminOnItem); if (!((Behaviour)((EnemyAI)PrimaryPikminOnItem).agent).enabled) { PrimaryPikminOnItem.SetCollisionMode(1); } } } public bool IsntHeldByPikmin() { return ItemScript.isHeld || (ItemScript.isHeldByEnemy && !IsBeingCarried); } public virtual void DiscardPikminItem() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: 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_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) Vector3 zero = Vector3.zero; bool droppedInElevator = false; bool pikminInElevator = (Object)(object)lastPrimaryPikminOnItem != (Object)null && lastPrimaryPikminOnItem.IsInShip; if (!IsBeingCarried || (Object)(object)lastPrimaryPikminOnItem == (Object)null) { LethalMin.Logger.LogWarning((object)(((Object)((Component)this).gameObject).name + " is not being carried or has no last primary pikmin")); DropPikminItemOnLocalClient(zero); DropPikminItemServerRpc(zero); return; } NetworkObjectReference primaryLeader = default(NetworkObjectReference); if ((Object)(object)PrimaryLeader != (Object)null) { primaryLeader = NetworkObjectReference.op_Implicit(((NetworkBehaviour)PrimaryLeader).NetworkObject); } NetworkObject val = null; Vector3 hitPoint; NetworkObject physicsRegionOfDroppedObject = GetPhysicsRegionOfDroppedObject(lastPrimaryPikminOnItem, out hitPoint); Bounds bounds; if ((Object)(object)physicsRegionOfDroppedObject != (Object)null) { LethalMin.Logger.LogInfo((object)("Physics region of dropped object: " + ((Object)physicsRegionOfDroppedObject).name)); zero = hitPoint; val = physicsRegionOfDroppedObject; bounds = StartOfRound.Instance.shipBounds.bounds; droppedInElevator = ((Bounds)(ref bounds)).Contains(zero); DropPikminItemOnLocalClient(zero, matchRotationOfParent: false, droppedInElevator, pikminInElevator, ((Component)val).transform, PrimaryLeader); DropPikminItemServerRpc(zero, matchRotationOfParent: false, droppedInElevator, pikminInElevator, NetworkObjectReference.op_Implicit(val), primaryLeader); return; } Vector3 val2 = RoundManager.Instance.RandomlyOffsetPosition(ItemScript.GetItemFloorPosition(default(Vector3)), 1.2f, 0.4f); val2 = ItemScript.GetItemFloorPosition(default(Vector3)); bounds = StartOfRound.Instance.shipBounds.bounds; if (((Bounds)(ref bounds)).Contains(val2) && !settings.DontParentWhenDropping) { val2 = StartOfRound.Instance.elevatorTransform.InverseTransformPoint(val2); droppedInElevator = true; LethalMin.Logger.LogInfo((object)$"Dropped in elevator, adjusted target floor position: {val2}"); } else if (!settings.DontParentWhenDropping) { val2 = StartOfRound.Instance.propsContainer.InverseTransformPoint(val2); droppedInElevator = false; LethalMin.Logger.LogInfo((object)$"Adjusted target floor position: {val2}"); } DropPikminItemOnLocalClient(val2, matchRotationOfParent: true, droppedInElevator, pikminInElevator, null, PrimaryLeader); DropPikminItemServerRpc(val2, matchRotationOfParent: true, droppedInElevator, pikminInElevator, default(NetworkObjectReference), primaryLeader); } [ServerRpc] public void DropPikminItemServerRpc(Vector3 targetFloorPosition, bool matchRotationOfParent = true, bool droppedInElevator = false, bool pikminInElevator = false, NetworkObjectReference parentObject = default(NetworkObjectReference), NetworkObjectReference primaryLeader = default(NetworkObjectReference)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Invalid comparison between Unknown and I4 //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2510730474u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref targetFloorPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref matchRotationOfParent, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref droppedInElevator, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pikminInElevator, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref parentObject, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref primaryLeader, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2510730474u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DropPikminItemClientRpc(targetFloorPosition, matchRotationOfParent, droppedInElevator, pikminInElevator, parentObject, primaryLeader); } } [ClientRpc] public void DropPikminItemClientRpc(Vector3 targetFloorPosition, bool matchRotationOfParent = true, bool droppedInElevator = false, bool pikminInElevator = false, NetworkObjectReference parentObject = default(NetworkObjectReference), NetworkObjectReference primaryLeader = default(NetworkObjectReference)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012a: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_01a1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(182670198u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref targetFloorPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref matchRotationOfParent, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref droppedInElevator, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pikminInElevator, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref parentObject, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref primaryLeader, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 182670198u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { Transform parentObject2 = null; Leader primaryLeader2 = null; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref parentObject)).TryGet(ref val3, (NetworkManager)null)) { parentObject2 = ((Component)val3).transform; } NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref primaryLeader)).TryGet(ref val4, (NetworkManager)null)) { primaryLeader2 = ((Component)val4).GetComponent(); } DropPikminItemOnLocalClient(targetFloorPosition, matchRotationOfParent, droppedInElevator, pikminInElevator, parentObject2, primaryLeader2); } } public virtual void DropPikminItemOnLocalClient(Vector3 targetFloorPosition, bool matchRotationOfParent = true, bool droppedInElevator = false, bool pikminInElevator = false, Transform? parentObject = null, Leader? PrimaryLeader = null) { //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: 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) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " is dropping an item on local client")); if ((Object)(object)ItemScript == (Object)null) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + " has no ItemScript when dropping")); return; } if (IsBeingCarried) { LethalMin.Logger.LogInfo((object)("PrimaryLeader: " + PrimaryLeader?.Controller.playerUsername)); if ((Object)(object)parentObject == (Object)null || settings.DontParentWhenDropping) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " dropped an item on a non-physics region parent")); ItemScript.heldByPlayerOnServer = false; ItemScript.parentObject = null; if (droppedInElevator) { if (!settings.DontParentWhenDropping && (!settings.ServerAuthParenting || ((NetworkBehaviour)this).IsServer)) { ((Component)ItemScript).transform.SetParent(StartOfRound.Instance.elevatorTransform, true); } } else if (!settings.DontParentWhenDropping && (!settings.ServerAuthParenting || ((NetworkBehaviour)this).IsServer)) { ((Component)ItemScript).transform.SetParent(StartOfRound.Instance.propsContainer, true); } if (PrimaryLeader != null) { PrimaryLeader.Controller.SetItemInElevator(pikminInElevator, pikminInElevator, ItemScript); } if (droppedInElevator) { RoundManager.Instance.CollectNewScrapForThisRound(ItemScript); } ItemScript.EnablePhysics(true); ItemScript.EnableItemMeshes(true); ItemScript.isHeld = false; ItemScript.isPocketed = false; ItemScript.fallTime = 0f; ItemScript.startFallingPosition = (((Object)(object)((Component)ItemScript).transform.parent == (Object)null) ? ((Component)ItemScript).transform.position : ((Component)ItemScript).transform.parent.InverseTransformPoint(((Component)ItemScript).transform.position)); ((Component)ItemScript).transform.localScale = ItemScript.originalScale; ((Component)ItemScript).transform.localPosition = targetFloorPosition; ItemScript.targetFloorPosition = targetFloorPosition; ItemScript.floorYRot = (int)((Component)ItemScript).transform.eulerAngles.y; } else { PlayerPhysicsRegion componentInChildren = ((Component)parentObject).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.allowDroppingItems) { parentObject = componentInChildren.physicsTransform; } LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " dropped an item on a physics region parent")); ItemScript.EnablePhysics(true); ItemScript.EnableItemMeshes(true); ItemScript.isHeld = false; ItemScript.isPocketed = false; ItemScript.heldByPlayerOnServer = false; if (PrimaryLeader != null) { PrimaryLeader.Controller.SetItemInElevator(pikminInElevator, pikminInElevator, ItemScript); } if (droppedInElevator) { RoundManager.Instance.CollectNewScrapForThisRound(ItemScript); } ItemScript.parentObject = null; if (!settings.ServerAuthParenting || ((NetworkBehaviour)this).IsServer) { ((Component)ItemScript).transform.SetParent(parentObject, true); } ItemScript.startFallingPosition = ((Component)ItemScript).transform.localPosition; ((Component)ItemScript).transform.localScale = ItemScript.originalScale; ItemScript.targetFloorPosition = targetFloorPosition; ItemScript.targetFloorPosition = targetFloorPosition; if (!matchRotationOfParent) { ItemScript.fallTime = 0f; } else { ((Component)ItemScript).transform.localEulerAngles = new Vector3(0f, 0f, 0f); ItemScript.fallTime = 1.1f; } ItemScript.OnPlaceObject(); } ItemScript.isHeldByEnemy = false; ItemScript.DiscardItemFromEnemy(); } IsBeingCarried = false; lastPrimaryPikminOnItem = null; PikminCounter.SetCounterColor(DefultColor); ClearCurrentRoute(); if (soundRoutine != null) { ((MonoBehaviour)this).StopCoroutine(soundRoutine); soundRoutine = null; } foreach (PikminAI item in PikminOnItem) { item.UnsetAsCarryingItem(); } OnItemDropped.Invoke(this); } private Vector3 DropItemAheadOfPikmin(PikminAI pikmin) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_008c: 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_00b1: 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_00a2: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) Vector3 zero = Vector3.zero; Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)this).transform.position + Vector3.up * 0.4f, ((Component)pikmin).transform.forward); RaycastHit val2 = default(RaycastHit); zero = ((!Physics.Raycast(val, ref val2, 1.7f, 268438273, (QueryTriggerInteraction)1)) ? ((Ray)(ref val)).GetPoint(1.7f) : ((Ray)(ref val)).GetPoint(Mathf.Clamp(((RaycastHit)(ref val2)).distance - 0.3f, 0.01f, 2f))); Vector3 itemFloorPosition = ItemScript.GetItemFloorPosition(zero); if (itemFloorPosition == zero) { itemFloorPosition = ItemScript.GetItemFloorPosition(default(Vector3)); } return itemFloorPosition; } [ServerRpc] public void RemoveAllPikminFromItemServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2058973021u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2058973021u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RemoveAllPikminFromItemClientRpc(); } } [ClientRpc] public void RemoveAllPikminFromItemClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(365604985u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 365604985u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RemoveAllPikminFromItemOnLocalClient(); } } } private void RemoveAllPikminFromItemOnLocalClient() { List list = new List(PikminOnItem); foreach (PikminAI item in list) { if (item.CurrentTask != null) { if (!(item.CurrentTask is CarryItemTask)) { LethalMin.Logger.LogWarning((object)("Pikmin " + item.DebugID + " current task is not carry item task???")); } else { item.FinishTask(); } } } PikminOnItem.Clear(); } [ServerRpc] public void RemoveFromPikminServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4108332875u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4108332875u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RemoveFromPikminClientRpc(); } } [ClientRpc] public void RemoveFromPikminClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4074632369u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4074632369u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RemoveFromPikminOnLocalClient(); } } } private void RemoveFromPikminOnLocalClient() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) foreach (PikminAI item in PikminOnItem) { if (!IsBeingCarried) { break; } if ((Object)(object)item != (Object)null) { item.PlayAudioOnLocalClient(PikminSoundPackSounds.Lost); } } IsBeingCarried = false; ItemScript.isHeldByEnemy = false; lastPrimaryPikminOnItem = null; PikminCounter.SetCounterColor(DefultColor); ClearCurrentRoute(); RemoveAllPikminFromItemOnLocalClient(); } public NetworkObject GetPhysicsRegionOfDroppedObject(PikminAI pikminDropping, out Vector3 hitPoint) { //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_0092: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: 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_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) Transform val = null; RaycastHit val3 = default(RaycastHit); if ((Object)(object)pikminDropping != (Object)null && ItemScript.itemProperties.allowDroppingAheadOfPlayer) { Debug.DrawRay(((Component)pikminDropping).transform.position + Vector3.up * 0.4f, ((Component)pikminDropping).transform.forward * 1.7f, Color.yellow, 1f); Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(((Component)pikminDropping).transform.position + Vector3.up * 0.4f, ((Component)pikminDropping).transform.forward); Vector3 val4 = ((!Physics.Raycast(val2, ref val3, 1.7f, 1342179585, (QueryTriggerInteraction)1)) ? ((Ray)(ref val2)).GetPoint(1.7f) : ((Ray)(ref val2)).GetPoint(Mathf.Clamp(((RaycastHit)(ref val3)).distance - 0.3f, 0.01f, 2f))); if (Physics.Raycast(val4, -Vector3.up, ref val3, 80f, 1342179585, (QueryTriggerInteraction)1)) { Debug.DrawRay(val4, -Vector3.up * 80f, Color.yellow, 2f); val = ((Component)((RaycastHit)(ref val3)).collider).gameObject.transform; } } else { Ray val5 = default(Ray); ((Ray)(ref val5))..ctor(((Component)ItemScript).transform.position, -Vector3.up); if (Physics.Raycast(val5, ref val3, 80f, 1342179585, (QueryTriggerInteraction)1)) { Debug.DrawRay(((Component)ItemScript).transform.position, -Vector3.up * 80f, Color.blue, 2f); val = ((Component)((RaycastHit)(ref val3)).collider).gameObject.transform; } } if ((Object)(object)val != (Object)null) { PlayerPhysicsRegion componentInChildren = ((Component)val).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.allowDroppingItems && componentInChildren.itemDropCollider.ClosestPoint(((RaycastHit)(ref val3)).point) == ((RaycastHit)(ref val3)).point) { NetworkObject parentNetworkObject = componentInChildren.parentNetworkObject; if ((Object)(object)parentNetworkObject != (Object)null) { Vector3 addPositionOffsetToItems = componentInChildren.addPositionOffsetToItems; hitPoint = componentInChildren.physicsTransform.InverseTransformPoint(((RaycastHit)(ref val3)).point + Vector3.up * 0.04f + ItemScript.itemProperties.verticalOffset * Vector3.up + addPositionOffsetToItems); return parentNetworkObject; } Debug.LogError((object)("Error: physics region transform does not have network object?: " + ((Object)((Component)val).gameObject).name)); } } hitPoint = Vector3.zero; return null; } public void SetAsArrived(float Delay = 2f, Vector3? OverrideArrivePosition = null, float Distance = 5f) { //IL_004a: 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_0030: 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) HasArrived = true; timeSinceArrived = Time.time; arrivedTurnOffDelay = Delay; arrivedDistanceCheck = Distance; if (OverrideArrivePosition.HasValue) { arrivePosition = OverrideArrivePosition.Value; } else { arrivePosition = ((Component)ItemScript).transform.position; } } [ServerRpc(RequireOwnership = false)] public void IncrumentDestoryCountServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2602416696u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2602416696u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; DespawnCount++; if (DespawnCount >= StartOfRound.Instance.connectedPlayersAmount + 1) { LethalMin.Logger.LogInfo((object)("All Clients marked to despawn " + ((Object)((Component)this).gameObject).name)); if ((Object)(object)ItemScript.playerHeldBy != (Object)null) { LethalMin.Logger.LogWarning((object)("Item " + ((Object)((Component)this).gameObject).name + " is held by a player! dropping")); ItemScript.playerHeldBy.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3)); } if (HasOwnNetworkObject) { ((NetworkBehaviour)ItemScript).NetworkObject.Despawn(true); } else { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } } public override void OnNetworkObjectParentChanged(NetworkObject parentNetworkObject) { ((NetworkBehaviour)this).OnNetworkObjectParentChanged(parentNetworkObject); if (HasOwnNetworkObject && (Object)(object)((Component)this).transform.parent == (Object)null && ((NetworkBehaviour)this).IsServer && HasInitalized) { LethalMin.Logger.LogWarning((object)("PikminItem " + ((Object)((Component)this).gameObject).name + " is detached from a GrabbableObject")); ((MonoBehaviour)this).StartCoroutine(DespawnNextFrame()); } } [IteratorStateMachine(typeof(d__68))] private IEnumerator DespawnNextFrame() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__68(0) { <>4__this = this }; } public virtual void Update() { //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ItemScript == (Object)null) { if (((NetworkBehaviour)this).IsServer && hadItemScript) { LethalMin.Logger.LogWarning((object)("PikminItem " + ((Object)((Component)this).gameObject).name + " has no ItemScript, despawning")); ((NetworkBehaviour)this).NetworkObject.Despawn(true); } return; } hadItemScript = true; if (PikminOnItem.Count > 0) { PrimaryPikminOnItem = PikminOnItem[0]; lastPrimaryPikminOnItem = PikminOnItem[0]; if ((Object)(object)PrimaryPikminOnItem != (Object)(object)previousPrimaryPikmin && (Object)(object)PrimaryPikminOnItem != (Object)null) { previousPrimaryPikmin = PrimaryPikminOnItem; OnPrimaryChange(); } } else { PrimaryPikminOnItem = null; previousPrimaryPikmin = null; } if (shouldGrab) { int count = PikminOnItem.Count; PikminOnItem.RemoveAll((PikminAI pikmin) => (Object)(object)pikmin == (Object)null); if (count != PikminOnItem.Count) { LethalMin.Logger.LogWarning((object)$"{((Object)((Component)this).gameObject).name} had null pikmin in PikminOnItem list, removed {count - PikminOnItem.Count} null pikmin"); } } if (shouldGrab) { GrabPikminItemOnLocalClient(); GrabPikminItemServerRpc(); } if (hoarderBugItem != null && IsBeingCarried) { hoarderBugItem.status = (HoarderBugItemStatus)1; } if (ItemScript.isHeld && PikminOnItem.Count > 0 && ((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + ": Stopping Carry because player held item")); RemoveFromPikminServerRpc(); } if (ItemScript.isHeldByEnemy && !IsBeingCarried && PikminOnItem.Count > 0 && ((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + ": Stopping Carry because enemy held item")); RemoveAllPikminFromItemServerRpc(); } if (IsBeingCarried && (Object)(object)PrimaryPikminOnItem == (Object)null && PikminOnItem.Count > 0 && ((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + ": Stopping Carry because Primary Pikmin Is Null")); RemoveAllPikminFromItemServerRpc(); } if (PikminOnItem.Count > 0) { int[] source = PikminOnItem.Select((PikminAI pikmin) => pikmin.CurrentCarryStrength).ToArray(); TotalCarryStrength = source.Sum(); } else { TotalCarryStrength = 0; } if (TotalCarryStrength < CarryStrengthNeeded && IsBeingCarried && ((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " is not carrying enough pikmin and is dropping it")); DiscardPikminItem(); return; } if (CurrentRoute != null && ((NetworkBehaviour)this).IsOwner) { CurrentRoute.Update(); if (routeRecallInterval > 0f) { routeRecallInterval -= Time.deltaTime; } else if (CurrentRoute != null) { routeRecallInterval = 0.25f + Random.Range(0.1f, 0.25f); if (PikminOnItem.Count > 0) { PrimaryLeader = PikUtils.GetLeaderFromMultiplePikmin(PikminOnItem); } } } if ((Object)(object)GrabPositionContainer != (Object)null) { ((Component)GrabPositionContainer).transform.position = ((Component)ItemScript).transform.position; } if ((HasArrived && IsntHeldByPikmin()) || (HasArrived && Vector3.Distance(arrivePosition, ((Component)ItemScript).transform.position) > arrivedDistanceCheck) || (settings.CanProduceSprouts && Time.time - timeSinceArrived > arrivedTurnOffDelay)) { HasArrived = false; arrivePosition = Vector3.zero; } if ((Object)(object)PikminCounter == (Object)null) { if (AlreadyPartalInitalized) { LethalMin.Logger.LogWarning((object)(((Object)((Component)this).gameObject).name + " has no Pikmin Counter, creating one")); } CreateCounter(); } else if ((Object)(object)GrabPositionContainer == (Object)null) { if (AlreadyPartalInitalized) { LethalMin.Logger.LogWarning((object)(((Object)((Component)this).gameObject).name + " has no GrabPositionContainer, creating one")); } CreateGrabPositions(); } else { ((Component)PikminCounter).gameObject.SetActive(PikminOnItem.Count > 0); } } [IteratorStateMachine(typeof(d__70))] private IEnumerator CarryNumerator() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__70(0) { <>4__this = this }; } public float GetSpeed(bool OverrideCarryCheck = false) { if (PikminOnItem.Count == 0 || (!IsBeingCarried && !OverrideCarryCheck)) { return 0f; } float num = Mathf.Max(1f, (float)CarryStrengthNeeded); float num2 = Mathf.Max(1f, (float)(CarryStrengthNeeded * 2)); float num3 = 0f; foreach (PikminAI item in PikminOnItem) { float speed = item.pikminType.GetSpeed(item.CurrentGrowthStage, item.ShouldRun); float num4 = 0f; switch (item.CurrentGrowthStage) { case 0: num4 = 0.2f; break; case 1: num4 = 0.5f; break; case 2: num4 = 1f; break; } num3 += speed + num4; } float num5 = 1f; float num6 = 0f; float num7 = num5 + (num3 - num + (float)PikminOnItem.Count) / num2 + num6; return Mathf.Max(num7, 1f); } public void CreateRoute() { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown ClearCurrentRoute(); if ((Object)(object)PrimaryPikminOnItem != (Object)null) { PikminRouteRequest pikminRouteRequest = new PikminRouteRequest { Pikmin = PrimaryPikminOnItem, Intent = DetermineRouteIntent(), TargetOnion = targetOnion, CarriedItem = this, HandleEntrances = false }; if (pikminRouteRequest.Intent == RouteIntent.ToPlayer) { PrimaryLeader = PikUtils.GetLeaderFromMultiplePikmin(PikminOnItem); pikminRouteRequest.TargetPlayer = PrimaryLeader; pikminRouteRequest.CustomCheckDistance = settings.RouteToPlayerDroppingDistance; } CurrentRoute = PikminRouteManager.Instance.CreateRoute(pikminRouteRequest); CurrentRoute.OnNodeReached.AddListener((UnityAction)OnNodeReached); CurrentRoute.OnRouteComplete.AddListener(new UnityAction(OnRouteEndOwnerSide)); CurrentRoute.OnRouteInvalidated.AddListener((UnityAction)OnRouteInvalidated); if (!isRegeneratingRoute) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " has created a route")); } isRegeneratingRoute = false; } else { LethalMin.Logger.LogWarning((object)(((Object)((Component)this).gameObject).name + " has no primary pikmin to create a route")); } } public virtual RouteIntent DetermineRouteIntent() { //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)PrimaryPikminOnItem == (Object)null) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + " has no primary pikmin to determine route intent")); return RouteIntent.ToShip; } if (settings.RouteToPlayer) { return RouteIntent.ToPlayer; } if ((bool)LethalMin.TakeItemsToTheOnion && (Object)(object)targetOnion != (Object)null && (!LethalMin.OnCompany || (bool)LethalMin.TakeItemsToOnionOnCompany)) { if (TestRoute(RouteIntent.ToOnion)) { return RouteIntent.ToOnion; } LethalMin.Logger.LogWarning((object)"Failed to find path to onion, setting target onion to null."); targetOnion = null; PikminCounter.SetCounterColor(DefultColor); } else if ((Object)(object)targetOnion != (Object)null) { LethalMin.Logger.LogDebug((object)"Not taking item to onion due to configs, setting target onion to null."); targetOnion = null; PikminCounter.SetCounterColor(DefultColor); } if (LethalMin.OnCompany) { RouteIntent routeIntent = ((ItemScript.itemProperties.isScrap || (bool)LethalMin.CarryNonScrapItemsToCompany) ? RouteIntent.ToCounter : RouteIntent.ToShip); if (TestRoute(routeIntent)) { return routeIntent; } } Vector3 val = (((EnemyAI)PrimaryPikminOnItem).isOutside ? ((Component)ItemScript).transform.position : PikminRouteManager.Instance.EntranceExitPoints[PikminRouteManager.GetClosestEntrance(((Component)ItemScript).transform.position, CompareOutside: false)].position); float num = float.PositiveInfinity; foreach (PikminVehicleController vehicle in PikminManager.instance.Vehicles) { if (vehicle.controller.backDoorOpen && !vehicle.controller.carDestroyed && !vehicle.IsNearByShip()) { float num2 = Vector3.Distance(((Component)vehicle).transform.position, val); if (num2 < num) { num = num2; } } } float num3 = Vector3.Distance(((Component)StartOfRound.Instance.shipBounds).transform.position, val); bool flag = PikminManager.instance.Vehicles.Count > 0 && num3 > num && (bool)LethalMin.TakeItemsToTheCar; if (!((EnemyAI)PrimaryPikminOnItem).isOutside) { return DetermineIndoorRouteIntent(flag); } if (flag && TestRoute(RouteIntent.ToVehicle)) { return RouteIntent.ToVehicle; } return RouteIntent.ToShip; } private RouteIntent DetermineIndoorRouteIntent(bool shouldPreferVehicle) { RouteIntent routeIntent = ((!LethalMin.UseExitsWhenCarryingItems) ? RouteIntent.ToExit : RouteIntent.ToShip); if (shouldPreferVehicle && routeIntent == RouteIntent.ToShip && TestRoute(RouteIntent.ToVehicle)) { return RouteIntent.ToVehicle; } if (TestRoute(routeIntent)) { return routeIntent; } if (PikminRouteManager.Instance.CurrentFloorData != null && TestRoute(RouteIntent.ToElevator)) { return RouteIntent.ToElevator; } return RouteIntent.ToShip; } public bool TestRoute(RouteIntent intent) { PikminRouteRequest request = new PikminRouteRequest { Pikmin = PrimaryPikminOnItem, Intent = intent, TargetOnion = targetOnion, CarriedItem = this, HandleEntrances = false }; PikminRoute pikminRoute = PikminRouteManager.Instance.CreateRoute(request); if (pikminRoute == null || !pikminRoute.IsFullPath) { LethalMin.Logger.LogWarning((object)$"{((Object)((Component)this).gameObject).name} could not create a route to the {intent}"); return false; } LethalMin.Logger.LogInfo((object)$"{((Object)((Component)this).gameObject).name} successfully created a test route to the {intent}"); pikminRoute.DestoryRoute(); return true; } public void OnNodeReached(RouteNode node) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " has reached a route node: " + node.name)); EntranceTeleport entrance = default(EntranceTeleport); if ((Object)(object)node.entrancePoint != (Object)null && (bool)LethalMin.UseExitsWhenCarryingItems && ((Component)node.entrancePoint).TryGetComponent(ref entrance)) { UseEntranceOwnerSide(entrance); } } public void ClearCurrentRoute() { if (CurrentRoute != null) { CurrentRoute.DestoryRoute(); CurrentRoute = null; LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " has cleared its route")); } } public void OnRouteInvalidated(RouteValidation.InvalidationReason reason) { LethalMin.Logger.LogWarning((object)$"{((Object)((Component)this).gameObject).name} route has been invalidated ({reason}), clearing route"); isRegeneratingRoute = true; CreateRoute(); } public void OnRouteEndOwnerSide() { if (((NetworkBehaviour)this).IsOwner) { OnRouteEnd((Object)(object)targetOnion != (Object)null); if (((NetworkBehaviour)this).NetworkObject.IsSpawned) { OnRouteEndServerRpc((Object)(object)targetOnion != (Object)null); } } } [ServerRpc] public void OnRouteEndServerRpc(bool suckItemIntoOnion) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2369184943u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref suckItemIntoOnion, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2369184943u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; OnRouteEndClientRpc(suckItemIntoOnion); } } [ClientRpc] public void OnRouteEndClientRpc(bool suckItemIntoOnion) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(234345826u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref suckItemIntoOnion, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 234345826u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { OnRouteEnd(suckItemIntoOnion); } } } public void OnRouteEnd(bool suckItemIntoOnion = false) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " has reached its route end")); SetAsArrived(); ((MonoBehaviour)this).StartCoroutine(DoYays(PikminOnItem)); ClearCurrentRoute(); if (suckItemIntoOnion) { if ((Object)(object)targetOnion == (Object)null) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + " owner requested to have sucked into onion, but it has no target onion to suck item into!")); } else { targetOnion.SuckItemIntoOnion(this, targetPikminTypeOnion); } } RemoveAllPikminFromItemOnLocalClient(); } [IteratorStateMachine(typeof(d__83))] private IEnumerator DoYays(List ais) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__83(0) { <>4__this = this, ais = ais }; } private void UseEntranceOwnerSide(EntranceTeleport entrance) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { UseEntranceServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)entrance).NetworkObject)); } } [ServerRpc] public void UseEntranceServerRpc(NetworkObjectReference Ref) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3779673240u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Ref, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3779673240u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UseEntranceClientRpc(Ref); } } [ClientRpc] public void UseEntranceClientRpc(NetworkObjectReference Ref) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2887981461u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Ref, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2887981461u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); EntranceTeleport val4 = default(EntranceTeleport); if (((NetworkObjectReference)(ref Ref)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref val4)) { UseEntranceOnLocalClient(val4, val4.isEntranceToBuilding); } else { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": Could not find entrance")); } } } public void UseEntranceOnLocalClient(EntranceTeleport entrance, bool Inside) { if (!IsBeingCarried) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + " is not carrying any pikmin, cannot use entrance")); return; } List list = new List(PikminOnItem); foreach (PikminAI item in list) { item.UseEntranceOnLocalClient(entrance, Inside, PlaySFX: false); } ItemScript.isInFactory = Inside; entrance.PlayAudioAtTeleportPositions(); } 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 //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1815125574u, new RpcReceiveHandler(__rpc_handler_1815125574), "InitalizeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2246398377u, new RpcReceiveHandler(__rpc_handler_2246398377), "GrabPikminItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(2324520482u, new RpcReceiveHandler(__rpc_handler_2324520482), "GrabPikminItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(2510730474u, new RpcReceiveHandler(__rpc_handler_2510730474), "DropPikminItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(182670198u, new RpcReceiveHandler(__rpc_handler_182670198), "DropPikminItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(2058973021u, new RpcReceiveHandler(__rpc_handler_2058973021), "RemoveAllPikminFromItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(365604985u, new RpcReceiveHandler(__rpc_handler_365604985), "RemoveAllPikminFromItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(4108332875u, new RpcReceiveHandler(__rpc_handler_4108332875), "RemoveFromPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(4074632369u, new RpcReceiveHandler(__rpc_handler_4074632369), "RemoveFromPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(2602416696u, new RpcReceiveHandler(__rpc_handler_2602416696), "IncrumentDestoryCountServerRpc"); ((NetworkBehaviour)this).__registerRpc(2369184943u, new RpcReceiveHandler(__rpc_handler_2369184943), "OnRouteEndServerRpc"); ((NetworkBehaviour)this).__registerRpc(234345826u, new RpcReceiveHandler(__rpc_handler_234345826), "OnRouteEndClientRpc"); ((NetworkBehaviour)this).__registerRpc(3779673240u, new RpcReceiveHandler(__rpc_handler_3779673240), "UseEntranceServerRpc"); ((NetworkBehaviour)this).__registerRpc(2887981461u, new RpcReceiveHandler(__rpc_handler_2887981461), "UseEntranceClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1815125574(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_004a: 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) //IL_007c: 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_009a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference @ref = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref @ref, default(ForNetworkSerializable)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string itemName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminItem)(object)target).InitalizeClientRpc(@ref, itemName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2246398377(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminItem)(object)target).GrabPikminItemServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2324520482(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; ((PikminItem)(object)target).GrabPikminItemClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2510730474(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00c5: 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) //IL_00e0: 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_00fb: 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_0115: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } Vector3 targetFloorPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetFloorPosition); bool matchRotationOfParent = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref matchRotationOfParent, default(ForPrimitives)); bool droppedInElevator = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref droppedInElevator, default(ForPrimitives)); bool pikminInElevator = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikminInElevator, default(ForPrimitives)); NetworkObjectReference parentObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref parentObject, default(ForNetworkSerializable)); NetworkObjectReference primaryLeader = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref primaryLeader, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminItem)(object)target).DropPikminItemServerRpc(targetFloorPosition, matchRotationOfParent, droppedInElevator, pikminInElevator, parentObject, primaryLeader); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_182670198(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00eb: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 targetFloorPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetFloorPosition); bool matchRotationOfParent = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref matchRotationOfParent, default(ForPrimitives)); bool droppedInElevator = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref droppedInElevator, default(ForPrimitives)); bool pikminInElevator = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikminInElevator, default(ForPrimitives)); NetworkObjectReference parentObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref parentObject, default(ForNetworkSerializable)); NetworkObjectReference primaryLeader = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref primaryLeader, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminItem)(object)target).DropPikminItemClientRpc(targetFloorPosition, matchRotationOfParent, droppedInElevator, pikminInElevator, parentObject, primaryLeader); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2058973021(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminItem)(object)target).RemoveAllPikminFromItemServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_365604985(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; ((PikminItem)(object)target).RemoveAllPikminFromItemClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4108332875(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminItem)(object)target).RemoveFromPikminServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4074632369(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; ((PikminItem)(object)target).RemoveFromPikminClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2602416696(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; ((PikminItem)(object)target).IncrumentDestoryCountServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2369184943(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { bool suckItemIntoOnion = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref suckItemIntoOnion, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminItem)(object)target).OnRouteEndServerRpc(suckItemIntoOnion); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_234345826(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 suckItemIntoOnion = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref suckItemIntoOnion, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminItem)(object)target).OnRouteEndClientRpc(suckItemIntoOnion); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3779673240(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference @ref = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref @ref, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminItem)(object)target).UseEntranceServerRpc(@ref); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2887981461(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 @ref = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref @ref, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminItem)(object)target).UseEntranceClientRpc(@ref); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PikminItem"; } } public class PikminItemCounter : MonoBehaviour { public TMP_Text DeviderCounter = null; public TMP_Text PikminOnItemCounter = null; public TMP_Text PikminNeededCounter = null; public PikminItem item = null; public Color PrimaryAccent; public Color SecondaryAccent; public float Offset; private void Update() { //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_022c: 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) if ((Object)(object)item == (Object)null) { LethalMin.Logger.LogWarning((object)("(" + ((Object)((Component)this).gameObject).name + ")'s item is null, destroying counter.")); Object.Destroy((Object)(object)((Component)this).gameObject); return; } Color val = default(Color); ((Color)(ref val))..ctor(PrimaryAccent.r, PrimaryAccent.g, PrimaryAccent.b, 0.5f); Color val2 = default(Color); ((Color)(ref val2))..ctor(SecondaryAccent.r, SecondaryAccent.g, SecondaryAccent.b, 0.75f); Color color = default(Color); ((Color)(ref color))..ctor(PrimaryAccent.r, PrimaryAccent.g, PrimaryAccent.b, 1f); Color val3 = default(Color); ((Color)(ref val3))..ctor(SecondaryAccent.r, SecondaryAccent.g, SecondaryAccent.b, 1f); PikminOnItemCounter.text = $"{item.TotalCarryStrength}"; PikminNeededCounter.text = $"{item.CarryStrengthNeeded}"; if ((Object)(object)item.ItemScript != (Object)null) { ((Component)this).transform.localPosition = new Vector3(((Component)item.ItemScript).transform.position.x, ((Component)item.ItemScript).transform.position.y + Offset, ((Component)item.ItemScript).transform.position.z); } if (item.IsBeingCarried) { ((Graphic)DeviderCounter).color = color; ((Graphic)PikminOnItemCounter).color = color; ((Graphic)PikminNeededCounter).color = color; DeviderCounter.outlineColor = Color32.op_Implicit(val3); PikminOnItemCounter.outlineColor = Color32.op_Implicit(val3); PikminNeededCounter.outlineColor = Color32.op_Implicit(val3); } else { ((Graphic)DeviderCounter).color = val; ((Graphic)PikminOnItemCounter).color = val2; ((Graphic)PikminNeededCounter).color = val; DeviderCounter.outlineColor = Color32.op_Implicit(val2); PikminOnItemCounter.outlineColor = Color32.op_Implicit(val); PikminNeededCounter.outlineColor = Color32.op_Implicit(val2); } } public void SetCounterColor(Color colorA, Color? ColorB = null) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) PrimaryAccent = colorA; SecondaryAccent = ((!ColorB.HasValue) ? Color.black : ColorB.Value); } } public class PikminItemSettings : MonoBehaviour { [Tooltip("How many Pikmin are required to carry this item. -1 means to auto calculate based on weight")] public int CarryStrength = -1; [Tooltip("If true, this item will be taken to the onion to produce sprouts")] public bool CanProduceSprouts = false; [Tooltip("If true, Pikmin will beable to grab this item even if GrabableToEnemies is false on the grabable component")] public bool OverrideGrabbableToEnemeis = false; [Tooltip("How many sprouts to spawn when this item is taken to the onion. (will be auto set with CarryStrength if CarryStrength is -1)")] public int SproutsToSpawn = 0; [Tooltip("How many more sprouts will spawn if the item is taken to the onion of the preferred type, (SproutsToSpawn * PerferedTypeMultipler)")] public float PerferedTypeMultipler = 1f; [Tooltip("If true, the item will not be reparented when dropped")] public bool DontParentWhenDropping = false; [Tooltip("If true, the server will be the authority on parenting when dropped")] public bool ServerAuthParenting = false; [Tooltip("If true, pikmin will take this item to the player")] public bool RouteToPlayer = false; [Tooltip("The NavMeshAgent Stopping distance when routing to the player")] public float RouteToPlayerStoppingDistance = 5f; [Tooltip("The distance from the player at which the item will be dropped when routing to the player")] public float RouteToPlayerDroppingDistance = 0f; [Tooltip("If true, the item will change ownership to the Primary Pikmin's leader when carried")] public bool ChangeOwnershipOnCarry = true; [Tooltip("If true, the item can be grabbed by Pikmin")] public bool GrabableToPikmin = true; [Tooltip("If true, the pikmin will not consider this item when looking for items to grab, basically the same as setting GrabableToPikmin to false, but pikmin won't drop it if they are already carrying it")] public bool ExcludeFromGetItemsCheck = false; [Tooltip("If true, the item will not be initialized on startup with a counter and grab positions.")] public bool DontInitalizeOnStartup = false; [Tooltip("The preferred type of Pikmin that will give the preferred type multiplier when brought to the onion")] public PikminType PerferedType = null; [Tooltip("The colider that will be used for determining the grab positions")] public Collider OverrideGrabPostionColider = null; [Tooltip("Used for the white glow effect when brought to the onion")] public List ExtraRenderers = new List(); } public enum PikminLatchTriggerType { PikminEntersTrigger, TriggerEntersPikmin } public enum LatchTriggerStateToSet { Attack, Stuck } public class PikminLatchTrigger : MonoBehaviour { [Tooltip("The state that the pikmin must be in to be landed on the latch trigger (Leave empty for any state)")] public List StateCondisions = new List(); [Tooltip("The state that the pikmin will be switched to when landing on the trigger")] public LatchTriggerStateToSet StateToSet = LatchTriggerStateToSet.Stuck; [Tooltip("The max number of pikmin that can be on the trigger at once")] public int MaxAmmount = 100; [Tooltip("The time it takes for the pikmin to be killed, recomended for it to be higher than the time to escape varible")] public float KillTimer = -1f; [Tooltip("The ammount of time a player needs to whistle for a pikmin to escape (set to -255 to be unescapeable)")] public float WhistleTime = 0f; [Tooltip("Allow pikmin to latch on via OnCollisionEnter")] public bool AllowBaseLatchOn = true; [Tooltip("Incase you want the transform the pikmin latch to and the trigger be 2 differnt things.")] public Transform? OverrideLatchObject; [HideInInspector] public List PikminOnLatch = new List(); public Transform? OverrideLookAtObject; [Tooltip("The Network Addon, needed if you don't have any other way of syncing pikmin latching onto the trigger")] public PikminLatchTriggerNetworkAddon networkAddon = null; [Header("Events (Called for every player)")] public UnityEvent OnPikminDirectLatch; public UnityEvent OnPikminLatch; public UnityEvent OnPikminUnlatch; public UnityEvent OnPikminHit; public (Pintent, int) GetPikminState() { switch (StateToSet) { case LatchTriggerStateToSet.Attack: return (Pintent.Attack, 2); case LatchTriggerStateToSet.Stuck: return (Pintent.Stuck, 3); default: LethalMin.Logger.LogError((object)$"Invalid state to set: {StateToSet}"); return (Pintent.Stuck, 3); } } public PikminLatchTrigger() { OnPikminLatch = new UnityEvent(); OnPikminUnlatch = new UnityEvent(); OnPikminHit = new UnityEvent(); OnPikminDirectLatch = new UnityEvent(); } public void InvokePikminDirectLatch(PikminAI pikmin) { OnPikminDirectLatch.Invoke(pikmin); } public void InvokePikminLatch(PikminAI pikmin) { OnPikminLatch.Invoke(pikmin); } public void InvokePikminUnlatch(PikminAI pikmin) { OnPikminUnlatch.Invoke(pikmin); } public void InvokePikminHit(PikminAI pikmin) { OnPikminHit.Invoke(pikmin); } public void RemoveAllPikmin(int Mode) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0086: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) if ((bool)LethalMin.YeetAfterLatchOn) { Mode = 0; } List list = new List(PikminOnLatch); switch (Mode) { case 0: { foreach (PikminAI item in list) { UnlatchPikmin(item); Vector3 val = -((Component)item).transform.forward; Vector3 val2 = val + Vector3.up * 0.5f; Vector3 normalized = ((Vector3)(ref val2)).normalized; item.ApplyKnockBack(normalized, LethalMin.YeetAfterLatchOn.InternalValue ? 25f : 10f); } break; } case 1: { foreach (PikminAI item2 in list) { UnlatchPikmin(item2); } break; } case 2: { foreach (PikminAI item3 in list) { item3.SetToIdle(); item3.SetCollisionMode(1); } break; } case 3: { foreach (PikminAI item4 in list) { item4.SetToIdle(); item4.SetCollisionMode(1); item4.DoYay(); } break; } } } public virtual bool TryLatch(PikminAI pikmin, Vector3 Point, bool IsDirectHit = true, bool DoCheckOnly = false) { //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) if (PikminOnLatch.Count >= MaxAmmount) { LethalMin.Logger.LogWarning((object)$"Latch failed because max ammount reached ({MaxAmmount})"); return false; } if (PikminOnLatch.Contains(pikmin)) { LethalMin.Logger.LogWarning((object)("Latch failed because Pikmin is already latching (" + pikmin.DebugID + ")")); return false; } if (!StateCondisions.ToList().Contains(pikmin.CurrentIntention)) { return false; } if ((Object)(object)pikmin.CurrentLatchTrigger != (Object)null) { LethalMin.Logger.LogWarning((object)("Latch failed because Pikmin is on another trigger (" + pikmin.DebugID + ")")); return false; } if (DoCheckOnly) { return true; } if ((Object)(object)networkAddon != (Object)null) { networkAddon.LatchPikminServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)pikmin).NetworkObject), Point, IsDirectHit); } LatchPikmin(pikmin, Point, IsDirectHit); return true; } public virtual void LatchPikmin(PikminAI pikmin, Vector3 LandPos, bool IsDirectHit = true) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogDebug((object)(((Object)((Component)this).gameObject).name + " Latching Pikmin: " + pikmin.DebugID)); pikmin.LatchPikmin(this, LandPos); PikminOnLatch.Add(pikmin); InvokePikminLatch(pikmin); if (IsDirectHit) { InvokePikminDirectLatch(pikmin); } } public virtual void UnlatchPikmin(PikminAI pikmin) { LethalMin.Logger.LogInfo((object)("Unlatching Pikmin: " + pikmin.DebugID)); pikmin.UnlatchPikmin(); PikminOnLatch.Remove(pikmin); InvokePikminUnlatch(pikmin); } public virtual void OnDestroy() { RemoveAllPikmin(2); } } public class PikminLatchTriggerNetworkAddon : NetworkBehaviour { public PikminLatchTrigger MainTrigger = null; [ServerRpc(RequireOwnership = false)] public void RemoveAllPikminServerRpc(int Mode) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3722833395u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, Mode); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3722833395u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RemoveAllPikminClientRpc(Mode); } } } [ClientRpc] public void RemoveAllPikminClientRpc(int Mode) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1728998641u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, Mode); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1728998641u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; MainTrigger.RemoveAllPikmin(Mode); } } } [ServerRpc(RequireOwnership = false)] public void LatchPikminServerRpc(NetworkObjectReference PikRef, Vector3 LandPos, bool IsDirectHit = true) { //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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2528098858u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref LandPos); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref IsDirectHit, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2528098858u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; LatchPikminClientRpc(PikRef, LandPos, IsDirectHit); } } } [ClientRpc] public void LatchPikminClientRpc(NetworkObjectReference PikRef, Vector3 LandPos, bool IsDirectHit = true) { //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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1050966179u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PikRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref LandPos); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref IsDirectHit, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1050966179u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { NetworkObject val3 = default(NetworkObject); PikminAI pikmin = default(PikminAI); if (((NetworkObjectReference)(ref PikRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref pikmin)) { MainTrigger.LatchPikmin(pikmin, LandPos, IsDirectHit); } else { LethalMin.Logger.LogError((object)$"Failed to latch Pikmin: {PikRef}"); } } } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkDespawn(); MainTrigger.RemoveAllPikmin(2); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3722833395u, new RpcReceiveHandler(__rpc_handler_3722833395), "RemoveAllPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(1728998641u, new RpcReceiveHandler(__rpc_handler_1728998641), "RemoveAllPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(2528098858u, new RpcReceiveHandler(__rpc_handler_2528098858), "LatchPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(1050966179u, new RpcReceiveHandler(__rpc_handler_1050966179), "LatchPikminClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3722833395(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 mode = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mode); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminLatchTriggerNetworkAddon)(object)target).RemoveAllPikminServerRpc(mode); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1728998641(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 mode = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mode); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminLatchTriggerNetworkAddon)(object)target).RemoveAllPikminClientRpc(mode); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2528098858(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_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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); Vector3 landPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref landPos); bool isDirectHit = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isDirectHit, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminLatchTriggerNetworkAddon)(object)target).LatchPikminServerRpc(pikRef, landPos, isDirectHit); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1050966179(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_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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference pikRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRef, default(ForNetworkSerializable)); Vector3 landPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref landPos); bool isDirectHit = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isDirectHit, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminLatchTriggerNetworkAddon)(object)target).LatchPikminClientRpc(pikRef, landPos, isDirectHit); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PikminLatchTriggerNetworkAddon"; } } public class PikminManager : NetworkBehaviour { public enum PikminOddsPositions { Indoors, Outdoors, Sprouts, NoSprouts, Any } [CompilerGenerated] private sealed class d__181 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PikminManager <>4__this; private int 5__1; private List 5__2; private List.Enumerator <>s__3; private SproutData 5__4; private GameObject 5__5; private Sprout 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__181(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } 5__2 = null; <>s__3 = default(List.Enumerator); 5__5 = null; 5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown try { int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -3; 5__5 = null; 5__6 = null; } else { <>1__state = -1; if (!((NetworkBehaviour)<>4__this).IsServer) { return false; } 5__1 = 0; if (!SaveManager.KeyExists("persistentSprouts")) { goto IL_01c6; } 5__2 = SaveManager.Load>("persistentSprouts"); <>s__3 = 5__2.GetEnumerator(); <>1__state = -3; } while (<>s__3.MoveNext()) { 5__4 = <>s__3.Current; if (5__4.MoonSpawnedOn != StartOfRound.Instance.currentLevelID) { continue; } 5__5 = Object.Instantiate(LethalMin.SproutPrefab, 5__4.Position, 5__4.Rotaion); 5__6 = 5__5.GetComponent(); 5__6.IsPersistant = true; ((NetworkBehaviour)5__6).NetworkObject.Spawn(false); 5__6.InitalizeClientRpc(5__4); 5__1++; <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 1; return true; } <>m__Finally1(); <>s__3 = default(List.Enumerator); if (5__1 > 0) { LethalMin.Logger.LogInfo((object)$"Loaded {5__1} persistent sprouts"); } 5__2 = null; goto IL_01c6; IL_01c6: return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__3).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__40 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int singCount; public float initialDelay; public float[] intervals; public PikminManager <>4__this; private int 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__40(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; LethalMin.Logger.LogInfo((object)$"Singing will start in {initialDelay:F2} seconds, with {singCount} total sings."); <>2__current = (object)new WaitForSeconds(initialDelay); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = 0; goto IL_0109; case 2: { <>1__state = -1; goto IL_00f8; } IL_0109: if (5__1 < singCount) { <>4__this.TriggerOneSing(); if (5__1 < singCount - 1) { LethalMin.Logger.LogInfo((object)$"Next sing will occur in {intervals[5__1]:F2} seconds."); <>2__current = (object)new WaitForSeconds(intervals[5__1]); <>1__state = 2; return true; } goto IL_00f8; } <>4__this._singingCoroutine = null; return false; IL_00f8: 5__1++; goto IL_0109; } } 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__161 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PikminManager <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__161(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(10f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.SpawnOnions(); 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__151 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PikminType Ptype; public int Quant; public Vector3 SpawnPos; public Quaternion SpawnRot; public float interval; public PikminManager <>4__this; private int 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__151(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!PikChecks.IsNavMeshOnMap()) { LethalMin.Logger.LogWarning((object)"Current map does not have a navmesh, cannot spawn pikmin!"); return false; } 5__1 = 0; break; case 1: <>1__state = -1; <>4__this.SpawnPikminOnServer(Ptype, SpawnPos, SpawnRot); 5__1++; break; } if (5__1 < Quant) { <>2__current = (object)new WaitForSeconds(interval); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__37 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float targetWeight; public float duration; public bool autoFadeOut; public float holdTime; public PikminManager <>4__this; private float 5__1; private float 5__2; private float 5__3; private float 5__4; private float 5__5; private float 5__6; private float 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__37(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (<>4__this.ChargeTweenCoroutine != null) { ((MonoBehaviour)<>4__this).StopCoroutine(<>4__this.ChargeTweenCoroutine); <>4__this.ChargeTweenCoroutine = null; } 5__1 = <>4__this.ChargeVolume.weight; 5__2 = Time.time; 5__3 = 5__2 + duration; goto IL_0126; case 1: <>1__state = -1; goto IL_0126; case 2: <>1__state = -1; goto IL_0182; case 3: { <>1__state = -1; goto IL_0258; } IL_0182: if (!autoFadeOut || !(targetWeight > 0f)) { break; } 5__2 = Time.time; 5__3 = 5__2 + duration; 5__1 = <>4__this.ChargeVolume.weight; goto IL_0258; IL_0258: if (Time.time < 5__3) { 5__6 = (Time.time - 5__2) / duration; 5__7 = 5__6 * 5__6 * (3f - 2f * 5__6); <>4__this.ChargeVolume.weight = Mathf.Lerp(5__1, 0f, 5__7); <>2__current = null; <>1__state = 3; return true; } <>4__this.ChargeVolume.weight = 0f; break; IL_0126: if (Time.time < 5__3) { 5__4 = (Time.time - 5__2) / duration; 5__5 = 5__4 * 5__4 * (3f - 2f * 5__4); <>4__this.ChargeVolume.weight = Mathf.Lerp(5__1, targetWeight, 5__5); <>2__current = null; <>1__state = 1; return true; } <>4__this.ChargeVolume.weight = targetWeight; if (holdTime > 0f) { <>2__current = (object)new WaitForSeconds(holdTime); <>1__state = 2; return true; } goto IL_0182; } <>4__this.ChargeTweenCoroutine = null; 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__163 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int AmmountToWaitFor; public PikminManager <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__163(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; LethalMin.Logger.LogInfo((object)$"Waiting for {AmmountToWaitFor} onions to load... Total: {<>4__this.OnionsSpawnable.Count}"); goto IL_0087; case 1: <>1__state = -1; goto IL_0087; case 2: { <>1__state = -1; LethalMin.Logger.LogInfo((object)$"{AmmountToWaitFor}/{<>4__this.OnionsSpawnable.Count} onions loaded, loading data"); <>4__this.LoadOnionData(); return false; } IL_0087: if (<>4__this.OnionsSpawnable.Count < AmmountToWaitFor) { <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__185 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PikminManager <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__185(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => !IsSaving)); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.DespawnOnions(); <>4__this.DespawnSprouts(); <>4__this.DespawnLumiknulls(); <>4__this.DespawnExtras(); 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 static PikminManager instance = null; public float CleanupCheckTimer = 0f; public static bool CanPathOnMoonGlobal; public PikminEndOfGameStats EndOfGameStats = new PikminEndOfGameStats(); public PikminFiredStats FiredStats = default(PikminFiredStats); public Transform ShipPosition = null; public Volume ChargeVolume = null; public Coroutine ChargeTweenCoroutine = null; public ShipPhaseOnionContainer shipPhaseOnionContainer = null; public MoonSettings? CurrentMoonSettings = null; public Dictionary LeaflingPlayers = new Dictionary(); private bool _allScrapCollected = false; private bool _singingTriggered = false; private float _scrapCheckTimer = 0f; private Coroutine _singingCoroutine = null; private static float SINGING_GROUP_RADIUS = 10f; internal NetworkVariable Cheat_WhistleMakesNoiseAtNoticeZone = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable Cheat_DontMakeAudibleNoises = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable Cheat_PikminSingalCooldown = new NetworkVariable(-1f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable Cheat_UselessBluesMode = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable Cheat_InvinceablePikmin = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable Cheat_NoKnockback = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable Cheat_MaxWhistleZoneRadius = new NetworkVariable(-1f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable Cheat_MaxWhistleZoneDistance = new NetworkVariable(-1f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable Cheat_PlayerNoticeZoneSize = new NetworkVariable(-1f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable Cheat_PikminDamageMultipler = new NetworkVariable(-1f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable Cheat_PikminSpeedMultipler = new NetworkVariable(-1f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable Cheat_ChargeCoolDown = new NetworkVariable(-1f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal NetworkVariable Cheat_ChargeDistance = new NetworkVariable(-1f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public Leader LocalLeader = null; public List FreezeableWaters = new List(); public List ScannedPiklopediaIDs = new List(); public List NewlyScannedPiklopediaIDs = new List(); public List ExtrasSpawnedObjects = new List(); private Dictionary _wildSpawnFalloffCache = new Dictionary(); private float _cachedOverallIndoorFalloff = 0f; private float _cachedOverallOutdoorFalloff = 0f; public static bool IsSaving = false; public List OnionsCollected = new List(); public static bool IsTooManyPikminOnMap => instance.PikminAIs.Count > LethalMin.MaxPikmin.InternalValue; public bool UseSaveModLib => LethalMin.IsDependencyLoaded("MaxWasUnavailable.LethalModDataLib"); public List Leaders { get; private set; } = new List(); public HashSet PikminAIs { get; private set; } = new HashSet(); public HashSet PikminAICounter { get; private set; } = new HashSet(); public HashSet EnemyAIs { get; private set; } = new HashSet(); public HashSet ConvertedAIs { get; private set; } = new HashSet(); public HashSet PikminItems { get; private set; } = new HashSet(); public HashSet PikminEnemies { get; private set; } = new HashSet(); public HashSet Onions { get; private set; } = new HashSet(); public HashSet OnionsSpawnable => new HashSet(from o in Onions where (Object)(object)o != (Object)null select o as BaseOnion into o where (Object)(object)o != (Object)null select o); public HashSet Vehicles { get; private set; } = new HashSet(); public Dictionary EnemyItems { get; private set; } = new Dictionary(); public HashSet PuffminLeaders { get; private set; } = new HashSet(); public HashSet PuffminAIs { get; private set; } = new HashSet(); public HashSet ItemArrivalZones { get; private set; } = new HashSet(); private void Awake() { instance = this; ((Object)this).name = "Pikmin Manager"; ((Component)this).gameObject.AddComponent(); } private void Start() { //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) foreach (EnemyType enemyType in LethalMin.EnemyTypes) { try { EnemyAIPatch.AddPikminEnemyToEnemyAI(enemyType); } catch (Exception arg) { LethalMin.Logger.LogError((object)$"Error adding Pikmin Enemy for {enemyType.enemyName}: {arg}"); } } MaskedPlayerEnemy[] array = Resources.FindObjectsOfTypeAll(); foreach (MaskedPlayerEnemy val in array) { try { MaskedPlayerEnemyPatch.RegisterAsPuffminLeader(val); } catch (Exception arg2) { LethalMin.Logger.LogError((object)$"Error registering MaskedPlayerEnemy {((Object)val).name} as Puffmin Leader: {arg2}"); } } EnemyAIPatch.FillinEnemyHPs(); GameObject val2 = LethalMin.assetBundle.LoadAsset("Assets/LethalMin/HUD/ChargeVolume.prefab"); ChargeVolume = Object.Instantiate(val2).gameObject.GetComponentInChildren(); ((Object)ChargeVolume).name = "Pikmin Charge Volume"; shipPhaseOnionContainer = Object.Instantiate(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/ShipPhaseOnionContainer.prefab")).GetComponent(); LoadInitalData(); if ((Object)(object)ShipPosition == (Object)null) { ShipPosition = new GameObject("LethalMin_ShipPosition").transform; } ShipPosition.position = StartOfRound.Instance.elevatorTransform.position; ShipPosition.rotation = StartOfRound.Instance.elevatorTransform.rotation; SyncLeaflingPlayers(); if (!((NetworkBehaviour)this).IsServer) { OnPlayerJoinnedServerRpc(); } NetworkVariable cheat_InvinceablePikmin = Cheat_InvinceablePikmin; cheat_InvinceablePikmin.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)cheat_InvinceablePikmin.OnValueChanged, (Delegate?)(object)(OnValueChangedDelegate)delegate(bool oldValue, bool newValue) { LethalMin.Logger.LogInfo((object)$"Cheat_InvinceablePikmin set to {newValue}"); }); } private void Update() { if (((NetworkBehaviour)this).IsServer) { Cheat_WhistleMakesNoiseAtNoticeZone.Value = LethalMin.WhistleMakesNoiseAtNoiceZone; Cheat_DontMakeAudibleNoises.Value = LethalMin.DontMakeAudibleNoises; Cheat_PikminSingalCooldown.Value = LethalMin.PikminSignalCooldown; Cheat_UselessBluesMode.Value = LethalMin.UselessBluesMode; Cheat_InvinceablePikmin.Value = LethalMin.InvinceablePikmin; Cheat_NoKnockback.Value = LethalMin.NoKnockBack; Cheat_MaxWhistleZoneRadius.Value = LethalMin.MaxWhistleZoneRadius; Cheat_MaxWhistleZoneDistance.Value = LethalMin.MaxWhistleZoneDistance; Cheat_PlayerNoticeZoneSize.Value = LethalMin.PlayerNoticeZoneSize; Cheat_PikminDamageMultipler.Value = LethalMin.PikminDamageMultipler; Cheat_PikminSpeedMultipler.Value = LethalMin.PikminSpeedMultipler; Cheat_ChargeCoolDown.Value = LethalMin.ChargeCooldown; Cheat_ChargeDistance.Value = LethalMin.ChargeDistance; } if (!StartOfRound.Instance.inShipPhase && ((NetworkBehaviour)this).IsServer) { if (CleanupCheckTimer >= 0f) { CleanupCheckTimer -= Time.deltaTime; } else { CleanUpExcessPikmin(); CleanupCheckTimer = 1f; } } if ((Object)(object)shipPhaseOnionContainer != (Object)null) { ((Component)shipPhaseOnionContainer).gameObject.SetActive((bool)LethalMin.ShowOnionsInSpace && StartOfRound.Instance.inShipPhase); } if (!((NetworkBehaviour)this).IsServer || StartOfRound.Instance.inShipPhase || _singingTriggered) { return; } _scrapCheckTimer -= Time.deltaTime; if (!(_scrapCheckTimer <= 0f)) { return; } _scrapCheckTimer = 2f; if (CheckAllScrapCollected() && !LethalMin.OnCompany) { if (!_allScrapCollected) { _allScrapCollected = true; int num = Random.Range(2, 5); float initialDelay = Random.Range(5f, 12f); float[] array = new float[num - 1]; for (int i = 0; i < array.Length; i++) { array[i] = Random.Range(20f, 55f); } TriggerSingingClientRpc(num, initialDelay, array); } } else { _allScrapCollected = false; } } [IteratorStateMachine(typeof(d__37))] public IEnumerator TweenChargeWeight(float targetWeight, float duration = 0.5f, bool autoFadeOut = true, float holdTime = 0.2f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__37(0) { <>4__this = this, targetWeight = targetWeight, duration = duration, autoFadeOut = autoFadeOut, holdTime = holdTime }; } private bool CheckAllScrapCollected() { bool flag = false; foreach (PikminItem pikminItem in PikminItems) { if (!((Object)(object)pikminItem == (Object)null) && !((Object)(object)pikminItem.ItemScript == (Object)null) && !((Object)(object)pikminItem.ItemScript.itemProperties == (Object)null) && pikminItem.ItemScript.itemProperties.isScrap) { flag = true; if (!pikminItem.ItemScript.isInShipRoom) { return false; } } } return flag && PikminAIs.Any((PikminAI p) => (Object)(object)p != (Object)null && !p.IsDeadOrDying && (Object)(object)p.leader != (Object)null); } [ClientRpc] public void TriggerSingingClientRpc(int singCount, float initialDelay, float[] intervals) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3621159874u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, singCount); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref initialDelay, default(ForPrimitives)); bool flag = intervals != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(intervals, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3621159874u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (_singingCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_singingCoroutine); } _singingTriggered = true; _singingCoroutine = ((MonoBehaviour)this).StartCoroutine(SingingSequence(singCount, initialDelay, intervals)); } } [IteratorStateMachine(typeof(d__40))] private IEnumerator SingingSequence(int singCount, float initialDelay, float[] intervals) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__40(0) { <>4__this = this, singCount = singCount, initialDelay = initialDelay, intervals = intervals }; } private void TriggerOneSing() { //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) List list = new List(); foreach (PikminAI pikminAI in PikminAIs) { if ((Object)(object)pikminAI != (Object)null && !pikminAI.IsDeadOrDying && (Object)(object)pikminAI.leader != (Object)null && (Object)(object)pikminAI.CurrentSoundPack.PullSoundFromDict("Singing", new Random()) != (Object)null) { list.Add(pikminAI); } } if (list.Count == 0) { LethalMin.Logger.LogWarning((object)"No singable Pikmin found for singing trigger."); return; } HashSet hashSet = new HashSet(); foreach (PikminAI pikmin in list) { if (hashSet.Contains(pikmin)) { continue; } bool isLeadSinger = true; hashSet.Add(pikmin); foreach (PikminAI item in list) { if (!hashSet.Contains(item) && Vector3.Distance(((Component)pikmin).transform.position, ((Component)item).transform.position) <= SINGING_GROUP_RADIUS) { hashSet.Add(item); item.PlaySingingAudio(isLeadSinger: false); } } LethalMin.Logger.LogInfo((object)$"Pikmin {pikmin.DebugID} is singing as lead singer for its group of {hashSet.Count((PikminAI p) => (Object)(object)p != (Object)(object)pikmin)} other Pikmin. Leader: {pikmin.leader?.Controller.playerUsername}"); pikmin.PlaySingingAudio(isLeadSinger); } } public void ResetSingingState() { _allScrapCollected = false; _singingTriggered = false; if (_singingCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_singingCoroutine); _singingCoroutine = null; } } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkDespawn(); } public void AddPikminAI(PikminAI pikminAI) { if (PikminAIs.Contains(pikminAI)) { LethalMin.Logger.LogWarning((object)("Pikmin AI " + pikminAI.DebugID + " already exists in the PikminManager.")); } else { PikminAIs.Add(pikminAI); } } public void RemovePikminAI(PikminAI pikminAI) { PikminAICounter.Remove(pikminAI); if (!PikminAIs.Contains(pikminAI)) { LethalMin.Logger.LogWarning((object)("Pikmin AI " + pikminAI.DebugID + " does not exist in the PikminManager.")); } else { PikminAIs.Remove(pikminAI); } } public void AddPikminItem(PikminItem pikminItem) { if (PikminItems.Contains(pikminItem)) { LethalMin.Logger.LogWarning((object)("Pikmin Item " + ((Object)pikminItem).name + " already exists in the PikminManager.")); } else { PikminItems.Add(pikminItem); } } public void RemovePikminItem(PikminItem pikminItem) { if (!PikminItems.Contains(pikminItem)) { LethalMin.Logger.LogWarning((object)("Pikmin Item " + ((Object)pikminItem).name + " does not exist in the PikminManager.")); } else { PikminItems.Remove(pikminItem); } } public void AddLeader(Leader leader) { if (Leaders.Contains(leader)) { LethalMin.Logger.LogWarning((object)("Leader " + ((Object)leader).name + " already exists in the PikminManager.")); return; } Leaders.Add(leader); Leaders = (from l in Leaders orderby ((Object)l).name, ((NetworkBehaviour)l).OwnerClientId select l).ToList(); } public void AddOnion(Onion onion) { if (Onions.Contains(onion)) { LethalMin.Logger.LogWarning((object)("Onion " + ((Object)onion).name + " already exists in the PikminManager")); } else { Onions.Add(onion); } } public void RemoveOnion(Onion onion) { if (!Onions.Contains(onion)) { LethalMin.Logger.LogWarning((object)("Onion " + ((Object)onion).name + " Does not exists in the PikminManager")); } else { Onions.Remove(onion); } } [ServerRpc(RequireOwnership = false)] public void OnPlayerJoinnedServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2945104722u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2945104722u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; LethalMin.Logger.LogInfo((object)"Player joined the server, syncing PikminManager data."); SyncAllPikminItemsOnServer(); SyncGameStatsClientRpc(EndOfGameStats, FiredStats); SyncAllGlowmobs(); SyncScannedPikminClientRpc(ScannedPiklopediaIDs.ToArray()); SyncLeaflingPlayers(); shipPhaseOnionContainer.RefreshOnions(); } } } public void SyncLeaflingPlayers() { if (LeaflingPlayers.Count == 0) { return; } Leader[] array = Object.FindObjectsOfType(); foreach (Leader leader in array) { if (!PikChecks.IsPlayerConnected(leader.Controller)) { LethalMin.Logger.LogInfo((object)("Leader " + ((Object)leader).name + " is not connected, skipping sync.")); continue; } foreach (KeyValuePair leaflingPlayer in LeaflingPlayers) { LethalMin.Logger.LogInfo((object)$"Checking Leafling Player: {leaflingPlayer.Key} with Pikmin Type ID: {leaflingPlayer.Value} = {leader.Controller.playerUsername} {((NetworkBehaviour)leader).OwnerClientId}"); if (leader.Controller.playerUsername == leaflingPlayer.Key) { SetLeaderAsLeaflingClientRpc(((NetworkBehaviour)leader).OwnerClientId, leaflingPlayer.Value); LethalMin.Logger.LogInfo((object)$" loaded Leader {leaflingPlayer.Key} as leafling with Pikmin Type ID: {leaflingPlayer.Value}"); } } } } [ClientRpc] public void SetLeaderAsLeaflingClientRpc(ulong ID, int pikminTypeID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3591013923u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ID); BytePacker.WriteValueBitPacked(val2, pikminTypeID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3591013923u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; Leader leaderViaID = LethalMin.GetLeaderViaID(ID); if ((Object)(object)leaderViaID != (Object)null) { if (!leaderViaID.IsLeafling) { leaderViaID.SetAsLeafling(pikminTypeID); LethalMin.Logger.LogInfo((object)$"Set Leader {((Object)leaderViaID).name} as Leafling with Pikmin Type ID: {pikminTypeID}"); } } else { LethalMin.Logger.LogWarning((object)$"Failed to set Leader as Leafling, Leader not found for Client ID: {ID}"); } } public void SyncAllGlowmobs() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) Glowmob[] array = Object.FindObjectsOfType(); foreach (Glowmob glowmob in array) { LethalMin.Logger.LogInfo((object)("Syncing Glowmob to " + glowmob.leaderScript.Controller.playerUsername)); glowmob.SetLeaderClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)glowmob.leaderScript).NetworkObject)); } } public void SyncAllPikminItemsOnServer() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogInfo((object)"Syncing all Pikmin Items to clients"); foreach (PikminItem pikminItem in PikminItems) { if (pikminItem.DontUseInitClientRpc) { LethalMin.Logger.LogInfo((object)("skipping Pikmin Item " + ((Object)pikminItem).name + " to clients")); continue; } LethalMin.Logger.LogInfo((object)("Syncing Pikmin Item " + ((Object)pikminItem).name + " to clients")); pikminItem.InitalizeClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)pikminItem.ItemScript).NetworkObject), ((Object)pikminItem.ItemScript).name); } } [ClientRpc] public void SyncGameStatsClientRpc(PikminEndOfGameStats stats, PikminFiredStats fired) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3996474103u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref stats, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref fired, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3996474103u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsServer) { LethalMin.Logger.LogInfo((object)"Syncing Game Stats to clients"); return; } EndOfGameStats = stats; FiredStats = fired; } } [ClientRpc] public void SyncScannedPikminClientRpc(int[] scannedIDs) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3301298637u, val, (RpcDelivery)0); bool flag = scannedIDs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(scannedIDs, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3301298637u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { LethalMin.Logger.LogInfo((object)"Syncing Scanned Pikmin IDs to clients"); ScannedPiklopediaIDs = scannedIDs.ToList(); } } } public void OnGameStarted() { LethalMin.Logger.LogInfo((object)"__ LethalMin On Game Started __"); LethalMin.Logger.LogInfo((object)"__ LethalMin On Game Started Finished __"); } public void OnGameLoaded() { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogInfo((object)"__ LethalMin On Game Loaded __"); CanPathOnMoonGlobal = PikChecks.IsNavMeshOnMap(); EndOfGameStats.Refresh(); GetMoonSettings(); SpawnTeleportTriggers(); AddWaterTriggers(); AddBridgeTriggers(); ResetSingingState(); if ((bool)LethalMin.DieInPlayerDeathZone) { AddDeathTriggers(); } if (((NetworkBehaviour)this).IsServer) { _wildSpawnFalloffCache = CalculateWildSpawnFalloffValues(); _cachedOverallIndoorFalloff = CalculateOverallFalloff(indoor: true); _cachedOverallOutdoorFalloff = CalculateOverallFalloff(indoor: false); LogWildSpawnFalloff(); SpawnSprouts(); ((MonoBehaviour)this).StartCoroutine(SpawnOnionsAfterDelay()); SpawnMapPikmin(); SpawnLumiknulls(); SpawnExtras(); } if (LethalMin.OnCompany) { GameObject val = new GameObject("ONION_SPAWN_POINT_1"); SceneManager.MoveGameObjectToScene(val, SceneManager.GetSceneByName(RoundManager.Instance.currentLevel.sceneName)); val.transform.position = RoundManager.Instance.GetNavMeshPosition(new Vector3(0f, 0f, 0f), default(NavMeshHit), 5f, -1); if (((NetworkBehaviour)this).IsServer) { GameObject val2 = Object.Instantiate(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/CompanyPikminEnemyScript.prefab")); NetworkObject component = val2.GetComponent(); SceneManager.MoveGameObjectToScene(val2, SceneManager.GetSceneByName(RoundManager.Instance.currentLevel.sceneName)); component.Spawn(false); } } PikminRouteManager.Instance.OnGameLoaded(); LethalMin.Logger.LogInfo((object)$"Can path on moon: {CanPathOnMoonGlobal} {PikChecks.IsNavMeshOnMap()}"); LethalMin.Logger.LogInfo((object)"__ LethalMin On Game Loaded Finished __"); } public void OnGameEnd() { LethalMin.Logger.LogInfo((object)"Game Ended, Deinitializing PikminManager"); foreach (PikminAI pikminAI in PikminAIs) { if (!((EnemyAI)pikminAI).isOutside || pikminAI.IsWildPikmin || pikminAI.IsDeadOrDying) { continue; } LethalMin.Logger.LogInfo((object)("Pikmin " + pikminAI.DebugID + " is outside and not dead/dying, checking if it can leave")); if (!PikChecks.DoesPikminHaveRegisteredOnion(pikminAI)) { pikminAI.SetPikminToLeaving(); pikminAI.IsLeftBehind = true; } else if (IsPikminInSafetyRange(pikminAI)) { Onion onionOfPikmin = Onion.GetOnionOfPikmin(pikminAI); pikminAI.SetPikminToLeaving(onionOfPikmin); if ((Object)(object)onionOfPikmin != (Object)null) { onionOfPikmin.AddPikmin(pikminAI); PikminAICounter.Remove(pikminAI); pikminAI.DontAddToOnion = true; } if ((Object)(object)onionOfPikmin == (Object)null) { pikminAI.SetPikminToLeaving(); pikminAI.IsLeftBehind = true; EndOfGameStats.PikminLeftBehind++; FiredStats.TotalPikminLost++; } } else { pikminAI.SetPikminToLeaving(); pikminAI.IsLeftBehind = true; EndOfGameStats.PikminLeftBehind++; FiredStats.TotalPikminLost++; } } } public void OnGameEnded() { PikminRouteManager.Instance.OnGameEnded(); } public bool IsPikminInSafetyRange(PikminAI pikmin) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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) Onion onionOfPikmin = Onion.GetOnionOfPikmin(pikmin); bool flag = false; return Vector3.Distance(StartOfRound.Instance.elevatorTransform.position, ((Component)pikmin).transform.position) < 30f || ((Object)(object)onionOfPikmin != (Object)null && Vector3.Distance(((Component)onionOfPikmin).transform.position, ((Component)pikmin).transform.position) < 30f); } public void GetMoonSettings() { CurrentMoonSettings = null; MoonSettings[] array = Resources.FindObjectsOfTypeAll(); foreach (MoonSettings moonSettings in array) { if ((Object)(object)moonSettings.Level == (Object)(object)RoundManager.Instance.currentLevel) { CurrentMoonSettings = moonSettings; LethalMin.Logger.LogInfo((object)("Found Moon Settings for " + ((Object)moonSettings).name + " on " + moonSettings.Level.sceneName)); break; } } } public void AddDeathTriggers() { KillLocalPlayer[] array = Object.FindObjectsOfType(true); foreach (KillLocalPlayer val in array) { PikminDamageTrigger pikminDamageTrigger = ((Component)val).gameObject.AddComponent(); pikminDamageTrigger.InstaDeath = !val.justDamage; pikminDamageTrigger.DontKillInShip = val.disallowKillingInShip; } } public void AddWaterTriggers() { FreezeableWaters.Clear(); QuicksandTrigger[] array = Object.FindObjectsOfType(true); foreach (QuicksandTrigger val in array) { if (val.isWater && (Object)(object)((Component)val).gameObject.GetComponent() == (Object)null) { PikminEffectTrigger pikminEffectTrigger = ((Component)val).gameObject.AddComponent(); pikminEffectTrigger.EffectType = PikminEffectType.Paralized; pikminEffectTrigger.HazardType = PikminHazard.Water; pikminEffectTrigger.Mode = PikminEffectMode.Persitant; LethalMin.Logger.LogInfo((object)("Added Pikmin Effect Trigger to: " + ((Object)((Component)val).gameObject).name)); } FreezeableWater freezeableWater = null; if (val.isWater && !((Component)val).gameObject.TryGetComponent(ref freezeableWater)) { freezeableWater = ((Component)val).gameObject.AddComponent(); } if ((Object)(object)freezeableWater != (Object)null) { FreezeableWaters.Add(freezeableWater); } } FreezeableWaters.Sort((FreezeableWater a, FreezeableWater b) => string.Compare(((Object)((Component)a).gameObject).name, ((Object)((Component)b).gameObject).name, StringComparison.Ordinal)); } public void AddBridgeTriggers() { BridgeTrigger[] array = Object.FindObjectsOfType(true); foreach (BridgeTrigger val in array) { if ((Object)(object)((Component)val).GetComponent() == (Object)null) { ((Component)val).gameObject.AddComponent(); } } BridgeTriggerType2[] array2 = Object.FindObjectsOfType(true); foreach (BridgeTriggerType2 val2 in array2) { if ((Object)(object)((Component)val2).GetComponent() == (Object)null) { ((Component)val2).gameObject.AddComponent(); } } } public void SpawnSprouts() { //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) if (LethalMin.OnCompany) { LethalMin.Logger.LogInfo((object)"Cannot Spawn Sprouts on comapyn moon!"); return; } if (!PikChecks.IsNavMeshOnMap()) { LethalMin.Logger.LogWarning((object)"Current map does not have a navmesh, cannot spawn sprouts!"); return; } LethalMin.Logger.LogInfo((object)"-- Spawning Sprouts --"); ((MonoBehaviour)this).StartCoroutine(LoadSproutData()); int num = 100; int maxEnemyPowerCount = StartOfRound.Instance.currentLevel.maxEnemyPowerCount; float num2 = LethalMin.OutdoorSpawnChance.InternalValue; string text = $"Base spawn chance: {num2}"; if ((bool)LethalMin.UsePowerLVForSprouts) { num2 = 0.2f * ((float)maxEnemyPowerCount * 0.25f); LethalMin.Logger.LogDebug((object)$"Moon power level: {maxEnemyPowerCount}, spawn chance: {num2:F2}"); } string text2 = LethalMin.NormalizeMoonName(StartOfRound.Instance.currentLevel.PlanetName); MoonSpawnConfig moonSpawnConfig = null; if (LethalMin.MoonSpawnConfigs.TryGetValue(text2, out MoonSpawnConfig value)) { moonSpawnConfig = value; } else if (LethalMin.GenerateMoonSpawnConfigs != null && LethalMin.GenerateMoonSpawnConfigs.InternalValue) { moonSpawnConfig = LethalMin.GetOrCreateMoonSpawnConfig(text2); } if (moonSpawnConfig != null) { num2 *= moonSpawnConfig.BaseSpawnMultiplier; text += $", after applying moon base multiplier ({moonSpawnConfig.BaseSpawnMultiplier}): {num2:F2}"; if (moonSpawnConfig.MaxPikminSpawns >= 0) { num = Mathf.Min(num, moonSpawnConfig.MaxPikminSpawns); } } string text3 = ((object)(LevelWeatherType)(ref StartOfRound.Instance.currentLevel.currentWeather)).ToString(); WeatherSpawnConfig weatherSpawnConfig = null; if (LethalMin.WeatherSpawnConfigs.ContainsKey(text3)) { weatherSpawnConfig = LethalMin.WeatherSpawnConfigs[text3]; } else if (LethalMin.GenerateWeatherSpawnConfigs != null && LethalMin.GenerateWeatherSpawnConfigs.InternalValue) { weatherSpawnConfig = LethalMin.GetOrCreateWeatherSpawnConfig(text3); } if (weatherSpawnConfig != null) { num2 *= weatherSpawnConfig.BaseSpawnMultiplier; text += $", after applying weather multiplier ({weatherSpawnConfig.BaseSpawnMultiplier}): {num2:F2}"; } LethalMin.Logger.LogInfo((object)$"{text}, Map Pikmin Spawn Chance: {num2}"); Random random = new Random(StartOfRound.Instance.randomMapSeed); Dictionary pikminSpawningOddsOnCurrentMoon = GetPikminSpawningOddsOnCurrentMoon(PikminOddsPositions.Sprouts); GameObject[] array = GameObject.FindGameObjectsWithTag("AINode"); GameObject[] array2 = GameObject.FindGameObjectsWithTag("OutsideAINode"); LethalMin.Logger.LogDebug((object)("Sprouts Odds: " + string.Join(", ", pikminSpawningOddsOnCurrentMoon.Select((KeyValuePair kvp) => $"{kvp.Key.PikminName}: {kvp.Value}")))); int num3 = 0; RaycastHit val5 = default(RaycastHit); for (int i = 0; i < num; i++) { if (Random.value > num2) { continue; } if (pikminSpawningOddsOnCurrentMoon.Count == 0) { LethalMin.Logger.LogWarning((object)"No pikmin types available to spawn for sprouts, skipping spawn."); break; } Vector3 val = default(Vector3); Quaternion val2 = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f); PikminType pikminType = null; float num4 = pikminSpawningOddsOnCurrentMoon.Values.Sum(); float num5 = Random.Range(0f, num4); float num6 = 0f; foreach (KeyValuePair item in pikminSpawningOddsOnCurrentMoon) { num6 += item.Value; if (num5 <= num6) { pikminType = item.Key; break; } } if ((Object)(object)pikminType == (Object)null) { LethalMin.Logger.LogWarning((object)$"No random type found for {i}, using alterntive random"); try { pikminType = pikminSpawningOddsOnCurrentMoon.Keys.ToList()[random.Next(0, pikminSpawningOddsOnCurrentMoon.Keys.ToList().Count)]; } catch (Exception arg) { LethalMin.Logger.LogError((object)$"Failed to get random type for {i}: {arg}"); continue; } } if (pikminType.SpawnsIndoors) { val = array[random.Next(0, array.Length)].transform.position; } if (pikminType.SpawnsOutdoors) { val = RoundManager.Instance.GetRandomNavMeshPositionInRadius(array2[random.Next(0, array2.Length)].transform.position, 50f, default(NavMeshHit)); } GameObject val3 = Object.Instantiate(LethalMin.SproutPrefab, val, val2); Sprout component = val3.GetComponent(); component.pikminType = pikminType; LayerMask val4 = LayerMask.op_Implicit(StartOfRound.Instance.collidersAndRoomMaskAndDefault); if (Physics.Raycast(val, Vector3.down, ref val5, 50f, LayerMask.op_Implicit(val4), (QueryTriggerInteraction)1)) { val = ((RaycastHit)(ref val5)).point; LethalMin.Logger.LogDebug((object)($"Spawning sprout {num3} iteration({i}) at: [{val}, {((Quaternion)(ref val2)).eulerAngles}]" + $" With type: {component.pikminType.PikminName} odds:({pikminSpawningOddsOnCurrentMoon[component.pikminType]}) rng: ({num5} / {num4})")); ((NetworkBehaviour)component).NetworkObject.Spawn(false); component.InitalizeClientRpc(val, val2, component.pikminType.PikminTypeID); num3++; } else { LethalMin.Logger.LogWarning((object)"No ground detected."); Object.Destroy((Object)(object)val3); } } LethalMin.Logger.LogInfo((object)$"-- Spawned {num3} sprouts on the map. --"); } public void SpawnMapPikmin() { //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Unknown result type (might be due to invalid IL or missing references) //IL_066e: Unknown result type (might be due to invalid IL or missing references) //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_07d5: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_0825: Unknown result type (might be due to invalid IL or missing references) //IL_082f: Unknown result type (might be due to invalid IL or missing references) if (IsTooManyPikminOnMap) { LethalMin.Logger.LogInfo((object)"Max Pikmin count reached, cannot spawn map pikmin!"); return; } if (LethalMin.OnCompany) { LethalMin.Logger.LogInfo((object)"Cannot Spawn map pikmin on company moon!"); return; } if (!PikChecks.IsNavMeshOnMap()) { LethalMin.Logger.LogWarning((object)"Current map does not have a navmesh, cannot spawn map pikmin!"); return; } LethalMin.Logger.LogInfo((object)"-- Spawning Map Pikmin --"); int num = GameObject.FindGameObjectsWithTag("AINode").Length - Object.FindObjectsOfType().Length; LethalMin.Logger.LogInfo((object)$"Map Possible Spawn Amount: {num}"); string text = LethalMin.NormalizeMoonName(StartOfRound.Instance.currentLevel.PlanetName); MoonSpawnConfig moonSpawnConfig = null; if (LethalMin.MoonSpawnConfigs.TryGetValue(text, out MoonSpawnConfig value)) { moonSpawnConfig = value; } else if (LethalMin.GenerateMoonSpawnConfigs != null && LethalMin.GenerateMoonSpawnConfigs.InternalValue) { moonSpawnConfig = LethalMin.GetOrCreateMoonSpawnConfig(text); } float num2 = LethalMin.IndoorSpawnChance.InternalValue; string text2 = $"Base spawn chance: {num2}"; if (moonSpawnConfig != null) { num2 *= moonSpawnConfig.BaseSpawnMultiplier; text2 += $", Moon spawn multiplier: {moonSpawnConfig.BaseSpawnMultiplier}"; if (moonSpawnConfig.MaxPikminSpawns >= 0) { num = Mathf.Min(num, moonSpawnConfig.MaxPikminSpawns); } } string text3 = ((object)(LevelWeatherType)(ref StartOfRound.Instance.currentLevel.currentWeather)).ToString(); WeatherSpawnConfig weatherSpawnConfig = null; if (LethalMin.WeatherSpawnConfigs.ContainsKey(text3)) { weatherSpawnConfig = LethalMin.WeatherSpawnConfigs[text3]; } else if (LethalMin.GenerateWeatherSpawnConfigs != null && LethalMin.GenerateWeatherSpawnConfigs.InternalValue) { weatherSpawnConfig = LethalMin.GetOrCreateWeatherSpawnConfig(text3); } if (weatherSpawnConfig != null) { num2 *= weatherSpawnConfig.BaseSpawnMultiplier; text2 += $", Weather '{text3}' spawn multiplier: {weatherSpawnConfig.BaseSpawnMultiplier}"; } LethalMin.Logger.LogInfo((object)$"{text2}, Map Pikmin Spawn Chance: {num2}"); Random random = new Random(StartOfRound.Instance.randomMapSeed); Dictionary pikminSpawningOddsOnCurrentMoon = GetPikminSpawningOddsOnCurrentMoon(PikminOddsPositions.NoSprouts); GameObject[] array = GameObject.FindGameObjectsWithTag("AINode"); GameObject[] array2 = GameObject.FindGameObjectsWithTag("OutsideAINode"); float num3 = 1f; float num4 = 1f; if (LethalMin.EnableTypeSpawnFalloff.InternalValue && LethalMin.ScaleTypeSpawnAmountBySuppressedTypes.InternalValue) { float num5 = CalculateZoneSpawnFalloffRatio(indoor: false); float num6 = CalculateZoneSpawnFalloffRatio(indoor: true); float num7 = Mathf.Clamp01(LethalMin.OutdoorSpawnAmountScaleAtMaxSuppressed.InternalValue); float num8 = Mathf.Clamp01(LethalMin.IndoorSpawnAmountScaleAtMaxSuppressed.InternalValue); num3 = Mathf.Lerp(1f, num7, num5); num4 = Mathf.Lerp(1f, num8, num6); LethalMin.Logger.LogInfo((object)($"Spawn volume scaling by zone falloff: outdoor={num3:F3} (falloff={num5:F3}), " + $"indoor={num4:F3} (falloff={num6:F3})")); } LethalMin.Logger.LogInfo((object)("Map Pikmin Odds: " + string.Join(", ", pikminSpawningOddsOnCurrentMoon.Select((KeyValuePair kvp) => $"{kvp.Key.PikminName}: {kvp.Value}")))); int num9 = 0; for (int i = 0; i < num; i++) { if (Random.value > num2) { continue; } if (pikminSpawningOddsOnCurrentMoon.Count == 0) { LethalMin.Logger.LogWarning((object)"No pikmin types available to spawn for sprouts, skipping spawn."); break; } Vector3 val = default(Vector3); Quaternion val2 = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f); PikminType pikminType = null; float num10 = pikminSpawningOddsOnCurrentMoon.Values.Sum(); float num11 = Random.Range(0f, num10); float num12 = 0f; foreach (KeyValuePair item in pikminSpawningOddsOnCurrentMoon) { num12 += item.Value; if (num11 <= num12) { pikminType = item.Key; break; } } if ((Object)(object)pikminType == (Object)null) { LethalMin.Logger.LogWarning((object)$"No random type found for {i}, using alterntive random"); try { pikminType = pikminSpawningOddsOnCurrentMoon.Keys.ToList()[random.Next(0, pikminSpawningOddsOnCurrentMoon.Keys.ToList().Count)]; } catch (Exception arg) { LethalMin.Logger.LogError((object)$"Failed to get random type for {i}: {arg}"); continue; } } bool flag = false; if (pikminType.SpawnsIndoors && pikminType.SpawnsOutdoors) { if (Random.value < 0.5f) { val = array[random.Next(0, array.Length)].transform.position; flag = true; } else { val = array2[random.Next(0, array2.Length)].transform.position; } } else if (pikminType.SpawnsIndoors) { val = array[random.Next(0, array.Length)].transform.position; flag = true; } else if (pikminType.SpawnsOutdoors) { val = array2[random.Next(0, array2.Length)].transform.position; } float num13 = (flag ? num4 : num3); if (Random.value > num13) { continue; } val = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(val, flag ? 8f : 35f, default(NavMeshHit), new Random(StartOfRound.Instance.randomMapSeed), -1, 1f); int num14 = 0; bool flag2 = IsPositionInWater(val); while (IsPositionInWater(val) && num14 < 25) { Vector3 val3 = (flag ? array[random.Next(0, array.Length)].transform.position : array2[random.Next(0, array2.Length)].transform.position); val = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(val3, flag ? 8f : 35f, default(NavMeshHit), new Random(StartOfRound.Instance.randomMapSeed + num14 + 1), -1, 1f); num14++; } if (IsPositionInWater(val)) { LethalMin.Logger.LogWarning((object)$"Could not find a non-water spawn point for Map Pikmin {i}, skipping."); continue; } if (flag2) { LethalMin.Logger.LogInfo((object)$"Spawn point for Map Pikmin {i} was in water, but found a new valid position after {num14} retries."); } PikminSpawnProps props = new PikminSpawnProps(); props.IsOutside = pikminType.SpawnsOutdoors; props.AddToSpawnCountForWild = true; int num15 = 1; if (LethalMin.EnableTypeSpawnFalloff.InternalValue && pikminType.CanGroupSpawnWhenFalloffHigh && pikminType.MaxGroupSpawnSize > 1) { float num16 = (flag ? _cachedOverallIndoorFalloff : _cachedOverallOutdoorFalloff); float internalValue = LethalMin.NoOnionGroupSpawnThreshold.InternalValue; if (num16 >= internalValue) { float num17 = Mathf.Clamp01((num16 - internalValue) / Mathf.Max(0.001f, 1f - internalValue)); num15 = Mathf.Max(1, Mathf.RoundToInt(Mathf.Lerp(1f, (float)pikminType.MaxGroupSpawnSize, num17))); } } for (int j = 0; j < num15; j++) { SpawnPikminOnServer(pikminType, val, val2, props); } LethalMin.Logger.LogDebug((object)($"Spawning Pikmin ({num9}) iteration({i}) (x{num15}) at: [{val}, {val2}]" + $" With type: {pikminType.PikminName} odds:({pikminSpawningOddsOnCurrentMoon[pikminType]}) rng: ({num11} / {num10})")); num9 += num15; } LethalMin.Logger.LogInfo((object)$"-- Finished spawning map pikmin, total spawned: {num9} --"); } public void SpawnTeleportTriggers() { //IL_002f: 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_0057: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_015e: 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) if (RoundManager.Instance.currentLevel.sceneName == "Level7Offense") { SpawnTeleportTrigger(new Vector3(-6.9494f, 18.3041f, -134.7692f), new Vector3(10f, 10f, 10f), new Vector3(7.9994f, 0.4394f, -136.0314f), 1); } if (RoundManager.Instance.currentLevel.sceneName == "Level2Assurance") { SpawnTeleportTrigger(new Vector3(105f, 17.6f, -67f), new Vector3(3.2909f, 8.1763f, 28.3619f), new Vector3(99.9956f, 2.2635f, -57.4636f), 1, new Vector3(0f, 35f, 0f)); } if (RoundManager.Instance.currentLevel.sceneName == "Level4March") { } if (RoundManager.Instance.currentLevel.sceneName == "Level11Embrion") { GameObject val = SpawnTeleportTrigger(new Vector3(-190.1637f, 10.6708f, -16.6201f), new Vector3(4.0527f, 10.9381f, 18.4337f), new Vector3(-181.8325f, 0.5593f, -15.6719f), 0); val.transform.rotation = Quaternion.Euler(0f, 40f, 0f); } static GameObject SpawnTeleportTrigger(Vector3 TPostion, Vector3 Scale, Vector3 DestPos, int ID, Vector3? Rotation = null) { //IL_0010: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) Scene sceneByName = SceneManager.GetSceneByName(RoundManager.Instance.currentLevel.sceneName); GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)val2).name = "Pikmin Teleport Trigger"; val2.transform.position = TPostion; val2.transform.localScale = Scale; if (Rotation.HasValue) { val2.transform.rotation = Quaternion.Euler(Rotation.Value); } val2.AddComponent(); val2.GetComponent().enabled = true; val2.GetComponent().isTrigger = true; SceneManager.MoveGameObjectToScene(val2, sceneByName); GameObject val3 = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val3).name = "Pikmin Teleport Destination"; val3.transform.position = DestPos; val2.GetComponent().Destination = val3.transform; SceneManager.MoveGameObjectToScene(val3, sceneByName); PikminRouteManager.Instance.AddedTelepointsForExits.Add(ID, val3.transform); Object.Destroy((Object)(object)val2.GetComponent()); Object.Destroy((Object)(object)val3.GetComponent()); Object.Destroy((Object)(object)val3.GetComponent()); return val2; } } public void SpawnExtras() { } [ServerRpc(RequireOwnership = false)] public void ConvertEnemyToGrabbableObjectServerRpc(NetworkObjectReference enemyRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: 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(3917132973u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemyRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3917132973u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (!((NetworkObjectReference)(ref enemyRef)).TryGet(ref val3, (NetworkManager)null)) { LethalMin.Logger.LogWarning((object)"Failed to get enemy object from reference"); return; } EnemyAI val4 = default(EnemyAI); if (!((Component)val3).TryGetComponent(ref val4)) { LethalMin.Logger.LogWarning((object)"Failed to get EnemyAI component from object"); return; } LethalMin.Logger.LogInfo((object)("Adding Physic Prop to enemy body " + ((Object)((Component)val4).gameObject).name)); GameObject val5 = Object.Instantiate(LethalMin.EnemyItemNode, ((Component)val4).transform.position, ((Component)val4).transform.rotation); ((Object)val5).name = "EnemyItemNode_" + val4.enemyType.enemyName; NetworkObject component = val5.GetComponent(); component.Spawn(false); SyncEnemyToGrabbableObjectConversionClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)val4).NetworkObject), NetworkObjectReference.op_Implicit(component)); } } [ClientRpc] public void SyncEnemyToGrabbableObjectConversionClientRpc(NetworkObjectReference enemyRef, NetworkObjectReference itemNode) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Expected O, but got Unknown //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1145705668u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemyRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref itemNode, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1145705668u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (!((NetworkObjectReference)(ref enemyRef)).TryGet(ref val3, (NetworkManager)null)) { LethalMin.Logger.LogWarning((object)"Failed to get enemy object from reference"); return; } EnemyAI val4 = default(EnemyAI); if (!((Component)val3).TryGetComponent(ref val4)) { LethalMin.Logger.LogWarning((object)"Failed to get EnemyAI component from object"); return; } NetworkObject val5 = default(NetworkObject); if (!((NetworkObjectReference)(ref itemNode)).TryGet(ref val5, (NetworkManager)null)) { LethalMin.Logger.LogWarning((object)"Failed to get item object from reference"); return; } GrabbableObject val6 = default(GrabbableObject); if (!((Component)val5).TryGetComponent(ref val6)) { LethalMin.Logger.LogWarning((object)"Failed to get GrabbableObject component from object"); return; } PikminItemSettings component = ((Component)val6).GetComponent(); Item val7 = null; if (!EnemyItems.ContainsKey(val4.enemyType)) { val7 = (Item)ScriptableObject.CreateInstance(typeof(Item)); ((Object)val7).name = "(LethalMin_EnemyItem)" + val4.enemyType.enemyName; EnemyItems.Add(val4.enemyType, val7); } else { val7 = EnemyItems[val4.enemyType]; } if ((Object)(object)val7 == (Object)null) { LethalMin.Logger.LogError((object)("Failed to create Item instance for enemy conversion Enemy: " + ((Object)((Component)val4).gameObject).name)); return; } LethalMin.Logger.LogInfo((object)("Creating item node on enemy body " + ((Object)((Component)val4).gameObject).name)); val4.moveTowardsDestination = false; val4.movingTowardsTargetPlayer = false; val4.updatePositionThreshold = 9000f; val4.syncMovementSpeed = 0f; val4.inSpecialAnimation = true; Item obj = val7; Quaternion rotation = ((Component)val4).transform.rotation; obj.restingRotation = ((Quaternion)(ref rotation)).eulerAngles; val7.itemName = val4.enemyType.enemyName; if (val4.enemyType.canDie && (float)EnemyAIPatch.EnemyHPs[val4.enemyType] > 0f) { if ((float)EnemyAIPatch.EnemyHPs[val4.enemyType] <= 1f) { val7.weight = 0f; } else { val7.weight = (float)EnemyAIPatch.EnemyHPs[val4.enemyType] * 0.4f; } } else { val7.weight = Mathf.Clamp((float)((double)val4.enemyType.PowerLevel * 0.6), 1f, 5f); } val6.itemProperties = val7; ((Object)((Component)val6).gameObject).name = "EnemyItem_" + val4.enemyType.enemyName; Dictionary dictionary = new Dictionary { { "Water Wraith", 100 }, { "Baboon hawk", 12 }, { "Maneater", 20 }, { "Centipede", 5 }, { "Clay Surgeon", 24 }, { "Crawler", 20 }, { "Manticoil", 2 }, { "Tulip Snake", 3 }, { "Flowerman", 20 }, { "ForestGiant", 50 }, { "GiantKiwi", 83 }, { "Hoarding bug", 7 }, { "Masked", 4 }, { "MouthDog", 30 }, { "Nutcracker", 27 }, { "RadMech", 250 }, { "Bunker Spider", 21 }, { "Earth Leviathan", 1000 }, { "Bush Wolf", 37 }, { "Feiopar", 40 } }; component.CanProduceSprouts = true; component.OverrideGrabPostionColider = ((Component)val4).GetComponentInChildren(); component.OverrideGrabbableToEnemeis = true; component.ExtraRenderers = ((Component)val4).GetComponentsInChildren().ToList(); component.CarryStrength = (dictionary.ContainsKey(val4.enemyType.enemyName) ? dictionary[val4.enemyType.enemyName] : PikUtils.CalculatePikminItemWeight(val7)); component.SproutsToSpawn = component.CarryStrength; PikminItem componentInChildren = ((Component)val6).GetComponentInChildren(); (componentInChildren.EnemyGrabbableObject = ((Component)val4).gameObject.AddComponent()).grabbableObject = val6; componentInChildren.Initalize(); ConvertedAIs.Add(val4); } [ServerRpc(RequireOwnership = false)] public void ApplyKnockbackServalPikminServerRpc(NetworkObjectReference[] Pikrefs, Vector3 direction, float force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2124005398u, val, (RpcDelivery)0); bool flag = Pikrefs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikrefs, default(ForNetworkSerializable)); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2124005398u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ApplyKnockbackServalPikminClientRpc(Pikrefs, direction, force); } } [ClientRpc] public void ApplyKnockbackServalPikminClientRpc(NetworkObjectReference[] Pikrefs, Vector3 direction, float force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3832496342u, val, (RpcDelivery)0); bool flag = Pikrefs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(Pikrefs, default(ForNetworkSerializable)); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3832496342u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); PikminAI pikminAI = default(PikminAI); for (int i = 0; i < Pikrefs.Length; i++) { NetworkObjectReference val3 = Pikrefs[i]; if (!((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null)) { LethalMin.Logger.LogWarning((object)"Failed to get pikmin object from reference when applying knockback sevral"); break; } if (!((Component)val4).TryGetComponent(ref pikminAI)) { LethalMin.Logger.LogWarning((object)"Failed to get PikminAI component from object when applying knockback sevral"); break; } pikminAI.ApplyKnockBack(direction, force); } } [ServerRpc] public void FreezeWaterAtIndexServerRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3548144878u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3548144878u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; FreezeWaterAtIndexClientRpc(index); } } [ClientRpc] public void FreezeWaterAtIndexClientRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4190370950u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4190370950u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; FreezeWaterAtIndex(index); } } } public void FreezeWaterAtIndex(int index) { FreezeableWater freezeableWater = FreezeableWaters[index]; freezeableWater.FreezeWater(); LethalMin.Logger.LogInfo((object)$"Freezing water at index {index} ({((Object)((Component)freezeableWater).gameObject).name})"); } [ServerRpc] public void UnfreezeWaterAtIndexServerRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4263540606u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4263540606u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UnfreezeWaterAtIndexClientRpc(index); } } [ClientRpc] public void UnfreezeWaterAtIndexClientRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3530085895u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3530085895u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UnfreezeWaterAtIndex(index); } } } public void UnfreezeWaterAtIndex(int index) { FreezeableWater freezeableWater = FreezeableWaters[index]; freezeableWater.UnfreezeWater(); LethalMin.Logger.LogInfo((object)$"Freezing water at index {index} ({((Object)((Component)freezeableWater).gameObject).name})"); } public void SpawnLumiknulls() { //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) if (StartOfRound.Instance.gameStats.daysSpent <= (int)LethalMin.SpawnLumiknullAfterDays || !LethalMin.RegisteredPikminTypes.ContainsValue(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/Types/Glow Pikmin/Lumknul/Lumiknull.prefab").GetComponent().GlowPikminType)) { return; } if (LethalMin.OnCompany) { LethalMin.Logger.LogInfo((object)"Cannot Lumiknull on company moon!"); return; } if (!PikChecks.IsNavMeshOnMap()) { LethalMin.Logger.LogWarning((object)"Current map does not have a navmesh, cannot spawn lumiknulls!"); return; } SelectableLevel currentLevel = StartOfRound.Instance.currentLevel; float num = LethalMin.LumiknullSpawnChance.InternalValue; if (((object)(LevelWeatherType)(ref currentLevel.currentWeather)).ToString().Equals("Eclipsed", StringComparison.OrdinalIgnoreCase) && num != 0f) { num *= 2.5f; LethalMin.Logger.LogInfo((object)$"Eclipsed weather detected, increasing lumiknull spawn chance to {num}"); } if (Random.value > num) { return; } GameObject val = LethalMin.assetBundle.LoadAsset("Assets/LethalMin/Types/Glow Pikmin/Lumknul/Lumiknull.prefab"); List entrancePositions = new List(); entrancePositions.Add(RoundManager.FindMainEntrancePosition(false, true)); EntranceTeleport[] array = Object.FindObjectsOfType(); foreach (EntranceTeleport val2 in array) { entrancePositions.Add(((Component)val2).transform.position); } List list = GameObject.FindGameObjectsWithTag("OutsideAINode").ToList(); list.RemoveAll((GameObject sp) => Vector3.Distance(sp.transform.position, StartOfRound.Instance.shipLandingPosition.position) < 35f); list.RemoveAll(delegate(GameObject sp) { GameObject sp2 = sp; return entrancePositions.Any((Vector3 ep) => Vector3.Distance(sp2.transform.position, ep) < 25f); }); if (list.Count == 0) { LethalMin.Logger.LogWarning((object)"No valid outdoor spawn points found for lumiknulls, relaxing constraints..."); list = GameObject.FindGameObjectsWithTag("OutsideAINode").ToList(); list.RemoveAll((GameObject sp) => Vector3.Distance(sp.transform.position, StartOfRound.Instance.shipLandingPosition.position) < 20f); list.RemoveAll((GameObject sp) => Vector3.Distance(sp.transform.position, RoundManager.FindMainEntrancePosition(false, true)) < 15f); if (list.Count == 0) { LethalMin.Logger.LogWarning((object)"Still no valid outdoor spawn points for lumiknulls, using any node!"); list = GameObject.FindGameObjectsWithTag("OutsideAINode").ToList(); } } Vector3 position = list[Random.Range(0, list.Count)].transform.position; NavMeshHit val3 = default(NavMeshHit); if (NavMesh.SamplePosition(position, ref val3, 5f, -1)) { position = ((NavMeshHit)(ref val3)).position; } position = RoundManager.Instance.GetRandomNavMeshPositionInRadius(position, 20f, default(NavMeshHit)); GameObject val4 = Object.Instantiate(val, position, Quaternion.identity); Lumiknull component = val4.GetComponent(); ((NetworkBehaviour)component).NetworkObject.Spawn(false); LethalMin.Logger.LogInfo((object)$"Spawning Lumiknull at: {val4.transform.position}"); } public void AttemptScanNewType(int TypeID) { if (!ScannedPiklopediaIDs.Contains(TypeID)) { ScanNewPikminTypeServerRpc(TypeID); } } [ServerRpc(RequireOwnership = false)] public void ScanNewPikminTypeServerRpc(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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2583255835u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, typeID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2583255835u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!ScannedPiklopediaIDs.Contains(typeID)) { HUDManager.Instance.DisplayGlobalNotification("New pikmin data sent to piklopedia!"); ScannedPiklopediaIDs.Add(typeID); NewlyScannedPiklopediaIDs.Add(typeID); ScanNewPikminTypeClientRpc(typeID); } } } [ClientRpc] public void ScanNewPikminTypeClientRpc(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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2745695640u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, typeID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2745695640u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer && !ScannedPiklopediaIDs.Contains(typeID)) { ScannedPiklopediaIDs.Add(typeID); NewlyScannedPiklopediaIDs.Add(typeID); HUDManager.Instance.DisplayGlobalNotification("New pikmin data sent to piklopedia!"); } } } public void SpawnPikmin(PikminType pikminType, int Quantity = -1, Vector3 spawnPosition = default(Vector3), Quaternion spawnRotation = default(Quaternion)) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (!PikChecks.IsNavMeshOnMap()) { LethalMin.Logger.LogWarning((object)"Current map does not have a navmesh, cannot spawn pikmin!"); } else if (((NetworkBehaviour)this).IsServer) { if (Quantity > 0) { SpawnPikminOnServer(pikminType, Quantity, spawnPosition, spawnRotation); } else { SpawnPikminOnServer(pikminType, spawnPosition, spawnRotation); } } else { SpawnPikminServerRpc(pikminType.PikminTypeID, Quantity, spawnPosition, spawnRotation); } } [ServerRpc(RequireOwnership = false)] public void SpawnPikminServerRpc(int PikminID, int quantity, Vector3 SpawnPos, Quaternion SpawnRot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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(2929605241u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, PikminID); BytePacker.WriteValueBitPacked(val2, quantity); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref SpawnPos); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref SpawnRot); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2929605241u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PikminType pikminTypeByID = LethalMin.GetPikminTypeByID(PikminID); if ((Object)(object)pikminTypeByID != (Object)null) { if (quantity > 0) { SpawnPikminOnServer(pikminTypeByID, quantity, SpawnPos, SpawnRot); } else { SpawnPikminOnServer(pikminTypeByID, SpawnPos, SpawnRot); } } else { LethalMin.Logger.LogError((object)$"Failed to get pikmin via ID {PikminID}"); } } public PikminAI SpawnPikminOnServer(PikminType Ptype, Vector3 SpawnPos, Quaternion SpawnRot, PikminSpawnProps props = default(PikminSpawnProps), Onion OnionSpawningFrom = null) { //IL_004d: 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_0138: Unknown result type (might be due to invalid IL or missing references) if (!PikChecks.IsNavMeshOnMap()) { LethalMin.Logger.LogWarning((object)"Current map does not have a navmesh, cannot spawn pikmin!"); return null; } LethalMin.Logger.LogMessage((object)("Spawning: " + Ptype.PikminName)); EnemyType pikminEnemyType = LethalMin.PikminEnemyType; PikminAI component = Object.Instantiate(pikminEnemyType.enemyPrefab, SpawnPos, SpawnRot).GetComponent(); PikminTypeResolver component2 = ((Component)component).GetComponent(); if (!props.Equals(default(PikminSpawnProps)) && (Object)(object)LethalMin.GetLeaderViaID(props.PlayerID) != (Object)null) { ((NetworkBehaviour)component).NetworkObject.SpawnWithOwnership(props.PlayerID, false); } else { ((NetworkBehaviour)component).NetworkObject.Spawn(false); } if ((Object)(object)OnionSpawningFrom == (Object)null) { if (props.Equals(default(PikminSpawnProps))) { component2.SyncSpawnClientRpc(Ptype.PikminTypeID); } else { component2.SyncSpawnClientRpc(Ptype.PikminTypeID, props); } } else { component2.SyncSpawnFromOnionClientRpc(Ptype.PikminTypeID, Random.Range(0, OnionSpawningFrom.ClimbLinks.Count), NetworkObjectReference.op_Implicit(((NetworkBehaviour)OnionSpawningFrom).NetworkObject), props); } return ((Component)this).gameObject.GetComponentInChildren(); } public PikminAI[] SpawnPikminOnServer(PikminType Ptype, int Quant, Vector3 SpawnPos, Quaternion SpawnRot) { //IL_005c: 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) if (!PikChecks.IsNavMeshOnMap()) { LethalMin.Logger.LogWarning((object)"Current map does not have a navmesh, cannot spawn pikmin!"); return null; } LethalMin.Logger.LogMessage((object)$"Spawning {Quant}: {Ptype.PikminName}"); EnemyType pikminEnemyType = LethalMin.PikminEnemyType; PikminAI[] array = new PikminAI[Quant]; for (int i = 0; i < Quant; i++) { PikminAI component = Object.Instantiate(pikminEnemyType.enemyPrefab, SpawnPos, SpawnRot).GetComponent(); ((NetworkBehaviour)component).NetworkObject.Spawn(true); array[i] = component; } return array; } [IteratorStateMachine(typeof(d__151))] private IEnumerator SpawnPikminIntervalled(PikminType Ptype, int Quant, Vector3 SpawnPos, Quaternion SpawnRot, float interval = 0.1f) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__151(0) { <>4__this = this, Ptype = Ptype, Quant = Quant, SpawnPos = SpawnPos, SpawnRot = SpawnRot, interval = interval }; } public Dictionary CalculateWildSpawnFalloffValues() { Dictionary dictionary = new Dictionary(); if (!LethalMin.EnableTypeSpawnFalloff.InternalValue) { foreach (PikminType value3 in LethalMin.RegisteredPikminTypes.Values) { dictionary[value3] = 0f; } return dictionary; } float num = Mathf.Max(1, LethalMin.TypeSpawnFalloffMaxCount.InternalValue); float internalValue = LethalMin.TypeSpawnFalloffExponent.InternalValue; Dictionary dictionary2 = new Dictionary(); if (SaveManager.KeyExists("onionPikmin")) { Dictionary> dictionary3 = SaveManager.Load>>("onionPikmin"); foreach (List value4 in dictionary3.Values) { foreach (PikminData item in value4) { if (!dictionary2.ContainsKey(item.TypeID)) { dictionary2[item.TypeID] = 0; } dictionary2[item.TypeID]++; } } } foreach (PikminType value5 in LethalMin.RegisteredPikminTypes.Values) { if ((Object)(object)value5.TargetOnion == (Object)null) { dictionary[value5] = 0f; continue; } dictionary2.TryGetValue(value5.PikminTypeID, out var value); float num2 = (float)value / num; float value2 = Mathf.Clamp01(Mathf.Pow(num2, internalValue)); dictionary[value5] = value2; } return dictionary; } private float CalculateOverallFalloff(bool indoor) { List list = (from kvp in _wildSpawnFalloffCache where (Object)(object)kvp.Key.TargetOnion != (Object)null && (indoor ? kvp.Key.SpawnsIndoors : kvp.Key.SpawnsOutdoors) select kvp.Value).ToList(); return (list.Count == 0) ? 0f : list.Average(); } private float CalculateZoneSpawnFalloffRatio(bool indoor) { return Mathf.Clamp01(CalculateOverallFalloff(indoor)); } private void LogWildSpawnFalloff() { if (!LethalMin.EnableTypeSpawnFalloff.InternalValue) { LethalMin.Logger.LogInfo((object)"Wild Spawn Falloff is disabled."); return; } LethalMin.Logger.LogInfo((object)"=== Wild Spawn Falloff Values ==="); foreach (KeyValuePair item in _wildSpawnFalloffCache) { string arg = (((Object)(object)item.Key.TargetOnion == (Object)null) ? " (no onion)" : ""); LethalMin.Logger.LogInfo((object)$" {item.Key.PikminName}{arg}: {item.Value:F3}"); } LethalMin.Logger.LogInfo((object)$" [Overall Indoor Falloff: {_cachedOverallIndoorFalloff:F3}]"); LethalMin.Logger.LogInfo((object)$" [Overall Outdoor Falloff: {_cachedOverallOutdoorFalloff:F3}]"); LethalMin.Logger.LogInfo((object)"================================="); } public Dictionary GetPikminSpawningOddsOnCurrentMoon(PikminOddsPositions props = PikminOddsPositions.Any) { Dictionary dictionary = new Dictionary(); SelectableLevel currentLevel = StartOfRound.Instance.currentLevel; string text = LethalMin.NormalizeMoonName(currentLevel.PlanetName); MoonSpawnConfig moonSpawnConfig = null; if (LethalMin.MoonSpawnConfigs.ContainsKey(text)) { moonSpawnConfig = LethalMin.MoonSpawnConfigs[text]; } else if (LethalMin.GenerateMoonSpawnConfigs != null && LethalMin.GenerateMoonSpawnConfigs.InternalValue) { moonSpawnConfig = LethalMin.GetOrCreateMoonSpawnConfig(text); } Dictionary dictionary2 = moonSpawnConfig?.GetTypeMultipliers(); bool flag = moonSpawnConfig?.OverrideTypeSettings ?? false; WeatherSpawnConfig weatherSpawnConfig = null; string text2 = ((object)(LevelWeatherType)(ref currentLevel.currentWeather)).ToString(); if (LethalMin.WeatherSpawnConfigs.ContainsKey(text2)) { weatherSpawnConfig = LethalMin.WeatherSpawnConfigs[text2]; } else if (LethalMin.GenerateWeatherSpawnConfigs != null && LethalMin.GenerateWeatherSpawnConfigs.InternalValue) { weatherSpawnConfig = LethalMin.GetOrCreateWeatherSpawnConfig(text2); } Dictionary dictionary3 = weatherSpawnConfig?.GetTypeMultipliers(); bool flag2 = weatherSpawnConfig?.OverrideTypeSettings ?? false; LethalMin.Logger.LogInfo((object)("=== Pikmin Spawning Odds [" + text + "] (" + text2 + ") ===")); foreach (PikminType value4 in LethalMin.RegisteredPikminTypes.Values) { switch (props) { case PikminOddsPositions.Indoors: if (!value4.SpawnsIndoors) { continue; } break; case PikminOddsPositions.Outdoors: if (!value4.SpawnsOutdoors) { continue; } break; case PikminOddsPositions.Sprouts: if ((!value4.SpawnsIndoors && !value4.SpawnsOutdoors) || !value4.SpawnsAsSprout) { continue; } break; case PikminOddsPositions.NoSprouts: if ((!value4.SpawnsIndoors && !value4.SpawnsOutdoors) || value4.SpawnsAsSprout) { continue; } break; } if (StartOfRound.Instance.gameStats.daysSpent <= value4.SpawnAfterDay || (moonSpawnConfig != null && moonSpawnConfig.IsTypeBlocked(value4.PikminName))) { continue; } float num = 0.5f; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(" [" + value4.PikminName + "]: base=0.500"); Dictionary dictionary4 = PikminType.ParseMultiplierList(value4.MoonSpawnMultipliers); foreach (KeyValuePair item in dictionary4) { if (item.Key.Equals(text, StringComparison.OrdinalIgnoreCase)) { num *= item.Value; stringBuilder.Append($" * moonType({item.Key})={item.Value:F3}"); } } if (LethalMin.IsDependencyLoaded("imabatby.lethallevelloader")) { Dictionary dictionary5 = PikminType.ParseMultiplierList(value4.TagSpawnMultipliers); foreach (KeyValuePair item2 in dictionary5) { if (LLLIsOnMoonTag(item2.Key)) { num *= item2.Value; stringBuilder.Append($" * tag({item2.Key})={item2.Value:F3}"); } } } if (!flag2) { Dictionary dictionary6 = PikminType.ParseMultiplierList(value4.WeatherSpawnMultipliers); foreach (KeyValuePair item3 in dictionary6) { if (text2.Equals(item3.Key, StringComparison.OrdinalIgnoreCase)) { num *= item3.Value; stringBuilder.Append($" * weatherType({item3.Key})={item3.Value:F3}"); } } } if (moonSpawnConfig != null) { num *= moonSpawnConfig.BaseSpawnMultiplier; stringBuilder.Append($" * moonBase={moonSpawnConfig.BaseSpawnMultiplier:F3}"); if (dictionary2 != null && dictionary2.TryGetValue(value4.PikminName, out var value)) { if (flag) { num = 0.5f * moonSpawnConfig.BaseSpawnMultiplier * value; stringBuilder.Append($" [OVERRIDE moonTypeCfg={value:F3}]"); } else { num *= value; stringBuilder.Append($" * moonTypeCfg={value:F3}"); } } } if (weatherSpawnConfig != null) { num *= weatherSpawnConfig.BaseSpawnMultiplier; stringBuilder.Append($" * weatherBase={weatherSpawnConfig.BaseSpawnMultiplier:F3}"); if (dictionary3 != null && dictionary3.TryGetValue(value4.PikminName, out var value2)) { num *= value2; stringBuilder.Append($" * weatherTypeCfg={value2:F3}"); } } if (LethalMin.EnableTypeSpawnFalloff.InternalValue && _wildSpawnFalloffCache.TryGetValue(value4, out var value3)) { float num2 = Mathf.Clamp01(LethalMin.SuppressedTypeFalloffThreshold.InternalValue); if (value3 >= num2) { stringBuilder.Append($" * falloff=SUPPRESSED({value3:F3}>={num2:F3}) = 0.000"); LethalMin.Logger.LogInfo((object)stringBuilder.ToString()); continue; } num *= 1f - value3; stringBuilder.Append($" * falloff={1f - value3:F3}"); } stringBuilder.Append($" = {num:F3}"); LethalMin.Logger.LogInfo((object)stringBuilder.ToString()); if (!(num <= 0f)) { dictionary.Add(value4, num); } } LethalMin.Logger.LogInfo((object)"================================="); return dictionary; } public bool LLLIsOnMoonTag(string tag) { foreach (ContentTag contentTag in ((ExtendedContent)LevelManager.CurrentExtendedLevel).ContentTags) { if (contentTag.contentTagName.ToLower().Contains(tag.ToLower())) { return true; } } return false; } public void DespawnPikmin(PikminAI pikmin) { if (((NetworkBehaviour)this).IsServer) { if ((Object)(object)pikmin == (Object)null) { LethalMin.Logger.LogWarning((object)"Tried to despawn a null pikmin reference"); } else { ((NetworkBehaviour)pikmin).NetworkObject.Despawn(true); } } } private bool IsPositionInWater(Vector3 pos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(pos, 0.5f); Collider[] array2 = array; foreach (Collider val in array2) { QuicksandTrigger component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null && (component.isWater || component.isInsideWater)) { return true; } } return false; } public void SpawnOnionItems() { //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) OnionsCollected = SaveManager.Load("collectedOnions", OnionsCollected); GameObject onionItemPrefab = LethalMin.OnionItemPrefab; LethalMin.Logger.LogInfo((object)"Spawing Onion items"); foreach (OnionType value in LethalMin.RegisteredOnionTypes.Values) { if ((!value.SpawnsIndoors && !value.SpawnsOutdoors) || OnionsCollected.Contains(value.OnionTypeID) || (float)StartOfRound.Instance.currentLevel.maxEnemyPowerCount < value.PreferedPowerLevel || Random.value > LethalMin.OnionSpawnChance.InternalValue * value.SpawnChanceMultiplier || StartOfRound.Instance.gameStats.daysSpent <= value.SpawnAfterDay) { continue; } RandomScrapSpawn[] array = Object.FindObjectsOfType(); if (array == null || array.Length == 0) { break; } List list = new List(); foreach (RandomScrapSpawn val in array) { if (!val.spawnUsed) { list.Add(val); } } LethalMin.Logger.LogDebug((object)$"Spawning Onion {value.TypeName} with ID {value.OnionTypeID} at: {((Component)list[0]).transform.position}. Onions Collected: {PikUtils.ParseListToString(OnionsCollected)}"); RandomScrapSpawn val2 = list[Random.Range(0, list.Count)]; OnionItem component = Object.Instantiate(onionItemPrefab, ((Component)val2).transform.position, ((Component)val2).transform.rotation).GetComponent(); val2.spawnUsed = true; ((NetworkBehaviour)component).NetworkObject.Spawn(false); component.DontChooseRandomType = true; component.InitalizeTypeClientRpc(value.OnionTypeID); } } [IteratorStateMachine(typeof(d__161))] private IEnumerator SpawnOnionsAfterDelay() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__161(0) { <>4__this = this }; } public void SpawnOnions() { if (!PikChecks.IsNavMeshOnMap()) { LethalMin.Logger.LogWarning((object)"Current map does not have a navmesh, cannot spawn onions!"); return; } OnionsCollected = SaveManager.Load("collectedOnions", OnionsCollected); int num = 0; List list = new List(); LethalMin.Logger.LogInfo((object)"Spawing Onion"); if (SaveManager.KeyExists("onionFusion")) { Dictionary> dictionary = SaveManager.Load>>("onionFusion"); foreach (string key in dictionary.Keys) { list.AddRange(dictionary[key]); SpawnOnionOnServer(dictionary[key]); num++; } } foreach (int item in OnionsCollected) { if (!list.Contains(item)) { OnionType onionTypeByID = LethalMin.GetOnionTypeByID(item); if ((Object)(object)onionTypeByID == (Object)null) { LethalMin.Logger.LogError((object)$"Null ID: {item}"); continue; } SpawnOnionOnServer(item); num++; } } if (num != 0) { ((MonoBehaviour)this).StartCoroutine(WaitForAllOnionsToInitalize(num)); } } [IteratorStateMachine(typeof(d__163))] public IEnumerator WaitForAllOnionsToInitalize(int AmmountToWaitFor) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__163(0) { <>4__this = this, AmmountToWaitFor = AmmountToWaitFor }; } private Vector3 FindOpenSpaceForOnions(Transform ShipTransform) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ShipTransform.position; GameObject[] array = GameObject.FindGameObjectsWithTag("OutsideAINode"); if (array == null || array.Length == 0) { LethalMin.Logger.LogWarning((object)"No OutsideAINodes found, falling back to default spawn logic"); return position + Vector3.forward * 20f; } List list = FilterOnionNodes(array, position); GameObject val = null; float num = float.MaxValue; foreach (GameObject item in list) { float num2 = Vector3.Distance(position, item.transform.position); if (item.transform.position.z < position.z && (bool)LethalMin.AvoidBehindShipForOnionSpawning) { num2 *= 2f; } if (num2 < num) { num = num2; val = item; } } Vector3 position2 = val.transform.position; NavMeshHit val2 = default(NavMeshHit); if (NavMesh.SamplePosition(position2, ref val2, 15f, -1)) { return ((NavMeshHit)(ref val2)).position; } return position2; } private List FilterOnionNodes(GameObject[] outsideNodes, Vector3 shipPos) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) bool flag = ((object)(LevelWeatherType)(ref StartOfRound.Instance.currentLevel.currentWeather)).ToString().Equals("Flooded", StringComparison.OrdinalIgnoreCase); bool flag2 = LethalMin.AvoidWaterForOnionSpawning.InternalValue && !flag; List list = new List(); foreach (GameObject val in outsideNodes) { if (!flag2 || !IsPositionInWater(val.transform.position)) { list.Add(val); } } if (list.Count == 0) { LethalMin.Logger.LogWarning((object)"No valid onion spawn nodes after filtering, unfiltering nodes."); list.AddRange(outsideNodes); } return list; } private List FindSpecificOnionSpawnPoints() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 1; i < LethalMin.RegisteredOnionTypes.Count; i++) { GameObject val = GameObject.Find($"ONION_SPAWN_POINT_{i}"); if ((Object)(object)val != (Object)null) { list.Add(val.transform.position); } } return list; } private Vector3 GetBetaOnionSpawnPosition(int onionIndex) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) Vector3 shipPos = ShipPosition.position; GameObject[] array = GameObject.FindGameObjectsWithTag("OutsideAINode"); if (array == null || array.Length == 0) { LethalMin.Logger.LogWarning((object)"Beta onion spawn: no OutsideAINodes found, falling back to offset."); return shipPos + Vector3.forward * (20f + (float)onionIndex * 8f); } List list = FilterOnionNodes(array, shipPos); list.Sort((GameObject a, GameObject b) => Vector3.Distance(a.transform.position, shipPos).CompareTo(Vector3.Distance(b.transform.position, shipPos))); int num = Mathf.Clamp(onionIndex, 0, list.Count - 1); Vector3 position = list[num].transform.position; NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(position, ref val, 15f, -1)) { position = ((NavMeshHit)(ref val)).position; } LethalMin.Logger.LogInfo((object)$"Beta onion spawn: onion index {onionIndex} → node index {num} at {position}"); return position; } public void SpawnOnionOnServer(int OnionID) { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_0063: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) List list = FindSpecificOnionSpawnPoints(); int num = Object.FindObjectsOfType().Length; Vector3 val; if (!PikUtils.IsOutOfRange(list, num)) { val = list[num]; LethalMin.Logger.LogInfo((object)$"Custom Pos: {val}, ID: {OnionID}"); } else if (LethalMin.UseBetaOnionSpawnSystem.InternalValue) { val = GetBetaOnionSpawnPosition(num); } else { Vector3 val2 = FindOpenSpaceForOnions(ShipPosition); float num2 = 360f / (float)(LethalMin.OnionTypes.Count + 1) * (float)(OnionID + 1); float num3 = 5f; val = val2 + Quaternion.Euler(0f, num2, 0f) * (Vector3.forward * num3); LethalMin.Logger.LogInfo((object)$"Pos: {val}, Angle: {num2}, ID: {OnionID}"); NavMeshHit val3 = default(NavMeshHit); if (NavMesh.SamplePosition(val, ref val3, 50f, -1)) { val = ((NavMeshHit)(ref val3)).position; } } Quaternion identity = Quaternion.identity; GameObject val4 = Object.Instantiate(LethalMin.OnionPrefab, val, identity); ((NetworkBehaviour)val4.GetComponent()).NetworkObject.Spawn(false); val4.GetComponent().DontChooseRandomType = true; val4.GetComponent().InitalizeTypeClientRpc(OnionID); } public void SpawnOnionOnServer(List OnionIDs) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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) List list = FindSpecificOnionSpawnPoints(); int num = ((Component)this).GetComponents().Length; Vector3 val; if (!PikUtils.IsOutOfRange(list, num)) { val = list[num]; LethalMin.Logger.LogInfo((object)$"Custom Pos: {val}, IDs: {PikUtils.ParseListToString(OnionIDs)}"); } else if (LethalMin.UseBetaOnionSpawnSystem.InternalValue) { val = GetBetaOnionSpawnPosition(num); } else { Vector3 val2 = FindOpenSpaceForOnions(ShipPosition); float num2 = 360f / (float)(LethalMin.OnionTypes.Count + 1) * (float)(OnionIDs[0] + 1); float num3 = 5f; val = val2 + Quaternion.Euler(0f, num2, 0f) * (Vector3.forward * num3); LethalMin.Logger.LogInfo((object)$"Pos: {val}, Angle: {num2}, IDs: {PikUtils.ParseListToString(OnionIDs)}"); NavMeshHit val3 = default(NavMeshHit); if (NavMesh.SamplePosition(val, ref val3, 50f, -1)) { val = ((NavMeshHit)(ref val3)).position; } } Quaternion identity = Quaternion.identity; GameObject val4 = Object.Instantiate(LethalMin.OnionPrefab, val, identity); ((NetworkBehaviour)val4.GetComponent()).NetworkObject.Spawn(false); val4.GetComponent().DontChooseRandomType = true; val4.GetComponent().InitalizeTypeClientRpc(OnionIDs.ToArray()); } [ServerRpc] public void RemoveShipPhaseOnionsServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(420950372u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 420950372u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RemoveShipPhaseOnionsClientRpc(); } } [ClientRpc] public void RemoveShipPhaseOnionsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2321289145u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2321289145u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; LethalMin.Logger.LogInfo((object)"Removing ship phase onions"); foreach (ShipPhaseOnionContainer.ShipPhaseOnion shipPhaseOnion in shipPhaseOnionContainer.shipPhaseOnions) { Object.Destroy((Object)(object)shipPhaseOnion.Instance); } shipPhaseOnionContainer.shipPhaseOnions.Clear(); } [ServerRpc] public void SpawnShipPhaseOnionServerRpc(int OnionID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1823152035u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, OnionID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1823152035u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SpawnShipPhaseOnionClientRpc(OnionID); } } [ClientRpc] public void SpawnShipPhaseOnionClientRpc(int OnionID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(71696338u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, OnionID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 71696338u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; OnionType onionTypeByID = LethalMin.GetOnionTypeByID(OnionID); if ((Object)(object)onionTypeByID == (Object)null) { LethalMin.Logger.LogError((object)$"Null ID: {OnionID}"); return; } GameObject val3 = null; val3 = ((!((Object)(object)onionTypeByID.OnionOverrideModelPrefab == (Object)null)) ? Object.Instantiate(onionTypeByID.OnionOverrideModelPrefab, ((Component)shipPhaseOnionContainer).transform) : Object.Instantiate(LethalMin.DefultOnionMesh, ((Component)shipPhaseOnionContainer).transform)); ShipPhaseOnionContainer.ShipPhaseOnion item = new ShipPhaseOnionContainer.ShipPhaseOnion(onionTypeByID, val3); shipPhaseOnionContainer.shipPhaseOnions.Add(item); shipPhaseOnionContainer.SwitchGeneration(PikUtils.ConvertCfgGenerationToPikminGeneration(LethalMin.OnionModelGeneration.InternalValue)); } } [ServerRpc] public void SpawnShipPhaseOnionServerRpc(int[] OnionID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Invalid comparison between Unknown and I4 //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1251378289u, val, (RpcDelivery)0); bool flag = OnionID != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(OnionID, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1251378289u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SpawnShipPhaseOnionClientRpc(OnionID); } } [ClientRpc] public void SpawnShipPhaseOnionClientRpc(int[] OnionID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3112031328u, val, (RpcDelivery)0); bool flag = OnionID != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(OnionID, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3112031328u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; List list = new List(); foreach (int num in OnionID) { OnionType onionTypeByID = LethalMin.GetOnionTypeByID(num); if ((Object)(object)onionTypeByID == (Object)null) { LethalMin.Logger.LogError((object)$"Null ID: {num}"); } else { list.Add(onionTypeByID); } } if (list.Count == 0) { LethalMin.Logger.LogError((object)"No valid onions to spawn"); return; } GameObject val3 = null; val3 = Object.Instantiate(LethalMin.DefultOnionMesh, ((Component)shipPhaseOnionContainer).transform); ShipPhaseOnionContainer.ShipPhaseOnion item = new ShipPhaseOnionContainer.ShipPhaseOnion(list, val3); shipPhaseOnionContainer.shipPhaseOnions.Add(item); shipPhaseOnionContainer.SwitchGeneration(PikUtils.ConvertCfgGenerationToPikminGeneration(LethalMin.OnionModelGeneration.InternalValue)); } public List FuseOnions(OnionFuseRules rules, List onionIDs) { if (!LethalMin.AllowOnionFusing) { return new List(); } List list = new List(); OnionType[] onionsToFuse = rules.OnionsToFuse; foreach (OnionType onionType in onionsToFuse) { if (onionIDs.Contains(onionType.OnionTypeID)) { list.Add(onionType.OnionTypeID); } } if (list.Count == 0 || list.Count == 1) { list.Clear(); } LethalMin.Logger.LogInfo((object)("Created Fusion: '" + ((Object)rules).name + "' " + PikUtils.ParseListToString(list) + " from: " + PikUtils.ParseListToString(onionIDs))); return list; } public void LoadInitalData() { if (((NetworkBehaviour)this).IsServer) { LethalMin.Logger.LogDebug((object)"---Loading LethalMin Data---"); LethalMin.Logger.LogDebug((object)("SavePath: " + SaveManager.settings.path)); if (SaveManager.KeyExists("pikminLeft")) { EndOfGameStats.PikminLeft = SaveManager.Load("pikminLeft", EndOfGameStats.PikminLeft); LethalMin.Logger.LogDebug((object)$"Loaded {EndOfGameStats.PikminLeft} pikmin left from save file"); } if (SaveManager.KeyExists("firedStats")) { FiredStats = SaveManager.Load("firedStats", FiredStats); LethalMin.Logger.LogDebug((object)$"Loaded {FiredStats} fired stats from save file"); } if (SaveManager.KeyExists("collectedOnions")) { OnionsCollected = SaveManager.Load("collectedOnions", OnionsCollected); LethalMin.Logger.LogDebug((object)("Loaded (" + PikUtils.ParseListToString(OnionsCollected) + ") onions from save file")); } if (SaveManager.KeyExists("scannedTypes")) { ScannedPiklopediaIDs = SaveManager.Load("scannedTypes", ScannedPiklopediaIDs); LethalMin.Logger.LogDebug((object)("Loaded (" + PikUtils.ParseListToString(ScannedPiklopediaIDs) + ") scanned types from save file")); } if (SaveManager.KeyExists("LeaflingPlayers")) { LeaflingPlayers = SaveManager.Load("LeaflingPlayers", LeaflingPlayers); LethalMin.Logger.LogDebug((object)$"Loaded {LeaflingPlayers.Count} leafling players from save file"); } LethalMin.Logger.LogDebug((object)"---Finished Loading LethalMin Data---"); } } public void SaveData() { if (!((NetworkBehaviour)this).IsServer) { return; } LethalMin.Logger.LogMessage((object)"---Saving LethalMin Data---"); LethalMin.Logger.LogDebug((object)("SavePath: " + SaveManager.settings.path)); IsSaving = true; SaveManager.Save("pikminLeft", EndOfGameStats.PikminLeft); SaveManager.Save("collectedOnions", OnionsCollected); SaveManager.Save("firedStats", FiredStats); SaveManager.Save("scannedTypes", ScannedPiklopediaIDs); List list = null; if (SaveManager.KeyExists("persistentSprouts")) { list = SaveManager.Load>("persistentSprouts"); LethalMin.Logger.LogInfo((object)$"Loaded {list.Count} persistent sprouts from save file"); } else { list = new List(); LethalMin.Logger.LogInfo((object)"No persistent sprouts found in save file created new data"); } List list2 = new List(list); int num = 0; for (int i = 0; i < list2.Count; i++) { SproutData item = list2[i]; LethalMin.Logger.LogInfo((object)$"data moon: {item.MoonSpawnedOn}, current moon: {StartOfRound.Instance.currentLevelID}"); if (item.MoonSpawnedOn == StartOfRound.Instance.currentLevelID) { list.Remove(item); num++; } } LethalMin.Logger.LogInfo((object)$"Removed {num} persistent sprouts from load due to them already being spawned on the current moon"); Sprout[] array = Object.FindObjectsOfType(); foreach (Sprout sprout in array) { if (sprout.IsPersistant) { list.Add(new SproutData(sprout)); } } if (list.Count > 0) { SaveManager.Save("persistentSprouts", list); LethalMin.Logger.LogInfo((object)$"Saved {list.Count} persistent sprouts"); } else { SaveManager.Save("persistentSprouts", list); LethalMin.Logger.LogInfo((object)"No persistent sprouts to save"); } LeaflingPlayers = null; if (SaveManager.KeyExists("LeaflingPlayers")) { LeaflingPlayers = SaveManager.Load>("LeaflingPlayers"); LethalMin.Logger.LogInfo((object)$"Loaded {LeaflingPlayers.Count} leafling players from save file"); } else { LeaflingPlayers = new Dictionary(); } Leader[] array2 = Object.FindObjectsOfType(); foreach (Leader leader in array2) { if (PikChecks.IsPlayerConnected(leader.Controller)) { if (leader.IsLeafling) { LeaflingPlayers[leader.Controller.playerUsername] = (((Object)(object)leader.LeaflingType == (Object)null) ? (-1) : leader.LeaflingType.PikminTypeID); } else if (LeaflingPlayers.ContainsKey(leader.Controller.playerUsername)) { LeaflingPlayers.Remove(leader.Controller.playerUsername); } } } SaveManager.Save("LeaflingPlayers", LeaflingPlayers); if (LeaflingPlayers.Count > 0) { LethalMin.Logger.LogInfo((object)$"Saved {LeaflingPlayers.Count} leafling players"); } Dictionary> dictionary = null; if (SaveManager.KeyExists("onionPikmin")) { dictionary = SaveManager.Load>>("onionPikmin"); LethalMin.Logger.LogInfo((object)$"Loaded {dictionary.Count} onions from save file"); } else { dictionary = new Dictionary>(); LethalMin.Logger.LogInfo((object)"No onions found in save file created new data"); } Onion[] array3 = Object.FindObjectsOfType(); foreach (Onion onion in array3) { if (onion.fusedTypes.Count == 0) { LethalMin.Logger.LogInfo((object)$"Saving {onion.onionType.TypeName} type ({onion.onionType.OnionTypeID})"); string key = $"onion_{onion.onionType.OnionTypeID}"; List list3 = new List(); list3.AddRange(onion.PikminInOnion); if (list3.Count > 0) { dictionary[key] = list3; } continue; } LethalMin.Logger.LogInfo((object)$"Saving {onion.fusedTypes.Count} fused types for {onion.onionType.TypeName}"); foreach (OnionType fusedType in onion.fusedTypes) { LethalMin.Logger.LogInfo((object)$"Saving {fusedType.TypeName} fused type ({fusedType.OnionTypeID})"); string key2 = $"onion_{fusedType.OnionTypeID}"; List list4 = new List(); foreach (PikminData item2 in onion.PikminInOnion) { if (item2.LastOnionID == fusedType.OnionTypeID) { list4.Add(item2); } } if (list4.Count > 0) { dictionary[key2] = list4; } } } if (dictionary.Count > 0) { SaveManager.Save("onionPikmin", dictionary); LethalMin.Logger.LogInfo((object)$"Saved pikmin data for {dictionary.Count} onions"); } else { LethalMin.Logger.LogInfo((object)"No onion pikmin data to save"); } Dictionary> dictionary2 = null; if (SaveManager.KeyExists("onionFusion")) { dictionary2 = SaveManager.Load>>("onionFusion"); LethalMin.Logger.LogInfo((object)$"Loaded {dictionary2.Count} fusions from save file"); } else { dictionary2 = new Dictionary>(); LethalMin.Logger.LogInfo((object)"No fusions found in save file created new data"); } foreach (OnionFuseRules value in LethalMin.RegisteredFuseRules.Values) { string key3 = $"fusion_{value.FuseRulesTypeID}"; List list5 = FuseOnions(value, OnionsCollected); if (list5.Count > 0) { dictionary2[key3] = list5; } } if (dictionary2.Count > 0) { SaveManager.Save("onionFusion", dictionary2); LethalMin.Logger.LogInfo((object)$"Saved pikmin data for {dictionary2.Count} fusions"); } else { LethalMin.Logger.LogInfo((object)"No onion fusion data to save"); } IsSaving = false; LethalMin.Logger.LogMessage((object)"---Finished Saving LethalMin Data---"); } [IteratorStateMachine(typeof(d__181))] public IEnumerator LoadSproutData() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__181(0) { <>4__this = this }; } public void LoadOnionData() { if (!((NetworkBehaviour)this).IsServer || !SaveManager.KeyExists("onionPikmin")) { return; } Dictionary> dictionary = SaveManager.Load>>("onionPikmin"); int num = 0; foreach (Onion onion in Onions) { if (onion.fusedTypes.Count == 0) { string key = $"onion_{onion.onionType.OnionTypeID}"; if (dictionary.ContainsKey(key)) { onion.SetPikminClientRpc(new PikminData[0]); List list = dictionary[key]; for (int i = 0; i < list.Count; i += 50) { int count = Mathf.Min(50, list.Count - i); PikminData[] dats = list.GetRange(i, count).ToArray(); onion.AddPikminClientRpc(dats); num++; } LethalMin.Logger.LogInfo((object)$"Restored {dictionary[key].Count} pikmin to onion {onion.onionType.OnionTypeID} in {num} batches"); num = 0; } continue; } onion.SetPikminClientRpc(new PikminData[0]); foreach (OnionType fusedType in onion.fusedTypes) { string key2 = $"onion_{fusedType.OnionTypeID}"; if (dictionary.ContainsKey(key2)) { List list2 = dictionary[key2]; for (int j = 0; j < list2.Count; j += 50) { int count2 = Mathf.Min(50, list2.Count - j); PikminData[] dats2 = list2.GetRange(j, count2).ToArray(); onion.AddPikminClientRpc(dats2); num++; } LethalMin.Logger.LogInfo((object)$"Restored {dictionary[key2].Count} pikmin to onion {onion.onionType.OnionTypeID} in {num} batches"); num = 0; } } } } public void ClearSavedData() { if (((NetworkBehaviour)this).IsServer) { if ((bool)LethalMin.DontPurgeAfterFire) { LethalMin.Logger.LogInfo((object)"Skipping clearing saved Pikmin data due to DontPurgeAfterFire being enabled"); return; } SaveManager.DeleteFile(); ClearLocalDataClientRpc(); LethalMin.Logger.LogInfo((object)"Cleared all saved Pikmin data"); } } [ClientRpc] public void ClearLocalDataClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(437144134u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 437144134u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; Onions.Clear(); OnionsCollected.Clear(); LeaflingPlayers.Clear(); ScannedPiklopediaIDs.Clear(); NewlyScannedPiklopediaIDs.Clear(); FiredStats = default(PikminFiredStats); EndOfGameStats = new PikminEndOfGameStats(); try { Leader[] array = Object.FindObjectsOfType(); foreach (Leader leader in array) { leader.wasLeaflingBeforeDeath = false; leader.IsLeafling = false; } } catch (Exception ex) { LethalMin.Logger.LogError((object)("Error while clearing leader leafling status: " + ex.Message)); } } [IteratorStateMachine(typeof(d__185))] public IEnumerator WaitToDespawnObjects() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__185(0) { <>4__this = this }; } public void CleanUpExcessPikmin() { if (!IsTooManyPikminOnMap) { return; } int num = PikminAIs.Count - LethalMin.MaxPikmin.InternalValue; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; LethalMin.Logger.LogInfo((object)$"Cleaning up {num} excess pikmin ({PikminAIs.Count} total) on map..."); List list = (from p in PikminAIs orderby !p.IsWildPikmin, ((EnemyAI)p).currentBehaviourStateIndex != 0, ((EnemyAI)p).currentBehaviourStateIndex != 1, ((EnemyAI)p).currentBehaviourStateIndex != 2 select p).ToList(); foreach (PikminAI item in list) { if (!IsTooManyPikminOnMap) { break; } Onion onionOfPikmin = Onion.GetOnionOfPikmin(item); if ((Object)(object)onionOfPikmin != (Object)null) { onionOfPikmin.AddPikminClientRpc(item.GetPikminData()); } if (item.IsWildPikmin) { num2++; } else if (((EnemyAI)item).currentBehaviourStateIndex == 0) { num3++; } else if (((EnemyAI)item).currentBehaviourStateIndex == 1) { num5++; } else if (((EnemyAI)item).currentBehaviourStateIndex == 2) { num4++; } DespawnPikmin(item); } LethalMin.Logger.LogInfo((object)$"Finished cleaning up excess pikmin. Current count: {PikminAIs.Count}"); LethalMin.Logger.LogInfo((object)($"Wild Removed: {num2}\n Idle Removed: {num3}\n" + $"Following Removed: {num5}\n Working Removed: {num4}")); } public void DespawnSprouts() { if (((NetworkBehaviour)this).IsServer) { Sprout[] array = Object.FindObjectsOfType(); foreach (Sprout sprout in array) { ((NetworkBehaviour)sprout).NetworkObject.Despawn(true); } } } public void DespawnOnions() { if (((NetworkBehaviour)this).IsServer) { Onion[] array = Object.FindObjectsOfType(); foreach (Onion onion in array) { if (!onion.DontDespawnOnGameEnd) { ((NetworkBehaviour)onion).NetworkObject.Despawn(true); } } } Onions.RemoveWhere((Onion oni) => (Object)(object)oni == (Object)null || (Object)(object)((NetworkBehaviour)oni).NetworkObject == (Object)null || !((NetworkBehaviour)oni).NetworkObject.IsSpawned); } public void DespawnLumiknulls() { if (((NetworkBehaviour)this).IsServer) { Lumiknull[] array = Object.FindObjectsOfType(); foreach (Lumiknull lumiknull in array) { ((NetworkBehaviour)lumiknull).NetworkObject.Despawn(true); } } } public void DespawnExtras() { } protected override void __initializeVariables() { if (Cheat_WhistleMakesNoiseAtNoticeZone == null) { throw new Exception("PikminManager.Cheat_WhistleMakesNoiseAtNoticeZone cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_WhistleMakesNoiseAtNoticeZone).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_WhistleMakesNoiseAtNoticeZone, "Cheat_WhistleMakesNoiseAtNoticeZone"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_WhistleMakesNoiseAtNoticeZone); if (Cheat_DontMakeAudibleNoises == null) { throw new Exception("PikminManager.Cheat_DontMakeAudibleNoises cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_DontMakeAudibleNoises).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_DontMakeAudibleNoises, "Cheat_DontMakeAudibleNoises"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_DontMakeAudibleNoises); if (Cheat_PikminSingalCooldown == null) { throw new Exception("PikminManager.Cheat_PikminSingalCooldown cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_PikminSingalCooldown).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_PikminSingalCooldown, "Cheat_PikminSingalCooldown"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_PikminSingalCooldown); if (Cheat_UselessBluesMode == null) { throw new Exception("PikminManager.Cheat_UselessBluesMode cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_UselessBluesMode).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_UselessBluesMode, "Cheat_UselessBluesMode"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_UselessBluesMode); if (Cheat_InvinceablePikmin == null) { throw new Exception("PikminManager.Cheat_InvinceablePikmin cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_InvinceablePikmin).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_InvinceablePikmin, "Cheat_InvinceablePikmin"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_InvinceablePikmin); if (Cheat_NoKnockback == null) { throw new Exception("PikminManager.Cheat_NoKnockback cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_NoKnockback).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_NoKnockback, "Cheat_NoKnockback"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_NoKnockback); if (Cheat_MaxWhistleZoneRadius == null) { throw new Exception("PikminManager.Cheat_MaxWhistleZoneRadius cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_MaxWhistleZoneRadius).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_MaxWhistleZoneRadius, "Cheat_MaxWhistleZoneRadius"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_MaxWhistleZoneRadius); if (Cheat_MaxWhistleZoneDistance == null) { throw new Exception("PikminManager.Cheat_MaxWhistleZoneDistance cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_MaxWhistleZoneDistance).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_MaxWhistleZoneDistance, "Cheat_MaxWhistleZoneDistance"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_MaxWhistleZoneDistance); if (Cheat_PlayerNoticeZoneSize == null) { throw new Exception("PikminManager.Cheat_PlayerNoticeZoneSize cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_PlayerNoticeZoneSize).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_PlayerNoticeZoneSize, "Cheat_PlayerNoticeZoneSize"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_PlayerNoticeZoneSize); if (Cheat_PikminDamageMultipler == null) { throw new Exception("PikminManager.Cheat_PikminDamageMultipler cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_PikminDamageMultipler).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_PikminDamageMultipler, "Cheat_PikminDamageMultipler"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_PikminDamageMultipler); if (Cheat_PikminSpeedMultipler == null) { throw new Exception("PikminManager.Cheat_PikminSpeedMultipler cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_PikminSpeedMultipler).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_PikminSpeedMultipler, "Cheat_PikminSpeedMultipler"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_PikminSpeedMultipler); if (Cheat_ChargeCoolDown == null) { throw new Exception("PikminManager.Cheat_ChargeCoolDown cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_ChargeCoolDown).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_ChargeCoolDown, "Cheat_ChargeCoolDown"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_ChargeCoolDown); if (Cheat_ChargeDistance == null) { throw new Exception("PikminManager.Cheat_ChargeDistance cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)Cheat_ChargeDistance).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)Cheat_ChargeDistance, "Cheat_ChargeDistance"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)Cheat_ChargeDistance); ((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 //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Expected O, but got Unknown //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3621159874u, new RpcReceiveHandler(__rpc_handler_3621159874), "TriggerSingingClientRpc"); ((NetworkBehaviour)this).__registerRpc(2945104722u, new RpcReceiveHandler(__rpc_handler_2945104722), "OnPlayerJoinnedServerRpc"); ((NetworkBehaviour)this).__registerRpc(3591013923u, new RpcReceiveHandler(__rpc_handler_3591013923), "SetLeaderAsLeaflingClientRpc"); ((NetworkBehaviour)this).__registerRpc(3996474103u, new RpcReceiveHandler(__rpc_handler_3996474103), "SyncGameStatsClientRpc"); ((NetworkBehaviour)this).__registerRpc(3301298637u, new RpcReceiveHandler(__rpc_handler_3301298637), "SyncScannedPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(3917132973u, new RpcReceiveHandler(__rpc_handler_3917132973), "ConvertEnemyToGrabbableObjectServerRpc"); ((NetworkBehaviour)this).__registerRpc(1145705668u, new RpcReceiveHandler(__rpc_handler_1145705668), "SyncEnemyToGrabbableObjectConversionClientRpc"); ((NetworkBehaviour)this).__registerRpc(2124005398u, new RpcReceiveHandler(__rpc_handler_2124005398), "ApplyKnockbackServalPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(3832496342u, new RpcReceiveHandler(__rpc_handler_3832496342), "ApplyKnockbackServalPikminClientRpc"); ((NetworkBehaviour)this).__registerRpc(3548144878u, new RpcReceiveHandler(__rpc_handler_3548144878), "FreezeWaterAtIndexServerRpc"); ((NetworkBehaviour)this).__registerRpc(4190370950u, new RpcReceiveHandler(__rpc_handler_4190370950), "FreezeWaterAtIndexClientRpc"); ((NetworkBehaviour)this).__registerRpc(4263540606u, new RpcReceiveHandler(__rpc_handler_4263540606), "UnfreezeWaterAtIndexServerRpc"); ((NetworkBehaviour)this).__registerRpc(3530085895u, new RpcReceiveHandler(__rpc_handler_3530085895), "UnfreezeWaterAtIndexClientRpc"); ((NetworkBehaviour)this).__registerRpc(2583255835u, new RpcReceiveHandler(__rpc_handler_2583255835), "ScanNewPikminTypeServerRpc"); ((NetworkBehaviour)this).__registerRpc(2745695640u, new RpcReceiveHandler(__rpc_handler_2745695640), "ScanNewPikminTypeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2929605241u, new RpcReceiveHandler(__rpc_handler_2929605241), "SpawnPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(420950372u, new RpcReceiveHandler(__rpc_handler_420950372), "RemoveShipPhaseOnionsServerRpc"); ((NetworkBehaviour)this).__registerRpc(2321289145u, new RpcReceiveHandler(__rpc_handler_2321289145), "RemoveShipPhaseOnionsClientRpc"); ((NetworkBehaviour)this).__registerRpc(1823152035u, new RpcReceiveHandler(__rpc_handler_1823152035), "SpawnShipPhaseOnionServerRpc"); ((NetworkBehaviour)this).__registerRpc(71696338u, new RpcReceiveHandler(__rpc_handler_71696338), "SpawnShipPhaseOnionClientRpc"); ((NetworkBehaviour)this).__registerRpc(1251378289u, new RpcReceiveHandler(__rpc_handler_1251378289), "SpawnShipPhaseOnionServerRpc"); ((NetworkBehaviour)this).__registerRpc(3112031328u, new RpcReceiveHandler(__rpc_handler_3112031328), "SpawnShipPhaseOnionClientRpc"); ((NetworkBehaviour)this).__registerRpc(437144134u, new RpcReceiveHandler(__rpc_handler_437144134), "ClearLocalDataClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3621159874(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int singCount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref singCount); float initialDelay = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref initialDelay, default(ForPrimitives)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); float[] intervals = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref intervals, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).TriggerSingingClientRpc(singCount, initialDelay, intervals); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2945104722(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; ((PikminManager)(object)target).OnPlayerJoinnedServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3591013923(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_0043: 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) { ulong iD = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref iD); int pikminTypeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref pikminTypeID); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).SetLeaderAsLeaflingClientRpc(iD, pikminTypeID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3996474103(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_004a: 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) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { PikminEndOfGameStats stats = default(PikminEndOfGameStats); ((FastBufferReader)(ref reader)).ReadValueSafe(ref stats, default(ForNetworkSerializable)); PikminFiredStats fired = default(PikminFiredStats); ((FastBufferReader)(ref reader)).ReadValueSafe(ref fired, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).SyncGameStatsClientRpc(stats, fired); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3301298637(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); int[] scannedIDs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref scannedIDs, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).SyncScannedPikminClientRpc(scannedIDs); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3917132973(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 enemyRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).ConvertEnemyToGrabbableObjectServerRpc(enemyRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1145705668(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_004a: 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) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemyRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyRef, default(ForNetworkSerializable)); NetworkObjectReference itemNode = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemNode, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).SyncEnemyToGrabbableObjectConversionClientRpc(enemyRef, itemNode); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2124005398(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_0081: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikrefs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikrefs, default(ForNetworkSerializable)); } Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); float force = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).ApplyKnockbackServalPikminServerRpc(pikrefs, direction, force); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3832496342(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_0081: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikrefs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikrefs, default(ForNetworkSerializable)); } Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); float force = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).ApplyKnockbackServalPikminClientRpc(pikrefs, direction, force); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3548144878(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).FreezeWaterAtIndexServerRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4190370950(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 index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).FreezeWaterAtIndexClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4263540606(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).UnfreezeWaterAtIndexServerRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3530085895(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 index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).UnfreezeWaterAtIndexClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2583255835(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 typeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref typeID); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).ScanNewPikminTypeServerRpc(typeID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2745695640(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 typeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref typeID); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).ScanNewPikminTypeClientRpc(typeID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2929605241(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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int pikminID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref pikminID); int quantity = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref quantity); Vector3 spawnPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPos); Quaternion spawnRot = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnRot); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).SpawnPikminServerRpc(pikminID, quantity, spawnPos, spawnRot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_420950372(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).RemoveShipPhaseOnionsServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2321289145(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; ((PikminManager)(object)target).RemoveShipPhaseOnionsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1823152035(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int onionID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref onionID); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).SpawnShipPhaseOnionServerRpc(onionID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_71696338(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 onionID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref onionID); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).SpawnShipPhaseOnionClientRpc(onionID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1251378289(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); int[] onionID = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref onionID, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).SpawnShipPhaseOnionServerRpc(onionID); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_3112031328(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); int[] onionID = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref onionID, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminManager)(object)target).SpawnShipPhaseOnionClientRpc(onionID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_437144134(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; ((PikminManager)(object)target).ClearLocalDataClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PikminManager"; } } public class PikminNetworkRigidbody : NetworkBehaviour { [Header("Sync Configuration")] [SerializeField] private float velocityThreshold = 0.5f; [SerializeField] private float angularVelocityThreshold = 0.5f; [SerializeField] private float syncSmoothingFactor = 15f; [SerializeField] private bool syncVelocity = true; [SerializeField] private bool syncAngularVelocity = true; private Rigidbody rb = null; private PikminNetworkTransfrom networkTransform = null; private Vector3 networkVelocity; private Vector3 networkAngularVelocity; private float lastSyncTime; private bool hasInitialized = false; private void Awake() { rb = ((Component)this).GetComponent(); networkTransform = ((Component)this).GetComponent(); if ((Object)(object)rb == (Object)null) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": PikminNetworkRigidbody requires a Rigidbody component!")); ((Behaviour)this).enabled = false; } else if ((Object)(object)networkTransform == (Object)null) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": PikminNetworkRigidbody requires a PikminNetworkTransfrom component!")); ((Behaviour)this).enabled = false; } } public void OnEnable() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner) { rb.isKinematic = true; rb.interpolation = (RigidbodyInterpolation)0; rb.collisionDetectionMode = (CollisionDetectionMode)0; } networkVelocity = rb.velocity; networkAngularVelocity = rb.angularVelocity; hasInitialized = true; } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkDespawn(); } private void FixedUpdate() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0091: Unknown result type (might be due to invalid IL or missing references) if (!hasInitialized) { return; } if (((NetworkBehaviour)this).IsOwner) { CheckAndUpdateState(); return; } if (syncVelocity) { rb.velocity = Vector3.Lerp(rb.velocity, networkVelocity, Time.fixedDeltaTime * syncSmoothingFactor); } if (syncAngularVelocity) { rb.angularVelocity = Vector3.Lerp(rb.angularVelocity, networkAngularVelocity, Time.fixedDeltaTime * syncSmoothingFactor); } } private void CheckAndUpdateState() { //IL_0011: 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_0045: 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_0075: 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) bool flag = false; if (syncVelocity && Vector3.Distance(rb.velocity, networkVelocity) > velocityThreshold) { flag = true; } if (!flag && syncAngularVelocity && Vector3.Distance(rb.angularVelocity, networkAngularVelocity) > angularVelocityThreshold) { flag = true; } if (flag) { UpdateNetworkState(rb.velocity, rb.angularVelocity); } } private void UpdateNetworkState(Vector3 velocity, Vector3 angularVelocity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) networkVelocity = velocity; networkAngularVelocity = angularVelocity; lastSyncTime = Time.time; if (!((NetworkBehaviour)this).IsServer) { UpdateStateServerRpc(velocity, angularVelocity); } else { UpdateStateClientRpc(velocity, angularVelocity); } } [ServerRpc] private void UpdateStateServerRpc(Vector3 velocity, Vector3 angularVelocity) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Invalid comparison between Unknown and I4 //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2532454545u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref velocity); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref angularVelocity); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2532454545u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; networkVelocity = velocity; networkAngularVelocity = angularVelocity; UpdateStateClientRpc(velocity, angularVelocity); } } [ClientRpc] private void UpdateStateClientRpc(Vector3 velocity, Vector3 angularVelocity) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_00f7: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4070541543u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref velocity); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref angularVelocity); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4070541543u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { networkVelocity = velocity; networkAngularVelocity = angularVelocity; lastSyncTime = Time.time; } } } public void TeleportRigidbody(Vector3 position, Quaternion rotation, Vector3 velocity, Vector3 angularVelocity) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { networkTransform.Teleport(position, rotation); UpdateNetworkState(velocity, angularVelocity); rb.velocity = velocity; rb.angularVelocity = angularVelocity; } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2532454545u, new RpcReceiveHandler(__rpc_handler_2532454545), "UpdateStateServerRpc"); ((NetworkBehaviour)this).__registerRpc(4070541543u, new RpcReceiveHandler(__rpc_handler_4070541543), "UpdateStateClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2532454545(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 velocity = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref velocity); Vector3 angularVelocity = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref angularVelocity); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminNetworkRigidbody)(object)target).UpdateStateServerRpc(velocity, angularVelocity); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4070541543(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 velocity = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref velocity); Vector3 angularVelocity = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref angularVelocity); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminNetworkRigidbody)(object)target).UpdateStateClientRpc(velocity, angularVelocity); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PikminNetworkRigidbody"; } } public class PikminNetworkTransfrom : NetworkBehaviour { [Header("Sync Configuration")] [SerializeField] private float positionThreshold = 1f; [SerializeField] private float rotationThreshold = 6f; [SerializeField] private float syncMovementSpeed = 0.22f; [SerializeField] private float velocityChangeThreshold = 1.5f; [SerializeField] private float maxExtrapolationTime = 1f; [Header("Debug Configuration")] private Vector3 networkPosition; private Quaternion networkRotation; private float lastSyncTime; private Vector3 estimatedVelocity; private float lastSyncInterval = 0.5f; private Vector3 lastOwnerPos; private float lastOwnerSampleTime; private Vector3 smoothedOwnerVelocity; private Vector3 lastSentVelocity; public Vector3 tempVelocity; private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_003a: Unknown result type (might be due to invalid IL or missing references) networkPosition = ((Component)this).transform.position; networkRotation = ((Component)this).transform.rotation; lastSyncTime = Time.time; lastOwnerPos = ((Component)this).transform.position; lastOwnerSampleTime = Time.time; } private void Update() { if (((NetworkBehaviour)this).IsOwner) { CheckRpcUpdate(); } else { InterpolatePosition(); } } private void CheckRpcUpdate() { //IL_0076: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - lastOwnerSampleTime; if (num > 0.0001f) { Vector3 val = (((Component)this).transform.position - lastOwnerPos) / num; smoothedOwnerVelocity = Vector3.Lerp(smoothedOwnerVelocity, val, 0.25f); lastOwnerPos = ((Component)this).transform.position; lastOwnerSampleTime = Time.time; } bool flag = Vector3.Distance(((Component)this).transform.position, networkPosition) > positionThreshold; bool flag2 = Quaternion.Angle(((Component)this).transform.rotation, networkRotation) > rotationThreshold; bool flag3 = Vector3.Distance(smoothedOwnerVelocity, lastSentVelocity) > velocityChangeThreshold && Vector3.Distance(((Component)this).transform.position, networkPosition) > 0.05f; if (flag || flag2 || flag3) { UpdatePosition(((Component)this).transform.position, ((Component)this).transform.rotation); lastSentVelocity = smoothedOwnerVelocity; } } private void InterpolatePosition() { //IL_002d: 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_0039: 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_0043: 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) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - lastSyncTime; float num2 = Mathf.Min(num, Mathf.Min(maxExtrapolationTime, lastSyncInterval * 1.2f)); Vector3 val = networkPosition + estimatedVelocity * num2; ((Component)this).transform.position = Vector3.SmoothDamp(((Component)this).transform.position, val, ref tempVelocity, syncMovementSpeed); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, networkRotation, 15f * Time.deltaTime); } private void UpdatePosition(Vector3 newPosition, Quaternion newRotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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) networkPosition = newPosition; networkRotation = newRotation; lastSyncTime = Time.time; UpdatePositionRpc(newPosition, newRotation); } [Rpc(/*Could not decode attribute arguments.*/)] private void UpdatePositionRpc(Vector3 newPosition, Quaternion newRotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_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_007b: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = true, Delivery = (RpcDelivery)1 }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2145669805u, val2, val, (SendTo)1, (RpcDelivery)1); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref newPosition); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref newRotation); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2145669805u, val2, val, (SendTo)1, (RpcDelivery)1); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; float num = Time.time - lastSyncTime; if (num > 0.0001f) { estimatedVelocity = (newPosition - networkPosition) / num; lastSyncInterval = num; } networkPosition = newPosition; networkRotation = newRotation; lastSyncTime = Time.time; } } public void Teleport(Vector3 position) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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) Teleport(position, ((Component)this).transform.rotation, ((Component)this).transform.localScale); } public void Teleport(Vector3 position, Quaternion rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) Teleport(position, rotation, ((Component)this).transform.localScale); } public void Teleport(Vector3 position, Quaternion rotation, Vector3 scale) { //IL_000d: 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) if (((NetworkBehaviour)this).IsOwner) { TeleportRpc(position, rotation, scale); } } [Rpc(/*Could not decode attribute arguments.*/)] private void TeleportRpc(Vector3 position, Quaternion rotation, Vector3 scale) { //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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = true }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2288022619u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref rotation); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref scale); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2288022619u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; TeleportOnLocalClient(position, rotation, scale); } } } public void TeleportOnLocalClient(Vector3 position, Quaternion rotation, Vector3 scale) { //IL_0007: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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) ((Component)this).transform.position = position; ((Component)this).transform.rotation = rotation; ((Component)this).transform.localScale = scale; networkPosition = position; networkRotation = rotation; lastSyncTime = Time.time; estimatedVelocity = Vector3.zero; tempVelocity = Vector3.zero; lastOwnerPos = position; lastOwnerSampleTime = Time.time; smoothedOwnerVelocity = Vector3.zero; lastSentVelocity = Vector3.zero; } public void TeleportOnLocalClient(Vector3 position, Quaternion rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) TeleportOnLocalClient(position, rotation, ((Component)this).transform.localScale); } public void TeleportOnLocalClient(Vector3 position) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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) TeleportOnLocalClient(position, ((Component)this).transform.rotation, ((Component)this).transform.localScale); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2145669805u, new RpcReceiveHandler(__rpc_handler_2145669805), "UpdatePositionRpc"); ((NetworkBehaviour)this).__registerRpc(2288022619u, new RpcReceiveHandler(__rpc_handler_2288022619), "TeleportRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2145669805(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 newPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newPosition); Quaternion newRotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newRotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminNetworkTransfrom)(object)target).UpdatePositionRpc(newPosition, newRotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2288022619(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); Vector3 scale = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scale); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminNetworkTransfrom)(object)target).TeleportRpc(position, rotation, scale); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PikminNetworkTransfrom"; } } public class PikminNoticeZone : NetworkBehaviour { public bool IsAttachedToPlayer = true; public bool Active = true; public float Radius = 2f; public bool CanSavePikmin = false; public bool CanPluckSprouts = false; public Leader LeaderScript = null; public GameObject Visualizer = null; public Pintent[] ValidStates = new Pintent[1]; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); LethalMin.Logger.LogDebug((object)"PikminNoticeZone has spawned"); } public void Start() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (IsAttachedToPlayer) { LeaderScript = ((Component)this).GetComponentInParent(true); LeaderScript.NoticeZone = this; } if (CanPluckSprouts) { ((Component)this).GetComponent().excludeLayers = LayerMask.op_Implicit(0); } } public void OnTriggerStay(Collider other) { //IL_01f7: Unknown result type (might be due to invalid IL or missing references) if (!Active || !((NetworkBehaviour)this).IsOwner || !Object.op_Implicit((Object)(object)LeaderScript) || LeaderScript.Controller.isPlayerDead) { return; } PikminCollisionDetect pikminCollisionDetect = null; NoticeZoneOnlyDetect noticeZoneOnlyDetect = null; Sprout sprout = null; if (CanPluckSprouts && ((Component)other).CompareTag("InteractTrigger")) { sprout = ((Component)other).GetComponentInParent(); if ((Object)(object)sprout != (Object)null && !sprout.IsBeingPlucked) { sprout.SpawnPikminServerRpc(Despawn: true, (long)((NetworkBehaviour)LeaderScript.Controller).OwnerClientId); ((Component)other).tag = "Untagged"; return; } } if (((Component)other).CompareTag("Enemy") && ((((Component)other).TryGetComponent(ref pikminCollisionDetect) && Object.op_Implicit((Object)(object)pikminCollisionDetect.mainPikmin)) || (((Component)other).TryGetComponent(ref noticeZoneOnlyDetect) && Object.op_Implicit((Object)(object)noticeZoneOnlyDetect.mainPikmin)))) { PikminAI pikminAI = pikminCollisionDetect?.mainPikmin ?? noticeZoneOnlyDetect.mainPikmin; if (!(pikminAI.LeaderAssesmentDelay > 0f) && !((Object)(object)pikminAI.leader == (Object)(object)LeaderScript) && !((Object)(object)pikminAI.leader != (Object)null) && !pikminAI.IsAirborn && ((EnemyAI)pikminAI).currentBehaviourStateIndex != 3 && ((EnemyAI)pikminAI).currentBehaviourStateIndex != 4 && pikminAI.HasBeenInitalized && ValidStates.Contains(pikminAI.CurrentIntention)) { pikminAI.AssignLeaderServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)LeaderScript).NetworkObject)); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PikminNoticeZone"; } } public class PikminEnemyCollisionDetector : MonoBehaviour { public PikminEnemy enemy = null; public HashSet PikminInCollider { get; } = new HashSet(); public void AddPikmin(PikminAI pikmin) { if ((Object)(object)pikmin != (Object)null && !pikmin.IsDeadOrDying) { PikminInCollider.Add(pikmin); } } public void RemovePikmin(PikminAI pikmin) { if ((Object)(object)pikmin != (Object)null) { PikminInCollider.Remove(pikmin); } } private void OnDisable() { PikminInCollider.Clear(); } private void OnDestroy() { PikminInCollider.Clear(); } } public class PikminScanNodeProperties : ScanNodeProperties { public enum ScanNodeType { PointOfInterest, Enemy, Item } public int VisualNodeType = 2; public PiklopediaEntry? PiklopediaEntry = null; public bool OverrideEnemyGlobalNotif = true; private void Awake() { if (OverrideEnemyGlobalNotif && !LethalMin.EnemyIDsOverridenByPiklopedia.Contains(base.creatureScanID)) { LethalMin.EnemyIDsOverridenByPiklopedia.Add(base.creatureScanID); } } } public class PikminTypeResolver : NetworkBehaviour { public bool hasResolvedType = false; public PikminAI DefaultAI = null; public PikminCollisionDetect detect = null; [HideInInspector] public List PikminAIs = new List(); public PikminType typeToResolve = null; public int TypeIDToResolve = -1; public PikminSpawnProps SpawningProps; public Onion OnionToSpawnFrom = null; public int OnionIndex; private Vector3 StoredSpawnPosition = Vector3.zero; [ClientRpc] public void SyncSpawnClientRpc(int PikminTypeID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4112188661u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, PikminTypeID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4112188661u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TypeIDToResolve = PikminTypeID; } } } [ClientRpc] public void SyncSpawnClientRpc(int PikminTypeID, PikminSpawnProps props) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2303567680u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, PikminTypeID); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref props, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2303567680u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TypeIDToResolve = PikminTypeID; SpawningProps = props; } } } [ClientRpc] public void SyncSpawnFromOnionClientRpc(int PikminTypeID, int Index, NetworkObjectReference OnionRef, PikminSpawnProps props = default(PikminSpawnProps)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2870944325u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, PikminTypeID); BytePacker.WriteValueBitPacked(val2, Index); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref OnionRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref props, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2870944325u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); Onion onionToSpawnFrom = default(Onion); if (((NetworkObjectReference)(ref OnionRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref onionToSpawnFrom)) { TypeIDToResolve = PikminTypeID; SpawningProps = props; OnionToSpawnFrom = onionToSpawnFrom; OnionIndex = Index; } else { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": Failed to get onion network object or onion script when resloving type!")); } } } public void Start() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) if (hasResolvedType) { return; } if (((NetworkBehaviour)this).IsOwner) { StoredSpawnPosition = ((Component)this).transform.position; } if (TypeIDToResolve >= 0) { typeToResolve = LethalMin.GetPikminTypeByID(TypeIDToResolve); if ((Object)(object)typeToResolve == (Object)null) { LethalMin.Logger.LogError((object)$"PikminType with ID {TypeIDToResolve} not found when resloving..."); return; } } else { typeToResolve = ChooseRandomPikminType(); } Type type = (((Object)(object)typeToResolve.CustomTypeScript != (Object)null) ? ((object)typeToResolve.CustomTypeScript).GetType() : ((object)DefaultAI).GetType()); foreach (PikminAI pikminAI in PikminAIs) { if (((object)pikminAI).GetType() == type) { pikminAI.pikminType = typeToResolve; ((EnemyAICollisionDetect)detect).mainScript = (EnemyAI)(object)pikminAI; detect.mainPikmin = pikminAI; ((Behaviour)pikminAI).enabled = true; pikminAI.SpawnProps = SpawningProps; pikminAI.StoredSpawnPosition = StoredSpawnPosition; if ((Object)(object)OnionToSpawnFrom != (Object)null) { pikminAI.SpawnFromOnion(OnionIndex, OnionToSpawnFrom); } } else { ((NetworkBehaviour)this).NetworkObject.ChildNetworkBehaviours.Remove((NetworkBehaviour)(object)pikminAI); Object.Destroy((Object)(object)pikminAI); } } PikUtils.ReorganizeNetworkBehaviours(((NetworkBehaviour)this).NetworkObject); hasResolvedType = true; } private PikminType ChooseRandomPikminType() { int seed = StartOfRound.Instance.randomMapSeed + (int)((NetworkBehaviour)this).NetworkObjectId; Random random = new Random(seed); List list = new List(LethalMin.NaturalSpawningTypes); if (LethalMin.RandomizeByDay.InternalValue) { list.RemoveAll((PikminType type) => StartOfRound.Instance.gameStats.daysSpent <= type.SpawnAfterDay); } PikminType pikminType = list[random.Next(0, list.Count)]; LethalMin.Logger.LogInfo((object)("Randomly selected PikminType: " + ((Object)pikminType).name)); return pikminType; } 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(4112188661u, new RpcReceiveHandler(__rpc_handler_4112188661), "SyncSpawnClientRpc"); ((NetworkBehaviour)this).__registerRpc(2303567680u, new RpcReceiveHandler(__rpc_handler_2303567680), "SyncSpawnClientRpc"); ((NetworkBehaviour)this).__registerRpc(2870944325u, new RpcReceiveHandler(__rpc_handler_2870944325), "SyncSpawnFromOnionClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_4112188661(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 pikminTypeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref pikminTypeID); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminTypeResolver)(object)target).SyncSpawnClientRpc(pikminTypeID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2303567680(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int pikminTypeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref pikminTypeID); PikminSpawnProps props = default(PikminSpawnProps); ((FastBufferReader)(ref reader)).ReadValueSafe(ref props, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminTypeResolver)(object)target).SyncSpawnClientRpc(pikminTypeID, props); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2870944325(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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int pikminTypeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref pikminTypeID); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); NetworkObjectReference onionRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref onionRef, default(ForNetworkSerializable)); PikminSpawnProps props = default(PikminSpawnProps); ((FastBufferReader)(ref reader)).ReadValueSafe(ref props, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PikminTypeResolver)(object)target).SyncSpawnFromOnionClientRpc(pikminTypeID, index, onionRef, props); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PikminTypeResolver"; } } public class PikminVehicleController : MonoBehaviour { public VehicleController controller = null; public BoxCollider PointsRegion = null; public Collider PikminCheckRegion = null; public Transform PikminWarpPoint = null; public Dictionary PikminPoints = new Dictionary(); public Random RNG = new Random(StartOfRound.Instance.randomMapSeed); public bool ForceWarpPointOntoNavmesh = true; private Vector3 OriginalWTLocalPosition = Vector3.zero; public void Start() { InitializeReferences(); if (((Behaviour)this).enabled) { PikminManager.instance.Vehicles.Add(this); } } public void OnDestroy() { PikminManager.instance.Vehicles.Remove(this); } public void InitializeReferences() { //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)controller == (Object)null) { controller = ((Component)this).GetComponent(); } if ((Object)(object)PointsRegion == (Object)null) { Transform val = FindChildRecursiveExact(((Component)this).transform, "InsideTruckNavBounds"); if ((Object)(object)val == (Object)null) { LethalMin.Logger.LogWarning((object)("[PikminVehicleController] Could not find 'InsideTruckNavBounds' for '" + ((Object)((Component)this).gameObject).name + "', trying looser search.")); val = FindChildRecursiveLoose(((Component)this).transform, new string[1] { "NavBounds" }, null); } if ((Object)(object)val == (Object)null) { LethalMin.Logger.LogWarning((object)("[PikminVehicleController] Could not find 'NavBounds' for '" + ((Object)((Component)this).gameObject).name + "', trying looser search.")); val = FindChildRecursiveLoose(((Component)this).transform, new string[1] { "Nav" }, null); } if ((Object)(object)val != (Object)null) { LethalMin.Logger.LogInfo((object)("[PikminVehicleController] Found NavBounds for '" + ((Object)((Component)this).gameObject).name + "' on object '" + ((Object)((Component)val).gameObject).name + "'.")); PointsRegion = ((Component)val).GetComponent() ?? ((Component)val).GetComponentInChildren(true); } } if ((Object)(object)PikminCheckRegion == (Object)null) { Transform val2 = FindChildRecursiveExact(((Component)this).transform, "VehicleBounds"); if ((Object)(object)val2 == (Object)null) { LethalMin.Logger.LogWarning((object)("[PikminVehicleController] Could not find 'VehicleBounds' for '" + ((Object)((Component)this).gameObject).name + "', trying looser search.")); val2 = FindChildRecursiveLoose(((Component)this).transform, new string[1] { "Bounds" }, new string[1] { "Nav" }); } if ((Object)(object)val2 != (Object)null) { LethalMin.Logger.LogInfo((object)("[PikminVehicleController] Found VehicleBounds for '" + ((Object)((Component)this).gameObject).name + "' on object '" + ((Object)((Component)val2).gameObject).name + "'.")); PikminCheckRegion = ((Component)val2).GetComponent() ?? ((Component)val2).GetComponentInChildren(true); } } if ((Object)(object)PointsRegion == (Object)null || (Object)(object)PikminCheckRegion == (Object)null) { LethalMin.Logger.LogFatal((object)("[PikminVehicleController] Failed to initialize vehicle regions for '" + ((Object)((Component)this).gameObject).name + "'. " + $"PointsRegion missing: {(Object)(object)PointsRegion == (Object)null}, PikminCheckRegion missing: {(Object)(object)PikminCheckRegion == (Object)null}. Destroying component.")); ((Behaviour)this).enabled = false; Object.Destroy((Object)(object)this); } else if ((Object)(object)PikminWarpPoint == (Object)null) { PikminWarpPoint = new GameObject("Pikmin Warp Point").transform; PikminWarpPoint.SetParent(((Component)this).transform); PikminWarpPoint.localPosition = new Vector3(0f, -2f, -5f); PikminWarpPoint.localScale = new Vector3(1f, 1f, 1f); OriginalWTLocalPosition = PikminWarpPoint.localPosition; } } private static Transform? FindChildRecursiveExact(Transform parent, string targetName) { if (((Object)parent).name == targetName) { return parent; } for (int i = 0; i < parent.childCount; i++) { Transform child = parent.GetChild(i); Transform val = FindChildRecursiveExact(child, targetName); if ((Object)(object)val != (Object)null) { return val; } } return null; } private static Transform? FindChildRecursiveLoose(Transform parent, string[]? requiredParts, string[]? excludedParts) { string text = ((Object)parent).name.ToLowerInvariant(); bool flag = true; if (requiredParts != null) { for (int i = 0; i < requiredParts.Length; i++) { if (!text.Contains(requiredParts[i].ToLowerInvariant())) { flag = false; break; } } } if (flag && excludedParts != null) { for (int j = 0; j < excludedParts.Length; j++) { if (text.Contains(excludedParts[j].ToLowerInvariant())) { flag = false; break; } } } if (flag) { return parent; } for (int k = 0; k < parent.childCount; k++) { Transform child = parent.GetChild(k); Transform val = FindChildRecursiveLoose(child, requiredParts, excludedParts); if ((Object)(object)val != (Object)null) { return val; } } return null; } public Transform GetAvaiblePikminPoint(PikminAI pikmin) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0041: 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_0050: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) if (PikminPoints.ContainsKey(pikmin)) { return PikminPoints[pikmin]; } GameObject val = new GameObject(pikmin.DebugID + "Point"); Vector3 val2 = PointsRegion.size / 2f; Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(Random.Range(0f - val2.x, val2.x), Random.Range(0f - val2.y, val2.y), Random.Range(0f - val2.z, val2.z)); Vector3 val4 = ((Component)PointsRegion).transform.TransformPoint(val3); NavMeshHit val5 = default(NavMeshHit); if (NavMesh.SamplePosition(val4, ref val5, 1f, -1)) { val.transform.position = ((NavMeshHit)(ref val5)).position; } else { val.transform.position = val4; } val.transform.SetParent(((Component)PointsRegion).transform, true); val.transform.rotation = Quaternion.identity; PikminPoints[pikmin] = val.transform; LethalMin.Logger.LogInfo((object)$"Created point at {val.transform.position} for {pikmin.DebugID}"); return val.transform; } public void RemovePikminPoint(PikminAI pikmin) { } public bool IsNearByShip() { //IL_0007: 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) return Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.shipAnimatorObject).transform.position) < 20f; } private void Update() { if (controller.carDestroyed && PikminManager.instance.Vehicles.Contains(this)) { PikminManager.instance.Vehicles.Remove(this); ((Behaviour)this).enabled = false; } } private void LateUpdate() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (ForceWarpPointOntoNavmesh) { NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)this).transform.TransformPoint(OriginalWTLocalPosition), ref val, 5f, -1)) { PikminWarpPoint.position = ((NavMeshHit)(ref val)).position; } else { LethalMin.Logger.LogWarning((object)("Failed to ensure the point is on the NavMesh for: " + ((Object)PikminWarpPoint).name)); } } } } public class PikminZap : MonoBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PikminZap <>4__this; private PikminGhost 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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; 5__1 = Object.Instantiate(LethalMin.PikminGhostPrefab, ((Component)<>4__this).transform.position, ((Component)<>4__this).transform.rotation).GetComponent(); 5__1.LostType = <>4__this.LostType; 5__1.InMemoryof = <>4__this.InMemoryof; 5__1.ghostRandom = <>4__this.ghostRandom; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; case 2: <>1__state = -1; Object.Destroy((Object)(object)((Component)<>4__this).gameObject); 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 PikminType LostType = null; public Random ghostRandom = null; public string InMemoryof = ""; private void Start() { ((MonoBehaviour)this).StartCoroutine(SpawnGhost()); } [IteratorStateMachine(typeof(d__4))] private IEnumerator SpawnGhost() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this }; } } public enum PikminGeneration { Pikmin1And2, Pikmin3, HeyPikmin, Pikmin4 } public enum DisableablePikminGeneration { Any = -1, Pikmin1And2, Pikmin3, HeyPikmin, Pikmin4 } public enum CfgPikminGeneration { Default = -1, Pikmin1And2, Pikmin3, HeyPikmin, Pikmin4 } public class PikminSproutFXManager : MonoBehaviour { public PikminAI minmin = null; public Transform Top = null; [SerializeField] private Animator GlowAnim = null; [SerializeField] private SpriteRenderer GlowSprt = null; [SerializeField] private ParticleSystem FireParticles = null; [SerializeField] private ParticleSystem GasParticles = null; private void Start() { if ((Object)(object)FireParticles == (Object)null) { GameObject val = Object.Instantiate(LethalMin.PikminFirePrefab, Top); FireParticles = val.GetComponentInChildren(); } if ((Object)(object)GasParticles == (Object)null) { GameObject val2 = Object.Instantiate(LethalMin.PikminGasPrefab, Top); GasParticles = val2.GetComponentInChildren(); } if ((Object)(object)GlowAnim == (Object)null || (Object)(object)GlowSprt == (Object)null) { GameObject val3 = Object.Instantiate(LethalMin.GlowPrefab, Top); GlowAnim = val3.GetComponentInChildren(); GlowSprt = val3.GetComponentInChildren(); } FireParticles.Stop(); GasParticles.Stop(); } private void Update() { //IL_0092: 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) if ((Object)(object)minmin == (Object)null) { return; } GlowAnim.SetBool("Glow", (((EnemyAI)minmin).currentBehaviourStateIndex == 0 && minmin.CurrentIntention == Pintent.Idle && !minmin.Laying) || minmin.ForceSproutGlow); GlowSprt.color = (minmin.pikminType.UseOverrideSproutGlowColor ? minmin.pikminType.OverrideSproutGlowColor : minmin.pikminType.PikminPrimaryColor); string curPanicAnim = minmin.CurPanicAnim; string text = curPanicAnim; if (!(text == "FirePanic")) { if (text == "PoisonPanic") { if (!GasParticles.isPlaying) { GasParticles.Play(); } return; } if (FireParticles.isPlaying) { FireParticles.Stop(); } if (GasParticles.isPlaying) { GasParticles.Stop(); } } else if (!FireParticles.isPlaying) { FireParticles.Play(); } } } public class PikminTeleportTrigger : MonoBehaviour { public Transform Destination = null; public void OnTriggerEnter(Collider other) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } PikminCollisionDetect component = ((Component)other).GetComponent(); if (!((Object)(object)component == (Object)null)) { PikminAI mainPikmin = component.mainPikmin; if (!((Object)(object)mainPikmin == (Object)null) && ((NetworkBehaviour)mainPikmin).IsOwner && ((EnemyAI)mainPikmin).currentBehaviourStateIndex == 2) { ((EnemyAI)mainPikmin).agent.Warp(Destination.position); ((Component)mainPikmin).transform.position = Destination.position; } } } } public class PlayerGhost : MonoBehaviour { public Transform LookAt = null; private Renderer renderer = null; private Vector3 StartingPosition; private Color StartingColor; private float RemoveTimer; private Vector3 lookatLocalPos = new Vector3(0f, 0f, 0f); private AudioSource audioSource = null; private void Start() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) renderer = ((Component)this).GetComponentInChildren(); StartingColor = renderer.material.color; audioSource = ((Component)this).GetComponent(); audioSource.rolloffMode = (AudioRolloffMode)((!LethalMin.GlobalGhostSFX) ? 1 : 0); StartingPosition = ((Component)this).transform.position; if ((Object)(object)((Component)LookAt).transform.parent == (Object)(object)((Component)this).transform) { lookatLocalPos = ((Component)LookAt).transform.localPosition; ((Component)LookAt).transform.SetParent((Transform)null, true); } } public void Update() { //IL_0029: 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_0061: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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_011f: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) audioSource.rolloffMode = (AudioRolloffMode)((!LethalMin.GlobalGhostSFX) ? 1 : 0); LookAt.position = new Vector3(((Component)this).transform.position.x + lookatLocalPos.x, ((Component)this).transform.position.y + lookatLocalPos.y, ((Component)this).transform.position.z + lookatLocalPos.z); ((Component)this).transform.position = new Vector3(((Component)this).transform.position.x, ((Component)this).transform.position.y + Time.deltaTime * 1.5f, ((Component)this).transform.position.z); if (Vector3.Distance(StartingPosition, ((Component)this).transform.position) > 10f) { renderer.material.color = new Color(renderer.material.color.r, renderer.material.color.g, renderer.material.color.b, renderer.material.color.a - Time.deltaTime * 0.5f); RemoveTimer += Time.deltaTime * 0.5f; } if (RemoveTimer > 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public enum PuffminIntent { Idle, Held, Thrown, Knockback, LatchedOn, Dead } public class PuffminAI : EnemyAI, IGenerationSwitchable { [CompilerGenerated] private sealed class d__55 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PuffminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__55(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00c9: 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_0068: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; ((EnemyAI)<>4__this).creatureVoice.PlayOneShot(<>4__this.HitSound); if (((NetworkBehaviour)<>4__this.LeaderLatchedTo).IsOwner) { <>4__this.LeaderLatchedTo.Controller.DamagePlayer(1, true, true, (CauseOfDeath)1, 0, false, ((Component)<>4__this).transform.forward); } break; } if ((Object)(object)<>4__this.LeaderLatchedTo != (Object)null && <>4__this.LeaderLatchedTo.Controller.isPlayerControlled) { ((EnemyAI)<>4__this).creatureAnimator.SetTrigger("Attack"); ((EnemyAI)<>4__this).creatureVoice.PlayOneShot(<>4__this.AttackVoice); <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 1; return true; } <>4__this.latchedRoutine = null; 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__75 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public PuffminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__75(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; delay += (float)<>4__this.enemyRandom.Next(1, 10) / 10f; LethalMin.Logger.LogDebug((object)$"{<>4__this.DebugID}: Spawning Ghost after, {delay} seconds"); <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.SpawnGhost(); 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__52 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB player; public PuffminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__52(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((EnemyAI)<>4__this).creatureVoice.PlayOneShot(<>4__this.AttackVoice); ((EnemyAI)<>4__this).creatureAnimator.SetTrigger("Attack"); <>4__this.AttackCooldown = 0.25f; <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((double)Vector3.Distance(((Component)<>4__this).transform.position, ((Component)player).transform.position) < 2.5) { if (((NetworkBehaviour)player).IsOwner) { player.DamagePlayer(1, true, true, (CauseOfDeath)1, 0, false, ((Component)<>4__this).transform.forward); } ((EnemyAI)<>4__this).creatureSFX.PlayOneShot(<>4__this.HitSound); } 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__87 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PuffminAI <>4__this; private Renderer 5__1; private Texture 5__2; private Color 5__3; private Color 5__4; private Color 5__5; private float 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__87(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!<>4__this.OrignalPikmin.HasValue) { LethalMin.Logger.LogError((object)(<>4__this.DebugID + ": OrignalPikmin is null when tweening colors!")); return false; } 5__1 = <>4__this.CurBodyRenderer; 5__2 = null; 5__3 = 5__1.material.color; 5__4 = LethalMin.GetPikminTypeByID(<>4__this.OrignalPikmin.Value.TypeID).PikminPrimaryColor; 5__5 = new Color(0.42f, 0f, 0.42f); if ((Object)(object)5__1.material.mainTexture != (Object)null) { 5__2 = 5__1.material.mainTexture; 5__1.material.mainTexture = null; } 5__1.material.color = 5__4; 5__6 = 0f; break; case 1: <>1__state = -1; break; } if (5__6 < 1f) { 5__1.material.color = Color.Lerp(5__4, 5__5, 5__6); 5__6 += Time.deltaTime / 2f; <>2__current = null; <>1__state = 1; return true; } 5__1.material.color = 5__3; if ((Object)(object)5__2 != (Object)null) { 5__1.material.mainTexture = 5__2; } 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 PuffminIntent currentIntent = PuffminIntent.Idle; public Transform MeshContainer = null; public PikminNetworkTransfrom transform2 = null; public Rigidbody rb = null; public Collider Pcollider = null; public GameObject PuffminMeshes = null; public PikminData? OrignalPikmin = null; public PuffminLeader? Leader = null; public PuffminLeader? PreviousLeader = null; public PlayerControllerB? PlayerChaseing = null; public Leader? LeaderLatchedTo = null; public float AttackCooldown = 1f; public float StunTimer = 1.5f; public float KnockbackLandBuffer = 0.5f; public float WhistleBuffer = 0f; public string DebugID = ""; public Random enemyRandom = null; public Renderer CurBodyRenderer = null; public AudioClip HitSound = null; public AudioClip AttackVoice = null; public AudioClip NoticeVoice = null; public AudioClip HoldVoice = null; public AudioClip ThrowVoice = null; public AudioClip HurtVoice = null; public List TempObjects = new List(); private float timeOffNavMesh; private Coroutine latchedRoutine = null; private int destoryCounter = 0; public bool IsDeadOrDying => currentIntent == PuffminIntent.Knockback || base.isEnemyDead; public bool IsAirborn => currentIntent == PuffminIntent.Held || currentIntent == PuffminIntent.Thrown || currentIntent == PuffminIntent.Knockback; [ClientRpc] public void SetPuffminDataClientRpc(PikminData data) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3301664309u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref data, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3301664309u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OrignalPikmin = data; } } } public override void Start() { ((EnemyAI)this).Start(); enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); if (!OrignalPikmin.HasValue) { LethalMin.Logger.LogWarning((object)("LethalMin: OrignalPikmin is null for " + DebugID + "! Using random...")); int num = enemyRandom.Next(0, LethalMin.RegisteredPikminTypes.Count); string pikminName = LethalMin.GetPikminTypeByID(num).PikminName; OrignalPikmin = new PikminData(num, -1, 0, pikminName + "_" + PikUtils.GenerateRandomString(enemyRandom), $"{DateTime.Now}"); } DebugID = "(Puffmin)" + OrignalPikmin.Value.DebugName; ((Object)((Component)this).gameObject).name = DebugID; Object.Instantiate(PuffminMeshes, MeshContainer); PikminManager.instance.PuffminAIs.Add(this); SwitchGeneration(PikUtils.ConvertCfgGenerationToPikminGeneration(LethalMin.PuffminGeneration.InternalValue)); SetCollisionMode(1); DoTransformAnimation(); int num2 = 1 << NavMesh.GetAreaFromName("Water"); PikminType pikminTypeByID = LethalMin.GetPikminTypeByID(OrignalPikmin.Value.TypeID); if (PikChecks.IsPikminResistantToHazard(pikminTypeByID, PikminHazard.Water)) { NavMeshAgent agent = base.agent; agent.areaMask |= num2; } else { NavMeshAgent agent2 = base.agent; agent2.areaMask &= ~num2; } } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkDespawn(); PikminManager.instance.PuffminAIs.Remove(this); UnLatchPuffmin(); RemoveLeader(); foreach (GameObject tempObject in TempObjects) { if (!((Object)(object)tempObject == (Object)null)) { LethalMin.Logger.LogInfo((object)(DebugID + ": Destroying temp object " + ((Object)tempObject).name)); Object.Destroy((Object)(object)tempObject); } } } public void SwitchGeneration(PikminGeneration generation) { if (LethalMin.RandomizeGenerationModels.InternalValue) { generation = (PikminGeneration)enemyRandom.Next(0, Enum.GetValues(typeof(PikminGeneration)).Length); } PuffminModelRefernces modelRefernces = ((Component)this).GetComponentInChildren(); bool flag = false; PuffminModelGeneration[] generations = modelRefernces.Generations; foreach (PuffminModelGeneration puffminModelGeneration in generations) { if (!PikChecks.IsGenerationValid(puffminModelGeneration)) { LethalMin.Logger.LogError((object)$"Generation {puffminModelGeneration.Generation} is invaild for a Puffmin!"); continue; } puffminModelGeneration.Model.SetActive(puffminModelGeneration.Generation == generation); if (puffminModelGeneration.Generation == generation) { applyGeneration(puffminModelGeneration); flag = true; } } if (!flag) { LethalMin.Logger.LogWarning((object)$"Failed to find a valid generation for Puffmin! Generation: {generation}"); applyDefaultGeneration(); } void applyDefaultGeneration() { modelRefernces.Model.SetActive(true); base.creatureAnimator = modelRefernces.Animator; base.skinnedMeshRenderers = modelRefernces.Model.gameObject.GetComponentsInChildren(); base.meshRenderers = modelRefernces.Model.gameObject.GetComponentsInChildren(); CurBodyRenderer = modelRefernces.BodyRenderer; } void applyGeneration(PuffminModelGeneration gen) { base.creatureAnimator = gen.Animator; base.skinnedMeshRenderers = gen.Model.gameObject.GetComponentsInChildren(); base.meshRenderers = gen.Model.gameObject.GetComponentsInChildren(); CurBodyRenderer = gen.BodyRenderer; } } public override void Update() { //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) ModifiedUpdate(); HandleLocalSnapPosition(); if (((NetworkBehaviour)this).IsOwner) { Animator creatureAnimator = base.creatureAnimator; Vector3 velocity = base.agent.velocity; creatureAnimator.SetBool("Moving", ((Vector3)(ref velocity)).magnitude > 0.1f); } else { base.creatureAnimator.SetBool("Moving", ((Vector3)(ref transform2.tempVelocity)).magnitude > 0.1f); } if (((NetworkBehaviour)this).IsOwner) { if (StunTimer > 0f) { StunTimer -= Time.deltaTime; } if (WhistleBuffer >= 0f) { WhistleBuffer -= Time.deltaTime; } } if (((NetworkBehaviour)this).IsOwner) { CheckIfOnNavmesh(); } if (base.currentBehaviourStateIndex == 2) { HandleChaseStateConstantly(); } } public void ModifiedUpdate() { //IL_004a: 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) if (base.inSpecialAnimation || !((Behaviour)base.agent).enabled || !base.agent.isOnNavMesh || Time.realtimeSinceStartup - base.refreshDestinationInterval > 15f) { base.refreshDestinationInterval = Time.realtimeSinceStartup; base.prevDestination = Vector3.zero; } if (base.enemyType.isDaytimeEnemy && !base.daytimeEnemyLeaving) { ((EnemyAI)this).CheckTimeOfDayToLeave(); } if (base.stunnedIndefinitely <= 0) { if (base.stunNormalizedTimer >= 0f) { base.stunNormalizedTimer -= Time.deltaTime / base.enemyType.stunTimeMultiplier; } else { base.stunnedByPlayer = null; if (base.postStunInvincibilityTimer >= 0f) { base.postStunInvincibilityTimer -= Time.deltaTime * 5f; } } } if (!base.ventAnimationFinished && base.timeSinceSpawn < base.exitVentAnimationTime + 0.005f * (float)RoundManager.Instance.numberOfEnemiesInScene) { base.timeSinceSpawn += Time.deltaTime; return; } if (!base.inSpecialAnimation && !base.ventAnimationFinished) { base.ventAnimationFinished = true; if ((Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.SetBool("inSpawningAnimation", false); } } ((EnemyAI)this).DisableAnimatorWhenNotVisible(); if (!((NetworkBehaviour)this).IsOwner) { if (base.currentSearch.inProgress) { ((EnemyAI)this).StopSearch(base.currentSearch, true); } base.timeSinceSpawn += Time.deltaTime; return; } if (base.isEnemyDead) { ((Behaviour)base.agent).enabled = false; return; } if (base.movingTowardsTargetPlayer && (Object)(object)base.targetPlayer != (Object)null) { ((EnemyAI)this).NavigateTowardsTargetPlayer(); } if (!base.inSpecialAnimation) { if (base.updateDestinationInterval >= 0f) { base.updateDestinationInterval -= Time.deltaTime; return; } ((EnemyAI)this).DoAIInterval(); base.updateDestinationInterval = base.AIIntervalTime + Random.Range(-0.015f, 0.015f); } } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if ((Object)(object)Leader != (Object)null && Leader.AI.isEnemyDead) { LethalMin.Logger.LogInfo((object)(DebugID + ": Leader is dead! Turning back to normal...")); TransformIntoPikminServerRpc(); return; } if ((Object)(object)Leader == (Object)null && (Object)(object)PreviousLeader != (Object)null && PreviousLeader.AI.isEnemyDead) { LethalMin.Logger.LogInfo((object)(DebugID + ": Previous Leader is dead! Turning back to normal...")); TransformIntoPikminServerRpc(); return; } switch (base.currentBehaviourStateIndex) { case 0: HandleIdleStateOnOwnerClient(); break; case 1: HandleFollowStateOnOwnerClient(); break; case 2: HandleChaseStateOnOwnerClient(); break; } } public void PathToPosition(Vector3 position) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogWarning((object)(DebugID + ": PathToPosition called on non-owner client!")); } if (((NetworkBehaviour)this).IsOwner && ((Behaviour)base.agent).enabled) { base.agent.SetDestination(position); } } [ServerRpc] public void SetToIdleServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2322496202u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2322496202u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetToIdleClientRpc(); } } [ClientRpc] public void SetToIdleClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1139558359u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1139558359u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { SetToIdle(); } } } public void SetToIdle() { LethalMin.Logger.LogInfo((object)(DebugID + ": Setting to idle")); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); SwitchToIntent(PuffminIntent.Idle); PlayerChaseing = null; SetCollisionMode(1); UnLatchPuffmin(); } public void HandleIdleStateOnOwnerClient() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) base.agent.stoppingDistance = 0f; PathToPosition(((Component)this).transform.position); if (currentIntent != PuffminIntent.Held && currentIntent != PuffminIntent.Thrown && !IsDeadOrDying && !(StunTimer > 0f)) { PlayerControllerB closestPlayer = GetClosestPlayer(); if ((Object)(object)closestPlayer != (Object)null) { SetToChasePlayerServerRpc(((NetworkBehaviour)closestPlayer).OwnerClientId); } } } public void HandleFollowStateOnOwnerClient() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Leader == (Object)null || Leader.AI.isEnemyDead) { SetToIdleServerRpc(); SetToIdle(); } else if (currentIntent != PuffminIntent.Held && currentIntent != PuffminIntent.Thrown) { base.agent.stoppingDistance = 3.5f; PathToPosition(((Component)Leader).transform.position); } } public void HandleChaseStateOnOwnerClient() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)PlayerChaseing != (Object)null) { base.agent.stoppingDistance = 0f; PathToPosition(((Component)PlayerChaseing).transform.position); } } public void HandleChaseStateConstantly() { //IL_004d: 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_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LeaderLatchedTo != (Object)null && LeaderLatchedTo.Controller.isPlayerControlled) { return; } if ((Object)(object)PlayerChaseing == (Object)null || !PlayerChaseing.isPlayerControlled || Vector3.Distance(((Component)this).transform.position, ((Component)PlayerChaseing).transform.position) > 25f) { if ((Object)(object)PreviousLeader != (Object)null && !PreviousLeader.AI.isEnemyDead) { LethalMin.Logger.LogInfo((object)(DebugID + ": Setting to follow previous leader")); if (((NetworkBehaviour)this).IsOwner) { AssignLeader(PreviousLeader); AssignLeaderServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)PreviousLeader).NetworkObject)); } } else { LethalMin.Logger.LogInfo((object)(DebugID + ": Player is no longer valid! Switching to idle state...")); if (((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).SwitchToBehaviourState(0); } } } else if (AttackCooldown >= 0f) { AttackCooldown -= Time.deltaTime; } else if ((double)Vector3.Distance(((Component)this).transform.position, ((Component)PlayerChaseing).transform.position) < 2.5) { ((MonoBehaviour)this).StartCoroutine(TryHitPlayer(PlayerChaseing)); } } public void CheckIfOnNavmesh() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)base.agent).enabled || base.agent.isOnNavMesh || base.agent.isOnOffMeshLink) { return; } if (timeOffNavMesh > 0f) { timeOffNavMesh -= Time.deltaTime; return; } timeOffNavMesh = 4f; if ((Object)(object)Leader != (Object)null) { Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(((Component)Leader).transform.position, default(NavMeshHit), 5f, -1); base.agent.Warp(navMeshPosition); LethalMin.Logger.LogWarning((object)$"{DebugID}: Warped to Leader: {navMeshPosition} due to being off navmesh"); } else if ((Object)(object)PreviousLeader != (Object)null) { Vector3 navMeshPosition2 = RoundManager.Instance.GetNavMeshPosition(((Component)PreviousLeader).transform.position, default(NavMeshHit), 5f, -1); base.agent.Warp(navMeshPosition2); LethalMin.Logger.LogWarning((object)$"{DebugID}: Warped to Previous Leader: {navMeshPosition2} due to being off navmesh"); } else { Vector3 navMeshPosition3 = RoundManager.Instance.GetNavMeshPosition(((Component)this).transform.position, default(NavMeshHit), 100f, -1); base.agent.Warp(navMeshPosition3); LethalMin.Logger.LogWarning((object)$"{DebugID}: Warped to {navMeshPosition3} due to being off navmesh"); } } public void SwitchToIntent(PuffminIntent intent) { currentIntent = intent; } public PlayerControllerB? GetClosestPlayer() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return PikUtils.GetClosestInstanceOfClassToPosition(((Component)this).transform.position, 10f, (IEnumerable?)StartOfRound.Instance.allPlayerScripts); } [ServerRpc] public void SetToChasePlayerServerRpc(ulong PlayerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(689057634u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, PlayerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 689057634u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).OwnerClientId != PlayerID) { ((EnemyAI)this).ChangeOwnershipOfEnemy(PlayerID); } SetToChasePlayerClientRpc(PlayerID); } } [ClientRpc] public void SetToChasePlayerClientRpc(ulong PlayerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(264576174u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, PlayerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 264576174u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Leader leaderViaID = LethalMin.GetLeaderViaID(PlayerID); if ((Object)(object)leaderViaID == (Object)null) { LethalMin.Logger.LogError((object)$"{DebugID}: Failed to find leader with ID {PlayerID}!"); } else { SetToChase(leaderViaID.Controller); } } } public void SetToChase(PlayerControllerB player) { LethalMin.Logger.LogInfo((object)$"{DebugID}: Setting to chase player {((NetworkBehaviour)player).OwnerClientId}"); PlayerChaseing = player; SetCollisionMode(1); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2); } [IteratorStateMachine(typeof(d__52))] public IEnumerator TryHitPlayer(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__52(0) { <>4__this = this, player = player }; } public void SetPuffminAsLatchedOn(Leader leader) { LethalMin.Logger.LogInfo((object)(DebugID + ": Setting as latched on to " + leader.Controller.playerUsername)); if (latchedRoutine != null) { ((MonoBehaviour)this).StopCoroutine(latchedRoutine); latchedRoutine = null; } LeaderLatchedTo = leader; SetCollisionMode(0); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2); SwitchToIntent(PuffminIntent.LatchedOn); latchedRoutine = ((MonoBehaviour)this).StartCoroutine(LatchedOnRoutine()); } public void UnLatchPuffmin() { if (latchedRoutine != null) { LethalMin.Logger.LogInfo((object)(DebugID + " stopping latch routine")); ((MonoBehaviour)this).StopCoroutine(latchedRoutine); latchedRoutine = null; } if ((Object)(object)LeaderLatchedTo != (Object)null) { LethalMin.Logger.LogInfo((object)$"{DebugID}: Unlatching from {((NetworkBehaviour)LeaderLatchedTo).OwnerClientId}"); if (LeaderLatchedTo.PuffminLatchedOn.ContainsKey(this)) { Object.Destroy((Object)(object)((Component)LeaderLatchedTo.PuffminLatchedOn[this]).gameObject); LeaderLatchedTo.PuffminLatchedOn.Remove(this); } else { LethalMin.Logger.LogError((object)(DebugID + ": Failed to find self in LeaderLatchedTo's PuffminLatchedOn!")); } } LeaderLatchedTo = null; } [IteratorStateMachine(typeof(d__55))] private IEnumerator LatchedOnRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__55(0) { <>4__this = this }; } public virtual void SetCollisionMode(int Mode) { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0297: 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_02b3: 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_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogDebug((object)$"{DebugID}: Setting collision mode to {Mode}"); switch (Mode) { case 0: ((Behaviour)base.agent).enabled = false; ((Behaviour)transform2).enabled = false; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; base.updatePositionThreshold = 9000f; base.syncMovementSpeed = 0f; rb.isKinematic = true; rb.useGravity = false; Pcollider.enabled = false; rb.collisionDetectionMode = (CollisionDetectionMode)0; rb.detectCollisions = false; rb.constraints = (RigidbodyConstraints)126; rb.interpolation = (RigidbodyInterpolation)0; rb.excludeLayers = LayerMask.op_Implicit(0); rb.Sleep(); break; case 1: if (((NetworkBehaviour)this).IsOwner) { ((Behaviour)base.agent).enabled = true; } else { ((Behaviour)base.agent).enabled = false; } ((Behaviour)transform2).enabled = true; base.updatePositionThreshold = 1f; base.syncMovementSpeed = 0.22f; rb.isKinematic = true; rb.useGravity = false; Pcollider.enabled = false; rb.collisionDetectionMode = (CollisionDetectionMode)0; rb.detectCollisions = true; rb.constraints = (RigidbodyConstraints)126; rb.interpolation = (RigidbodyInterpolation)0; rb.excludeLayers = LayerMask.op_Implicit(0); rb.Sleep(); break; case 2: ((Behaviour)base.agent).enabled = false; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; base.updatePositionThreshold = 9000f; base.syncMovementSpeed = 0f; rb.isKinematic = false; rb.useGravity = true; rb.detectCollisions = true; rb.constraints = (RigidbodyConstraints)80; rb.interpolation = (RigidbodyInterpolation)1; rb.collisionDetectionMode = (CollisionDetectionMode)1; if (((NetworkBehaviour)this).IsOwner) { Pcollider.excludeLayers = LayerMask.op_Implicit(~LayerMask.op_Implicit(LethalMin.PikminColideable)); rb.excludeLayers = LayerMask.op_Implicit(~LayerMask.op_Implicit(LethalMin.PikminColideable)); } else { Pcollider.excludeLayers = LayerMask.op_Implicit(~LayerMask.op_Implicit(LethalMin.PikminColideable)); rb.excludeLayers = LayerMask.op_Implicit(~LayerMask.op_Implicit(LethalMin.PikminColideable)); } Pcollider.enabled = true; rb.WakeUp(); break; case 3: ((Behaviour)base.agent).enabled = false; if (((NetworkBehaviour)this).IsOwner) { Pcollider.enabled = true; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; base.updatePositionThreshold = 9000f; base.syncMovementSpeed = 0f; rb.isKinematic = false; rb.useGravity = true; rb.detectCollisions = true; rb.constraints = (RigidbodyConstraints)80; rb.interpolation = (RigidbodyInterpolation)1; rb.collisionDetectionMode = (CollisionDetectionMode)1; Pcollider.excludeLayers = LayerMask.op_Implicit(~LayerMask.op_Implicit(LethalMin.PikminColideable)); rb.excludeLayers = LayerMask.op_Implicit(~LayerMask.op_Implicit(LethalMin.PikminColideable)); rb.WakeUp(); } else { Pcollider.enabled = false; base.moveTowardsDestination = false; base.movingTowardsTargetPlayer = false; base.updatePositionThreshold = 9000f; base.syncMovementSpeed = 0f; rb.isKinematic = true; rb.useGravity = false; rb.detectCollisions = false; rb.constraints = (RigidbodyConstraints)126; rb.interpolation = (RigidbodyInterpolation)0; rb.excludeLayers = LayerMask.op_Implicit(0); rb.Sleep(); } ((Behaviour)transform2).enabled = true; break; } } public void HandleLocalSnapPosition() { //IL_002f: 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_0094: Unknown result type (might be due to invalid IL or missing references) if (currentIntent == PuffminIntent.Held && (Object)(object)Leader != (Object)null) { ((Component)this).transform.position = Leader.HoldPos.position; ((Component)this).transform.rotation = Leader.HoldPos.rotation; } if ((Object)(object)LeaderLatchedTo != (Object)null && LeaderLatchedTo.Controller.isPlayerControlled) { ((Component)this).transform.position = LeaderLatchedTo.PuffminLatchedOn[this].position; ((Component)this).transform.LookAt(((Component)LeaderLatchedTo.Controller.gameplayCamera).transform); } } public void StartThrow() { if ((Object)(object)Leader == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Leader is null when starting throw")); return; } SwitchToIntent(PuffminIntent.Held); SetCollisionMode(0); base.creatureAnimator.SetTrigger("Hold"); base.creatureVoice.PlayOneShot(HoldVoice); } public virtual void ThrowPuffmin(Vector3 Direction) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Leader == (Object)null) { LethalMin.Logger.LogError((object)(DebugID + ": Leader is null when throwing pikmin")); if (currentIntent == PuffminIntent.Held) { SetToIdle(); } return; } if (!OrignalPikmin.HasValue) { LethalMin.Logger.LogError((object)(DebugID + ": OrignalPikmin is null when throwing pikmin")); if (currentIntent == PuffminIntent.Held) { SetToIdle(); } return; } PikminType pikminTypeByID = LethalMin.GetPikminTypeByID(OrignalPikmin.Value.TypeID); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Direction.x * pikminTypeByID.ThrowForce.x, Direction.y * pikminTypeByID.ThrowForce.y, Direction.z * pikminTypeByID.ThrowForce.z); LethalMin.Logger.LogDebug((object)$"{DebugID}: Thrown with force: {val}"); SwitchToIntent(PuffminIntent.Thrown); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); SetCollisionMode(2); rb.position = Leader.ThrowOrigin.position; ((Component)this).transform.position = Leader.ThrowOrigin.position; if (Direction != Vector3.zero) { ((Component)this).transform.rotation = Quaternion.LookRotation(Direction); rb.rotation = Quaternion.LookRotation(Direction); } rb.AddForce(val, (ForceMode)1); base.creatureVoice.Stop(); base.creatureVoice.PlayOneShot(ThrowVoice); base.creatureAnimator.SetTrigger("Throw"); } public void OnCollisionEnter(Collision collision) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner && currentIntent == PuffminIntent.Thrown) { LandPuffminServerRpc(((Component)this).transform.position); LandPuffmin(); LethalMin.Logger.LogInfo((object)(DebugID + ": Landed on " + ((Object)collision.gameObject).name)); } } public void OnCollisionStay(Collision collision) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner && currentIntent == PuffminIntent.Knockback) { if (KnockbackLandBuffer > 0f) { KnockbackLandBuffer -= Time.deltaTime; return; } KnockbackLandBuffer = 0.5f; LandPuffminServerRpc(((Component)this).transform.position); LandPuffmin(); LethalMin.Logger.LogInfo((object)(DebugID + ": Landed on " + ((Object)collision.gameObject).name + " (knockback)")); } } public override void OnCollideWithPlayer(Collider other) { ((EnemyAI)this).OnCollideWithPlayer(other); if (((NetworkBehaviour)this).IsOwner && currentIntent == PuffminIntent.Thrown) { LethalMin.Logger.LogInfo((object)(DebugID + ": OnCollideWithPlayer - Attempting to latch on to player " + ((Object)((Component)other).gameObject).name)); PlayerControllerB val = default(PlayerControllerB); if (((Component)other).TryGetComponent(ref val)) { LethalMin.Logger.LogInfo((object)$"{DebugID}: Found player {((NetworkBehaviour)val).OwnerClientId} to latch on to!"); LatchOnToLeaderServerRpc(((NetworkBehaviour)((Component)val).GetComponent()).OwnerClientId); } LethalMin.Logger.LogInfo((object)(DebugID + ": Landed on " + ((Object)((Component)other).gameObject).name)); } } [ServerRpc] public void LatchOnToLeaderServerRpc(ulong LeaderID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1545598946u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, LeaderID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1545598946u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).OwnerClientId != LeaderID) { ((EnemyAI)this).ChangeOwnershipOfEnemy(LeaderID); } LatchOnToLeaderClientRpc(LeaderID); } } [ClientRpc] public void LatchOnToLeaderClientRpc(ulong LeaderID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4071604013u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, LeaderID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4071604013u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Leader leaderViaID = LethalMin.GetLeaderViaID(LeaderID); if ((Object)(object)leaderViaID == (Object)null) { LethalMin.Logger.LogError((object)$"{DebugID}: Failed to find leader with ID {LeaderID}!"); } else { LatchOnToLeaderOnLocalClient(leaderViaID); } } } public void LatchOnToLeaderOnLocalClient(Leader lead) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0023: 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_0122: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(DebugID + "LatchPoint"); val.transform.position = ((Component)this).transform.position; ((Component)this).transform.LookAt(((Component)lead.Controller.gameplayCamera).transform); val.transform.SetParent(((Component)lead).transform, true); float num = (float)(enemyRandom.NextDouble() * 2.0 - 1.0); float num2 = (float)(enemyRandom.NextDouble() * 3.0 - 1.0); float num3 = (((Object)(object)PikminManager.instance.LocalLeader == (Object)(object)lead) ? 1 : 0); val.transform.localPosition = new Vector3(num, num2, num3); TempObjects.Add(val); lead.PuffminLatchedOn.Add(this, val.transform); SetPuffminAsLatchedOn(lead); LethalMin.Logger.LogDebug((object)$"{DebugID}: Latching on to {((NetworkBehaviour)lead).OwnerClientId} at position: {val.transform.position} with offset X: {num}, Y: {num2}"); } [ServerRpc] public void LandPuffminServerRpc(Vector3 landPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1496792136u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref landPos); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1496792136u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LandPuffminClientRpc(landPos); } } [ClientRpc] public void LandPuffminClientRpc(Vector3 landPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2033783597u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref landPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2033783597u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; transform2.TeleportOnLocalClient(landPos); if (!((NetworkBehaviour)this).IsOwner) { LandPuffmin(); } } } public void LandPuffmin() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) SetToIdle(); base.creatureAnimator.SetTrigger("Land"); if (((NetworkBehaviour)this).IsOwner) { base.agent.Warp(((Component)this).transform.position); } } [ServerRpc] public void ApplyKnockBackServerRpc(Vector3 direction, float force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Invalid comparison between Unknown and I4 //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1416356724u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1416356724u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ApplyKnockBackClientRpc(direction, force); } } [ClientRpc] public void ApplyKnockBackClientRpc(Vector3 direction, float force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(285834999u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 285834999u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ApplyKnockBack(direction, force); } } } public void ApplyKnockBack(Vector3 direction, float force) { //IL_0017: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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) LethalMin.Logger.LogDebug((object)$"{DebugID}: Knockback with force: {force} and direction: {direction}"); SwitchToIntent(PuffminIntent.Knockback); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); base.creatureAnimator.SetTrigger("Knockback"); PlayerChaseing = null; SetCollisionMode(3); UnLatchPuffmin(); RemoveLeader(); StunTimer += 5f; if (((NetworkBehaviour)this).IsOwner) { rb.AddForce(direction * force, (ForceMode)1); rb.rotation = Quaternion.LookRotation(-direction); } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_0045: 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_0082: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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) ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (!IsDeadOrDying) { base.creatureVoice.PlayOneShot(HurtVoice); base.enemyHP -= force; Vector3 direction = default(Vector3); ((Vector3)(ref direction))..ctor((0f - ((Component)this).transform.forward.x) * (float)force, (float)(force * 2), (0f - ((Component)this).transform.forward.z) * (float)force); if ((Object)(object)playerWhoHit != (Object)null) { Vector3 val = ((Component)this).transform.position - ((Component)playerWhoHit).transform.position; ((Vector3)(ref direction))..ctor(((Vector3)(ref val)).normalized.x * 2f, 3f, ((Vector3)(ref val)).normalized.z * 2f); } if (base.enemyHP > 0) { ApplyKnockBack(direction, 3 + force); return; } ApplyKnockBack(direction, force); ((EnemyAI)this).KillEnemy(false); } } public override void KillEnemy(bool destroy = false) { if (destroy && ((NetworkBehaviour)this).IsServer) { LethalMin.Logger.LogInfo((object)(DebugID + ": Died, but due to the way zeekees programmed it we need to do dis first")); SpawnGhostClientRpc(); ((EnemyAI)this).KillEnemy(destroy); } else { ((EnemyAI)this).KillEnemy(destroy); base.creatureVoice.PlayOneShot(HurtVoice); LethalMin.Logger.LogInfo((object)(DebugID + ": Died")); currentIntent = PuffminIntent.Dead; ((MonoBehaviour)this).StartCoroutine(SpawnGhostAfterDelay()); } } [ClientRpc] public void SpawnGhostClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1559446624u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1559446624u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SpawnGhost(); } } } [IteratorStateMachine(typeof(d__75))] private IEnumerator SpawnGhostAfterDelay(float delay = 2f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__75(0) { <>4__this = this, delay = delay }; } public void SpawnGhost() { //IL_004c: 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_008c: 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_00aa: 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_00b3: Unknown result type (might be due to invalid IL or missing references) if ((bool)LethalMin.TurnToNormalOnDeath) { if (((NetworkBehaviour)this).IsServer) { TransformIntoPikminServerRpc(); } return; } LethalMin.Logger.LogInfo((object)(DebugID + ": Spawning Ghost")); PikminGhost component = Object.Instantiate(LethalMin.PikminGhostPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation).GetComponent(); if (OrignalPikmin.HasValue) { Color pikminPrimaryColor = LethalMin.GetPikminTypeByID(OrignalPikmin.Value.TypeID).PikminPrimaryColor; Color val = default(Color); ((Color)(ref val))..ctor(0.42f, 0f, 0.42f); component.overrideColor = Color.Lerp(pikminPrimaryColor, val, 0.5f); } component.LostType = LethalMin.GetPikminTypeByID(OrignalPikmin.HasValue ? OrignalPikmin.Value.TypeID : 0); component.InMemoryof = DebugID; component.ghostRandom = enemyRandom; ((Component)component).GetComponentInChildren().pitch = 0.75f; PikminManager.instance.EndOfGameStats.PikminKilled++; PikminManager.instance.FiredStats.TotalPikminLost++; if (((NetworkBehaviour)this).NetworkObject.IsSpawned) { IncrumentDestoryCountServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void IncrumentDestoryCountServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3513302635u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3513302635u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; destoryCounter++; LethalMin.Logger.LogInfo((object)$"{DebugID}: {destoryCounter} - {StartOfRound.Instance.connectedPlayersAmount + 1}"); if (destoryCounter >= StartOfRound.Instance.connectedPlayersAmount + 1) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } } public PuffminLeader? GetClosestLeader() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return PikUtils.GetClosestInstanceOfClassToPosition(((Component)this).transform.position, 2.5f, (IEnumerable?)PikminManager.instance.PuffminLeaders); } [ServerRpc] public void AssignLeaderServerRpc(NetworkObjectReference LeaderRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_015b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1915778743u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref LeaderRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1915778743u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref LeaderRef)).TryGet(ref val3, (NetworkManager)null) && ((NetworkBehaviour)this).OwnerClientId != val3.OwnerClientId) { ((EnemyAI)this).ChangeOwnershipOfEnemy(val3.OwnerClientId); } AssignLeaderClientRpc(LeaderRef); } } [ClientRpc] public void AssignLeaderClientRpc(NetworkObjectReference LeaderRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1649635575u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref LeaderRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1649635575u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsOwner) { return; } NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref LeaderRef)).TryGet(ref val3, (NetworkManager)null)) { PuffminLeader leader = default(PuffminLeader); if (((Component)val3).TryGetComponent(ref leader)) { AssignLeader(leader); } else { LethalMin.Logger.LogError((object)$"{DebugID}: Failed to get PuffminLeader from {LeaderRef}"); } } else { LethalMin.Logger.LogError((object)$"{DebugID}: Failed to get NetworkObject from {LeaderRef}"); } } public void AssignLeader(PuffminLeader leader) { LethalMin.Logger.LogInfo((object)(DebugID + ": Assigning leader " + ((Object)((Component)leader).gameObject).name)); Leader = leader; leader.AddPuffminToSquad(this); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); SetCollisionMode(1); base.creatureVoice.PlayOneShot(NoticeVoice); } [ServerRpc] public void RemoveLeaderServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(914380161u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 914380161u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RemoveLeaderClientRpc(); } } [ClientRpc] public void RemoveLeaderClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3142113593u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3142113593u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RemoveLeader(); } } } public void RemoveLeader() { Leader?.RemovePuffminFromSquad(this); if ((Object)(object)Leader != (Object)null) { PreviousLeader = Leader; } Leader = null; } public void DoTransformAnimation() { StunTimer = 1.5f; base.creatureAnimator.Play("Spawn"); ((MonoBehaviour)this).StartCoroutine(TweenColors()); } [IteratorStateMachine(typeof(d__87))] private IEnumerator TweenColors() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__87(0) { <>4__this = this }; } [ServerRpc(RequireOwnership = false)] public void TransformIntoPikminServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2581637343u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2581637343u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!OrignalPikmin.HasValue) { LethalMin.Logger.LogError((object)(DebugID + ": OrignalPikmin is null when tranforming!")); ((NetworkBehaviour)this).NetworkObject.Despawn(true); return; } PikminSpawnProps props = new PikminSpawnProps(); props.GrowthStage = OrignalPikmin.Value.GrowthStage; props.OverrideDebugID = OrignalPikmin.Value.DebugName; PikminManager.instance.SpawnPikminOnServer(LethalMin.GetPikminTypeByID(OrignalPikmin.Value.TypeID), ((Component)this).transform.position, ((Component)this).transform.rotation, props); ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } [ClientRpc] public void TransformIntoPikminClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2623718540u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2623718540u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TransformIntoPikmin(); } } } public void TransformIntoPikmin() { } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3301664309u, new RpcReceiveHandler(__rpc_handler_3301664309), "SetPuffminDataClientRpc"); ((NetworkBehaviour)this).__registerRpc(2322496202u, new RpcReceiveHandler(__rpc_handler_2322496202), "SetToIdleServerRpc"); ((NetworkBehaviour)this).__registerRpc(1139558359u, new RpcReceiveHandler(__rpc_handler_1139558359), "SetToIdleClientRpc"); ((NetworkBehaviour)this).__registerRpc(689057634u, new RpcReceiveHandler(__rpc_handler_689057634), "SetToChasePlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(264576174u, new RpcReceiveHandler(__rpc_handler_264576174), "SetToChasePlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(1545598946u, new RpcReceiveHandler(__rpc_handler_1545598946), "LatchOnToLeaderServerRpc"); ((NetworkBehaviour)this).__registerRpc(4071604013u, new RpcReceiveHandler(__rpc_handler_4071604013), "LatchOnToLeaderClientRpc"); ((NetworkBehaviour)this).__registerRpc(1496792136u, new RpcReceiveHandler(__rpc_handler_1496792136), "LandPuffminServerRpc"); ((NetworkBehaviour)this).__registerRpc(2033783597u, new RpcReceiveHandler(__rpc_handler_2033783597), "LandPuffminClientRpc"); ((NetworkBehaviour)this).__registerRpc(1416356724u, new RpcReceiveHandler(__rpc_handler_1416356724), "ApplyKnockBackServerRpc"); ((NetworkBehaviour)this).__registerRpc(285834999u, new RpcReceiveHandler(__rpc_handler_285834999), "ApplyKnockBackClientRpc"); ((NetworkBehaviour)this).__registerRpc(1559446624u, new RpcReceiveHandler(__rpc_handler_1559446624), "SpawnGhostClientRpc"); ((NetworkBehaviour)this).__registerRpc(3513302635u, new RpcReceiveHandler(__rpc_handler_3513302635), "IncrumentDestoryCountServerRpc"); ((NetworkBehaviour)this).__registerRpc(1915778743u, new RpcReceiveHandler(__rpc_handler_1915778743), "AssignLeaderServerRpc"); ((NetworkBehaviour)this).__registerRpc(1649635575u, new RpcReceiveHandler(__rpc_handler_1649635575), "AssignLeaderClientRpc"); ((NetworkBehaviour)this).__registerRpc(914380161u, new RpcReceiveHandler(__rpc_handler_914380161), "RemoveLeaderServerRpc"); ((NetworkBehaviour)this).__registerRpc(3142113593u, new RpcReceiveHandler(__rpc_handler_3142113593), "RemoveLeaderClientRpc"); ((NetworkBehaviour)this).__registerRpc(2581637343u, new RpcReceiveHandler(__rpc_handler_2581637343), "TransformIntoPikminServerRpc"); ((NetworkBehaviour)this).__registerRpc(2623718540u, new RpcReceiveHandler(__rpc_handler_2623718540), "TransformIntoPikminClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3301664309(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) { PikminData puffminDataClientRpc = default(PikminData); ((FastBufferReader)(ref reader)).ReadValueSafe(ref puffminDataClientRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).SetPuffminDataClientRpc(puffminDataClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2322496202(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).SetToIdleServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1139558359(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; ((PuffminAI)(object)target).SetToIdleClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_689057634(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { ulong toChasePlayerServerRpc = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref toChasePlayerServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).SetToChasePlayerServerRpc(toChasePlayerServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_264576174(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong toChasePlayerClientRpc = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref toChasePlayerClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).SetToChasePlayerClientRpc(toChasePlayerClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1545598946(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { ulong leaderID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref leaderID); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).LatchOnToLeaderServerRpc(leaderID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4071604013(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong leaderID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref leaderID); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).LatchOnToLeaderClientRpc(leaderID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1496792136(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 landPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref landPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).LandPuffminServerRpc(landPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2033783597(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 landPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref landPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).LandPuffminClientRpc(landPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1416356724(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); float force = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).ApplyKnockBackServerRpc(direction, force); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_285834999(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); float force = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).ApplyKnockBackClientRpc(direction, force); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1559446624(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; ((PuffminAI)(object)target).SpawnGhostClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3513302635(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; ((PuffminAI)(object)target).IncrumentDestoryCountServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1915778743(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference leaderRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).AssignLeaderServerRpc(leaderRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1649635575(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 leaderRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).AssignLeaderClientRpc(leaderRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_914380161(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminAI)(object)target).RemoveLeaderServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3142113593(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; ((PuffminAI)(object)target).RemoveLeaderClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2581637343(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; ((PuffminAI)(object)target).TransformIntoPikminServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2623718540(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; ((PuffminAI)(object)target).TransformIntoPikminClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PuffminAI"; } } public class PuffminLeader : NetworkBehaviour { [CompilerGenerated] private sealed class d__27 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool Reversed; public PuffminLeader <>4__this; private float 5__1; private float 5__2; private float 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__27(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_009c: 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_0169: 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 = (Reversed ? <>4__this.maxWhistleZoneRadius : <>4__this.minWhistleZoneRadius); 5__2 = (Reversed ? <>4__this.minWhistleZoneRadius : <>4__this.maxWhistleZoneRadius); 5__3 = 0f; ((Component)<>4__this.noticeZone).transform.localScale = new Vector3(5__1, 5__1, 5__1); break; case 1: <>1__state = -1; break; } if (5__3 < <>4__this.tweenDuration) { 5__4 = Mathf.Lerp(5__1, 5__2, 5__3 / <>4__this.tweenDuration); ((Component)<>4__this.noticeZone).transform.localScale = new Vector3(5__4, 5__4, 5__4); 5__3 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } ((Component)<>4__this.noticeZone).transform.localScale = new Vector3(5__2, 5__2, 5__2); <>4__this.whistleZoneTween = null; 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 EnemyAI AI = null; public PuffminAI? PuffminHolding = null; public Transform HoldPos = null; public List PuffminInSquad = new List(); public PuffminNoticeZone noticeZone = null; public AudioSource WhistleAudioSource = null; public AudioClip WhistleClip = null; public Transform ThrowOrigin = null; public bool lastOutsideValue = false; public bool IsWhistleing = false; private float tweenDuration = 1.5f; public float minWhistleZoneRadius = 1f; public float maxWhistleZoneRadius = 15f; public bool UseOverrideThrowDirection = false; public Vector3 OverrideThrowDirection = Vector3.zero; private Coroutine whistleZoneTween = null; public void Start() { if ((Object)(object)AI == (Object)null) { AI = ((Component)this).GetComponent(); } lastOutsideValue = AI.isOutside; PikminManager.instance.PuffminLeaders.Add(this); } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkDespawn(); PikminManager.instance.PuffminLeaders.Remove(this); } public void Update() { if (((NetworkBehaviour)this).IsOwner && PuffminInSquad.Count > 0 && lastOutsideValue != AI.isOutside) { lastOutsideValue = AI.isOutside; SetPuffminToEntranceServerRpc(AI.isOutside); } } public void StartWhistleing() { if (!((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": AIFunc 'StartWhistleing' called by non-owner client!")); return; } StartWhistleingOnLocalClient(); if (((NetworkBehaviour)this).IsServer) { StartWhistleingClientRpc(); } else { StartWhistleingServerRpc(); } } [ServerRpc] private void StartWhistleingServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(558410607u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 558410607u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StartWhistleingClientRpc(); } } [ClientRpc] private void StartWhistleingClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1238810668u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1238810668u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { StartWhistleingOnLocalClient(); } } } public void StartWhistleingOnLocalClient() { if (whistleZoneTween != null) { ((MonoBehaviour)this).StopCoroutine(whistleZoneTween); whistleZoneTween = null; } ((Component)noticeZone).gameObject.SetActive(true); whistleZoneTween = ((MonoBehaviour)this).StartCoroutine(TweenSize()); WhistleAudioSource.PlayOneShot(WhistleClip); IsWhistleing = true; LethalMin.Logger.LogDebug((object)(((Object)((Component)this).gameObject).name + ": Started Whistleing")); } public void StopWhistleing() { if (!((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": AIFunc 'StopWhistleing' called by non-owner client!")); return; } StopWhistleingOnLocalClient(); if (((NetworkBehaviour)this).IsServer) { StopWhistleingClientRpc(); } else { StopWhistleingServerRpc(); } } [ServerRpc] private void StopWhistleingServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3170913972u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3170913972u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StopWhistleingClientRpc(); } } [ClientRpc] private void StopWhistleingClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2261414631u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2261414631u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { StopWhistleingOnLocalClient(); } } } public void StopWhistleingOnLocalClient() { if (whistleZoneTween != null) { ((MonoBehaviour)this).StopCoroutine(whistleZoneTween); whistleZoneTween = null; } ((Component)noticeZone).gameObject.SetActive(false); IsWhistleing = false; LethalMin.Logger.LogDebug((object)(((Object)((Component)this).gameObject).name + ": Stopped Whistleing")); } [IteratorStateMachine(typeof(d__27))] public IEnumerator TweenSize(bool Reversed = false) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__27(0) { <>4__this = this, Reversed = Reversed }; } public void StartThrow() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": AIFunc 'StartThrow' called by non-owner client!")); return; } if (PuffminInSquad.Count == 0) { LethalMin.Logger.LogWarning((object)(((Object)((Component)this).gameObject).name + ": AIFunc 'StartThrow' called with no puffmin in squad!")); return; } PuffminAI closestInstanceOfClassToPosition = PikUtils.GetClosestInstanceOfClassToPosition(((Component)this).transform.position, float.PositiveInfinity, (IEnumerable?)PuffminInSquad); if ((Object)(object)closestInstanceOfClassToPosition == (Object)null) { LethalMin.Logger.LogWarning((object)(((Object)((Component)this).gameObject).name + ": AIFunc 'StartThrow' called with no puffmin in squad!")); return; } StartThrowOnLocalClient(closestInstanceOfClassToPosition); if (((NetworkBehaviour)this).IsServer) { StartThrowClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)closestInstanceOfClassToPosition).NetworkObject)); } else { StartThrowServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)closestInstanceOfClassToPosition).NetworkObject)); } } [ServerRpc] private void StartThrowServerRpc(NetworkObjectReference PuffRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3916899212u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PuffRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3916899212u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StartThrowClientRpc(PuffRef); } } [ClientRpc] private void StartThrowClientRpc(NetworkObjectReference PuffRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(323381104u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref PuffRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 323381104u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { NetworkObject val3 = default(NetworkObject); PuffminAI closestPuffmin = default(PuffminAI); if (!((NetworkObjectReference)(ref PuffRef)).TryGet(ref val3, (NetworkManager)null)) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": AIFunc 'StartThrow' called with invalid puffmin reference!")); } else if (!((Component)val3).TryGetComponent(ref closestPuffmin)) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": AIFunc 'StartThrow' called with invalid puffmin script!")); } else { StartThrowOnLocalClient(closestPuffmin); } } } private void StartThrowOnLocalClient(PuffminAI ClosestPuffmin) { PuffminHolding = ClosestPuffmin; ClosestPuffmin.StartThrow(); LethalMin.Logger.LogDebug((object)(((Object)((Component)this).gameObject).name + ": Started Throw")); } public void DoThrow() { //IL_007f: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner) { LethalMin.Logger.LogError((object)(((Object)((Component)this).gameObject).name + ": AIFunc 'DoThrow' called by non-owner client!")); return; } if ((Object)(object)PuffminHolding == (Object)null) { LethalMin.Logger.LogWarning((object)(((Object)((Component)this).gameObject).name + ": AIFunc 'DoThrow' called with no puffmin in hand!")); return; } Vector3 direction = (UseOverrideThrowDirection ? OverrideThrowDirection : ((Component)HoldPos).transform.forward); DoThrowOnLocalClient(direction); if (((NetworkBehaviour)this).IsServer) { DoThrowClientRpc(direction); } else { DoThrowServerRpc(direction); } } [ServerRpc] private void DoThrowServerRpc(Vector3 Direction) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2614546125u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Direction); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2614546125u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DoThrowClientRpc(Direction); } } [ClientRpc] private void DoThrowClientRpc(Vector3 Direction) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1443259171u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Direction); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1443259171u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { DoThrowOnLocalClient(Direction); } } } private void DoThrowOnLocalClient(Vector3 Direction) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)PuffminHolding == (Object)null) { LethalMin.Logger.LogWarning((object)(((Object)((Component)this).gameObject).name + ": AIFunc 'DoThrow' called with no puffmin in hand!")); return; } PuffminHolding.ThrowPuffmin(Direction); PuffminHolding.RemoveLeader(); PuffminHolding.WhistleBuffer = 3f; PuffminHolding = null; LethalMin.Logger.LogDebug((object)(((Object)((Component)this).gameObject).name + ": did throw")); } public void AddPuffminToSquad(PuffminAI puffmin) { PuffminInSquad.Add(puffmin); } public void RemovePuffminFromSquad(PuffminAI puffmin) { PuffminInSquad.Remove(puffmin); } [ServerRpc] public void SetPuffminToEntranceServerRpc(bool isOutside) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3652979915u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isOutside, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3652979915u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetPuffminToEntranceClientRpc(isOutside); } } [ClientRpc] public void SetPuffminToEntranceClientRpc(bool isOutside) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3463662432u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isOutside, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3463662432u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetPuffminToEntrance(isOutside); } } } public void SetPuffminToEntrance(bool isOutside) { //IL_0085: 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_006d: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogInfo((object)$"{((Object)((Component)this).gameObject).name}: Setting {PuffminInSquad.Count} puffmin to entrance: {isOutside}"); foreach (PuffminAI item in PuffminInSquad) { ((EnemyAI)item).isOutside = isOutside; if (((NetworkBehaviour)this).IsOwner) { ((EnemyAI)item).agent.Warp(((Component)this).transform.position); } item.transform2.TeleportOnLocalClient(((Component)this).transform.position, ((Component)this).transform.rotation); } } 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 //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(558410607u, new RpcReceiveHandler(__rpc_handler_558410607), "StartWhistleingServerRpc"); ((NetworkBehaviour)this).__registerRpc(1238810668u, new RpcReceiveHandler(__rpc_handler_1238810668), "StartWhistleingClientRpc"); ((NetworkBehaviour)this).__registerRpc(3170913972u, new RpcReceiveHandler(__rpc_handler_3170913972), "StopWhistleingServerRpc"); ((NetworkBehaviour)this).__registerRpc(2261414631u, new RpcReceiveHandler(__rpc_handler_2261414631), "StopWhistleingClientRpc"); ((NetworkBehaviour)this).__registerRpc(3916899212u, new RpcReceiveHandler(__rpc_handler_3916899212), "StartThrowServerRpc"); ((NetworkBehaviour)this).__registerRpc(323381104u, new RpcReceiveHandler(__rpc_handler_323381104), "StartThrowClientRpc"); ((NetworkBehaviour)this).__registerRpc(2614546125u, new RpcReceiveHandler(__rpc_handler_2614546125), "DoThrowServerRpc"); ((NetworkBehaviour)this).__registerRpc(1443259171u, new RpcReceiveHandler(__rpc_handler_1443259171), "DoThrowClientRpc"); ((NetworkBehaviour)this).__registerRpc(3652979915u, new RpcReceiveHandler(__rpc_handler_3652979915), "SetPuffminToEntranceServerRpc"); ((NetworkBehaviour)this).__registerRpc(3463662432u, new RpcReceiveHandler(__rpc_handler_3463662432), "SetPuffminToEntranceClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_558410607(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminLeader)(object)target).StartWhistleingServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1238810668(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; ((PuffminLeader)(object)target).StartWhistleingClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3170913972(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminLeader)(object)target).StopWhistleingServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2261414631(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; ((PuffminLeader)(object)target).StopWhistleingClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3916899212(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference puffRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref puffRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminLeader)(object)target).StartThrowServerRpc(puffRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_323381104(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 puffRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref puffRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminLeader)(object)target).StartThrowClientRpc(puffRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2614546125(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminLeader)(object)target).DoThrowServerRpc(direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1443259171(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminLeader)(object)target).DoThrowClientRpc(direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3652979915(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { bool puffminToEntranceServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref puffminToEntranceServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminLeader)(object)target).SetPuffminToEntranceServerRpc(puffminToEntranceServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3463662432(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 puffminToEntranceClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref puffminToEntranceClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PuffminLeader)(object)target).SetPuffminToEntranceClientRpc(puffminToEntranceClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PuffminLeader"; } } public class PuffminNoticeZone : MonoBehaviour { public bool Active = true; public PuffminLeader LeaderScript = null; public GameObject Visualizer = null; public void OnTriggerEnter(Collider other) { if (Active && ((NetworkBehaviour)LeaderScript).IsOwner && Object.op_Implicit((Object)(object)LeaderScript) && !LeaderScript.AI.isEnemyDead && !HandlePuffminInZone(other) && !HandlePikminInZone(other)) { } } public bool HandlePuffminInZone(Collider other) { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) EnemyAICollisionDetect val = default(EnemyAICollisionDetect); if (((Component)other).CompareTag("Enemy") && ((Component)other).TryGetComponent(ref val) && (Object)(object)val.mainScript != (Object)null) { PuffminAI puffminAI = default(PuffminAI); if (!((Component)val.mainScript).TryGetComponent(ref puffminAI)) { return false; } if (puffminAI.IsDeadOrDying) { return false; } if (((EnemyAI)puffminAI).currentBehaviourStateIndex == 1) { return false; } if ((Object)(object)puffminAI.Leader == (Object)(object)LeaderScript) { return false; } if ((Object)(object)puffminAI.Leader != (Object)null) { return false; } if (puffminAI.IsAirborn) { return false; } if (puffminAI.WhistleBuffer > 0f) { return false; } puffminAI.AssignLeader(LeaderScript); puffminAI.AssignLeaderServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)LeaderScript).NetworkObject)); LethalMin.Logger.LogDebug((object)"Puffmin has entered the evil zone"); return true; } return false; } public bool HandlePikminInZone(Collider other) { PikminCollisionDetect pikminCollisionDetect = default(PikminCollisionDetect); if (((Component)other).CompareTag("Enemy") && ((Component)other).TryGetComponent(ref pikminCollisionDetect) && (Object)(object)pikminCollisionDetect.mainPikmin != (Object)null) { if ((Object)(object)pikminCollisionDetect.mainPikmin.leader != (Object)null) { return false; } if (pikminCollisionDetect.mainPikmin.IsAirborn) { return false; } if (((EnemyAI)pikminCollisionDetect.mainPikmin).currentBehaviourStateIndex == 4) { return false; } if (((EnemyAI)pikminCollisionDetect.mainPikmin).currentBehaviourStateIndex == 5) { return false; } if (pikminCollisionDetect.mainPikmin.IsDeadOrDying) { return false; } if (PikChecks.IsPikminResistantToHazard(pikminCollisionDetect.mainPikmin, PikminHazard.Spore, (Object)(object)this)) { return false; } pikminCollisionDetect.mainPikmin.TransformIntoPuffminServerRpc(); LethalMin.Logger.LogDebug((object)"Pikmin has entered the evil zone"); return true; } return false; } } public class PurplePikminAI : PikminAI { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PurplePikminAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(<>4__this.SlamDelay); <>1__state = 1; return true; case 1: <>1__state = -1; if (<>4__this.CurrentIntention == Pintent.Thrown) { if ((Object)(object)<>4__this.SlamSound != (Object)null) { <>4__this.PlayAudioOnLocalClient(PikminSoundPackSounds.Attack); ((EnemyAI)<>4__this).creatureSFX.PlayOneShot(<>4__this.SlamSound); } <>4__this.SlamDown(); <>4__this.PlayAnimation(<>4__this.animController.AnimPack.EditorStandingAttackAnim); } <>4__this.slamRoutine = null; 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 AudioClip LandSound = null; public AudioClip SlamSound = null; public float SlamDelay = 0.3f; [Range(10f, 50f)] public float SlamForce = 30f; private Coroutine? slamRoutine = null; private bool IsInSlam = false; public override void Start() { base.Start(); trajectoryModifier = new PurplePikminTrajectoryModifier(); } public override void ThrowPikmin(Vector3 Direction) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) base.ThrowPikmin(Direction); if (slamRoutine == null) { slamRoutine = ((MonoBehaviour)this).StartCoroutine(SlamAfterDelay()); } } [IteratorStateMachine(typeof(d__8))] private IEnumerator SlamAfterDelay() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } public void SlamDown() { //IL_0021: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (CurrentIntention == Pintent.Thrown) { rb.velocity = new Vector3(0f, rb.velocity.y, 0f); rb.AddForce(Vector3.down * SlamForce, (ForceMode)1); IsInSlam = true; } } public override void LandPikmin() { base.LandPikmin(); if (IsInSlam) { DoSlam(); } IsInSlam = false; if (slamRoutine != null) { ((MonoBehaviour)this).StopCoroutine(slamRoutine); slamRoutine = null; } } public void DoSlam() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).creatureSFX.PlayOneShot(LandSound); WalkieTalkie.TransmitOneShotAudio(((EnemyAI)this).creatureSFX, LandSound, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 10f, 0.5f, 0, false, 0); PikUtils.ShakeNearbyPlayers((ScreenShakeType)1, ((Component)this).transform.position, 10f); PikUtils.StunNearbyEnemies(((Component)this).transform.position, 10f, 1f); } public override void LandPikminOnEnemy(Collider hitbox, PikminLatchTrigger latchTrigger, PikminEnemy enemy) { //IL_003a: 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) base.LandPikminOnEnemy(hitbox, latchTrigger, enemy); if (!((Object)(object)CurrentLatchTrigger == (Object)null)) { ((EnemyAI)this).creatureSFX.PlayOneShot(LandSound); PikUtils.ShakeNearbyPlayers((ScreenShakeType)1, ((Component)this).transform.position, 10f); enemy.enemyScript.SetEnemyStunned(true, 1f, (PlayerControllerB)null); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 10f, 0.5f, 0, false, 0); IsInSlam = false; if (slamRoutine != null) { ((MonoBehaviour)this).StopCoroutine(slamRoutine); slamRoutine = null; } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PurplePikminAI"; } } public class PurplePikminTrajectoryModifier : ITrajectoryModifier { public bool CanModify(PikminAI pikminAI) { return pikminAI is PurplePikminAI; } public void ModifyTrajectory(ref Vector3[] points, PikminAI aiModifying, int pointCount, float timeIncrement, out RaycastHit finalhit) { //IL_000a: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0180: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) PurplePikminAI purplePikminAI = aiModifying as PurplePikminAI; finalhit = default(RaycastHit); List list = new List(points); if ((Object)(object)purplePikminAI == (Object)null) { LethalMin.Logger.LogError((object)"PurplePikminTrajectoryModifier: The provided PikminAI is not a PurplePikminAI."); return; } float slamDelay = purplePikminAI.SlamDelay; int num = Mathf.FloorToInt(slamDelay / timeIncrement); if (num >= pointCount || num < 1) { return; } bool flag = false; int num2 = pointCount - 1; Vector3 val2 = default(Vector3); RaycastHit val4 = default(RaycastHit); for (int i = num; i < pointCount; i++) { Vector3 val = list[num]; float num3 = (float)(i - num) * timeIncrement; float num4 = (0f - purplePikminAI.SlamForce) / purplePikminAI.rb.mass; float num5 = num4 * num3 + 0.5f * Physics.gravity.y * num3 * num3; ((Vector3)(ref val2))..ctor(val.x, val.y + num5, val.z); if (i > num) { Vector3 val3 = val2 - list[i - 1]; Vector3 normalized = ((Vector3)(ref val3)).normalized; float num6 = Vector3.Distance(list[i - 1], val2) * 1.1f; if (Physics.Raycast(list[i - 1], normalized, ref val4, num6, LayerMask.op_Implicit(LethalMin.PikminColideable), (QueryTriggerInteraction)1) && !((RaycastHit)(ref val4)).collider.isTrigger) { list[i] = ((RaycastHit)(ref val4)).point; finalhit = val4; flag = true; num2 = i; break; } } list[i] = val2; } if (!flag) { return; } for (int j = 0; j < pointCount; j++) { if (j > num2) { points[j] = list[num2]; } else { points[j] = list[j]; } } } } public class RockPikminAI : PikminAI { [CompilerGenerated] private sealed class d__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public RockPikminAI <>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__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = (float)<>4__this.enemyRandom.NextDouble(); <>2__current = (object)new WaitForSeconds(5__1 * 2f); <>1__state = 1; return true; case 1: <>1__state = -1; if (!<>4__this.Stunned) { return false; } <>4__this.PlayAnimation(<>4__this.animController.AnimPack.EditorGetUpAnim); <>4__this.PlayAudioOnLocalClient(PikminSoundPackSounds.GetUp); <>4__this.Stunned = false; LethalMin.Logger.LogInfo((object)(((Object)((Component)<>4__this).gameObject).name + " is now getting up after bouncing.")); 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__25 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public RockPikminAI <>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__25(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0096: 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 = (float)<>4__this.enemyRandom.NextDouble(); <>2__current = (object)new WaitForSeconds(5__1 * (float)<>4__this.enemyRandom.Next(7) + 5f); <>1__state = 1; return true; case 1: <>1__state = -1; if (!<>4__this.IsEmbeded) { return false; } ((Component)<>4__this.modelContainer).transform.localPosition = Vector3.zero; <>4__this.SetToIdle(); <>4__this.PlayAnimation(<>4__this.animController.AnimPack.EditorNoticeAnim); <>4__this.PlayAudioOnLocalClient(PikminSoundPackSounds.GetUp); if (((NetworkBehaviour)<>4__this).IsOwner) { ((Behaviour)((EnemyAI)<>4__this).agent).enabled = true; } if ((Object)(object)<>4__this.leaderBeforeEmbed != (Object)null && <>4__this.leaderBeforeEmbed.Controller.isPlayerControlled) { <>4__this.AssignLeader(<>4__this.leaderBeforeEmbed, SwitchState: true, PlayAnim: false); <>4__this.leaderBeforeEmbed = null; } <>4__this.IsEmbeded = false; LethalMin.Logger.LogInfo((object)(((Object)((Component)<>4__this).gameObject).name + " has unembedded from the ground.")); 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 AudioClip[] bounceSounds = (AudioClip[])(object)new AudioClip[0]; private Leader? leaderBeforeEmbed = null; private bool hasBounced = false; private bool IsEmbeded = false; private bool Stunned = false; private bool SelfThrown = false; public override void Update() { base.Update(); if (((NetworkBehaviour)this).IsOwner && Stunned) { ((EnemyAI)this).agent.speed = 0f; } } public override PikminEnemy? GetClosestEnemy(float overrideDetectionRadius = -1f) { PikminEnemy closestEnemy = base.GetClosestEnemy(overrideDetectionRadius); if ((Object)(object)closestEnemy == (Object)null || (Object)(object)((Component)closestEnemy).GetComponentInChildren() == (Object)null) { return null; } return closestEnemy; } public override void AttackEnemyWhenNear() { //IL_004d: 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_00ab: 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_00bb: 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_00c3: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)TargetEnemy == (Object)null) && !Stunned && !IsEmbeded && !hasBounced && ((Behaviour)((EnemyAI)this).agent).enabled && Vector3.Distance(((Component)this).transform.position, ((Component)TargetEnemy).transform.position) < 5f + TargetEnemy.enemyScript.agent.radius + ((EnemyAI)this).agent.radius) { SelfThrown = true; Vector3 val = ((Component)TargetEnemy).transform.position - ((Component)this).transform.position; DoJumpOnLocalClient(((Vector3)(ref val)).normalized); } } public override void OnCollisionEnter(Collision collision) { if (!((NetworkBehaviour)this).IsOwner || CurrentIntention != Pintent.Thrown || ((EnemyAI)this).currentBehaviourStateIndex == 3) { return; } if (hasBounced) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " has already bounced, not bouncing again on collision with OBJ:" + ((Object)collision.gameObject).name + ".")); base.OnCollisionEnter(collision); return; } PikminLatchTrigger component = collision.gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { BounceOffObject(collision); } else { base.OnCollisionEnter(collision); } } public override void OnCollideWithEnemy(Collider other, EnemyAI collidedEnemy = null) { //IL_00db: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner || CurrentIntention != Pintent.Thrown) { return; } if (hasBounced) { LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " has already bounced, not bouncing again on collision with ENY:" + ((Object)((Component)collidedEnemy).gameObject).name + ".")); } else if ((Object)(object)collidedEnemy != (Object)null && (Object)(object)collidedEnemy.enemyType != (Object)(object)((EnemyAI)this).enemyType && !collidedEnemy.isEnemyDead) { BounceOffObject(other, DontExitCurrentState: true); PikminEnemy componentInChildren = ((Component)collidedEnemy).GetComponentInChildren(); if (!((Object)(object)componentInChildren == (Object)null)) { float damage = ((!SelfThrown) ? 0.1f : pikminType.GetAttackStrength(CurrentGrowthStage)); componentInChildren.HitEnemyServerRpc(damage, NetworkObjectReference.op_Implicit(((NetworkBehaviour)this).NetworkObject)); } } } [ServerRpc] public void ApplyKnockBackNoResetServerRpc(Vector3 direction, float force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Invalid comparison between Unknown and I4 //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3602542698u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3602542698u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ApplyKnockBackNoResetClientRpc(direction, force); } } [ClientRpc] public void ApplyKnockBackNoResetClientRpc(Vector3 direction, float force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3822677456u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3822677456u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ApplyKnockBackNoReset(direction, force); } } } public void ApplyKnockBackNoReset(Vector3 direction, float force) { //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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) StopThrow(PlayAnim: false); SetCollisionMode(3); ChangeIntent(Pintent.Knockedback); PlayAnimation(animController.AnimPack.EditorKnockbackAnim); PlayAudioOnLocalClient(PikminSoundPackSounds.Knockback); if (((NetworkBehaviour)this).IsOwner) { rb.rotation = Quaternion.LookRotation(-direction); rb.AddForce(direction * force, (ForceMode)1); } } [ServerRpc] public void DoBounceServerRpc(Vector3 bounceDirection, float bounceForce, bool DontExitCurrentState = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Invalid comparison between Unknown and I4 //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1111149224u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref bounceDirection); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref bounceForce, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref DontExitCurrentState, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1111149224u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DoBounceClientRpc(bounceDirection, bounceForce, DontExitCurrentState); } } [ClientRpc] private void DoBounceClientRpc(Vector3 bounceDirection, float bounceForce, bool DontExitCurrentState = false) { //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_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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2721426014u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref bounceDirection); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref bounceForce, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref DontExitCurrentState, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2721426014u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { DoBounce(bounceDirection, bounceForce, DontExitCurrentState); } } } private void DoBounce(Vector3 bounceDirection, float bounceForce, bool DontExitCurrentState = false) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) if (!hasBounced) { bounceDirection += Vector3.up * 0.5f; ((Vector3)(ref bounceDirection)).Normalize(); if (DontExitCurrentState) { ApplyKnockBackNoReset(bounceDirection, bounceForce); PlayAudioOnLocalClient(PikminSoundPackSounds.HitSFX, PlayOnVoice: false); } else { ApplyKnockBack(bounceDirection, bounceForce); } if (((NetworkBehaviour)this).IsOwner) { hasBounced = true; Stunned = true; } if (bounceSounds.Length != 0) { ((EnemyAI)this).creatureSFX.PlayOneShot(bounceSounds[Random.Range(0, bounceSounds.Length)], 1f); } LethalMin.Logger.LogInfo((object)$"{((Object)((Component)this).gameObject).name} bounced with velocity {rb.velocity} in direction {bounceDirection}. Bounce force: {bounceForce}"); } } public void BounceOffObject(Collision collision, bool DontExitCurrentState = false) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0030: Unknown result type (might be due to invalid IL or missing references) if (!hasBounced) { Vector3 normal = ((ContactPoint)(ref collision.contacts[0])).normal; float bounceForce = 7f; DoBounce(normal, bounceForce, DontExitCurrentState); DoBounceServerRpc(normal, bounceForce, DontExitCurrentState); } } public void BounceOffObject(Collider other, bool DontExitCurrentState = false) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_003a: Unknown result type (might be due to invalid IL or missing references) if (!hasBounced) { Vector3 bounceDirection = ((Component)this).transform.position - ((Component)other).transform.position; float bounceForce = 7f; DoBounce(bounceDirection, bounceForce, DontExitCurrentState); DoBounceServerRpc(bounceDirection, bounceForce, DontExitCurrentState); } } public override void LandPikmin() { LethalMin.Logger.LogDebug((object)$"{((Object)((Component)this).gameObject).name} is landing after bouncing. HasBounced: {hasBounced}, IsDeadOrDying: {base.IsDeadOrDying}"); SelfThrown = false; if (hasBounced && !base.IsDeadOrDying) { ((MonoBehaviour)this).StartCoroutine(WaitToGetUp()); hasBounced = false; animController.PlayLandAnim(); SetCollisionMode(1); if (CurrentIntention != Pintent.Attack) { SetToIdle(); LethalMin.Logger.LogDebug((object)(((Object)((Component)this).gameObject).name + " is now idle after landing, not in attack state.")); } } else { base.LandPikmin(); } } [IteratorStateMachine(typeof(d__20))] private IEnumerator WaitToGetUp() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { <>4__this = this }; } public override void OnAvoidHazard(PikminHazard hazard, Object? instance = null) { //IL_00c3: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) base.OnAvoidHazard(hazard, instance); if (hazard == PikminHazard.Crush && !IsEmbeded && ((NetworkBehaviour)this).IsOwner) { ManualLogSource logger = LethalMin.Logger; Leader? obj = leader; string arg = ((obj != null) ? ((Object)((Component)obj).gameObject).name : null); Leader? obj2 = leader; logger.LogInfo((object)$"Avoided spike trap: leader ({arg})-[{((obj2 != null) ? new ulong?(((NetworkBehaviour)obj2).OwnerClientId) : null)}]"); EmbedIntoGroundServerRpc(((Object)(object)leader == (Object)null) ? 9999999999uL : ((NetworkBehaviour)leader).OwnerClientId); } if (hazard == PikminHazard.Bullet && ((NetworkBehaviour)this).IsOwner) { Vector3 val = ((instance != (Object)null) ? ((GameObject)instance).transform.position : Vector3.zero); Vector3 val2 = ((Component)this).transform.position - val; Vector3 normalized = ((Vector3)(ref val2)).normalized; ApplyKnockBackServerRpc(normalized, 4f); } } [ServerRpc] public void EmbedIntoGroundServerRpc(ulong PrevLeaderID = 9999999999uL) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2092889145u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, PrevLeaderID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2092889145u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EmbedIntoGroundClientRpc(PrevLeaderID); } } [ClientRpc] private void EmbedIntoGroundClientRpc(ulong PrevLeaderID = 9999999999uL) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(853968414u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, PrevLeaderID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 853968414u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (Object.op_Implicit((Object)(object)LethalMin.GetLeaderViaID(PrevLeaderID))) { leaderBeforeEmbed = LethalMin.GetLeaderViaID(PrevLeaderID); ManualLogSource logger = LethalMin.Logger; string name = ((Object)((Component)this).gameObject).name; Leader? obj = leaderBeforeEmbed; logger.LogInfo((object)(name + " embedding into ground, previous leader: " + ((obj != null) ? ((Object)((Component)obj).gameObject).name : null))); } EmbedIntoGround(); } } public void EmbedIntoGround() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (!IsEmbeded) { ((Component)modelContainer).transform.localPosition = new Vector3(0f, -1.25f, 0f); CallResetMethods(); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); ChangeIntent(Pintent.Stuck); ((MonoBehaviour)this).StartCoroutine(WaitToUnembed()); IsEmbeded = true; ((Behaviour)((EnemyAI)this).agent).enabled = false; LethalMin.Logger.LogInfo((object)(((Object)((Component)this).gameObject).name + " has embedded into the ground.")); } } [IteratorStateMachine(typeof(d__25))] private IEnumerator WaitToUnembed() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__25(0) { <>4__this = this }; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3602542698u, new RpcReceiveHandler(__rpc_handler_3602542698), "ApplyKnockBackNoResetServerRpc"); ((NetworkBehaviour)this).__registerRpc(3822677456u, new RpcReceiveHandler(__rpc_handler_3822677456), "ApplyKnockBackNoResetClientRpc"); ((NetworkBehaviour)this).__registerRpc(1111149224u, new RpcReceiveHandler(__rpc_handler_1111149224), "DoBounceServerRpc"); ((NetworkBehaviour)this).__registerRpc(2721426014u, new RpcReceiveHandler(__rpc_handler_2721426014), "DoBounceClientRpc"); ((NetworkBehaviour)this).__registerRpc(2092889145u, new RpcReceiveHandler(__rpc_handler_2092889145), "EmbedIntoGroundServerRpc"); ((NetworkBehaviour)this).__registerRpc(853968414u, new RpcReceiveHandler(__rpc_handler_853968414), "EmbedIntoGroundClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3602542698(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); float force = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RockPikminAI)(object)target).ApplyKnockBackNoResetServerRpc(direction, force); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3822677456(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); float force = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RockPikminAI)(object)target).ApplyKnockBackNoResetClientRpc(direction, force); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1111149224(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } Vector3 bounceDirection = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref bounceDirection); float bounceForce = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref bounceForce, default(ForPrimitives)); bool dontExitCurrentState = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dontExitCurrentState, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RockPikminAI)(object)target).DoBounceServerRpc(bounceDirection, bounceForce, dontExitCurrentState); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_2721426014(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_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_0077: 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) { Vector3 bounceDirection = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref bounceDirection); float bounceForce = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref bounceForce, default(ForPrimitives)); bool dontExitCurrentState = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dontExitCurrentState, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RockPikminAI)(object)target).DoBounceClientRpc(bounceDirection, bounceForce, dontExitCurrentState); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2092889145(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { ulong prevLeaderID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref prevLeaderID); target.__rpc_exec_stage = (__RpcExecStage)1; ((RockPikminAI)(object)target).EmbedIntoGroundServerRpc(prevLeaderID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_853968414(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong prevLeaderID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref prevLeaderID); target.__rpc_exec_stage = (__RpcExecStage)1; ((RockPikminAI)(object)target).EmbedIntoGroundClientRpc(prevLeaderID); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "RockPikminAI"; } } public static class SaveManager { internal static ES3Settings settings; static SaveManager() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown settings = new ES3Settings((string)null, (ES3Settings)null); settings.path = GameNetworkManager.Instance.currentSaveFileName + "_LethalMinSave"; } public static void Save(string key, T value) { if (LethalMin.UseModDataLib) { MODDATLIB_Save(key, value); } else { ES3.Save(key, value, settings); } } private static void MODDATLIB_Save(string key, T value) { SaveLoadHandler.SaveData(value, key, (SaveLocation)0, true); } public static T Load(string key) { if (LethalMin.UseModDataLib) { return MODDATLIB_Load(key); } return ES3.Load(key, settings); } public static T Load(string key, T defaultValue) { if (LethalMin.UseModDataLib) { return MODDATLIB_Load(key, defaultValue); } return ES3.Load(key, defaultValue, settings); } private static T MODDATLIB_Load(string key, T defaultValue) { T val = SaveLoadHandler.LoadData(key, (SaveLocation)0, defaultValue, true); if (val == null) { Debug.LogWarning((object)("Failed to load key '" + key + "' from MODDATLIB. Returning default value.")); return defaultValue; } return val; } private static T MODDATLIB_Load(string key) { return SaveLoadHandler.LoadData(key, (SaveLocation)0, default(T), true); } public static void DeleteFile() { if (LethalMin.UseModDataLib) { MODDATLIB_Delete(); } else if (ES3.FileExists(settings)) { ES3.DeleteFile(settings); } } private static void MODDATLIB_Delete() { string currentSaveFileName = ModDataHelper.GetCurrentSaveFileName(); currentSaveFileName += ".moddata"; if (!ES3.FileExists(currentSaveFileName)) { return; } string[] keys = ES3.GetKeys(currentSaveFileName); string[] array = keys; foreach (string text in array) { if (text.StartsWith("NoteBoxz.LethalMin.")) { ES3.DeleteKey(text, currentSaveFileName); } } Debug.Log((object)("Removed LethalMin keys from save file: " + currentSaveFileName)); } public static bool KeyExists(string key) { if (LethalMin.UseModDataLib) { return MODDATLIB_KeyExists(key); } return ES3.KeyExists(key, settings); } private static bool MODDATLIB_KeyExists(string key) { string currentSaveFileName = ModDataHelper.GetCurrentSaveFileName(); currentSaveFileName += ".moddata"; key = "NoteBoxz.LethalMin." + key; return ES3.KeyExists(key, currentSaveFileName); } } public class ShipOnion : Onion { public Animator BeamAnim = null; public InteractTrigger IntTrigger = null; public StartOfRound playerManager = null; public override void Start() { DontChooseRandomType = true; DontDespawnOnGameEnd = true; playerManager = StartOfRound.Instance; base.Start(); AllClimbLinks = ((Component)this).GetComponentsInChildren().ToList(); } public void OnBeamInteract(PlayerControllerB controller) { //IL_0044: 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) OnionHUDManager.instance.SetCurrentOnion(this); OnionHUDManager.instance.OpenMenu(); ClimbLinks[0].AnimSpeedMultiplier = 3f; NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)ClimbLinks[0].EndPoint).transform.position, ref val, 100f, -1)) { ((Component)ClimbLinks[0].EndPoint).transform.position = ((NavMeshHit)(ref val)).position; } } public override void Update() { base.Update(); if (playerManager.inShipPhase || playerManager.shipIsLeaving || !PikminManager.CanPathOnMoonGlobal || !playerManager.shipHasLanded) { ((Component)IntTrigger).gameObject.SetActive(false); BeamAnim.SetBool("Active", false); } else { ((Component)IntTrigger).gameObject.SetActive(true); BeamAnim.SetBool("Active", true); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ShipOnion"; } } public class ShipPhaseOnionContainer : MonoBehaviour, IGenerationSwitchable { public class ShipPhaseOnion { public GameObject Instance = null; public OnionType onionType = null; public List fusedTypes = new List(); public Animator anim = null; public BaseOnionFusionProperties fusionProperties = null; public ShipPhaseOnion(OnionType type, GameObject instance) { onionType = type; Instance = instance; } public ShipPhaseOnion(List types, GameObject instance) { onionType = null; fusedTypes = types; Instance = instance; } } public List shipPhaseOnions = new List(); public void OnEnable() { PikminManager.instance.shipPhaseOnionContainer = this; RefreshOnions(); GenerationManager.Instance.Register(this); } public void RefreshOnions() { if (!((NetworkBehaviour)PikminManager.instance).IsServer) { return; } LethalMin.Logger.LogInfo((object)("Refreshing onions for " + ((Object)((Component)this).gameObject).name)); PikminManager.instance.RemoveShipPhaseOnionsServerRpc(); int num = 0; List list = new List(); if (SaveManager.KeyExists("onionFusion")) { Dictionary> dictionary = SaveManager.Load>>("onionFusion"); foreach (string key in dictionary.Keys) { list.AddRange(dictionary[key]); PikminManager.instance.SpawnShipPhaseOnionServerRpc(dictionary[key].ToArray()); num++; } } if (!SaveManager.KeyExists("collectedOnions")) { return; } List list2 = SaveManager.Load>("collectedOnions"); foreach (int item in list2) { if (!list.Contains(item)) { OnionType onionTypeByID = LethalMin.GetOnionTypeByID(item); if ((Object)(object)onionTypeByID == (Object)null) { LethalMin.Logger.LogError((object)$"Null ID: {item}"); continue; } PikminManager.instance.SpawnShipPhaseOnionServerRpc(item); num++; } } } public void LateUpdate() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) if (!LethalMin.DontUpdateSpaceOnionPosition.InternalValue) { ((Component)this).transform.position = LethalMin.SpaceOnionPosition.InternalValue; } if (((Component)this).transform.childCount <= 0) { return; } float num = 10f; float num2 = Time.time * 2f; foreach (Transform item in ((Component)this).transform) { Transform val = item; val.position = ((Component)this).transform.position + new Vector3(Mathf.Cos(num2), 0f, Mathf.Sin(num2)) * num; num2 += MathF.PI * 2f / (float)((Component)this).transform.childCount; } } public void SwitchGeneration(PikminGeneration generation) { foreach (ShipPhaseOnion shipPhaseOnion in shipPhaseOnions) { SwitchGenerationB(generation, shipPhaseOnion); } } public void SwitchGenerationB(PikminGeneration generation, ShipPhaseOnion onion) { ShipPhaseOnion onion2 = onion; if (LethalMin.RandomizeGenerationModels.InternalValue) { generation = (PikminGeneration)Random.Range(0, Enum.GetValues(typeof(PikminGeneration)).Length); } if ((Object)(object)onion2.Instance == (Object)null) { LethalMin.Logger.LogError((object)"SwitchGenerationB: onion.Instance is null"); return; } OnionModelRefernces modelRefernces = onion2.Instance.GetComponentInChildren(); bool flag = false; OnionModelGeneration[] generations = modelRefernces.Generations; foreach (OnionModelGeneration onionModelGeneration in generations) { onionModelGeneration.Model.SetActive(onionModelGeneration.Generation == generation); if (onionModelGeneration.Generation == generation) { applyGeneration(onionModelGeneration); flag = true; } } if (!flag) { LethalMin.Logger.LogWarning((object)$"Failed to find a valid generation for Onion! Generation: {generation}"); useDefultGeneration(); } void applyGeneration(OnionModelGeneration gen) { onion2.anim = gen.Animator; onion2.fusionProperties = gen.FusionProperties; onion2.fusionProperties.MainOnionRenderer = gen.MainOnionRenderer; onion2.fusionProperties.ApplyFusionProperties(onion2.onionType, onion2.fusedTypes); onion2.anim.SetTrigger("DoFloat"); } void useDefultGeneration() { modelRefernces.Model.SetActive(true); onion2.anim = modelRefernces.Animator; onion2.fusionProperties = modelRefernces.FusionProperties; onion2.fusionProperties.MainOnionRenderer = modelRefernces.MainOnionRenderer; onion2.fusionProperties.ApplyFusionProperties(onion2.onionType, onion2.fusedTypes); onion2.anim.SetTrigger("DoFloat"); } } } public class SofaChairPikminInteraction : SpecialPikminIdleInteraction { public Vector3[] SeatPositions = (Vector3[])(object)new Vector3[2] { new Vector3(0.75f, 1.25f, 0f), new Vector3(0.5f, 4.8f, -0.7f) }; private PikminAI? lastAI1; private PikminAI? lastAI2; private int CachedIndex1; private int CachedIndex2; public override void OnLeaderChanged(bool isNull) { base.OnLeaderChanged(isNull); if (isNull || (Object)(object)leaderInSpecialAnim == (Object)null) { foreach (PikminAI item in AIsInSpecialAnim) { if ((Object)(object)item != (Object)null) { item.SpecialIdlePosition = null; item.SpecialIdleRotation = null; item.SetCollisionMode(1); } } AIsInSpecialAnim.Clear(); LethalMin.Logger.LogInfo((object)"SofaChairPikminInteraction: Leader is null or not in special anim, clearing AIsInSpecialAnim."); } else if (((NetworkBehaviour)leaderInSpecialAnim).IsOwner) { AIsInSpecialAnim = GetRangeOfClosestPikminToLeader(leaderInSpecialAnim, 2, 35f); SyncAIsList(); OnFillAisList(); } } public override void OnFillAisList() { base.OnFillAisList(); foreach (PikminAI item in AIsInSpecialAnim) { if ((Object)(object)item != (Object)null) { item.SetCollisionMode(0); } } } public void LateUpdate() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_0139: Unknown result type (might be due to invalid IL or missing references) if (AIsInSpecialAnim.Count == 0) { return; } if (AIsInSpecialAnim.Contains(null)) { LethalMin.Logger.LogWarning((object)"SofaChairPikminInteraction: AIsInSpecialAnim contains a null reference! clearing list."); AIsInSpecialAnim.Clear(); } PikminAI pikminAI = AIsInSpecialAnim[0]; pikminAI.SpecialIdlePosition = ((Component)this).transform.TransformPoint(SeatPositions[0]); pikminAI.SpecialIdleRotation = ((Component)this).transform.rotation; if ((Object)(object)lastAI1 != (Object)(object)pikminAI) { lastAI1 = pikminAI; CachedIndex1 = SpecialPikminIdleInteraction.FindIdleIndexForSpecialAnim(pikminAI, AnimIndexToForce); } pikminAI.animController.RandomIdle = CachedIndex1; if (pikminAI.CurrentIntention != 0) { AIsInSpecialAnim.Remove(pikminAI); } if (AIsInSpecialAnim.Count != 1) { PikminAI pikminAI2 = AIsInSpecialAnim[1]; pikminAI2.SpecialIdlePosition = ((Component)this).transform.TransformPoint(SeatPositions[1]); pikminAI2.SpecialIdleRotation = ((Component)this).transform.rotation; if ((Object)(object)lastAI2 != (Object)(object)pikminAI2) { lastAI2 = pikminAI2; CachedIndex2 = SpecialPikminIdleInteraction.FindIdleIndexForSpecialAnim(pikminAI2, AnimIndexToForce); } pikminAI2.animController.RandomIdle = CachedIndex2; if (pikminAI2.CurrentIntention != 0) { AIsInSpecialAnim.Remove(pikminAI2); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string? __getTypeName() { return "SofaChairPikminInteraction"; } } public class SpecialPikminIdleInteraction : NetworkBehaviour { public InteractTrigger trigger = null; public Leader? leaderInSpecialAnim; public List AIsInSpecialAnim = new List(); public string AnimIndexToForce = "Sit"; private Transform? prevLockedPlayer; private int? prevPikminInSquadCount = 0; public virtual void Start() { if ((Object)(object)trigger == (Object)null) { trigger = ((Component)this).GetComponent(); } } public virtual void Update() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)trigger.lockedPlayer != (Object)(object)prevLockedPlayer) { prevLockedPlayer = trigger.lockedPlayer; leaderInSpecialAnim = (((Object)(object)prevLockedPlayer == (Object)null) ? null : ((Component)prevLockedPlayer).gameObject.GetComponent()); if ((Object)(object)leaderInSpecialAnim == (Object)null) { SetLeaderServerRpc(); } else { SetLeaderServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)leaderInSpecialAnim).NetworkObject)); } } if ((Object)(object)leaderInSpecialAnim != (Object)null && (!prevPikminInSquadCount.HasValue || leaderInSpecialAnim.PikminInSquad.Count != prevPikminInSquadCount.Value)) { bool flag = !prevPikminInSquadCount.HasValue; prevPikminInSquadCount = leaderInSpecialAnim.PikminInSquad.Count; if (!flag) { OnPikminCountChanged(); } } else { prevPikminInSquadCount = null; } } [ServerRpc(RequireOwnership = false)] public void SetLeaderServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1165267935u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1165267935u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetLeaderClientRpc(); } } } [ClientRpc] public void SetLeaderClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2332952125u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2332952125u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; leaderInSpecialAnim = null; OnLeaderChanged((Object)(object)leaderInSpecialAnim == (Object)null); } } } [ServerRpc(RequireOwnership = false)] public void SetLeaderServerRpc(NetworkObjectReference reff) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1591418968u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref reff, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1591418968u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetLeaderClientRpc(reff); } } } [ClientRpc] public void SetLeaderClientRpc(NetworkObjectReference reff) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(145214183u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref reff, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 145214183u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); Leader leader = default(Leader); if (((NetworkObjectReference)(ref reff)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref leader)) { leaderInSpecialAnim = leader; LethalMin.Logger.LogInfo((object)("SetLeaderClientRpc: Leader set to " + leader.Controller.playerUsername + ".")); } else { LethalMin.Logger.LogWarning((object)(((Object)((Component)this).gameObject).name + ": Invalid Leader reference in SetLeaderClientRpc!")); leaderInSpecialAnim = null; } OnLeaderChanged((Object)(object)leaderInSpecialAnim == (Object)null); } } public virtual void OnLeaderChanged(bool isNull) { LethalMin.Logger.LogInfo((object)$"LeaderChanged {isNull}"); } public virtual void OnPikminCountChanged() { LethalMin.Logger.LogInfo((object)"PikminCountChanged"); } public virtual void OnFillAisList() { LethalMin.Logger.LogInfo((object)"AiListFiled"); } public void SyncAIsList() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) NetworkObjectReference[] array = (NetworkObjectReference[])(object)new NetworkObjectReference[AIsInSpecialAnim.Count]; for (int i = 0; i < AIsInSpecialAnim.Count; i++) { if ((Object)(object)AIsInSpecialAnim[i] != (Object)null) { array[i] = NetworkObjectReference.op_Implicit(((NetworkBehaviour)AIsInSpecialAnim[i]).NetworkObject); } } SyncAIsListServerRpc(array); } [ServerRpc(RequireOwnership = false)] public void SyncAIsListServerRpc(NetworkObjectReference[] pikRefs) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3063878785u, val, (RpcDelivery)0); bool flag = pikRefs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(pikRefs, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3063878785u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ReciveAIsListClientRpc(pikRefs); } } [ClientRpc] public void ReciveAIsListClientRpc(NetworkObjectReference[] pikRefs) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3581276736u, val, (RpcDelivery)0); bool flag = pikRefs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(pikRefs, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3581276736u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)leaderInSpecialAnim != (Object)null && ((NetworkBehaviour)leaderInSpecialAnim).IsOwner) { return; } AIsInSpecialAnim.Clear(); NetworkObject val4 = default(NetworkObject); PikminAI pikminAI = default(PikminAI); for (int i = 0; i < pikRefs.Length; i++) { NetworkObjectReference val3 = pikRefs[i]; if (((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref pikminAI)) { AIsInSpecialAnim.Add(pikminAI); LethalMin.Logger.LogInfo((object)("got ai: " + pikminAI.DebugID)); } else { LethalMin.Logger.LogWarning((object)(((Object)((Component)this).gameObject).name + ": Invalid PikminAI reference in AIsInSpecialAnim!")); } } OnFillAisList(); } public List GetRangeOfClosestPikminToLeader(Leader leader, int MaxCount, float MaxDistance) { //IL_0082: 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) LethalMin.Logger.LogInfo((object)$"GetRangeOfClosestPikminToLeader: Searching for up to {MaxCount} pikmin within {MaxDistance} units of {leader.Controller.playerUsername}."); List list = new List(); foreach (PikminAI item in leader.PikminInSquad) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.leader != (Object)(object)leader) && !item.Unselectable && item.CurrentIntention == Pintent.Idle && !(Vector3.Distance(((Component)item).transform.position, ((Component)leader).transform.position) > MaxDistance)) { list.Add(item); if (list.Count >= MaxCount) { break; } } } return list; } public static int FindIdleIndexForSpecialAnim(PikminAI ai, string anim, bool mustBeExact = false) { LethalMin.Logger.LogInfo((object)("FindIdleIndexForSpecialAnim: Searching for '" + anim + "' in " + ai.DebugID + ".")); PikminAnimationPack pikminAnimationPack = ai.animController?.AnimPack; if ((Object)(object)pikminAnimationPack == (Object)null) { LethalMin.Logger.LogWarning((object)("FindIndexForSpecialAnim: " + ai.DebugID + " has no animpack or animcontroller!")); return 0; } foreach (AnimationClip item in pikminAnimationPack.EditorIdleAnim) { if (!mustBeExact && ((Object)item).name.ToLower().Contains(anim.ToLower())) { return pikminAnimationPack.EditorIdleAnim.IndexOf(item); } if (mustBeExact && ((Object)item).name.ToLower() == anim.ToLower()) { return pikminAnimationPack.EditorIdleAnim.IndexOf(item); } } return 0; } 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 ((NetworkBehaviour)this).__registerRpc(1165267935u, new RpcReceiveHandler(__rpc_handler_1165267935), "SetLeaderServerRpc"); ((NetworkBehaviour)this).__registerRpc(2332952125u, new RpcReceiveHandler(__rpc_handler_2332952125), "SetLeaderClientRpc"); ((NetworkBehaviour)this).__registerRpc(1591418968u, new RpcReceiveHandler(__rpc_handler_1591418968), "SetLeaderServerRpc"); ((NetworkBehaviour)this).__registerRpc(145214183u, new RpcReceiveHandler(__rpc_handler_145214183), "SetLeaderClientRpc"); ((NetworkBehaviour)this).__registerRpc(3063878785u, new RpcReceiveHandler(__rpc_handler_3063878785), "SyncAIsListServerRpc"); ((NetworkBehaviour)this).__registerRpc(3581276736u, new RpcReceiveHandler(__rpc_handler_3581276736), "ReciveAIsListClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1165267935(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; ((SpecialPikminIdleInteraction)(object)target).SetLeaderServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2332952125(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; ((SpecialPikminIdleInteraction)(object)target).SetLeaderClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1591418968(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 leaderServerRpc = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderServerRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SpecialPikminIdleInteraction)(object)target).SetLeaderServerRpc(leaderServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_145214183(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 leaderClientRpc = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref leaderClientRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SpecialPikminIdleInteraction)(object)target).SetLeaderClientRpc(leaderClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3063878785(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikRefs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRefs, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((SpecialPikminIdleInteraction)(object)target).SyncAIsListServerRpc(pikRefs); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3581276736(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pikRefs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pikRefs, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((SpecialPikminIdleInteraction)(object)target).ReciveAIsListClientRpc(pikRefs); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SpecialPikminIdleInteraction"; } } public class Sprout : NetworkBehaviour, IGenerationSwitchable { public enum SproutPlantColor { Default, Red, Purple, Yellow } [CompilerGenerated] private sealed class d__28 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 StartPosition; public Vector3 EndPosition; public Quaternion Rotaion; public Sprout <>4__this; private float 5__1; private float 5__2; private Vector3 5__3; private Vector3 5__4; private Quaternion 5__5; private Vector3 5__6; private Vector3 5__7; private float 5__8; private float 5__9; private float 5__10; private Vector3 5__11; private Quaternion 5__12; private float 5__13; private Vector3 5__14; 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_022c: 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_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)<>4__this.interactTrigger != (Object)null) { <>4__this.interactTrigger.interactable = false; } 5__1 = 1.5f; 5__2 = 0f; 5__3 = Vector3.zero; 5__4 = ((Component)<>4__this).transform.localScale; 5__5 = Quaternion.Euler(180f, ((Quaternion)(ref Rotaion)).eulerAngles.y, 0f); 5__6 = new Vector3(EndPosition.x, StartPosition.y, EndPosition.z); ((Component)<>4__this).transform.position = StartPosition; ((Component)<>4__this).transform.rotation = 5__5; ((Component)<>4__this).transform.localScale = 5__3; 5__7 = Vector3.Lerp(StartPosition, 5__6, 0.25f) + Vector3.up * 5f; break; case 1: <>1__state = -1; break; } if (5__2 < 5__1) { 5__8 = 5__2 / 5__1; 5__9 = 1f - Mathf.Pow(1f - 5__8, 1.5f); 5__10 = 1f - 5__9; 5__11 = 5__10 * 5__10 * StartPosition + 2f * 5__10 * 5__9 * 5__7 + 5__9 * 5__9 * EndPosition; 5__12 = Quaternion.Slerp(5__5, Rotaion, 5__9); 5__13 = Mathf.Min(1f, 5__8 * 4f); 5__14 = Vector3.Lerp(5__3, 5__4, 5__13); ((Component)<>4__this).transform.position = 5__11; ((Component)<>4__this).transform.rotation = 5__12; ((Component)<>4__this).transform.localScale = 5__14; 5__2 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } ((Component)<>4__this).transform.position = EndPosition; ((Component)<>4__this).transform.rotation = Rotaion; ((Component)<>4__this).transform.localScale = 5__4; <>4__this.sproutAudio.PlayOneShot(<>4__this.PlantSFX); if ((Object)(object)<>4__this.interactTrigger != (Object)null) { <>4__this.interactTrigger.interactable = true; } LethalMin.Logger.LogInfo((object)$"Sprout animation complete: {<>4__this.pikminType.PikminName} at position {EndPosition}"); 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__51 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Sprout <>4__this; private Renderer[] <>s__1; private int <>s__2; private Renderer 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__51(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>s__1 = ((Component)<>4__this).GetComponentsInChildren(true); for (<>s__2 = 0; <>s__2 < <>s__1.Length; <>s__2++) { 5__3 = <>s__1[<>s__2]; 5__3.enabled = false; 5__3 = null; } <>s__1 = null; if ((Object)(object)<>4__this.interactTrigger != (Object)null) { <>4__this.interactTrigger.interactable = false; } <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)<>4__this.interactTrigger != (Object)null && (Object)(object)<>4__this.interactTrigger.lockedPlayer != (Object)null) { <>4__this.interactTrigger.StopSpecialAnimation(); } if (((NetworkBehaviour)<>4__this).IsServer) { ((NetworkBehaviour)<>4__this).NetworkObject.Despawn(true); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__46 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB player; public Sprout <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__46(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(g__FrameToSeconds|46_0(25)); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.sproutAudio.PlayOneShot(<>4__this.PullSFX); <>2__current = (object)new WaitForSeconds(g__FrameToSeconds|46_0(35)); <>1__state = 2; return true; case 2: <>1__state = -1; <>4__this.sproutAudio.PlayOneShot(<>4__this.PluckSFX); if (((NetworkBehaviour)<>4__this).IsServer) { <>4__this.SpawnPikminServerRpc(Despawn: false, -1L); } ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.DespawnRoutine()); <>4__this.pluckRoutine = null; 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 Transform ModelContainer = null; public InteractTrigger? interactTrigger = null; public Transform SpawnPos = null; public PikminType pikminType = null; public Animator sproutAnimator = null; public AudioSource sproutAudio = null; public AudioClip PlantSFX = null; public AudioClip GrowSFX = null; public AudioClip PullSFX = null; public AudioClip PluckSFX = null; public PikminScanNodeProperties sNode = null; public int CurrentGrowthStage = 0; public int MaxGrowthStage = 2; public float GrowTimer = 100f; public ulong PlayerPluckingID = 9999999999999999uL; public PikminAI pikminSpawned = null; private bool HasNoGrowthStages; private Dictionary> growthObjects = new Dictionary>(); public Coroutine pluckRoutine = null; public bool IsPersistant = false; public bool IsBeingPlucked = false; private SproutPlantColor sproutColor = SproutPlantColor.Default; public void Start() { sNode = ((Component)this).GetComponentInChildren(true); } [ClientRpc] public void InitalizeClientRpc(SproutData data) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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(822602528u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref data, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 822602528u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; InitalizeOnLocalClient(data.Position, data.Rotaion, data.TypeID); SetGrowth(data.GrowthStage); } } } [ClientRpc] public void InitalizeClientRpc(Vector3 Position, Quaternion Rotaion, 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_008b: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) 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(2992799991u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Rotaion); BytePacker.WriteValueBitPacked(val2, TypeID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2992799991u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; InitalizeOnLocalClient(Position, Rotaion, TypeID); } } } [ClientRpc] public void InitalizeClientRpc(Vector3 StartPosition, Vector3 EndPosition, Quaternion Rotaion, 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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) 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(3954856842u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref StartPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref EndPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Rotaion); BytePacker.WriteValueBitPacked(val2, TypeID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3954856842u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; InitalizeOnLocalClient(StartPosition, Rotaion, TypeID); ((MonoBehaviour)this).StartCoroutine(AnimateSprout(StartPosition, EndPosition, Rotaion)); } } } public void InitalizeOnLocalClient(Vector3 Position, Quaternion Rotaion, int TypeID) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) pikminType = LethalMin.GetPikminTypeByID(TypeID); ((Component)this).transform.rotation = Rotaion; ((Component)this).transform.position = Position; GrowTimer = Random.Range(50, 500); sproutColor = pikminType.SproutPlantColor; GameObject val = null; if ((Object)(object)pikminType.SproutOverrideModel == (Object)null) { val = Object.Instantiate(LethalMin.DefultPikminSproutMesh, ModelContainer); } else { val = Object.Instantiate(pikminType.SproutOverrideModel, ModelContainer); } GenerationManager.Instance.Register(this); SwitchGeneration(PikUtils.ConvertCfgGenerationToPikminGeneration(LethalMin.SproutModelGeneration.InternalValue)); GetGrowthObjects(); SetGrowth(0); LethalMin.Logger.LogDebug((object)$"{LethalMin.GetPikminTypeByID(TypeID).PikminName} sprout initalized at ({Position},{((Quaternion)(ref Rotaion)).eulerAngles})"); } [IteratorStateMachine(typeof(d__28))] private IEnumerator AnimateSprout(Vector3 StartPosition, Vector3 EndPosition, Quaternion Rotaion) { //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) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this, StartPosition = StartPosition, EndPosition = EndPosition, Rotaion = Rotaion }; } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); GenerationManager.Instance.Unregister(this); } public void SwitchGeneration(PikminGeneration generation) { if (LethalMin.RandomizeGenerationModels.InternalValue) { generation = (PikminGeneration)Random.Range(0, Enum.GetValues(typeof(PikminGeneration)).Length); } SproutModelRefences modelRefernces = ((Component)this).GetComponentInChildren(); bool flag = false; SproutModelGeneration[] generations = modelRefernces.Generations; foreach (SproutModelGeneration sproutModelGeneration in generations) { if (!PikChecks.IsGenerationValid(sproutModelGeneration)) { LethalMin.Logger.LogError((object)$"Generation {sproutModelGeneration.Generation} of type {pikminType.PikminName} is invaild for a sprout!"); continue; } sproutModelGeneration.Model.SetActive(sproutModelGeneration.Generation == generation); if (sproutModelGeneration.Generation == generation) { applyGeneration(sproutModelGeneration); flag = true; } } if (!flag) { LethalMin.Logger.LogWarning((object)$"Failed to find a valid generation for sprout! Generation: {generation}"); applyDefaultGeneration(); } void applyDefaultGeneration() { //IL_00de: Unknown result type (might be due to invalid IL or missing references) modelRefernces.Model.SetActive(true); sproutAnimator = modelRefernces.Animator; if (!((Object)(object)modelRefernces.MainRenderer == (Object)null)) { if (pikminType.PikminSproutOverrideMaterial != null && pikminType.PikminSproutOverrideMaterial.Length != 0) { Material material = pikminType.PikminSproutOverrideMaterial[0]; if (!PikUtils.IsOutOfRange(pikminType.PikminSproutOverrideMaterial, (int)generation)) { material = pikminType.PikminSproutOverrideMaterial[(int)generation]; } modelRefernces.MainRenderer.material = material; } else if (pikminType.SetColorOnSprout) { modelRefernces.MainRenderer.material.color = pikminType.PikminPrimaryColor; } } } void applyGeneration(SproutModelGeneration gen) { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) sproutAnimator = gen.Animator; if (!((Object)(object)gen.MainRenderer == (Object)null)) { if (pikminType.PikminSproutOverrideMaterial != null && pikminType.PikminSproutOverrideMaterial.Length != 0) { Material material2 = pikminType.PikminSproutOverrideMaterial[0]; if (!PikUtils.IsOutOfRange(pikminType.PikminSproutOverrideMaterial, (int)generation)) { material2 = pikminType.PikminSproutOverrideMaterial[(int)generation]; } gen.MainRenderer.material = material2; } else if (pikminType.SetColorOnSprout) { gen.MainRenderer.material.SetTexture("_BaseColorMap", (Texture)null); gen.MainRenderer.material.color = pikminType.PikminPrimaryColor; } } } } private void Update() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) float internalValue = LethalMin.SproutScale.InternalValue; ((Component)this).transform.localScale = new Vector3(internalValue, internalValue, internalValue); if (Object.op_Implicit((Object)(object)pikminType)) { ((ScanNodeProperties)sNode).subText = pikminType.PikminName; } sNode.VisualNodeType = (int)LethalMin.PikminSproutScanNodeColorType.InternalValue; ((Component)sNode).gameObject.SetActive(LethalMin.MakeSproutsScanable.InternalValue); if (((NetworkBehaviour)this).IsServer && CurrentGrowthStage < MaxGrowthStage) { GrowTimer -= Time.deltaTime; if (GrowTimer <= 0f) { GrowTimer = Random.Range(40, 500); SetGrowthClientRpc(CurrentGrowthStage + 1); } } } public void GetGrowthObjects() { SproutModelRefences componentInChildren = ((Component)this).GetComponentInChildren(); growthObjects = new Dictionary>(); growthObjects.Clear(); MaxGrowthStage = 0; ProcessPlants(componentInChildren.Plants, componentInChildren.AltBudMaterials, componentInChildren.AltFlowerMaterials); SproutModelGeneration[] generations = componentInChildren.Generations; foreach (SproutModelGeneration sproutModelGeneration in generations) { ProcessPlants(sproutModelGeneration.Plants, sproutModelGeneration.AltBudMaterials, sproutModelGeneration.AltFlowerMaterials); } HasNoGrowthStages = growthObjects.Count == 0; if (HasNoGrowthStages) { LethalMin.Logger.LogWarning((object)"Sprout found no growth stages"); } void ProcessPlants(List plants, List BudMats, List FlowerMats) { foreach (GameObject plant in plants) { if ((Object)(object)plant == (Object)null) { LethalMin.Logger.LogError((object)"A Sprout's Growth object is null"); } else { int num = plants.IndexOf(plant); if (!growthObjects.ContainsKey(num)) { growthObjects[num] = new List(); } growthObjects[num].Add(plant); if (num == 1 && !PikUtils.IsOutOfRange(BudMats, (int)sproutColor)) { plant.GetComponent().material = BudMats[(int)sproutColor]; } else if (num == 2 && !PikUtils.IsOutOfRange(FlowerMats, (int)sproutColor)) { plant.GetComponent().material = FlowerMats[(int)sproutColor]; } if (num > MaxGrowthStage) { MaxGrowthStage = num; } } } } } public void SetGrowth(int Stage) { if (HasNoGrowthStages) { return; } if (Stage < 0 || Stage > MaxGrowthStage) { LethalMin.Logger.LogWarning((object)$"Sprout Invalid growth stage {Stage}"); return; } LethalMin.Logger.LogDebug((object)$"Sprout Setting growth stage to {Stage}"); if (Stage > CurrentGrowthStage && (Object)(object)GrowSFX != (Object)null) { sproutAudio.PlayOneShot(GrowSFX); } CurrentGrowthStage = Stage; foreach (KeyValuePair> growthObject in growthObjects) { foreach (GameObject item in growthObject.Value) { item.SetActive(growthObject.Key == Stage); } } } [ClientRpc] public void SetGrowthClientRpc(int Stage) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2015704989u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, Stage); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2015704989u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!HasNoGrowthStages) { SetGrowth(Stage); } } } [ServerRpc(RequireOwnership = false)] public void PlayPullSoundServerRpc(ServerRpcParams rpcParams = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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_0120: 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)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2899850049u, rpcParams, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2899850049u, rpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ulong senderId = rpcParams.Receive.SenderClientId; ClientRpcParams val2 = default(ClientRpcParams); val2.Send = new ClientRpcSendParams { TargetClientIds = NetworkManager.Singleton.ConnectedClientsIds.Where((ulong id) => id != senderId).ToArray() }; ClientRpcParams rpcParams2 = val2; PlayPullSoundClientRpc(rpcParams2); } } [ClientRpc] public void PlayPullSoundClientRpc(ClientRpcParams rpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2941489068u, rpcParams, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2941489068u, rpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)sproutAudio != (Object)null && (Object)(object)PullSFX != (Object)null) { sproutAudio.PlayOneShot(PullSFX); } } } [ServerRpc(RequireOwnership = false)] public void PlayPluckSoundServerRpc(ServerRpcParams rpcParams = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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_0120: 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)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3803951217u, rpcParams, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3803951217u, rpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ulong senderId = rpcParams.Receive.SenderClientId; ClientRpcParams val2 = default(ClientRpcParams); val2.Send = new ClientRpcSendParams { TargetClientIds = NetworkManager.Singleton.ConnectedClientsIds.Where((ulong id) => id != senderId).ToArray() }; ClientRpcParams rpcParams2 = val2; PlayPluckSoundClientRpc(rpcParams2); } } [ClientRpc] public void PlayPluckSoundClientRpc(ClientRpcParams rpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3403553532u, rpcParams, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3403553532u, rpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)sproutAudio != (Object)null && (Object)(object)PluckSFX != (Object)null) { sproutAudio.PlayOneShot(PluckSFX); } } } public void HoldingInteractEvent() { if ((Object)(object)interactTrigger != (Object)null) { interactTrigger.specialCharacterAnimation = !LethalMin.SkipPluckAnimation; } } public void OnInteract(PlayerControllerB player) { if ((Object)(object)interactTrigger != (Object)null && !interactTrigger.specialCharacterAnimation) { if ((Object)(object)player == (Object)null) { LethalMin.Logger.LogError((object)"Sprout OnInteract called with null player"); return; } sproutAudio.PlayOneShot(PluckSFX); PluckAndDespawnServerRpc(((NetworkBehaviour)player).OwnerClientId); } } public void OnInteractEarlyOnOtherClients(PlayerControllerB player) { PlayerPluckingID = ((NetworkBehaviour)player).OwnerClientId; Leader component = ((Component)player).GetComponent(); component.CustomAnimController.ReplaceAnimatorWithOverride(); IsBeingPlucked = true; if (pluckRoutine != null) { ((MonoBehaviour)this).StopCoroutine(pluckRoutine); pluckRoutine = null; } pluckRoutine = ((MonoBehaviour)this).StartCoroutine(PluckRoutine(player)); } public void OnInteractEarly(PlayerControllerB player) { } public void OnStopInteract(PlayerControllerB player) { } public void OnCancleAnimation(PlayerControllerB player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { LethalMin.Logger.LogInfo((object)"Sprout animation was cancled"); if (pluckRoutine != null) { ((MonoBehaviour)this).StopCoroutine(pluckRoutine); pluckRoutine = null; } IsBeingPlucked = false; ((Component)player).GetComponent().CustomAnimController.RevertAnimator(); if ((Object)(object)interactTrigger != (Object)null) { SyncAnimCancleRpc(((NetworkBehaviour)interactTrigger.playerScriptInSpecialAnimation).OwnerClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncAnimCancleRpc(ulong ID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_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) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(899669099u, val2, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, ID); ((NetworkBehaviour)this).__endSendRpc(ref val3, 899669099u, val2, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)StartOfRound.Instance.localPlayerController).OwnerClientId != ID) { Leader leaderViaID = LethalMin.GetLeaderViaID(ID); if ((Object)(object)leaderViaID == (Object)null) { LethalMin.Logger.LogError((object)$"Sprout Failed to find leader with ID {ID} when syncing cancle"); } LethalMin.Logger.LogInfo((object)"Sprout animation was cancled (synced)"); if (pluckRoutine != null) { ((MonoBehaviour)this).StopCoroutine(pluckRoutine); pluckRoutine = null; } IsBeingPlucked = false; leaderViaID?.CustomAnimController.RevertAnimator(); } } [IteratorStateMachine(typeof(d__46))] private IEnumerator PluckRoutine(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__46(0) { <>4__this = this, player = player }; } [ServerRpc(RequireOwnership = false)] public void PluckAndDespawnServerRpc(ulong ID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3647450524u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3647450524u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SpawnPikminOnServer(Despawn: false, (long)ID); StartDespawnRoutineClientRpc(ID); } } } [ClientRpc] public void StartDespawnRoutineClientRpc(ulong ID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3959366296u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, ID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3959366296u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (pluckRoutine != null) { ((MonoBehaviour)this).StopCoroutine(pluckRoutine); pluckRoutine = null; } if (((NetworkBehaviour)StartOfRound.Instance.localPlayerController).OwnerClientId != ID) { sproutAudio.PlayOneShot(PluckSFX); } ((MonoBehaviour)this).StartCoroutine(DespawnRoutine()); } } [ServerRpc(RequireOwnership = false)] public void SpawnPikminServerRpc(bool Despawn = false, long ID = -1L) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3921144968u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Despawn, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, ID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3921144968u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SpawnPikminOnServer(Despawn, ID); } } } public void SpawnPikminOnServer(bool Despawn = false, long ID = -1L) { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pikminSpawned != (Object)null) { LethalMin.Logger.LogWarning((object)"Sprout has already spawned a pikmin"); return; } if (ID != -1) { PlayerPluckingID = (ulong)ID; } PikminSpawnProps props = new PikminSpawnProps(); props.GrowthStage = CurrentGrowthStage; props.PlayerID = PlayerPluckingID; props.SpawnAnimation = "Plucked"; props.SpawnSound = "Born"; props.OverrideVolume = 1f; props.SpawnSoundDelay = 0.2f; props.AddToSpawnCount = true; ManualLogSource logger = LethalMin.Logger; object arg = SpawnPos.position; Quaternion rotation = ((Component)this).transform.rotation; logger.LogInfo((object)$"SpawnPosition: {arg} SpawnRotaion: {((Quaternion)(ref rotation)).eulerAngles}"); pikminSpawned = PikminManager.instance.SpawnPikminOnServer(pikminType, SpawnPos.position, ((Component)this).transform.rotation, props); if (Despawn) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } [IteratorStateMachine(typeof(d__51))] public IEnumerator DespawnRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__51(0) { <>4__this = this }; } [CompilerGenerated] internal static float g__FrameToSeconds|46_0(int frame, int FPS = 60) { return (float)frame / (float)FPS; } 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 //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(822602528u, new RpcReceiveHandler(__rpc_handler_822602528), "InitalizeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2992799991u, new RpcReceiveHandler(__rpc_handler_2992799991), "InitalizeClientRpc"); ((NetworkBehaviour)this).__registerRpc(3954856842u, new RpcReceiveHandler(__rpc_handler_3954856842), "InitalizeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2015704989u, new RpcReceiveHandler(__rpc_handler_2015704989), "SetGrowthClientRpc"); ((NetworkBehaviour)this).__registerRpc(2899850049u, new RpcReceiveHandler(__rpc_handler_2899850049), "PlayPullSoundServerRpc"); ((NetworkBehaviour)this).__registerRpc(2941489068u, new RpcReceiveHandler(__rpc_handler_2941489068), "PlayPullSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(3803951217u, new RpcReceiveHandler(__rpc_handler_3803951217), "PlayPluckSoundServerRpc"); ((NetworkBehaviour)this).__registerRpc(3403553532u, new RpcReceiveHandler(__rpc_handler_3403553532), "PlayPluckSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(899669099u, new RpcReceiveHandler(__rpc_handler_899669099), "SyncAnimCancleRpc"); ((NetworkBehaviour)this).__registerRpc(3647450524u, new RpcReceiveHandler(__rpc_handler_3647450524), "PluckAndDespawnServerRpc"); ((NetworkBehaviour)this).__registerRpc(3959366296u, new RpcReceiveHandler(__rpc_handler_3959366296), "StartDespawnRoutineClientRpc"); ((NetworkBehaviour)this).__registerRpc(3921144968u, new RpcReceiveHandler(__rpc_handler_3921144968), "SpawnPikminServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_822602528(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) { SproutData data = default(SproutData); ((FastBufferReader)(ref reader)).ReadValueSafe(ref data, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Sprout)(object)target).InitalizeClientRpc(data); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2992799991(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003d: 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) //IL_005b: 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_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotaion = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotaion); int typeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref typeID); target.__rpc_exec_stage = (__RpcExecStage)1; ((Sprout)(object)target).InitalizeClientRpc(position, rotaion, typeID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3954856842(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_004a: 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_0068: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 startPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref startPosition); Vector3 endPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref endPosition); Quaternion rotaion = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotaion); int typeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref typeID); target.__rpc_exec_stage = (__RpcExecStage)1; ((Sprout)(object)target).InitalizeClientRpc(startPosition, endPosition, rotaion, typeID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2015704989(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 growthClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref growthClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((Sprout)(object)target).SetGrowthClientRpc(growthClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2899850049(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((Sprout)(object)target).PlayPullSoundServerRpc(server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2941489068(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)1; ((Sprout)(object)target).PlayPullSoundClientRpc(client); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3803951217(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((Sprout)(object)target).PlayPluckSoundServerRpc(server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3403553532(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)1; ((Sprout)(object)target).PlayPluckSoundClientRpc(client); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_899669099(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong iD = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref iD); target.__rpc_exec_stage = (__RpcExecStage)1; ((Sprout)(object)target).SyncAnimCancleRpc(iD); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3647450524(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong iD = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref iD); target.__rpc_exec_stage = (__RpcExecStage)1; ((Sprout)(object)target).PluckAndDespawnServerRpc(iD); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3959366296(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong iD = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref iD); target.__rpc_exec_stage = (__RpcExecStage)1; ((Sprout)(object)target).StartDespawnRoutineClientRpc(iD); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3921144968(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool despawn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref despawn, default(ForPrimitives)); long iD = default(long); ByteUnpacker.ReadValueBitPacked(reader, ref iD); target.__rpc_exec_stage = (__RpcExecStage)1; ((Sprout)(object)target).SpawnPikminServerRpc(despawn, iD); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Sprout"; } } public struct SproutData : INetworkSerializable { public int TypeID; public int GrowthStage; public Vector3 Position; public Quaternion Rotaion; public int MoonSpawnedOn; public SproutData(Sprout original) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) TypeID = original.pikminType.PikminTypeID; GrowthStage = original.CurrentGrowthStage; Position = ((Component)original).transform.position; Rotaion = ((Component)original).transform.rotation; MoonSpawnedOn = StartOfRound.Instance.currentLevelID; } public unsafe void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) ((BufferSerializer*)(&serializer))->SerializeValue(ref TypeID, default(ForPrimitives)); ((BufferSerializer*)(&serializer))->SerializeValue(ref GrowthStage, default(ForPrimitives)); serializer.SerializeValue(ref Position); serializer.SerializeValue(ref Rotaion); ((BufferSerializer*)(&serializer))->SerializeValue(ref MoonSpawnedOn, default(ForPrimitives)); } } public struct ProjectileProperties { public PikminAI pikminAI; public Vector3 direction; public Vector3 throwForce; public float mass; public float drag; } public interface ITrajectoryModifier { bool CanModify(PikminAI pikminAI); void ModifyTrajectory(ref Vector3[] points, PikminAI aiModifying, int pointCount, float timeIncrement, out RaycastHit finalhit); } [RequireComponent(typeof(LineRenderer))] public class TrajectoryPredictor : MonoBehaviour { public LineRenderer trajectoryLine = null; [SerializeField] [Tooltip("The marker will show where the projectile will hit")] public Transform hitMarker = null; [SerializeField] [Range(10f, 100f)] [Tooltip("The maximum number of points the LineRenderer can have")] private int maxPoints = 30; [SerializeField] [Range(0.01f, 0.5f)] [Tooltip("The time increment used to calculate the trajectory")] private float increment = 0.05f; [SerializeField] [Range(1.05f, 2f)] [Tooltip("The raycast overlap between points in the trajectory, this is a multiplier of the length between points. 2 = twice as long")] private float rayOverlap = 1.1f; [SerializeField] [Tooltip("Reference to the throw origin transform")] public Transform throwOrigin = null; private LayerMask collidersAndRoomMask; private Vector3[] trajectoryPoints = (Vector3[])(object)new Vector3[0]; private void Start() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)trajectoryLine == (Object)null) { trajectoryLine = ((Component)this).GetComponent(); } if ((Object)(object)throwOrigin == (Object)null) { LethalMin.Logger.LogWarning((object)"TrajectoryPredictor: Throw origin is not set. Please assign it in the LeaderManager."); } hitMarker = Object.Instantiate(LethalMin.assetBundle.LoadAsset("Assets/LethalMin/Target.prefab")).transform; collidersAndRoomMask = LethalMin.PikminColideable; trajectoryPoints = (Vector3[])(object)new Vector3[maxPoints]; SetTrajectoryVisible(visible: false); } public void PredictTrajectory(ProjectileProperties projectile) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)throwOrigin == (Object)null) { LethalMin.Logger.LogError((object)"TrajectoryPredictor: Throw origin is not set. Cannot predict trajectory."); return; } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(projectile.direction.x * projectile.throwForce.x, projectile.direction.y * projectile.throwForce.y, projectile.direction.z * projectile.throwForce.z); Vector3 val2 = val / projectile.mass; Vector3 val3 = throwOrigin.position; int num = 0; bool flag = false; RaycastHit hit = default(RaycastHit); RaycastHit val5 = default(RaycastHit); for (int i = 0; i < maxPoints; i++) { trajectoryPoints[i] = val3; num++; if (i > 0) { val2 = CalculateNewVelocity(val2, projectile.drag, increment); Vector3 val4 = val3 + val2 * increment; float num2 = Vector3.Distance(val3, val4) * rayOverlap; if (Physics.Raycast(val3, ((Vector3)(ref val2)).normalized, ref val5, num2, LayerMask.op_Implicit(collidersAndRoomMask), (QueryTriggerInteraction)1) && !((RaycastHit)(ref val5)).collider.isTrigger) { trajectoryPoints[i] = ((RaycastHit)(ref val5)).point; hit = val5; flag = true; break; } val3 = val4; } } if ((Object)(object)projectile.pikminAI != (Object)null && projectile.pikminAI.trajectoryModifier != null) { if (projectile.pikminAI.trajectoryModifier.CanModify(projectile.pikminAI)) { projectile.pikminAI.trajectoryModifier.ModifyTrajectory(ref trajectoryPoints, projectile.pikminAI, num, increment, out var finalhit); if (!((object)(RaycastHit)(ref finalhit)).Equals((object)default(RaycastHit))) { hit = finalhit; } } else { LethalMin.Logger.LogWarning((object)("TrajectoryPredictor: The provided PikminAI (" + projectile.pikminAI.DebugID + ") does not have a valid trajectory modifier.")); } } trajectoryLine.positionCount = num; for (int j = 0; j < num; j++) { trajectoryLine.SetPosition(j, trajectoryPoints[j]); } if (flag) { MoveHitMarker(hit); } else { ((Component)hitMarker).gameObject.SetActive(false); } SetTrajectoryVisible(visible: true); } private void UpdateLineRender(int count, (int point, Vector3 pos) pointPos) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) trajectoryLine.positionCount = count; trajectoryLine.SetPosition(pointPos.point, pointPos.pos); } private Vector3 CalculateNewVelocity(Vector3 velocity, float drag, float increment) { //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_0008: Unknown result type (might be due to invalid IL or missing references) //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) velocity += Physics.gravity * increment; velocity *= Mathf.Clamp01(1f - drag * increment); return velocity; } private void MoveHitMarker(RaycastHit hit) { //IL_0021: 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_002e: 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) ((Component)hitMarker).gameObject.SetActive(true); float num = 0.025f; hitMarker.position = ((RaycastHit)(ref hit)).point + ((RaycastHit)(ref hit)).normal * num; } public void SetTrajectoryVisible(bool visible) { ((Renderer)trajectoryLine).enabled = visible; ((Component)hitMarker).gameObject.SetActive(visible); } } public class WeatherSpawnConfig { private ConfigItem? _baseSpawnMultiplierConfig; private ConfigItem? _overrideTypeSettingsConfig; private ConfigItem>? _typeSpawnMultipliersConfig; private readonly float _defaultBaseSpawnMultiplier; private readonly bool _defaultOverrideTypeSettings; private readonly List _defaultTypeSpawnMultipliers; public string WeatherName { get; private set; } public float BaseSpawnMultiplier => _baseSpawnMultiplierConfig?.InternalValue ?? _defaultBaseSpawnMultiplier; public bool OverrideTypeSettings => _overrideTypeSettingsConfig?.InternalValue ?? _defaultOverrideTypeSettings; public List TypeSpawnMultipliersList => _typeSpawnMultipliersConfig?.InternalValue ?? _defaultTypeSpawnMultipliers; public bool HasConfigFile => _baseSpawnMultiplierConfig != null; public WeatherSpawnConfig(string weatherName, bool generateFile, float defaultBaseMultiplier = 1f, List? defaultTypeMultipliers = null) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown WeatherName = weatherName; _defaultBaseSpawnMultiplier = defaultBaseMultiplier; _defaultOverrideTypeSettings = false; _defaultTypeSpawnMultipliers = defaultTypeMultipliers ?? new List(); if (generateFile) { string text = Path.Combine(Paths.ConfigPath, "PikminWeatherSpawns"); Directory.CreateDirectory(text); string path = LethalMin.SanitizeFileName(weatherName) + ".cfg"; string text2 = Path.Combine(text, path); ConfigFile ovrcfg = new ConfigFile(text2, true); _baseSpawnMultiplierConfig = new ConfigItem("Spawning", "Base Spawn Multiplier", defaultBaseMultiplier, "Base multiplier applied to all pikmin spawn chances during this weather.", needsRestart: true, ConfigItemAuthority.Host, ovrcfg); _overrideTypeSettingsConfig = new ConfigItem("Spawning", "Override Type Settings", defaultValue: false, "If true, the per-type multipliers defined here fully replace the type's own WeatherSpawnMultipliers for this weather, rather than stacking with them.", needsRestart: true, ConfigItemAuthority.Host, ovrcfg); _typeSpawnMultipliersConfig = new ConfigItem>("Type Spawn Multipliers", "Type Multipliers", _defaultTypeSpawnMultipliers, "Per-type spawn chance multipliers during this weather. Format: TypeName:Multiplier (e.g., Red Pikmin:1.5).", needsRestart: true, ConfigItemAuthority.Host, ovrcfg); string directoryName = Path.GetDirectoryName(Path.GetDirectoryName(Paths.ConfigPath)); string relativePath = Path.GetRelativePath(directoryName, text2); LethalMin.Logger.LogInfo((object)("Weather spawn config file created for: " + weatherName + " at BepInEx/" + relativePath)); } else { LethalMin.Logger.LogDebug((object)("Weather spawn config loaded in memory (no file) for: " + weatherName)); } } public Dictionary GetTypeMultipliers() { return PikminType.ParseMultiplierList(TypeSpawnMultipliersList); } } public class WhistleItem : GrabbableObject { [CompilerGenerated] private sealed class d__47 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public WhistleItem <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__47(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.curPack = <>4__this.Sounds[<>4__this.CurrentSoundPackIndex.Value]; if (!<>4__this.isWhistling) { <>4__this.audioSource.Stop(); <>4__this.whistleAudioRutine = null; return false; } RoundManager.Instance.PlayAudibleNoise(LethalMin.WhistleMakesNoiseAtNoticeZoneCheat ? ((Component)<>4__this.noticeZone).transform.position : ((Component)<>4__this).transform.position, <>4__this.maxWhistleZoneRadius, 0.5f, 0, false, WhistleAudioID); <>4__this.audioSource.PlayOneShot(<>4__this.curPack.StartSound); <>2__current = (object)new WaitForSeconds(<>4__this.curPack.StartSound.length); <>1__state = 1; return true; case 1: <>1__state = -1; if (!<>4__this.isWhistling) { <>4__this.audioSource.Stop(); <>4__this.whistleAudioRutine = null; return false; } <>4__this.audioSource.clip = <>4__this.curPack.LoopSound; <>4__this.audioSource.Play(); <>4__this.whistleAudioRutine = null; 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__48 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public WhistleItem <>4__this; private float 5__1; private float 5__2; private float 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__48(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0072: 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_013f: 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 = <>4__this.minWhistleZoneRadius; 5__2 = <>4__this.maxWhistleZoneRadius; 5__3 = 0f; ((Component)<>4__this.noticeZone).transform.localScale = new Vector3(5__1, 5__1, 5__1); break; case 1: <>1__state = -1; break; } if (5__3 < <>4__this.tweenDuration) { 5__4 = Mathf.Lerp(5__1, 5__2, 5__3 / <>4__this.tweenDuration); ((Component)<>4__this.noticeZone).transform.localScale = new Vector3(5__4, 5__4, 5__4); 5__3 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } ((Component)<>4__this.noticeZone).transform.localScale = new Vector3(5__2, 5__2, 5__2); <>4__this.whistleZoneTween = null; 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 PikminNoticeZone noticeZone = null; public Camera? playerCamera; public GameObject Line = null; public Transform WhisStartPoint = null; public bool isWhistling = false; public float whistleZoneOffset = 20f; public float maxRaycastDistance = 20f; public float minWhistleZoneRadius = 1f; public float maxWhistleZoneRadius = 30f; private float tweenDuration = 0.5f; private LayerMask collidersAndRoomMask; private Coroutine? whistleZoneTween = null; private Coroutine? whistleAudioRutine = null; public AudioSource audioSource = null; public AudioClip chargeSound = null; public AudioClip chargeFailSound = null; public InputAction WhistleAction = null; public InputAction DismissAction = null; public InputAction WhistleSwitchAction = null; public InputAction ChargeAction = null; public InputAction SecondaryChargeAction = null; public WhistleSoundPack curPack = null; public WhistleSoundPack[] Sounds = new WhistleSoundPack[0]; public Animator WhistleAnim = null; public NetworkVariable CurrentSoundPackIndex = new NetworkVariable(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1); private float ChargeCooldown = 0f; public static int WhistleAudioID = -1; private ScanNodeProperties sNode = null; public void Awake() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)noticeZone == (Object)null) { noticeZone = ((Component)this).GetComponentInChildren(); } audioSource = ((Component)this).GetComponent(); sNode = ((Component)this).GetComponentInChildren(); collidersAndRoomMask = LethalMin.PikminColideable; InitializeInputAction(); WhistleAudioID = StartOfRound.Instance.randomMapSeed * 100; } public override void Update() { ((GrabbableObject)this).Update(); noticeZone.Active = isWhistling; noticeZone.CanSavePikmin = true; noticeZone.Visualizer.SetActive(noticeZone.Active); ((Component)sNode).gameObject.SetActive((bool)LethalMin.MakeItemsScanable && !base.isHeld && !base.isHeldByEnemy); audioSource.volume = LethalMin.WhistleVolume.InternalValue; Line.SetActive(noticeZone.Active); if ((Object)(object)WhistleAnim != (Object)null) { WhistleAnim.SetBool("whistleing", isWhistling); } if (isWhistling) { UpdateWhistleZonePosition(); } if (((NetworkBehaviour)this).IsOwner && isWhistling && (!base.isHeld || base.isPocketed)) { WhistleUseOnLocalClient(IsButtonDown: false); WhistleUseServerRpc(IsButtonDown: false); LethalMin.Logger.LogInfo((object)"WhistleItem: Whistle stopped because item is not held anymore or is pocketed."); } if (LethalMin.WhistleZoneRadiusCheat != -1f) { maxRaycastDistance = LethalMin.WhistleZoneDistanceCheat; } if (LethalMin.WhistleZoneRadiusCheat != -1f) { maxWhistleZoneRadius = LethalMin.WhistleZoneRadiusCheat; } if (ChargeCooldown >= 0f) { ChargeCooldown -= Time.deltaTime; } } private void InitializeInputAction() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Expected O, but got Unknown //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Expected O, but got Unknown //IL_02a5: Unknown result type (might be due to invalid IL or missing references) LethalMin.Logger.LogInfo((object)("Binding input actions for " + ((Object)this).name)); if (!LethalMin.UseInputUtils) { string text = (LethalMin.InVRMode ? LethalMin.WhisleVRAction.InternalValue : LethalMin.WhisleAction.InternalValue); WhistleAction = new InputAction("Whistle(Item)", (InputActionType)0, (string)null, (string)null, (string)null, (string)null); InputActionSetupExtensions.AddBinding(WhistleAction, text, (string)null, (string)null, (string)null); WhistleAction.performed -= OnWhistleStarted; WhistleAction.canceled -= OnWhistleCanceled; WhistleAction.performed += OnWhistleStarted; WhistleAction.canceled += OnWhistleCanceled; WhistleAction.Enable(); string text2 = (LethalMin.InVRMode ? LethalMin.DismissVRAction.InternalValue : LethalMin.DismissAction.InternalValue); DismissAction = new InputAction("Dismiss", (InputActionType)0, (string)null, (string)null, (string)null, (string)null); InputActionSetupExtensions.AddBinding(DismissAction, text2, (string)null, (string)null, (string)null); DismissAction.canceled -= OnDismiss; DismissAction.canceled += OnDismiss; DismissAction.Enable(); string text3 = (LethalMin.InVRMode ? LethalMin.SwitchWhistleSoundVRAction.InternalValue : LethalMin.SwitchWhistleSoundAction.InternalValue); WhistleSwitchAction = new InputAction("SwitchWhistleSound", (InputActionType)0, (string)null, (string)null, (string)null, (string)null); InputActionSetupExtensions.AddBinding(WhistleSwitchAction, text3, (string)null, (string)null, (string)null); WhistleSwitchAction.performed -= OnWhistleSoundSwitch; WhistleSwitchAction.performed += OnWhistleSoundSwitch; WhistleSwitchAction.Enable(); string text4 = (LethalMin.InVRMode ? LethalMin.ChargeVRAction.InternalValue : LethalMin.ChargeAction.InternalValue); ChargeAction = new InputAction("Charge", (InputActionType)0, (string)null, (string)null, (string)null, (string)null); InputActionSetupExtensions.AddBinding(ChargeAction, text4, (string)null, (string)null, (string)null); ChargeAction.canceled -= OnCharge; ChargeAction.canceled += OnCharge; ChargeAction.Enable(); string text5 = (LethalMin.InVRMode ? LethalMin.SecondaryChargeVRAction.InternalValue : ""); if (!string.IsNullOrEmpty(text5)) { SecondaryChargeAction = new InputAction("SecondaryCharge", (InputActionType)0, (string)null, (string)null, (string)null, (string)null); InputActionSetupExtensions.AddBinding(SecondaryChargeAction, text5, (string)null, (string)null, (string)null); SecondaryChargeAction.canceled -= OnCharge; SecondaryChargeAction.canceled += OnCharge; SecondaryChargeAction.Enable(); } } else { WhistleAction = LethalMin.InputClassInstace.Whistle; WhistleAction.performed -= OnWhistleStarted; WhistleAction.canceled -= OnWhistleCanceled; WhistleAction.performed += OnWhistleStarted; WhistleAction.canceled += OnWhistleCanceled; WhistleAction.Enable(); DismissAction = LethalMin.InputClassInstace.Dismiss; DismissAction.canceled -= OnDismiss; DismissAction.canceled += OnDismiss; DismissAction.Enable(); WhistleSwitchAction = LethalMin.InputClassInstace.SwitchWhistleAud; WhistleSwitchAction.performed -= OnWhistleSoundSwitch; WhistleSwitchAction.performed += OnWhistleSoundSwitch; WhistleSwitchAction.Enable(); ChargeAction = LethalMin.InputClassInstace.Charge; ChargeAction.canceled -= OnCharge; ChargeAction.canceled += OnCharge; ChargeAction.Enable(); } SetupTooltips(); } private void SetupTooltips() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_0038: 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_0086: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) base.itemProperties.toolTips = new string[4]; if (WhistleAction.controls.Count > 0) { string displayName = WhistleAction.controls[0].displayName; base.itemProperties.toolTips[0] = "Whistle: [" + displayName + "]"; } else { base.itemProperties.toolTips[0] = "Whistle: [Not Bound]"; } if (DismissAction.controls.Count > 0) { string displayName2 = DismissAction.controls[0].displayName; base.itemProperties.toolTips[1] = "Dismiss: [" + displayName2 + "]"; } else { base.itemProperties.toolTips[1] = "Dismiss: [Not Bound]"; } if (ChargeAction.controls.Count > 0) { string displayName3 = ChargeAction.controls[0].displayName; base.itemProperties.toolTips[2] = "Charge: [" + displayName3 + "]"; } else { base.itemProperties.toolTips[2] = "Charge: [Not Bound]"; } if (WhistleSwitchAction.controls.Count > 0) { string displayName4 = WhistleSwitchAction.controls[0].displayName; base.itemProperties.toolTips[3] = "Switch Whistle Sound: " + displayName4; } else { base.itemProperties.toolTips[3] = "Switch Whistle Sound: [Not Bound]"; } } public void OnWhistleStarted(CallbackContext callbackContext) { if (((NetworkBehaviour)this).IsOwner && !base.isPocketed && base.isHeld && !StartOfRound.Instance.localPlayerController.quickMenuManager.isMenuOpen) { WhistleUseOnLocalClient(IsButtonDown: true); WhistleUseServerRpc(IsButtonDown: true); } } public void OnWhistleCanceled(CallbackContext callbackContext) { if (((NetworkBehaviour)this).IsOwner && !base.isPocketed && base.isHeld && !StartOfRound.Instance.localPlayerController.quickMenuManager.isMenuOpen) { WhistleUseOnLocalClient(IsButtonDown: false); WhistleUseServerRpc(IsButtonDown: false); } } public void OnDismiss(CallbackContext callbackContext) { if (((NetworkBehaviour)this).IsOwner && !base.isPocketed && base.isHeld && !StartOfRound.Instance.localPlayerController.quickMenuManager.isMenuOpen) { DismissOnLocalClient(); DismissUseServerRpc(); } } public void OnWhistleSoundSwitch(CallbackContext callbackContext) { if (((NetworkBehaviour)this).IsOwner && !base.isPocketed && base.isHeld && !StartOfRound.Instance.localPlayerController.quickMenuManager.isMenuOpen) { NetworkVariable currentSoundPackIndex = CurrentSoundPackIndex; int value = currentSoundPackIndex.Value; currentSoundPackIndex.Value = value + 1; if (PikUtils.IsOutOfRange(Sounds, CurrentSoundPackIndex.Value)) { CurrentSoundPackIndex.Value = 0; } LethalMin.CurWhistPack.Entry.Value = CurrentSoundPackIndex.Value; noticeZone.LeaderScript.CurrentWhistleIndex = LethalMin.CurWhistPack.Entry.Value; LethalMin.Logger.LogInfo((object)$"Set Whistle index to: {LethalMin.CurWhistPack.Entry.Value}"); } } public void OnCharge(CallbackContext callbackContext) { //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner || base.isPocketed || !base.isHeld || StartOfRound.Instance.localPlayerController.quickMenuManager.isMenuOpen || ((Object)(object)PikminManager.instance.LocalLeader.glowmob != (Object)null && PikminManager.instance.LocalLeader.glowmob.IsDoingGlowmob) || (Object)(object)base.playerHeldBy == (Object)null || (Object)(object)playerCamera == (Object)null) { return; } if (LethalMin.InVRMode && SecondaryChargeAction != null && ((((CallbackContext)(ref callbackContext)).action == ChargeAction && !SecondaryChargeAction.IsPressed()) || (((CallbackContext)(ref callbackContext)).action == SecondaryChargeAction && !ChargeAction.IsPressed()))) { LethalMin.Logger.LogDebug((object)"Awaiting Second Charge Input"); return; } if (ChargeCooldown > 0f) { ChargeUse(); ChargeUseRpc(); return; } Vector3 val = ((LethalMin.InVRMode && !LethalMin.DisableWhistleFix.InternalValue) ? ((Component)this).transform.forward : ((Component)playerCamera).transform.forward); Vector3 val2 = ((LethalMin.InVRMode && !LethalMin.DisableWhistleFix.InternalValue) ? ((Component)this).transform.position : ((Component)playerCamera).transform.position); float num = ((PikminManager.instance.Cheat_ChargeDistance.Value == -1f) ? 15f : PikminManager.instance.Cheat_ChargeDistance.Value); Vector3 val3 = val2 + val * num; Vector3 val4 = val3; RaycastHit val5 = default(RaycastHit); if (Physics.Raycast(val2, val, ref val5, num, LayerMask.op_Implicit(collidersAndRoomMask), (QueryTriggerInteraction)1)) { if (!((RaycastHit)(ref val5)).collider.isTrigger) { LethalMin.Logger.LogInfo((object)$"WhistleItem: Charge raycast hit at {((RaycastHit)(ref val5)).point} by {((Object)((Component)((RaycastHit)(ref val5)).collider).gameObject).name}"); val4 = ((RaycastHit)(ref val5)).point + ((RaycastHit)(ref val5)).normal * 0.05f; } } else if (Physics.Raycast(val3, Vector3.down, ref val5, maxRaycastDistance, LayerMask.op_Implicit(collidersAndRoomMask), (QueryTriggerInteraction)1) && !((RaycastHit)(ref val5)).collider.isTrigger) { LethalMin.Logger.LogInfo((object)$"WhistleItem: Charge downward raycast hit at {((RaycastHit)(ref val5)).point} by {((Object)((Component)((RaycastHit)(ref val5)).collider).gameObject).name}"); val4 = ((RaycastHit)(ref val5)).point + ((RaycastHit)(ref val5)).normal * 0.05f; } NavMeshHit val6 = default(NavMeshHit); if (NavMesh.SamplePosition(val4, ref val6, 5f, -1)) { val4 = ((NavMeshHit)(ref val6)).position; } ChargeUse(val4); ChargeUseRpc(val4); } [Rpc(/*Could not decode attribute arguments.*/)] public void ChargeUseRpc(Vector3 ChargePos) { //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_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_00b9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4152762368u, val2, val, (SendTo)1, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref ChargePos); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4152762368u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ChargeUse(ChargePos); } } } public void ChargeUse(Vector3 ChargePos) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) ChargeCooldown = ((PikminManager.instance.Cheat_ChargeCoolDown.Value == -1f) ? 0.1f : PikminManager.instance.Cheat_ChargeCoolDown.Value); LethalMin.Logger.LogInfo((object)$"WhistleItem: ChargeUse at position {ChargePos} by {base.playerHeldBy?.playerUsername}"); OverridePikminPosition value = new OverridePikminPosition("WhisCharge", ChargePos, useTimer: true, 4f, 0.1f); audioSource.PlayOneShot(chargeSound); if ((Object)(object)WhistleAnim != (Object)null) { WhistleAnim.SetTrigger("char"); } if (((NetworkBehaviour)this).IsOwner && (!LethalMin.InVRMode || !LethalMin.DisableChargeMotionBlur)) { ((MonoBehaviour)PikminManager.instance).StartCoroutine(PikminManager.instance.TweenChargeWeight(1f, 0.25f, autoFadeOut: true, 0.5f)); } foreach (PikminAI item in noticeZone.LeaderScript.PikminInSquad) { float overrideVolume = (((Object)(object)item.leader == (Object)null || item.leader.PikminInSquad.Count == 0) ? 1f : (1f / (float)item.leader.PikminInSquad.Count)); item.PlayAudioOnLocalClient(PikminSoundPackSounds.Charge.ToString(), PlayOnVoice: true, overrideVolume); item.PlayAnimation(item.animController.AnimPack.EditorNoticeAnim); if (!((NetworkBehaviour)item).IsOwner) { continue; } if (Vector3.Distance(((Component)item).transform.position, ((Component)noticeZone.LeaderScript).transform.position) > 30f) { LethalMin.Logger.LogInfo((object)("WhistleItem: ChargeUse - " + ((Object)item).name + " is too far away, skipping charge.")); continue; } if (item.OverrideFollowPosition.HasValue && item.OverrideFollowPosition.Value.ID == "MoveToVPoint") { LethalMin.Logger.LogInfo((object)(item.DebugID + ": Charge interrupted by vehicle")); continue; } item.OverrideFollowPosition = value; if (item.chargeRoutine != null) { ((MonoBehaviour)item).StopCoroutine(item.chargeRoutine); item.chargeRoutine = null; } item.chargeRoutine = ((MonoBehaviour)item).StartCoroutine(item.DoCharge(4f)); } } [Rpc(/*Could not decode attribute arguments.*/)] public void ChargeUseRpc() { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(420686007u, val2, val, (SendTo)1, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 420686007u, val2, val, (SendTo)1, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ChargeUse(); } } } public void ChargeUse() { if ((Object)(object)WhistleAnim != (Object)null) { WhistleAnim.SetTrigger("diss"); } audioSource.PlayOneShot(chargeFailSound); } [ServerRpc] public void DismissUseServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3675867265u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3675867265u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DismissUseClientRpc(); } } [ClientRpc] public void DismissUseClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1941159571u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1941159571u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { DismissOnLocalClient(); } } } public void DismissOnLocalClient() { //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0369: 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_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039d: 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_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) curPack = Sounds[CurrentSoundPackIndex.Value]; audioSource.PlayOneShot(curPack.DismissSound); if ((Object)(object)WhistleAnim != (Object)null) { WhistleAnim.SetTrigger("diss"); } if (!((Object)(object)noticeZone.LeaderScript != (Object)null)) { return; } List list = new List(noticeZone.LeaderScript.PikminInSquad); noticeZone.LeaderScript.RemoveAllPikminFromSquadOnLocalClient(); if (!LethalMin.DisperseWhenDismissed.InternalValue) { foreach (PikminAI item in list) { if ((Object)(object)item != (Object)null) { item.LeaderAssesmentDelay = LethalMin.DismissWindownTime; } } return; } Dictionary> dictionary = new Dictionary>(); foreach (PikminAI item2 in list) { if ((Object)(object)item2 != (Object)null && (Object)(object)item2.pikminType != (Object)null) { if (!dictionary.ContainsKey(item2.pikminType)) { dictionary[item2.pikminType] = new List(); } dictionary[item2.pikminType].Add(item2); } } int count = dictionary.Count; if (count <= 0) { return; } Vector3 val = Vector3.zero; int num = 0; foreach (KeyValuePair> item3 in dictionary) { foreach (PikminAI item4 in item3.Value) { val += ((Component)item4).transform.position; num++; } } if (num <= 0) { return; } val /= (float)num; float num2 = 4f; float num3 = 180f; Vector3 position = ((Component)noticeZone.LeaderScript).transform.position; Vector3 val2 = val - position; Vector3 normalized = ((Vector3)(ref val2)).normalized; normalized.y = 0f; Quaternion val3; if (normalized != Vector3.zero) { val3 = Quaternion.LookRotation(-normalized); } else { LethalMin.Logger.LogWarning((object)"Direction to average position is zero, using player's rotation for formation."); val3 = ((Component)noticeZone.LeaderScript).transform.rotation; } Dictionary dictionary2 = new Dictionary(); int num4 = 0; Vector3 val4 = default(Vector3); NavMeshHit val7 = default(NavMeshHit); RaycastHit val8 = default(RaycastHit); foreach (KeyValuePair> item5 in dictionary) { PikminType key = item5.Key; float num5 = num3 / (float)((count - 1 <= 0) ? 1 : (count - 1)); float num6 = (0f - num3) / 2f + (float)num4 * num5; float num7 = num6 * (MathF.PI / 180f); ((Vector3)(ref val4))..ctor(Mathf.Sin(num7) * num2, 0f, (0f - Mathf.Cos(num7)) * num2); Vector3 val5 = val3 * val4; Vector3 val6 = val + val5; if (NavMesh.SamplePosition(val6, ref val7, 5f, -1)) { val6 = ((!Physics.Linecast(val + Vector3.up, ((NavMeshHit)(ref val7)).position + Vector3.up, ref val8, LayerMask.op_Implicit(LethalMin.PikminColideable))) ? ((NavMeshHit)(ref val7)).position : ((RaycastHit)(ref val8)).point); } dictionary2[key] = val6; num4++; } foreach (PikminAI item6 in list) { if ((Object)(object)item6 != (Object)null && (Object)(object)item6.pikminType != (Object)null && dictionary2.ContainsKey(item6.pikminType)) { item6.LeaderAssesmentDelay = LethalMin.DismissWindownTime; item6.OverrideIdlePosition = new OverridePikminPosition("WhisDismiss", dictionary2[item6.pikminType], useTimer: true, 2f, 2f); } } } [ServerRpc] public void WhistleUseServerRpc(bool IsButtonDown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1358102987u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref IsButtonDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1358102987u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; WhistleUseClientRpc(IsButtonDown); } } [ClientRpc] public void WhistleUseClientRpc(bool IsButtonDown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1850306144u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref IsButtonDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1850306144u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { WhistleUseOnLocalClient(IsButtonDown); } } } public void WhistleUseOnLocalClient(bool IsButtonDown) { isWhistling = IsButtonDown; if (IsButtonDown) { if (whistleZoneTween != null) { ((MonoBehaviour)this).StopCoroutine(whistleZoneTween); whistleZoneTween = null; } if (whistleAudioRutine != null) { ((MonoBehaviour)this).StopCoroutine(whistleAudioRutine); whistleAudioRutine = null; } whistleAudioRutine = ((MonoBehaviour)this).StartCoroutine(StartWhistAudio()); whistleZoneTween = ((MonoBehaviour)this).StartCoroutine(TweenSize()); } else { audioSource.Stop(); } } [IteratorStateMachine(typeof(d__47))] private IEnumerator StartWhistAudio() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__47(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__48))] private IEnumerator TweenSize() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__48(0) { <>4__this = this }; } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); if ((Object)(object)base.playerHeldBy != (Object)null) { noticeZone.LeaderScript = ((Component)base.playerHeldBy).GetComponent(); playerCamera = base.playerHeldBy.gameplayCamera; } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); playerCamera = null; } private void UpdateWhistleZonePosition() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_018f: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.playerHeldBy == (Object)null || (Object)(object)noticeZone == (Object)null || (Object)(object)playerCamera == (Object)null) { return; } Vector3 val = ((LethalMin.InVRMode && !LethalMin.DisableWhistleFix.InternalValue) ? ((Component)this).transform.forward : ((Component)playerCamera).transform.forward); Vector3 val2 = ((LethalMin.InVRMode && !LethalMin.DisableWhistleFix.InternalValue) ? ((Component)this).transform.position : ((Component)playerCamera).transform.position); Vector3 val3 = val2 + val * whistleZoneOffset; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val2, val, ref val4, whistleZoneOffset, LayerMask.op_Implicit(collidersAndRoomMask), (QueryTriggerInteraction)1)) { if (!((RaycastHit)(ref val4)).collider.isTrigger) { ((Component)noticeZone).transform.position = ((RaycastHit)(ref val4)).point + ((RaycastHit)(ref val4)).normal * 0.05f; } } else if (Physics.Raycast(val3, Vector3.down, ref val4, maxRaycastDistance, LayerMask.op_Implicit(collidersAndRoomMask), (QueryTriggerInteraction)1)) { if (!((RaycastHit)(ref val4)).collider.isTrigger) { ((Component)noticeZone).transform.position = ((RaycastHit)(ref val4)).point + ((RaycastHit)(ref val4)).normal * 0.05f; } } else { ((Component)noticeZone).transform.position = val3; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); noticeZone.LeaderScript = ((Component)base.playerHeldBy).GetComponentInChildren(); if (((NetworkBehaviour)this).IsOwner) { CurrentSoundPackIndex.Value = noticeZone.LeaderScript.CurrentWhistleIndex; } curPack = Sounds[CurrentSoundPackIndex.Value]; } public override void EnableItemMeshes(bool enable) { ((GrabbableObject)this).EnableItemMeshes(enable); MeshRenderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { if (!((Component)componentsInChildren[i]).gameObject.activeSelf && !((Component)componentsInChildren[i]).gameObject.CompareTag("DoNotSet") && !((Component)componentsInChildren[i]).gameObject.CompareTag("InteractTrigger")) { ((Renderer)componentsInChildren[i]).enabled = enable; } } SkinnedMeshRenderer[] componentsInChildren2 = ((Component)this).gameObject.GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren2.Length; j++) { if (!((Component)componentsInChildren2[j]).gameObject.activeSelf) { ((Renderer)componentsInChildren2[j]).enabled = enable; } } } protected override void __initializeVariables() { if (CurrentSoundPackIndex == null) { throw new Exception("WhistleItem.CurrentSoundPackIndex cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)CurrentSoundPackIndex).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)CurrentSoundPackIndex, "CurrentSoundPackIndex"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)CurrentSoundPackIndex); ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4152762368u, new RpcReceiveHandler(__rpc_handler_4152762368), "ChargeUseRpc"); ((NetworkBehaviour)this).__registerRpc(420686007u, new RpcReceiveHandler(__rpc_handler_420686007), "ChargeUseRpc"); ((NetworkBehaviour)this).__registerRpc(3675867265u, new RpcReceiveHandler(__rpc_handler_3675867265), "DismissUseServerRpc"); ((NetworkBehaviour)this).__registerRpc(1941159571u, new RpcReceiveHandler(__rpc_handler_1941159571), "DismissUseClientRpc"); ((NetworkBehaviour)this).__registerRpc(1358102987u, new RpcReceiveHandler(__rpc_handler_1358102987), "WhistleUseServerRpc"); ((NetworkBehaviour)this).__registerRpc(1850306144u, new RpcReceiveHandler(__rpc_handler_1850306144), "WhistleUseClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_4152762368(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 chargePos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref chargePos); target.__rpc_exec_stage = (__RpcExecStage)1; ((WhistleItem)(object)target).ChargeUseRpc(chargePos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_420686007(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; ((WhistleItem)(object)target).ChargeUseRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3675867265(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((WhistleItem)(object)target).DismissUseServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1941159571(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; ((WhistleItem)(object)target).DismissUseClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1358102987(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { bool isButtonDown = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isButtonDown, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WhistleItem)(object)target).WhistleUseServerRpc(isButtonDown); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1850306144(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 isButtonDown = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isButtonDown, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WhistleItem)(object)target).WhistleUseClientRpc(isButtonDown); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "WhistleItem"; } } [CreateAssetMenu(fileName = "WhistleSoundPack", menuName = "Pikmin/WhistlePack", order = 0)] public class WhistleSoundPack : ScriptableObject { public AudioClip StartSound = null; public AudioClip LoopSound = null; public AudioClip DismissSound = null; } public class FlyingNavAgentController : MonoBehaviour { [Header("References")] public NavMeshAgent GroundAgent = null; [Header("Flying Settings")] public float baseFlightHeight = 2f; public float maxFlightHeight = 9999f; public float ceilingDistance = 1f; public float MinFlightHeight = -9999f; public LayerMask ceilingLayerMask = LayerMask.op_Implicit(-1); public bool EnableFlying = true; [Header("Easing Settings")] public float positionEaseSpeed = 5f; public float rotationEaseSpeed = 8f; public float heightEaseSpeed = 3f; [Header("Obstacle Handling")] public float bodyClearanceRadius = 0.3f; public float openSkyProbeDistance = 30f; [Header("Shortcut Override")] public Vector3? ShortcutTarget = null; [Header("Debug Visualization")] public bool showGizmos = true; public Color flightPathColor = Color.cyan; public Color ceilingRayColor = Color.red; public Color targetPositionColor = Color.green; public Color groundAgentColor = Color.blue; private Vector3 targetPosition; private Quaternion targetRotation; private float targetHeight; private float desiredHeight; private void Start() { //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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GroundAgent == (Object)null) { Debug.LogError((object)"GroundAgent is not assigned!"); return; } targetPosition = ((Component)this).transform.position; targetRotation = ((Component)this).transform.rotation; targetHeight = baseFlightHeight; } private void Update() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GroundAgent == (Object)null) { return; } CalculateTargetPosition(); ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, targetPosition, positionEaseSpeed * Time.deltaTime); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, targetRotation, rotationEaseSpeed * Time.deltaTime); if (EnableFlying && !ShortcutTarget.HasValue) { Vector3 position = ((Component)this).transform.position; Vector3 trackedXZ = GetTrackedXZ(); float num = SampleCeilingY(new Vector3(trackedXZ.x, position.y, trackedXZ.z), ((Component)GroundAgent).transform.position.y, treatOpenSkyAsCeiling: false); if (!float.IsPositiveInfinity(num) && position.y > num) { position.y = num; ((Component)this).transform.position = position; } } } private Vector3 GetTrackedXZ() { //IL_0029: 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_0016: 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_0031: Unknown result type (might be due to invalid IL or missing references) if (ShortcutTarget.HasValue) { return ShortcutTarget.Value; } return ((Component)GroundAgent).transform.position; } private void CalculateTargetPosition() { //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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_0038: 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_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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) targetRotation = ((Component)GroundAgent).transform.rotation; if (!EnableFlying) { targetPosition = ((Component)GroundAgent).transform.position; targetHeight = ((Component)GroundAgent).transform.position.y; ShortcutTarget = null; return; } Vector3 position = ((Component)GroundAgent).transform.position; if (GroundAgent.isOnOffMeshLink) { GroundAgent.CompleteOffMeshLink(); } Vector3 trackedXZ = GetTrackedXZ(); float num = (ShortcutTarget.HasValue ? ShortcutTarget.Value.y : position.y); desiredHeight = num + baseFlightHeight; desiredHeight = Mathf.Clamp(desiredHeight, num, num + maxFlightHeight); if (MinFlightHeight > -9998f) { desiredHeight = Mathf.Max(desiredHeight, MinFlightHeight); } targetHeight = Mathf.Lerp(targetHeight, desiredHeight, heightEaseSpeed * Time.deltaTime); Vector3 flyPos = default(Vector3); ((Vector3)(ref flyPos))..ctor(trackedXZ.x, targetHeight, trackedXZ.z); if (!ShortcutTarget.HasValue) { AdjustForCeiling(ref flyPos, num); } AdjustForFloor(ref flyPos, num); targetPosition = flyPos; } private void AdjustForCeiling(ref Vector3 flyPos, float groundY) { //IL_003b: 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_005b: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(bodyClearanceRadius, 0.05f); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(flyPos.x, groundY + num + 0.05f, flyPos.z); float num2 = flyPos.y + ceilingDistance - val.y; RaycastHit val2 = default(RaycastHit); if (num2 <= 0f || !Physics.SphereCast(val, num, Vector3.up, ref val2, num2, LayerMask.op_Implicit(ceilingLayerMask), (QueryTriggerInteraction)1)) { return; } float num3 = groundY + maxFlightHeight; if (IsOpenSkyAbove(((RaycastHit)(ref val2)).point, num)) { float num4 = ((RaycastHit)(ref val2)).point.y + num * 2f + 0.5f; if (num4 <= num3) { if (flyPos.y < num4) { flyPos.y = num4; } if (targetHeight < num4) { targetHeight = num4; } return; } } float num5 = ((RaycastHit)(ref val2)).point.y - ceilingDistance; if (flyPos.y > num5) { flyPos.y = num5; targetHeight = num5; } } private bool IsOpenSkyAbove(Vector3 point, float radius) { //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_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) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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) Vector3 val = point + Vector3.up * (radius * 2f + 0.25f); RaycastHit val2 = default(RaycastHit); return !Physics.SphereCast(val, radius * 0.9f, Vector3.up, ref val2, openSkyProbeDistance, LayerMask.op_Implicit(ceilingLayerMask), (QueryTriggerInteraction)1); } private float SampleCeilingY(Vector3 atPosition, float groundY, bool treatOpenSkyAsCeiling) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_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_0091: 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) float num = Mathf.Max(bodyClearanceRadius, 0.05f); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(atPosition.x, groundY + num + 0.05f, atPosition.z); float num2 = atPosition.y + ceilingDistance - val.y; if (num2 <= 0f) { return float.PositiveInfinity; } RaycastHit val2 = default(RaycastHit); if (!Physics.SphereCast(val, num, Vector3.up, ref val2, num2, LayerMask.op_Implicit(ceilingLayerMask), (QueryTriggerInteraction)1)) { return float.PositiveInfinity; } if (!treatOpenSkyAsCeiling && IsOpenSkyAbove(((RaycastHit)(ref val2)).point, num)) { return float.PositiveInfinity; } return ((RaycastHit)(ref val2)).point.y - ceilingDistance; } private void AdjustForFloor(ref Vector3 flyPos, float groundY) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) float num = groundY; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(flyPos.x, flyPos.y + Mathf.Max(baseFlightHeight, 2f) + 1f, flyPos.z); float num2 = val.y - (groundY - 1f); RaycastHit val2 = default(RaycastHit); if (num2 > 0f && Physics.Raycast(val, Vector3.down, ref val2, num2, LayerMask.op_Implicit(ceilingLayerMask), (QueryTriggerInteraction)1) && ((RaycastHit)(ref val2)).point.y > num) { num = ((RaycastHit)(ref val2)).point.y; } if (MinFlightHeight > -9998f && num < MinFlightHeight) { num = MinFlightHeight; } if (flyPos.y < num) { flyPos.y = num; targetHeight = num; } } public Vector3 GetCurrentAgentCorner() { //IL_0011: 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) //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_0070: 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_0076: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a2: 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_00ce: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GroundAgent == (Object)null) { return Vector3.zero; } if (GroundAgent.path.corners.Length == 0) { return ((Component)GroundAgent).transform.position; } Vector3 position = ((Component)GroundAgent).transform.position; Vector3 val = GroundAgent.path.corners[0]; float num = Vector3.Distance(position, val); Vector3[] corners = GroundAgent.path.corners; foreach (Vector3 val2 in corners) { float num2 = Vector3.Distance(position, val2); if (num2 < num) { num = num2; val = val2; } } return val; } private void OnDrawGizmos() { //IL_0017: 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_0033: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)GroundAgent == (Object)null)) { Gizmos.color = flightPathColor; Gizmos.DrawLine(((Component)GroundAgent).transform.position, targetPosition); Gizmos.color = ceilingRayColor; Gizmos.DrawLine(((Component)GroundAgent).transform.position, new Vector3(((Component)GroundAgent).transform.position.x, ((Component)GroundAgent).transform.position.y + targetHeight, ((Component)GroundAgent).transform.position.z)); Gizmos.color = targetPositionColor; Gizmos.DrawSphere(targetPosition, 0.1f); Gizmos.color = groundAgentColor; Gizmos.DrawSphere(((Component)GroundAgent).transform.position, 0.1f); if (ShortcutTarget.HasValue) { Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(ShortcutTarget.Value, 0.4f); Gizmos.DrawLine(((Component)this).transform.position, ShortcutTarget.Value); } } } } public class WingedPikminAI : PikminAI { private List NoFlyOffsetStates = new List { 3, 4, 5 }; private Vector3? activeShortcut = null; private float shortcutCooldown = 0f; private const float SHORTCUT_DETOUR_RATIO = 1.6f; private const float SHORTCUT_LANDING_SAMPLE_RADIUS = 8f; private const float SHORTCUT_CLEARANCE_RADIUS = 0.35f; private const float SHORTCUT_ARRIVE_XZ = 1.5f; public FlyingNavAgentController FlyingNavAgentController { get; private set; } = null; public NoticeZoneOnlyDetect NoticeZoneOnlyDetect { get; private set; } = null; public override void Start() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) base.Start(); FlyingNavAgentController = ((Component)this).gameObject.AddComponent(); GameObject val = new GameObject(((Object)((Component)this).gameObject).name + "_NavAgent"); val.transform.position = ((Component)this).transform.position; NavMeshAgent val2 = val.AddComponent(); val2.speed = 12f; val2.angularSpeed = 500f; val2.acceleration = 500f; val2.stoppingDistance = 0f; val2.radius = 0.5f; val2.height = 1.75f; val2.avoidancePriority = 100; val2.baseOffset = 0f; Object.Destroy((Object)(object)((EnemyAI)this).agent); ((EnemyAI)this).agent = val2; FlyingNavAgentController.GroundAgent = val2; FlyingNavAgentController.ceilingLayerMask = LayerMask.op_Implicit(StartOfRound.Instance.collidersRoomDefaultAndFoliage); GameObject val3 = Object.Instantiate(((Component)((Component)this).gameObject.GetComponentInChildren()).gameObject, ((Component)this).transform); ((Object)val3).name = "WingedPikminNoticeZoneOnlyDetect"; PikminCollisionDetect pikminCollisionDetect = default(PikminCollisionDetect); if (val3.TryGetComponent(ref pikminCollisionDetect)) { Object.Destroy((Object)(object)pikminCollisionDetect); } NoticeZoneOnlyDetect = val3.AddComponent(); NoticeZoneOnlyDetect.mainPikmin = this; TempObjects.Add(val); } public override void Update() { //IL_0035: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) base.Update(); ((Behaviour)FlyingNavAgentController).enabled = ((Behaviour)((EnemyAI)this).agent).enabled; ((Component)NoticeZoneOnlyDetect).transform.position = ((Component)((EnemyAI)this).agent).transform.position; if (!((Behaviour)((EnemyAI)this).agent).enabled) { ((Component)((EnemyAI)this).agent).transform.position = ((Component)this).transform.position; ClearShortcut(); } if (!activeShortcut.HasValue) { return; } Vector3 value = activeShortcut.Value; Vector3 position = ((Component)this).transform.position; float num = value.x - position.x; float num2 = value.z - position.z; if (num * num + num2 * num2 <= 2.25f) { if (((Behaviour)((EnemyAI)this).agent).enabled && ((EnemyAI)this).agent.isOnNavMesh) { ((EnemyAI)this).agent.Warp(value); } ClearShortcut(); } } public override void DoAIInterval() { FlyingNavAgentController.baseFlightHeight = GetFlightHeight(); FlyingNavAgentController.MinFlightHeight = GetMinFlightHeight(); FlyingNavAgentController.EnableFlying = ShouldFly(); if (shortcutCooldown > 0f) { shortcutCooldown -= ((EnemyAI)this).AIIntervalTime + 0.015f; } base.DoAIInterval(); TryUpdateShortcut(); } private void ClearShortcut() { if (activeShortcut.HasValue || FlyingNavAgentController.ShortcutTarget.HasValue) { activeShortcut = null; FlyingNavAgentController.ShortcutTarget = null; } } private void TryUpdateShortcut() { //IL_00eb: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_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_009b: 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_00bb: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Invalid comparison between Unknown and I4 //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) if (!ShouldFly()) { ClearShortcut(); } else if (!((Behaviour)((EnemyAI)this).agent).enabled || !((EnemyAI)this).agent.isOnNavMesh) { ClearShortcut(); } else { if (((EnemyAI)this).agent.pathPending || shortcutCooldown > 0f) { return; } if (activeShortcut.HasValue) { Vector3 value = activeShortcut.Value; if (!(Vector3.Distance(value, ((EnemyAI)this).agent.destination) > 12f) && IsFlightLineClear(((Component)this).transform.position, value)) { return; } ClearShortcut(); } Vector3 destination = ((EnemyAI)this).agent.destination; Vector3 position = ((Component)this).transform.position; float num = Vector3.Distance(position, destination); if (num < 4f) { return; } bool flag = ((EnemyAI)this).agent.hasPath && (int)((EnemyAI)this).agent.pathStatus == 0; float num2 = (flag ? ComputePathLength(((EnemyAI)this).agent.path) : float.PositiveInfinity); NavMeshHit val = default(NavMeshHit); if ((!flag || !(num2 < num * 1.6f)) && NavMesh.SamplePosition(destination, ref val, 8f, ((EnemyAI)this).agent.areaMask)) { Vector3 position2 = ((NavMeshHit)(ref val)).position; if (Vector3.Distance(position2, ((Component)((EnemyAI)this).agent).transform.position) < 2f) { shortcutCooldown = 0.5f; return; } if (!IsFlightLineClear(position, position2)) { shortcutCooldown = 0.5f; return; } activeShortcut = position2; FlyingNavAgentController.ShortcutTarget = position2; } } } private bool IsFlightLineClear(Vector3 from, Vector3 landing) { //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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_007d: 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_008c: 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_0093: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_00bc: 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_00c9: Unknown result type (might be due to invalid IL or missing references) LayerMask ceilingLayerMask = FlyingNavAgentController.ceilingLayerMask; float num = Mathf.Max(GetFlightHeight(), 1.5f); Vector3 val = landing + Vector3.up * num; Vector3 val2 = val - from; float magnitude = ((Vector3)(ref val2)).magnitude; RaycastHit val3 = default(RaycastHit); if (magnitude > 0.01f && Physics.SphereCast(from, 0.35f, val2 / magnitude, ref val3, magnitude, LayerMask.op_Implicit(ceilingLayerMask), (QueryTriggerInteraction)1)) { return false; } Vector3 val4 = landing + Vector3.up * 0.1f; Vector3 val5 = val4 - val; float magnitude2 = ((Vector3)(ref val5)).magnitude; if (magnitude2 > 0.01f && Physics.SphereCast(val, 0.35f, val5 / magnitude2, ref val3, magnitude2, LayerMask.op_Implicit(ceilingLayerMask), (QueryTriggerInteraction)1)) { return false; } return true; } private static float ComputePathLength(NavMeshPath path) { //IL_0033: 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) if (path == null || path.corners.Length < 2) { return 0f; } float num = 0f; for (int i = 1; i < path.corners.Length; i++) { num += Vector3.Distance(path.corners[i - 1], path.corners[i]); } return num; } private bool ShouldFly() { if (Laying) { return false; } if (((EnemyAI)this).currentBehaviourStateIndex == 3) { return false; } if ((Object)(object)TargetItem != (Object)null && !AllWingedPikminOnItem(TargetItem)) { return false; } return true; } private float GetMinFlightHeight() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)((EnemyAI)this).agent).transform.position; Vector3 position2 = ((Component)this).transform.position; float num = Mathf.Abs(position2.y - position.y) + 5f; int mask = LayerMask.GetMask(new string[1] { "Triggers" }); RaycastHit val = default(RaycastHit); QuicksandTrigger val2 = default(QuicksandTrigger); if (Physics.Raycast(position2, Vector3.down, ref val, num, mask, (QueryTriggerInteraction)2) && ((Component)((RaycastHit)(ref val)).collider).TryGetComponent(ref val2) && val2.isWater) { float y = ((RaycastHit)(ref val)).point.y; return y + 2f; } return -9999f; } private float GetFlightHeight() { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)this).currentBehaviourStateIndex == 1) { return OverrideFollowPosition.HasValue ? 0f : 4f; } if (((EnemyAI)this).currentBehaviourStateIndex == 2 && (Object)(object)TargetItem != (Object)null && !TargetItem.PikminOnItem.Contains(this)) { return 0f; } if (((EnemyAI)this).currentBehaviourStateIndex == 2 && (Object)(object)TargetItem != (Object)null && (Object)(object)TargetItem.PrimaryPikminOnItem == (Object)(object)this && TargetItem.CurrentRoute != null) { return TargetItem.CurrentRoute.Nodes[TargetItem.CurrentRoute.CurrentNodeIndex].IsPikminNearNode(this, 10f) ? 0f : 4f; } if (((EnemyAI)this).currentBehaviourStateIndex == 2 && (Object)(object)TargetEnemy != (Object)null) { float y = ((Component)TargetEnemy).transform.position.y; float y2 = ((Component)((EnemyAI)this).agent).transform.position.y; float num = y - y2; if (num > 1f) { return num + 1f; } return 2f; } if (NoFlyOffsetStates.Contains(((EnemyAI)this).currentBehaviourStateIndex)) { return 0f; } return 2f; } protected override Vector3 GetCarrySnapPosition() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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) return ((Component)TargetItemPoint).transform.position; } public static bool AllWingedPikminOnItem(PikminItem itm) { if (itm.PikminOnItem.Count == 0) { return false; } if (itm.PikminOnItem.Count == 1 && itm.PrimaryPikminOnItem is WingedPikminAI) { return true; } foreach (PikminAI item in itm.PikminOnItem) { if (!(item is WingedPikminAI)) { return false; } } return true; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "WingedPikminAI"; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "NoteBoxz.LethalMin"; public const string PLUGIN_NAME = "LethalMin"; public const string PLUGIN_VERSION = "1.1.0"; } } namespace LethalMin.Utils { public class AnimStateVisualizer : MonoBehaviour { } public class BetterButton : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IPointerUpHandler { public Button baseButton = null; private bool isHeld = false; private float holdTime = 0f; private bool _visuallyDisabled = false; private ColorBlock _originalColors; [SerializeField] private float minimumHoldTime = 0.1f; private void Start() { //IL_0053: 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) Button component = ((Component)this).GetComponent