protected void GetHit(bool isRight, float damage) { if (state == State.Dead) { return; } health -= damage; if (health <= 0) { StopAllCoroutines(); nagaManager.EnrageFemaleNaga(); SetDead(isRight, this.GetType(), 0); nagaManager.Died(false); animator.SetBool("IsChannellingWhirlwind", false); animator.SetBool("IsWindingUpWhirlwind", false); this.enabled = false; nagaManager.HideHealthbar(false); if (spawnedWhirlwindObject != null) { spawnedWhirlwindObject.GetComponent <NagaKingWhirlwindEffect>().Stop(); } target.GetComponent <Player>().AddEnemyKilledToCount(this.GetType()); } else { bool stagger = false; if (staggerCounter + 1 <= maxStaggerCount) { stagger = true; } if (stagger) { staggerCounter += 1; SetStaggered(isRight); } nagaManager.UpdateHealthbar(false, health, maxHealth); } sound.PlayOneShot(getHitSound); cameraController.Shake(damage); ParticleEffectManager.PlayEffect(ParticleEffect.Type.blood, coll.bounds.center, isRight ? Vector3.left : Vector3.right); }
protected void GetHit(bool isRight, float damage) { if (state == State.Dead || !canTakeDamage) { return; } health -= damage; if (health <= 0) { StopAllCoroutines(); SetDead(isRight, this.GetType()); nagaManager.Died(true); nagaManager.StopPlayingBossMusic(); nagaManager.HideHealthbar(true); target.GetComponent <Player>().AddEnemyKilledToCount(this.GetType()); } Teleport(); nagaManager.UpdateHealthbar(true, health, maxHealth); sound.PlayOneShot(getHitSound); cameraController.Shake(damage); ParticleEffectManager.PlayEffect(ParticleEffect.Type.blood, coll.bounds.center, isRight ? Vector3.left : Vector3.right); }
protected void GetHit(bool isRight, float damage) { if (state == State.Dead) { return; } health -= damage; if (health <= 0) { StopAllCoroutines(); nagaManager.EnrageMaleNaga(); SetDead(isRight, this.GetType(), 0); nagaManager.Died(true); nagaManager.HideHealthbar(true); this.enabled = false; target.GetComponent <Player>().AddEnemyKilledToCount(this.GetType()); } else { bool stagger = false; if (staggerCounter + 1 <= maxStaggerCount) { stagger = true; } if (stagger) { staggerCounter += 1; SetStaggered(isRight); } nagaManager.UpdateHealthbar(true, health, maxHealth); } sound.PlayOneShot(getHitSound); cameraController.Shake(damage); ParticleEffectManager.PlayEffect(ParticleEffect.Type.blood, coll.bounds.center, isRight ? Vector3.left : Vector3.right); }