Exemplo n.º 1
0
 private void Awake()
 {
     animatorHandler   = GetComponentInChildren <PlayerAnimatorHandler>();
     inputHandler      = GetComponent <InputHandler>();
     playerStats       = GetComponent <PlayerStats>();
     weaponSlotManager = GetComponentInChildren <PlayerWeaponSlotManager>();
     playerManager     = GetComponent <PlayerManager>();
     blockingCollider  = GetComponentInChildren <BlockingCollider>();
 }
Exemplo n.º 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);
        }