void OnTriggerEnter(Collider other)
 {
     if (other.GetComponent <Rigidbody>() != null)
     {
         rigidbodyStrikingMe = other.GetComponent <Rigidbody>();
         if (rigidbodyStrikingMe.mass >= massRequirement && rigidbodyStrikingMe.velocity.sqrMagnitude >= speedRequirement * speedRequirement)
         {
             damageToApply = (int)(rigidbodyStrikingMe.mass * rigidbodyStrikingMe.velocity.magnitude * damageFactor);
             nPCMaster.CallEventNPCDecreaseHealth(damageToApply);
         }
     }
 }
Exemple #2
0
        public void ProcessDamage(int damage)
        {
            int damageToApply = damage * damageMultiplier;

            nPCMaster.CallEventNPCDecreaseHealth(damageToApply);
        }