Exemple #1
0
        public virtual void TakeDamage(int damage, int poiseDamage)
        {
            if (isDead)
            {
                return;
            }

            weaponSlotManager.CloseDamageCollider();

            UpdateHealth(-damage);

            if (!isStaggered)
            {
                currentPoiseBuildUp += poiseDamage;
            }

            if (currentHealth <= 0)
            {
                animatorHandler.PlayTargetAnimation("Death 01", true);
                isDead = true;
                HandleDeath();
            }
            else if (currentPoiseBuildUp > poise)
            {
                currentPoiseBuildUp = 0;
                animatorHandler.PlayTargetAnimation("Damage Light", true);
                isStaggered = true;
            }
        }
Exemple #2
0
        public virtual void TakeDamage(int damage, int poiseDamage, float?attackAngle = null)
        {
            BlockingCollider shield = transform.GetComponentInChildren <BlockingCollider>();

            if (isBlocking && shield != null && attackAngle > 90)
            {
                damage = Mathf.RoundToInt(damage - (damage * shield.blockingPhysicalDamageAbsorbtion) / 100);
                int staminaDamage = poiseDamage * (100 / shield.stability);
                stats.TakeStaminaDamage(staminaDamage);
                poiseDamage = 0;
                animatorHandler.PlayTargetAnimation("Block Impact", true);
            }
            stats.TakeDamage(damage, poiseDamage);
        }