Decompiled source of SCP3166 v1.0.1
plugins/ProjectSCP.SCP3166.dll
Decompiled 2 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using Dawn; using Dawn.Utils; using Dusk; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using ProjectSCP.SCP3166.NetcodePatcher; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Animations.Rigging; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ProjectSCP.SCP3166")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1+34f21188a8b367da196f577084717c38e72d28eb")] [assembly: AssemblyProduct("SCP3166")] [assembly: AssemblyTitle("ProjectSCP.SCP3166")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SCP3166 { internal class GarfieldPhoneBehavior : PhysicsProp { public enum State { Off, Main, Orbit } [CompilerGenerated] private sealed class <LocateLasagnaCoroutine>d__28 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GarfieldPhoneBehavior <>4__this; private float <waitTimeIntervals>5__1; private List<LasagnaBehavior>.Enumerator <>s__2; private LasagnaBehavior <lasagna>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LocateLasagnaCoroutine>d__28(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__2 = default(List<LasagnaBehavior>.Enumerator); <lasagna>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <waitTimeIntervals>5__1 = 1f; ((TMP_Text)<>4__this.LocatingLasagnaText).text = "Locating Lasagna"; <>2__current = (object)new WaitForSeconds(<waitTimeIntervals>5__1); <>1__state = 1; return true; case 1: <>1__state = -1; ((TMP_Text)<>4__this.LocatingLasagnaText).text = "Locating Lasagna."; <>2__current = (object)new WaitForSeconds(<waitTimeIntervals>5__1); <>1__state = 2; return true; case 2: <>1__state = -1; ((TMP_Text)<>4__this.LocatingLasagnaText).text = "Locating Lasagna.."; <>2__current = (object)new WaitForSeconds(<waitTimeIntervals>5__1); <>1__state = 3; return true; case 3: <>1__state = -1; ((TMP_Text)<>4__this.LocatingLasagnaText).text = "Locating Lasagna..."; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 4; return true; case 4: <>1__state = -1; if ((Object)(object)Plugin.localPlayer == (Object)(object)<>4__this.previousPlayerHeldBy) { <>s__2 = LasagnaBehavior.Instances.GetEnumerator(); try { while (<>s__2.MoveNext()) { <lasagna>5__3 = <>s__2.Current; <lasagna>5__3.ShowLocation(5f); <lasagna>5__3 = null; } } finally { ((IDisposable)<>s__2).Dispose(); } <>s__2 = default(List<LasagnaBehavior>.Enumerator); } ((TMP_Text)<>4__this.LocatingLasagnaText).text = $"Found {LasagnaBehavior.Instances.Count} lasagna"; <>2__current = (object)new WaitForSeconds(5f); <>1__state = 5; return true; case 5: <>1__state = -1; ((TMP_Text)<>4__this.LocatingLasagnaText).text = ""; <>4__this.scanningForLasagna = 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(); } } public AudioSource ItemAudio; public AudioClip WelcomeSFX; public AudioClip PingSFX; public TextMeshProUGUI GorefieldDistanceText; public TextMeshProUGUI ClosestLasagnaText; public TextMeshProUGUI LocatingLasagnaText; public GameObject FlashlightIcon; public Slider BatterySlider; public SpriteRenderer GorefieldStatusRenderer; public GameObject MainPanel; public GameObject OrbitPanel; public SCP3166AI? trackingInstance; private PlayerControllerB? previousPlayerHeldBy; public State CurrentState = State.Off; private bool flashlightToggle; private const int flashlightID = 1; private bool scanningForLasagna; private const float lasagnaDetectorTime = 5f; private const float lasagnaLocatorScanTime = 3f; public override void Start() { ((GrabbableObject)this).Start(); SwitchState(State.Off); ((GrabbableObject)this).insertedBattery.charge = 1f; } public override void Update() { //IL_0070: 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_0146: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); BatterySlider.value = ((GrabbableObject)this).insertedBattery.charge; if (StartOfRound.Instance.inShipPhase && CurrentState != State.Orbit && CurrentState != 0) { SwitchState(State.Orbit); } if (CurrentState == State.Main) { trackingInstance = SCP3166AI.Instances.GetClosestToPosition(((Component)this).transform.position, (SCP3166AI x) => ((Component)x).transform.position); float closestLasagnaDistance = GetClosestLasagnaDistance(2000f); if (closestLasagnaDistance == -1f) { ((TMP_Text)ClosestLasagnaText).text = "Closest Lasagna: N/A"; } else { ((TMP_Text)ClosestLasagnaText).text = "Closest Lasagna: " + closestLasagnaDistance.ToString("F1"); } if ((Object)(object)trackingInstance != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && ((GrabbableObject)this).isInFactory) { ((TMP_Text)GorefieldDistanceText).text = "Distance To Gorefield: " + Vector3.Distance(((Component)((GrabbableObject)this).playerHeldBy).transform.position, ((Component)trackingInstance).gameObject.transform.position).ToString("F1"); } else { ((TMP_Text)GorefieldDistanceText).text = "Distance To Gorefield: N/A"; } } } public override void ItemActivate(bool used, bool buttonDown = true) { if (buttonDown && CurrentState == State.Main && !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null)) { flashlightToggle = !flashlightToggle; FlashlightIcon.SetActive(flashlightToggle); ((GrabbableObject)this).playerHeldBy.ChangeHelmetLight(1, flashlightToggle); ((GrabbableObject)this).UseItemBatteries(false, true); } } public override void EquipItem() { ((PhysicsProp)this).EquipItem(); if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null)) { previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = true; if (!((Object)(object)Plugin.localPlayer != (Object)(object)((GrabbableObject)this).playerHeldBy)) { HUDManager.Instance.DisplayTip("Phone Tip", "Press 'E' to show lasagna through walls. Read tooltips at top right for more.", false, true, "GP_Phone_Tip1"); } } } public override void PocketItem() { SwitchState(State.Off); ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; ((GrabbableObject)this).PocketItem(); } public override void DiscardItem() { flashlightToggle = false; FlashlightIcon.SetActive(flashlightToggle); previousPlayerHeldBy.ChangeHelmetLight(1, flashlightToggle); ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; ((GrabbableObject)this).DiscardItem(); } public override void UseUpBatteries() { ((GrabbableObject)this).UseUpBatteries(); SwitchState(State.Off); } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null || scanningForLasagna || ((GrabbableObject)this).insertedBattery.empty) { return; } if (!right) { Plugin.logger.LogDebug((object)"Toggle power"); if (CurrentState == State.Off) { if (StartOfRound.Instance.inShipPhase) { SwitchState(State.Orbit); } else { SwitchState(State.Main); } } else { SwitchState(State.Off); } } else { Plugin.logger.LogDebug((object)"Locate lasagna"); if (!StartOfRound.Instance.inShipPhase && ((GrabbableObject)this).playerHeldBy.isInsideFactory && CurrentState != 0) { scanningForLasagna = true; ((MonoBehaviour)this).StartCoroutine(LocateLasagnaCoroutine()); } } } [IteratorStateMachine(typeof(<LocateLasagnaCoroutine>d__28))] private IEnumerator LocateLasagnaCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LocateLasagnaCoroutine>d__28(0) { <>4__this = this }; } public void SwitchState(State state) { Plugin.logger.LogDebug((object)("Switching state to " + state)); State currentState = CurrentState; CurrentState = state; MainPanel.SetActive(false); OrbitPanel.SetActive(false); switch (CurrentState) { case State.Off: ((GrabbableObject)this).UseItemBatteries(false, false); flashlightToggle = false; FlashlightIcon.SetActive(flashlightToggle); if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null)) { ((GrabbableObject)this).playerHeldBy.ChangeHelmetLight(1, flashlightToggle); } break; case State.Main: MainPanel.SetActive(true); ((GrabbableObject)this).UseItemBatteries(false, true); if (currentState != 0) { } break; case State.Orbit: OrbitPanel.SetActive(true); ((GrabbableObject)this).UseItemBatteries(false, true); break; } } private float GetClosestLasagnaDistance(float maxDistance) { //IL_0020: 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) float num = maxDistance; foreach (LasagnaBehavior instance in LasagnaBehavior.Instances) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)instance).transform.position); if (!(num2 > num)) { num = num2; } } if (num == maxDistance) { return -1f; } return num; } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((PhysicsProp)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "GarfieldPhoneBehavior"; } } internal class GarfieldPhoneStatusAnimator : MonoBehaviour { public GarfieldPhoneBehavior mainScript; public Animator StatusAnimator; public void Update() { if ((Object)(object)mainScript.trackingInstance != (Object)null) { StatusAnimator.SetInteger("state", ((EnemyAI)mainScript.trackingInstance).currentBehaviourStateIndex); } else { StatusAnimator.SetInteger("state", -1); } } } public class LasagnaBehavior : PhysicsProp { public Material MainMaterial; public Material OverlayMaterial; private float showLasagnaTimer; private bool showingLasagna; public static List<LasagnaBehavior> Instances { get; private set; } = new List<LasagnaBehavior>(); public override void Start() { ((GrabbableObject)this).Start(); Instances.Add(this); } public override void Update() { ((GrabbableObject)this).Update(); if (((GrabbableObject)this).isHeld) { if (showingLasagna) { showLasagnaTimer = 0f; ShowLocation(value: false); } } else if (showLasagnaTimer > 0f) { showLasagnaTimer -= Time.deltaTime; } else if (showingLasagna) { ShowLocation(value: false); } } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); Instances.Remove(this); } public void ShowLocation(float time) { showLasagnaTimer = time; ShowLocation(value: true); } public void ShowLocation(bool value) { if (((GrabbableObject)this).isHeld) { value = false; } if (value != showingLasagna) { ((Renderer)((GrabbableObject)this).mainObjectRenderer).material = (value ? OverlayMaterial : MainMaterial); showingLasagna = value; } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((PhysicsProp)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "LasagnaBehavior"; } } [BepInPlugin("ProjectSCP.SCP3166", "SCP3166", "1.0.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("ProjectSCP.SCP3166"); public static Plugin Instance { get; private set; } public static ManualLogSource logger { get; private set; } public static DuskMod Mod { get; private set; } public static PlayerControllerB localPlayer => GameNetworkManager.Instance.localPlayerController; public static bool IsServerOrHost => NetworkManager.Singleton.IsServer || NetworkManager.Singleton.IsHost; public static PlayerControllerB PlayerFromId(ulong id) { return StartOfRound.Instance.allPlayerScripts.Where((PlayerControllerB x) => x.actualClientId == id).First(); } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } logger = ((BaseUnityPlugin)Instance).Logger; harmony.PatchAll(); AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "scp3166_mainassets")); Mod = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val); Mod.RegisterContentHandlers(); InitializeNetworkBehaviours(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ProjectSCP.SCP3166 v1.0.1 has loaded!"); } private static void InitializeNetworkBehaviours() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } logger.LogDebug((object)"Finished initializing network behaviours"); } } internal class SCP3166AI : EnemyAI { public enum State { Roaming, Following, Hunger, Rage } [CompilerGenerated] private sealed class <<EatPlayerClientRpc>g__EatPlayerCoroutine|120_0>d : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB player; public float eatTime; public SCP3166AI <>4__this; private DeadBodyInfo <body>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <<EatPlayerClientRpc>g__EatPlayerCoroutine|120_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <body>5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; Plugin.logger.LogDebug((object)$"Eating player for {eatTime} seconds"); <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; ((EnemyAI)<>4__this).inSpecialAnimation = true; <body>5__1 = player.deadBody; <body>5__1.attachedTo = <>4__this.EatingPlayerTransform; <body>5__1.attachedLimb = <body>5__1.bodyParts[5]; <body>5__1.matchPositionExactly = true; ((EnemyAI)<>4__this).creatureVoice.Stop(); ((EnemyAI)<>4__this).creatureVoice.clip = <>4__this.EatingPlayerSFX; ((EnemyAI)<>4__this).creatureVoice.loop = true; ((EnemyAI)<>4__this).creatureVoice.Play(); ((EnemyAI)<>4__this).creatureAnimator.SetBool("eating", true); <>2__current = (object)new WaitForSeconds(eatTime); <>1__state = 2; return true; case 2: <>1__state = -1; <body>5__1.attachedTo = null; <body>5__1.attachedLimb = null; <body>5__1.matchPositionExactly = false; <body>5__1.DeactivateBody(false); ((EnemyAI)<>4__this).creatureAnimator.SetBool("eating", false); ((EnemyAI)<>4__this).creatureVoice.Stop(); ((EnemyAI)<>4__this).creatureVoice.loop = false; ((EnemyAI)<>4__this).inSpecialAnimation = false; <>4__this.targetPlayer = null; <>4__this.timeSinceEatingLasagna = 0f; <>4__this.playedHalfHungerSFX = false; if (<>4__this.Size + <>4__this.sizeIncreasePerLasagna <= <>4__this.maxSize) { <>4__this.Size += <>4__this.sizeIncreasePerLasagna; <>4__this.gorefieldDamage += <>4__this.damageIncreasePerLasagna; } <>4__this.timeSinceChatter = 0f; if (Plugin.IsServerOrHost) { <>4__this.PlayClip("PostEatingPlayerSFX"); } <>4__this.SwitchToBehaviourStateOnLocalClient(0); 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 <<FeedLasagnaClientRpc>g__EatLasagnaCoroutine|119_0>d : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float eatTime; public SCP3166AI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <<FeedLasagnaClientRpc>g__EatLasagnaCoroutine|119_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; Plugin.logger.LogDebug((object)$"Eating lasagna for {eatTime} seconds"); <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; ((EnemyAI)<>4__this).inSpecialAnimation = true; ((EnemyAI)<>4__this).creatureVoice.Stop(); ((EnemyAI)<>4__this).creatureVoice.clip = <>4__this.EatingLasagnaSFX; ((EnemyAI)<>4__this).creatureVoice.loop = true; ((EnemyAI)<>4__this).creatureVoice.Play(); ((EnemyAI)<>4__this).creatureAnimator.SetBool("eating", true); <>2__current = (object)new WaitForSeconds(eatTime); <>1__state = 2; return true; case 2: <>1__state = -1; ((EnemyAI)<>4__this).creatureAnimator.SetBool("eating", false); ((EnemyAI)<>4__this).creatureVoice.Stop(); ((EnemyAI)<>4__this).creatureVoice.loop = false; ((EnemyAI)<>4__this).inSpecialAnimation = false; <>4__this.targetPlayer = null; <>4__this.timeSinceEatingLasagna = 0f; <>4__this.playedHalfHungerSFX = false; if (<>4__this.Size + <>4__this.sizeIncreasePerLasagna <= <>4__this.maxSize) { <>4__this.Size += <>4__this.sizeIncreasePerLasagna; <>4__this.gorefieldDamage += <>4__this.damageIncreasePerLasagna; } <>4__this.timeSinceChatter = 0f; if (((NetworkBehaviour)<>4__this).IsServer) { <>4__this.PlayClip("PostEatingLasagnaSFX"); } <>4__this.SwitchToBehaviourStateOnLocalClient(0); if (((NetworkBehaviour)<>4__this).IsServer && <>4__this.spawnLasagnaWhenSpawned) { <>4__this.SpawnLasagna(); } 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 SmartAgentNavigator nav; public Transform turnCompass; public InteractTrigger LasagnaTrigger; public Transform EatingPlayerTransform; public AudioClip EatingPlayerSFX; public AudioClip EatingLasagnaSFX; public AudioClip[] FootstepSFX; public AudioClip[] FoundPlayerSFX; public AudioClip[] DemandLasagnaSFX; public AudioClip[] HalfHungerSFX; public AudioClip[] SmellsLasagnaSFX; public AudioClip[] FollowingChatterSFX; public AudioClip[] RageChatterSFX; public AudioClip[] StartRageSFX; public AudioClip[] PostEatingLasagnaSFX; public AudioClip[] PostEatingPlayerSFX; public AudioClip[] HurtByPlayerSFX; public AudioClip[] ShotByPlayerSFX; private Random random; private NetworkVariable<ulong> targetPlayerId = new NetworkVariable<ulong>(0uL, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public Dictionary<string, AudioClip[]> VoiceLines = new Dictionary<string, AudioClip[]>(); private float timeSinceSwitchBehavior; private float timeSinceEatingLasagna; private float timeSinceDemandLasagna; private float timeSinceDamagePlayer; private float timeSinceFollowPlayer; private float timeSinceChatter; private float nextChatterTime = 10f; private float hungerMultiplier = 1f; private bool playedHalfHungerSFX; private bool targetPlayerHasLasagna; private bool reachedPlayerWithLasagna; private float idleTime; private float currentSpeed; private Vector3 lastPosition; private int gorefieldDamage; private List<EntranceTeleport> entrances = new List<EntranceTeleport>(); private bool roaming; private int hashSpeed; private const float followDistance = 5f; private const int demandLasagnaVLAmount = 5; private readonly BoundedRange followChatterCooldown = new BoundedRange(30f, 60f); private readonly BoundedRange chaseChatterCooldown = new BoundedRange(10f, 20f); private const float lasagnaHeldHungerMultiplierIncrease = 0.5f; private const float followPlayerCooldown = 10f; public static List<SCP3166AI> Instances { get; private set; } = new List<SCP3166AI>(); private PlayerControllerB? targetPlayer { get { return Plugin.PlayerFromId(targetPlayerId.Value); } set { targetPlayerId.Value = (((Object)(object)value != (Object)null) ? value.actualClientId : 0); } } public float Size { get { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return ((Component)this).transform.localScale.y; } private set { //IL_000a: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.localScale = new Vector3(value, value, value); } } private float halfwayToRageTime => hungerPhaseCooldown + ragePhaseCooldown / 2f; private float demandLasagnaCooldown => ragePhaseCooldown / 5f; public bool isOutside => nav.IsAgentOutside(); public bool isInsideFactory => !isOutside; private float sniffDistance => 6f; private bool spawnLasagnaWhenSpawned => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<bool>("Spawn Lasagna When Spawned").Value; private bool showLasagnaInHungerPhase => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<bool>("Show Lasagna In Hunger Phase").Value; private int spawnLasagnaAmount => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<int>("Spawn Lasagna Amount").Value; private int startDamage => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<int>("Start Damage").Value; private int damageIncreasePerLasagna => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<int>("Damage Increase Per Lasagna").Value; private float hungerPhaseCooldown => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<float>("Hunger Phase Cooldown").Value; private float ragePhaseCooldown => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<float>("Rage Phase Cooldown").Value; private float distanceToLoseGorefield => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<float>("Distance To Lose Gorefield").Value; private float startingSize => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<float>("Starting Size").Value; private float maxSize => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<float>("Max Size").Value; private float sizeIncreasePerLasagna => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<float>("Size Increase Per Lasagna").Value; private float timeToEat => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<float>("Time To Eat").Value; private float hungerMultiplierIncreasePerLasagna => ((AssetBundleLoader<SCP3166ContentHandler.SCP3166Assets>)(object)ContentHandler<SCP3166ContentHandler>.Instance.SCP3166).GetConfig<float>("Hunger Multiplier Increase Per Lasagna").Value; public override void Start() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //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) Instances.Add(this); nav.SetAllValues(false); base.allAINodes = Utils.allAINodes; entrances = Object.FindObjectsOfType<EntranceTeleport>(false).ToList(); base.overlapColliders = (Collider[])(object)new Collider[1]; base.thisNetworkObject = ((NetworkBehaviour)this).NetworkObject; base.thisEnemyIndex = RoundManager.Instance.numberOfEnemiesInScene; random = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); RoundManager instance = RoundManager.Instance; instance.numberOfEnemiesInScene++; if (!((NetworkBehaviour)this).IsServer) { RoundManager.Instance.SpawnedEnemies.Add((EnemyAI)(object)this); } base.path1 = new NavMeshPath(); base.openDoorSpeedMultiplier = base.enemyType.doorSpeedMultiplier; base.serverPosition = ((Component)this).transform.position; base.ventAnimationFinished = true; base.currentBehaviourStateIndex = 0; hashSpeed = Animator.StringToHash("speed"); Size = startingSize; gorefieldDamage = startDamage; VoiceLines.Add("FoundPlayerSFX", FoundPlayerSFX); VoiceLines.Add("DemandLasagnaSFX", DemandLasagnaSFX); VoiceLines.Add("HalfHungerSFX", HalfHungerSFX); VoiceLines.Add("SmellsLasagnaSFX", SmellsLasagnaSFX); VoiceLines.Add("FollowingChatterSFX", FollowingChatterSFX); VoiceLines.Add("RageChatterSFX", RageChatterSFX); VoiceLines.Add("StartRageSFX", StartRageSFX); VoiceLines.Add("PostEatingLasagnaSFX", PostEatingLasagnaSFX); VoiceLines.Add("PostEatingPlayerSFX", PostEatingPlayerSFX); VoiceLines.Add("HurtByPlayerSFX", HurtByPlayerSFX); VoiceLines.Add("ShotByPlayerSFX", ShotByPlayerSFX); if (((NetworkBehaviour)this).IsServer && spawnLasagnaWhenSpawned) { SpawnLasagna(spawnLasagnaAmount); } } public override void OnDestroy() { Instances.Remove(this); ((EnemyAI)this).OnDestroy(); } public override void Update() { //IL_013c: Unknown result type (might be due to invalid IL or missing references) if (StartOfRound.Instance.allPlayersDead || base.inSpecialAnimation) { return; } timeSinceSwitchBehavior += Time.deltaTime; timeSinceDamagePlayer += Time.deltaTime; timeSinceFollowPlayer += Time.deltaTime; timeSinceChatter += Time.deltaTime; LasagnaTrigger.interactable = PlayerHasLasagna(Plugin.localPlayer, checkIfHolding: true); ShowLasagnaIfPlayerTargetted(); if (((NetworkBehaviour)this).IsServer) { float num = (targetPlayerHasLasagna ? (hungerMultiplier + 0.5f) : hungerMultiplier); timeSinceEatingLasagna += Time.deltaTime * num; timeSinceDemandLasagna += Time.deltaTime * num; if (base.updateDestinationInterval >= 0f) { base.updateDestinationInterval -= Time.deltaTime; } else { ((EnemyAI)this).DoAIInterval(); base.updateDestinationInterval = base.AIIntervalTime + Random.Range(-0.015f, 0.015f); } if (base.moveTowardsDestination) { nav.DoPathingToDestination(base.destination); } } } public void LateUpdate() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) Vector3 val = ((Component)this).transform.position - lastPosition; currentSpeed = ((Vector3)(ref val)).magnitude / Time.deltaTime / 2f; lastPosition = ((Component)this).transform.position; base.creatureAnimator.SetFloat(hashSpeed, currentSpeed); idleTime = ((currentSpeed <= 0f) ? (idleTime + Time.deltaTime) : 0f); } public override void DoAIInterval() { //IL_0104: 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_0413: 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_0172: 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_02c4: Unknown result type (might be due to invalid IL or missing references) switch (base.currentBehaviourStateIndex) { case 0: base.agent.speed = 5f; base.agent.stoppingDistance = 0f; if (timeSinceFollowPlayer > 10f && TargetClosestPlayer(distanceToLoseGorefield, requireLineOfSight: true)) { SwitchToBehaviourClientRpc(1); } else if (timeSinceEatingLasagna > hungerPhaseCooldown) { SwitchToBehaviourClientRpc(2); } break; case 1: base.agent.speed = 5f; base.agent.stoppingDistance = 5f; if (timeSinceEatingLasagna > hungerPhaseCooldown) { SwitchToBehaviourClientRpc(2); } else if (!TargetClosestPlayer(distanceToLoseGorefield) || !SetDestinationToPosition(((Component)targetPlayer).transform.position)) { Plugin.logger.LogDebug((object)"Following: Lost target player..."); targetPlayer = null; timeSinceFollowPlayer = 0f; SwitchToBehaviourClientRpc(0); } else if (targetPlayerHasLasagna && !reachedPlayerWithLasagna && Vector3.Distance(((Component)this).transform.position, ((Component)targetPlayer).transform.position) < sniffDistance) { reachedPlayerWithLasagna = true; DoAnimationClientRpc("smell"); PlayClip("SmellsLasagnaSFX"); } else if (timeSinceChatter > nextChatterTime) { timeSinceChatter = 0f; nextChatterTime = followChatterCooldown.GetRandomInRange(random); PlayClip("FollowingChatterSFX"); } break; case 2: base.agent.speed = 6f; base.agent.stoppingDistance = 5f; if (timeSinceEatingLasagna > ragePhaseCooldown + hungerPhaseCooldown) { SwitchToBehaviourClientRpc(3); } else if (TargetClosestPlayer(float.PositiveInfinity) && SetDestinationToPosition(((Component)targetPlayer).transform.position)) { if (roaming) { nav.StopSearchRoutine(); roaming = false; } if (targetPlayerHasLasagna && !reachedPlayerWithLasagna && Vector3.Distance(((Component)this).transform.position, ((Component)targetPlayer).transform.position) < sniffDistance) { reachedPlayerWithLasagna = true; DoAnimationClientRpc("smell"); PlayClip("SmellsLasagnaSFX"); break; } if (timeSinceEatingLasagna > halfwayToRageTime && !playedHalfHungerSFX) { playedHalfHungerSFX = true; timeSinceDemandLasagna = 0f; PlayClip("HalfHungerSFX"); } if (timeSinceDemandLasagna > demandLasagnaCooldown) { timeSinceDemandLasagna = 0f; PlayClip("DemandLasagnaSFX"); } } else if (!roaming) { nav.StartSearchRoutine(float.PositiveInfinity); roaming = true; } break; case 3: base.agent.speed = 10f; base.agent.stoppingDistance = 0f; if (CheckForDeadBodies(3f)) { base.inSpecialAnimation = true; EatPlayerClientRpc(targetPlayer.actualClientId); } else if (TargetClosestPlayer(float.PositiveInfinity) && SetDestinationToPosition(((Component)targetPlayer).transform.position)) { if (roaming) { nav.StopSearchRoutine(); roaming = false; } if (timeSinceChatter > nextChatterTime) { timeSinceChatter = 0f; nextChatterTime = chaseChatterCooldown.GetRandomInRange(random); PlayClip("RageChatterSFX"); } } else if (!roaming) { nav.StartSearchRoutine(float.PositiveInfinity); roaming = true; } break; default: Plugin.logger.LogWarning((object)("Invalid state: " + base.currentBehaviourStateIndex)); break; } } public bool CheckForDeadBodies(float range) { //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) PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.isPlayerDead && !((Object)(object)val.deadBody == (Object)null) && !(Vector3.Distance(((Component)this).transform.position, ((Component)val.deadBody).transform.position) > range)) { targetPlayer = val; return true; } } return false; } public void SpawnLasagna(int amount = 1) { //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_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_0029: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < amount; i++) { Vector3 position = Utils.allAINodes.GetRandom().transform.position; Utils.SpawnItem(SCP3166Keys.Lasagna, position); } } public bool TargetClosestPlayer(float mostOptimalDistance, bool requireLineOfSight = false, float viewWidth = 70f) { //IL_0047: 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_00e4: 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_0117: Unknown result type (might be due to invalid IL or missing references) targetPlayer = null; targetPlayerHasLasagna = false; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (((EnemyAI)this).PlayerIsTargetable(val, false, false) && PlayerHasLasagna(val)) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position); if (base.tempDist < mostOptimalDistance) { mostOptimalDistance = base.tempDist; targetPlayer = val; targetPlayerHasLasagna = true; } } } if ((Object)(object)targetPlayer == (Object)null) { PlayerControllerB[] allPlayerScripts2 = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val2 in allPlayerScripts2) { if (((EnemyAI)this).PlayerIsTargetable(val2, false, false) && (!requireLineOfSight || ((EnemyAI)this).CheckLineOfSightForPosition(((Component)val2.gameplayCamera).transform.position, viewWidth, 40, -1f, (Transform)null))) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (base.tempDist < mostOptimalDistance) { mostOptimalDistance = base.tempDist; targetPlayer = val2; } } } } return (Object)(object)targetPlayer != (Object)null; } private void ShowLasagnaIfPlayerTargetted() { if (!showLasagnaInHungerPhase || !((Object)(object)targetPlayer != (Object)null) || !((Object)(object)targetPlayer == (Object)(object)Plugin.localPlayer) || (base.currentBehaviourStateIndex != 2 && base.currentBehaviourStateIndex != 3)) { return; } foreach (LasagnaBehavior item in LasagnaBehavior.Instances.ToList()) { item.ShowLocation(10f); } } private bool PlayerHasLasagna(PlayerControllerB player, bool checkIfHolding = false) { if ((Object)(object)player.currentlyHeldObjectServer != (Object)null && ((Object)player.currentlyHeldObjectServer.itemProperties).name == ((Object)((Registry<DawnItemInfo>)(object)LethalContent.Items)[SCP3166Keys.Lasagna].Item).name) { return true; } if (checkIfHolding) { return false; } foreach (GrabbableObject item in player.ItemSlots.ToList()) { if ((Object)(object)item != (Object)null && ((Object)item.itemProperties).name == ((Object)((Registry<DawnItemInfo>)(object)LethalContent.Items)[SCP3166Keys.Lasagna].Item).name) { return true; } } return false; } public bool SetDestinationToPosition(Vector3 position, bool checkForPath = false) { //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_000e: Unknown result type (might be due to invalid IL or missing references) base.destination = position; return nav.DoPathingToDestination(position); } public bool SmartCanPathToPoint(Vector3 position) { //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_007b: 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_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_00c4: 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_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_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_0105: 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 (nav.CanPathToPoint(((Component)this).transform.position, position) > 0f) { return true; } foreach (EntranceTeleport entrance in entrances) { if (!(isInsideFactory ? (!entrance.isEntranceToBuilding) : entrance.isEntranceToBuilding)) { continue; } Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(entrance.entrancePoint.position, RoundManager.Instance.navHit, 5f, -1); if (!((Object)(object)entrance.exitPoint == (Object)null) || entrance.FindExitPoint()) { Vector3 navMeshPosition2 = RoundManager.Instance.GetNavMeshPosition(entrance.exitPoint.position, RoundManager.Instance.navHit, 5f, -1); if (nav.CanPathToPoint(((Component)this).transform.position, navMeshPosition) > 0f && nav.CanPathToPoint(navMeshPosition2, position) > 0f) { return true; } } } return false; } private void RepositionAgent() { //IL_000c: 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_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_002d: Unknown result type (might be due to invalid IL or missing references) Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(((Component)this).transform.position, RoundManager.Instance.navHit, 5f, -1); base.agent.Warp(navMeshPosition); } public override void OnCollideWithPlayer(Collider other) { //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) ((EnemyAI)this).OnCollideWithPlayer(other); PlayerControllerB val = default(PlayerControllerB); if (!base.inSpecialAnimation && base.currentBehaviourStateIndex == 3 && ((Component)other).gameObject.TryGetComponent<PlayerControllerB>(ref val) && !((Object)(object)val == (Object)null) && !(timeSinceDamagePlayer <= 1f) && !((Object)(object)Plugin.localPlayer != (Object)(object)val)) { timeSinceDamagePlayer = 0f; DoAnimationServerRpc("attack"); val.DamagePlayer(gorefieldDamage, true, true, (CauseOfDeath)6, 0, false, default(Vector3)); } } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { timeSinceChatter = 0f; Plugin.logger.LogDebug((object)"HitEnemy()"); if (hitID == -1) { Plugin.logger.LogDebug((object)"Attempting to play clip: ShotByPlayerSFX"); PlayClip("ShotByPlayerSFX"); } else { Plugin.logger.LogDebug((object)"Attempting to play clip: HurtByPlayerSFX"); PlayClip("HurtByPlayerSFX"); } } public void FeedLasagna() { if (!base.inSpecialAnimation) { Plugin.logger.LogDebug((object)"Feeding Lasagna"); Plugin.localPlayer.DespawnHeldObject(); base.inSpecialAnimation = true; FeedLasagnaServerRpc(); } } public void PlayFootstepSFX() { RoundManager.PlayRandomClip(base.creatureSFX, FootstepSFX, true, 1f, 0, 1000); } public void UnsetInSpecialAnimation() { Plugin.logger.LogDebug((object)"UnsetInSpecialAnimation"); base.inSpecialAnimation = false; } public void BehaviorSwitchCleanup() { timeSinceChatter = 0f; timeSinceDemandLasagna = 0f; playedHalfHungerSFX = false; reachedPlayerWithLasagna = false; nav.StopSearchRoutine(); roaming = false; } public void SwitchToBehaviourStateOnLocalClient(int stateIndex) { if (base.currentBehaviourStateIndex != stateIndex) { ManualLogSource logger = Plugin.logger; State state = (State)stateIndex; logger.LogDebug((object)("Switching behavior to: " + state)); base.previousBehaviourStateIndex = base.currentBehaviourStateIndex; base.currentBehaviourStateIndex = stateIndex; base.currentBehaviourState = base.enemyBehaviourStates[stateIndex]; timeSinceSwitchBehavior = 0f; BehaviorSwitchCleanup(); switch (stateIndex) { case 0: timeSinceFollowPlayer = 0f; base.creatureAnimator.SetBool("rage", false); nav.StartSearchRoutine(float.PositiveInfinity); roaming = true; break; case 1: PlayClip("FoundPlayerSFX"); break; case 2: PlayClip("DemandLasagnaSFX"); break; case 3: PlayClip("StartRageSFX"); base.creatureAnimator.SetBool("rage", true); break; } } } public void PlayClip(string clipName) { Plugin.logger.LogDebug((object)"In PlayClip()"); AudioClip[] array = VoiceLines[clipName]; float num = Random.Range(0.9f, 1.1f); int num2 = Random.Range(0, array.Length); Plugin.logger.LogDebug((object)$"Running PlayClipClientRpc({clipName}, {num2}, {num})"); PlayClipServerRpc(clipName, num2, num); } [ServerRpc(RequireOwnership = false)] public void DoAnimationServerRpc(string animName) { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1901319177u, val, (RpcDelivery)0); bool flag = animName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animName, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1901319177u, 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).IsServer) { DoAnimationClientRpc(animName); } } } [ClientRpc] public void DoAnimationClientRpc(string animName) { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1598392935u, val, (RpcDelivery)0); bool flag = animName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1598392935u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetTrigger(animName); } } [ServerRpc(RequireOwnership = false)] public void PlayClipServerRpc(string clipName, int index, float pitch) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1529781u, val, (RpcDelivery)0); bool flag = clipName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false); } BytePacker.WriteValueBitPacked(val2, index); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref pitch, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1529781u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (Plugin.IsServerOrHost) { PlayClipClientRpc(clipName, index, pitch); } } } [ClientRpc] public void PlayClipClientRpc(string clipName, int index, float pitch) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(764069451u, val, (RpcDelivery)0); bool flag = clipName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false); } BytePacker.WriteValueBitPacked(val2, index); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref pitch, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 764069451u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Plugin.logger.LogDebug((object)"In PlayClipClientRpc()"); Plugin.logger.LogDebug((object)("Playing clip " + clipName)); base.creatureVoice.Stop(); AudioClip[] array = VoiceLines[clipName]; base.creatureVoice.pitch = pitch; base.creatureVoice.clip = array[index]; base.creatureVoice.Play(); WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, array[index], 0.85f); } } [ClientRpc] public void SwitchToBehaviourClientRpc(int stateIndex) { //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(2579341352u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, stateIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2579341352u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SwitchToBehaviourStateOnLocalClient(stateIndex); } } } [ServerRpc(RequireOwnership = false)] public void FeedLasagnaServerRpc() { //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(3528172920u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3528172920u, 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).IsServer) { hungerMultiplier += hungerMultiplierIncreasePerLasagna; FeedLasagnaClientRpc(); } } } [ClientRpc] public void FeedLasagnaClientRpc() { //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(3200112956u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3200112956u, 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(EatLasagnaCoroutine(timeToEat)); } } [IteratorStateMachine(typeof(<<FeedLasagnaClientRpc>g__EatLasagnaCoroutine|119_0>d))] IEnumerator EatLasagnaCoroutine(float eatTime) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <<FeedLasagnaClientRpc>g__EatLasagnaCoroutine|119_0>d(0) { <>4__this = this, eatTime = eatTime }; } } [ClientRpc] public void EatPlayerClientRpc(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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(646144598u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 646144598u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB player2 = Plugin.PlayerFromId(clientId); ((MonoBehaviour)this).StartCoroutine(EatPlayerCoroutine(player2, timeToEat)); } } [IteratorStateMachine(typeof(<<EatPlayerClientRpc>g__EatPlayerCoroutine|120_0>d))] IEnumerator EatPlayerCoroutine(PlayerControllerB player, float eatTime) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <<EatPlayerClientRpc>g__EatPlayerCoroutine|120_0>d(0) { <>4__this = this, player = player, eatTime = eatTime }; } } protected override void __initializeVariables() { if (targetPlayerId == null) { throw new Exception("SCP3166AI.targetPlayerId cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)targetPlayerId).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)targetPlayerId, "targetPlayerId"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)targetPlayerId); ((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 ((NetworkBehaviour)this).__registerRpc(1901319177u, new RpcReceiveHandler(__rpc_handler_1901319177), "DoAnimationServerRpc"); ((NetworkBehaviour)this).__registerRpc(1598392935u, new RpcReceiveHandler(__rpc_handler_1598392935), "DoAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(1529781u, new RpcReceiveHandler(__rpc_handler_1529781), "PlayClipServerRpc"); ((NetworkBehaviour)this).__registerRpc(764069451u, new RpcReceiveHandler(__rpc_handler_764069451), "PlayClipClientRpc"); ((NetworkBehaviour)this).__registerRpc(2579341352u, new RpcReceiveHandler(__rpc_handler_2579341352), "SwitchToBehaviourClientRpc"); ((NetworkBehaviour)this).__registerRpc(3528172920u, new RpcReceiveHandler(__rpc_handler_3528172920), "FeedLasagnaServerRpc"); ((NetworkBehaviour)this).__registerRpc(3200112956u, new RpcReceiveHandler(__rpc_handler_3200112956), "FeedLasagnaClientRpc"); ((NetworkBehaviour)this).__registerRpc(646144598u, new RpcReceiveHandler(__rpc_handler_646144598), "EatPlayerClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_1901319177(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<bool>(ref flag, default(ForPrimitives)); string animName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP3166AI)(object)target).DoAnimationServerRpc(animName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1598392935(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<bool>(ref flag, default(ForPrimitives)); string animName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP3166AI)(object)target).DoAnimationClientRpc(animName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1529781(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_005b: 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_0089: 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) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string clipName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref clipName, false); } int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); float pitch = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref pitch, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP3166AI)(object)target).PlayClipServerRpc(clipName, index, pitch); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_764069451(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_005b: 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_0089: 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) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string clipName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref clipName, false); } int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); float pitch = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref pitch, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP3166AI)(object)target).PlayClipClientRpc(clipName, index, pitch); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2579341352(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 stateIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref stateIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP3166AI)(object)target).SwitchToBehaviourClientRpc(stateIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3528172920(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; ((SCP3166AI)(object)target).FeedLasagnaServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3200112956(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; ((SCP3166AI)(object)target).FeedLasagnaClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_646144598(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; ((SCP3166AI)(object)target).EatPlayerClientRpc(clientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP3166AI"; } } public class SCP3166ContentHandler : ContentHandler<SCP3166ContentHandler> { public class SCP3166Assets : AssetBundleLoader<SCP3166Assets> { public SCP3166Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class LasagnaAssets : AssetBundleLoader<LasagnaAssets> { public LasagnaAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class GarfieldPhoneAssets : AssetBundleLoader<GarfieldPhoneAssets> { public GarfieldPhoneAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public SCP3166Assets? SCP3166; public LasagnaAssets? Lasagna; public GarfieldPhoneAssets? GarfieldPhone; public SCP3166ContentHandler(DuskMod mod) : base(mod) { ((ContentHandler)this).RegisterContent<SCP3166Assets>("scp3166", ref SCP3166, false); ((ContentHandler)this).RegisterContent<LasagnaAssets>("lasagna", ref Lasagna, false); ((ContentHandler)this).RegisterContent<GarfieldPhoneAssets>("garfieldphone", ref GarfieldPhone, false); } } public static class SCP3166Keys { public const string Namespace = "scpthreeonesixsix"; internal static NamespacedKey LastVersion = NamespacedKey.From("scpthreeonesixsix", "last_version"); public static readonly NamespacedKey<DawnEnemyInfo> SCP3166 = NamespacedKey<DawnEnemyInfo>.From("scpthreeonesixsix", "scpthreeonesixsix"); public static readonly NamespacedKey<DawnItemInfo> GarfieldPhone = NamespacedKey<DawnItemInfo>.From("scpthreeonesixsix", "garfieldphone"); public static readonly NamespacedKey<DawnItemInfo> Lasagna = NamespacedKey<DawnItemInfo>.From("scpthreeonesixsix", "lasagna"); } [HarmonyPatch] public class TESTING : MonoBehaviour { [HarmonyPostfix] [HarmonyPatch(typeof(HUDManager), "PingScan_performed")] public static void PingScan_performedPostFix() { if (Utils.isBeta && Utils.testing) { } } [HarmonyPrefix] [HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")] public static void SubmitChat_performedPrefix(HUDManager __instance) { if (Utils.isBeta && Plugin.IsServerOrHost) { string text = __instance.chatTextField.text; string[] array = text.Split(" "); Plugin.logger.LogDebug((object)text); string text2 = array[0]; string text3 = text2; Utils.ChatCommand(array); } } } public class TestingHUDOverlay : MonoBehaviour { public static TestingHUDOverlay? Instance; public GameObject toggle1Obj; public Text toggle1Label; public Toggle toggle1; public GameObject toggle2Obj; public Text toggle2Label; public Toggle toggle2; public Text label1; public Text label2; public Text label3; public void Start() { if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { Instance = this; } } public void Update() { toggle1Obj.SetActive(toggle1Label.text != ""); toggle2Obj.SetActive(toggle2Label.text != ""); } } public static class Utils { public static bool isBeta; public static bool _testing; public static bool trailerMode; public static bool DEBUG_disableSpawning; public static bool DEBUG_disableTargetting; public static bool DEBUG_disableHostTargetting; public static bool DEBUG_disableMoving; public static bool localPlayerFrozen; public static bool testing => _testing && isBeta; public static bool inTestRoom => (Object)(object)StartOfRound.Instance?.testRoom != (Object)null; public static GameObject[] allAINodes => inTestRoom ? GameObject.FindGameObjectsWithTag("AINode") : insideAINodes.Concat(outsideAINodes).ToArray(); public static GameObject[] insideAINodes { get { if (RoundManager.Instance.insideAINodes != null && RoundManager.Instance.insideAINodes.Length != 0) { return RoundManager.Instance.insideAINodes; } return GameObject.FindGameObjectsWithTag("AINode"); } } public static GameObject[] outsideAINodes { get { if (RoundManager.Instance.outsideAINodes != null && RoundManager.Instance.outsideAINodes.Length != 0) { return RoundManager.Instance.outsideAINodes; } return GameObject.FindGameObjectsWithTag("OutsideAINode"); } } public static void ChatCommand(string[] args) { switch (args[0]) { case "/spawning": DEBUG_disableSpawning = !DEBUG_disableSpawning; HUDManager.Instance.DisplayTip("Disable Spawning", DEBUG_disableSpawning.ToString(), false, false, "LC_Tip1"); break; case "/hazards": { Dictionary<string, GameObject> allHazards = GetAllHazards(); { foreach (KeyValuePair<string, GameObject> item in allHazards) { Plugin.logger.LogDebug((object)item); } break; } } case "/testing": _testing = !_testing; HUDManager.Instance.DisplayTip("Testing", _testing.ToString(), false, false, "LC_Tip1"); break; case "/surfaces": { FootstepSurface[] footstepSurfaces = StartOfRound.Instance.footstepSurfaces; foreach (FootstepSurface val3 in footstepSurfaces) { Plugin.logger.LogDebug((object)val3.surfaceTag); } break; } case "/enemies": { foreach (SpawnableEnemyWithRarity enemy in GetEnemies()) { Plugin.logger.LogDebug((object)((Object)enemy.enemyType).name); } break; } case "/refresh": RoundManager.Instance.RefreshEnemiesList(); HoarderBugAI.RefreshGrabbableObjectsInMapList(); break; case "/levels": { SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val2 in levels) { Plugin.logger.LogDebug((object)((Object)val2).name); } break; } case "/dungeon": Plugin.logger.LogDebug((object)((Object)RoundManager.Instance.dungeonGenerator.Generator.DungeonFlow).name); break; case "/dungeons": { IndoorMapType[] dungeonFlowTypes = RoundManager.Instance.dungeonFlowTypes; foreach (IndoorMapType val in dungeonFlowTypes) { Plugin.logger.LogDebug((object)((Object)val.dungeonFlow).name); } break; } case "/time": RoundManager.Instance.currentLevel.planetHasTime = !RoundManager.Instance.currentLevel.planetHasTime; HUDManager.Instance.DisplayTip("planetHasTime", RoundManager.Instance.currentLevel.planetHasTime.ToString(), false, false, "LC_Tip1"); break; } } public static void LogChat(string msg) { HUDManager.Instance.AddChatMessage(msg, "Server", -1, false); } public static Transform? GetClosestAINodeToPosition(Vector3 pos) { //IL_002b: 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) Transform result = null; float num = float.PositiveInfinity; GameObject[] array = allAINodes; foreach (GameObject val in array) { if (!((Object)(object)val == (Object)null)) { float num2 = Vector3.Distance(pos, val.transform.position); if (!(num2 > num)) { num = num2; result = val.transform; } } } return result; } public static Vector3 GetBestThrowDirection(Vector3 origin, Vector3 forward, int rayCount, float maxDistance, LayerMask layerMask) { //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_0028: 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_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_003b: 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_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_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_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_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_00a6: 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_007b: Unknown result type (might be due to invalid IL or missing references) Vector3 result = forward; float num = 0f; RaycastHit val2 = default(RaycastHit); for (int i = 0; i < rayCount; i++) { float num2 = (float)i * (360f / (float)rayCount); Vector3 val = Quaternion.Euler(0f, num2, 0f) * ((Vector3)(ref forward)).normalized; if (Physics.Raycast(origin + Vector3.up * 0.5f, val, ref val2, maxDistance, LayerMask.op_Implicit(layerMask))) { if (((RaycastHit)(ref val2)).distance > num) { result = val; num = ((RaycastHit)(ref val2)).distance; } continue; } return val; } return result; } public static Vector3 GetSpeed() { //IL_022b: 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_0260: 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_027c: 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_028b: 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_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0433: 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_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0393: 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_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0345: 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) float num = Plugin.localPlayer.movementSpeed / Plugin.localPlayer.carryWeight; if (Plugin.localPlayer.sinkingValue > 0.73f) { num = 0f; } else { if (Plugin.localPlayer.isCrouching) { num /= 1.5f; } else if (Plugin.localPlayer.criticallyInjured && !Plugin.localPlayer.isCrouching) { num *= Plugin.localPlayer.limpMultiplier; } if (Plugin.localPlayer.isSpeedCheating) { num *= 15f; } if (Plugin.localPlayer.movementHinderedPrev > 0) { num /= 2f * Plugin.localPlayer.hinderedMultiplier; } if (Plugin.localPlayer.drunkness > 0f) { num *= StartOfRound.Instance.drunknessSpeedEffect.Evaluate(Plugin.localPlayer.drunkness) / 5f + 1f; } if (!Plugin.localPlayer.isCrouching && Plugin.localPlayer.crouchMeter > 1.2f) { num *= 0.5f; } if (!Plugin.localPlayer.isCrouching) { float num2 = Vector3.Dot(Plugin.localPlayer.playerGroundNormal, Plugin.localPlayer.walkForce); if (num2 > 0.05f) { Plugin.localPlayer.slopeModifier = Mathf.MoveTowards(Plugin.localPlayer.slopeModifier, num2, (Plugin.localPlayer.slopeModifierSpeed + 0.45f) * Time.deltaTime); } else { Plugin.localPlayer.slopeModifier = Mathf.MoveTowards(Plugin.localPlayer.slopeModifier, num2, Plugin.localPlayer.slopeModifierSpeed / 2f * Time.deltaTime); } num = Mathf.Max(num * 0.8f, num + Plugin.localPlayer.slopeIntensity * Plugin.localPlayer.slopeModifier); } } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 0f, 0f); int num3 = Physics.OverlapSphereNonAlloc(((Component)Plugin.localPlayer).transform.position, 0.65f, Plugin.localPlayer.nearByPlayers, StartOfRound.Instance.playersMask); for (int i = 0; i < num3; i++) { val += Vector3.Normalize((((Component)Plugin.localPlayer).transform.position - ((Component)Plugin.localPlayer.nearByPlayers[i]).transform.position) * 100f) * 1.2f; } int num4 = Physics.OverlapSphereNonAlloc(((Component)Plugin.localPlayer).transform.position, 1.25f, Plugin.localPlayer.nearByPlayers, 524288); for (int j = 0; j < num4; j++) { EnemyAICollisionDetect component = ((Component)Plugin.localPlayer.nearByPlayers[j]).gameObject.GetComponent<EnemyAICollisionDetect>(); if ((Object)(object)component != (Object)null && (Object)(object)component.mainScript != (Object)null && !component.mainScript.isEnemyDead && Vector3.Distance(((Component)Plugin.localPlayer).transform.position, ((Component)Plugin.localPlayer.nearByPlayers[j]).transform.position) < component.mainScript.enemyType.pushPlayerDistance) { val += Vector3.Normalize((((Component)Plugin.localPlayer).transform.position - ((Component)Plugin.localPlayer.nearByPlayers[j]).transform.position) * 100f) * component.mainScript.enemyType.pushPlayerForce; } } Vector3 val2 = Plugin.localPlayer.walkForce * num * Plugin.localPlayer.sprintMultiplier + new Vector3(0f, Plugin.localPlayer.fallValue, 0f) + val; return val2 + Plugin.localPlayer.externalForces; } public static void FreezePlayer(PlayerControllerB player, bool value) { localPlayerFrozen = value; player.disableInteract = value; player.disableLookInput = value; player.disableMoveInput = value; } public static void DespawnItemInSlotOnClient(int itemSlot) { ((Behaviour)HUDManager.Instance.itemSlotIcons[itemSlot]).enabled = false; Plugin.localPlayer.DestroyItemInSlotAndSync(itemSlot); } public static void MakePlayerInvisible(PlayerControllerB player, bool value) { GameObject gameObject = ((Component)((Component)player).gameObject.transform.Find("ScavengerModel")).gameObject; if ((Object)(object)gameObject == (Object)null) { Plugin.logger.LogError((object)"ScavengerModel not found"); return; } ((Component)gameObject.transform.Find("LOD1")).gameObject.SetActive(!value); ((Component)gameObject.transform.Find("LOD2")).gameObject.SetActive(!value); ((Component)gameObject.transform.Find("LOD3")).gameObject.SetActive(!value); ((Component)gameObject.transform.Find("metarig/spine/spine.001/spine.002/spine.003/LevelSticker")).gameObject.SetActive(!value); ((Component)gameObject.transform.Find("metarig/spine/spine.001/spine.002/spine.003/BetaBadge")).gameObject.SetActive(!value); ((Component)player.playerBadgeMesh).gameObject.SetActive(!value); } public static List<SpawnableEnemyWithRarity> GetEnemies() { List<SpawnableEnemyWithRarity> list = new List<SpawnableEnemyWithRarity>(); return (from x in GameObject.Find("Terminal").GetComponentInChildren<Terminal>().moonsCatalogueList.SelectMany((SelectableLevel x) => x.Enemies.Concat(x.DaytimeEnemies).Concat(x.OutsideEnemies)) where x != null && (Object)(object)x.enemyType != (Object)null && ((Object)x.enemyType).name != null select x).GroupBy((SpawnableEnemyWithRarity x) => ((Object)x.enemyType).name, (string k, IEnumerable<SpawnableEnemyWithRarity> v) => v.First()).ToList(); } public static EnemyVent GetClosestVentToPosition(Vector3 pos) { //IL_001f: 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) float num = 2000f; EnemyVent result = null; EnemyVent[] allEnemyVents = RoundManager.Instance.allEnemyVents; foreach (EnemyVent val in allEnemyVents) { float num2 = Vector3.Distance(pos, ((Component)val.floorNode).transform.position); if (num2 < num) { num = num2; result = val; } } return result; } public static bool CalculatePath(Vector3 fromPos, Vector3 toPos) { //IL_0006: 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_003f: 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_006a: 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) Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(fromPos, RoundManager.Instance.navHit, 1.75f, -1); Vector3 navMeshPosition2 = RoundManager.Instance.GetNavMeshPosition(toPos, RoundManager.Instance.navHit, 1.75f, -1); NavMeshPath val = new NavMeshPath(); return NavMesh.CalculatePath(navMeshPosition, navMeshPosition2, -1, val) && Vector3.Distance(val.corners[val.corners.Length - 1], RoundManager.Instance.GetNavMeshPosition(navMeshPosition2, RoundManager.Instance.navHit, 2.7f, -1)) <= 1.55f; } public static bool CalculatePath(Vector3 fromPos, Vector3 toPos, Vector3 mainEntranceInsidePosition, Vector3 mainEntranceOutsidePosition, bool isOutside) { //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_0017: 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_0018: 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_001d: 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_0022: 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_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) if (!CalculatePath(fromPos, toPos)) { Vector3 toPos2 = (isOutside ? mainEntranceOutsidePosition : mainEntranceInsidePosition); Vector3 fromPos2 = (isOutside ? mainEntranceInsidePosition : mainEntranceOutsidePosition); return CalculatePath(fromPos, toPos2) && CalculatePath(fromPos2, toPos); } return true; } public static T? GetClosestGameObjectOfType<T>(Vector3 position) where T : Component { //IL_0028: 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) T[] array = Object.FindObjectsOfType<T>(); T result = default(T); float num = float.PositiveInfinity; T[] array2 = array; foreach (T val in array2) { float num2 = Vector3.Distance(position, ((Component)val).transform.position); if (num2 < num) { num = num2; result = val; } } return result; } public static void Shuffle<T>(this List<T> list) { int num = list.Count; while (num > 1) { num--; int index = Random.Range(0, num + 1); T value = list[index]; list[index] = list[num]; list[num] = value; } } public static T? GetClosestToPosition<T>(this IEnumerable<T> list, Vector3 position, Func<T, Vector3> positionSelector) where T : class { //IL_0032: 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) T result = null; float num = float.PositiveInfinity; foreach (T item in list) { if (item != null) { float num2 = Vector3.Distance(position, positionSelector(item)); if (!(num2 >= num)) { result = item; num = num2; } } } return result; } public static T? GetFarthestFromPosition<T>(this IEnumerable<T> list, Vector3 position, Func<T, Vector3> positionSelector) where T : class { //IL_0032: 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) T result = null; float num = 0f; foreach (T item in list) { if (item != null) { float num2 = Vector3.Distance(position, positionSelector(item)); if (!(num2 <= num)) { result = item; num = num2; } } } return result; } public static Dictionary<string, GameObject> GetAllHazards() { Dictionary<string, GameObject> dictionary = new Dictionary<string, GameObject>(); List<SpawnableMapObject> list = (from x in StartOfRound.Instance.levels.SelectMany((SelectableLevel level) => level.spawnableMapObjects) group x by ((Object)x.prefabToSpawn).name into g select g.First()).ToList(); foreach (SpawnableMapObject item in list) { dictionary.Add(((Object)item.prefabToSpawn).name, item.prefabToSpawn); } return dictionary; } public static GameObject? GetRandomNode(bool outside, GameObject[]? excludedNodes = null) { Plugin.logger.LogDebug((object)"Choosing random node..."); if (excludedNodes == null) { excludedNodes = Array.Empty<GameObject>(); } GameObject[] first = (outside ? outsideAINodes : insideAINodes); first = first.Except(excludedNodes).ToArray(); if (first.Length == 0) { return null; } int num = Random.Range(0, first.Length); return first[num]; } public static GameObject? GetRandomNode(GameObject[]? excludedNodes = null) { Plugin.logger.LogDebug((object)"Choosing random node..."); if (excludedNodes == null) { excludedNodes = Array.Empty<GameObject>(); } GameObject[] array = allAINodes.Except(excludedNodes).ToArray(); if (array.Length == 0) { return null; } int num = Random.Range(0, array.Length); return array[num]; } public static Vector3 GetRandomNavMeshPositionInAnnulus(Vector3 center, float minRadius, float maxRadius, int sampleCount = 10) { //IL_0001: 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_00b2: 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_0054: Unknow