using System; using System.Collections; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("ManuLib")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ManuLib")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("8127ca6d-dea7-4f68-b515-c15a3c1b11da")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace ManuLib; public class MLCheckOnShip : MonoBehaviour { public GrabbableObject targetItem; public bool checkOnStart = false; public UnityEvent onTrue; public UnityEvent onFalse; public void CheckOnShip() { if (targetItem.isInShipRoom) { if (onTrue != null) { onTrue.Invoke(); } } else if (onFalse != null) { onFalse.Invoke(); } } public void Start() { if (checkOnStart) { CheckOnShip(); } } } public class MLItemValueModifier : MonoBehaviour { public GrabbableObject targetItem; public int amountToChange = 0; public bool isPercentage = false; private double amountToChangeInternal = 0.0; private double amountToCheck = 0.0; private int originalValue = 0; public void AddCalculatedValue() { ResetInternalVariables(); CalculatePercentage(); amountToCheck += amountToChangeInternal; SetToValue(); } public void MultiplyCalculatedValue() { ResetInternalVariables(); CalculatePercentage(); amountToCheck *= amountToChangeInternal; SetToValue(); } public void SetToInputValue() { targetItem.SetScrapValue(amountToChange); } public void ResetToOriginalValue() { targetItem.SetScrapValue(originalValue); } private void CalculatePercentage() { if (isPercentage) { if (amountToChange > 0) { amountToChangeInternal *= 0.01; } else { Plugin.ManuLogger.LogWarning((object)"Rejected devision of a value equal to or lower than 0."); } } } private void SetToValue() { if (amountToCheck >= 0.0) { targetItem.SetScrapValue((int)amountToCheck); return; } targetItem.SetScrapValue(0); Plugin.ManuLogger.LogInfo((object)"Rejected a price change that would result in a negative value. Setting to 0"); } private void ResetInternalVariables() { amountToCheck = targetItem.scrapValue; amountToChangeInternal = amountToChange; } private void Awake() { originalValue = targetItem.scrapValue; } } internal class MLLadderItem : GrabbableObject { private bool ladderActivated; private bool ladderAnimationBegun; private Coroutine ladderAnimationCoroutine; public Animator ladderAnimator; public Animator ladderRotateAnimator; public Transform baseNode; public Transform topNode; public Transform moveableNode; private RaycastHit hit; private int layerMask = 268437761; public AudioClip hitRoof; public AudioClip fullExtend; public AudioClip hitWall; public AudioClip ladderExtendSFX; public AudioClip ladderFallSFX; public AudioClip ladderShrinkSFX; public AudioClip blinkWarningSFX; public AudioClip lidOpenSFX; public AudioSource ladderAudio; public InteractTrigger ladderScript; private float rotateAmount; private float extendAmount; private float ladderTimer; private bool ladderBlinkWarning; public Collider interactCollider; public Collider bridgeCollider; public Collider killTrigger; private PlayerControllerB previousPlayerHeldBy; [Header("Extra stuff")] public float timerUntilFold = 20f; public bool hasUnlimitedTimer = false; public override void Update() { //IL_01ca: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if ((Object)(object)base.playerHeldBy == (Object)null && !base.isHeld && !base.isHeldByEnemy && base.reachedFloorTarget && ladderActivated) { if (!ladderAnimationBegun) { ladderTimer = 0f; StartLadderAnimation(); } else if (ladderAnimationBegun) { if (!hasUnlimitedTimer) { ladderTimer += Time.deltaTime; } if (!ladderBlinkWarning && ladderTimer > timerUntilFold - 5f) { ladderBlinkWarning = true; ladderAnimator.SetBool("blinkWarning", true); ladderAudio.clip = blinkWarningSFX; ladderAudio.Play(); } else if (ladderTimer >= timerUntilFold) { ladderActivated = false; ladderBlinkWarning = false; ladderAudio.Stop(); ladderAnimator.SetBool("blinkWarning", false); } } return; } if (ladderAnimationBegun) { ladderAnimationBegun = false; ladderAudio.Stop(); killTrigger.enabled = false; bridgeCollider.enabled = false; interactCollider.enabled = false; if (ladderAnimationCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(ladderAnimationCoroutine); } ladderAnimator.SetBool("blinkWarning", false); ((Component)ladderAudio).transform.position = ((Component)this).transform.position; ladderAudio.PlayOneShot(ladderShrinkSFX); ladderActivated = false; } killTrigger.enabled = false; ladderScript.interactable = false; if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController.currentTriggerInAnimationWith == (Object)(object)ladderScript) { ladderScript.CancelAnimationExternally(); } if (rotateAmount > 0f) { rotateAmount = Mathf.Max(rotateAmount - Time.deltaTime * 2f, 0f); ladderRotateAnimator.SetFloat("rotationAmount", rotateAmount); } else { ladderRotateAnimator.SetFloat("rotationAmount", 0f); } if (extendAmount > 0f) { extendAmount = Mathf.Max(extendAmount - Time.deltaTime * 2f, 0f); ladderAnimator.SetFloat("extensionAmount", extendAmount); } else { ladderAnimator.SetBool("openLid", false); ladderAnimator.SetBool("extend", false); ladderAnimator.SetFloat("extensionAmount", 0f); } } private void StartLadderAnimation() { ladderAnimationBegun = true; ladderScript.interactable = false; if (ladderAnimationCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(ladderAnimationCoroutine); } ladderAnimationCoroutine = ((MonoBehaviour)this).StartCoroutine(LadderAnimation()); } private IEnumerator LadderAnimation() { ladderAudio.volume = 1f; ladderScript.interactable = false; interactCollider.enabled = false; bridgeCollider.enabled = false; killTrigger.enabled = false; ladderAnimator.SetBool("openLid", false); ladderAnimator.SetBool("extend", false); yield return null; ladderAnimator.SetBool("openLid", true); ((Component)ladderAudio).transform.position = ((Component)this).transform.position; ladderAudio.PlayOneShot(lidOpenSFX, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)ladderAudio).transform.position, 18f, 0.8f, 0, base.isInShipRoom, 0); yield return (object)new WaitForSeconds(1f); ladderAnimator.SetBool("extend", true); float ladderExtendAmountNormalized = GetLadderExtensionDistance() / 9.72f; float ladderRotateAmountNormalized = Mathf.Clamp(GetLadderRotationDegrees(ladderExtendAmountNormalized) / -90f, 0f, 0.99f); ladderAudio.clip = ladderExtendSFX; ladderAudio.Play(); float currentNormalizedTime = 0f; float speedMultiplier = 0.1f; while (currentNormalizedTime < ladderExtendAmountNormalized) { speedMultiplier += Time.deltaTime * 2f; currentNormalizedTime = Mathf.Min(currentNormalizedTime + Time.deltaTime * speedMultiplier, ladderExtendAmountNormalized); ladderAnimator.SetFloat("extensionAmount", currentNormalizedTime); yield return null; } extendAmount = currentNormalizedTime; interactCollider.enabled = true; bridgeCollider.enabled = false; killTrigger.enabled = false; ladderAudio.Stop(); if (ladderExtendAmountNormalized == 1f) { ((Component)ladderAudio).transform.position = ((Component)baseNode).transform.position + ((Component)baseNode).transform.up * 9.72f; ladderAudio.PlayOneShot(fullExtend, 0.7f); WalkieTalkie.TransmitOneShotAudio(ladderAudio, fullExtend, 0.7f); RoundManager.Instance.PlayAudibleNoise(((Component)ladderAudio).transform.position, 8f, 0.5f, 0, base.isInShipRoom, 0); } else { ((Component)ladderAudio).transform.position = ((Component)baseNode).transform.position + ((Component)baseNode).transform.up * (ladderExtendAmountNormalized * 9.72f); ladderAudio.PlayOneShot(hitRoof); WalkieTalkie.TransmitOneShotAudio(ladderAudio, hitRoof, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)ladderAudio).transform.position, 17f, 0.8f, 0, base.isInShipRoom, 0); } yield return (object)new WaitForSeconds(0.4f); ladderAudio.clip = ladderFallSFX; ladderAudio.Play(); ladderAudio.volume = 0f; speedMultiplier = 0.15f; currentNormalizedTime = 0f; while (currentNormalizedTime < ladderRotateAmountNormalized) { speedMultiplier += Time.deltaTime * 2f; currentNormalizedTime = Mathf.Min(currentNormalizedTime + Time.deltaTime * speedMultiplier, ladderRotateAmountNormalized); if (ladderExtendAmountNormalized > 0.6f && currentNormalizedTime > 0.5f) { killTrigger.enabled = true; } ladderAudio.volume = Mathf.Min(ladderAudio.volume + Time.deltaTime * 1.75f, 1f); ladderRotateAnimator.SetFloat("rotationAmount", currentNormalizedTime); yield return null; } rotateAmount = ladderRotateAmountNormalized; ladderAudio.volume = 1f; ladderAudio.Stop(); ((Component)ladderAudio).transform.position = ((Component)moveableNode).transform.position; ladderAudio.PlayOneShot(hitWall, Mathf.Min(ladderRotateAmountNormalized + 0.3f, 1f)); RoundManager.Instance.PlayAudibleNoise(((Component)ladderAudio).transform.position, 18f, 0.7f, 0, base.isInShipRoom, 0); if (ladderRotateAmountNormalized * 90f < 45f) { ladderScript.interactable = true; interactCollider.enabled = true; } else { bridgeCollider.enabled = true; } killTrigger.enabled = false; } private float GetLadderExtensionDistance() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (Physics.Raycast(((Component)baseNode).transform.position, Vector3.up, ref hit, 9.72f, layerMask, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref hit)).distance; } return 9.72f; } private float GetLadderRotationDegrees(float topOfLadder) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) float num = 90f; for (int num2 = 4; num2 >= 1; num2--) { float num3 = 2.43f * (float)num2; ((Component)moveableNode).transform.localPosition = new Vector3(0f, num3, 0f); baseNode.localEulerAngles = Vector3.zero; for (int i = 1; (float)i < timerUntilFold; i++) { Vector3 position = ((Component)moveableNode).transform.position; baseNode.localEulerAngles = new Vector3((float)(-i) * 4.5f, 0f, 0f); if (Physics.Linecast(position, ((Component)moveableNode).transform.position, layerMask, (QueryTriggerInteraction)1)) { float num4 = (float)(i - 1) * 4.5f; if (num4 < num) { num = num4; } break; } } if (num < 12f) { break; } } return 0f - num; } public override void DiscardItem() { previousPlayerHeldBy = base.playerHeldBy; ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); } public override void DiscardItemFromEnemy() { ((GrabbableObject)this).DiscardItemFromEnemy(); ladderActivated = true; } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0026: 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) ((GrabbableObject)this).ItemActivate(used, buttonDown); ladderActivated = true; if (((NetworkBehaviour)this).IsOwner) { base.playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } } } internal class MLObjectEviscerator : MonoBehaviour { public GameObject ObjectToDestroy; public void DestroyObject() { if ((Object)(object)ObjectToDestroy != (Object)null) { Object.Destroy((Object)(object)ObjectToDestroy); } else { Plugin.ManuLogger.LogWarning((object)"Rejected destruction of a null gameobject."); } } } internal class MLObjectRotationModifier : MonoBehaviour { public GameObject targetObject; } public class MLPrintStewie : MonoBehaviour { public void PrintStewie() { ManualLogSource manuLogger = Plugin.ManuLogger; if (manuLogger != null) { manuLogger.LogInfo((object)" "); } ManualLogSource manuLogger2 = Plugin.ManuLogger; if (manuLogger2 != null) { manuLogger2.LogInfo((object)" gggÞÇÇ6ÞÇÇÞggg "); } ManualLogSource manuLogger3 = Plugin.ManuLogger; if (manuLogger3 != null) { manuLogger3.LogInfo((object)" ggGÞü3llll****l****‡63Þg "); } ManualLogSource manuLogger4 = Plugin.ManuLogger; if (manuLogger4 != null) { manuLogger4.LogInfo((object)" GÞ6‡‡l*******************lüGg "); } ManualLogSource manuLogger5 = Plugin.ManuLogger; if (manuLogger5 != null) { manuLogger5.LogInfo((object)" gÞ3ül************************llÞg "); } ManualLogSource manuLogger6 = Plugin.ManuLogger; if (manuLogger6 != null) { manuLogger6.LogInfo((object)" gG3‡l***3l************************3g "); } ManualLogSource manuLogger7 = Plugin.ManuLogger; if (manuLogger7 != null) { manuLogger7.LogInfo((object)" g6‡‡l*******‡‡ü3*******************l*üg "); } ManualLogSource manuLogger8 = Plugin.ManuLogger; if (manuLogger8 != null) { manuLogger8.LogInfo((object)" G6ü3‡l***‡üül*363**************3üü3‡ll**lG "); } ManualLogSource manuLogger9 = Plugin.ManuLogger; if (manuLogger9 != null) { manuLogger9.LogInfo((object)" Þü6‡‡l**ü‡l*****l6*************‡6l*l6‡***üÞ "); } ManualLogSource manuLogger10 = Plugin.ManuLogger; if (manuLogger10 != null) { manuLogger10.LogInfo((object)" ggÞ3‡l*lü***6GÞÞÇ63***********ü‡*****l6***6g "); } ManualLogSource manuLogger11 = Plugin.ManuLogger; if (manuLogger11 != null) { manuLogger11.LogInfo((object)" G3‡l**6**\u00af\u00af\u00af\u00af\u00af\u00afül******ül**lü‡l‡Þ33üÇl***3Ç"); } ManualLogSource manuLogger12 = Plugin.ManuLogger; if (manuLogger12 != null) { manuLogger12.LogInfo((object)" Þ3‡l**ü‡\u00af\u00af\u00af\u00af*3l*******lü***3*\u00af\u00af\u00af\u00af\u00af\u00af6l**‡3Ç"); } ManualLogSource manuLogger13 = Plugin.ManuLogger; if (manuLogger13 != null) { manuLogger13.LogInfo((object)" g63l***l33‡******‡***3l***l6l\u00af\u00af\u00aflü***3G "); } ManualLogSource manuLogger14 = Plugin.ManuLogger; if (manuLogger14 != null) { manuLogger14.LogInfo((object)" gLJl************l3Þ63******lll***lÞg "); } ManualLogSource manuLogger15 = Plugin.ManuLogger; if (manuLogger15 != null) { manuLogger15.LogInfo((object)" gÞül*************************lÇG "); } ManualLogSource manuLogger16 = Plugin.ManuLogger; if (manuLogger16 != null) { manuLogger16.LogInfo((object)" gÞ63l******************‡üÞg "); } ManualLogSource manuLogger17 = Plugin.ManuLogger; if (manuLogger17 != null) { manuLogger17.LogInfo((object)" g63üÞÇü3‡‡‡ll‡‡‡3ü6Gg "); } ManualLogSource manuLogger18 = Plugin.ManuLogger; if (manuLogger18 != null) { manuLogger18.LogInfo((object)" Þ‡‡‡3ÞÇÞ‡36üÞÇÇ**‡G "); } ManualLogSource manuLogger19 = Plugin.ManuLogger; if (manuLogger19 != null) { manuLogger19.LogInfo((object)" gü‡l***3‡***6Ç63l**Ç "); } ManualLogSource manuLogger20 = Plugin.ManuLogger; if (manuLogger20 != null) { manuLogger20.LogInfo((object)" g3‡‡*******‡Ç‡*****Þ "); } ManualLogSource manuLogger21 = Plugin.ManuLogger; if (manuLogger21 != null) { manuLogger21.LogInfo((object)" g63663‡l‡üÇÇÞ‡ll‡üÞ "); } ManualLogSource manuLogger22 = Plugin.ManuLogger; if (manuLogger22 != null) { manuLogger22.LogInfo((object)" GÞÞÞÇÇÞÞÇÇÇÇÇÇÇÇÇÇg "); } ManualLogSource manuLogger23 = Plugin.ManuLogger; if (manuLogger23 != null) { manuLogger23.LogInfo((object)" GÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇ6g "); } ManualLogSource manuLogger24 = Plugin.ManuLogger; if (manuLogger24 != null) { manuLogger24.LogInfo((object)" GÞÇÇÇÇÇÇÇÇÇÇÇÇÇÇ66g "); } ManualLogSource manuLogger25 = Plugin.ManuLogger; if (manuLogger25 != null) { manuLogger25.LogInfo((object)" gGÇÞÇÇÇÇÇÇÇÇÇÇÇÇüG "); } ManualLogSource manuLogger26 = Plugin.ManuLogger; if (manuLogger26 != null) { manuLogger26.LogInfo((object)" gÞÇÇÇÇÇÇÇÇÞÇÇÇÇÇg "); } ManualLogSource manuLogger27 = Plugin.ManuLogger; if (manuLogger27 != null) { manuLogger27.LogInfo((object)" gÞÞÇÇÇÇÇ6ÞÇÇÇÇÇÇg "); } ManualLogSource manuLogger28 = Plugin.ManuLogger; if (manuLogger28 != null) { manuLogger28.LogInfo((object)" gÞÞÞÞÇ6üü6ÞÇ63‡llüG "); } ManualLogSource manuLogger29 = Plugin.ManuLogger; if (manuLogger29 != null) { manuLogger29.LogInfo((object)" Þ333‡llllll6‡lllllüg "); } ManualLogSource manuLogger30 = Plugin.ManuLogger; if (manuLogger30 != null) { manuLogger30.LogInfo((object)" gÞü3l‡ll‡‡3Þgggggg "); } ManualLogSource manuLogger31 = Plugin.ManuLogger; if (manuLogger31 != null) { manuLogger31.LogInfo((object)" "); } } } internal class MLRaycastFromObject : MonoBehaviour { } public class MLRunOnHost : MonoBehaviour { public UnityEvent OnHost = new UnityEvent(); public UnityEvent OnClient = new UnityEvent(); public void CheckClient() { if (((NetworkBehaviour)RoundManager.Instance).IsHost || ((NetworkBehaviour)RoundManager.Instance).IsServer) { OnHost.Invoke(); } else { OnClient.Invoke(); } } } internal class MLRunOnWakeup : MonoBehaviour { public bool runOnAwake = false; public bool runOnStart = false; public bool runOnEnable = false; public bool runOnDisable = false; public UnityEvent onWakeup; public UnityEvent onDisable; private void Awake() { if (runOnAwake && onWakeup != null) { onWakeup.Invoke(); ManualLogSource manuLogger = Plugin.ManuLogger; if (manuLogger != null) { manuLogger.LogInfo((object)"Run on awake attempted."); } } } private void Start() { if (runOnStart && onWakeup != null) { onWakeup.Invoke(); ManualLogSource manuLogger = Plugin.ManuLogger; if (manuLogger != null) { manuLogger.LogInfo((object)"Run on start attempted."); } } } private void OnEnable() { if (runOnEnable && onWakeup != null) { onWakeup.Invoke(); ManualLogSource manuLogger = Plugin.ManuLogger; if (manuLogger != null) { manuLogger.LogInfo((object)"Run on enable attempted."); } } } private void OnDisable() { if (runOnDisable && onDisable != null) { onDisable.Invoke(); ManualLogSource manuLogger = Plugin.ManuLogger; if (manuLogger != null) { manuLogger.LogInfo((object)"Run on disable attempted."); } } } } internal class MLTheRockAudio : MonoBehaviour { public AudioSource speedBasedAudio; public EnemyAI thumperAI; private double amountToMultiply = 0.07; public void Update() { if ((double)thumperAI.agent.speed * amountToMultiply < 1.0) { speedBasedAudio.volume = (float)((double)thumperAI.agent.speed * amountToMultiply); } else { speedBasedAudio.volume = 1f; } } } [BepInPlugin("GenericGMD.ManuLib", "ManuLib", "1.0.0")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource ManuLogger; private void Awake() { ManuLogger = ((BaseUnityPlugin)this).Logger; ManuLogger.LogInfo((object)"ManuLib loaded. Printing Stewie."); ManuLogger.LogInfo((object)" "); ManuLogger.LogInfo((object)" gggÞÇÇ6ÞÇÇÞggg "); ManuLogger.LogInfo((object)" ggGÞü3llll****l****‡63Þg "); ManuLogger.LogInfo((object)" GÞ6‡‡l*******************lüGg "); ManuLogger.LogInfo((object)" gÞ3ül************************llÞg "); ManuLogger.LogInfo((object)" gG3‡l***3l************************3g "); ManuLogger.LogInfo((object)" g6‡‡l*******‡‡ü3*******************l*üg "); ManuLogger.LogInfo((object)" G6ü3‡l***‡üül*363**************3üü3‡ll**lG "); ManuLogger.LogInfo((object)" Þü6‡‡l**ü‡l*****l6*************‡6l*l6‡***üÞ "); ManuLogger.LogInfo((object)" ggÞ3‡l*lü***6GÞÞÇ63***********ü‡*****l6***6g "); ManuLogger.LogInfo((object)" G3‡l**6**\u00af\u00af\u00af\u00af\u00af\u00afül******ül**lü‡l‡Þ33üÇl***3Ç"); ManuLogger.LogInfo((object)" Þ3‡l**ü‡\u00af\u00af\u00af\u00af*3l*******lü***3*\u00af\u00af\u00af\u00af\u00af\u00af6l**‡3Ç"); ManuLogger.LogInfo((object)" g63l***l33‡******‡***3l***l6l\u00af\u00af\u00aflü***3G "); ManuLogger.LogInfo((object)" gLJl************l3Þ63******lll***lÞg "); ManuLogger.LogInfo((object)" gÞül*************************lÇG "); ManuLogger.LogInfo((object)" gÞ63l******************‡üÞg "); ManuLogger.LogInfo((object)" g63üÞÇü3‡‡‡ll‡‡‡3ü6Gg "); ManuLogger.LogInfo((object)" Þ‡‡‡3ÞÇÞ‡36üÞÇÇ**‡G "); ManuLogger.LogInfo((object)" gü‡l***3‡***6Ç63l**Ç "); ManuLogger.LogInfo((object)" g3‡‡*******‡Ç‡*****Þ "); ManuLogger.LogInfo((object)" g63663‡l‡üÇÇÞ‡ll‡üÞ "); ManuLogger.LogInfo((object)" GÞÞÞÇÇÞÞÇÇÇÇÇÇÇÇÇÇg "); ManuLogger.LogInfo((object)" GÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇ6g "); ManuLogger.LogInfo((object)" GÞÇÇÇÇÇÇÇÇÇÇÇÇÇÇ66g "); ManuLogger.LogInfo((object)" gGÇÞÇÇÇÇÇÇÇÇÇÇÇÇüG "); ManuLogger.LogInfo((object)" gÞÇÇÇÇÇÇÇÇÞÇÇÇÇÇg "); ManuLogger.LogInfo((object)" gÞÞÇÇÇÇÇ6ÞÇÇÇÇÇÇg "); ManuLogger.LogInfo((object)" gÞÞÞÞÇ6üü6ÞÇ63‡llüG "); ManuLogger.LogInfo((object)" Þ333‡llllll6‡lllllüg "); ManuLogger.LogInfo((object)" gÞü3l‡ll‡‡3Þgggggg "); ManuLogger.LogInfo((object)" "); ManuLogger.LogInfo((object)"Print sucessful. Enjoy your Stewie."); } } public class MLKeyItem : GrabbableObject { [Header("Extra stuff")] public bool hasLimitedUses = true; public int totalUses = 1; public bool destroyAfterUses = true; private int currentUses = 0; public UnityEvent OnUse = new UnityEvent(); public UnityEvent OnFinalUse = new UnityEvent(); public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if ((Object)(object)base.playerHeldBy == (Object)null || !((NetworkBehaviour)this).IsOwner || !Physics.Raycast(new Ray(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward), ref val, 3f, 2816)) { return; } DoorLock val2 = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)val2 == (Object)null) { TriggerPointToDoor component = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)component != (Object)null) { val2 = component.pointToDoor; } } if (!((Object)(object)val2 != (Object)null) || !val2.isLocked || val2.isPickingLock) { return; } if (currentUses < totalUses) { if (hasLimitedUses) { currentUses++; } if (OnUse != null) { OnUse.Invoke(); } val2.UnlockDoorSyncWithServer(); if (currentUses == totalUses) { if (OnFinalUse != null) { OnFinalUse.Invoke(); } if (destroyAfterUses) { base.playerHeldBy.DespawnHeldObject(); } } } else { ManualLogSource manuLogger = Plugin.ManuLogger; if (manuLogger != null) { manuLogger.LogInfo((object)"Tried to unlock a door with no uses remaining."); } } } } public class MLModularBirdAi : EnemyAI { public Animator bodyAnimator; private int behaviourStateLastFrame = -1; public AudioSource flappingAudio; public AudioClip[] birdScreechSFX; public AudioClip birdHitGroundSFX; public AISearchRoutine roamGlide; private bool alertingBird; private float glideTime = 10f; private float currentGlideTime; private RaycastHit hit; private bool flyingToOtherBirdLanding; private float avoidingPlayer; public Transform Body; private Vector3 previousPosition; private float flyLayerWeight; [Space(5f)] public float maxSpeed; [Space(5f)] public float speedElevationMultiplier; private float randomYRot; private int velocityAverageCount; private float averageVelocity; private float lerpedElevation; private float timeSinceEnteringFlight; private float randomHeightOffset; private bool birdStunned; private bool oddInterval; private int birdNoisiness = 5; private float timeSinceSquawking; private float velocityInterval; public Rigidbody birdRigidbody; [Header("Extra stuff")] public bool doesEnemyLeave; public override void Start() { ((EnemyAI)this).Start(); base.creatureAnimator.SetInteger("idleType", Random.Range(0, 2)); base.creatureAnimator.SetFloat("speedMultiplier", Random.Range(0.73f, 1.3f)); bodyAnimator.SetFloat("speedMultiplier", Random.Range(0.8f, 1.2f)); randomHeightOffset = (float)new Random(StartOfRound.Instance.randomMapSeed / (int)(((NetworkBehaviour)this).NetworkObjectId + 1)).NextDouble(); } public override void DaytimeEnemyLeave() { if (doesEnemyLeave) { ((EnemyAI)this).DaytimeEnemyLeave(); if (base.stunNormalizedTimer < 0f && !base.isEnemyDead) { bodyAnimator.SetBool("flying", true); base.creatureAnimator.SetBool("gliding", true); bodyAnimator.SetTrigger("Leave"); bodyAnimator.SetBool("Leaving", true); } ((MonoBehaviour)this).StartCoroutine(flyAwayThenDespawn()); } } private IEnumerator flyAwayThenDespawn() { yield return (object)new WaitForSeconds(7f); if (((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).KillEnemyOnOwnerClient(true); } } public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0) { //IL_0002: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DetectNoise(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID); if (noiseID != 911 && !base.isEnemyDead && !(base.stunNormalizedTimer > 0f)) { float num = Vector3.Distance(noisePosition, ((Component)this).transform.position + Vector3.up * 0.5f); if (Physics.Linecast(((Component)this).transform.position, noisePosition, 256)) { noiseLoudness /= 2f; } float num2 = 0.01f; if (!(noiseLoudness / num <= num2) && base.currentBehaviourStateIndex == 0 && !alertingBird) { alertingBird = true; AlertBirdServerRpc(); } } } public void StunBird() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (birdStunned) { return; } birdStunned = true; base.agent.speed = 0f; DoublewingAI[] array = Object.FindObjectsByType((FindObjectsInactive)0, (FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { if (!((Object)(object)array[i] == (Object)(object)this) && Vector3.Distance(((Component)array[i]).transform.position, ((Component)this).transform.position) < 8f) { array[i].AlertBirdByOther(); } } flappingAudio.Stop(); base.creatureAnimator.SetBool("stunned", true); bodyAnimator.SetBool("stunned", true); } public void UnstunBird() { if (birdStunned) { birdStunned = false; base.creatureAnimator.SetBool("stunned", false); bodyAnimator.SetBool("stunned", false); if (base.currentBehaviourStateIndex == 0) { ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); } } } public override void DoAIInterval() { //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: 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_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.daytimeEnemyLeaving || base.isEnemyDead || StartOfRound.Instance.allPlayersDead || base.stunNormalizedTimer > 0f) { return; } switch (base.currentBehaviourStateIndex) { case 0: oddInterval = !oddInterval; if (oddInterval && !alertingBird && Object.op_Implicit((Object)(object)((EnemyAI)this).CheckLineOfSightForPlayer(80f, 8, 4))) { alertingBird = true; AlertBirdServerRpc(); } break; case 1: { behaviourStateLastFrame = 1; base.creatureAnimator.SetBool("gliding", true); bodyAnimator.SetBool("flying", true); base.agent.speed = Mathf.Clamp(base.agent.speed + base.AIIntervalTime * 4f, 5f, 19f); if (!flyingToOtherBirdLanding && avoidingPlayer <= 0f && !roamGlide.inProgress) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, roamGlide); } if (avoidingPlayer > 0f) { avoidingPlayer -= base.AIIntervalTime; if (Vector3.Distance(((Component)this).transform.position, base.destination) < 3f) { avoidingPlayer = 0f; } break; } PlayerControllerB val = ((EnemyAI)this).CheckLineOfSightForPlayer(80f, 10, 8); if (oddInterval && Object.op_Implicit((Object)(object)val)) { Transform val2 = ((EnemyAI)this).ChooseFarthestNodeFromPosition(((Component)val).transform.position, false, Random.Range(0, base.allAINodes.Length / 2), false, 50, -1); if (((EnemyAI)this).SetDestinationToPosition(val2.position, false)) { avoidingPlayer = Random.Range(10, 20); ((EnemyAI)this).StopSearch(roamGlide, true); } } currentGlideTime += base.AIIntervalTime; if (!(currentGlideTime > glideTime)) { break; } currentGlideTime = 0f; if (flyingToOtherBirdLanding) { if (!((EnemyAI)this).SetDestinationToPosition(base.destination, true)) { flyingToOtherBirdLanding = false; glideTime = 5f; break; } if (Vector3.Distance(((Component)this).transform.position, base.destination) < 3f) { if (!TryLanding()) { flyingToOtherBirdLanding = false; glideTime = 5f; } else { ((EnemyAI)this).SwitchToBehaviourState(0); } break; } } for (int i = 0; i < RoundManager.Instance.SpawnedEnemies.Count; i++) { if ((Object)(object)RoundManager.Instance.SpawnedEnemies[i].enemyType == (Object)(object)base.enemyType && RoundManager.Instance.SpawnedEnemies[i].currentBehaviourStateIndex == 0 && Vector3.Distance(((Component)this).transform.position, ((Component)RoundManager.Instance.SpawnedEnemies[i]).transform.position) < 100f) { Vector3 randomNavMeshPositionInRadius = RoundManager.Instance.GetRandomNavMeshPositionInRadius(((Component)RoundManager.Instance.SpawnedEnemies[i]).transform.position, 10f, default(NavMeshHit)); if (((EnemyAI)this).SetDestinationToPosition(randomNavMeshPositionInRadius, true)) { ((EnemyAI)this).StopSearch(roamGlide, true); flyingToOtherBirdLanding = true; glideTime = 2f; } break; } } if (!flyingToOtherBirdLanding) { if (TryLanding()) { ((EnemyAI)this).SwitchToBehaviourState(0); } else { glideTime = 10f; } } break; } } } public bool TryLanding() { //IL_0007: 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_0027: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) if (Physics.Raycast(new Vector3(((Component)this).transform.position.x, base.eye.position.y, ((Component)this).transform.position.z), Vector3.down, ref hit, 60f, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { if (Physics.CheckSphere(((RaycastHit)(ref hit)).point, 16f, StartOfRound.Instance.playersMask, (QueryTriggerInteraction)1)) { return false; } if (Vector3.Distance(((RaycastHit)(ref hit)).point, ((Component)this).transform.position) > 1f) { if (((EnemyAI)this).SetDestinationToPosition(((RaycastHit)(ref hit)).point, true)) { base.agent.Warp(base.destination); return true; } return false; } return true; } return false; } [ServerRpc(RequireOwnership = false)] public void AlertBirdServerRpc() { AlertBirdClientRpc(); } [ClientRpc] public void AlertBirdClientRpc() { AlertBird(); } public void AlertBird() { //IL_0021: 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) DoublewingAI[] array = Object.FindObjectsByType((FindObjectsInactive)0, (FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { if (!((Object)(object)array[i] == (Object)(object)this) && Vector3.Distance(((Component)array[i]).transform.position, ((Component)this).transform.position) < 8f) { array[i].AlertBirdByOther(); } } ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); alertingBird = false; } public void AlertBirdByOther() { if (!base.daytimeEnemyLeaving) { if (((NetworkBehaviour)this).IsServer) { ((EnemyAI)this).SwitchToBehaviourState(1); } else { ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); } } } public override void Update() { //IL_01d8: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } SetFlyDirection(); if (base.daytimeEnemyLeaving) { return; } timeSinceSquawking += Time.deltaTime; if (base.stunNormalizedTimer > 0f) { StunBird(); } else { UnstunBird(); } switch (base.currentBehaviourStateIndex) { case 0: if (behaviourStateLastFrame != 0) { behaviourStateLastFrame = 0; randomYRot = Random.Range(0f, 360f); base.agent.speed = 0f; base.creatureAnimator.SetBool("gliding", false); bodyAnimator.SetBool("flying", false); flyingToOtherBirdLanding = false; timeSinceEnteringFlight = 0f; } flyLayerWeight = Mathf.Max(0f, flyLayerWeight - Time.deltaTime * 0.28f); timeSinceEnteringFlight += Time.deltaTime; break; case 1: if (behaviourStateLastFrame != 1) { behaviourStateLastFrame = 1; timeSinceEnteringFlight = 0f; base.creatureAnimator.SetBool("gliding", true); bodyAnimator.SetBool("flying", true); int num = RoundManager.PlayRandomClip(base.creatureSFX, base.enemyType.audioClips, true, 1f, 0, 1000); WalkieTalkie.TransmitOneShotAudio(base.creatureSFX, base.enemyType.audioClips[num], 0.7f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 12f, 0.6f, 0, false, 911); glideTime = Random.Range(8f, 20f); } timeSinceEnteringFlight += Time.deltaTime; flyLayerWeight = Mathf.Min(1f, flyLayerWeight + Time.deltaTime * 0.33f); break; } } private void BirdScreech() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) RoundManager.PlayRandomClip(base.creatureVoice, birdScreechSFX, true, 1f, 0, 1000); WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, birdScreechSFX[Random.Range(0, birdScreechSFX.Length)], 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 12f, 0.6f, 0, false, 911); } public void SetFlyDirection() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) if (birdStunned || base.isEnemyDead) { Vector3 localEulerAngles = Body.localEulerAngles; localEulerAngles.x = 0f; localEulerAngles.z = 0f; Body.localEulerAngles = localEulerAngles; return; } bool flag = false; flag = averageVelocity * speedElevationMultiplier < 12f; Vector3 val = Body.position - previousPosition; float num = ((Vector3)(ref val)).magnitude / Time.deltaTime; if (base.daytimeEnemyLeaving) { val = Body.position - previousPosition; if (((Vector3)(ref val)).sqrMagnitude >= 0f) { if (Body.position - previousPosition == Vector3.zero) { Body.rotation = Quaternion.Lerp(Body.rotation, Quaternion.Euler(0f, ((Component)this).transform.eulerAngles.y, 0f), 5f * Time.deltaTime); } else { Body.rotation = Quaternion.Lerp(Body.rotation, Quaternion.LookRotation(Body.position - previousPosition, Vector3.up), 5f * Time.deltaTime); } } } else if (base.currentBehaviourStateIndex == 0 || timeSinceEnteringFlight < 1f) { flag = false; Body.rotation = Quaternion.Lerp(Body.rotation, Quaternion.Euler(new Vector3(0f, randomYRot, 0f)), 10f * Time.deltaTime); } else if (averageVelocity * speedElevationMultiplier > 0f && Body.position - previousPosition != Vector3.zero) { Body.rotation = Quaternion.Lerp(Body.rotation, Quaternion.LookRotation(Body.position - previousPosition, Vector3.up), 5f * Time.deltaTime); } if (velocityInterval <= 0f) { velocityInterval = 0.1f; velocityAverageCount++; if (velocityAverageCount > 5) { averageVelocity += (num - averageVelocity) / 6f; } else { averageVelocity += num; if (velocityAverageCount == 5) { averageVelocity /= velocityAverageCount; } } } else { velocityInterval -= Time.deltaTime; } base.creatureAnimator.SetBool("flapping", flag); if (flag) { if (flappingAudio.volume <= 0.99f) { flappingAudio.volume = Mathf.Min(flappingAudio.volume + Time.deltaTime, 1f); } if (!flappingAudio.isPlaying) { flappingAudio.Play(); } } else if (flappingAudio.volume >= 0.05f) { flappingAudio.volume = Mathf.Max(flappingAudio.volume - Time.deltaTime, 0f); } else { flappingAudio.Stop(); } lerpedElevation = Mathf.Lerp(lerpedElevation, averageVelocity * speedElevationMultiplier / maxSpeed, Time.deltaTime * 0.5f); bodyAnimator.SetFloat("elevation", Mathf.Clamp(lerpedElevation * randomHeightOffset, 0.02f, 0.98f)); previousPosition = Body.position; } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); } } public override void KillEnemy(bool destroy = false) { ((EnemyAI)this).KillEnemy(destroy); bodyAnimator.SetBool("stunned", true); base.creatureAnimator.SetBool("dead", true); } public override void AnimationEventA() { ((EnemyAI)this).AnimationEventA(); if (((NetworkBehaviour)this).IsServer && timeSinceSquawking > 0.7f && Random.Range(0, 100) < birdNoisiness) { timeSinceSquawking = 0f; BirdScreechClientRpc(); } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void BirdScreechClientRpc() { BirdScreech(); } public override void AnimationEventB() { ((EnemyAI)this).AnimationEventB(); base.creatureSFX.PlayOneShot(birdHitGroundSFX); } }