private bool ExitDueToPlayerDeath() { if (transform.GetComponent <BaddieBoss>().GetTarget() == null) { print("Short circuiting because the target is dead"); ResetState(); OnComplete.Invoke(); return(true); } return(false); }
private void Update() { if (transform.GetComponent <BaddieBoss>().GetTarget() != null) { CheckForPlayerContact(); if (ShouldDragPlayer()) { _player.transform.position = transform.position; } } switch (_attackState) { case AttackState.TRAVEL: smoothTime = 0.5f; if (!_stateChangeInitiated) { _currentAttackPoint = GetClosestAttackPoint(); StartCoroutine(ChangeStateAfterSeconds(AttackState.POWERUP, 2f)); _stateChangeInitiated = true; } break; case AttackState.POWERUP: if (!_stateChangeInitiated) { AudioManager.Instance.PlaySound("PowerUp"); ToggleFacingLock.Invoke(false); Animator.SetBool("Attack3_CROUCH", true); Animator.SetBool("Attack3_CHARGEUP", true); StartCoroutine(ChangeStateAfterSeconds(AttackState.CHARGE, 3f)); _stateChangeInitiated = true; } break; case AttackState.CHARGE: Animator.SetBool("Attack3_CROUCH", false); Animator.SetBool("Attack3_CHARGEUP", false); _currentAttackPoint = _chargeAttackPoint; smoothTime = 0.2f; if (!_stateChangeInitiated) { AudioManager.Instance.StopSound("PowerUp"); AudioManager.Instance.PlaySound("Charge"); Animator.SetBool("Attack3_DASH", true); StartCoroutine(ChangeStateAfterSeconds(AttackState.WALLSMASH, 0.3f)); _stateChangeInitiated = true; } break; case AttackState.END: ResetState(); OnComplete.Invoke(); break; case AttackState.WALLSMASH: smoothTime = 0.3f; if (!_stateChangeInitiated) { _stateChangeInitiated = true; ShakeCamera.Invoke(); PlaySmashSound(); if (_contactedPlayer) { Animator.SetBool("Attack3_WALLSMASH", true); StartCoroutine(ChangeStateAfterSeconds(AttackState.PIN, 0.3f)); } else { Animator.SetBool("Attack3_WALLSMASH", true); Animator.SetBool("Attack3_BOUNCEBACK", true); StartCoroutine(ChangeStateAfterSeconds(AttackState.WEAK, 0.5f)); } } break; case AttackState.PIN: smoothTime = 1f; if (!_stateChangeInitiated) { Animator.SetBool("Attack3_WALLSMASH", false); Animator.SetBool("Attack3_PIN", true); StartCoroutine(ChangeStateAfterSeconds(AttackState.STAND, 3f)); _stateChangeInitiated = true; } break; case AttackState.WEAK: smoothTime = 1f; if (!_stateChangeInitiated) { ApplyDamageModifierForWeakSpot.Invoke(8); Animator.SetBool("Attack3_BOUNCEBACK", false); Animator.SetBool("Attack3_WALLSMASH", false); Invoke("ToggleLockFacingBackOn", 0.1f); Animator.SetBool("Attack3_WEAK", true); StartCoroutine(ChangeStateAfterSeconds(AttackState.STAND, 3f)); _stateChangeInitiated = true; } break; case AttackState.STAND: Animator.SetBool("Attack3_WEAK", false); Animator.SetBool("Attack3_PIN", false); if (!_standupCalled) { Animator.SetBool("Attack3_STANDUP", true); _standupCalled = true; } else { Animator.SetBool("Attack3_STANDUP", false); } if (!_stateChangeInitiated) { StartCoroutine(ChangeStateAfterSeconds(AttackState.END, 1f)); _stateChangeInitiated = true; } break; case AttackState.DEFAULT: default: return; } CalculateVelocity(); }
private void TriggerAttackComplete() { AttackComplete?.Invoke(); }
private void AttackCompleteHandler() => AttackComplete?.Invoke();
private void AcctackCompleteHandler() { _agressiveBehaviour.Complete -= AcctackCompleteHandler; _agressiveBehaviour.Cancel(); AttackComplete?.Invoke(); }
public void PlayAttackAnimation() { AttackComplete?.Invoke(); }