using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using DesaEnemies; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using UnityEngine; using UnityEngine.AI; using UnityEngine.Serialization; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("Desay1")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+a66823b48d3b9acf41c19244c83a3d5476f1f194")] [assembly: AssemblyProduct("DesaEnemies")] [assembly: AssemblyTitle("DesaEnemies")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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; } } } [HarmonyPatch(typeof(MapToolController))] public class MapToolControllerPatch { [HarmonyPatch("Update")] [HarmonyPrefix] private static bool UpdatePrefix(MapToolController __instance) { if (__instance.PlayerAvatar.GetMapDebuffTimer().minimapDebuffTimer > 0f) { if (__instance.Active) { __instance.Active = false; __instance.HideLerp = 1f; ((Component)__instance.VisualTransform).gameObject.SetActive(false); __instance.ToggleLocalShadows(false); Map.Instance.ActiveSet(false); } __instance.PlayerAvatar.GetMapDebuffTimer().minimapDebuffTimer -= Time.deltaTime; if (SemiFunc.InputDown((InputKey)8)) { CameraGlitch.Instance.PlayTiny(); } return false; } return true; } } public class Mareo : MonoBehaviour { public enum State { Spawn, Idle, Despawn, Roam, Investigate, Stun, Leave, Notice, Attack, Attached, Puke, Detach, IdlePuke, GoToPlayerOver, GoToPlayerUnder, MoveBackToNavmesh, GoToPlayer, Dead } public GameObject enemySlowMouthAttack; public GameObject localCameraMouthPrefab; public GameObject enemySlowMouthOnPlayerTop; public GameObject enemySlowMouthOnPlayerBot; public Transform particles; public Transform tentacles; private List springTentacles = new List(); private List spawnParticles = new List(); private bool movingRight; private bool movingLeft = true; private float moveThisDirectionTimer; private float looseTargetTimer; private float looseTargetTime; private float randomNudgeTimer; [FormerlySerializedAs("state")] public State currentState; private Vector3 agentDestination; public SemiPuke semiPuke; private EnemyVision enemyVision; public Transform mouthTransform; public Collider enemyCollider; public Transform enemyVisuals; private bool stateImpulse; private bool stateStartFixed; private float stateTimer; private PhotonView photonView; private PlayerAvatar attachTarget; private Enemy enemy; public EnemyRigidbody enemyRigidbody; public PhysGrabObject physGrabObject; public Transform followTarget; public Vector3 followTargetStartPosition; public Transform centerTransform; public AudioSource audioSourceVO; private float idleBreakerVOCooldown = 20f; private float idlePukeCooldown = 20f; private State idlePukePreviousState; public EnemySlowMouthAnim enemySlowMouthAnim; private Vector3 followPointPositionPrev; private Transform currentTarget; private SpringFloat spawnDespawnScaleSpring; private Vector3 targetDestination; private bool waitForTargettingLoop; private float visionTimer; private bool visionPrevious; private PlayerAvatar playerTarget; private float enemyHiddenTimer; private Vector3 moveBackPosition; private float targetForwardOffset = 1.5f; private Vector3 targetPosition; private float targetedPlayerTime; private float targetedPlayerTimeMax = 10f; private float moveBackTimer; private Vector3 enemyGroundPosition; internal Vector3 detachPosition; internal Quaternion detachRotation; private float attachedTimer; private float possessCooldown; private float stuckTimer; private Vector3 stuckPosition; private float aggroTimer; public Sound soundSpawnVO; public Sound soundIdleBreakerVO; public Sound soundHurtVO; public Sound soundDieVO; public Sound soundNoticeVO; public Sound soundChaseLoopVO; public Sound soundDetachVO; public Sound soundDetach; public Sound soundStunLoopVO; private void Start() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) spawnDespawnScaleSpring = new SpringFloat(); spawnDespawnScaleSpring.damping = 0.5f; spawnDespawnScaleSpring.speed = 20f; photonView = ((Component)this).GetComponent(); enemy = ((Component)this).GetComponent(); followTargetStartPosition = followTarget.localPosition; enemyVision = ((Component)this).GetComponent(); spawnParticles = new List(((Component)particles).GetComponentsInChildren()); springTentacles = new List(((Component)tentacles).GetComponentsInChildren()); } private void AnimStateIdle() { enemySlowMouthAnim.UpdateState((State)0); } private void AnimStatePuke() { enemySlowMouthAnim.UpdateState((State)1); } private void AnimStateStunned() { enemySlowMouthAnim.UpdateState((State)2); } private void AnimStateTargetting() { enemySlowMouthAnim.UpdateState((State)3); } private void AnimStateAttached() { enemySlowMouthAnim.UpdateState((State)4); } private void AnimStateAggro() { enemySlowMouthAnim.UpdateState((State)5); } private void AnimStateSpawnDespawn() { enemySlowMouthAnim.UpdateState((State)6); } private void AnimStateDeath() { enemySlowMouthAnim.UpdateState((State)7); } private void AnimStateLeave() { enemySlowMouthAnim.UpdateState((State)8); } private void PlaySpawnParticles() { foreach (ParticleSystem spawnParticle in spawnParticles) { spawnParticle.Play(); } } private void StateSpawn(bool fixedUpdate) { //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) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { enemyVisuals.localScale = Vector3.zero; stateTimer = 3f; stateImpulse = false; PlaySpawnParticles(); } float num = SemiFunc.SpringFloatGet(spawnDespawnScaleSpring, 1f, -1f); enemyVisuals.localScale = Vector3.one * num; AnimStateSpawnDespawn(); if (stateTimer <= 0f) { enemyVisuals.localScale = Vector3.one; UpdateState(State.Idle); } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateIdle(bool fixedUpdate) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { stateImpulse = false; enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); stateTimer = Random.Range(5f, 10f); } AnimStateIdle(); if (SemiFunc.IsMasterClientOrSingleplayer() && !SemiFunc.EnemySpawnIdlePause() && !IdlePukeLogic(0.1f)) { IdleBreakerVOLogic(); LookAtVelocityDirection(_moving: false); FloatAround(); if (stateTimer <= 0f) { UpdateState(State.Roam); } } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateDespawn(bool fixedUpdate) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { stateImpulse = false; PlaySpawnParticles(); soundDetach.Play(mouthTransform, 1f, 1f, 1f, 1f); stateTimer = 1f; } float num = SemiFunc.SpringFloatGet(spawnDespawnScaleSpring, 0f, -1f); enemyVisuals.localScale = Vector3.one * num; AnimStateSpawnDespawn(); if (SemiFunc.IsMasterClientOrSingleplayer() && stateTimer <= 0f) { enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); enemy.EnemyParent.Despawn(); } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateRoam(bool fixedUpdate) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { stateImpulse = false; agentDestination = SemiFunc.EnemyRoamFindPoint(((Component)this).transform.position); stateTimer = Random.Range(5f, 10f); followTarget.localPosition = new Vector3(0f, 1f, 0f); } AnimStateIdle(); if (SemiFunc.IsMasterClientOrSingleplayer() && !IdlePukeLogic(0.1f)) { IdleBreakerVOLogic(); LookAtVelocityDirection(_moving: false); StuckLogic(); enemy.NavMeshAgent.SetDestination(agentDestination); if (Vector3.Distance(((Component)this).transform.position, enemy.NavMeshAgent.GetPoint()) < 1f || stateTimer <= 0f) { UpdateState(State.Idle); } } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateInvestigate(bool fixedUpdate) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00cf: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { stateImpulse = false; followTarget.localPosition = new Vector3(0f, 1f, 0f); enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); } AnimStateIdle(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } LookAtVelocityDirection(_moving: false); if (!IdlePukeLogic(0.2f)) { IdleBreakerVOLogic(); enemy.NavMeshAgent.SetDestination(agentDestination); if (Vector3.Distance(((Component)this).transform.position, enemy.NavMeshAgent.GetPoint()) < 1f) { UpdateState(State.Idle); } } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateStun(bool fixedUpdate) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); stateImpulse = false; } AnimStateStunned(); foreach (SpringTentacle springTentacle in springTentacles) { if (SemiFunc.PerSecond(5f, (Object)(object)this)) { springTentacle.springStart.springVelocity = Random.insideUnitSphere * 25f; springTentacle.springMid.springVelocity = Random.insideUnitSphere * 25f; springTentacle.springEnd.springVelocity = Random.insideUnitSphere * 25f; } } if (SemiFunc.IsMasterClientOrSingleplayer() && !enemy.IsStunned()) { UpdateState(State.Idle); } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateLeave(bool fixedUpdate) { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!fixedUpdate) { if (stateImpulse) { if (!SemiFunc.EnemyLeavePoint(enemy, ref agentDestination)) { return; } stateImpulse = false; followTarget.localPosition = new Vector3(0f, 1f, 0f); stateTimer = Random.Range(10f, 15f); PlaySpawnParticles(); SemiFunc.EnemyLeaveStart(enemy); } enemy.NavMeshAgent.SetDestination(agentDestination); AnimStateLeave(); if (SemiFunc.IsMasterClientOrSingleplayer()) { StuckLogic(); IdleBreakerVOLogic(); FastMoving(_lookAtTarget: false); enemyRigidbody.OverrideFollowPosition(0.1f, 5f, 10f); enemy.NavMeshAgent.OverrideAgent(8f, 8f, 0.1f); if (stateTimer <= 0f || Vector3.Distance(((Component)this).transform.position, enemy.NavMeshAgent.GetPoint()) < 1f) { UpdateState(State.Idle); } } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateNotice(bool fixedUpdate) { //IL_00a8: 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_00bd: 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) if (!fixedUpdate) { if (stateImpulse) { TargettingPlayerStart(); if (!audioSourceVO.isPlaying) { soundNoticeVO.Play(mouthTransform, 1f, 1f, 1f, 1f); } if (SemiFunc.IsMasterClientOrSingleplayer()) { UpdatePlayerTarget(enemyVision.onVisionTriggeredPlayer); } stateTimer = 1f; stateImpulse = false; } AnimStateIdle(); if (SemiFunc.IsMasterClientOrSingleplayer()) { followTarget.localRotation = Quaternion.LookRotation(currentTarget.position - centerTransform.position, Vector3.up); if (stateTimer <= 0f) { UpdateState(State.GoToPlayer); } } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateAttack(bool fixedUpdate) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { stateImpulse = false; MareoAttaching component = Object.Instantiate(enemySlowMouthAttack, centerTransform.position, centerTransform.rotation).GetComponent(); component.targetPlayerAvatar = playerTarget; component.mareo = this; attachedTimer = 0f; } AnimStateAttached(); OverrideHideEnemy(); LookAtVelocityDirection(_moving: false); } else if (stateStartFixed) { stateStartFixed = false; } } private void DetatchLogic() { if (SemiFunc.PerSecond(5f, (Object)(object)this)) { if (!Object.op_Implicit((Object)(object)playerTarget)) { UpdateState(State.Detach); } else if (playerTarget.isDisabled) { UpdateState(State.Detach); } } } private void StateAttached(bool fixedUpdate) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0182: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { stateImpulse = false; if (attachedTimer <= 0f) { attachedTimer = Random.Range(20f, 60f); } stateTimer = Random.Range(1f, 15f); } OverrideHideEnemy(); AnimStateAttached(); PlayerEffects(); enemy.EnemyParent.SpawnedTimerPause(1f); ((Component)enemy).transform.position = ((Component)this).transform.position; if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } DetatchLogic(); if (SemiFunc.PerSecond(5f, (Object)(object)this) && !Object.op_Implicit((Object)(object)((Component)playerTarget.playerAvatarVisuals).GetComponentInChildren())) { if (Object.op_Implicit((Object)(object)currentTarget)) { detachPosition = currentTarget.position; detachRotation = currentTarget.rotation; } UpdateState(State.Detach); } IsPossessedBySeveral(); attachedTimer -= Time.deltaTime; if (attachedTimer <= 0f || playerTarget.isDisabled) { if (Object.op_Implicit((Object)(object)currentTarget)) { detachPosition = currentTarget.position; detachRotation = currentTarget.rotation; UpdateState(State.Detach); } else { enemy.EnemyParent.SpawnedTimerSet(0f); UpdateState(State.Despawn); } } else if (stateTimer <= 0f) { UpdateState(State.Puke); } } else if (stateStartFixed) { stateStartFixed = false; } } private void StatePuke(bool fixedUpdate) { if (!fixedUpdate) { if (stateImpulse) { stateImpulse = false; stateTimer = Random.Range(0.5f, 3f); if (Random.Range(0, 30) == 0) { stateTimer = 6f; } } PlayerEffects(); OverrideHideEnemy(); AnimStateAttached(); DetatchLogic(); if (stateTimer <= 0f) { UpdateState(State.Attached); } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateDetach(bool fixedUpdate) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { stateImpulse = false; stateTimer = 0f; attachedTimer = 0f; possessCooldown = Random.Range(30f, 120f); ((Component)enemy).transform.position = ((Component)this).transform.position; } PlayerEffects(); OverrideHideEnemy(); AnimStateAttached(); if (!(stateTimer <= 0f)) { return; } if (!Object.op_Implicit((Object)(object)playerTarget)) { enemy.EnemyParent.SpawnedTimerSet(0f); UpdateState(State.Despawn); return; } Transform overrideTransform = playerTarget.localCamera.GetOverrideTransform(); Vector3 forward = overrideTransform.forward; Vector3 val = overrideTransform.position + forward * 0.3f; if (playerTarget.tumble.isTumbling) { val += Vector3.up; } float num = 0.2f; if (Physics.SphereCastAll(val, 0.45f, forward, num, LayerMask.GetMask(new string[1] { "Default" })).Length == 0) { Vector3 val2 = overrideTransform.position + forward * num; if (SemiFunc.IsMasterClientOrSingleplayer() && Object.op_Implicit((Object)(object)playerTarget) && Object.op_Implicit((Object)(object)playerTarget.tumble)) { playerTarget.tumble.TumbleRequest(true, false); } physGrabObject.Teleport(val2, overrideTransform.rotation); enemy.NavMeshAgent.Warp(val2, false); soundDetach.Play(val2, 1f, 1f, 1f, 1f); soundDetachVO.Play(val2, 1f, 1f, 1f, 1f); enemy.EnemyParent.SpawnedTimerSet(2f); UpdateState(State.Leave); } else if (playerTarget.isDisabled) { enemy.EnemyParent.SpawnedTimerSet(0f); UpdateState(State.Despawn); } else { stateTimer = 0.25f; } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateIdlePuke(bool fixedUpdate) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { stateImpulse = false; stateTimer = Random.Range(0.5f, 2f); if (Random.Range(0, 30) == 0) { stateTimer = 4f; } } AnimStatePuke(); semiPuke.PukeActive(mouthTransform.position, mouthTransform.rotation); if (stateTimer <= 0f) { UpdateState(idlePukePreviousState); } } else { if (stateStartFixed) { stateStartFixed = false; } if (SemiFunc.IsMasterClientOrSingleplayer()) { Vector3 val = Random.insideUnitSphere * 80f; enemyRigidbody.rb.AddTorque(val * Time.fixedDeltaTime, (ForceMode)0); Vector3 val2 = -mouthTransform.forward * 400f; enemyRigidbody.rb.AddForce(val2 * Time.fixedDeltaTime, (ForceMode)0); } } } private void StateGoToPlayerOver(bool fixedUpdate) { //IL_0048: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_015a: 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_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { stateTimer = 2f; stateImpulse = false; followTarget.localPosition = Vector3.zero; } followTarget.localPosition = currentTarget.localPosition; AnimStateTargetting(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } FastMoving(_lookAtTarget: true); TargettingPlayer(); if (IdlePukeLogic()) { return; } AttachToPlayer(); enemy.NavMeshAgent.Disable(0.1f); ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, targetPosition, enemy.NavMeshAgent.DefaultSpeed * 0.5f * Time.deltaTime); enemy.Vision.StandOverride(0.25f); if (playerTarget.PlayerVisionTarget.VisionTransform.position.y > ((Component)enemy.Rigidbody).transform.position.y + 1.5f) { ((Component)this).transform.position = ((Component)enemy.Rigidbody).transform.position; ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, targetPosition, 2f); } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(targetPosition, ref val, 0.5f, -1)) { UpdateState(State.MoveBackToNavmesh); } else if (VisionBlocked() || !Object.op_Implicit((Object)(object)playerTarget) || playerTarget.isDisabled) { if (stateTimer <= 0f || enemy.Rigidbody.notMovingTimer > 1f) { UpdateState(State.MoveBackToNavmesh); } } else { stateTimer = 2f; } if (SemiFunc.EnemyForceLeave(enemy)) { UpdateState(State.MoveBackToNavmesh); } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateGoToPlayerUnder(bool fixedUpdate) { //IL_0030: 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_00c2: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { stateTimer = 2f; stateImpulse = false; followTarget.localPosition = Vector3.zero; } AnimStateTargetting(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } FastMoving(_lookAtTarget: true); TargettingPlayer(); AttachToPlayer(); if (IdlePukeLogic()) { return; } followTarget.localPosition = new Vector3(0f, 0.2f, 0f); enemy.NavMeshAgent.Disable(0.1f); ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, targetPosition, enemy.NavMeshAgent.DefaultSpeed * Time.deltaTime); enemy.Vision.StandOverride(0.25f); NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(targetPosition, ref val, 0.5f, -1)) { UpdateState(State.MoveBackToNavmesh); } else if (VisionBlocked() || !Object.op_Implicit((Object)(object)playerTarget) || playerTarget.isDisabled) { if (stateTimer <= 0f) { UpdateState(State.MoveBackToNavmesh); } } else { stateTimer = 2f; } if (SemiFunc.EnemyForceLeave(enemy)) { UpdateState(State.MoveBackToNavmesh); } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateMoveBackToNavmesh(bool fixedUpdate) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_019e: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { stateImpulse = false; stateTimer = 30f; followTarget.localPosition = Vector3.zero; } AnimStateTargetting(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } FastMoving(_lookAtTarget: false); TargettingPlayer(); enemy.NavMeshAgent.OverrideAgent(8f, 8f, 0.1f); if (!IdlePukeLogic()) { enemy.NavMeshAgent.Disable(0.1f); ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, moveBackPosition, enemy.NavMeshAgent.DefaultSpeed * Time.deltaTime); enemy.Vision.StandOverride(0.25f); if (Vector3.Distance(((Component)this).transform.position, enemyGroundPosition) > 2f || enemy.Rigidbody.notMovingTimer > 2f) { Vector3 val = moveBackPosition - enemyGroundPosition; Vector3 normalized = ((Vector3)(ref val)).normalized; ((Component)this).transform.position = ((Component)enemy.Rigidbody).transform.position; Transform transform = ((Component)this).transform; transform.position += normalized * 2f; } NavMeshHit val2 = default(NavMeshHit); if (Vector3.Distance(enemyGroundPosition, moveBackPosition) <= 0f || NavMesh.SamplePosition(enemyGroundPosition, ref val2, 0.5f, -1)) { UpdateState(State.GoToPlayer); } else if (stateTimer <= 0f) { enemy.EnemyParent.SpawnedTimerSet(0f); } } } else if (stateStartFixed) { stateStartFixed = false; } } private void StateGoToPlayer(bool fixedUpdate) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) if (!fixedUpdate) { if (stateImpulse) { followTarget.localPosition = Vector3.zero; stateImpulse = false; stateTimer = 5f; targetedPlayerTime = 0f; targetedPlayerTimeMax = Random.Range(8f, 22f); } AnimStateTargetting(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } FastMoving(_lookAtTarget: true); TargettingPlayer(); enemy.NavMeshAgent.OverrideAgent(8f, 8f, 0.1f); if (IdlePukeLogic()) { return; } AttachToPlayer(); enemy.NavMeshAgent.SetDestination(targetPosition); MoveBackPosition(); enemy.Vision.StandOverride(0.25f); NavMeshHit val = default(NavMeshHit); if (!enemy.NavMeshAgent.CanReach(targetPosition, 1f) && Vector3.Distance(((Component)enemy.Rigidbody).transform.position, enemy.NavMeshAgent.GetPoint()) < 2f && !VisionBlocked() && !NavMesh.SamplePosition(targetPosition, ref val, 0.5f, -1)) { if (playerTarget.isCrawling && Mathf.Abs(targetPosition.y - ((Component)enemy.Rigidbody).transform.position.y) < 0.3f) { UpdateState(State.GoToPlayerUnder); return; } if (targetPosition.y > ((Component)enemy.Rigidbody).transform.position.y) { UpdateState(State.GoToPlayerOver); return; } } LeaveCheck(); } else if (stateStartFixed) { stateStartFixed = false; } } private void StateDead(bool fixedUpdate) { if (!fixedUpdate) { if (stateImpulse) { stateImpulse = false; } OverrideHideEnemy(); AnimStateDeath(); } else if (stateStartFixed) { stateStartFixed = false; } } private void StateMachine(bool fixedUpdate) { if (!fixedUpdate && stateTimer > 0f) { stateTimer -= Time.deltaTime; } if (fixedUpdate) { if (enemyHiddenTimer <= 0f && !enemyCollider.enabled) { PlaySpawnParticles(); ((Component)enemySlowMouthAnim).gameObject.SetActive(true); enemyCollider.enabled = true; } if (enemyHiddenTimer > 0f) { enemyHiddenTimer -= Time.fixedDeltaTime; if (enemyCollider.enabled) { PlaySpawnParticles(); ((Component)enemySlowMouthAnim).gameObject.SetActive(false); enemyCollider.enabled = false; } } } switch (currentState) { case State.Spawn: StateSpawn(fixedUpdate); break; case State.Idle: StateIdle(fixedUpdate); break; case State.Despawn: StateDespawn(fixedUpdate); break; case State.Roam: StateRoam(fixedUpdate); break; case State.Investigate: StateInvestigate(fixedUpdate); break; case State.Stun: StateStun(fixedUpdate); break; case State.Leave: StateLeave(fixedUpdate); break; case State.Notice: StateNotice(fixedUpdate); break; case State.Attack: StateAttack(fixedUpdate); break; case State.Attached: StateAttached(fixedUpdate); break; case State.Puke: StatePuke(fixedUpdate); break; case State.Detach: StateDetach(fixedUpdate); break; case State.IdlePuke: StateIdlePuke(fixedUpdate); break; case State.GoToPlayerOver: StateGoToPlayerOver(fixedUpdate); break; case State.GoToPlayerUnder: StateGoToPlayerUnder(fixedUpdate); break; case State.MoveBackToNavmesh: StateMoveBackToNavmesh(fixedUpdate); break; case State.GoToPlayer: StateGoToPlayer(fixedUpdate); break; } } public void UpdateState(State newState) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (currentState != newState && SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("UpdateStateRPC", (RpcTarget)0, new object[1] { newState }); } else { UpdateStateRPC(newState); } } } private void UpdatePlayerTarget(PlayerAvatar _player) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("UpdatePlayerTargetRPC", (RpcTarget)0, new object[1] { _player.photonView.ViewID }); } else { UpdatePlayerTargetRPC(_player.photonView.ViewID); } } } [PunRPC] private void UpdatePlayerTargetRPC(int _photonViewID, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.MasterOnlyRPC(_info)) { return; } foreach (PlayerAvatar item in SemiFunc.PlayerGetList()) { if (item.photonView.ViewID == _photonViewID) { playerTarget = item; currentTarget = SemiFunc.PlayerGetFaceEyeTransform(item); break; } } } [PunRPC] public void UpdateStateRPC(State newState, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { currentState = newState; stateImpulse = true; stateStartFixed = true; stateTimer = 0f; } } public void OnSpawn() { if (SemiFunc.IsMasterClientOrSingleplayer() && SemiFunc.EnemySpawn(enemy)) { UpdateState(State.Spawn); } } public void OnHurt() { if (((Behaviour)audioSourceVO).isActiveAndEnabled) { soundHurtVO.Play(mouthTransform, 1f, 1f, 1f, 1f); } } public void OnVision() { if (currentState == State.Idle || currentState == State.Investigate || currentState == State.Roam || currentState == State.Leave) { UpdateState(State.Notice); } } public void OnInvestigate() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer() && (currentState == State.Idle || currentState == State.Roam || currentState == State.Investigate)) { agentDestination = enemy.StateInvestigate.onInvestigateTriggeredPosition; UpdateState(State.Investigate); } } public void OnDeath() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) soundDieVO.Play(mouthTransform, 1f, 1f, 1f, 1f); GameDirector.instance.CameraShake.ShakeDistance(3f, 3f, 10f, enemy.CenterTransform.position, 0.5f); GameDirector.instance.CameraImpact.ShakeDistance(3f, 3f, 10f, enemy.CenterTransform.position, 0.05f); PlaySpawnParticles(); if (SemiFunc.IsMasterClientOrSingleplayer()) { enemy.EnemyParent.Despawn(); UpdateState(State.Dead); } } public void OnDespawn() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) soundDieVO.Play(mouthTransform, 1f, 1f, 1f, 1f); GameDirector.instance.CameraShake.ShakeDistance(3f, 3f, 10f, enemy.CenterTransform.position, 0.5f); GameDirector.instance.CameraImpact.ShakeDistance(3f, 3f, 10f, enemy.CenterTransform.position, 0.05f); PlaySpawnParticles(); } private void Update() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) if (currentState != State.Stun) { physGrabObject.OverrideZeroGravity(0.1f); } if ((int)enemy.CurrentState == 11) { UpdateState(State.Despawn); } LoopSounds(); if (SemiFunc.IsMasterClientOrSingleplayer()) { if (possessCooldown > 0f) { possessCooldown -= Time.deltaTime; } if (enemy.IsStunned() && enemyHiddenTimer <= 0f) { UpdateState(State.Stun); } enemyGroundPosition = new Vector3(((Component)enemy.Rigidbody).transform.position.x, ((Component)this).transform.position.y, ((Component)enemy.Rigidbody).transform.position.z); TargetPositionLogic(); } StateMachine(fixedUpdate: false); if (SemiFunc.PerSecond(30f, (Object)(object)this)) { followPointPositionPrev = followTarget.position; } } private void FixedUpdate() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { Vector3 forward = ((Component)enemy.Rigidbody).transform.forward; RaycastHit val = default(RaycastHit); if (Physics.Raycast(centerTransform.position, forward, ref val, 1f, LayerMask.op_Implicit(SemiFunc.LayerMaskGetVisionObstruct())) && !Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val)).collider).GetComponentInParent())) { enemyRigidbody.rb.AddForce(-(forward * 600f) * Time.fixedDeltaTime, (ForceMode)0); } } StateMachine(fixedUpdate: true); } private void RandomNudge(float _force) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { soundIdleBreakerVO.Play(mouthTransform, 1f, 1f, 1f, 1f); Vector3 val = centerTransform.up; switch (Random.Range(0, 4)) { case 0: val = centerTransform.up; break; case 1: val = centerTransform.right; break; case 2: val = -centerTransform.right; break; case 3: val = -centerTransform.up; break; } _ = centerTransform.position + val * 0.5f; randomNudgeTimer = 0f; enemyRigidbody.rb.AddForce(val * _force, (ForceMode)1); } } private void LookAtVelocityDirection(bool _moving) { //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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { Vector3 velocity = enemyRigidbody.rb.velocity; Vector3 val = ((Vector3)(ref velocity)).normalized; if (_moving) { val = enemy.moveDirection; } if (((Vector3)(ref val)).magnitude > 0.001f) { Quaternion val2 = Quaternion.LookRotation(val, Vector3.up); followTarget.localRotation = Quaternion.Slerp(followTarget.localRotation, val2, Time.deltaTime * 2f); } } } private void FloatAround() { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) followTarget.localPosition = followTargetStartPosition + Vector3.up * Mathf.Sin(Time.time * 0.5f) * 0.5f; Transform obj = followTarget; obj.localPosition += Vector3.left * Mathf.Sin(Time.time * 0.2f) * 0.3f; Transform obj2 = followTarget; obj2.localPosition += Vector3.forward * Mathf.Sin(Time.time * 0.2f) * 2f; } private bool IdlePukeLogic(float _tickSpeed = 1f) { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return false; } if (idlePukeCooldown > 0f) { idlePukeCooldown -= Time.deltaTime * _tickSpeed; return false; } IdlePukeExecute(); return true; } private void IdlePukeExecute() { if (!audioSourceVO.isPlaying) { idlePukePreviousState = currentState; UpdateState(State.IdlePuke); idlePukeCooldown = Random.Range(5f, 10f); float force = Random.Range(5f, 20f); RandomNudge(force); } } private void IdleBreakerVOLogic() { if (SemiFunc.IsMasterClientOrSingleplayer()) { if (idleBreakerVOCooldown > 0f) { idleBreakerVOCooldown -= Time.deltaTime; } else { IdleBreakerVO(); } } } public void IdleBreakerVO() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (!audioSourceVO.isPlaying && SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("IdleBreakerVORPC", (RpcTarget)0, Array.Empty()); } else { IdleBreakerVORPC(); } idleBreakerVOCooldown = Random.Range(15f, 45f); } } [PunRPC] public void IdleBreakerVORPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info) && ((Behaviour)enemySlowMouthAnim).enabled && ((Behaviour)audioSourceVO).enabled) { soundIdleBreakerVO.Play(mouthTransform, 1f, 1f, 1f, 1f); } } private void AttachToTarget() { //IL_0007: 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) float num = Vector3.Distance(((Component)this).transform.position, targetDestination); if (!VisionBlocked() && num < 2f) { UpdateState(State.Attached); } } private void FastMoving(bool _lookAtTarget) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (_lookAtTarget) { followTarget.localRotation = Quaternion.LookRotation(currentTarget.position - centerTransform.position, Vector3.up); } else { LookAtVelocityDirection(_moving: false); } enemyRigidbody.OverrideFollowPosition(0.1f, 4f, 4f); } private void OverrideHideEnemy() { enemyHiddenTimer = 0.2f; } private bool VisionBlocked() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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) if (SemiFunc.PerSecond(5f, (Object)(object)this)) { Vector3 val = playerTarget.PlayerVisionTarget.VisionTransform.position - enemy.CenterTransform.position; visionPrevious = Physics.Raycast(enemy.CenterTransform.position, val, ((Vector3)(ref val)).magnitude, LayerMask.GetMask(new string[1] { "Default" }), (QueryTriggerInteraction)1); } return visionPrevious; } private void LeaveCheck() { if (SemiFunc.EnemyForceLeave(enemy) || targetedPlayerTime >= targetedPlayerTimeMax) { UpdateState(State.Leave); } } private void TargettingPlayerStart() { aggroTimer = Random.Range(8f, 15f); looseTargetTimer = 0f; } private void TargettingPlayer() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) StuckLogic(); float num = currentTarget.position.y - ((Component)this).transform.position.y; if (num < 0.1f) { num = 0.1f; } if (num > 2f) { num = 2f; } followTarget.localPosition = new Vector3(0f, num, 0f); targetedPlayerTime += Time.deltaTime; if (SemiFunc.IsMasterClientOrSingleplayer()) { float num2 = 1f; if (VisionBlocked()) { num2 = 4f; } aggroTimer -= Time.deltaTime * num2; if ((Object.op_Implicit((Object)(object)playerTarget) && playerTarget.isDisabled) || !Object.op_Implicit((Object)(object)playerTarget) || aggroTimer <= 0f) { UpdateState(State.Leave); } if (VisionBlocked()) { looseTargetTimer += Time.deltaTime; if (looseTargetTimer > 3f) { UpdateState(State.Leave); looseTargetTimer = 0f; } } else { looseTargetTimer = 0f; } } AudioSourceSmoothStop(); } public void TargetPositionLogic() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b5: 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_00bc: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if ((currentState == State.GoToPlayer || currentState == State.GoToPlayerOver || currentState == State.GoToPlayerUnder) && Object.op_Implicit((Object)(object)playerTarget)) { Vector3 val = ((currentState != State.GoToPlayer && currentState != State.GoToPlayerUnder && currentState != State.GoToPlayerOver) ? (((Component)playerTarget).transform.position + ((Component)playerTarget).transform.forward * targetForwardOffset) : (((Component)playerTarget).transform.position + ((Component)playerTarget).transform.forward * 1.5f)); targetPosition = Vector3.Lerp(targetPosition, val, 20f * Time.deltaTime); } } private void AudioSourceSmoothStop() { if (audioSourceVO.isPlaying) { audioSourceVO.volume = Mathf.Lerp(audioSourceVO.volume, 0f, Time.deltaTime * 40f); if (audioSourceVO.volume <= 0.01f) { audioSourceVO.Stop(); audioSourceVO.volume = 1f; } } else if (audioSourceVO.volume < 1f) { audioSourceVO.volume = 1f; } } private void LoopSounds() { bool flag = currentState == State.GoToPlayer || currentState == State.GoToPlayerOver || currentState == State.GoToPlayerUnder || currentState == State.MoveBackToNavmesh; soundChaseLoopVO.PlayLoop(flag, 2f, 2f, 1f, 1f); bool flag2 = currentState == State.Stun; soundStunLoopVO.PlayLoop(flag2, 2f, 2f, 1f, 1f); } private void AttachToPlayer() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer() || !Object.op_Implicit((Object)(object)playerTarget) || !Object.op_Implicit((Object)(object)currentTarget) || !(Vector3.Distance(centerTransform.position, currentTarget.position) < 1.8f)) { return; } if (SemiFunc.PerSecond(30f, (Object)(object)this)) { if (movingLeft) { enemyRigidbody.rb.AddForce(-centerTransform.right * 5f, (ForceMode)0); if (moveThisDirectionTimer <= 0f) { movingLeft = false; movingRight = true; moveThisDirectionTimer = Random.Range(0.2f, 3f); } } if (movingRight) { enemyRigidbody.rb.AddForce(centerTransform.right * 5f, (ForceMode)0); if (moveThisDirectionTimer <= 0f) { movingRight = false; movingLeft = true; moveThisDirectionTimer = Random.Range(0.2f, 3f); } } } if (moveThisDirectionTimer > 0f) { moveThisDirectionTimer -= Time.deltaTime; } if (Random.Range(0, 2) == 0 && possessCooldown <= 0f && !IsPossessed()) { UpdateState(State.Attack); return; } IdlePukeExecute(); if (Random.Range(0, 3) == 0) { idlePukePreviousState = State.Leave; } } public bool IsPossessed() { if (!Object.op_Implicit((Object)(object)playerTarget)) { return true; } if (Object.op_Implicit((Object)(object)((Component)playerTarget.playerAvatarVisuals).GetComponentInChildren())) { return true; } return false; } private void PlayerEffects() { if (Object.op_Implicit((Object)(object)playerTarget)) { if (Object.op_Implicit((Object)(object)playerTarget.voiceChat)) { playerTarget.voiceChat.OverridePitch(0.75f, 1f, 2f, 0.1f, 0f, 0f); } playerTarget.OverridePupilSize(2f, 4, 1f, 1f, 5f, 0.5f, 0.1f); playerTarget.playerCosmetics.ConditionCustomSet((Type)0, 0.1f); } } private void StuckLogic() { //IL_0007: 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_005b: 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) float num = Vector3.Distance(((Component)this).transform.position, stuckPosition); float num2 = 0.25f; if (currentState == State.GoToPlayer || currentState == State.GoToPlayerOver || currentState == State.GoToPlayerUnder) { num2 = 1.5f; } if (num > num2) { stuckPosition = ((Component)this).transform.position; stuckTimer = 0f; randomNudgeTimer = 0f; return; } stuckTimer += Time.deltaTime; randomNudgeTimer += Time.deltaTime; if (randomNudgeTimer > 2.5f) { float force = Random.Range(4f, 10f); RandomNudge(force); randomNudgeTimer = 0f; if (currentState == State.GoToPlayer) { if (Random.Range(0, 2) == 0) { UpdateState(State.GoToPlayerUnder); } else { UpdateState(State.GoToPlayerOver); } } } if (stuckTimer > 5f) { UpdateState(State.IdlePuke); stuckTimer = 0f; } } private void IsPossessedBySeveral() { if (SemiFunc.IsMasterClientOrSingleplayer() && SemiFunc.PerSecond(5f, (Object)(object)this) && Object.op_Implicit((Object)(object)playerTarget)) { if (playerTarget.isDisabled) { UpdateState(State.Leave); } else if (((Component)playerTarget.playerAvatarVisuals).GetComponentsInChildren().Length > 1) { UpdateState(State.Leave); } } } private void MoveBackPosition() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) if (moveBackTimer <= 0f) { moveBackTimer = 0.1f; NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)this).transform.position, ref val, 0.5f, -1) && Physics.Raycast(((Component)this).transform.position, Vector3.down, 2f, LayerMask.GetMask(new string[1] { "Default" }))) { moveBackPosition = ((NavMeshHit)(ref val)).position; } } } } public class MareoAttached : MonoBehaviour { public enum State { Intro, Idle, Puke, Outro } internal bool debug; internal Mareo mareo; internal State state; internal State statePrev; private bool stateStart = true; private float stateTimer; internal PlayerAvatar playerTarget; internal bool showDebug; public Transform localParentTransform; public SemiPuke semiPuke; public AnimationCurve curveIntroOutro; public Transform pukeCapsuleTransform; public MeshRenderer pukeCapsuleRenderer; public Transform topJawTransform; public Transform botJawTransform; private Quaternion topJawStartRotation; private Quaternion botJawStartRotation; private Quaternion topJawTargetRotation; private Quaternion botJawTargetRotation; private Vector3 jawStartPosition; private Vector3 jawTargetPosition; private SpringQuaternion topJawSpring; private SpringQuaternion botJawSpring; private SpringVector3 jawPositionSpring; private float openAngleTarget = 125f; private float pukeTimer; public List pukeParticles; public SemiPuke otherSemiPuke; public Transform otherTopJawTransform; public Transform otherBotJawTransform; public Transform particles; private SpringFloat springFloatScale; private float scaleTarget = 1f; public List eyeTransforms; private float loudnessAdd; private SpringFloat loudnessSpring; private float loudnessTarget; private void Start() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) jawPositionSpring = new SpringVector3(); jawPositionSpring.damping = 0.5f; jawPositionSpring.speed = 20f; topJawSpring = new SpringQuaternion(); topJawSpring.damping = 0.5f; topJawSpring.speed = 20f; botJawSpring = new SpringQuaternion(); botJawSpring.damping = 0.5f; botJawSpring.speed = 20f; topJawStartRotation = topJawTransform.localRotation; botJawStartRotation = botJawTransform.localRotation; topJawTargetRotation = topJawStartRotation; botJawTargetRotation = topJawStartRotation; jawStartPosition = localParentTransform.localPosition; loudnessSpring = new SpringFloat(); loudnessSpring.damping = 0.5f; loudnessSpring.speed = 20f; springFloatScale = new SpringFloat(); springFloatScale.damping = 0.35f; springFloatScale.speed = 10f; otherTopJawTransform.localScale = Vector3.one * 2f; springFloatScale.lastPosition = 2f; } private void StateIntro() { //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) if (stateStart) { stateStart = false; stateTimer = 1f; if (Object.op_Implicit((Object)(object)playerTarget) && playerTarget.isLocal) { float num = 125f; topJawTransform.localRotation = Quaternion.Euler(num, 0f, 0f); botJawTransform.localRotation = Quaternion.Euler(0f - num, 0f, 0f); topJawSpring.lastRotation = topJawTransform.localRotation; botJawSpring.lastRotation = botJawTransform.localRotation; jawTargetPosition = jawStartPosition; localParentTransform.localPosition = jawTargetPosition + new Vector3(0f, -1f, -1f); jawPositionSpring.lastPosition = localParentTransform.localPosition; } } loudnessTarget = 0f; scaleTarget = 1f; if (Object.op_Implicit((Object)(object)playerTarget) && playerTarget.isLocal) { float num2 = curveIntroOutro.Evaluate(1f - stateTimer); openAngleTarget = Mathf.LerpUnclamped(125f, 0f, num2); topJawTargetRotation = topJawStartRotation * Quaternion.Euler(openAngleTarget, 0f, 0f); botJawTargetRotation = botJawStartRotation * Quaternion.Euler(0f - openAngleTarget, 0f, 0f); } if (stateTimer < 0f) { StateSet(State.Idle); } } private void StateIdle() { //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) if (stateStart) { stateStart = false; if (Object.op_Implicit((Object)(object)playerTarget) && playerTarget.isLocal) { botJawTargetRotation = botJawStartRotation; topJawTargetRotation = topJawStartRotation; jawTargetPosition = jawStartPosition; if (statePrev == State.Puke) { GameDirector.instance.CameraShake.ShakeDistance(8f, 3f, 8f, localParentTransform.position, 0.1f); GameDirector.instance.CameraImpact.ShakeDistance(12f, 3f, 8f, localParentTransform.position, 0.1f); } } } loudnessTarget = 0f; scaleTarget = 1f; if (Object.op_Implicit((Object)(object)playerTarget) && playerTarget.isLocal) { botJawTargetRotation = botJawStartRotation * Quaternion.Euler(-2f * Mathf.Sin(Time.time * 2f), 0f, 0f); topJawTargetRotation = topJawStartRotation * Quaternion.Euler(2f * Mathf.Sin(Time.time * 2f), 0f, 0f); float num = 10f; botJawSpring.speed = 20f; topJawSpring.speed = 20f; if (Object.op_Implicit((Object)(object)playerTarget.voiceChat)) { num = playerTarget.voiceChat.clipLoudness * 100f; } num = Mathf.Clamp(num, 0f, 10f); topJawTargetRotation *= Quaternion.Euler(topJawStartRotation.x + num, topJawStartRotation.y, topJawStartRotation.z); botJawTargetRotation *= Quaternion.Euler(botJawStartRotation.x - num, botJawStartRotation.y, botJawStartRotation.z); if (SemiFunc.PerSecond(15f, (Object)(object)this)) { topJawSpring.springVelocity = Random.insideUnitSphere * 0.2f; botJawSpring.springVelocity = Random.insideUnitSphere * 0.2f; } } } private void StatePuke() { //IL_010e: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_021f: 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_022e: 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_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) if (stateStart) { stateStart = false; if (playerTarget.isLocal) { Vector3 localScale = pukeCapsuleTransform.localScale; localScale.x = 0f; GameDirector.instance.CameraShake.ShakeDistance(8f, 3f, 8f, localParentTransform.position, 0.1f); GameDirector.instance.CameraImpact.ShakeDistance(12f, 3f, 8f, localParentTransform.position, 0.1f); pukeCapsuleTransform.localScale = localScale; } } float num = Mathf.Sin(Time.time * 40f) * 0.05f; loudnessTarget = 0.2f + num; scaleTarget = 1f; if (playerTarget.isLocal) { GameDirector.instance.CameraShake.ShakeDistance(4f, 3f, 8f, localParentTransform.position, 0.1f); } if (((Component)semiPuke).gameObject.activeInHierarchy) { semiPuke.PukeActive(((Component)semiPuke).transform.position, ((Component)playerTarget.localCamera).transform.rotation); } else { otherSemiPuke.PukeActive(((Component)otherSemiPuke).transform.position, playerTarget.localCamera.GetOverrideTransform().rotation); } pukeTimer = 0.2f; if (playerTarget.isLocal) { botJawTargetRotation = botJawStartRotation * Quaternion.Euler(-25f, 0f, 0f); topJawTargetRotation = topJawStartRotation * Quaternion.Euler(25f, 0f, 0f); if (SemiFunc.PerSecond(15f, (Object)(object)this)) { topJawSpring.springVelocity = Random.insideUnitSphere * 5f; botJawSpring.springVelocity = Random.insideUnitSphere * 5f; } } } private void StateOutro() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) if (stateStart) { stateStart = false; stateTimer = 1f; ((Component)particles).gameObject.SetActive(true); } loudnessTarget = 0f; scaleTarget = 0f; if (playerTarget.isLocal) { float num = curveIntroOutro.Evaluate(1f - stateTimer); openAngleTarget = Mathf.LerpUnclamped(0f, 125f, num); topJawTargetRotation = topJawStartRotation * Quaternion.Euler(openAngleTarget, 0f, 0f); botJawTargetRotation = botJawStartRotation * Quaternion.Euler(0f - openAngleTarget, 0f, 0f); jawTargetPosition = Vector3.LerpUnclamped(jawStartPosition, jawStartPosition + new Vector3(0f, 0.2f, -0.4f), num); } if (stateTimer < 0f) { if (Object.op_Implicit((Object)(object)mareo) && mareo.currentState != Mareo.State.Detach && mareo.currentState != Mareo.State.Leave) { mareo.UpdateState(Mareo.State.Detach); } Object.Destroy((Object)(object)((Component)otherTopJawTransform).gameObject); Object.Destroy((Object)(object)((Component)otherBotJawTransform).gameObject); Object.Destroy((Object)(object)((Component)localParentTransform).gameObject); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void StateSynchingWithParentEnemy() { if (!Object.op_Implicit((Object)(object)mareo) && !debug) { StateSet(State.Outro); return; } bool flag = Object.op_Implicit((Object)(object)mareo) && mareo.currentState == Mareo.State.Puke; bool flag2 = Object.op_Implicit((Object)(object)mareo) && (mareo.currentState == Mareo.State.Attached || mareo.currentState == Mareo.State.Puke || mareo.currentState == Mareo.State.Detach); if (debug || flag2) { if (flag) { StateSet(State.Puke); } else if (state != State.Intro) { StateSet(State.Idle); } } else { StateSet(State.Outro); } } private void StateMachine() { if (stateTimer > 0f) { stateTimer -= Time.deltaTime; } switch (state) { case State.Intro: StateIntro(); break; case State.Idle: StateIdle(); break; case State.Puke: StatePuke(); break; case State.Outro: StateOutro(); break; } } public void StateSet(State newState) { if (state != newState) { statePrev = state; state = newState; stateStart = true; stateTimer = 0f; } } private void PukeParticles(bool _play) { foreach (ParticleSystem pukeParticle in pukeParticles) { if (_play) { if (!pukeParticle.isPlaying) { pukeParticle.Play(); } } else if (pukeParticle.isPlaying) { pukeParticle.Stop(); } } } private void Update() { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)playerTarget) && Object.op_Implicit((Object)(object)playerTarget.voiceChat)) { playerTarget.voiceChat.OverrideClipLoudnessAnimationValue(loudnessAdd); } loudnessAdd = SemiFunc.SpringFloatGet(loudnessSpring, loudnessTarget, -1f); if (Object.op_Implicit((Object)(object)playerTarget)) { Quaternion rotation = playerTarget.playerAvatarVisuals.playerEyes.eyeLeft.rotation; Quaternion rotation2 = playerTarget.playerAvatarVisuals.playerEyes.eyeRight.rotation; eyeTransforms[0].rotation = rotation; eyeTransforms[1].rotation = rotation2; } StateSynchingWithParentEnemy(); StateMachine(); otherTopJawTransform.localScale = Vector3.one * SemiFunc.SpringFloatGet(springFloatScale, scaleTarget, -1f); otherBotJawTransform.localScale = Vector3.one * SemiFunc.SpringFloatGet(springFloatScale, scaleTarget, -1f); if (Object.op_Implicit((Object)(object)playerTarget) && playerTarget.isLocal) { if (pukeTimer > 0f && ((Component)localParentTransform).gameObject.activeInHierarchy) { PukeParticles(_play: true); pukeTimer -= Time.deltaTime; pukeCapsuleTransform.localScale = Vector3.Lerp(pukeCapsuleTransform.localScale, Vector3.one, Time.deltaTime * 5f); Transform obj = pukeCapsuleTransform; obj.localScale += Vector3.one * Mathf.Sin(Time.time * 30f) * 0.01f; Transform obj2 = pukeCapsuleTransform; obj2.localScale += Vector3.one * Mathf.Sin(Time.time * 60f) * 0.01f; Vector2 textureOffset = ((Renderer)pukeCapsuleRenderer).material.GetTextureOffset("_MainTex"); textureOffset.x -= Time.deltaTime * 1.5f; ((Renderer)pukeCapsuleRenderer).material.SetTextureOffset("_MainTex", textureOffset); if (!((Component)pukeCapsuleTransform).gameObject.activeSelf) { pukeCapsuleTransform.localScale = Vector3.zero; ((Component)pukeCapsuleTransform).gameObject.SetActive(true); } } else { PukeParticles(_play: false); pukeCapsuleTransform.localScale = Vector3.Lerp(pukeCapsuleTransform.localScale, Vector3.zero, Time.deltaTime * 5f); if (pukeCapsuleTransform.localScale.x < 0.01f && ((Component)pukeCapsuleTransform).gameObject.activeSelf) { pukeCapsuleTransform.localScale = Vector3.zero; ((Component)pukeCapsuleTransform).gameObject.SetActive(false); } } localParentTransform.localPosition = SemiFunc.SpringVector3Get(jawPositionSpring, jawTargetPosition, -1f); topJawTransform.localRotation = SemiFunc.SpringQuaternionGet(topJawSpring, topJawTargetRotation, -1f); botJawTransform.localRotation = SemiFunc.SpringQuaternionGet(botJawSpring, botJawTargetRotation, -1f); } if (Object.op_Implicit((Object)(object)playerTarget) && playerTarget.isLocal) { bool flag = showDebug || playerTarget.localCamera.GetOverrideActive() || playerTarget.playerAvatarVisuals.showSelfOverrideTimer > 0f; ((Component)localParentTransform).gameObject.SetActive(!flag); ((Component)otherTopJawTransform).gameObject.SetActive(flag); ((Component)otherBotJawTransform).gameObject.SetActive(flag); } } private void OnDisable() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)playerTarget) && playerTarget.isDisabled) { if (Object.op_Implicit((Object)(object)mareo)) { mareo.UpdateState(Mareo.State.Detach); Transform overrideTransform = playerTarget.localCamera.GetOverrideTransform(); mareo.detachPosition = overrideTransform.position; mareo.detachRotation = overrideTransform.rotation; } Object.Destroy((Object)(object)((Component)otherTopJawTransform).gameObject); Object.Destroy((Object)(object)((Component)otherBotJawTransform).gameObject); Object.Destroy((Object)(object)((Component)localParentTransform).gameObject); Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class MareoAttaching : MonoBehaviour { internal Mareo mareo; public Transform tentaclesTransform; public List eyeTransforms = new List(); public Transform topJaw; public Transform bottomJaw; public Transform particleTransform; private List particleSystems = new List(); private Quaternion startRotationTopJaw; private Quaternion startRotationBottomJaw; private Transform targetTransform; public PlayerAvatar targetPlayerAvatar; private SpringQuaternion springQuaternion; private bool isActive; private Vector3 startPosition; private SpringFloat springFloatScale; private float targetScale = 1f; public GameObject localPlayerJaw; [Space(20f)] public Sound soundAttachVO; public Sound soundAttach; private void Start() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) springQuaternion = new SpringQuaternion(); springQuaternion.damping = 0.5f; springQuaternion.speed = 20f; springFloatScale = new SpringFloat(); springFloatScale.damping = 0.5f; springFloatScale.speed = 20f; startRotationTopJaw = topJaw.localRotation; startRotationBottomJaw = bottomJaw.localRotation; startPosition = ((Component)this).transform.position; particleSystems = new List(((Component)particleTransform).GetComponentsInChildren()); GoTime(); } public void GoTime() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) PlayParticles(finalPlay: false); if (targetPlayerAvatar.isLocal) { CameraGlitch.Instance.PlayLong(); } SetTarget(targetPlayerAvatar); springFloatScale.springVelocity = 50f; isActive = true; targetScale = 1f; GameDirector.instance.CameraShake.ShakeDistance(3f, 3f, 8f, ((Component)this).transform.position, 0.1f); GameDirector.instance.CameraImpact.ShakeDistance(2f, 3f, 8f, ((Component)this).transform.position, 0.1f); soundAttachVO.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } private void PlayParticles(bool finalPlay) { foreach (ParticleSystem particleSystem in particleSystems) { particleSystem.Play(); if (finalPlay) { ((Component)particleSystem).transform.parent = null; Object.Destroy((Object)(object)((Component)particleSystem).gameObject, 4f); } } } private void SpawnPlayerJaw() { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(localPlayerJaw, ((Component)this).transform.position, Quaternion.identity, ((Component)targetPlayerAvatar.playerAvatarVisuals).transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; MareoAttached component = val.GetComponent(); component.mareo = mareo; component.playerTarget = targetPlayerAvatar; if (targetPlayerAvatar.isLocal) { component.localParentTransform.parent = ((Component)targetPlayerAvatar.localCamera).transform; ((Object)((Component)component.localParentTransform).gameObject).name = "SlowMouthJawLocal"; component.localParentTransform.localPosition = Vector3.zero; component.localParentTransform.localRotation = Quaternion.identity; ((Component)component.localParentTransform).gameObject.SetActive(true); } Transform attachPointJawTop = targetPlayerAvatar.playerAvatarVisuals.attachPointJawTop; Transform attachPointJawBottom = targetPlayerAvatar.playerAvatarVisuals.attachPointJawBottom; component.otherTopJawTransform.parent = attachPointJawTop; component.otherTopJawTransform.localPosition = Vector3.zero; component.otherTopJawTransform.rotation = Quaternion.identity; component.otherTopJawTransform.localRotation = Quaternion.identity; component.otherBotJawTransform.parent = attachPointJawBottom; component.otherBotJawTransform.localPosition = Vector3.zero; component.otherBotJawTransform.rotation = Quaternion.identity; component.otherBotJawTransform.localRotation = Quaternion.identity; if (targetPlayerAvatar.isLocal) { UpdateLocalRenderers(component.otherTopJawTransform); UpdateLocalRenderers(component.otherBotJawTransform); if (!targetPlayerAvatar.localCamera.GetOverrideActive()) { ((Component)component.otherTopJawTransform).gameObject.SetActive(false); ((Component)component.otherBotJawTransform).gameObject.SetActive(false); } } } private void UpdateLocalRenderers(Transform _transform) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) LayerMask val = LayerMask.op_Implicit(LayerMask.NameToLayer("PlayerVisualsLocal")); Renderer[] componentsInChildren = ((Component)_transform).GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val2 in array) { if (Object.op_Implicit((Object)(object)val2)) { ((Component)val2).gameObject.layer = LayerMask.op_Implicit(val); val2.shadowCastingMode = targetPlayerAvatar.playerAvatarVisuals.localVisibility; } } } private void Update() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) bool flag = !Object.op_Implicit((Object)(object)targetTransform) || !Object.op_Implicit((Object)(object)targetPlayerAvatar); if (!isActive) { return; } if (flag) { Detach(); return; } Quaternion val = Quaternion.LookRotation(targetTransform.position - ((Component)this).transform.position); ((Component)this).transform.rotation = SemiFunc.SpringQuaternionGet(springQuaternion, val, -1f); float num = SemiFunc.SpringFloatGet(springFloatScale, targetScale, -1f); ((Component)this).transform.localScale = Vector3.one * num; float num2 = Vector3.Distance(((Component)this).transform.position, targetTransform.position); float num3 = num2 * 2f; if (num3 < 4f) { num3 = 4f; } if (num3 > 10f) { num3 = 10f; } ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, targetTransform.position, Time.deltaTime * num3); if (num2 < 1f) { targetScale = 2.5f; } if (!SemiFunc.IsMasterClientOrSingleplayer()) { if (!Object.op_Implicit((Object)(object)mareo) || mareo.currentState != Mareo.State.Attack) { if (!targetPlayerAvatar.isDisabled && (!Object.op_Implicit((Object)(object)mareo) || !mareo.IsPossessed())) { AttachToPlayer(); } else { Detach(); } } if (targetPlayerAvatar.isLocal) { GameDirector.instance.CameraShake.Shake(4f, 0.1f); } } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (!targetPlayerAvatar.isDisabled && Object.op_Implicit((Object)(object)mareo) && !mareo.IsPossessed()) { if (num2 < 0.1f) { AttachToPlayer(); mareo.UpdateState(Mareo.State.Attached); isActive = false; } } else { Detach(); } if (targetPlayerAvatar.isLocal) { CameraAim.Instance.AimTargetSet(((Component)this).transform.position, 0.2f, 20f, ((Component)this).gameObject, 100); CameraZoom.Instance.OverrideZoomSet(30f, 0.1f, 8f, 1f, ((Component)this).gameObject, 50); } tentaclesTransform.localScale = new Vector3(1f + Mathf.Sin(Time.time * 40f) * 0.2f, 1f + Mathf.Sin(Time.time * 60f) * 0.1f, 1f); tentaclesTransform.localRotation = Quaternion.Euler(0f, 0f, Mathf.Sin(Time.time * 20f) * 10f); topJaw.localRotation = startRotationTopJaw * Quaternion.Euler(Mathf.Sin(Time.time * 60f) * 3f, 0f, 0f); bottomJaw.localRotation = startRotationBottomJaw * Quaternion.Euler(Mathf.Sin(Time.time * 60f) * 10f, 0f, 0f); foreach (Transform eyeTransform in eyeTransforms) { eyeTransform.localScale = new Vector3(1.5f + Mathf.Sin(Time.time * 40f) * 0.5f, 1.5f + Mathf.Sin(Time.time * 60f) * 0.5f, 1.5f); } } private void AttachToPlayer() { if (!targetPlayerAvatar.isDisabled && !Object.op_Implicit((Object)(object)((Component)targetPlayerAvatar.playerAvatarVisuals).GetComponentInChildren())) { SpawnPlayerJaw(); Despawn(); } } private void Detach() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) soundAttach.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); PlayParticles(finalPlay: true); if (Object.op_Implicit((Object)(object)mareo) && SemiFunc.IsMasterClientOrSingleplayer()) { mareo.detachPosition = ((Component)this).transform.position; mareo.detachRotation = ((Component)this).transform.rotation; mareo.UpdateState(Mareo.State.Detach); } Object.Destroy((Object)(object)((Component)this).gameObject); } private void Despawn() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) soundAttach.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); PlayParticles(finalPlay: true); if (targetPlayerAvatar.isLocal) { GameDirector.instance.CameraImpact.Shake(8f, 0.1f); GameDirector.instance.CameraShake.Shake(5f, 0.1f); CameraGlitch.Instance.PlayLong(); } else { GameDirector.instance.CameraShake.ShakeDistance(3f, 3f, 8f, ((Component)this).transform.position, 0.1f); GameDirector.instance.CameraImpact.ShakeDistance(2f, 3f, 8f, ((Component)this).transform.position, 0.1f); } Object.Destroy((Object)(object)((Component)this).gameObject); } public void SetTarget(PlayerAvatar _playerAvatar) { targetTransform = SemiFunc.PlayerGetFaceEyeTransform(_playerAvatar); targetPlayerAvatar = _playerAvatar; } } public class MareoPlayerAvatarAttached : MonoBehaviour { public enum State { Intro, Idle, Puke, Outro } public Transform jawBot; public Transform particles; private SpringFloat springFloatScale; internal Mareo mareo; internal SemiPuke semiPuke; private float scaleTarget = 1f; private bool stateStart; internal PlayerAvatar playerTarget; public List eyeTransforms; private PlayerVoiceChat playerVoiceChat; private float loudnessAdd; private SpringFloat loudnessSpring; private float loudnessTarget; public State state; private void Start() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_005d: 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) loudnessSpring = new SpringFloat(); loudnessSpring.damping = 0.5f; loudnessSpring.speed = 20f; springFloatScale = new SpringFloat(); springFloatScale.damping = 0.35f; springFloatScale.speed = 10f; ((Component)this).transform.localScale = Vector3.one * 2f; springFloatScale.lastPosition = 2f; playerVoiceChat = playerTarget.voiceChat; } private void StateIntro() { if (stateStart) { stateStart = false; } loudnessTarget = 0f; scaleTarget = 1f; } private void StateIdle() { if (stateStart) { stateStart = false; } loudnessTarget = 0f; scaleTarget = 1f; } private void StatePuke() { //IL_0054: 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) if (stateStart) { stateStart = false; } float num = Mathf.Sin(Time.time * 40f) * 0.05f; loudnessTarget = 0.2f + num; scaleTarget = 1f; semiPuke.PukeActive(((Component)semiPuke).transform.position, ((Component)playerTarget.localCamera).transform.rotation); } private void StateOutro() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (stateStart) { ((Component)particles).gameObject.SetActive(true); stateStart = false; } loudnessTarget = 0f; scaleTarget = 0f; if (((Component)this).transform.localScale.x < 0.05f) { mareo.UpdateState(Mareo.State.Detach); Object.Destroy((Object)(object)((Component)jawBot).gameObject); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void StateMachine() { switch (state) { case State.Intro: StateIntro(); break; case State.Idle: StateIdle(); break; case State.Puke: StatePuke(); break; case State.Outro: StateOutro(); break; } } private void Update() { //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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)playerVoiceChat)) { playerVoiceChat.OverrideClipLoudnessAnimationValue(loudnessAdd); } else if (Object.op_Implicit((Object)(object)playerTarget)) { playerVoiceChat = playerTarget.voiceChat; } loudnessAdd = SemiFunc.SpringFloatGet(loudnessSpring, loudnessTarget, -1f); Quaternion rotation = playerTarget.playerAvatarVisuals.playerEyes.eyeLeft.rotation; Quaternion rotation2 = playerTarget.playerAvatarVisuals.playerEyes.eyeRight.rotation; eyeTransforms[0].rotation = rotation; eyeTransforms[1].rotation = rotation2; StateSynchingWithParentEnemy(); StateMachine(); ((Component)this).transform.localScale = Vector3.one * SemiFunc.SpringFloatGet(springFloatScale, scaleTarget, -1f); jawBot.localScale = Vector3.one * SemiFunc.SpringFloatGet(springFloatScale, scaleTarget, -1f); } private void StateSynchingWithParentEnemy() { if (!Object.op_Implicit((Object)(object)mareo)) { StateSet(State.Outro); return; } bool flag = mareo.currentState == Mareo.State.Puke; if (mareo.currentState == Mareo.State.Attached || mareo.currentState == Mareo.State.Puke || mareo.currentState == Mareo.State.Detach) { if (flag) { StateSet(State.Puke); } else if (state != State.Intro) { StateSet(State.Idle); } } else { StateSet(State.Outro); } } private void StateSet(State _state) { if (state != _state) { state = _state; stateStart = true; } } private void OnDisable() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (playerTarget.isDisabled) { mareo.UpdateState(Mareo.State.Detach); mareo.detachPosition = ((Component)playerTarget.localCamera).transform.position; mareo.detachRotation = ((Component)playerTarget.localCamera).transform.rotation; Object.Destroy((Object)(object)((Component)jawBot).gameObject); Object.Destroy((Object)(object)((Component)this).gameObject); } } } public static class MinimapDebuffTimer { private static readonly ConditionalWeakTable minimapsData = new ConditionalWeakTable(); public static PlayerMinimapData GetMapDebuffTimer(this PlayerAvatar instance) { return minimapsData.GetOrCreateValue(instance); } } public class PlayerMinimapData { public float minimapDebuffTimer = 0f; } public class Payayo : MonoBehaviour, IPunObservable { public enum State { Spawn, Idle, Roam, Investigate, AttackStart, Attack, AttackEnd, MeleeStart, Melee, Seek, Leave, Stun, Despawn } internal enum AttackType { Normal, Quick, Sine, Circle, Targeted } internal int currentAttack = 0; public State currentState; public float stateTimer; private bool stateImpulse; private float stateTicker; internal Enemy enemy; internal PhotonView photonView; public PayayoAnim anim; public Transform aimVerticalTransform; public Transform hatTransform; public Transform bottomTransform; public SemiLaser laser; public Transform laserStartTransform; public Transform laserRayTransform; private Quaternion aimVerticalTarget; private Quaternion aimHorizontalTarget; public SpringQuaternion horizontalRotationSpring; private Quaternion horizontalRotationTarget = Quaternion.identity; [Space] public AnimationCurve aimHorizontalCurve; public float aimHorizontalSpread; public float aimHorizontalSpeed; private float aimHorizontalLerp; private float aimHorizontalResult; internal PlayerAvatar playerTarget; private Vector3 agentDestination; private Vector3 seekDestination; private Vector3 meleeTarget; private bool meleePlayer; private float laserCooldown; private float laserRange = 10f; private Vector3 hitPosition; private Vector3 hitPositionSmooth; private float hitPositionClientDistance; private bool hitPositionStartImpulse; private bool hitPositionImpact; private float hitPositionTimer; public ParticleSystem particleDeathSmoke; public ParticleSystem particleDeathBody; public ParticleSystem particleDeathNose; public ParticleSystem particleDeathHat; public ParticleSystem particleBottomSmoke; internal bool moveFast; internal float rotator = 0f; private void Awake() { enemy = ((Component)this).GetComponent(); photonView = ((Component)this).GetComponent(); } private void Update() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Invalid comparison between Unknown and I4 VerticalAimLogic(); LaserLogic(); MoveFastLogic(); if ((!GameManager.Multiplayer() || PhotonNetwork.IsMasterClient) && LevelGenerator.Instance.Generated) { if (enemy.IsStunned()) { UpdateState(State.Stun); } if ((int)enemy.CurrentState == 11) { UpdateState(State.Despawn); } switch (currentState) { case State.Spawn: StateSpawn(); break; case State.Idle: StateIdle(); break; case State.Roam: StateRoam(); break; case State.Investigate: StateInvestigate(); break; case State.AttackStart: StateAttackStart(); break; case State.Attack: StateAttack(); break; case State.AttackEnd: StateAttackEnd(); break; case State.MeleeStart: StateMeleeStart(); break; case State.Melee: StateMelee(); break; case State.Seek: StateSeek(); break; case State.Leave: StateLeave(); break; case State.Stun: StateStun(); break; case State.Despawn: StateDespawn(); break; } RotationLogic(); } } private void StateSpawn() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); stateImpulse = false; stateTimer = 2f; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Idle); } } private void StateIdle() { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; stateTimer = Random.Range(4f, 8f); if (Random.Range(0, 7) == 0) { anim.idleSounds.Play(((Component)anim).transform.position, 1f, 1f, 1f, 1f); } enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); } if (!SemiFunc.EnemySpawnIdlePause()) { stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Roam); } if (SemiFunc.EnemyForceLeave(enemy)) { UpdateState(State.Leave); } } } private void StateRoam() { //IL_011c: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; stateTimer = 999f; bool flag = false; LevelPoint val = SemiFunc.LevelPointGet(((Component)this).transform.position, 10f, 25f); if (!Object.op_Implicit((Object)(object)val)) { val = SemiFunc.LevelPointGet(((Component)this).transform.position, 0f, 999f); } NavMeshHit val2 = default(NavMeshHit); if (Object.op_Implicit((Object)(object)val) && NavMesh.SamplePosition(((Component)val).transform.position + Random.insideUnitSphere * 3f, ref val2, 5f, -1) && Physics.Raycast(((NavMeshHit)(ref val2)).position, Vector3.down, 5f, LayerMask.GetMask(new string[1] { "Default" }))) { agentDestination = ((NavMeshHit)(ref val2)).position; flag = true; } if (!flag) { return; } enemy.Rigidbody.notMovingTimer = 0f; stateImpulse = false; } enemy.NavMeshAgent.SetDestination(agentDestination); if (!enemy.Jump.jumping && Vector3.Distance(((Component)this).transform.position, enemy.NavMeshAgent.GetPoint()) < 1f) { UpdateState(State.Idle); } else if (enemy.Rigidbody.notMovingTimer >= 3f) { AttackNearestPhysObjectOrGoToIdle(); } if (SemiFunc.EnemyForceLeave(enemy)) { UpdateState(State.Leave); } } private void StateInvestigate() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; stateTimer = 999f; enemy.Rigidbody.notMovingTimer = 0f; } else { enemy.NavMeshAgent.SetDestination(agentDestination); if (!enemy.Jump.jumping && (Vector3.Distance(((Component)enemy.Rigidbody).transform.position, enemy.NavMeshAgent.GetPoint()) < 1f || Vector3.Distance(((Component)enemy.Rigidbody).transform.position, agentDestination) < 1f)) { UpdateState(State.Idle); } else if (enemy.Rigidbody.notMovingTimer >= 3f) { AttackNearestPhysObjectOrGoToIdle(); } } if (SemiFunc.EnemyForceLeave(enemy)) { UpdateState(State.Leave); } } private void StateAttackStart() { //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { rotator = 0f; currentAttack = Random.Range(1, 5); aimHorizontalResult = 0f; stateImpulse = false; stateTimer = 1f; enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); seekDestination = ((Component)playerTarget).transform.position; aimHorizontalLerp = 0f; if (currentAttack == 1) { aimHorizontalSpeed = 1.25f; } else { aimHorizontalSpeed = 0.5f; } if (currentAttack == 4) { aimHorizontalSpread = 0f; laserRange = 20f; } else { aimHorizontalSpread = 60f; laserRange = 10f; } } aimHorizontalResult = Mathf.Lerp(0f, 0f - aimHorizontalSpread, aimHorizontalCurve.Evaluate(aimHorizontalLerp)); aimHorizontalLerp += 1.5f * Time.deltaTime; aimHorizontalTarget = Quaternion.LookRotation(playerTarget.PlayerVisionTarget.VisionTransform.position - ((Component)enemy.Rigidbody).transform.position); aimHorizontalTarget = Quaternion.Euler(0f, ((Quaternion)(ref aimHorizontalTarget)).eulerAngles.y, 0f); stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Attack); } } private void StateAttack() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; if (currentAttack == 3) { stateTimer = 2f; } else { stateTimer = 0.5f; } enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); aimHorizontalLerp = 0f; } if (currentAttack == 4) { aimHorizontalResult = 0f; } else { aimHorizontalResult = Mathf.Lerp(0f - aimHorizontalSpread, aimHorizontalSpread, aimHorizontalCurve.Evaluate(aimHorizontalLerp)); } aimHorizontalLerp += aimHorizontalSpeed * Time.deltaTime; if (aimHorizontalLerp >= 1f) { stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.AttackEnd); } } } private void StateAttackEnd() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; if (currentAttack == 1) { stateTimer = 0.5f; } else { stateTimer = 2f; } enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); aimHorizontalLerp = 0f; } aimHorizontalResult = Mathf.Lerp(aimHorizontalSpread, 0f, aimHorizontalCurve.Evaluate(aimHorizontalLerp)); aimHorizontalLerp += 1.5f * Time.deltaTime; stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Seek); } } private void StateMeleeStart() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; stateTimer = 0.5f; enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); seekDestination = meleeTarget; } if (meleePlayer) { meleeTarget = ((Component)playerTarget).transform.position; seekDestination = meleeTarget; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Melee); } } private void StateMelee() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; stateTimer = 3f; enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Seek); } } private void StateSeek() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateTimer = 20f; stateImpulse = false; enemy.Rigidbody.notMovingTimer = 0f; if (Vector3.Distance(((Component)this).transform.position, seekDestination) >= 3f) { moveFast = true; if (SemiFunc.IsMultiplayer()) { photonView.RPC("MoveFastRPC", (RpcTarget)1, new object[1] { moveFast }); } } } enemy.NavMeshAgent.SetDestination(seekDestination); if (moveFast) { enemy.NavMeshAgent.OverrideAgent(enemy.NavMeshAgent.DefaultSpeed * 2f, enemy.NavMeshAgent.DefaultAcceleration * 2f, 0.1f); } if (Vector3.Distance(((Component)this).transform.position, enemy.NavMeshAgent.GetPoint()) < 1f) { LevelPoint levelPointAhead = enemy.GetLevelPointAhead(seekDestination); if (Object.op_Implicit((Object)(object)levelPointAhead)) { seekDestination = ((Component)levelPointAhead).transform.position; } if (moveFast) { moveFast = false; if (SemiFunc.IsMultiplayer()) { photonView.RPC("MoveFastRPC", (RpcTarget)1, new object[1] { moveFast }); } } } if (enemy.Rigidbody.notMovingTimer >= 3f) { AttackNearestPhysObjectOrGoToIdle(); return; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Idle); } } public void StateLeave() { //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateTimer = 999f; bool flag = false; LevelPoint val = SemiFunc.LevelPointGetPlayerDistance(((Component)this).transform.position, 30f, 50f, false); if (!Object.op_Implicit((Object)(object)val)) { val = SemiFunc.LevelPointGetFurthestFromPlayer(((Component)this).transform.position, 5f); } NavMeshHit val2 = default(NavMeshHit); if (Object.op_Implicit((Object)(object)val) && NavMesh.SamplePosition(((Component)val).transform.position + Random.insideUnitSphere * 3f, ref val2, 5f, -1) && Physics.Raycast(((NavMeshHit)(ref val2)).position, Vector3.down, 5f, LayerMask.GetMask(new string[1] { "Default" }))) { agentDestination = ((NavMeshHit)(ref val2)).position; flag = true; } if (!flag) { return; } SemiFunc.EnemyLeaveStart(enemy); enemy.Rigidbody.notMovingTimer = 0f; stateImpulse = false; } enemy.NavMeshAgent.SetDestination(agentDestination); if (Vector3.Distance(((Component)this).transform.position, enemy.NavMeshAgent.GetPoint()) < 1f) { UpdateState(State.Idle); } else if (enemy.Rigidbody.notMovingTimer >= 3f) { AttackNearestPhysObjectOrGoToIdle(); } } private void StateStun() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); } if (!enemy.IsStunned()) { UpdateState(State.Idle); } } private void StateDespawn() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); stateImpulse = false; } } public void OnSpawn() { if (SemiFunc.IsMasterClientOrSingleplayer() && SemiFunc.EnemySpawn(enemy)) { UpdateState(State.Spawn); } } public void OnVision() { //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_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_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) if (enemy.Jump.jumping) { return; } if (currentState == State.Roam || currentState == State.Idle || currentState == State.Seek || currentState == State.Leave || currentState == State.Investigate) { if ((Object)(object)playerTarget != (Object)(object)enemy.Vision.onVisionTriggeredPlayer) { playerTarget = enemy.Vision.onVisionTriggeredPlayer; if (GameManager.Multiplayer()) { photonView.RPC("UpdatePlayerTargetRPC", (RpcTarget)0, new object[1] { playerTarget.photonView.ViewID }); } } if (!playerTarget.isMoving || playerTarget.isCrouching || playerTarget.isCrawling) { UpdateState(State.Roam); } else if (Object.op_Implicit((Object)(object)playerTarget) && Vector3.Distance(((Component)this).transform.position, ((Component)playerTarget).transform.position) < 2.5f && Mathf.Abs(((Component)this).transform.position.y - ((Component)playerTarget).transform.position.y) < 1f) { meleeTarget = ((Component)playerTarget).transform.position; meleePlayer = true; UpdateState(State.MeleeStart); } else if (laserCooldown <= 0f) { UpdateState(State.AttackStart); } else { seekDestination = ((Component)playerTarget).transform.position; UpdateState(State.Seek); } } else if ((currentState == State.AttackStart || currentState == State.Attack || currentState == State.AttackEnd) && (Object)(object)playerTarget == (Object)(object)enemy.Vision.onVisionTriggeredPlayer) { seekDestination = ((Component)playerTarget).transform.position; } } public void OnInvestigate() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer() && (currentState == State.Idle || currentState == State.Roam || currentState == State.Seek || currentState == State.Investigate)) { agentDestination = enemy.StateInvestigate.onInvestigateTriggeredPosition; UpdateState(State.Investigate); } } public void OnHurt() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (Random.Range(0, 10) == 0) { anim.soundHurtSpecial.Play(((Component)anim).transform.position, 1f, 1f, 1f, 1f); } else { anim.soundHurt.Play(((Component)anim).transform.position, 1f, 1f, 1f, 1f); } anim.soundHurtPauseTimer = 0.5f; if (SemiFunc.IsMasterClientOrSingleplayer() && currentState == State.Leave) { UpdateState(State.Idle); } } public void OnDeath() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) anim.soundDeath.Play(((Component)anim).transform.position, 1f, 1f, 1f, 1f); GameDirector.instance.CameraShake.ShakeDistance(3f, 3f, 10f, enemy.CenterTransform.position, 0.5f); GameDirector.instance.CameraImpact.ShakeDistance(3f, 3f, 10f, enemy.CenterTransform.position, 0.05f); ((Component)particleDeathSmoke).transform.position = enemy.CenterTransform.position; particleDeathSmoke.Play(); ((Component)particleDeathBody).transform.position = enemy.CenterTransform.position; particleDeathBody.Play(); ((Component)particleDeathNose).transform.position = laserStartTransform.position; particleDeathNose.Play(); ((Component)particleDeathHat).transform.position = hatTransform.position; particleDeathHat.Play(); if (SemiFunc.IsMasterClientOrSingleplayer()) { enemy.EnemyParent.Despawn(); } } private void UpdateState(State _state) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (_state != currentState) { currentState = _state; stateImpulse = true; stateTimer = 0f; if (GameManager.Multiplayer()) { photonView.RPC("UpdateStateRPC", (RpcTarget)0, new object[1] { currentState }); } else { UpdateStateRPC(currentState); } } } private void AttackNearestPhysObjectOrGoToIdle() { //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_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) meleeTarget = SemiFunc.EnemyGetNearestPhysObject(enemy); if (meleeTarget != Vector3.zero) { meleePlayer = false; UpdateState(State.Melee); } else { enemy.Jump.StuckReset(); UpdateState(State.Idle); } } private void RotationLogic() { //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) if (currentState == State.AttackStart || currentState == State.Attack || currentState == State.AttackEnd) { if (currentAttack == 2) { float num = 15f * Mathf.Sin(Time.time * 10f); horizontalRotationTarget = Quaternion.Euler(((Quaternion)(ref aimHorizontalTarget)).eulerAngles.x + num, ((Quaternion)(ref aimHorizontalTarget)).eulerAngles.y + aimHorizontalResult, ((Quaternion)(ref aimHorizontalTarget)).eulerAngles.z); } else if (currentAttack == 3) { rotator += 3f; horizontalRotationTarget = Quaternion.Euler(((Quaternion)(ref aimHorizontalTarget)).eulerAngles.x, ((Quaternion)(ref aimHorizontalTarget)).eulerAngles.y + rotator, ((Quaternion)(ref aimHorizontalTarget)).eulerAngles.z); } else { horizontalRotationTarget = Quaternion.Euler(((Quaternion)(ref aimHorizontalTarget)).eulerAngles.x, ((Quaternion)(ref aimHorizontalTarget)).eulerAngles.y + aimHorizontalResult, ((Quaternion)(ref aimHorizontalTarget)).eulerAngles.z); } } else if (currentState == State.MeleeStart) { if (Vector3.Distance(meleeTarget, ((Component)enemy.Rigidbody).transform.position) > 0.1f) { horizontalRotationTarget = Quaternion.LookRotation(meleeTarget - ((Component)enemy.Rigidbody).transform.position); ((Quaternion)(ref horizontalRotationTarget)).eulerAngles = new Vector3(0f, ((Quaternion)(ref horizontalRotationTarget)).eulerAngles.y, 0f); } } else { Vector3 normalized = ((Vector3)(ref enemy.NavMeshAgent.AgentVelocity)).normalized; if (((Vector3)(ref normalized)).magnitude > 0.1f) { horizontalRotationTarget = Quaternion.LookRotation(((Vector3)(ref enemy.NavMeshAgent.AgentVelocity)).normalized); ((Quaternion)(ref horizontalRotationTarget)).eulerAngles = new Vector3(0f, ((Quaternion)(ref horizontalRotationTarget)).eulerAngles.y, 0f); } } if (currentState == State.Spawn || currentState == State.Idle || currentState == State.Roam || currentState == State.Investigate || currentState == State.Leave) { horizontalRotationSpring.speed = 5f; horizontalRotationSpring.damping = 0.7f; } else if (currentState == State.AttackStart || currentState == State.Attack || currentState == State.AttackEnd) { horizontalRotationSpring.speed = 15f; if (currentAttack == 3) { horizontalRotationSpring.speed = 5f; } horizontalRotationSpring.damping = 0.8f; } else { horizontalRotationSpring.speed = 10f; horizontalRotationSpring.damping = 0.8f; } ((Component)this).transform.rotation = SemiFunc.SpringQuaternionGet(horizontalRotationSpring, horizontalRotationTarget, -1f); } private void VerticalAimLogic() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) if (currentState != State.AttackStart && currentState != State.Attack && currentState != State.AttackEnd) { aimVerticalTarget = Quaternion.identity; } else if (currentState == State.AttackStart || (currentState != State.Attack && aimHorizontalLerp < 0.1f)) { Quaternion val = Quaternion.LookRotation(playerTarget.PlayerVisionTarget.VisionTransform.position - laserRayTransform.position); if (aimVerticalTarget == Quaternion.identity) { aimVerticalTarget = val; } else { aimVerticalTarget = Quaternion.Lerp(aimVerticalTarget, val, 2f * Time.deltaTime); } Quaternion rotation = laserRayTransform.rotation; laserRayTransform.rotation = aimVerticalTarget; aimVerticalTarget = laserRayTransform.localRotation; aimVerticalTarget = Quaternion.Euler(laserRayTransform.eulerAngles.x, 0f, 0f); laserRayTransform.rotation = rotation; } aimVerticalTransform.localRotation = Quaternion.Lerp(aimVerticalTransform.localRotation, aimVerticalTarget, 20f * Time.deltaTime); laserRayTransform.localRotation = aimVerticalTarget; } private void LaserLogic() { //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: 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_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_017b: 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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) if (currentState != State.Attack && currentState != State.AttackStart && currentState != State.AttackEnd) { laserCooldown -= Time.deltaTime; } if (currentState == State.Attack) { laserCooldown = 3f; if (SemiFunc.IsMasterClientOrSingleplayer()) { Transform val = laserStartTransform; Vector3 val2 = laserRayTransform.position - laserStartTransform.position; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(laserStartTransform.position, val2, ref val3, ((Vector3)(ref val2)).magnitude, LayerMask.GetMask(new string[1] { "Default" }))) { val = laserRayTransform; } else if (Physics.OverlapSphere(laserStartTransform.position, 0.25f, LayerMask.GetMask(new string[1] { "Default" })).Length != 0) { val = laserRayTransform; } if (hitPositionTimer <= 0f) { hitPositionTimer = 0.05f; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val.position, val.forward, ref val4, laserRange, LayerMask.GetMask(new string[1] { "Default" }))) { hitPosition = ((RaycastHit)(ref val4)).point; hitPositionImpact = true; } else { hitPosition = val.position + val.forward * laserRange; hitPositionImpact = false; } } else { hitPositionTimer -= Time.deltaTime; } hitPositionSmooth = Vector3.Lerp(hitPositionSmooth, hitPosition, 20f * Time.deltaTime); } else { hitPositionSmooth = Vector3.MoveTowards(hitPositionSmooth, hitPosition, hitPositionClientDistance * Time.deltaTime * ((float)PhotonNetwork.SerializationRate * 0.8f)); } if (hitPositionStartImpulse) { hitPositionSmooth = hitPosition; hitPositionStartImpulse = false; } Vector3 val5 = laserRayTransform.position - hitPosition; Vector3 val6 = laserRayTransform.position - hitPositionSmooth; if (((Vector3)(ref val5)).magnitude < ((Vector3)(ref val6)).magnitude) { val6 = Vector3.ClampMagnitude(val6, ((Vector3)(ref val5)).magnitude); hitPositionSmooth = laserRayTransform.position - val6; } laser.LaserActive(laserStartTransform.position, hitPositionSmooth, hitPositionImpact); } else { hitPositionTimer = 0f; hitPositionStartImpulse = true; } } private void MoveFastLogic() { if (currentState != State.Seek && moveFast) { moveFast = false; if (SemiFunc.IsMultiplayer()) { photonView.RPC("MoveFastRPC", (RpcTarget)1, new object[1] { moveFast }); } } } [PunRPC] private void UpdateStateRPC(State _state, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { currentState = _state; } } [PunRPC] private void UpdatePlayerTargetRPC(int _photonViewID, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.MasterOnlyRPC(_info)) { return; } foreach (PlayerAvatar item in SemiFunc.PlayerGetList()) { if (item.photonView.ViewID == _photonViewID) { playerTarget = item; break; } } } [PunRPC] private void MeleeTriggerRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { anim.meleeImpulse = true; } } [PunRPC] private void MoveFastRPC(bool _moveFast, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { moveFast = _moveFast; } } public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(info)) { if (stream.IsWriting) { stream.SendNext((object)aimVerticalTarget); stream.SendNext((object)hitPosition); stream.SendNext((object)hitPositionImpact); } else { aimVerticalTarget = (Quaternion)stream.ReceiveNext(); hitPosition = (Vector3)stream.ReceiveNext(); hitPositionImpact = (bool)stream.ReceiveNext(); hitPositionClientDistance = Vector3.Distance(hitPositionSmooth, hitPosition); } } } } public class PayayoAnim : MonoBehaviour { public Enemy enemy; public Payayo controller; public bool noseEmission; private Animator animator; private int animSpawn = Animator.StringToHash("spawn"); private int animDespawning = Animator.StringToHash("despawning"); private int animStun = Animator.StringToHash("stun"); private int animStunned = Animator.StringToHash("stunned"); private int animMoving = Animator.StringToHash("moving"); private int animMovingFast = Animator.StringToHash("movingFast"); private int animJump = Animator.StringToHash("jump"); private int animFalling = Animator.StringToHash("falling"); private int animLand = Animator.StringToHash("land"); private int animMelee = Animator.StringToHash("melee"); private int animAttacking = Animator.StringToHash("attacking"); private int animAttack = Animator.StringToHash("attack"); public float springSpeedMultiplier; public float springDampingMultiplier; [Space] public SpringQuaternion springNose01; private float springNose01Speed; private float springNose01Damping; public Transform springNose01Target; public Transform springNose01Source; public SpringQuaternion springNose02; private float springNose02Speed; private float springNose02Damping; public Transform springNose02Target; public Transform springNose02Source; public SpringQuaternion springNose03; private float springNose03Speed; private float springNose03Damping; public Transform springNose03Target; public Transform springNose03Source; private float moveTimer; private bool spawnImpulse = true; private bool stunImpulse = true; private bool stunEndImpulse; private bool jumpImpulse = true; private bool landImpulse = true; internal bool meleeImpulse = true; private bool attackImpulse = true; private Color emissionColor = Color.black; private Color emissionColorPrevious = Color.black; internal MaterialTrigger material = new MaterialTrigger(); internal float soundHurtPauseTimer; public Sound soundMoveShort; public Sound soundMoveLong; [Space] public Sound soundFootstepSmall; public Sound soundFootstepBig; public Sound soundFootstepHuge; [Space] public Sound soundStunIntro; public Sound soundStunLoop; public Sound soundStunOutro; [Space] public Sound soundJump; public Sound soundLand; [Space] public Sound soundMeleeTell; public Sound soundMeleeKick; [Space] public bool soundAttackLoopActive; public Sound soundAttackIntro; public Sound soundAttackShort; public Sound soundAttackLong; private bool soundAttackPlayed; public AudioSource soundAttackSource; public Sound soundAttackOutro; [Space] public Sound soundHurt; public Sound soundHurtSpecial; public Sound soundDeath; public Sound idleSounds; private void Awake() { animator = ((Component)this).GetComponent(); animator.keepAnimatorStateOnDisable = true; springNose01Speed = springNose01.speed; springNose01Damping = springNose01.damping; springNose02Speed = springNose02.speed; springNose02Damping = springNose02.damping; springNose03Speed = springNose03.speed; springNose03Damping = springNose03.damping; } private void Update() { //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: 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_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_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_01ec: 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_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) if (enemy.Rigidbody.frozen) { animator.speed = 0f; } else { animator.speed = 1f; } if (controller.currentState == Payayo.State.Stun) { if (stunImpulse) { soundStunIntro.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); animator.SetTrigger(animStun); stunImpulse = false; } animator.SetBool(animStunned, true); if (soundHurtPauseTimer > 0f) { soundStunLoop.PlayLoop(false, 5f, 5f, 1f, 1f); } else { soundStunLoop.PlayLoop(true, 5f, 5f, 1f, 1f); } stunEndImpulse = true; } else { if (stunEndImpulse) { soundStunOutro.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); stunEndImpulse = false; } animator.SetBool(animStunned, false); soundStunLoop.PlayLoop(false, 5f, 5f, 1f, 1f); stunImpulse = true; } if (noseEmission) { emissionColor = Color.Lerp(emissionColor, Color.white, Time.deltaTime * 10f); } else { emissionColor = Color.Lerp(emissionColor, Color.black, Time.deltaTime * 10f); } if (emissionColor != emissionColorPrevious) { emissionColorPrevious = emissionColor; enemy.Health.instancedMaterials[0].SetColor("_EmissionColor", emissionColor); } if (SemiFunc.IsMasterClientOrSingleplayer()) { if (!enemy.Jump.jumping && !enemy.IsStunned() && (controller.currentState == Payayo.State.MeleeStart || controller.currentState == Payayo.State.Melee)) { if (meleeImpulse) { if (SemiFunc.IsMultiplayer()) { controller.photonView.RPC("MeleeTriggerRPC", (RpcTarget)1, Array.Empty()); } animator.SetTrigger(animMelee); meleeImpulse = false; } } else { meleeImpulse = true; } } else if (meleeImpulse) { animator.SetTrigger(animMelee); meleeImpulse = false; } if (controller.currentState == Payayo.State.AttackStart || controller.currentState == Payayo.State.Attack) { if (attackImpulse) { attackImpulse = false; animator.SetTrigger(animAttack); } animator.SetBool(animAttacking, true); } else { attackImpulse = true; animator.SetBool(animAttacking, false); } if (controller.currentState == Payayo.State.Attack) { if (!soundAttackPlayed) { if (controller.currentAttack == 3) { soundAttackLong.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } else { soundAttackShort.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } soundAttackPlayed = true; } } else { soundAttackPlayed = false; } if ((controller.currentState == Payayo.State.Roam || controller.currentState == Payayo.State.Investigate || controller.currentState == Payayo.State.Seek || controller.currentState == Payayo.State.Leave) && (((Vector3)(ref enemy.Rigidbody.velocity)).magnitude > 0.5f || ((Vector3)(ref enemy.Rigidbody.physGrabObject.rbAngularVelocity)).magnitude > 5f)) { moveTimer = 0.25f; } if (moveTimer > 0f) { moveTimer -= Time.deltaTime; animator.SetBool(animMoving, true); } else { animator.SetBool(animMoving, false); } animator.SetBool(animMovingFast, controller.moveFast); if (enemy.Jump.jumping || enemy.Jump.jumpingDelay) { if (jumpImpulse) { if (!enemy.IsStunned()) { animator.SetTrigger(animJump); } animator.SetBool(animFalling, false); jumpImpulse = false; landImpulse = true; } else if (controller.enemy.Rigidbody.physGrabObject.rbVelocity.y < -0.5f) { animator.SetBool(animFalling, true); } } else { if (landImpulse) { if (!enemy.IsStunned()) { animator.SetTrigger(animLand); } moveTimer = 0f; landImpulse = false; } animator.SetBool(animFalling, false); jumpImpulse = true; } if (controller.currentState == Payayo.State.Spawn) { if (spawnImpulse) { spawnImpulse = false; animator.SetTrigger(animSpawn); } } else { spawnImpulse = true; } if (controller.currentState == Payayo.State.Despawn) { animator.SetBool(animDespawning, true); } else { animator.SetBool(animDespawning, false); } if (soundHurtPauseTimer > 0f) { soundHurtPauseTimer -= Time.deltaTime; } } public void Despawn() { enemy.EnemyParent.Despawn(); } public void FootstepSmall() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) soundFootstepSmall.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); Materials.Instance.Impulse(enemy.Rigidbody.physGrabObject.centerPoint + Vector3.down * 0.5f, Vector3.down, (SoundType)0, false, false, material, (HostType)2); } public void FootstepBig() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_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) GameDirector.instance.CameraShake.ShakeDistance(2f, 5f, 10f, ((Component)this).transform.position, 0.25f); GameDirector.instance.CameraImpact.ShakeDistance(2f, 5f, 10f, ((Component)this).transform.position, 0.1f); soundFootstepBig.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); Materials.Instance.Impulse(enemy.Rigidbody.physGrabObject.centerPoint + Vector3.down * 0.5f, Vector3.down, (SoundType)2, false, false, material, (HostType)2); } public void FootstepHuge() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_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) GameDirector.instance.CameraShake.ShakeDistance(2.5f, 5f, 15f, ((Component)this).transform.position, 0.25f); GameDirector.instance.CameraImpact.ShakeDistance(2.5f, 5f, 15f, ((Component)this).transform.position, 0.1f); soundFootstepHuge.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); Materials.Instance.Impulse(enemy.Rigidbody.physGrabObject.centerPoint + Vector3.down * 0.5f, Vector3.down, (SoundType)2, false, false, material, (HostType)2); } public void Jump() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ef: Unknown result type (might be due to invalid IL or missing references) ((Component)controller.particleBottomSmoke).transform.position = controller.bottomTransform.position; controller.particleBottomSmoke.Play(); soundJump.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); GameDirector.instance.CameraShake.ShakeDistance(5f, 5f, 10f, ((Component)this).transform.position, 0.5f); GameDirector.instance.CameraImpact.ShakeDistance(5f, 5f, 10f, ((Component)this).transform.position, 0.1f); Materials.Instance.Impulse(enemy.Rigidbody.physGrabObject.centerPoint + Vector3.down * 0.5f, Vector3.down, (SoundType)2, false, false, material, (HostType)2); } public void Land() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ef: Unknown result type (might be due to invalid IL or missing references) ((Component)controller.particleBottomSmoke).transform.position = controller.bottomTransform.position; controller.particleBottomSmoke.Play(); soundLand.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); GameDirector.instance.CameraShake.ShakeDistance(5f, 5f, 10f, ((Component)this).transform.position, 0.5f); GameDirector.instance.CameraImpact.ShakeDistance(5f, 5f, 10f, ((Component)this).transform.position, 0.1f); Materials.Instance.Impulse(enemy.Rigidbody.physGrabObject.centerPoint + Vector3.down * 0.5f, Vector3.down, (SoundType)2, false, false, material, (HostType)2); } public void MoveShort() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) soundMoveShort.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void MoveLong() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) soundMoveLong.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void MeleeTell() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) soundMeleeTell.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void MeleeKick() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) soundMeleeKick.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void AttackIntro() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) soundAttackIntro.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void AttackOutro() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) soundAttackOutro.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } public class PibePlateadoAnim : MonoBehaviour { public Enemy enemy; public PibePlateado enemyBirthdayBoy; [HideInInspector] public Animator animator; public Transform leftEyePivot; public Transform rightEyePivot; public PlayerAvatar lookTarget; public Rigidbody rb; public Transform headPivot; public SpringQuaternion topHairRightSpring = new SpringQuaternion(); public Transform topHairRightTransform; public Transform topHairRightTarget; [Space] public SpringQuaternion topHairLeftSpring = new SpringQuaternion(); public Transform topHairLeftTransform; public Transform topHairLeftTarget; [Space] public SpringQuaternion sideHairLeftSpring = new SpringQuaternion(); public Transform sideHairLeftTransform; public Transform sideHairLeftTarget; [Space] public SpringQuaternion sideHairRightSpring = new SpringQuaternion(); public Transform sideHairRightTransform; public Transform sideHairRightTarget; [Space] public SpringQuaternion middleHairSpring = new SpringQuaternion(); public Transform middleHairTransform; public Transform middleHairTarget; [Space] public SpringQuaternion BackHairSpring = new SpringQuaternion(); public Transform BackHairTransform; public Transform BackHairTarget; public ParticleSystem spawnSmokeParticle; public ParticleSystem runningSpitParticle; public ParticleSystem balloonPopParticle; public GameObject deathParticlePrefab; public ParticleSystem droolParticle; public ParticleSystem runningSmokeParticle; internal MaterialTrigger material = new MaterialTrigger(); private bool noticed; private bool floating; public bool breaker; private Quaternion prevHeadLookRotation; private Quaternion prevRigidBodyRotation; private float moveSoundRigidBodyTimer; private float moveSoundHeadTimer; public Sound footStepSound; public Sound footStepGlobalSound; public Sound footStepHardSound; public Sound balloonSqueakSound; public Sound moveLightSound; public Sound moveHeavySound; public Sound balloonPopSound; public Sound balloonBlowSound; public Sound balloonTieSound; [Space] public Sound deathSound; public Sound hurtSound; public Sound idleLoop; public Sound runLoop; public Sound aggroLoop; public Sound idleBreaker; public List idleBreakers; public Sound attackSwoosh; public Sound jumpSound; public Sound landSound; public Sound inhaleSound; public Sound noticeSound; public Sound crackSound; public Sound balloonPopGlobal; private static readonly int animDespawn = Animator.StringToHash("despawn"); private static readonly int animDespawnTrigger = Animator.StringToHash("despawn_trigger"); private static readonly int animFloat = Animator.StringToHash("float"); private static readonly int animFloatTrigger = Animator.StringToHash("float_trigger"); private void Awake() { animator = ((Component)this).GetComponent(); animator.keepAnimatorStateOnDisable = true; } private void LateUpdate() { //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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) if (enemyBirthdayBoy.currentState == PibePlateado.State.CreepyStare || enemyBirthdayBoy.currentState == PibePlateado.State.Attack || enemyBirthdayBoy.currentState == PibePlateado.State.AttackOver || enemyBirthdayBoy.currentState == PibePlateado.State.AttackUnder) { PlayerAvatar val = ((!Object.op_Implicit((Object)(object)enemyBirthdayBoy.playerTarget)) ? lookTarget : enemyBirthdayBoy.playerTarget); if (Object.op_Implicit((Object)(object)val)) { Vector3 val2 = ((!SemiFunc.IsMultiplayer() || val.isLocal) ? ((Component)val.localCamera).transform.position : val.playerAvatarVisuals.headLookAtTransform.position); val2.y -= 0.3f; Quaternion rotation = Quaternion.LookRotation(val2 - leftEyePivot.position, Vector3.up); leftEyePivot.rotation = rotation; Quaternion rotation2 = Quaternion.LookRotation(val2 - rightEyePivot.position, Vector3.up); rightEyePivot.rotation = rotation2; } } else { leftEyePivot.localRotation = Quaternion.Slerp(leftEyePivot.localRotation, Quaternion.identity, Time.deltaTime * 5f); rightEyePivot.localRotation = Quaternion.Slerp(rightEyePivot.localRotation, Quaternion.identity, Time.deltaTime * 5f); } } private void Update() { //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Invalid comparison between Unknown and I4 TurnSoundLogic(); AnimateSprings(); bool flag = enemyBirthdayBoy.AttackState() || enemyBirthdayBoy.currentState == PibePlateado.State.GoToPlayerAngry || enemyBirthdayBoy.currentState == PibePlateado.State.GoToBalloonAngry; bool flag2 = (((Vector3)(ref enemy.Rigidbody.velocity)).magnitude > 0.1f || ((Vector3)(ref enemy.Rigidbody.physGrabObject.rbAngularVelocity)).magnitude > 0.5f || enemy.IsStunned()) && enemyBirthdayBoy.currentState != PibePlateado.State.Idle && enemyBirthdayBoy.currentState != PibePlateado.State.PlaceBalloon && !flag; bool flag3 = enemyBirthdayBoy.currentState != PibePlateado.State.PlaceBalloon && enemyBirthdayBoy.currentState != PibePlateado.State.PlayerNotice && enemyBirthdayBoy.currentState != PibePlateado.State.Despawn && !flag && !flag2 && !breaker; runLoop.PlayLoop(flag2, 1f, 1f, 1f, 1f); idleLoop.PlayLoop(flag3, 1f, 1f, 1f, 1f); aggroLoop.PlayLoop(flag, 1f, 1f, 1f, 1f); if (flag2 || enemyBirthdayBoy.currentState == PibePlateado.State.GoToPlayerAngry || enemyBirthdayBoy.currentState == PibePlateado.State.GoToBalloonAngry) { animator.SetBool("move", true); } else { animator.SetBool("move", false); } if (enemyBirthdayBoy.currentState == PibePlateado.State.Attack && ((Vector3)(ref enemy.Rigidbody.velocity)).magnitude > 1f && !enemy.Jump.jumping && !enemy.Jump.jumpingDelay && !enemy.Jump.landDelay) { if (!runningSmokeParticle.isPlaying) { runningSmokeParticle.Play(true); } } else if (runningSmokeParticle.isPlaying) { runningSmokeParticle.Stop(true); } if (enemyBirthdayBoy.currentState == PibePlateado.State.Attack) { if (!runningSpitParticle.isPlaying) { runningSpitParticle.Play(); } } else if (runningSpitParticle.isPlaying) { runningSpitParticle.Stop(); } if (enemyBirthdayBoy.currentState == PibePlateado.State.Attack || enemyBirthdayBoy.currentState == PibePlateado.State.AttackUnder || enemyBirthdayBoy.currentState == PibePlateado.State.AttackOver) { animator.SetBool("attack", true); } else { animator.SetBool("attack", false); } if (enemy.IsStunned()) { animator.SetBool("stun", true); } else { animator.SetBool("stun", false); } if (!enemy.IsStunned() && (enemy.Jump.jumping || enemy.Jump.jumpingDelay)) { animator.SetBool("jump", true); } else { animator.SetBool("jump", false); } if (enemyBirthdayBoy.currentState == PibePlateado.State.AttackUnderStart || enemyBirthdayBoy.currentState == PibePlateado.State.AttackUnder || enemyBirthdayBoy.currentState == PibePlateado.State.AttackUnderEnd) { animator.SetBool("crawl", true); } else { animator.SetBool("crawl", false); } if (enemyBirthdayBoy.currentState == PibePlateado.State.PlayerNotice && !noticed) { animator.SetTrigger("player_notice"); noticed = true; } else if (enemyBirthdayBoy.currentState != PibePlateado.State.PlayerNotice) { noticed = false; } if (enemyBirthdayBoy.currentState == PibePlateado.State.FlyBackUp || enemyBirthdayBoy.currentState == PibePlateado.State.FlyBackToNavMesh) { if (!animator.GetBool(animFloat)) { animator.SetTrigger(animFloatTrigger); } animator.SetBool(animFloat, true); } else { animator.SetBool(animFloat, false); } if (enemyBirthdayBoy.currentState == PibePlateado.State.Despawn || (int)enemy.CurrentState == 11) { if (!animator.GetBool(animDespawn)) { animator.ResetTrigger(animFloatTrigger); animator.ResetTrigger("stun_trigger"); droolParticle.Stop(); spawnSmokeParticle.Play(); animator.SetTrigger(animDespawnTrigger); } animator.SetBool(animDespawn, true); } else { animator.SetBool(animDespawn, false); if (!droolParticle.isPlaying) { droolParticle.Play(); } } } private void AnimateSprings() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) topHairRightTransform.rotation = SemiFunc.SpringQuaternionGet(topHairRightSpring, topHairRightTarget.rotation, -1f); topHairLeftTransform.rotation = SemiFunc.SpringQuaternionGet(topHairLeftSpring, topHairLeftTarget.rotation, -1f); sideHairLeftTransform.rotation = SemiFunc.SpringQuaternionGet(sideHairLeftSpring, sideHairLeftTarget.rotation, -1f); sideHairRightTransform.rotation = SemiFunc.SpringQuaternionGet(sideHairRightSpring, sideHairRightTarget.rotation, -1f); middleHairTransform.rotation = SemiFunc.SpringQuaternionGet(middleHairSpring, middleHairTarget.rotation, -1f); BackHairTransform.rotation = SemiFunc.SpringQuaternionGet(BackHairSpring, BackHairTarget.rotation, -1f); } public void BlowBalloonAnimationTrigger() { animator.SetTrigger("blow_balloon_trigger"); } public void DoneWithBalloonBlow() { enemyBirthdayBoy.OnBalloonBlowComplete(); } public void StoreBalloonLocation() { enemyBirthdayBoy.StoreBalloonLocation(); } public void SetBlowingFalse() { enemyBirthdayBoy.blowing = false; } public void SetBlowingTrue() { enemyBirthdayBoy.blowing = true; } public void SetSpawn() { animator.Play("Birthday Boy - Spawn", 0, 0f); spawnSmokeParticle.Play(); } public void SetDespawn() { enemy.EnemyParent.Despawn(); } public void CrouchedDown() { enemyBirthdayBoy.CrouchedDown(); } public void FootStepSound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) footStepSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); MaterialSound(); if (enemyBirthdayBoy.AttackState()) { footStepSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); footStepHardSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } public void MoveLightSound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) moveLightSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void MoveHeavySound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) moveHeavySound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void BalloonSqueakSound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) balloonSqueakSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void InterruptBalloonPop() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) balloonPopParticle.Play(true); balloonPopSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void BalloonBloWSound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) balloonBlowSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void BalloonTieSound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) balloonTieSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } private void MaterialSound() { //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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Materials.Instance.Impulse(enemy.Rigidbody.physGrabObject.centerPoint + Vector3.down * 0.5f, Vector3.down, (SoundType)0, true, true, material, (HostType)2); } private void TurnSoundLogic() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.PerSecond(5f, (Object)(object)this)) { if (Quaternion.Angle(prevHeadLookRotation, headPivot.rotation) > 30f && moveSoundHeadTimer <= 0f) { moveLightSound.Play(headPivot.position, 1f, 1f, 1f, 1f); prevHeadLookRotation = headPivot.rotation; moveSoundHeadTimer = 0.2f; } if (Quaternion.Angle(prevRigidBodyRotation, rb.rotation) > 20f && moveSoundRigidBodyTimer <= 0f) { moveSoundRigidBodyTimer = 0.5f; moveHeavySound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); prevRigidBodyRotation = rb.rotation; } prevHeadLookRotation = headPivot.rotation; prevRigidBodyRotation = rb.rotation; } if (moveSoundRigidBodyTimer > 0f) { moveSoundRigidBodyTimer -= Time.deltaTime; } if (moveSoundHeadTimer > 0f) { moveSoundHeadTimer -= Time.deltaTime; } } public void PlayDeathParticles() { //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) Object.Instantiate(deathParticlePrefab, ((Component)this).transform.position, Quaternion.identity).GetComponent().Play(true); } public void AttackSwoosh() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) attackSwoosh.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void JumpSound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) jumpSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void LandSound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) landSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void InhaleSound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) inhaleSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void NoticeSound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) noticeSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } public void CrackSound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) crackSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } public class ÑacaÑaca : MonoBehaviour { public enum State { Spawn, Idle, Roam, Investigate, PlayerNotice, PlayerGoTo, PlayerPickup, PlayerMove, PlayerRelease, PlayerReleaseWait, Leave, Stun, StunEnd, Despawn } [Space] public State currentState; private bool stateImpulse; private float stateTimer; [Space] public Enemy enemy; public ÑacaÑacaAnim enemyHiddenAnim; private PhotonView photonView; [Space] public Transform playerPickupTransform; public AnimationCurve playerPickupCurveUp; public AnimationCurve playerPickupCurveSide; private float playerPickupLerpUp; private float playerPickupLerpSide; private Vector3 playerPickupPositionOriginal; [Space] public SpringQuaternion rotationSpring; private Quaternion rotationTarget; private Vector3 agentDestination; private PlayerAvatar playerTarget; private bool agentSet; private float grabAggroTimer; private float maxMoveTimer; private void Awake() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) photonView = ((Component)this).GetComponent(); playerPickupPositionOriginal = playerPickupTransform.localPosition; } private void Update() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Invalid comparison between Unknown and I4 if (SemiFunc.IsMasterClientOrSingleplayer()) { if (grabAggroTimer > 0f) { grabAggroTimer -= Time.deltaTime; } RotationLogic(); PlayerPickupTransformLogic(); if (enemy.IsStunned()) { UpdateState(State.Stun); } if ((int)enemy.CurrentState == 11 && !enemy.IsStunned()) { UpdateState(State.Despawn); } switch (currentState) { case State.Spawn: StateSpawn(); break; case State.Idle: StateIdle(); break; case State.Roam: StateRoam(); break; case State.Investigate: StateInvestigate(); break; case State.PlayerNotice: StatePlayerNotice(); break; case State.PlayerGoTo: StatePlayerGoTo(); break; case State.PlayerPickup: StatePlayerPickup(); break; case State.PlayerMove: StatePlayerMove(); break; case State.PlayerRelease: StatePlayerRelease(); break; case State.PlayerReleaseWait: StatePlayerReleaseWait(); break; case State.Leave: StateLeave(); break; case State.Stun: StateStun(); break; case State.StunEnd: StateStunEnd(); break; case State.Despawn: StateDespawn(); break; } } } private void FixedUpdate() { PlayerTumbleLogic(); } private void StateSpawn() { if (stateImpulse) { stateImpulse = false; stateTimer = 1f; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Idle); } } private void StateIdle() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; stateTimer = Random.Range(2f, 5f); enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); } if (!SemiFunc.EnemySpawnIdlePause()) { stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Roam); } if (SemiFunc.EnemyForceLeave(enemy)) { UpdateState(State.Leave); } } } private void StateRoam() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; stateTimer = 5f; bool flag = false; LevelPoint val = SemiFunc.LevelPointGet(((Component)this).transform.position, 10f, 25f); if (!Object.op_Implicit((Object)(object)val)) { val = SemiFunc.LevelPointGet(((Component)this).transform.position, 0f, 999f); } NavMeshHit val2 = default(NavMeshHit); if (Object.op_Implicit((Object)(object)val) && NavMesh.SamplePosition(((Component)val).transform.position + Random.insideUnitSphere * 3f, ref val2, 5f, -1) && Physics.Raycast(((NavMeshHit)(ref val2)).position, Vector3.down, 5f, LayerMask.GetMask(new string[1] { "Default" }))) { enemy.NavMeshAgent.SetDestination(((NavMeshHit)(ref val2)).position); flag = true; } if (!flag) { return; } enemy.Rigidbody.notMovingTimer = 0f; } else { SemiFunc.EnemyCartJump(enemy); if (enemy.Rigidbody.notMovingTimer > 2f) { stateTimer -= Time.deltaTime; } if (stateTimer <= 0f || !enemy.NavMeshAgent.HasPath()) { SemiFunc.EnemyCartJumpReset(enemy); UpdateState(State.Idle); } } if (SemiFunc.EnemyForceLeave(enemy)) { UpdateState(State.Leave); } } private void StateInvestigate() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateTimer = 5f; enemy.Rigidbody.notMovingTimer = 0f; stateImpulse = false; } else { enemy.NavMeshAgent.SetDestination(agentDestination); SemiFunc.EnemyCartJump(enemy); if (enemy.Rigidbody.notMovingTimer > 2f) { stateTimer -= Time.deltaTime; } if (stateTimer <= 0f || !enemy.NavMeshAgent.HasPath()) { SemiFunc.EnemyCartJumpReset(enemy); UpdateState(State.Idle); } } if (SemiFunc.EnemyForceLeave(enemy)) { UpdateState(State.Leave); } } private void StatePlayerNotice() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); enemy.NavMeshAgent.ResetPath(); stateImpulse = false; stateTimer = 2f; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.PlayerGoTo); } } private void StatePlayerGoTo() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; stateTimer = 2f; agentSet = true; } stateTimer -= Time.deltaTime; if (!Object.op_Implicit((Object)(object)playerTarget) || playerTarget.isDisabled || stateTimer <= 0f) { UpdateState(State.Leave); return; } SemiFunc.EnemyCartJump(enemy); if (enemy.Jump.jumping) { enemy.NavMeshAgent.Disable(0.5f); ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, ((Component)playerTarget).transform.position, 5f * Time.deltaTime); agentSet = true; } else if (!enemy.NavMeshAgent.IsDisabled()) { if (!agentSet && enemy.NavMeshAgent.HasPath() && Vector3.Distance(((Component)enemy.Rigidbody).transform.position + Vector3.down * 0.75f, enemy.NavMeshAgent.GetDestination()) < 0.25f) { enemy.Jump.StuckTrigger(((Component)enemy.Rigidbody).transform.position - ((Component)playerTarget).transform.position); } enemy.NavMeshAgent.SetDestination(((Component)playerTarget).transform.position); enemy.NavMeshAgent.OverrideAgent(5f, 10f, 0.25f); agentSet = false; } if (Vector3.Distance(((Component)enemy.Rigidbody).transform.position, ((Component)playerTarget).transform.position) < 1.5f) { SemiFunc.EnemyCartJumpReset(enemy); UpdateState(State.PlayerPickup); } } private void StatePlayerPickup() { if (stateImpulse) { stateImpulse = false; stateTimer = 1f; } if (!Object.op_Implicit((Object)(object)playerTarget) || playerTarget.isDisabled) { UpdateState(State.Leave); return; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.PlayerMove); } } private void StatePlayerMove() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateTimer = 5f; maxMoveTimer = 15f; bool flag = false; LevelPoint val = SemiFunc.LevelPointGetPlayerDistance(((Component)this).transform.position, 50f, 999f, false); if (!Object.op_Implicit((Object)(object)val)) { val = SemiFunc.LevelPointGetFurthestFromPlayer(((Component)this).transform.position, 5f); } NavMeshHit val2 = default(NavMeshHit); if (Object.op_Implicit((Object)(object)val) && NavMesh.SamplePosition(((Component)val).transform.position + Random.insideUnitSphere * 3f, ref val2, 5f, -1) && Physics.Raycast(((NavMeshHit)(ref val2)).position, Vector3.down, 5f, LayerMask.GetMask(new string[1] { "Default" }))) { agentDestination = ((NavMeshHit)(ref val2)).position; flag = true; } if (!flag) { stateTimer = 0f; } stateImpulse = false; } if (enemy.Rigidbody.notMovingTimer > 2f) { stateTimer -= Time.deltaTime; } if (!Object.op_Implicit((Object)(object)playerTarget) || playerTarget.isDisabled) { UpdateState(State.Leave); return; } enemy.NavMeshAgent.SetDestination(agentDestination); SemiFunc.EnemyCartJump(enemy); enemy.NavMeshAgent.OverrideAgent(10f, 15f, 0.1f); enemy.Rigidbody.OverrideFollowPosition(0.1f, 15f, 30f); enemy.Jump.GapJumpOverride(0.1f, 20f, 20f); maxMoveTimer -= Time.deltaTime; if (!enemy.NavMeshAgent.HasPath() || Vector3.Distance(((Component)this).transform.position, agentDestination) < 1f || Vector3.Distance(((Component)enemy.Rigidbody).transform.position, ((Component)playerTarget).transform.position) > 5f || stateTimer <= 0f || maxMoveTimer <= 0f) { SemiFunc.EnemyCartJumpReset(enemy); UpdateState(State.PlayerRelease); } } private void StatePlayerRelease() { //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) if (stateImpulse) { stateImpulse = false; stateTimer = 2f; } stateTimer -= Time.deltaTime; if (Object.op_Implicit((Object)(object)playerTarget)) { playerTarget.GetMapDebuffTimer().minimapDebuffTimer = 30f; } if (!Object.op_Implicit((Object)(object)playerTarget) || playerTarget.isDisabled) { UpdateState(State.Leave); } else if (stateTimer <= 0f || Vector3.Distance(((Component)enemy.Rigidbody).transform.position, ((Component)playerTarget).transform.position) > 5f) { UpdateState(State.PlayerReleaseWait); } } private void StatePlayerReleaseWait() { if (stateImpulse) { stateImpulse = false; stateTimer = 2f; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Leave); } } private void StateLeave() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateTimer = 5f; bool flag = false; LevelPoint val = SemiFunc.LevelPointGetPlayerDistance(((Component)this).transform.position, 30f, 50f, false); if (!Object.op_Implicit((Object)(object)val)) { val = SemiFunc.LevelPointGetFurthestFromPlayer(((Component)this).transform.position, 5f); } NavMeshHit val2 = default(NavMeshHit); if (Object.op_Implicit((Object)(object)val) && NavMesh.SamplePosition(((Component)val).transform.position + Random.insideUnitSphere * 3f, ref val2, 5f, -1) && Physics.Raycast(((NavMeshHit)(ref val2)).position, Vector3.down, 10f, LayerMask.GetMask(new string[1] { "Default" }))) { agentDestination = ((NavMeshHit)(ref val2)).position; flag = true; } SemiFunc.EnemyLeaveStart(enemy); if (!flag) { return; } stateImpulse = false; enemy.EnemyParent.SpawnedTimerSet(1f); } if (enemy.Rigidbody.notMovingTimer > 2f) { stateTimer -= Time.deltaTime; } enemy.NavMeshAgent.SetDestination(agentDestination); enemy.NavMeshAgent.OverrideAgent(5f, 10f, 0.25f); SemiFunc.EnemyCartJump(enemy); if (Vector3.Distance(((Component)this).transform.position, agentDestination) < 1f || stateTimer <= 0f) { SemiFunc.EnemyCartJumpReset(enemy); UpdateState(State.Idle); } } private void StateStun() { if (!enemy.IsStunned()) { UpdateState(State.StunEnd); } } private void StateStunEnd() { if (stateImpulse) { stateImpulse = false; stateTimer = 1f; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Leave); } } private void StateDespawn() { if (stateImpulse) { stateImpulse = false; enemy.EnemyParent.Despawn(); UpdateState(State.Spawn); } } public void OnSpawn() { if (SemiFunc.IsMasterClientOrSingleplayer() && SemiFunc.EnemySpawn(enemy)) { UpdateState(State.Spawn); } } public void OnHurt() { enemyHiddenAnim.Hurt(); } public void OnDeath() { enemyHiddenAnim.Death(); if (SemiFunc.IsMasterClientOrSingleplayer()) { enemy.EnemyParent.Despawn(); } } public void OnInvestigate() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer() && (currentState == State.Idle || currentState == State.Roam || currentState == State.Investigate)) { agentDestination = enemy.StateInvestigate.onInvestigateTriggeredPosition; UpdateState(State.Investigate); } } public void OnVision() { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (currentState == State.Idle || currentState == State.Roam || currentState == State.Investigate || currentState == State.Leave) { playerTarget = enemy.Vision.onVisionTriggeredPlayer; if (SemiFunc.IsMultiplayer()) { photonView.RPC("UpdatePlayerTargetRPC", (RpcTarget)0, new object[1] { playerTarget.photonView.ViewID }); } UpdateState(State.PlayerNotice); } else if (currentState == State.PlayerGoTo) { stateTimer = 2f; } } public void OnGrabbed() { if (SemiFunc.IsMasterClientOrSingleplayer() && !(grabAggroTimer > 0f) && currentState == State.Leave) { grabAggroTimer = 60f; playerTarget = enemy.Rigidbody.onGrabbedPlayerAvatar; if (SemiFunc.IsMultiplayer()) { photonView.RPC("UpdatePlayerTargetRPC", (RpcTarget)0, new object[1] { playerTarget.photonView.ViewID }); } UpdateState(State.PlayerNotice); } } private void UpdateState(State _state) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer() && _state != currentState) { enemy.Rigidbody.StuckReset(); currentState = _state; stateImpulse = true; stateTimer = 0f; if (currentState == State.Leave) { SemiFunc.EnemyLeaveStart(enemy); } if (GameManager.Multiplayer()) { photonView.RPC("UpdateStateRPC", (RpcTarget)0, new object[1] { currentState }); } else { UpdateStateRPC(currentState); } } } private void RotationLogic() { //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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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) if (currentState == State.PlayerNotice || currentState == State.PlayerGoTo) { if (Vector3.Distance(((Component)playerTarget).transform.position, ((Component)this).transform.position) > 0.1f) { rotationTarget = Quaternion.LookRotation(((Component)playerTarget).transform.position - ((Component)this).transform.position); ((Quaternion)(ref rotationTarget)).eulerAngles = new Vector3(0f, ((Quaternion)(ref rotationTarget)).eulerAngles.y, 0f); } } else { Vector3 normalized = ((Vector3)(ref enemy.NavMeshAgent.AgentVelocity)).normalized; if (((Vector3)(ref normalized)).magnitude > 0.1f) { rotationTarget = Quaternion.LookRotation(((Vector3)(ref enemy.NavMeshAgent.AgentVelocity)).normalized); ((Quaternion)(ref rotationTarget)).eulerAngles = new Vector3(0f, ((Quaternion)(ref rotationTarget)).eulerAngles.y, 0f); } } ((Component)this).transform.rotation = SemiFunc.SpringQuaternionGet(rotationSpring, rotationTarget, -1f); } private void PlayerTumbleLogic() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) if ((currentState != State.PlayerPickup && currentState != State.PlayerMove && currentState != State.PlayerRelease) || !Object.op_Implicit((Object)(object)playerTarget) || playerTarget.isDisabled) { return; } playerTarget.voiceChat.OverridePitch(1.35f, 0.3f, 2f, 0.1f, 0f, 0f); if (playerTarget.isLocal) { playerTarget.physGrabber.OverrideDisableSpecialGrabPowers(1f); PostProcessing.Instance.VignetteOverride(new Color(0f, 0.1f, 0f), 5f, 1f, 2f, 2f, 0.1f, ((Component)this).gameObject); PostProcessing.Instance.SaturationOverride(-25f, 3f, 1f, 0.1f, ((Component)this).gameObject); CameraZoom.Instance.OverrideZoomSet(90f, 0.1f, 3f, 1f, ((Component)this).gameObject, 150); PostProcessing.Instance.SaturationOverride(-25f, 3f, 1f, 0.1f, ((Component)this).gameObject); PostProcessing.Instance.ContrastOverride(10f, 3f, 1f, 0.1f, ((Component)this).gameObject); playerTarget.GetMapDebuffTimer().minimapDebuffTimer = 8f; } if (SemiFunc.IsMasterClientOrSingleplayer()) { if (!playerTarget.tumble.isTumbling) { playerTarget.tumble.TumbleRequest(true, false); } playerTarget.tumble.TumbleOverrideTime(1f); playerTarget.FallDamageResetSet(0.1f); playerTarget.tumble.physGrabObject.OverrideMass(1f, 0.1f); playerTarget.tumble.physGrabObject.OverrideAngularDrag(2f, 0.1f); playerTarget.tumble.physGrabObject.OverrideDrag(1f, 0.1f); playerTarget.tumble.OverrideEnemyHurt(0.1f); float num = 1f; if (playerTarget.tumble.physGrabObject.playerGrabbing.Count > 0) { num = 0.5f; } else if (currentState == State.PlayerRelease || currentState == State.PlayerPickup) { num = 0.75f; } Vector3 val = SemiFunc.PhysFollowPosition(((Component)playerTarget.tumble).transform.position, playerPickupTransform.position, playerTarget.tumble.rb.velocity, 10f * num); playerTarget.tumble.rb.AddForce(val * (10f * Time.fixedDeltaTime * num), (ForceMode)1); Vector3 val2 = SemiFunc.PhysFollowRotation(((Component)playerTarget.tumble).transform, playerPickupTransform.rotation, playerTarget.tumble.rb, 0.2f * num); playerTarget.tumble.rb.AddTorque(val2 * (1f * Time.fixedDeltaTime * num), (ForceMode)1); } } private void PlayerPickupTransformLogic() { //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) if (currentState == State.PlayerMove || currentState == State.PlayerPickup || currentState == State.PlayerRelease) { float magnitude = ((Vector3)(ref enemy.Rigidbody.velocity)).magnitude; Vector3 angularVelocity = enemy.Rigidbody.rb.angularVelocity; float num = (magnitude + ((Vector3)(ref angularVelocity)).magnitude) * 0.5f; num = Mathf.Clamp(num, 0f, 1f); float num2 = playerPickupCurveUp.Evaluate(playerPickupLerpUp) - 0.5f; float num3 = playerPickupCurveSide.Evaluate(playerPickupLerpSide) - 0.5f; playerPickupLerpUp += 2f * Time.deltaTime * num; if (playerPickupLerpUp > 1f) { playerPickupLerpUp -= 1f; } playerPickupLerpSide += 1f * Time.deltaTime * num; if (playerPickupLerpSide > 1f) { playerPickupLerpSide -= 1f; } playerPickupTransform.localPosition = Vector3.Lerp(playerPickupTransform.localPosition, new Vector3(playerPickupPositionOriginal.x + num3 * 0.2f, playerPickupPositionOriginal.y + num2 * 0.2f, playerPickupPositionOriginal.z), 50f * Time.deltaTime); } else { playerPickupLerpSide = 0f; playerPickupLerpUp = 0f; playerPickupTransform.localPosition = Vector3.Lerp(playerPickupTransform.localPosition, playerPickupPositionOriginal, 10f * Time.deltaTime); } } [PunRPC] private void UpdateStateRPC(State _state, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { currentState = _state; } } [PunRPC] private void UpdatePlayerTargetRPC(int _photonViewID, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.MasterOnlyRPC(_info)) { return; } foreach (PlayerAvatar item in SemiFunc.PlayerGetList()) { if (item.photonView.ViewID == _photonViewID) { playerTarget = item; break; } } } } public class ÑacaÑacaAnim : MonoBehaviour { public enum BreathingState { None, Slow, Medium, Fast, FastNoSound } public enum FootstepState { None, Standing, TwoStep, Moving, Sprinting, TimedSteps } private BreathingState breathingState; private FootstepState footstepState; [Space] public Enemy enemy; public ÑacaÑaca enemyHidden; internal MaterialTrigger material = new MaterialTrigger(); [Space] public ParticleSystem particleBreath; public ParticleSystem particleBreathFast; public ParticleSystem particleBreathConstant; private bool breathingCurrent; private float breathingTimer; [Space] public Transform transformFoot; public ParticleSystem particleFootstepShapeRight; public ParticleSystem particleFootstepShapeLeft; public ParticleSystem particleFootstepSmoke; private Vector3 footstepPositionPrevious; private Vector3 footstepPositionPreviousRight; private Vector3 footstepPositionPreviousLeft; private int footstepCurrent = 1; private float movingTimer; private float stopStepTimer; private float timedStepsTimer; private bool jumpStartImpulse = true; private bool jumpStopImpulse; [Space] public Sound soundBreatheIn; public Sound soundBreatheOut; [Space] public Sound soundBreatheInFast; public Sound soundBreatheOutFast; [Space] public Sound soundFootstep; public Sound soundFootstepSprint; [Space] public Sound soundStunStart; private bool soundStunStartImpulse; public Sound soundStunLoop; public Sound soundStunStop; private bool soundStunStopImpulse; private float soundStunPauseTimer; [Space] public Sound soundJump; private bool soundJumpImpulse; public Sound soundLand; private bool soundLandImpulse; [Space] public Sound soundPlayerPickup; private bool soundPlayerPickupImpulse; public Sound soundPlayerRelease; private bool soundPlayerReleaseImpulse; public Sound soundPlayerMove; public Sound soundPlayerMoveStop; private bool soundPlayerMoveImpulse; [Space] public Sound soundHurt; public Sound soundDeath; private void Update() { //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) BreathingLogic(); FootstepLogic(); if (enemyHidden.currentState == ÑacaÑaca.State.Stun) { if (soundStunStartImpulse) { StopBreathing(); soundStunStart.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); soundStunStartImpulse = false; } if (soundStunPauseTimer > 0f) { if (soundStunStopImpulse) { soundStunStop.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); soundStunStopImpulse = false; } soundStunLoop.PlayLoop(false, 2f, 5f, 1f, 1f); particleBreathConstant.Stop(); } else { soundStunLoop.PlayLoop(true, 2f, 10f, 1f, 1f); particleBreathConstant.Play(); soundStunStopImpulse = true; } } else { if (soundStunStopImpulse) { soundStunStop.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); soundStunStopImpulse = false; } soundStunLoop.PlayLoop(false, 2f, 5f, 1f, 1f); particleBreathConstant.Stop(); soundStunStartImpulse = true; } if (soundStunPauseTimer > 0f) { soundStunPauseTimer -= Time.deltaTime; } if (enemy.Jump.jumping) { if (soundJumpImpulse) { particleBreath.Play(); soundJump.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); StopBreathing(); soundJumpImpulse = false; } soundLandImpulse = true; } else { if (soundLandImpulse) { particleBreathFast.Play(); soundLand.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); StopBreathing(); soundLandImpulse = false; } soundJumpImpulse = true; } if (enemyHidden.currentState == ÑacaÑaca.State.PlayerPickup) { if (soundPlayerPickupImpulse) { StopBreathing(); particleBreath.Play(); soundPlayerPickup.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); soundPlayerPickupImpulse = false; } } else { soundPlayerPickupImpulse = true; } if (enemyHidden.currentState == ÑacaÑaca.State.PlayerReleaseWait) { if (soundPlayerReleaseImpulse) { StopBreathing(); particleBreath.Play(); soundPlayerRelease.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); soundPlayerReleaseImpulse = false; } } else { soundPlayerReleaseImpulse = true; } if (enemyHidden.currentState == ÑacaÑaca.State.PlayerMove && !enemy.Jump.jumping) { soundPlayerMove.PlayLoop(true, 2f, 10f, 1f, 1f); soundPlayerMoveImpulse = true; return; } if (soundPlayerMoveImpulse) { soundPlayerMoveStop.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); soundPlayerMoveImpulse = false; } soundPlayerMove.PlayLoop(false, 2f, 10f, 1f, 1f); } private void BreathingLogic() { //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) if (enemy.Jump.jumping || enemyHidden.currentState == ÑacaÑaca.State.Stun || enemyHidden.currentState == ÑacaÑaca.State.PlayerRelease || enemyHidden.currentState == ÑacaÑaca.State.PlayerReleaseWait || enemyHidden.currentState == ÑacaÑaca.State.PlayerPickup) { breathingState = BreathingState.None; } else if (enemyHidden.currentState == ÑacaÑaca.State.PlayerMove) { breathingState = BreathingState.FastNoSound; } else if (enemyHidden.currentState == ÑacaÑaca.State.PlayerGoTo || enemyHidden.currentState == ÑacaÑaca.State.Leave) { breathingState = BreathingState.Fast; } else if (enemyHidden.currentState == ÑacaÑaca.State.Roam || enemyHidden.currentState == ÑacaÑaca.State.Investigate) { breathingState = BreathingState.Medium; } else { breathingState = BreathingState.Slow; } if (breathingState == BreathingState.None) { soundBreatheIn.Stop(); soundBreatheOut.Stop(); } if (breathingTimer <= 0f) { if (breathingCurrent) { breathingCurrent = false; if (breathingState != BreathingState.FastNoSound) { if (breathingState == BreathingState.Fast) { soundBreatheInFast.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); } else { soundBreatheIn.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); } } else { particleBreathFast.Play(); } breathingTimer = 3f; } else { breathingCurrent = true; if (breathingState != BreathingState.FastNoSound) { if (breathingState == BreathingState.Fast) { soundBreatheOutFast.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); } else { soundBreatheOut.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); } particleBreath.Play(); } else { particleBreathFast.Play(); } breathingTimer = 4.5f; } } if (breathingState == BreathingState.Slow) { breathingTimer -= 1f * Time.deltaTime; } else if (breathingState == BreathingState.Medium) { breathingTimer -= 2f * Time.deltaTime; } else { breathingTimer -= 5f * Time.deltaTime; } } private void FootstepLogic() { //IL_021d: 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) if (movingTimer > 0f) { movingTimer -= Time.deltaTime; } if ((enemyHidden.currentState == ÑacaÑaca.State.Roam || enemyHidden.currentState == ÑacaÑaca.State.Investigate || enemyHidden.currentState == ÑacaÑaca.State.PlayerGoTo || enemyHidden.currentState == ÑacaÑaca.State.PlayerMove || enemyHidden.currentState == ÑacaÑaca.State.Leave) && ((Vector3)(ref enemy.Rigidbody.velocity)).magnitude > 0.5f) { movingTimer = 0.25f; } if (enemyHidden.currentState == ÑacaÑaca.State.Stun || enemy.Jump.jumping) { footstepState = FootstepState.None; } else if (enemyHidden.currentState == ÑacaÑaca.State.StunEnd || enemyHidden.currentState == ÑacaÑaca.State.PlayerNotice) { footstepState = FootstepState.TimedSteps; } else if (movingTimer > 0f) { if (enemyHidden.currentState == ÑacaÑaca.State.PlayerGoTo || enemyHidden.currentState == ÑacaÑaca.State.PlayerMove || enemyHidden.currentState == ÑacaÑaca.State.Leave) { footstepState = FootstepState.Sprinting; } else { footstepState = FootstepState.Moving; } } else if (footstepState == FootstepState.Moving) { footstepState = FootstepState.TwoStep; } else if (footstepState != FootstepState.TwoStep) { footstepState = FootstepState.Standing; } if (enemy.Jump.jumping) { if (jumpStartImpulse) { jumpStopImpulse = true; jumpStartImpulse = false; FootstepSet(); FootstepSet(); } } else if (jumpStopImpulse) { jumpStopImpulse = false; jumpStartImpulse = true; FootstepSet(); FootstepSet(); } if ((footstepState == FootstepState.Moving || footstepState == FootstepState.Sprinting) && Vector3.Distance(transformFoot.position, footstepPositionPrevious) > 1f) { FootstepSet(); } if (footstepState == FootstepState.TimedSteps) { if (timedStepsTimer <= 0f) { timedStepsTimer = 0.25f; FootstepSet(); } else { timedStepsTimer -= Time.deltaTime; } } else { timedStepsTimer = 0f; } if (footstepState == FootstepState.TwoStep) { if (stopStepTimer == -1f) { FootstepSet(); stopStepTimer = 0.25f; return; } stopStepTimer -= Time.deltaTime; if (stopStepTimer <= 0f) { footstepState = FootstepState.Standing; FootstepSet(); stopStepTimer = -1f; } } else { stopStepTimer = -1f; } } private void FootstepSet() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: 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_00b9: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_0201: 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_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0234: 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) Vector3 val = transformFoot.right * (-0.3f * (float)footstepCurrent); Vector3 val2 = Random.insideUnitSphere * 0.15f; val2.y = 0f; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(transformFoot.position + val + val2, Vector3.down * 2f, ref val3, 3f, LayerMask.GetMask(new string[1] { "Default" }))) { ParticleSystem val4 = particleFootstepShapeRight; Vector3 val5 = footstepPositionPreviousRight; if (footstepCurrent == 1) { val4 = particleFootstepShapeLeft; val5 = footstepPositionPreviousLeft; } if (Vector3.Distance(val5, ((RaycastHit)(ref val3)).point) > 0.2f) { ((Component)val4).transform.position = ((RaycastHit)(ref val3)).point + Vector3.up * 0.02f; ((Component)val4).transform.eulerAngles = new Vector3(0f, transformFoot.eulerAngles.y, 0f); val4.Play(); ((Component)particleFootstepSmoke).transform.position = ((Component)val4).transform.position; ((Component)particleFootstepSmoke).transform.rotation = ((Component)val4).transform.rotation; particleFootstepSmoke.Play(); Materials.Instance.Impulse(((Component)val4).transform.position + Vector3.up * 0.5f, Vector3.down, (SoundType)1, true, true, material, (HostType)2); if (footstepState == FootstepState.Sprinting) { soundFootstepSprint.Play(((Component)val4).transform.position, 1f, 1f, 1f, 1f); } else { soundFootstep.Play(((Component)val4).transform.position, 1f, 1f, 1f, 1f); } if (footstepCurrent == 1) { footstepPositionPreviousLeft = ((RaycastHit)(ref val3)).point; } else { footstepPositionPreviousRight = ((RaycastHit)(ref val3)).point; } footstepCurrent *= -1; } } footstepPositionPrevious = transformFoot.position; } public void StopBreathing() { soundBreatheIn.Stop(); soundBreatheInFast.Stop(); soundBreatheOut.Stop(); soundBreatheOutFast.Stop(); } public void StunPause() { soundStunPauseTimer = 1f; } public void Hurt() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) StopBreathing(); StunPause(); soundHurt.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); } public void Death() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) particleBreathConstant.Stop(); StopBreathing(); StunPause(); soundDeath.Play(((Component)particleBreath).transform.position, 1f, 1f, 1f, 1f); } } namespace DesaEnemies { [BepInPlugin("Desay1.DesaEnemies", "DesaEnemies", "1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class DesaEnemies : BaseUnityPlugin { internal static DesaEnemies Instance { get; private set; } internal static ManualLogSource Logger => Instance._logger; private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger; internal Harmony? Harmony { get; set; } private void Awake() { Instance = this; ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Patch(); Logger.LogInfo((object)"DesaTest has loaded!"); } internal void Patch() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0026: Expected O, but got Unknown if (Harmony == null) { Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID); Harmony val2 = val; Harmony = val; } Harmony.PatchAll(); } internal void Unpatch() { Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } } private void Update() { } } public class PibePlateado : MonoBehaviour { public enum State { Spawn, Despawn, Idle, GoToBalloonPlacement, PlaceBalloon, LeaveAfterBalloon, GoToPlayerAngry, GoToBalloonAngry, PlayerNotice, LookAround, SeekPlayer, Investigate, CreepyStare, Attack, AttackUnderStart, AttackUnder, AttackUnderEnd, StandUp, AttackOver, Leave, Stunned, FlyBackUp, FlyBackToNavMesh } [HideInInspector] public State currentState; [Header("Scripts & Components")] public PibePlateadoAnim anim; public EnemyParent enemyParent; [Header("Balloon Placement")] public int maxBalloons = 30; public GameObject balloonPrefab; public List balloonSpawnPoints; [Header("Collision Checkers")] public Transform balloonCollisionChecker; public Transform standUpCollisionChecker; public Transform doorCollisionChecker; [Header("Collider")] public CapsuleCollider BBcollider; public CapsuleCollider colliderSmall; [Header("Code Anim components")] public Transform visualMesh; public Transform headPivot; public Transform leftEyePivot; public Transform rightEyePivot; public Transform bottom; public Transform animatingBalloon; [Header("Rotation Logic")] private Quaternion horizontalRotationTarget = Quaternion.identity; public SpringQuaternion horizontalRotationSpring; public GameObject balloonPopEffect; [HideInInspector] public bool blowing; [HideInInspector] public PlayerAvatar playerTarget; private State previousState; private Enemy enemy; private PhotonView photonView; public Dictionary balloons = new Dictionary(); private List balloonsToRemove = new List(); private List balloonPlacements; private float stateTimer; private float secondStateTimer; private float thirdStateTimer; private float popAggroRadius = 10f; private float stateTimerClient; private float balloonInterval = 3f; private float onScreenTimer; private float creepyStareTimer; private float maxHeadRotationUpDown = 40f; private float maxHeadRotationLeftRight = 70f; private float idleBreakerTimer; private float breakerPlayTime = 2f; private float breakerPlayTimer; private float preferredBalloonDistance = 1.8f; private bool stateImpulse; private bool startOfStateClient; private bool SkipStateImpulse; private bool nonAggroInvestigate; private bool hasPendingBalloon; private bool checkedForDuplicates; private bool replaceOldBalloons; private bool onNavMesh; private bool playerOnNavMesh; private bool angrySpawn; private Vector3 targetPosition; private Vector3 stuckAttackTarget; private Vector3 agentDestination; private Vector3 moveBackPosition; private Vector3 pendingBalloonPoint; private Vector3 bPos; private Vector3 bScale; private int minBalloonsPerPlacement = 2; private int maxBalloonsPerPlacement = 5; private int balloonCount; private int balloonsPlaced; private int balloonsPlacedTotal; private int myIndex; private ParticleScriptExplosion particleScriptExplosion; private Color[] colors = (Color[])(object)new Color[7] { new Color(0.5f, 0.5f, 0.5f), new Color(0.66f, 0.66f, 0.66f), new Color(0.18f, 0.31f, 0.31f), new Color(0.41f, 0.41f, 0.41f), new Color(0.83f, 0.83f, 0.83f), new Color(0.47f, 0.53f, 0.6f), new Color(0.44f, 0.5f, 0.56f) }; private Color balloonColor = new Color(0.75f, 0.75f, 0.75f); private void Awake() { enemy = ((Component)this).GetComponent(); photonView = ((Component)this).GetComponent(); particleScriptExplosion = ((Component)this).GetComponent(); } private void FixedUpdate() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } enemy.Rigidbody.gravity = !FlyState(); if (currentState == State.FlyBackUp) { if (enemy.Rigidbody.rb.velocity.y < 0f) { Rigidbody rb = enemy.Rigidbody.rb; rb.velocity *= 0.8f; } Vector3 angularVelocity = enemy.Rigidbody.rb.angularVelocity; if (((Vector3)(ref angularVelocity)).magnitude > 5f) { Rigidbody rb2 = enemy.Rigidbody.rb; rb2.angularVelocity *= 0.95f; } } } private void Update() { //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Invalid comparison between Unknown and I4 //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: 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_0250: Unknown result type (might be due to invalid IL or missing references) stateTimerClient += Time.deltaTime; CheckForStartOfStateClient(); BodyRotationLogic(); HeadRotationLogic(); if (currentState == State.Stunned && startOfStateClient) { anim.animator.SetTrigger("stun_trigger"); } if (currentState == State.CreepyStare && startOfStateClient) { anim.CrackSound(); } if (anim.breaker) { breakerPlayTimer += Time.deltaTime; if (breakerPlayTimer > breakerPlayTime) { anim.breaker = false; breakerPlayTimer = 0f; } } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } ColliderSizeLogic(); if (enemy.IsStunned() && currentState != State.Stunned && currentState != State.Despawn) { replaceOldBalloons = false; if (currentState == State.PlaceBalloon) { InterruptBalloonPop(); hasPendingBalloon = false; } UpdateState(State.Stunned); } if (PlayerTargetState() && (!Object.op_Implicit((Object)(object)playerTarget) || playerTarget.isDisabled)) { UpdateState(State.Idle); } else if ((int)enemy.CurrentState == 11) { UpdateState(State.Despawn); } if (((Component)enemy.Rigidbody).transform.position.y - moveBackPosition.y < -2.5f && !enemy.IsStunned() && currentState != State.Despawn && !FlyState()) { float num = float.PositiveInfinity; RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)enemy.Rigidbody).transform.position, Vector3.down, ref val, 5f, LayerMask.GetMask(new string[1] { "Default" }))) { num = Vector3.Distance(((Component)enemy.Rigidbody).transform.position, ((RaycastHit)(ref val)).point); } if (num > 2f) { UpdateState(State.FlyBackUp); } } CheckForCreepyStareStart(); if (NavMeshState() && !enemy.Jump.jumping) { UpdateMoveBackPosition(); } CheckForPoppedBalloons(); if (!FlyState()) { RotationLogic(); } switch (currentState) { case State.Spawn: StateSpawn(); break; case State.Despawn: StateDespawn(); break; case State.Idle: StateIdle(); break; case State.GoToBalloonPlacement: StateGoToBalloonPlacement(); break; case State.PlaceBalloon: StatePlaceBalloon(); break; case State.LeaveAfterBalloon: StateLeaveAfterBalloon(); break; case State.Leave: StateLeave(); break; case State.PlayerNotice: StatePlayerNotice(); break; case State.GoToPlayerAngry: StateGoToPlayerAngry(); break; case State.GoToBalloonAngry: StateGoToBalloonAngry(); break; case State.SeekPlayer: StateSeekPlayer(); break; case State.Investigate: StateInvestigate(); break; case State.Attack: StateAttack(); break; case State.AttackUnderStart: StateAttackUnderStart(); break; case State.AttackUnder: StateAttackUnder(); break; case State.AttackUnderEnd: StateAttackUnderEnd(); break; case State.AttackOver: StateAttackOver(); break; case State.StandUp: StateStandUp(); break; case State.CreepyStare: StateCreepyStare(); break; case State.LookAround: StateLookAround(); break; case State.Stunned: StateStunned(); break; case State.FlyBackUp: StateFlyBackUp(); break; case State.FlyBackToNavMesh: StateFlyBackToNavMesh(); break; } } private void PlayIdleBreaker(int index) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("PlayIdleBreakerRPC", (RpcTarget)0, new object[1] { index }); } else { PlayIdleBreakerRPC(index); } } } [PunRPC] private void PlayIdleBreakerRPC(int index, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: 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) if (SemiFunc.MasterOnlyRPC(_info)) { anim.breaker = true; AudioClip val = anim.idleBreakers[index]; AudioClip[] sounds = (AudioClip[])(object)new AudioClip[1] { val }; anim.idleBreaker.Sounds = sounds; anim.idleBreaker.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } private void InterruptBalloonPop() { if (SemiFunc.IsMasterClientOrSingleplayer()) { anim.InterruptBalloonPop(); if (GameManager.Multiplayer()) { photonView.RPC("InterruptBalloonPopRPC", (RpcTarget)1, Array.Empty()); } } } [PunRPC] private void InterruptBalloonPopRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { anim.InterruptBalloonPop(); } } public void UpdateState(State _nextState) { if (SemiFunc.IsMasterClientOrSingleplayer() && _nextState != currentState) { SemiLogger.LogMonika((object)("Change state to : " + _nextState), (GameObject)null, (Color?)null, true, true); onScreenTimer = 0f; stateImpulse = true; currentState = _nextState; if (GameManager.Multiplayer()) { photonView.RPC("UpdateStateRPC", (RpcTarget)1, new object[1] { _nextState }); } } } [PunRPC] private void UpdateStateRPC(State _nextState, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { currentState = _nextState; } } private void BalloonPopEffect(Vector3 _pos, bool _global = true) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) GameObject val = Object.Instantiate(balloonPopEffect, _pos, Quaternion.identity); val.GetComponent().PlayParticle(); anim.balloonPopSound.Play(_pos, 1f, 1f, 1f, 1f); if (_global) { anim.balloonPopGlobal.Play(_pos, 1f, 1f, 1f, 1f); } particleScriptExplosion.Spawn(_pos, 0.75f, 25, 10, 1f, false, false, 1f); } private void RemoveBalloon(Vector3 _position, bool _manualRemove = false) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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) float num = CheckIfPlayersNearbyPop(_position); if (!_manualRemove && num > popAggroRadius) { return; } bool poppedWhileDespawned = balloons[_position].GetComponentInChildren().poppedWhileDespawned; if (GameManager.Multiplayer()) { photonView.RPC("RemoveBalloonRPC", (RpcTarget)0, new object[2] { _position, !_manualRemove }); } else { RemoveBalloonRPC(_position, !_manualRemove); } if (!_manualRemove) { if (poppedWhileDespawned) { UpdateState(State.Spawn); angrySpawn = true; } else if (currentState != State.GoToPlayerAngry && currentState != State.Despawn && !AttackState() && num < popAggroRadius / 2f) { replaceOldBalloons = false; UpdateState(State.GoToBalloonAngry); } } } [PunRPC] private void RemoveBalloonRPC(Vector3 _position, bool _global, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { BalloonPopEffect(_position, _global); Object.Destroy((Object)(object)balloons[_position]); balloons.Remove(_position); if (_global) { EnemyDirector.instance.SetInvestigate(_position, 5f, false); } } } private void SpawnBalloon(Vector3 _position) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { float num = Random.Range(0.5f, 1.5f); if (GameManager.Multiplayer()) { photonView.RPC("SpawnBalloonRPC", (RpcTarget)0, new object[4] { _position, bPos, bScale, num }); } else { SpawnBalloonRPC(_position, bPos, bScale, num); } balloons[_position].GetComponentInChildren().balloonIndex = balloonsPlacedTotal; } } [PunRPC] private void SpawnBalloonRPC(Vector3 _keyPos, Vector3 _spawnPos, Vector3 _spawnScale, float _randomSpeed, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { balloons[_keyPos] = Object.Instantiate(balloonPrefab, _keyPos, Quaternion.identity); BirthdayBoyBalloon componentInChildren = balloons[_keyPos].GetComponentInChildren(); componentInChildren.enemyParent = enemy.EnemyParent; componentInChildren.placerIndex = myIndex; componentInChildren.randomSpeed = _randomSpeed; if (myIndex != 0 && myIndex < 8) { componentInChildren.ChangeColor(balloonColor); } balloons[_keyPos].GetComponentInChildren().TakeToSpawnPoint(_spawnPos, _spawnScale); } } private void SyncBalloonPlacements() { //IL_004d: 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) if (SemiFunc.IsMasterClientOrSingleplayer()) { List nonCollidingBalloonSpawnPoints = GetNonCollidingBalloonSpawnPoints(); int[] array = GetBalloonSpawnPointIndexes(nonCollidingBalloonSpawnPoints).ToArray(); if (GameManager.Multiplayer()) { photonView.RPC("SyncBalloonPlacementsRPC", (RpcTarget)0, new object[1] { array }); } else { SyncBalloonPlacementsRPC(array); } } } [PunRPC] private void SyncBalloonPlacementsRPC(int[] _spawnPoints, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { List list = new List(_spawnPoints); balloonPlacements = list; } } private void BlowBalloonAnimation() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (GameManager.Multiplayer()) { photonView.RPC("BlowBalloonAnimationRPC", (RpcTarget)0, Array.Empty()); } else { BlowBalloonAnimationRPC(); } } [PunRPC] private void BlowBalloonAnimationRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { anim.BlowBalloonAnimationTrigger(); } } private void UpdatePlayerTarget(PlayerAvatar _target) { if (SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer() && (Object)(object)_target != (Object)null && (Object)(object)_target != (Object)(object)playerTarget) { photonView.RPC("UpdatePlayerTargetRPC", (RpcTarget)1, new object[1] { _target.photonView.ViewID }); } playerTarget = _target; } } [PunRPC] private void UpdatePlayerTargetRPC(int photonViewID, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { playerTarget = SemiFunc.PlayerAvatarGetFromPhotonID(photonViewID); } } private void UpdateLookTarget(PlayerAvatar _target) { if (SemiFunc.IsMasterClientOrSingleplayer()) { if (!SemiFunc.IsMultiplayer()) { anim.lookTarget = _target; } else if (!Object.op_Implicit((Object)(object)anim.lookTarget) || anim.lookTarget.photonView.ViewID != _target.photonView.ViewID) { anim.lookTarget = _target; photonView.RPC("UpdateLookTargetRPC", (RpcTarget)1, new object[1] { _target.photonView.ViewID }); } } } [PunRPC] private void UpdateLookTargetRPC(int photonViewID, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { anim.lookTarget = SemiFunc.PlayerAvatarGetFromPhotonID(photonViewID); } } private void PopAllBalloons() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (GameManager.Multiplayer()) { photonView.RPC("PopAllBalloonsRPC", (RpcTarget)0, Array.Empty()); } else { PopAllBalloonsRPC(); } } } [PunRPC] private void PopAllBalloonsRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.MasterOnlyRPC(_info)) { return; } foreach (Vector3 item in new List(balloons.Keys)) { BalloonPopEffect(item, _global: false); Object.Destroy((Object)(object)balloons[item]); balloons.Remove(item); } } [PunRPC] private void ToggleShrinkColliderRPC(bool _active, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { ((Component)BBcollider).gameObject.SetActive(!_active); ((Component)colliderSmall).gameObject.SetActive(_active); } } private void StateSpawn() { if (stateImpulse) { stateImpulse = false; stateTimer = 1f; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { if (angrySpawn) { angrySpawn = false; UpdateState(State.GoToBalloonAngry); } else { UpdateState(State.Idle); } } } private void StateDespawn() { if (stateImpulse) { stateImpulse = false; ResetNavMesh(); } } private void StateIdle() { if (stateImpulse && !SkipStateImpulse) { ResetNavMesh(); stateTimer = Random.Range(1f, 4f); stateImpulse = false; if (Random.Range(0, 10) > 4) { int index = Random.Range(0, 3); PlayIdleBreaker(index); } } SkipStateImpulse = false; if (!SemiFunc.EnemySpawnIdlePause()) { stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.GoToBalloonPlacement); } if (SemiFunc.EnemyForceLeave(enemy)) { UpdateState(State.Leave); } } } private void StateGoToBalloonPlacement() { //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { LevelPoint val = SemiFunc.LevelPointGet(((Component)this).transform.position, 5f, 15f); if (!Object.op_Implicit((Object)(object)val)) { val = SemiFunc.LevelPointGet(((Component)this).transform.position, 0f, 999f); } NavMeshHit val2 = default(NavMeshHit); if (Object.op_Implicit((Object)(object)val) && NavMesh.SamplePosition(((Component)val).transform.position + Random.insideUnitSphere * 3f, ref val2, 5f, -1) && Physics.Raycast(((NavMeshHit)(ref val2)).position, Vector3.down, 5f, LayerMask.GetMask(new string[1] { "Default" }))) { agentDestination = ((NavMeshHit)(ref val2)).position; } stateTimer = 5f; enemy.Rigidbody.notMovingTimer = 0f; stateImpulse = false; } enemy.NavMeshAgent.SetDestination(agentDestination); JumpIfStuck(); if (enemy.Rigidbody.notMovingTimer > 2f) { stateTimer -= Time.deltaTime; } if (stateTimer <= 0f) { UpdateState(State.Idle); } else if (Vector3.Distance(((Component)this).transform.position, agentDestination) < 1f) { UpdateState(State.PlaceBalloon); } else if (SemiFunc.EnemyForceLeave(enemy)) { UpdateState(State.Leave); } } private void StatePlaceBalloon() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse && !SkipStateImpulse) { ResetNavMesh(); SyncBalloonPlacements(); balloonCount = balloonPlacements.Count; balloonsPlaced = 0; balloonsToRemove = new List(); if (balloons.Count >= maxBalloons) { for (int i = 0; i < balloonCount; i++) { List list = new List(balloons.Keys); Vector3 val = list[0]; foreach (Vector3 item in list) { if (balloons[item].GetComponentInChildren().balloonIndex < balloons[val].GetComponentInChildren().balloonIndex && !balloonsToRemove.Contains(item)) { val = item; } } balloonsToRemove.Add(val); } replaceOldBalloons = true; } stateTimer = (float)balloonCount * balloonInterval + 0.5f; secondStateTimer = 0f; stateImpulse = false; } SkipStateImpulse = false; stateTimer -= Time.deltaTime; secondStateTimer -= Time.deltaTime; if (stateTimer <= 0f) { replaceOldBalloons = false; UpdateState(State.LeaveAfterBalloon); } else { if (balloonsPlaced >= balloonCount || !(secondStateTimer <= 0f)) { return; } int index = balloonPlacements[balloonsPlaced]; Vector3 position = balloonSpawnPoints[index].position; if (balloons.ContainsKey(position)) { return; } if (!IsColliding(balloonCollisionChecker, position) && !NearbyDoor(position)) { pendingBalloonPoint = position; hasPendingBalloon = true; BlowBalloonAnimation(); } else { SemiLogger.LogMonika((object)"Didnt spawn, was colliding", (GameObject)null, (Color?)null, true, true); } secondStateTimer = balloonInterval; if (replaceOldBalloons) { Vector3 val2 = balloonsToRemove[Mathf.Min(balloonsPlaced, balloonsToRemove.Count - 1)]; if (balloons.ContainsKey(val2)) { RemoveBalloon(val2, _manualRemove: true); } } balloonsPlaced++; balloonsPlacedTotal++; } } private void StateLeaveAfterBalloon() { //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { LevelPoint val = SemiFunc.LevelPointGet(((Component)this).transform.position, 5f, 15f); if (!Object.op_Implicit((Object)(object)val)) { val = SemiFunc.LevelPointGet(((Component)this).transform.position, 0f, 999f); } NavMeshHit val2 = default(NavMeshHit); if (Object.op_Implicit((Object)(object)val) && NavMesh.SamplePosition(((Component)val).transform.position + Random.insideUnitSphere * 3f, ref val2, 5f, -1) && Physics.Raycast(((NavMeshHit)(ref val2)).position, Vector3.down, 5f, LayerMask.GetMask(new string[1] { "Default" }))) { agentDestination = ((NavMeshHit)(ref val2)).position; } stateTimer = 5f; enemy.Rigidbody.notMovingTimer = 0f; stateImpulse = false; } enemy.NavMeshAgent.SetDestination(agentDestination); JumpIfStuck(); if (enemy.Rigidbody.notMovingTimer > 2f) { stateTimer -= Time.deltaTime; } if (stateTimer <= 0f || Vector3.Distance(((Component)this).transform.position, agentDestination) < 1f) { UpdateState(State.Idle); } else if (SemiFunc.EnemyForceLeave(enemy)) { UpdateState(State.Leave); } } private void StateLeave() { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { LevelPoint val = SemiFunc.LevelPointGetPlayerDistance(((Component)this).transform.position, 25f, 50f, false); if (!Object.op_Implicit((Object)(object)val)) { val = SemiFunc.LevelPointGetFurthestFromPlayer(((Component)this).transform.position, 5f); } if (Object.op_Implicit((Object)(object)val)) { agentDestination = ((Component)val).transform.position; } else { enemy.EnemyParent.SpawnedTimerSet(0f); } stateTimer = 10f; stateImpulse = false; enemy.Rigidbody.notMovingTimer = 0f; SemiFunc.EnemyLeaveStart(enemy); } enemy.NavMeshAgent.SetDestination(agentDestination); JumpIfStuck(); if (enemy.Rigidbody.notMovingTimer > 2f) { stateTimer -= Time.deltaTime; } enemy.NavMeshAgent.OverrideAgent(6f, 12f, 0.25f); if (stateTimer <= 0f || Vector3.Distance(((Component)this).transform.position, agentDestination) < 1f) { UpdateState(State.Idle); } } private void StateStunned() { if (stateImpulse) { stateImpulse = false; ResetNavMesh(); } if (!enemy.IsStunned()) { stateTimer = 20f; UpdateState(State.SeekPlayer); } } private void StateGoToPlayerAngry() { UpdateState(State.Idle); } private void StateGoToBalloonAngry() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateTimer = 30f; stateImpulse = false; enemy.Rigidbody.notMovingTimer = 0f; enemy.NavMeshAgent.SetDestination(targetPosition); return; } JumpIfStuck(); if (CloseToNavMeshTarget() && !enemy.IsStunned()) { stateTimer = 20f; UpdateState(State.LookAround); return; } enemy.NavMeshAgent.OverrideAgent(4f, 10f, 0.25f); stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Idle); } } private void StateAttack() { secondStateTimer = 0f; stateTimer = 0f; if (stateTimer <= 0f) { UpdateState(State.Idle); } } private void StateAttackUnderStart() { if (stateImpulse) { stateImpulse = false; } enemy.Vision.StandOverride(0.25f); } private void StateAttackUnder() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: 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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { thirdStateTimer = 10f; enemy.Rigidbody.notMovingTimer = 0f; secondStateTimer = 0f; stateImpulse = false; } if (enemy.Vision.VisionsTriggered[playerTarget.photonView.ViewID] != 0) { secondStateTimer = 0f; } else { secondStateTimer += Time.deltaTime; } enemy.Vision.StandOverride(0.25f); float num = Vector3.Distance(((Component)this).transform.position, ((Component)playerTarget).transform.position); if (num > 0.5f) { enemy.NavMeshAgent.Disable(0.1f); float num2 = enemy.NavMeshAgent.DefaultSpeed * 0.5f; ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, ((Component)playerTarget).transform.position, num2 * Time.deltaTime); Vector3 val = ((Component)playerTarget).transform.position - ((Component)enemy.Rigidbody).transform.position; val.y = 0f; ((Vector3)(ref val)).Normalize(); Quaternion val2 = Quaternion.LookRotation(val, Vector3.up); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)enemy.Rigidbody).transform.rotation, val2, Time.deltaTime * 15f); } else { enemy.NavMeshAgent.OverrideAgent(0.5f, 12f, 0.25f); } if (SemiFunc.PerSecond(5f, (Object)(object)this)) { onNavMesh = enemy.NavMeshAgent.OnNavmesh(((Component)enemy.Rigidbody).transform.position, 1f, true); } stateTimer -= Time.deltaTime; if (secondStateTimer > 3f || !playerTarget.isCrawling || stateTimer <= 0f) { UpdateState(State.AttackUnderEnd); } else if (onNavMesh && thirdStateTimer <= 0f && !IsColliding(standUpCollisionChecker, standUpCollisionChecker.position, _collideWithPlayer: false)) { UpdateState(State.StandUp); } else if (num > 0.5f && enemy.Rigidbody.notMovingTimer > 2f) { thirdStateTimer -= Time.deltaTime; if (thirdStateTimer <= 0f) { UpdateState(State.AttackUnderEnd); } } else { thirdStateTimer = 10f; } } private void StateAttackUnderEnd() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_0126: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { secondStateTimer = 0f; stateImpulse = false; } enemy.NavMeshAgent.Disable(0.1f); enemy.Vision.StandOverride(0.25f); ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, moveBackPosition, enemy.NavMeshAgent.DefaultSpeed * Time.deltaTime); stateTimer -= Time.deltaTime; secondStateTimer += Time.deltaTime; if (Vector3.Distance(((Component)enemy.Rigidbody).transform.position, ((Component)this).transform.position) > 2f) { ((Component)this).transform.position = ((Component)enemy.Rigidbody).transform.position; } if (SemiFunc.PerSecond(5f, (Object)(object)this)) { onNavMesh = enemy.NavMeshAgent.OnNavmesh(((Component)enemy.Rigidbody).transform.position, 1f, true); } if (Vector3.Distance(((Component)enemy.Rigidbody).transform.position, moveBackPosition) <= 1f || onNavMesh) { UpdateState(State.StandUp); } else if (secondStateTimer > 30f) { enemy.EnemyParent.SpawnedTimerSet(0f); UpdateState(State.Despawn); } } private void StateStandUp() { if (stateImpulse) { stateImpulse = false; secondStateTimer = 0f; } enemy.Vision.StandOverride(0.25f); secondStateTimer += Time.deltaTime; if (secondStateTimer > 1f) { UpdateState(State.Idle); } } private void StateAttackOver() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { secondStateTimer = 0f; thirdStateTimer = 10f; stateImpulse = false; } if (SemiFunc.PerSecond(5f, (Object)(object)this)) { playerOnNavMesh = PlayerOnNavMesh(); onNavMesh = enemy.NavMeshAgent.OnNavmesh(((Component)enemy.Rigidbody).transform.position, 1f, true); } if (enemy.Vision.VisionsTriggered[playerTarget.photonView.ViewID] != 0) { secondStateTimer = 0f; } else { secondStateTimer += Time.deltaTime; } Vector3 position = ((Component)playerTarget).transform.position; enemy.NavMeshAgent.Disable(0.1f); if (Vector3.Distance(((Component)enemy.Rigidbody).transform.position, position) > 1.5f) { float num = enemy.NavMeshAgent.DefaultSpeed * 0.75f; ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, position, num * Time.deltaTime); } else { ((Component)this).transform.position = ((Component)enemy.Rigidbody).transform.position; enemy.Rigidbody.DisableFollowPosition(0.1f, 5f); } Vector3 val = ((Component)playerTarget).transform.position - ((Component)enemy.Rigidbody).transform.position; val.y = 0f; ((Vector3)(ref val)).Normalize(); Quaternion val2 = Quaternion.LookRotation(val, Vector3.up); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)enemy.Rigidbody).transform.rotation, val2, Time.deltaTime * 15f); SemiFunc.EnemyCartJump(enemy); if (position.y > ((Component)enemy.Rigidbody).transform.position.y + 0.3f && !enemy.Jump.jumping && !enemy.Jump.jumpingDelay && !enemy.Jump.landDelay && !enemy.Jump.stuckJumpImpulse) { Vector3 val3 = position - ((Component)enemy.Rigidbody).transform.position; Vector3 normalized = ((Vector3)(ref val3)).normalized; enemy.Jump.StuckTrigger(normalized); enemy.Rigidbody.WarpDisable(0.25f); ((Component)this).transform.position = ((Component)enemy.Rigidbody).transform.position; ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, position, 2f); stateTimer -= 0.5f; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Idle); } else { if (enemy.Jump.jumping || enemy.Jump.jumpingDelay || enemy.Jump.landDelay || (onNavMesh && playerOnNavMesh)) { return; } if (secondStateTimer > 3f || enemy.Rigidbody.notMovingTimer > 2f) { thirdStateTimer -= Time.deltaTime; if (thirdStateTimer <= 0f) { UpdateState(State.Idle); } } else { thirdStateTimer = 10f; } } } private void StateLookAround() { UpdateState(State.Idle); } private void StateSeekPlayer() { //IL_0083: 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_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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { targetPosition = ((Component)this).transform.position; LevelPoint val = SemiFunc.LevelPointInTargetRoomGet(enemy.Rigidbody.physGrabObject.roomVolumeCheck, 1f, 10f, (LevelPoint)null); if (Object.op_Implicit((Object)(object)val)) { targetPosition = ((Component)val).transform.position; } enemy.Rigidbody.notMovingTimer = 0f; stateImpulse = false; } if (Vector3.Distance(((Component)this).transform.position, enemy.NavMeshAgent.GetPoint()) < 2f) { UpdateState(State.LookAround); } JumpIfStuck(); enemy.NavMeshAgent.OverrideAgent(3f, enemy.NavMeshAgent.DefaultAcceleration, 0.2f); enemy.NavMeshAgent.SetDestination(targetPosition); stateTimer -= Time.deltaTime; if (stateTimer <= 0f || enemy.Rigidbody.notMovingTimer > 3f) { UpdateState(State.Leave); } } private void StateInvestigate() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; stateTimer += 3f; if (nonAggroInvestigate) { stateTimer = 10f; } enemy.Rigidbody.notMovingTimer = 0f; } enemy.NavMeshAgent.SetDestination(agentDestination); JumpIfStuck(); enemy.NavMeshAgent.OverrideAgent(2.5f, 12f, 0.25f); stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Idle); } else if (Vector3.Distance(((Component)this).transform.position, agentDestination) < 2f) { if (nonAggroInvestigate) { nonAggroInvestigate = false; UpdateState(State.Idle); } else { UpdateState(State.SeekPlayer); } } else if (SemiFunc.EnemyForceLeave(enemy)) { UpdateState(State.Leave); } } private void StateCreepyStare() { SkipStateImpulse = true; if (stateImpulse) { stateImpulse = false; thirdStateTimer = 4f; creepyStareTimer = 30f; } thirdStateTimer -= Time.deltaTime; if (thirdStateTimer <= 0f) { SkipStateImpulse = true; UpdateState(State.Idle); } } private void StatePlayerNotice() { if (stateImpulse) { secondStateTimer = 1.2f; stateImpulse = false; } enemy.NavMeshAgent.ResetPath(); enemy.NavMeshAgent.Stop(0.1f); secondStateTimer -= Time.deltaTime; } private void StateFlyBackUp() { //IL_003d: 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_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_008a: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; stateTimer = 30f; } enemy.NavMeshAgent.Disable(0.1f); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(((Component)this).transform.position.x, moveBackPosition.y + 1.5f, ((Component)this).transform.position.z); ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, val, Time.deltaTime * 5f); enemy.Rigidbody.OverrideFollowPosition(0.1f, 1f, -1f); enemy.Rigidbody.OverrideFollowRotation(0.1f, 0.25f); Transform transform = ((Component)this).transform; Quaternion rotation = ((Component)this).transform.rotation; Quaternion rotation2 = ((Component)this).transform.rotation; transform.rotation = Quaternion.Slerp(rotation, Quaternion.Euler(0f, ((Quaternion)(ref rotation2)).eulerAngles.y, 0f), Time.deltaTime * 5f); if (Vector3.Distance(((Component)enemy.Rigidbody).transform.position, ((Component)this).transform.position) > 2f) { ((Component)this).transform.position = ((Component)enemy.Rigidbody).transform.position; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Despawn); } if (((Component)enemy.Rigidbody).transform.position.y - moveBackPosition.y > 1f) { UpdateState(State.FlyBackToNavMesh); } } private void StateFlyBackToNavMesh() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateImpulse = false; stateTimer = 20f; secondStateTimer = 0f; } enemy.NavMeshAgent.Disable(0.1f); ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, moveBackPosition + Vector3.up * 0.5f, 0.75f * Time.deltaTime); enemy.Rigidbody.OverrideFollowPosition(0.1f, 1f, -1f); enemy.Rigidbody.OverrideFollowRotation(0.1f, 0.25f); if (Vector3.Distance(((Component)enemy.Rigidbody).transform.position, ((Component)this).transform.position) > 2f) { ((Component)this).transform.position = ((Component)enemy.Rigidbody).transform.position; } if (secondStateTimer <= 0f) { secondStateTimer = 0.25f; RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)enemy.Rigidbody).transform.position, Vector3.down, ref val, 5f, LayerMask.GetMask(new string[1] { "Default" }))) { NavMeshHit val2 = default(NavMeshHit); if (Physics.Raycast(((Component)enemy.Rigidbody).transform.position + ((Component)enemy.Rigidbody).transform.forward * 0.5f, Vector3.down, ref val, 5f, LayerMask.GetMask(new string[1] { "Default" })) && NavMesh.SamplePosition(((RaycastHit)(ref val)).point, ref val2, 0.5f, -1)) { moveBackPosition = ((NavMeshHit)(ref val2)).position; UpdateState(State.Idle); return; } } else if (Vector3.Distance(((Component)this).transform.position, moveBackPosition) < 0.1f) { UpdateState(State.Idle); } } else { secondStateTimer -= Time.deltaTime; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { UpdateState(State.Despawn); } } public void OnSpawn() { if (!checkedForDuplicates) { CheckForDuplicates(); checkedForDuplicates = true; } if (SemiFunc.IsMasterClientOrSingleplayer() && SemiFunc.EnemySpawn(enemy)) { UpdateState(State.Spawn); } if (((Behaviour)anim).isActiveAndEnabled) { anim.SetSpawn(); } } public void OnHurt() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) anim.hurtSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); if (SemiFunc.IsMasterClientOrSingleplayer() && !AttackState() && !enemy.IsStunned()) { stateTimer = 20f; UpdateState(State.SeekPlayer); } } public void OnVision() { if (SemiFunc.IsMasterClientOrSingleplayer() && currentState == State.GoToPlayerAngry && (Object)(object)enemy.Vision.onVisionTriggeredPlayer == (Object)(object)playerTarget) { UpdateState(State.PlayerNotice); } } public void OnDeath() { //IL_0012: 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_008b: Unknown result type (might be due to invalid IL or missing references) anim.deathSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); anim.PlayDeathParticles(); GameDirector.instance.CameraShake.ShakeDistance(5f, 3f, 8f, ((Component)this).transform.position, 0.5f); GameDirector.instance.CameraImpact.ShakeDistance(5f, 3f, 8f, ((Component)this).transform.position, 0.1f); if (SemiFunc.IsMasterClientOrSingleplayer()) { PopAllBalloons(); enemy.EnemyParent.Despawn(); UpdateState(State.Despawn); } } public void OnInvestigate() { //IL_0038: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) if (currentState == State.SeekPlayer) { agentDestination = enemy.StateInvestigate.onInvestigateTriggeredPosition; UpdateState(State.Investigate); } else if (Vector3.Distance(((Component)this).transform.position, enemy.StateInvestigate.onInvestigateTriggeredPosition) > 15f) { agentDestination = enemy.StateInvestigate.onInvestigateTriggeredPosition; nonAggroInvestigate = true; UpdateState(State.Investigate); } } public void OnBalloonBlowComplete() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (hasPendingBalloon) { SpawnBalloon(pendingBalloonPoint); hasPendingBalloon = false; } } public void CrouchedDown() { } public void DoneWithBalloonBlow() { if (SemiFunc.IsMasterClientOrSingleplayer()) { UpdateState(State.PlaceBalloon); } } public void StoreBalloonLocation() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) bPos = animatingBalloon.position; bScale = animatingBalloon.localScale; } private void ColliderSizeLogic() { if (startOfStateClient) { if (currentState == State.AttackUnder) { ToggleShrinkCollider(_active: true); } else if (currentState == State.StandUp) { ToggleShrinkCollider(_active: false); } } } private void RotationLogic() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) Vector3 normalized = ((Vector3)(ref enemy.NavMeshAgent.AgentVelocity)).normalized; if (((Vector3)(ref normalized)).magnitude > 0.1f) { horizontalRotationTarget = Quaternion.LookRotation(((Vector3)(ref enemy.NavMeshAgent.AgentVelocity)).normalized); ((Quaternion)(ref horizontalRotationTarget)).eulerAngles = new Vector3(0f, ((Quaternion)(ref horizontalRotationTarget)).eulerAngles.y, 0f); } ((Component)this).transform.rotation = SemiFunc.SpringQuaternionGet(horizontalRotationSpring, horizontalRotationTarget, -1f); } private void CheckForCreepyStareStart() { if (!CreepyStareStartState()) { return; } if (enemy.OnScreen.OnScreenAny) { onScreenTimer += Time.deltaTime; } else { onScreenTimer = 0f; } creepyStareTimer -= Time.deltaTime; if (onScreenTimer > 3f && CreepyStareStartState() && creepyStareTimer <= 0f) { PlayerAvatar val = PlayerNearby(); if (Object.op_Implicit((Object)(object)val)) { UpdateLookTarget(val); UpdateState(State.CreepyStare); } else { onScreenTimer = 0f; } } } private void CheckForStartOfStateClient() { if (currentState != previousState) { startOfStateClient = true; if (currentState != State.CreepyStare) { stateTimerClient = 0f; } previousState = currentState; } else { startOfStateClient = false; } } private void CheckForPoppedBalloons() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } foreach (KeyValuePair balloon in balloons) { if (balloon.Value.GetComponentInChildren().popped) { if (currentState != State.GoToPlayerAngry && !AttackState()) { playerTarget = balloon.Value.GetComponentInChildren().popper; UpdatePlayerTarget(balloon.Value.GetComponentInChildren().popper); } targetPosition = balloon.Value.transform.position; RemoveBalloon(balloon.Key); break; } } } private void JumpIfStuck(bool _cartJump = true) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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) if (_cartJump) { SemiFunc.EnemyCartJump(enemy); } Vector3 destination = enemy.NavMeshAgent.GetDestination(); if (!enemy.Jump.jumping && !enemy.Jump.jumpingDelay && !enemy.Jump.landDelay && enemy.Rigidbody.notMovingTimer > 2f) { enemy.Jump.StuckTrigger(destination - ((Component)enemy.Rigidbody).transform.position); } } private void ResetNavMesh() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) enemy.NavMeshAgent.ResetPath(); enemy.NavMeshAgent.Warp(((Component)enemy.Rigidbody).transform.position, false); } private void UpdateMoveBackPosition() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) NavMeshHit val = default(NavMeshHit); if (SemiFunc.PerSecond(1f, (Object)(object)this) && NavMesh.SamplePosition(((Component)this).transform.position, ref val, 1.5f, -1) && Physics.Raycast(((Component)this).transform.position, Vector3.down, 2f, LayerMask.GetMask(new string[1] { "Default" }))) { moveBackPosition = ((NavMeshHit)(ref val)).position; } } private void RotateBodyTowards(Vector3 _target, float _slerpSpeed = 1f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) Vector3 val = _target - visualMesh.position; val.y = 0f; Quaternion val2 = Quaternion.LookRotation(val, Vector3.up); visualMesh.rotation = Quaternion.Slerp(visualMesh.rotation, val2, Time.deltaTime * _slerpSpeed); } private void BodyRotationLogic() { //IL_004b: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) if (currentState == State.CreepyStare) { if (!(stateTimerClient < 1f) && Object.op_Implicit((Object)(object)anim.lookTarget)) { RotateBodyTowards(((Component)anim.lookTarget.localCamera).transform.position, 0.2f); } } else if (currentState == State.PlaceBalloon && balloonPlacements != null && balloonPlacements.Count != 0) { int num = (int)(stateTimerClient / balloonInterval); if (num >= balloonPlacements.Count) { visualMesh.localRotation = Quaternion.Slerp(visualMesh.localRotation, Quaternion.identity, Time.deltaTime * 2f); return; } if (num >= balloonPlacements.Count) { num = balloonPlacements.Count - 1; } int index = balloonPlacements[num]; RotateBodyTowards(balloonSpawnPoints[index].position, 2f); } else if (currentState == State.LookAround) { if (stateTimerClient > 1.5f) { Quaternion val = Quaternion.Euler(0f, 180f, 0f); visualMesh.localRotation = Quaternion.Slerp(visualMesh.localRotation, val, Time.deltaTime * 2f); } } else if (currentState == State.PlayerNotice && Object.op_Implicit((Object)(object)playerTarget)) { RotateBodyTowards(((Component)playerTarget.localCamera).transform.position, 4f); } else { visualMesh.localRotation = Quaternion.Slerp(visualMesh.localRotation, Quaternion.identity, Time.deltaTime * 2f); } } private void RotateHeadTowardsPlayer(float speed = 1f, bool clamp = true) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00c2: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_01b2: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = (Object.op_Implicit((Object)(object)playerTarget) ? playerTarget : anim.lookTarget); if (!Object.op_Implicit((Object)(object)val)) { return; } Vector3 position; if (SemiFunc.IsMultiplayer() && !val.isLocal) { position = val.playerAvatarVisuals.headLookAtTransform.position; } else { position = ((Component)val.localCamera).transform.position; position.y -= 0.3f; } Vector3 val2 = position - headPivot.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; if (!(((Vector3)(ref normalized)).sqrMagnitude < 1E-06f)) { Quaternion val3 = Quaternion.LookRotation(normalized, Vector3.up); Quaternion val4 = Quaternion.Inverse(Object.op_Implicit((Object)(object)headPivot.parent) ? headPivot.parent.rotation : Quaternion.identity) * val3; headPivot.localRotation = Quaternion.Slerp(headPivot.localRotation, val4, Time.deltaTime * Mathf.Max(0f, speed)); if (clamp) { Vector3 localEulerAngles = headPivot.localEulerAngles; float num = Mathf.DeltaAngle(0f, localEulerAngles.x); float num2 = Mathf.DeltaAngle(0f, localEulerAngles.y); num = Mathf.Clamp(num, 0f - maxHeadRotationUpDown, maxHeadRotationUpDown); num2 = Mathf.Clamp(num2, 0f - maxHeadRotationLeftRight, maxHeadRotationLeftRight); headPivot.localRotation = Quaternion.Euler(num, num2, 0f); } } } private void HeadRotationLogic() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_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_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) if (currentState == State.LookAround) { Quaternion val = Quaternion.Euler(0f, Mathf.Sin(Time.time * 2f) * 75f, 0f); headPivot.localRotation = Quaternion.Slerp(headPivot.localRotation, val, Time.deltaTime * 2f); } else if (currentState == State.CreepyStare) { if (!(stateTimerClient < 0.5f)) { RotateHeadTowardsPlayer(); } } else if (LookAtTargetPlayerState() && currentState != State.AttackUnder) { RotateHeadTowardsPlayer(); } else if (currentState == State.PlaceBalloon && !startOfStateClient && balloonPlacements != null && balloonPlacements.Count != 0 && !blowing) { int num = (int)(stateTimerClient / balloonInterval); if (num >= balloonPlacements.Count) { num = balloonPlacements.Count - 1; } if (num < 0) { num = 0; } int index = balloonPlacements[num]; Quaternion val2 = Quaternion.LookRotation(balloonSpawnPoints[index].position - headPivot.position, Vector3.up); headPivot.rotation = Quaternion.Slerp(headPivot.rotation, val2, Time.deltaTime * 2f); Vector3 localEulerAngles = headPivot.localEulerAngles; float num2 = Mathf.DeltaAngle(0f, localEulerAngles.x); float num3 = Mathf.DeltaAngle(0f, localEulerAngles.y); num2 = Mathf.Clamp(num2, 0f - maxHeadRotationUpDown, maxHeadRotationUpDown); num3 = Mathf.Clamp(num3, 0f - maxHeadRotationLeftRight, maxHeadRotationLeftRight); headPivot.localRotation = Quaternion.Euler(num2, num3, 0f); } else if (currentState == State.PlayerNotice || currentState == State.GoToPlayerAngry) { RotateHeadTowardsPlayer(2f); } else if (currentState == State.Investigate) { Quaternion val3 = Quaternion.LookRotation(enemy.StateInvestigate.onInvestigateTriggeredPosition - headPivot.position, Vector3.up); headPivot.rotation = Quaternion.Slerp(headPivot.rotation, val3, Time.deltaTime * 2f); Vector3 localEulerAngles2 = headPivot.localEulerAngles; float num4 = Mathf.DeltaAngle(0f, localEulerAngles2.x); float num5 = Mathf.DeltaAngle(0f, localEulerAngles2.y); num4 = Mathf.Clamp(num4, 0f - maxHeadRotationUpDown, maxHeadRotationUpDown); num5 = Mathf.Clamp(num5, 0f - maxHeadRotationLeftRight, maxHeadRotationLeftRight); headPivot.localRotation = Quaternion.Euler(num4, num5, 0f); } else { headPivot.localRotation = Quaternion.Slerp(headPivot.localRotation, Quaternion.identity, Time.deltaTime * 2f); } } private void CheckForDuplicates() { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) List enemiesSpawned = EnemyDirector.instance.enemiesSpawned; int num = 0; int num2 = 0; foreach (EnemyParent item in enemiesSpawned) { if (Object.op_Implicit((Object)(object)item) && ((Object)item).name == "Enemy - Birthday boy(Clone)") { if ((Object)(object)item == (Object)(object)enemyParent) { myIndex = num2; } num++; } num2++; } if (num != 1 && myIndex != 0 && myIndex < 8) { balloonColor = colors[myIndex % colors.Length]; ((Renderer)((Component)animatingBalloon).GetComponentInChildren()).material.SetColor("_BaseColor", balloonColor); ((Renderer)((Component)animatingBalloon).GetComponentInChildren()).material.SetColor("_EmissionColor", balloonColor * 0.28f); } } public bool AttackState() { if (currentState != State.Attack && currentState != State.AttackUnder && currentState != State.AttackUnderStart) { return currentState == State.AttackOver; } return true; } private bool PlayerTargetState() { if (currentState != State.Attack && currentState != State.GoToPlayerAngry && currentState != State.AttackUnder && currentState != State.AttackUnderStart) { return currentState == State.AttackOver; } return true; } private bool CreepyStareStartState() { return currentState == State.Idle; } private bool CloseToNavMeshTarget(float _treshold = 1.5f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) return Mathf.Abs(Vector3.Distance(((Component)this).transform.position, enemy.NavMeshAgent.GetDestination())) < _treshold; } private bool VisionRelevantState() { if (currentState != State.SeekPlayer && currentState != State.Investigate && currentState != State.LookAround) { if (currentState == State.GoToBalloonAngry) { return CloseToNavMeshTarget(5f); } return false; } return true; } private bool LookAtTargetPlayerState() { if (currentState != State.Attack && currentState != State.AttackUnder && currentState != State.AttackUnderStart && currentState != State.AttackOver) { return currentState == State.StandUp; } return true; } private bool PlayerOnNavMesh() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)playerTarget)) { return false; } NavMeshHit val = default(NavMeshHit); return NavMesh.SamplePosition(((Component)playerTarget).transform.position, ref val, 0.5f, -1); } private bool NavMeshState() { if (currentState != State.AttackUnder && currentState != State.AttackOver && currentState != State.AttackUnderStart && currentState != State.FlyBackUp && currentState != State.FlyBackToNavMesh) { return currentState != State.Stunned; } return false; } private bool FlyState() { if (currentState != State.FlyBackUp) { return currentState == State.FlyBackToNavMesh; } return true; } private float CheckIfPlayersNearbyPop(Vector3 _pos) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) List list = SemiFunc.PlayerGetList(); float num = float.PositiveInfinity; foreach (PlayerAvatar item in list) { Vector3 position = ((Component)item).transform.position; if (item.isDisabled) { position = ((Component)item.playerDeathHead).transform.position; } position.y = 0f; Vector3 val = _pos; val.y = 0f; float num2 = Vector3.Distance(position, val); if (num2 < num) { num = num2; } } return num; } private List GetNonCollidingBalloonSpawnPoints() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_0038: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < balloonSpawnPoints.Count; i++) { Vector3 position = balloonSpawnPoints[i].position; if (!IsColliding(balloonCollisionChecker, position) && !IsCollidingWithOtherBalloons(position) && !IsTooCloseToExistingBalloons(position, preferredBalloonDistance)) { list.Add(i); } } return list; } private List GetBalloonSpawnPointIndexes(List _nonCollidingBalloonSpawnPoints) { //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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0146: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) List list = new List(); int num = Mathf.Min(_nonCollidingBalloonSpawnPoints.Count, minBalloonsPerPlacement); int num2 = Mathf.Min(_nonCollidingBalloonSpawnPoints.Count, maxBalloonsPerPlacement); if (balloons.Count < maxBalloons) { num2 = Mathf.Min(num2, maxBalloons - balloons.Count); if (num > num2) { num = num2; } } int num3 = Random.Range(num, num2); for (int i = 0; i < num3; i++) { int num4 = 0; bool flag = false; int num5; do { int index = Random.Range(0, _nonCollidingBalloonSpawnPoints.Count); num5 = _nonCollidingBalloonSpawnPoints[index]; if (!list.Contains(num5)) { Vector3 position = balloonSpawnPoints[num5].position; flag = true; foreach (int item in list) { Vector3 position2 = balloonSpawnPoints[item].position; if (Vector3.Distance(position, position2) < preferredBalloonDistance) { flag = false; SemiLogger.LogMonika((object)(" Too close to already selected point. Distance: " + Vector3.Distance(position, position2)), (GameObject)null, (Color?)null, true, true); break; } SemiLogger.LogMonika((object)("Not too close. Distance: " + Vector3.Distance(position, position2)), (GameObject)null, (Color?)null, true, true); } } num4++; } while (num4 <= 50 && !flag); if (flag) { list.Add(num5); } } return list; } private PlayerAvatar PlayerNearby() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar result = null; float num = float.MaxValue; foreach (PlayerAvatar item in SemiFunc.PlayerGetList()) { if (!item.isDisabled) { float num2 = Vector3.Distance(((Component)item).transform.position, ((Component)this).transform.position); if (num2 < num) { result = item; num = num2; } } } if (num <= 10f) { return result; } return null; } private void ToggleShrinkCollider(bool _active) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { photonView.RPC("ToggleShrinkColliderRPC", (RpcTarget)0, new object[1] { _active }); } else { ToggleShrinkColliderRPC(_active); } } private Collider[] GetCollidingColliders(Transform _collisionChecker, Vector3 _pos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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) return Physics.OverlapBox(_pos, _collisionChecker.lossyScale / 2f, _collisionChecker.rotation); } private bool NearbyDoor(Vector3 _pos) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) Collider[] collidingColliders = GetCollidingColliders(doorCollisionChecker, _pos); for (int i = 0; i < collidingColliders.Length; i++) { if (((Component)collidingColliders[i]).gameObject.layer == LayerMask.NameToLayer("PhysGrabObjectHinge")) { return true; } } return false; } private unsafe bool IsColliding(Transform _collisionChecker, Vector3 _pos, bool _collideWithPlayer = true) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) Collider[] collidingColliders = GetCollidingColliders(_collisionChecker, _pos); Collider[] array = collidingColliders; foreach (Collider val in array) { if (((Component)val).gameObject.layer == LayerMask.NameToLayer("RoomVolume") || ((Component)val).gameObject.layer == LayerMask.NameToLayer("Triggers") || ((Component)val).transform.IsChildOf(((Component)this).transform) || ((Component)val).transform.IsChildOf(((Component)enemy.EnemyParent).transform) || !(((Object)val).name != "Trigger Collider Balloon (Hurt collider)") || ((Object)val).name.Contains("Level Point")) { continue; } BirthdayBoyBalloon componentInParent = ((Component)val).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent) && componentInParent.placerIndex != myIndex) { if (componentInParent.placerIndex != myIndex) { return true; } } else if ((_collideWithPlayer || !((Component)val).CompareTag("Player")) && ((Component)val).gameObject.layer != LayerMask.NameToLayer("StaticGrabObject")) { string name = ((Object)val).name; Vector3 val2 = _pos; SemiLogger.LogMonika((object)("Colliding with: " + name + " at position: " + ((object)(*(Vector3*)(&val2))/*cast due to .constrained prefix*/).ToString()), (GameObject)null, (Color?)null, true, true); return true; } } return false; } private unsafe bool IsCollidingWithOtherBalloons(Vector3 _pos) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0053: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair balloon in balloons) { float num = Mathf.Abs(balloon.Key.y - _pos.y); if (Mathf.Abs(balloon.Key.x - _pos.x) < balloonCollisionChecker.lossyScale.x / 2f && num < balloonCollisionChecker.lossyScale.y / 2f) { string text = ((object)balloon.Key/*cast due to .constrained prefix*/).ToString(); Vector3 val = _pos; SemiLogger.LogMonika((object)("Colliding with other balloon at: " + text + "position: " + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString()), (GameObject)null, (Color?)null, true, true); return true; } } return false; } private bool IsTooCloseToExistingBalloons(Vector3 _pos, float _minDistance) { //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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair balloon in balloons) { if (Vector3.Distance(balloon.Key, _pos) < _minDistance) { return true; } } foreach (EnemyParent item in EnemyDirector.instance.enemiesSpawned) { if (!Object.op_Implicit((Object)(object)item) || !(((Object)item).name == "Enemy - Birthday boy(Clone)")) { continue; } PibePlateado componentInChildren = ((Component)item).GetComponentInChildren(); if (!Object.op_Implicit((Object)(object)componentInChildren) || !((Object)(object)componentInChildren != (Object)(object)this)) { continue; } foreach (KeyValuePair balloon2 in componentInChildren.balloons) { if (Vector3.Distance(balloon2.Key, _pos) < _minDistance) { return true; } } } return false; } public void GetAngry() { if (SemiFunc.IsMasterClientOrSingleplayer() && !enemy.IsStunned() && currentState != State.FlyBackUp && currentState != State.FlyBackToNavMesh && currentState != State.LookAround && currentState != State.PlayerNotice && currentState != State.Despawn && !AttackState()) { stateTimer = 20f; UpdateState(State.LookAround); } } } }