using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using LethalLib.Modules; using LethalLibido.Configuration; using LethalLibido.src; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Boogie.LethalLibido")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.1.1.0")] [assembly: AssemblyInformationalVersion("0.1.1")] [assembly: AssemblyProduct("LethalLibido")] [assembly: AssemblyTitle("Boogie.LethalLibido")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] 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 LethalLibido { internal class ArmosAI : BoogieEnemy { private enum State { Spawning, FloatIdle, SlamDown, SlamDownLanded, Attacking, GivingUp, GroundIdle, Dying, Dead, Smacked } public AudioClip thumpSFX; public AudioSource thumpSFXSource; public AudioSource thumpDeepSFXSource; public AudioSource voiceSFXSource; public AudioSource bossDiesSFXSource; public AudioSource hitSFX; private Vector3 StalkPos; private float hopAnimationSpeed = 1f; protected bool slamHurts; public override void Start() { //IL_003d: 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) base.Start(); timeSpentChasingPlayer = 0f; ((EnemyAI)this).creatureAnimator.SetTrigger("Spawn"); ((EnemyAI)this).currentBehaviourStateIndex = 0; int num = randomInt(1, 3); ((Component)this).transform.localScale = new Vector3((float)num, (float)num, (float)num); ((EnemyAI)this).enemyHP = num; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } public override void Update() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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) base.Update(); timeSinceNewRandPos += Time.deltaTime; int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if (currentBehaviourStateIndex == 4) { timeSpentChasingPlayer += Time.deltaTime; } if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && (currentBehaviourStateIndex == 4 || currentBehaviourStateIndex == 2)) { turnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } } public override void DoAIInterval() { //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) base.DoAIInterval(); if (((EnemyAI)this).isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 1: ((EnemyAI)this).agent.speed = 3f; break; case 4: if (timeSpentChasingPlayer > 5f) { if (((EnemyAI)this).agent.speed > 0.75f) { NavMeshAgent agent = ((EnemyAI)this).agent; agent.speed -= 0.1f; } if (((EnemyAI)this).agent.speed < 0.75f) { NavMeshAgent agent2 = ((EnemyAI)this).agent; agent2.speed += 0.1f; } if (hopAnimationSpeed > 0.75f) { hopAnimationSpeed -= 0.01f; } } else { if (((EnemyAI)this).agent.speed < 9f) { NavMeshAgent agent3 = ((EnemyAI)this).agent; agent3.speed += 0.5f; } if (hopAnimationSpeed < 2f) { hopAnimationSpeed += 0.01f; } } ((EnemyAI)this).creatureAnimator.SetFloat("AnimationSpeed", hopAnimationSpeed); if (timeSpentChasingPlayer > 10f && (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) > 20f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)) || (((EnemyAI)this).agent.speed < 1f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)))) { doReset(); } else { ((EnemyAI)this).SetDestinationToPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, false); } break; } } public void SlamDownCompleted() { ((EnemyAI)this).SwitchToBehaviourClientRpc(4); } public void SlamDownBigSlam() { thumpDeepSFXSource.Play(); thumpPlayers(20, 1f); fearAllPlayersInRadius(20f, 1f, shakeCamera: true, ((EnemyAI)this).targetPlayer); ((EnemyAI)this).SwitchToBehaviourClientRpc(3); } private IEnumerator ActivateSlamDown() { for (int i = 0; i <= 6; i++) { if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) > 5f) { break; } yield return (object)new WaitForSeconds(0.5f); } DoAnimationClientRpc("SlamDown"); if (!backgroundMusicSFXSource.isPlaying) { backgroundMusicSFXSource.Play(); } } public void ActivateCrushBox() { slamHurts = true; } public void DeactivateCrushBox() { slamHurts = false; } public void Thump() { if (Random.Range(0f, 2f) > 1f) { thumpSFXSource.Play(); } else { thumpDeepSFXSource.Play(); } thumpPlayers(10, 0.2f); } public void FinishedResetting() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); timeSpentChasingPlayer = 0f; } public IEnumerator recoil(Vector3 goal) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).SetDestinationToPosition(goal, false); yield return (object)new WaitForSeconds(3f); TargetClosestPlayerInAnyCase(); DoAnimationClientRpc("BeginJumpAttack"); ((EnemyAI)this).SwitchToBehaviourClientRpc(4); yield return null; } public override void OnDeath() { ((EnemyAI)this).SwitchToBehaviourClientRpc(8); DoAnimationClientRpc("Die"); } public override void OnSmack() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).SwitchToBehaviourClientRpc(9); DoAnimationClientRpc("Smacked"); ((MonoBehaviour)this).StartCoroutine(recoil(((Component)this).transform.position - ((Component)this).transform.forward * 0.99f)); } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (((EnemyAI)this).currentBehaviourStateIndex != 1) { base.HitEnemy(force, playerWhoHit, playHitSFX, hitID); } } public override void CollidedWithPlayer(Collider collider, PlayerControllerB playerControllerB) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) if ((slamHurts || (((EnemyAI)this).currentBehaviourStateIndex != 1 && ((EnemyAI)this).currentBehaviourStateIndex != 4)) && (Object)(object)playerControllerB != (Object)null) { timeSinceHittingLocalPlayer = 0f; switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: case 1: ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = 0f; doActivateSlamDownServerRpc((int)playerControllerB.playerClientId); break; case 4: playerControllerB.DamagePlayer(10, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); timeSpentChasingPlayer = 0f; doThrowPlayerServerRpc((int)playerControllerB.playerClientId); ((EnemyAI)this).agent.speed = 0f; break; } } } [ServerRpc(RequireOwnership = false)] public void doThrowPlayerServerRpc(int playerId) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; int enemyYRot = (int)((Component)this).transform.eulerAngles.y; doThrowPlayerClientRpc(playerId, position, enemyYRot); } [ClientRpc] public void doThrowPlayerClientRpc(int playerId, Vector3 enemyPosition, int enemyYRot) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) doThrowPlayer(StartOfRound.Instance.allPlayerScripts[playerId], enemyPosition, enemyYRot); } public void doThrowPlayer(PlayerControllerB playerControllerB, Vector3 enemyPosition, int enemyYRot) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StartCoroutine(throwPlayer(playerControllerB, 3f, ((Component)this).transform.forward)); } [ServerRpc(RequireOwnership = false)] public void doActivateSlamDownServerRpc(int playerId) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_0020: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; int enemyYRot = (int)((Component)this).transform.eulerAngles.y; doActivateSlamDownClientRpc(playerId, position, enemyYRot); } [ClientRpc] public void doActivateSlamDownClientRpc(int playerId, Vector3 enemyPosition, int enemyYRot) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { doActivateSlamDown(StartOfRound.Instance.allPlayerScripts[playerId], enemyPosition, enemyYRot); } } public void doActivateSlamDown(PlayerControllerB playerControllerB, Vector3 enemyPosition, int enemyYRot) { //IL_003a: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = 0f; ((EnemyAI)this).targetPlayer = playerControllerB; turnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); ((MonoBehaviour)this).StartCoroutine(ActivateSlamDown()); } public void doReset() { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = 0f; timeSpentChasingPlayer = 0f; DoAnimationClientRpc("Reset"); ((EnemyAI)this).SwitchToBehaviourClientRpc(5); stopBackgroundMusicServerRpc(); } } internal class ExampleEnemyAI : EnemyAI { private enum State { SearchingForPlayer, StickingInFrontOfPlayer, HeadSwingAttackInProgress } public Transform turnCompass; public Transform attackArea; public GameObject overridePhysicsParentAnimationMesh; private float timeSinceHittingLocalPlayer; private float timeSinceNewRandPos; private Vector3 positionRandomness; private Vector3 StalkPos; private Random enemyRandom; private bool isDeadAnimationDone; [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { Plugin.Logger.LogInfo((object)text); } public override void Start() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); timeSinceHittingLocalPlayer = 0f; base.creatureAnimator.SetTrigger("startWalk"); timeSinceNewRandPos = 0f; positionRandomness = new Vector3(0f, 0f, 0f); enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); isDeadAnimationDone = false; base.currentBehaviourStateIndex = 0; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } public override void Update() { //IL_007f: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.isEnemyDead) { if (!isDeadAnimationDone) { isDeadAnimationDone = true; base.creatureVoice.Stop(); base.creatureVoice.PlayOneShot(base.dieSFX); } return; } timeSinceNewRandPos += Time.deltaTime; int currentBehaviourStateIndex = base.currentBehaviourStateIndex; if ((Object)(object)base.targetPlayer != (Object)null && (currentBehaviourStateIndex == 1 || currentBehaviourStateIndex == 2)) { turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } if (base.stunNormalizedTimer > 0f) { base.agent.speed = 0f; } } public override void DoAIInterval() { //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } switch (base.currentBehaviourStateIndex) { case 0: base.agent.speed = 3f; if (FoundClosestPlayerInRange(25f, 3f)) { ((EnemyAI)this).StopSearch(base.currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } break; case 1: base.agent.speed = 5f; if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 20f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null))) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } else { StickingInFrontOfPlayer(); } break; case 2: break; } } private bool FoundClosestPlayerInRange(float range, float senseRange) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f); if ((Object)(object)base.targetPlayer == (Object)null) { ((EnemyAI)this).TargetClosestPlayer(1.5f, false, 70f); range = senseRange; } if ((Object)(object)base.targetPlayer != (Object)null) { return Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range; } return false; } private bool TargetClosestPlayerInAnyCase() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) base.mostOptimalDistance = 2000f; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } if ((Object)(object)base.targetPlayer == (Object)null) { return false; } return true; } private void StickingInFrontOfPlayer() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)base.targetPlayer == (Object)null) && ((NetworkBehaviour)this).IsOwner && timeSinceNewRandPos > 0.7f) { timeSinceNewRandPos = 0f; if (enemyRandom.Next(0, 5) == 0) { ((MonoBehaviour)this).StartCoroutine(SwingAttack()); } else { positionRandomness = new Vector3((float)enemyRandom.Next(-2, 2), 0f, (float)enemyRandom.Next(-2, 2)); StalkPos = ((Component)base.targetPlayer).transform.position - Vector3.Scale(new Vector3(-5f, 0f, -5f), ((Component)base.targetPlayer).transform.forward) + positionRandomness; } ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); } } private IEnumerator SwingAttack() { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); StalkPos = ((Component)base.targetPlayer).transform.position; ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); yield return (object)new WaitForSeconds(0.5f); if (!base.isEnemyDead) { DoAnimationClientRpc("swingAttack"); yield return (object)new WaitForSeconds(0.35f); SwingAttackHitClientRpc(); if (base.currentBehaviourStateIndex == 2) { ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } } public override void OnCollideWithPlayer(Collider other) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (!(timeSinceHittingLocalPlayer < 1f)) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { timeSinceHittingLocalPlayer = 0f; val.DamagePlayer(20, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); base.inSpecialAnimationWithPlayer = val; base.inSpecialAnimationWithPlayer.inSpecialInteractAnimation = true; base.inSpecialAnimationWithPlayer.inAnimationWithEnemy = (EnemyAI)(object)this; base.inSpecialAnimationWithPlayer.overridePhysicsParent = overridePhysicsParentAnimationMesh.transform; } } } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (!base.isEnemyDead) { base.enemyHP -= force; if (((NetworkBehaviour)this).IsOwner && base.enemyHP <= 0 && !base.isEnemyDead) { ((MonoBehaviour)this).StopCoroutine(SwingAttack()); ((MonoBehaviour)this).StopCoroutine(base.searchCoroutine); ((EnemyAI)this).KillEnemyOnOwnerClient(false); } } } [ClientRpc] public void DoAnimationClientRpc(string animationName) { base.creatureAnimator.SetTrigger(animationName); } [ClientRpc] public void SwingAttackHitClientRpc() { //IL_0008: 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_005f: 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) int num = 8; Collider[] array = Physics.OverlapBox(attackArea.position, attackArea.localScale, Quaternion.identity, num); if (array.Length == 0) { return; } Collider[] array2 = array; foreach (Collider val in array2) { PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false); if ((Object)(object)val2 != (Object)null) { timeSinceHittingLocalPlayer = 0f; val2.DamagePlayer(40, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } } public void testy() { } } [BepInPlugin("Boogie.LethalLibido", "LethalLibido", "0.1.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; public static AssetBundle? ModAssets; internal static PluginConfig BoundConfig { get; private set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; BoundConfig = new PluginConfig(((BaseUnityPlugin)this).Config); InitializeNetworkBehaviours(); string path = "modassets"; ModAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), path)); if ((Object)(object)ModAssets == (Object)null) { Logger.LogError((object)"Failed to load custom assets."); return; } EnemyType val = ModAssets.LoadAsset("Armos"); TerminalNode val2 = ModAssets.LoadAsset("ArmosTN"); TerminalKeyword val3 = ModAssets.LoadAsset("ArmosTK"); NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab); Enemies.RegisterEnemy(val, BoundConfig.SpawnWeight.Value, (LevelTypes)(-1), val2, val3); EnemyType val4 = ModAssets.LoadAsset("Marie"); TerminalNode val5 = ModAssets.LoadAsset("MarieTN"); TerminalKeyword val6 = ModAssets.LoadAsset("MarieTK"); NetworkPrefabs.RegisterNetworkPrefab(val4.enemyPrefab); Enemies.RegisterEnemy(val4, BoundConfig.SpawnWeight.Value, (LevelTypes)(-1), val5, val6); EnemyType val7 = ModAssets.LoadAsset("Amy"); TerminalNode val8 = ModAssets.LoadAsset("AmyTN"); TerminalKeyword val9 = ModAssets.LoadAsset("AmyTK"); NetworkPrefabs.RegisterNetworkPrefab(val7.enemyPrefab); Enemies.RegisterEnemy(val7, BoundConfig.SpawnWeight.Value, (LevelTypes)(-1), val8, val9); EnemyType val10 = ModAssets.LoadAsset("Rouge"); TerminalNode val11 = ModAssets.LoadAsset("RougeTN"); TerminalKeyword val12 = ModAssets.LoadAsset("RougeTK"); NetworkPrefabs.RegisterNetworkPrefab(val10.enemyPrefab); Enemies.RegisterEnemy(val10, BoundConfig.SpawnWeight.Value, (LevelTypes)(-1), val11, val12); EnemyType val13 = ModAssets.LoadAsset("Midna"); TerminalNode val14 = ModAssets.LoadAsset("MidnaTN"); TerminalKeyword val15 = ModAssets.LoadAsset("MidnaTK"); NetworkPrefabs.RegisterNetworkPrefab(val13.enemyPrefab); Enemies.RegisterEnemy(val13, BoundConfig.SpawnWeight.Value, (LevelTypes)(-1), val14, val15); EnemyType val16 = ModAssets.LoadAsset("Betilla"); TerminalNode val17 = ModAssets.LoadAsset("BetillaTN"); TerminalKeyword val18 = ModAssets.LoadAsset("BetillaTK"); NetworkPrefabs.RegisterNetworkPrefab(val16.enemyPrefab); Enemies.RegisterEnemy(val16, BoundConfig.SpawnWeight.Value, (LevelTypes)(-1), val17, val18); Logger.LogInfo((object)"Plugin Boogie.LethalLibido is 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); } } } } } public static class PluginInfo { public const string PLUGIN_GUID = "Boogie.LethalLibido"; public const string PLUGIN_NAME = "LethalLibido"; public const string PLUGIN_VERSION = "0.1.1"; } } namespace LethalLibido.Configuration { public class PluginConfig { public ConfigEntry SpawnWeight; public PluginConfig(ConfigFile cfg) { SpawnWeight = cfg.Bind("General", "Spawn weight", 20, "The spawn chance weight for LethalLibido, relative to other existing enemies.\nGoes up from 0, lower is more rare, 100 and up is very common."); ClearUnusedEntries(cfg); } private void ClearUnusedEntries(ConfigFile cfg) { PropertyInfo property = ((object)cfg).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); Dictionary dictionary = (Dictionary)property.GetValue(cfg, null); dictionary.Clear(); cfg.Save(); } } } namespace LethalLibido.src { public class AmyAI : BoogieEnemy { private enum State { Spawning, RunningAround, SearchingForPlayer, PlayerSpotted, ChasingPlayer, AttackingPlayer, RecoilingFromPlayerAttack, Dying, Dead } public AudioClip HammerSFX; public bool SearchingForPlayer_standingStill = true; private float timeWalkingOrStandingStill; private float timeRunningAround; private new float wanderSpeed = 12f; private new float runSpeed = 60f; private new int attackDamage = 5; public Vector3? attackTargetPosition; public override void Start() { base.Start(); ((EnemyAI)this).currentBehaviourStateIndex = 0; ((MonoBehaviour)this).StartCoroutine(doSpawn()); } public override void Update() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) base.Update(); timeSinceNewRandPos += Time.deltaTime; Vector3 velocity; switch (((EnemyAI)this).currentBehaviourStateIndex) { case 1: { timeRunningAround += Time.deltaTime; Animator creatureAnimator2 = ((EnemyAI)this).creatureAnimator; velocity = ((EnemyAI)this).agent.velocity; creatureAnimator2.SetFloat("RunSpeedMultiplier", ((((Vector3)(ref velocity)).magnitude < 0.3f) ? 0.3f : ((EnemyAI)this).agent.speed) / ((EnemyAI)this).agent.speed * 2f); break; } case 4: { timeRunningAround += Time.deltaTime; timeSpentChasingPlayer += Time.deltaTime; Animator creatureAnimator = ((EnemyAI)this).creatureAnimator; velocity = ((EnemyAI)this).agent.velocity; creatureAnimator.SetFloat("RunSpeedMultiplier", ((((Vector3)(ref velocity)).magnitude < 0.3f) ? 0.3f : ((EnemyAI)this).agent.speed) / ((EnemyAI)this).agent.speed * 2f); break; } } if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && (((EnemyAI)this).currentBehaviourStateIndex == 3 || ((EnemyAI)this).currentBehaviourStateIndex == 4)) { turnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 1f * Time.deltaTime); } } public override void DoAIInterval() { //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) base.DoAIInterval(); if (((EnemyAI)this).isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 1: ((EnemyAI)this).agent.speed = wanderSpeed; if (randomInt(0, 10) == 1) { playRandomVoicefromArray(RandomVoicelineSFX, randomizePitch: false); } if (timeRunningAround > 10f && FoundClosestPlayerInRange(detectionRange, detectionRange)) { ((MonoBehaviour)this).StartCoroutine(playerSpotted()); } break; case 4: if (((EnemyAI)this).agent.speed < runSpeed) { NavMeshAgent agent = ((EnemyAI)this).agent; agent.speed += 1f; } if (randomInt(0, 20) == 1) { playRandomVoicefromArray(RandomVoicelineSFX, randomizePitch: false); } if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) > 20f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)) || timeRunningAround > 20f) { ((MonoBehaviour)this).StartCoroutine(doRunAround()); } else if (TargetClosestPlayerInAnyCase() && Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) < 7f) { ((MonoBehaviour)this).StartCoroutine(doSlamAttack()); } else { ((EnemyAI)this).SetDestinationToPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, false); } break; case 5: if (!attackTargetPosition.HasValue) { attackTargetPosition = ((Component)((EnemyAI)this).targetPlayer).transform.position; ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); } ((EnemyAI)this).SetDestinationToPosition(attackTargetPosition.Value, false); break; case 0: case 2: case 3: break; } } public override void CollidedWithPlayer(Collider collider, PlayerControllerB playerControllerB) { int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if (currentBehaviourStateIndex != 2) { _ = 4; } } private IEnumerator doSpawn() { yield return (object)new WaitForSeconds(2f); ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = wanderSpeed; ((EnemyAI)this).SwitchToBehaviourClientRpc(3); yield return (object)new WaitForSeconds(1f); ((MonoBehaviour)this).StartCoroutine(doRunAround()); yield return null; } private IEnumerator doRunAround() { timeRunningAround = 0f; ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).agent.speed = wanderSpeed; ((EnemyAI)this).SwitchToBehaviourClientRpc(1); DoAnimationClientRpc("Run"); ((EnemyAI)this).agent.angularSpeed = 300f; ((EnemyAI)this).agent.acceleration = 10f; yield return null; } private IEnumerator playerSpotted() { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = runSpeed; ((EnemyAI)this).SwitchToBehaviourClientRpc(4); DoAnimationClientRpc("Run"); timeRunningAround = 0f; timeSpentChasingPlayer = 0f; yield return null; } private IEnumerator doSlamAttack() { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(5); if (randomInt(0, 5) == 1) { playRandomVoicefromArray(RandomSpecialWanderVoicelineSFX, randomizePitch: false); } DoAnimationClientRpc("Slam"); yield return (object)new WaitForSeconds(2f); ((MonoBehaviour)this).StartCoroutine(doRunAround()); yield return null; } private IEnumerator doHitRecoil() { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(6); DoAnimationClientRpc("Smacked"); yield return (object)new WaitForSeconds(4f); if (!((EnemyAI)this).isEnemyDead) { ((MonoBehaviour)this).StartCoroutine(doRunAround()); } yield return null; } [ClientRpc] public void slamPlayersClientRpc() { //IL_0024: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) playSfxRandomizedPitch(HammerSFX); ((EnemyAI)this).agent.speed = 0f; int num = 8; Collider[] array = Physics.OverlapBox(attackArea.position, attackArea.localScale, Quaternion.identity, num); if (array.Length == 0) { return; } Collider[] array2 = array; foreach (Collider val in array2) { PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false); if ((Object)(object)val2 != (Object)null && !val2.isPlayerDead) { timeSinceHittingLocalPlayer = 0f; int num2 = attackDamage; Vector3 val3 = default(Vector3); val2.DamagePlayer(num2, true, true, (CauseOfDeath)0, 0, false, val3); val3 = new Vector3(0f, 0.5f, 0f); Vector3 normalized = ((Vector3)(ref val3)).normalized; val3 = ((Component)val2).transform.position - ((Component)attackArea).transform.position; Vector3 normalized2 = ((Vector3)(ref val3)).normalized; float num3 = 2f * (1f - Vector3.Distance(((Component)val2).transform.position, ((Component)attackArea).transform.position) / 10f); num3 = (1f + Math.Abs(num3 / 10f)) / 4f; if ((Object)(object)GameNetworkManager.Instance.localPlayerController.thisController == (Object)(object)val) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } float force = num3; val3 = normalized + normalized2; ((MonoBehaviour)this).StartCoroutine(throwPlayer(val2, force, ((Vector3)(ref val3)).normalized / 5f)); } } } public void footStep() { playSfxRandomizedPitch(FootstepSFX); } public void spotPlayerAnimationFinished() { ((EnemyAI)this).SwitchToBehaviourClientRpc(4); DoAnimationClientRpc("DashAtPlayer"); } public void spawnAnimationFinished() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).SwitchToBehaviourClientRpc(2); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } public void slamAttackFinished() { attackTargetPosition = null; ((EnemyAI)this).SwitchToBehaviourClientRpc(2); DoAnimationClientRpc("ToIdleWalk"); SearchingForPlayer_standingStill = false; } public override void OnDeath() { ((EnemyAI)this).SwitchToBehaviourClientRpc(8); DoAnimationClientRpc("Die"); } public override void OnSmack() { ((MonoBehaviour)this).StartCoroutine(doHitRecoil()); } } internal class BetillaAI : BoogieEnemy { private enum State { Spawning, SearchingForPlayer, PlayerSpotted, FollowingPlayer, SittingOnPlayer, WavingAtPlayer, KickingLegs, AccidentallyKillingPlayer, TeleportingPlayer, Reset, Dying, Dead } private bool playerAttached; private int vectTest; private Quaternion quatBeforeTakingControl; public PlayerControllerB clingingToPlayer; public float clingToPlayerTimer; public float timeSinceTeleportingPlayerTimer; public float timeSinceEmoting; public float timeSinceSittingOnPlayer; public int clingPosition; private bool backOnGround; public override void Start() { base.Start(); ((EnemyAI)this).currentBehaviourStateIndex = 0; } public override void Update() { //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) base.Update(); timeSinceNewRandPos += Time.deltaTime; timeSinceTeleportingPlayerTimer += Time.deltaTime; timeSinceEmoting += Time.deltaTime; timeSinceSittingOnPlayer += Time.deltaTime; switch (((EnemyAI)this).currentBehaviourStateIndex) { case 4: if (!(timeSinceEmoting > 10f)) { break; } switch (randomInt(1, 5)) { case 1: ((MonoBehaviour)this).StartCoroutine(doWaveAtPlayer()); break; case 2: ((MonoBehaviour)this).StartCoroutine(doTapAtPlayer()); break; case 3: if (randomInt(1, 50) == 1) { doKillPlayerServerRpc((int)clingingToPlayer.playerClientId); } break; } timeSinceEmoting = 0f; break; } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 4: case 5: SetClingingAnimationPosition(); break; case 11: if (!backOnGround) { returnToGround(); backOnGround = true; } break; } if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && (((EnemyAI)this).currentBehaviourStateIndex == 2 || ((EnemyAI)this).currentBehaviourStateIndex == 3)) { turnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 2f * Time.deltaTime); } if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer != (Object)null && ((EnemyAI)this).currentBehaviourStateIndex == 7) { ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.position = overridePhysicsParentAnimationMesh2.transform.position; Transform transform = ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform; transform.position -= ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.up * 0.4f; ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.rotation = overridePhysicsParentAnimationMesh2.transform.rotation; } } public override void DoAIInterval() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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) base.DoAIInterval(); _ = (Object)(object)clingingToPlayer != (Object)null; if (((EnemyAI)this).isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 1: ((EnemyAI)this).agent.speed = 3f; if (FoundClosestPlayerInRange(25f, 3f, noAttachments: true)) { ((MonoBehaviour)this).StartCoroutine(playerSpotted()); } break; case 3: if (((EnemyAI)this).agent.speed < 5f) { NavMeshAgent agent = ((EnemyAI)this).agent; agent.speed += 0.5f; } if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) > 20f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)) || (((EnemyAI)this).agent.speed < 1f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)) || ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && ((EnemyAI)this).targetPlayer.enemiesOnPerson > 0)) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); startWandering(); } else if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null) { ((EnemyAI)this).SetDestinationToPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, false); } break; case 7: if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer != (Object)null) { ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.rotation = overridePhysicsParentAnimationMesh.transform.rotation; } break; } } public override void CollidedWithPlayer(Collider collider, PlayerControllerB playerControllerB) { if ((Object)(object)clingingToPlayer == (Object)null && (Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null && timeSinceSittingOnPlayer > 5f && playerControllerB.enemiesOnPerson == 0) { int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if (currentBehaviourStateIndex == 1 || currentBehaviourStateIndex == 3) { ((EnemyAI)this).agent.speed = 0f; float num = Random.Range(30f, 60f); SetClingToPlayerServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } else if ((Object)(object)clingingToPlayer == (Object)null && timeSinceSittingOnPlayer > 5f) { startWandering(); } } [ServerRpc(RequireOwnership = false)] public void SetClingToPlayerServerRpc(int playerId) { ClingToPlayerClientRpc(playerId, 0, 40f); } private void SetClingToPlayer(PlayerControllerB playerToCling, int setClingPosition, float clingTime) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) clingPosition = setClingPosition; clingingToPlayer = playerToCling; ((EnemyAI)this).inSpecialAnimation = true; playerToCling.enemiesOnPerson++; playerToCling.carryWeight += 0.03f; if ((Object)(object)playerToCling == (Object)(object)GameNetworkManager.Instance.localPlayerController) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); SoundManager.Instance.misc2DAudio.volume = 1f; SoundManager.Instance.misc2DAudio.pitch = Random.Range(0.9f, 1.1f); } clingToPlayerTimer = clingTime; DoAnimationClientRpc("SitOnPlayer"); ((EnemyAI)this).SwitchToBehaviourClientRpc(4); SetClingingAnimationPosition(); scaleBeforeTakingControl = ((Component)playerToCling).transform.localScale; } [ClientRpc] public void ClingToPlayerClientRpc(int playerId, int setClingPosition, float clingTime) { PlayerControllerB playerToCling = StartOfRound.Instance.allPlayerScripts[playerId]; SetClingToPlayer(playerToCling, setClingPosition, clingTime); } private void SetClingingAnimationPosition() { //IL_00a9: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_008d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)clingingToPlayer == (Object)null)) { if ((Object)(object)clingingToPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController) { enableSkinnedMeshRenderers(); ((Component)this).transform.position = ((Component)clingingToPlayer.gameplayCamera).transform.position; Transform transform = ((Component)this).transform; transform.position -= ((Component)this).transform.up * 0.4f; ((Component)this).transform.rotation = ((Component)clingingToPlayer.gameplayCamera).transform.rotation; } else { ((Component)this).transform.position = clingingToPlayer.upperSpine.position; ((Component)this).transform.rotation = clingingToPlayer.upperSpine.rotation; } } } public void TeleportPlayer() { if ((Object)(object)clingingToPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController) { TeleportPlayerServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } [ServerRpc(RequireOwnership = false)] public void TeleportPlayerServerRpc(int playerId) { TeleportPlayerClientRpc(playerId); } [ClientRpc] public void TeleportPlayerClientRpc(int playerId) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (RoundManager.Instance.insideAINodes.Length != 0) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId]; Vector3 position = RoundManager.Instance.insideAINodes[enemyRandom.Next(0, RoundManager.Instance.insideAINodes.Length)].transform.position; position = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(position, 10f, default(NavMeshHit), enemyRandom, -1); val.isInsideFactory = !val.isInsideFactory; val.isInElevator = false; val.isInHangarShipRoom = false; val.TeleportPlayer(position, true, 0f, false, true); } } public IEnumerator doTeleportPlayer(PlayerControllerB player) { if (RoundManager.Instance.insideAINodes.Length == 0) { yield return null; } Vector3 position = RoundManager.Instance.insideAINodes[enemyRandom.Next(0, RoundManager.Instance.insideAINodes.Length)].transform.position; position = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(position, 10f, default(NavMeshHit), enemyRandom, -1); player.isInsideFactory = !player.isInsideFactory; player.isInElevator = false; player.isInHangarShipRoom = false; player.TeleportPlayer(position, true, 0f, false, true); yield return null; } [ServerRpc(RequireOwnership = false)] public void doKillPlayerServerRpc(int playerId) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (!((Object)(object)networkManager == (Object)null) && networkManager.IsListening && (Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { Vector3 position = ((Component)this).transform.position; int enemyYRot = (int)((Component)this).transform.eulerAngles.y; doKillPlayer2ClientRpc(playerId, position, enemyYRot); } } [ClientRpc] public void doKillPlayer2ClientRpc(int playerId, Vector3 enemyPosition, int enemyYRot) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { doKillPlayer(StartOfRound.Instance.allPlayerScripts[playerId], enemyPosition, enemyYRot); } } public void doKillPlayer(PlayerControllerB playerControllerB, Vector3 enemyPosition, int enemyYRot) { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = clingingToPlayer; scaleBeforeTakingControl = ((Component)val).transform.localScale; shrinkPlayerClientRpc(); ((EnemyAI)this).SwitchToBehaviourClientRpc(7); AttachPlayerToKillAnimation(val); Transform transform = ((Component)this).transform; transform.position -= ((Component)this).transform.forward * 0.12f; DoAnimationClientRpc("CrushPlayer"); } public IEnumerator doWaveAtPlayer() { DoAnimationClientRpc("SitWave"); ((EnemyAI)this).SwitchToBehaviourClientRpc(5); yield return null; } public IEnumerator doTapAtPlayer() { DoAnimationClientRpc("SitTap"); ((EnemyAI)this).SwitchToBehaviourClientRpc(5); yield return null; } private IEnumerator playerSpotted() { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(2); yield return (object)new WaitForSeconds(1f); DoAnimationClientRpc("SeePlayer"); yield return null; } public void spotPlayerAnimationFinished() { ((EnemyAI)this).SwitchToBehaviourClientRpc(3); } public void spawnAnimationFinished() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).SwitchToBehaviourClientRpc(1); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } public void startWandering() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) DoAnimationClientRpc("Idle"); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } public void waveAtPlayerAnimationFinished() { ((EnemyAI)this).SwitchToBehaviourClientRpc(4); DoAnimationClientRpc("SitOnPlayer"); } public void crushPlayerAnimationFinished() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).SwitchToBehaviourClientRpc(1); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); DoAnimationClientRpc("Idle"); ReleasePlayerFromKillAnimation(); } [ClientRpc] private void shrinkPlayerClientRpc() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) scaleBeforeTakingControl = ((Component)clingingToPlayer).transform.localScale; ((Component)clingingToPlayer).transform.localScale = scaleBeforeTakingControl / 8f; } [ServerRpc(RequireOwnership = false)] private void releaseClingingPlayerServerRpc() { releaseClingingPlayerClientRpc(); ((EnemyAI)this).inSpecialAnimationWithPlayer = null; } [ClientRpc] private void releaseClingingPlayerClientRpc() { if ((Object)(object)clingingToPlayer != (Object)null) { PlayerControllerB obj = clingingToPlayer; obj.enemiesOnPerson--; clingingToPlayer = null; ((EnemyAI)this).inSpecialAnimation = false; } timeSinceSittingOnPlayer = 0f; returnToGround(); } [ClientRpc] private void unShrinkPlayerClientRpc() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)clingingToPlayer != (Object)null) { ((Component)clingingToPlayer).transform.localScale = scaleBeforeTakingControl; } } public void executePlayer() { //IL_0012: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).inSpecialAnimationWithPlayer.DamagePlayer(1000, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); ((EnemyAI)this).inSpecialAnimationWithPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)8, 0, default(Vector3)); if (!((EnemyAI)this).inSpecialAnimationWithPlayer.isPlayerDead) { unShrinkPlayerClientRpc(); releaseClingingPlayerClientRpc(); ReleasePlayerFromKillAnimation(); ((EnemyAI)this).inSpecialAnimationWithPlayer = null; } } public void returnToGround() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_006c: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)this).transform.position, Vector3.down); _ = ((Component)this).transform.position; Vector3 position = ((Component)this).transform.position; RaycastHit val2 = default(RaycastHit); Vector3 position2 = ((!Physics.Raycast(val, ref val2, 40f, 256)) ? RoundManager.Instance.GetNavMeshPosition(((Component)this).transform.position, default(NavMeshHit), 5f, -1) : ((RaycastHit)(ref val2)).point); ((Component)this).transform.position = position2; } public override void OnDeath() { unShrinkPlayerClientRpc(); releaseClingingPlayerServerRpc(); } public override void OnSmack() { unShrinkPlayerClientRpc(); releaseClingingPlayerServerRpc(); } } public abstract class BoogieEnemy : EnemyAI, INoiseListener { public Transform turnCompass; public Animator enemyAnimator; public GameObject overridePhysicsParentAnimationMesh; public GameObject overridePhysicsParentAnimationMesh2; public GameObject overridePhysicsParentAnimationMesh3; public GameObject[] updateWhenOffscreenMeshes; public Collider toggleCollider; public AudioClip RoarSFX; public AudioClip KillSceneBeginSFX; public AudioClip FootstepSFX; public AudioClip[] RandomVoicelineSFX; public AudioClip[] RandomSpecialWanderVoicelineSFX; public AudioSource backgroundMusicSFXSource; protected float timeSinceHittingLocalPlayer; protected float timeSinceNewRandPos; protected float timeSpentChasingPlayer; protected float timeSinceAttacking; protected bool isDeadAnimationDone; protected Vector3 positionRandomness; private Quaternion rotationBeforeTakingControl; private Vector3 positionBeforeTakingControl; protected Vector3 scaleBeforeTakingControl; protected Random enemyRandom; public float wanderSpeed = 15f; public float runSpeed = 25f; public float detectionRange = 20f; public int attackDamage = 1; private string enemyName = ""; public Transform attackArea; public Transform collider; protected float originalVoicePitch; private float originalSFXPitch; [Conditional("DEBUG")] protected void LogIfDebugBuild(string text) { Plugin.Logger.LogInfo((object)text); } public override void Start() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); timeSinceHittingLocalPlayer = 0f; timeSinceNewRandPos = 0f; positionRandomness = new Vector3(0f, 0f, 0f); enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); isDeadAnimationDone = false; originalVoicePitch = base.creatureVoice.pitch; originalSFXPitch = base.creatureSFX.pitch; } public override void Update() { ((EnemyAI)this).Update(); timeSinceNewRandPos += Time.deltaTime; timeSinceHittingLocalPlayer += Time.deltaTime; if (base.isEnemyDead && (Object)(object)backgroundMusicSFXSource != (Object)null && backgroundMusicSFXSource.isPlaying) { backgroundMusicSFXSource.Stop(); } } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if (!base.isEnemyDead) { _ = StartOfRound.Instance.allPlayersDead; } } protected bool FoundClosestPlayerInRange(float range, float senseRange, bool noAttachments = false) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) if (noAttachments) { TargetClosestPlayerAndHasZeroEnemiesAttached(1.5f, requireLineOfSight: true); } else { ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f); } if ((Object)(object)base.targetPlayer == (Object)null) { if (noAttachments) { TargetClosestPlayerAndHasZeroEnemiesAttached(); } else { ((EnemyAI)this).TargetClosestPlayer(1.5f, false, 70f); } range = senseRange; } if ((Object)(object)base.targetPlayer != (Object)null) { return Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range; } return false; } public bool TargetClosestPlayerAndHasZeroEnemiesAttached(float bufferDistance = 1.5f, bool requireLineOfSight = false, float viewWidth = 70f) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) base.mostOptimalDistance = 2000f; PlayerControllerB targetPlayer = base.targetPlayer; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { if (StartOfRound.Instance.allPlayerScripts[i].enemiesOnPerson == 0 && ((EnemyAI)this).PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false) && !((EnemyAI)this).PathIsIntersectedByLineOfSight(((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position, false, false, false) && (!requireLineOfSight || ((EnemyAI)this).CheckLineOfSightForPosition(((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position, viewWidth, 40, -1f, (Transform)null))) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } } if ((Object)(object)base.targetPlayer != (Object)null && bufferDistance > 0f && (Object)(object)targetPlayer != (Object)null && Mathf.Abs(base.mostOptimalDistance - Vector3.Distance(((Component)this).transform.position, ((Component)targetPlayer).transform.position)) < bufferDistance) { base.targetPlayer = targetPlayer; } return (Object)(object)base.targetPlayer != (Object)null; } protected bool FoundClosestPlayerInRangeAndLineOfSight(float range) { //IL_0026: 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) ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f); if ((Object)(object)base.targetPlayer != (Object)null) { return Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range; } return false; } protected bool IsTargetLineOfSight(PlayerControllerB player, float viewWidth = 40f, int range = 40) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return ((EnemyAI)this).CheckLineOfSightForPosition(((Component)player.gameplayCamera).transform.position, viewWidth, range, -1f, (Transform)null); } protected bool IsTargetVisible(Camera c, GameObject go) { //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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Plane[] array = GeometryUtility.CalculateFrustumPlanes(c); Vector3 position = go.transform.position; Plane[] array2 = array; for (int i = 0; i < array2.Length; i++) { Plane val = array2[i]; if (((Plane)(ref val)).GetDistanceToPoint(position) < 0f) { return false; } } return true; } protected bool IsTransformVisible(Camera c, Transform go) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) Plane[] array = GeometryUtility.CalculateFrustumPlanes(c); Vector3 position = go.position; Plane[] array2 = array; for (int i = 0; i < array2.Length; i++) { Plane val = array2[i]; if (((Plane)(ref val)).GetDistanceToPoint(position) < 0f) { return false; } } return true; } protected bool TargetClosestPlayerInAnyCase() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) base.mostOptimalDistance = 2000f; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } if ((Object)(object)base.targetPlayer == (Object)null) { return false; } return true; } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (base.isEnemyDead) { return; } base.enemyHP -= force; if (!((NetworkBehaviour)this).IsOwner) { return; } if (base.enemyHP <= 0 && !base.isEnemyDead) { if (base.searchCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.searchCoroutine); } ((EnemyAI)this).KillEnemyOnOwnerClient(false); stopBackgroundMusicClientRpc(); OnDeath(); } else if (base.enemyHP > 0) { OnSmack(); } } public abstract void OnDeath(); public abstract void OnSmack(); public override void OnCollideWithPlayer(Collider other) { ((EnemyAI)this).OnCollideWithPlayer(other); if (!(timeSinceHittingLocalPlayer < 1f)) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { CollidedWithPlayer(other, val); } } } public abstract void CollidedWithPlayer(Collider collider, PlayerControllerB playerControllerB); [ClientRpc] public void DoAnimationClientRpc(string animationName) { base.creatureAnimator.SetTrigger(animationName); } public void toggleSkinnedMeshRenderers() { if (updateWhenOffscreenMeshes != null) { GameObject[] array = updateWhenOffscreenMeshes; foreach (GameObject val in array) { SkinnedMeshRenderer component = val.GetComponent(); component.updateWhenOffscreen = true; } } } public void enableSkinnedMeshRenderers() { if (updateWhenOffscreenMeshes == null) { return; } GameObject[] array = updateWhenOffscreenMeshes; foreach (GameObject val in array) { SkinnedMeshRenderer component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.updateWhenOffscreen = true; } } } public void disableSkinnedMeshRenderers() { GameObject[] array = updateWhenOffscreenMeshes; foreach (GameObject val in array) { SkinnedMeshRenderer component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.updateWhenOffscreen = false; } } } public void AttachPlayerToKillAnimation(PlayerControllerB playerControllerB) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) base.inSpecialAnimationWithPlayer = playerControllerB; base.inSpecialAnimation = true; base.inSpecialAnimationWithPlayer.isInElevator = false; base.inSpecialAnimationWithPlayer.isInHangarShipRoom = false; base.inSpecialAnimationWithPlayer.inSpecialInteractAnimation = true; base.inSpecialAnimationWithPlayer.inAnimationWithEnemy = (EnemyAI)(object)this; base.inSpecialAnimationWithPlayer.inSpecialInteractAnimation = true; ((Component)base.inSpecialAnimationWithPlayer).transform.position = overridePhysicsParentAnimationMesh.transform.position; ((Component)base.inSpecialAnimationWithPlayer).transform.rotation = overridePhysicsParentAnimationMesh.transform.rotation; rotationBeforeTakingControl = ((Component)base.inSpecialAnimationWithPlayer).transform.rotation; positionBeforeTakingControl = ((Component)base.inSpecialAnimationWithPlayer).transform.position; } public void ReleasePlayerFromKillAnimation() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.inSpecialAnimationWithPlayer != (Object)null) { base.inSpecialAnimationWithPlayer.inSpecialInteractAnimation = false; base.inSpecialAnimationWithPlayer.inAnimationWithEnemy = null; base.inSpecialAnimationWithPlayer.snapToServerPosition = false; base.inSpecialAnimationWithPlayer.inSpecialInteractAnimation = false; ((Component)base.inSpecialAnimationWithPlayer).transform.rotation = rotationBeforeTakingControl; ((Component)base.inSpecialAnimationWithPlayer).transform.position = positionBeforeTakingControl; base.inSpecialAnimationWithPlayer.overridePhysicsParent = null; base.inSpecialAnimationWithPlayer = null; } base.inSpecialAnimation = false; } public int randomInt(int min, int max) { return enemyRandom.Next(min, max + 1); } public IEnumerator killCurrentTargetPlayer() { if ((Object)(object)base.inSpecialAnimationWithPlayer.inAnimationWithEnemy == (Object)(object)this && !base.inSpecialAnimationWithPlayer.isPlayerDead) { base.inSpecialAnimationWithPlayer.KillPlayer(Vector3.zero, false, (CauseOfDeath)8, 0, default(Vector3)); base.inSpecialAnimationWithPlayer.inSpecialInteractAnimation = false; base.inSpecialAnimationWithPlayer.inAnimationWithEnemy = null; base.inSpecialAnimationWithPlayer = null; yield return (object)new WaitForSeconds(3f); } yield return null; } public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DetectNoise(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID); } protected void thumpPlayers(int radius, float strength) { //IL_0011: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < (float)radius) { list.Add(StartOfRound.Instance.allPlayerScripts[i]); } } foreach (PlayerControllerB item in list) { if ((!((Object)(object)base.inSpecialAnimationWithPlayer != (Object)null) || !((Object)(object)base.inSpecialAnimationWithPlayer == (Object)(object)item)) && !item.isPlayerDead && !item.isInElevator && !item.isInHangarShipRoom && !(item.fallValue > 0f)) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)item).transform.position); float strengthPercentage = ((float)radius - base.tempDist) / (float)radius; if (strength < 0f) { strength = 0f; } ((MonoBehaviour)this).StartCoroutine(thumpPlayerRoutine(item, strength, strengthPercentage)); } } } private IEnumerator thumpPlayerRoutine(PlayerControllerB player, float thumpStrength, float strengthPercentage) { Vector3 throwDirection = default(Vector3); ((Vector3)(ref throwDirection))..ctor(0f, thumpStrength * strengthPercentage, 0f); if ((Object)(object)GameNetworkManager.Instance.localPlayerController.thisController == (Object)(object)player) { if (strengthPercentage > 0.9f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); HUDManager.Instance.ShakeCamera((ScreenShakeType)1); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } else if (strengthPercentage > 0.7f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } else if (strengthPercentage > 0.5f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } else if (strengthPercentage > 0.2f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } else { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } } ((MonoBehaviour)this).StartCoroutine(throwPlayer(player, 1f, throwDirection)); yield return (object)new WaitForSeconds(1f); } public IEnumerator throwPlayer(PlayerControllerB player, float force, Vector3 throwDirection) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) float smoothTime = 0.5f; Vector3 val = ((Component)player.thisController).transform.position + throwDirection; Vector3 val2 = val - ((Component)player.thisController).transform.position; Vector3 direction = ((Vector3)(ref val2)).normalized; float distance = Vector3.Distance(((Component)player.thisController).transform.position, val); for (float currentTime = 0f; currentTime < smoothTime; currentTime += Time.fixedDeltaTime) { float num = distance * Mathf.Min(currentTime, smoothTime) / smoothTime; player.thisController.Move(direction * num); yield return null; } } public IEnumerator throwPlayer2(PlayerControllerB player, Vector3 push) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) float num = 0.08f; float smoothTime = ((Vector3)(ref push)).magnitude / num; Vector3 val = ((Component)player).transform.position + push; _ = val - ((Component)player).transform.position; Vector3 direction = ((Vector3)(ref push)).normalized; float distance = Vector3.Distance(((Component)player).transform.position, val); for (float currentTime = 0f; currentTime < smoothTime; currentTime += Time.fixedDeltaTime) { float num2 = distance * Mathf.Min(currentTime, smoothTime) / smoothTime; player.thisController.Move(direction * num2); yield return null; } } public void playVoiceRandomizedPitch(AudioClip clip) { int[] array = new int[5] { 0, 2, 4, 7, 9 }; float num = originalVoicePitch; for (int i = 0; i < array[randomInt(0, array.Length - 1)]; i++) { num *= 1.059463f; } base.creatureVoice.pitch = num; base.creatureVoice.PlayOneShot(clip); } public void playSfxRandomizedPitch(AudioClip clip) { int[] array = new int[5] { 0, 2, 4, 7, 9 }; float num = originalSFXPitch; for (int i = 0; i < array[randomInt(0, array.Length - 1)]; i++) { num *= 1.059463f; } base.creatureSFX.pitch = num; base.creatureSFX.PlayOneShot(clip); } public void playRandomVoiceSFX() { if (RandomVoicelineSFX != null && RandomVoicelineSFX.Length != 0) { playVoiceRandomizedPitch(RandomVoicelineSFX[randomInt(0, RandomVoicelineSFX.Length - 1)]); } } public void playRandomSfxfromArray(AudioClip[] arr, bool randomizePitch = true) { if (!base.creatureSFX.isPlaying && arr != null && arr.Length != 0) { if (randomizePitch) { playSfxRandomizedPitch(arr[randomInt(0, arr.Length - 1)]); return; } base.creatureSFX.pitch = originalSFXPitch; base.creatureSFX.PlayOneShot(arr[randomInt(0, arr.Length - 1)]); } } public void playRandomVoicefromArray(AudioClip[] arr, bool randomizePitch = true) { if (!base.creatureVoice.isPlaying && arr != null && arr.Length != 0) { if (randomizePitch) { playVoiceRandomizedPitch(arr[randomInt(0, arr.Length - 1)]); return; } base.creatureVoice.pitch = originalSFXPitch; base.creatureVoice.PlayOneShot(arr[randomInt(0, arr.Length - 1)]); } } [ServerRpc(RequireOwnership = false)] public void stopBackgroundMusicServerRpc() { stopBackgroundMusicClientRpc(); } [ClientRpc] public void stopBackgroundMusicClientRpc() { if ((Object)(object)backgroundMusicSFXSource != (Object)null) { backgroundMusicSFXSource.Stop(); } } public void fearAllPlayersInRadius(float radius, float fearLevel, bool shakeCamera = false, PlayerControllerB targetPlayer = null) { //IL_0011: 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) List list = new List(); for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < radius || ((Object)(object)targetPlayer != (Object)null && (Object)(object)targetPlayer == (Object)(object)StartOfRound.Instance.allPlayerScripts[i])) { list.Add(StartOfRound.Instance.allPlayerScripts[i]); } } foreach (PlayerControllerB item in list) { if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)item) { item.JumpToFearLevel(fearLevel, true); if (shakeCamera) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); HUDManager.Instance.ShakeCamera((ScreenShakeType)1); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } } } } } public class GenericBase : BoogieEnemy { private enum State { Spawning, SearchingForPlayer, PlayerSpotted, ChasingPlayer, AttackingPlayer, RecoilingFromPlayerAttack, Dying, Dead } public override void Start() { base.Start(); ((EnemyAI)this).currentBehaviourStateIndex = 0; } public override void Update() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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) base.Update(); timeSinceNewRandPos += Time.deltaTime; if (((EnemyAI)this).currentBehaviourStateIndex != 0) { _ = 2; } if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && (((EnemyAI)this).currentBehaviourStateIndex == 2 || ((EnemyAI)this).currentBehaviourStateIndex == 3)) { turnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } } public override void DoAIInterval() { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) base.DoAIInterval(); if (((EnemyAI)this).isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 1: ((EnemyAI)this).agent.speed = 3f; if (FoundClosestPlayerInRange(25f, 3f)) { ((MonoBehaviour)this).StartCoroutine(playerSpotted()); } break; case 3: if (((EnemyAI)this).agent.speed < 5f) { NavMeshAgent agent = ((EnemyAI)this).agent; agent.speed += 0.5f; } if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) > 20f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)) || (((EnemyAI)this).agent.speed < 1f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null))) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = 0f; timeSpentChasingPlayer = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } else { ((EnemyAI)this).SetDestinationToPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, false); } break; } } public override void CollidedWithPlayer(Collider collider, PlayerControllerB playerControllerB) { int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if (currentBehaviourStateIndex != 1) { _ = 3; } } private IEnumerator playerSpotted() { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(2); yield return (object)new WaitForSeconds(1f); DoAnimationClientRpc("SeePlayer"); yield return null; } public void spotPlayerAnimationFinished() { ((EnemyAI)this).SwitchToBehaviourClientRpc(3); } public void spawnAnimationFinished() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).SwitchToBehaviourClientRpc(1); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } public override void OnDeath() { } public override void OnSmack() { } } internal class GiantessAI { private enum State { Spawning, WaitingForTarget, Activating, Chasing, Attacking, SittingOnPlayer, SteppingOnPlayer, EatingPlayer, Reset, Dying, Dead } } public class GiantessRougeAI : BoogieEnemy { private enum State { Spawning, Roaring, Walking, Standing, SpottedPlayer, ChasingPlayer, Attacking, SittingOnPlayer, SteppingOnPlayer, EatingPlayer, Resetting, Dying, Dead, Wandering, Stunned } public AudioClip GulpSFX; public AudioClip CrushSFX; public AudioClip BellyPatSFX; private float timeWalkingOrStandingStill; private float timeSinceKillingSomeone; public bool isStandingAnim; public override void Start() { base.Start(); ((EnemyAI)this).currentBehaviourStateIndex = 0; ((Renderer)overridePhysicsParentAnimationMesh2.GetComponent()).enabled = false; } private bool isWalking() { return !isStandingAnim; } private bool isStanding() { return isStandingAnim; } public override void Update() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) base.Update(); timeSinceNewRandPos += Time.deltaTime; if (timeSinceKillingSomeone < 15f) { timeSinceKillingSomeone += Time.deltaTime; } int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if (currentBehaviourStateIndex != 0) { _ = currentBehaviourStateIndex - 4; _ = 1; } if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && (((EnemyAI)this).currentBehaviourStateIndex == 4 || ((EnemyAI)this).currentBehaviourStateIndex == 5)) { turnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer != (Object)null && ((EnemyAI)this).currentBehaviourStateIndex == 9) { ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.position = overridePhysicsParentAnimationMesh2.transform.position; Transform transform = ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform; transform.position -= ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.up * 2.5f; } if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer != (Object)null && ((EnemyAI)this).currentBehaviourStateIndex == 8) { ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.position = overridePhysicsParentAnimationMesh2.transform.position; Transform transform2 = ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform; transform2.position -= ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.up * 2.5f; ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.rotation = overridePhysicsParentAnimationMesh2.transform.rotation; ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.Rotate(0f, 0f, 180f); } } public override void DoAIInterval() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) base.DoAIInterval(); if (((EnemyAI)this).isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } Vector3 velocity; switch (((EnemyAI)this).currentBehaviourStateIndex) { case 14: if (!Object.op_Implicit((Object)(object)((EnemyAI)this).stunnedByPlayer)) { ((MonoBehaviour)this).StartCoroutine(doStartWandering()); } break; case 13: { Animator creatureAnimator2 = ((EnemyAI)this).creatureAnimator; velocity = ((EnemyAI)this).agent.velocity; creatureAnimator2.SetFloat("RunSpeedMultiplier", ((((Vector3)(ref velocity)).magnitude < 0.3f) ? 0.3f : ((EnemyAI)this).agent.speed) / ((EnemyAI)this).agent.speed); if (FoundClosestPlayerInRange(detectionRange, detectionRange)) { ((MonoBehaviour)this).StartCoroutine(doSpotPlayer()); break; } if (isStandingAnim && ((EnemyAI)this).agent.speed > 0f) { DoAnimationClientRpc("Walk"); isStandingAnim = false; timeWalkingOrStandingStill = 0f; } if (!isStandingAnim && ((EnemyAI)this).agent.speed < 1f) { DoAnimationClientRpc("Stand"); isStandingAnim = true; timeWalkingOrStandingStill = 0f; } if (isStanding() && timeWalkingOrStandingStill > 2f) { ((EnemyAI)this).agent.speed = wanderSpeed; timeWalkingOrStandingStill = 0f; } else if (isWalking() && timeWalkingOrStandingStill > 8f) { ((EnemyAI)this).agent.speed = 0f; timeWalkingOrStandingStill = 0f; } break; } case 5: { Animator creatureAnimator = ((EnemyAI)this).creatureAnimator; velocity = ((EnemyAI)this).agent.velocity; creatureAnimator.SetFloat("RunSpeedMultiplier", ((((Vector3)(ref velocity)).magnitude < 0.3f) ? 0.3f : ((EnemyAI)this).agent.speed) / ((EnemyAI)this).agent.speed); if (((EnemyAI)this).agent.speed < runSpeed) { NavMeshAgent agent = ((EnemyAI)this).agent; agent.speed += 0.1f; } if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) > detectionRange && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null))) { ((MonoBehaviour)this).StartCoroutine(doStartWandering()); break; } if (TargetClosestPlayerInAnyCase() && Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) < 15f) { ((EnemyAI)this).targetPlayer.JumpToFearLevel(0.4f, true); } ((EnemyAI)this).SetDestinationToPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, false); break; } } } public override void CollidedWithPlayer(Collider collider, PlayerControllerB playerControllerB) { VehicleController val = Object.FindObjectOfType(); if ((!((Object)(object)val != (Object)null) || !((Object)(object)playerControllerB.physicsParent != (Object)null) || !((Object)(object)playerControllerB.physicsParent == (Object)(object)((Component)val).transform) || val.backDoorOpen) && (Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null && !playerControllerB.isInHangarShipRoom && timeSinceKillingSomeone > 10f) { int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if ((uint)currentBehaviourStateIndex <= 3u || currentBehaviourStateIndex == 5 || currentBehaviourStateIndex == 13) { toggleCollider = collider; ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).targetPlayer = null; doKillPlayerServerRpc((int)playerControllerB.playerClientId); } } } public IEnumerator doChasePlayer() { ((EnemyAI)this).SwitchToBehaviourClientRpc(5); ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); DoAnimationClientRpc("ChasePlayer"); yield return (object)new WaitForSeconds(1f); ((EnemyAI)this).agent.speed = wanderSpeed; yield return null; } [ClientRpc] public void doKillPlayerClientRpc() { PlayerControllerB inSpecialAnimationWithPlayer = ((EnemyAI)this).inSpecialAnimationWithPlayer; if (!inSpecialAnimationWithPlayer.isInHangarShipRoom && !inSpecialAnimationWithPlayer.isPlayerDead) { if (randomInt(1, 2) == 1) { DoAnimationClientRpc("StompPlayer"); ((EnemyAI)this).SwitchToBehaviourClientRpc(8); } else { DoAnimationClientRpc("EatPlayer"); ((EnemyAI)this).SwitchToBehaviourClientRpc(9); } enableSkinnedMeshRenderers(); AttachPlayerToKillAnimation(inSpecialAnimationWithPlayer); } else { ((EnemyAI)this).inSpecialAnimationWithPlayer = null; } } [ServerRpc(RequireOwnership = false)] public void doKillPlayerServerRpc(int playerId) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { Vector3 position = ((Component)this).transform.position; int enemyYRot = (int)((Component)this).transform.eulerAngles.y; doKillPlayer2ClientRpc(playerId, position, enemyYRot); } } [ClientRpc] public void doKillPlayer2ClientRpc(int playerId, Vector3 enemyPosition, int enemyYRot) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { doKillPlayer(StartOfRound.Instance.allPlayerScripts[playerId], enemyPosition, enemyYRot); } } public void doKillPlayer(PlayerControllerB playerControllerB, Vector3 enemyPosition, int enemyYRot) { ((EnemyAI)this).inSpecialAnimationWithPlayer = playerControllerB; if (!playerControllerB.isInHangarShipRoom && !playerControllerB.isPlayerDead) { ((EnemyAI)this).agent.speed = 0f; if (randomInt(1, 2) == 1) { DoAnimationClientRpc("StompPlayer"); ((EnemyAI)this).SwitchToBehaviourClientRpc(8); } else { DoAnimationClientRpc("EatPlayer"); ((EnemyAI)this).SwitchToBehaviourClientRpc(9); } enableSkinnedMeshRenderers(); AttachPlayerToKillAnimation(playerControllerB); } else { ((EnemyAI)this).inSpecialAnimationWithPlayer = null; } } [ClientRpc] public void stopKillPlayerClientRpc() { if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer != (Object)null) { ReleasePlayerFromKillAnimation(); } } public IEnumerator doSpotPlayer() { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(4); yield return (object)new WaitForSeconds(1f); DoAnimationClientRpc("SeePlayer"); yield return null; } public IEnumerator doStartWandering() { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); isStandingAnim = ((EnemyAI)this).agent.speed == 0f; if (isStandingAnim) { DoAnimationClientRpc("Stand"); } else { DoAnimationClientRpc("Walk"); } ((EnemyAI)this).SwitchToBehaviourClientRpc(13); yield return (object)new WaitForSeconds(1f); yield return null; } public IEnumerator doStunned() { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(14); DoAnimationClientRpc("Stunned"); yield return (object)new WaitForSeconds(1f); yield return null; } public IEnumerator enableColliderIn3Seconds() { yield return (object)new WaitForSeconds(3f); toggleCollider.enabled = true; yield return null; } public void spotPlayerAnimationFinished() { ((MonoBehaviour)this).StartCoroutine(doChasePlayer()); } public void spawnAnimationFinished() { ((EnemyAI)this).SwitchToBehaviourClientRpc(1); DoAnimationClientRpc("Roar"); } public void roarAnimationFinished() { ((MonoBehaviour)this).StartCoroutine(doStartWandering()); } public void playerKillAnimationFinished() { ReleasePlayerFromKillAnimation(); ((MonoBehaviour)this).StartCoroutine(doStartWandering()); ((MonoBehaviour)this).StartCoroutine(enableColliderIn3Seconds()); disableSkinnedMeshRenderers(); } public void executePlayer() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) timeSinceKillingSomeone = 0f; ((EnemyAI)this).inSpecialAnimationWithPlayer.DamagePlayer(1000, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); ((EnemyAI)this).inSpecialAnimationWithPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)8, 0, default(Vector3)); if (!((EnemyAI)this).inSpecialAnimationWithPlayer.isPlayerDead) { ReleasePlayerFromKillAnimation(); } } public void spawnSlam() { playSfxRandomizedPitch(FootstepSFX); thumpPlayers(50, 1f); } public void playRoarAudio() { playVoiceRandomizedPitch(RoarSFX); } public void playGulpAudio() { playVoiceRandomizedPitch(GulpSFX); } public void playCrushAudio() { playVoiceRandomizedPitch(CrushSFX); } public void playBellyPatAudio() { playVoiceRandomizedPitch(BellyPatSFX); } public void footStep() { playSfxRandomizedPitch(FootstepSFX); thumpPlayers(30, 0.2f); } public override void OnDeath() { stopKillPlayerClientRpc(); ((EnemyAI)this).SwitchToBehaviourClientRpc(12); ((MonoBehaviour)this).StopCoroutine(((EnemyAI)this).searchCoroutine); ((EnemyAI)this).KillEnemyOnOwnerClient(false); } public override void OnSmack() { } public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 1f, PlayerControllerB setStunnedByPlayer = null) { ((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer); stopKillPlayerClientRpc(); ((MonoBehaviour)this).StartCoroutine(doStunned()); } } public class MarieAI : BoogieEnemy { private enum State { Spawning, Wandering, FollowingPlayer, Transforming, AttackingPlayer, Dying, Dead } public GameObject plushMesh; public Transform plushLookTarget; private new float wanderSpeed = 0.2f; private new float runSpeed = 10f; public bool isPlush; public bool isStandingAnim; private float wanderSpeed_Marie = 1f; private float wanderSpeed_Plush = 5f; private float detectionRadius_Marie = 3f; private float detectionRadius_Plush = 25f; protected float timeStandingStillNextToPlayer; protected float timePlayerHadTheirBackTurned; public Transform StopWalkingArea; public float timeSinceStabbinSomeone; public Material mariePlushMaterial; public Texture mariePlushTexture; public Texture mariePlushTextureBloody; public Material mariePlushMaterial_knife; public Texture mariePlushTexture_knife; public Texture mariePlushTextureBloody_knife; public override void Start() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) base.Start(); ((Component)this).transform.localScale = new Vector3(1.5f, 1.5f, 1.5f); ((EnemyAI)this).currentBehaviourStateIndex = 0; timeStandingStillNextToPlayer = 0f; timePlayerHadTheirBackTurned = 0f; } public override void Update() { //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) base.Update(); timeSinceNewRandPos += Time.deltaTime; int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if (currentBehaviourStateIndex == 2) { timeStandingStillNextToPlayer += Time.deltaTime; timePlayerHadTheirBackTurned += Time.deltaTime; if (!isPlush) { if (IsTargetVisible(GameNetworkManager.Instance.localPlayerController.gameplayCamera, ((Component)this).gameObject)) { timePlayerHadTheirBackTurned = 0f; } if (((EnemyAI)this).agent.speed > 0f) { timeStandingStillNextToPlayer = 0f; } } else if (timeSinceStabbinSomeone > 10f && Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) < 4f && (IsTargetVisible(GameNetworkManager.Instance.localPlayerController.gameplayCamera, overridePhysicsParentAnimationMesh) || IsTransformVisible(GameNetworkManager.Instance.localPlayerController.gameplayCamera, plushLookTarget))) { doKillPlayerServerRpc((int)((EnemyAI)this).targetPlayer.playerClientId); } } timeSinceStabbinSomeone += Time.deltaTime; if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && (((EnemyAI)this).currentBehaviourStateIndex == 2 || ((EnemyAI)this).currentBehaviourStateIndex == 4)) { turnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } } public override void DoAIInterval() { //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) base.DoAIInterval(); if (((EnemyAI)this).isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } if (!isPlush && (timeStandingStillNextToPlayer > 10f || timePlayerHadTheirBackTurned > 5f) && ((EnemyAI)this).currentBehaviourStateIndex == 2) { transformIntoPlushClientRpc(); } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 1: if (randomInt(0, 20) == 1) { if (isPlush) { playRandomVoicefromArray(RandomSpecialWanderVoicelineSFX); } else { playRandomVoicefromArray(RandomVoicelineSFX); } } ((EnemyAI)this).agent.speed = (isPlush ? wanderSpeed_Plush : wanderSpeed_Marie); if (FoundClosestPlayerInRange(isPlush ? detectionRadius_Plush : detectionRadius_Marie, 3f)) { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } if (!isPlush) { if (isStandingAnim && ((EnemyAI)this).agent.speed > 0f) { ((EnemyAI)this).creatureAnimator.SetFloat("AnimationSpeed", 3f); DoAnimationClientRpc("Walk"); isStandingAnim = false; } if (!isStandingAnim && ((EnemyAI)this).agent.speed < 0.2f) { DoAnimationClientRpc("Stand"); isStandingAnim = true; } } break; case 2: if (randomInt(0, 20) == 1) { if (isPlush) { playRandomVoicefromArray(RandomSpecialWanderVoicelineSFX); } else { playRandomVoicefromArray(RandomVoicelineSFX); } } if (!((EnemyAI)this).targetPlayer.isInsideFactory || (!isPlush && Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) > 30f)) { ((EnemyAI)this).SwitchToBehaviourClientRpc(1); ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } if (Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) > (float)(isPlush ? 3 : 4)) { timeStandingStillNextToPlayer = 0f; ((EnemyAI)this).agent.speed = (isPlush ? wanderSpeed_Plush : wanderSpeed_Marie); ((EnemyAI)this).SetDestinationToPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, false); } else { ((EnemyAI)this).agent.speed = 0f; } if (isPlush) { fearAllPlayersInRadius(5f, 1f); } break; case 3: ((EnemyAI)this).agent.speed = 0f; break; } if (isPlush) { return; } int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if ((uint)(currentBehaviourStateIndex - 1) <= 1u) { if (isStandingAnim && ((EnemyAI)this).agent.speed > 0f) { DoAnimationClientRpc("Walk"); isStandingAnim = false; } if (!isStandingAnim && ((EnemyAI)this).agent.speed < 1f) { DoAnimationClientRpc("Stand"); isStandingAnim = true; } } } public override void CollidedWithPlayer(Collider collider, PlayerControllerB playerControllerB) { if (isPlush && timeSinceStabbinSomeone > 10f) { int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if ((uint)(currentBehaviourStateIndex - 1) <= 1u) { DoAnimationClientRpc("Attack"); } } } public void transformAnimationFinished() { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } public void spawnAnimationFinished() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).SwitchToBehaviourClientRpc(1); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } public void killAnimationFinished() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); ((EnemyAI)this).agent.speed = runSpeed; mariePlushMaterial.mainTexture = mariePlushTextureBloody; mariePlushMaterial_knife.mainTexture = mariePlushTextureBloody_knife; if (!((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null)) { ((EnemyAI)this).inSpecialAnimationWithPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)14, 0, default(Vector3)); ((EnemyAI)this).inSpecialAnimationWithPlayer.inSpecialInteractAnimation = false; ((EnemyAI)this).inSpecialAnimationWithPlayer.inAnimationWithEnemy = null; ((EnemyAI)this).inSpecialAnimationWithPlayer.clampLooking = false; ((EnemyAI)this).inSpecialAnimationWithPlayer = null; } } public void knifeSwung() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).targetPlayer.DamagePlayer(30, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } [ClientRpc] public void transformIntoPlushClientRpc() { DoAnimationClientRpc("TransformIntoPlush"); ((EnemyAI)this).SwitchToBehaviourClientRpc(3); ((EnemyAI)this).agent.speed = 0f; isPlush = true; toggleSkinnedMeshRenderers(); if ((Object)(object)backgroundMusicSFXSource != (Object)null && !backgroundMusicSFXSource.isPlaying) { backgroundMusicSFXSource.Play(); } } [ServerRpc(RequireOwnership = false)] public void doKillPlayerServerRpc(int playerId) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { Vector3 position = ((Component)this).transform.position; int enemyYRot = (int)((Component)this).transform.eulerAngles.y; doKillPlayer2ClientRpc(playerId, position, enemyYRot); } } [ClientRpc] public void doKillPlayer2ClientRpc(int playerId, Vector3 enemyPosition, int enemyYRot) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { doKillPlayer(StartOfRound.Instance.allPlayerScripts[playerId], enemyPosition, enemyYRot); } } private void doKillPlayer(PlayerControllerB playerControllerB, Vector3 enemyPosition, int enemyYRot) { //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(4); ((EnemyAI)this).agent.speed = 0f; ((EnemyAI)this).inSpecialAnimationWithPlayer = playerControllerB; ((EnemyAI)this).inSpecialAnimationWithPlayer.inSpecialInteractAnimation = true; ((EnemyAI)this).inSpecialAnimationWithPlayer.inAnimationWithEnemy = (EnemyAI)(object)this; if (isPlush) { fearAllPlayersInRadius(1f, 1f, shakeCamera: true, ((EnemyAI)this).inSpecialAnimationWithPlayer); } ((EnemyAI)this).inSpecialAnimationWithPlayer.clampLooking = true; if ((Object)(object)playerControllerB == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((Component)this).transform.position = ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer.gameplayCamera).transform.position; Transform transform = ((Component)this).transform; transform.position -= ((Component)this).transform.forward * 1.4f; ((EnemyAI)this).SetDestinationToPosition(((Component)((EnemyAI)this).inSpecialAnimationWithPlayer.gameplayCamera).transform.position - ((Component)this).transform.forward * 1.4f, false); ((EnemyAI)this).inSpecialAnimationWithPlayer.turnCompass.LookAt(((Component)this).transform.position); ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.rotation = Quaternion.Lerp(((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.rotation, Quaternion.Euler(new Vector3(0f, ((EnemyAI)this).inSpecialAnimationWithPlayer.turnCompass.eulerAngles.y, 0f)), 1f * Time.deltaTime); } else { ((Component)this).transform.position = playerControllerB.upperSpine.position; Transform transform2 = ((Component)this).transform; transform2.position -= ((Component)this).transform.forward * 0.85f; ((EnemyAI)this).inSpecialAnimationWithPlayer.turnCompass.LookAt(((Component)this).transform.position); ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.rotation = Quaternion.Lerp(((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.rotation, Quaternion.Euler(new Vector3(0f, ((EnemyAI)this).inSpecialAnimationWithPlayer.turnCompass.eulerAngles.y, 0f)), 1f * Time.deltaTime); } if ((Object)(object)KillSceneBeginSFX != (Object)null) { ((EnemyAI)this).creatureVoice.pitch = originalVoicePitch; ((EnemyAI)this).creatureVoice.PlayOneShot(KillSceneBeginSFX); } DoAnimationClientRpc("Attack"); timeSinceStabbinSomeone = 0f; } public override void OnDeath() { ((MonoBehaviour)this).StopCoroutine(((EnemyAI)this).searchCoroutine); ((EnemyAI)this).KillEnemyOnOwnerClient(false); ((EnemyAI)this).SwitchToBehaviourClientRpc(6); DoAnimationClientRpc("Die"); } public override void OnSmack() { } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (((EnemyAI)this).currentBehaviourStateIndex != 0) { if (!isPlush && ((EnemyAI)this).currentBehaviourStateIndex != 3) { transformIntoPlushClientRpc(); } else { base.HitEnemy(isPlush ? force : 0, playerWhoHit, playHitSFX, hitID); } } } } internal class MidnaAI : BoogieEnemy { private enum State { Spawning, WaitingForPlayer, SpottedPlayer, Roaring, RunningAroundBeforeAttack, FollowingPlayer, JumpingAtPlayer, SittingOnPlayer, SmotheringPlayer, GettingOffPlayerAfterKill, Reset, Dying, Dead } private bool playerAttached; private int vectTest; private float leapSpeed = 25f; private new float runSpeed = 15f; private Quaternion quatBeforeTakingControl; public float timeLookingAtMidna; public float timeBeingCloseToMidna; public float timeSinceSittingOnSomeone; public float timeRunningAround; public AudioClip[] LeapSFX; public AudioClip[] MissedLeapSFX; public override void Start() { base.Start(); detectionRange = 30f; wanderSpeed = 30f; ((EnemyAI)this).currentBehaviourStateIndex = 1; } public override void Update() { //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) base.Update(); timeSinceNewRandPos += Time.deltaTime; timeSinceAttacking += Time.deltaTime; switch (((EnemyAI)this).currentBehaviourStateIndex) { case 4: timeRunningAround += Time.deltaTime; break; case 1: if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null) { if (Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) < 5f) { timeBeingCloseToMidna += Time.deltaTime; } else { timeBeingCloseToMidna = 0f; } if (IsTargetLineOfSight(((EnemyAI)this).targetPlayer)) { timeLookingAtMidna += Time.deltaTime; break; } turnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 1f * Time.deltaTime); timeLookingAtMidna = 0f; } break; case 2: case 5: turnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 1f * Time.deltaTime); break; } int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if ((uint)(currentBehaviourStateIndex - 4) <= 2u) { timeSinceSittingOnSomeone += Time.deltaTime; } if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer != (Object)null && ((EnemyAI)this).currentBehaviourStateIndex == 8) { ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.position = overridePhysicsParentAnimationMesh2.transform.position; Transform transform = ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform; transform.position -= ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.up * 2.5f; ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.rotation = overridePhysicsParentAnimationMesh2.transform.rotation; ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.Rotate(0f, 0f, 180f); Transform transform2 = ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform; transform2.position += ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer).transform.forward * 0.25f; } } public override void DoAIInterval() { //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) base.DoAIInterval(); _ = playerAttached; if (((EnemyAI)this).isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } Vector3 velocity; switch (((EnemyAI)this).currentBehaviourStateIndex) { case 1: if (!FoundClosestPlayerInRange(detectionRange, detectionRange)) { break; } if (IsTargetLineOfSight(((EnemyAI)this).targetPlayer)) { if (timeLookingAtMidna > 1f || timeBeingCloseToMidna > 2f) { ((MonoBehaviour)this).StartCoroutine(doSpotPlayer()); } } else if (randomInt(0, 10) == 1) { playRandomVoicefromArray(RandomSpecialWanderVoicelineSFX); } break; case 4: { Animator creatureAnimator2 = ((EnemyAI)this).creatureAnimator; velocity = ((EnemyAI)this).agent.velocity; creatureAnimator2.SetFloat("RunSpeedMultiplier", ((((Vector3)(ref velocity)).magnitude < 0.3f) ? 0.3f : ((EnemyAI)this).agent.speed) / ((EnemyAI)this).agent.speed); if (randomInt(0, 10) == 1) { playRandomVoicefromArray(RandomVoicelineSFX); } if (timeRunningAround > 10f && (Object)(object)((EnemyAI)this).targetPlayer != (Object)null) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(5); } break; } case 5: { Animator creatureAnimator = ((EnemyAI)this).creatureAnimator; velocity = ((EnemyAI)this).agent.velocity; creatureAnimator.SetFloat("RunSpeedMultiplier", ((((Vector3)(ref velocity)).magnitude < 0.3f) ? 0.3f : ((EnemyAI)this).agent.speed) / ((EnemyAI)this).agent.speed); if (Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) < 40f && ((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 70f, (int)detectionRange, -1f, (Transform)null) && IsTargetLineOfSight(((EnemyAI)this).targetPlayer)) { doLeapAtCurrentTargetServerRpc((int)((EnemyAI)this).targetPlayer.playerClientId); } else { if (randomInt(0, 10) == 1) { playRandomVoiceSFX(); } ((EnemyAI)this).SetDestinationToPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, false); } if ((Object)(object)((EnemyAI)this).targetPlayer == (Object)null) { ((MonoBehaviour)this).StartCoroutine(doRunAround()); } break; } case 2: case 3: case 6: break; } } public override void CollidedWithPlayer(Collider collider, PlayerControllerB playerControllerB) { if (!(timeSinceSittingOnSomeone < 10f)) { int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if (!playerControllerB.inSpecialInteractAnimation && (Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { doKillPlayerServerRpc((int)playerControllerB.playerClientId); } } } public void releaseCurrentlyKillingPlayer() { if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer != (Object)null && (Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer.currentVoiceChatAudioSource != (Object)null && ((EnemyAI)this).inSpecialAnimationWithPlayer.voiceMuffledByEnemy) { ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer.currentVoiceChatAudioSource).GetComponent().lowpassResonanceQ = 1f; OccludeAudio component = ((Component)((EnemyAI)this).inSpecialAnimationWithPlayer.currentVoiceChatAudioSource).GetComponent(); component.overridingLowPass = false; component.lowPassOverride = 20000f; ((EnemyAI)this).inSpecialAnimationWithPlayer.voiceMuffledByEnemy = false; } ReleasePlayerFromKillAnimation(); timeSinceSittingOnSomeone = 0f; } public IEnumerator doKillPlayer(PlayerControllerB playerControllerB) { ((EnemyAI)this).agent.speed = 0f; DoAnimationClientRpc("SmotherPlayer"); ((EnemyAI)this).SwitchToBehaviourClientRpc(8); enableSkinnedMeshRenderers(); AttachPlayerToKillAnimation(playerControllerB); int count = 0; fearAllPlayersInRadius(10f, 0.7f, shakeCamera: true, ((EnemyAI)this).targetPlayer); while ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer != (Object)null && !((EnemyAI)this).inSpecialAnimationWithPlayer.isPlayerDead && !((EnemyAI)this).isEnemyDead && !((EnemyAI)this).inSpecialAnimationWithPlayer.isInHangarShipRoom && count < 3) { yield return (object)new WaitForSeconds(1.5f); playerControllerB.DamagePlayer(10, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); count++; } releaseCurrentlyKillingPlayer(); ((MonoBehaviour)this).StartCoroutine(doRunAround()); yield return null; } [ServerRpc(RequireOwnership = false)] public void doKillPlayerServerRpc(int playerId) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { Vector3 position = ((Component)this).transform.position; int enemyYRot = (int)((Component)this).transform.eulerAngles.y; doKillPlayer2ClientRpc(playerId, position, enemyYRot); } } [ClientRpc] public void doKillPlayer2ClientRpc(int playerId, Vector3 enemyPosition, int enemyYRot) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { doKillPlayer(StartOfRound.Instance.allPlayerScripts[playerId], enemyPosition, enemyYRot); } } public void doKillPlayer(PlayerControllerB playerControllerB, Vector3 enemyPosition, int enemyYRot) { ((EnemyAI)this).inSpecialAnimationWithPlayer = playerControllerB; if (!playerControllerB.isInHangarShipRoom && !playerControllerB.isPlayerDead) { if ((Object)(object)playerControllerB.currentVoiceChatAudioSource != (Object)null) { ((Component)playerControllerB.currentVoiceChatAudioSource).GetComponent().lowpassResonanceQ = 5f; OccludeAudio component = ((Component)playerControllerB.currentVoiceChatAudioSource).GetComponent(); component.overridingLowPass = true; component.lowPassOverride = 500f; playerControllerB.voiceMuffledByEnemy = true; } ((MonoBehaviour)this).StartCoroutine(doKillPlayer(playerControllerB)); } else { ((EnemyAI)this).inSpecialAnimationWithPlayer = null; } } [ServerRpc(RequireOwnership = false)] public void doLeapAtCurrentTargetServerRpc(int playerId) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { Vector3 position = ((Component)this).transform.position; int enemyYRot = (int)((Component)this).transform.eulerAngles.y; doLeapAtCurrentTargetClientRpc(playerId, position, enemyYRot); } } [ClientRpc] public void doLeapAtCurrentTargetClientRpc(int playerId, Vector3 enemyPosition, int enemyYRot) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { doLeapAtCurrentTarget(StartOfRound.Instance.allPlayerScripts[playerId], enemyPosition, enemyYRot); } } public void doLeapAtCurrentTarget(PlayerControllerB playerControllerB, Vector3 enemyPosition, int enemyYRot) { ((MonoBehaviour)this).StartCoroutine(doLeapAtCurrentTargetC()); } public IEnumerator doLeapAtCurrentTargetC() { if (!((EnemyAI)this).creatureVoice.isPlaying) { playRandomSfxfromArray(LeapSFX); } ((EnemyAI)this).SwitchToBehaviourClientRpc(6); DoAnimationClientRpc("Leap"); ((EnemyAI)this).agent.speed = leapSpeed; float timeLeaping = 0f; while (((EnemyAI)this).agent.speed > 0f && timeLeaping < 0.5f && ((EnemyAI)this).destination != ((Component)this).transform.position) { timeLeaping += 0.1f; yield return (object)new WaitForSeconds(0.1f); } if (!((EnemyAI)this).isEnemyDead && (Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { ((EnemyAI)this).agent.speed = 0f; DoAnimationClientRpc("Pout"); if (!((EnemyAI)this).creatureVoice.isPlaying) { playRandomSfxfromArray(MissedLeapSFX); } yield return (object)new WaitForSeconds(0.667f); yield return (object)new WaitForSeconds(0.8f); ((MonoBehaviour)this).StartCoroutine(doRunAround()); } yield return null; } public IEnumerator doSpotPlayer() { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).agent.speed = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(2); yield return (object)new WaitForSeconds(2f); if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { DoAnimationClientRpc("SeePlayer"); } yield return (object)new WaitForSeconds(3.283f); fearAllPlayersInRadius(detectionRange, 1f, shakeCamera: true, ((EnemyAI)this).targetPlayer); yield return (object)new WaitForSeconds(2.267f); if ((Object)(object)((EnemyAI)this).inSpecialAnimationWithPlayer == (Object)null) { ((MonoBehaviour)this).StartCoroutine(doRunAround()); } timeSinceSittingOnSomeone = 5f; yield return null; } public IEnumerator doRunAround() { timeSinceSittingOnSomeone = 0f; DoAnimationClientRpc("Run"); ((EnemyAI)this).agent.speed = runSpeed; ((EnemyAI)this).agent.angularSpeed = 900f; ((EnemyAI)this).agent.acceleration = 200f; ((EnemyAI)this).SwitchToBehaviourClientRpc(4); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); timeRunningAround = 0f; yield return null; } public void playRoarAudio() { playVoiceRandomizedPitch(RoarSFX); } public void footStep() { playSfxRandomizedPitch(FootstepSFX); } public override void OnDeath() { ((EnemyAI)this).KillEnemyOnOwnerClient(false); ((EnemyAI)this).SwitchToBehaviourClientRpc(12); DoAnimationClientRpc("Die"); } public override void OnSmack() { } } internal class TRexAI { } }