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; [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] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } [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 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_0154: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) if ((currentState != State.PlayerPickup && currentState != State.PlayerMove && currentState != State.PlayerRelease) || !Object.op_Implicit((Object)(object)playerTarget) || playerTarget.isDisabled) { return; } if (playerTarget.isLocal) { playerTarget.physGrabber.OverrideDisableSpecialGrabPowers(1f); } 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); 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; playerTarget.voiceChat.OverridePitch(1.35f, 0.3f, 2f, 0.1f, 0f, 0f); 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 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)(ref val2)).ToString()), (GameObject)null, (Color?)null, true, true); return true; } } return false; } private 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) { Vector3 key = balloon.Key; string text = ((object)(Vector3)(ref key)).ToString(); Vector3 val = _pos; SemiLogger.LogMonika((object)("Colliding with other balloon at: " + text + "position: " + ((object)(Vector3)(ref val)).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); } } } }