Esempio n. 1
0
 /// <summary>
 /// Receive a hit and modify it to represent actual damage inflicted. This will take into account
 /// defense and other passive abilities. The hit returned can then be passed to the ReceiveHit
 /// method to execute the hit, or simply read for AI processing.
 /// </summary>
 /// <param name="hit">A hit generated by a call to Ability.GenerateHits().</param>
 public Hit ProcessHit(Hit hit)
 {
     return hit;
 }
Esempio n. 2
0
        /// <summary>
        /// Inflict the damage/healing/status ailments from a hit. The hit should be run through ProcessHit
        /// beforehand to ensure that damage is adjusted by armor and passive abilities.
        /// </summary>
        /// <param name="hit"></param>
        public void ReceiveHit(Hit hit)
        {
            if (hit.Damage > 0)
            {
                CurrentHealth -= hit.Damage;
                return;
            }

            var heal = hit.Damage < CurrentHealth - MaxHealth ? CurrentHealth - MaxHealth : hit.Damage;
            CurrentHealth += Math.Abs(heal);
            return;
        }
Esempio n. 3
0
 /// <summary>
 /// Receive a hit and modify it to represent actual damage inflicted. This will take into account
 /// defense and other passive abilities. The hit returned can then be passed to the ReceiveHit
 /// method to execute the hit, or simply read for AI processing.
 /// </summary>
 /// <param name="hit">A hit generated by a call to Ability.GenerateHits().</param>
 public Hit ProcessHit(Hit hit)
 {
     return(hit);
 }