Exemple #1
0
 public HitInfo(DamageInfo damage, Vector3 point, bool shouldShowEffect, HitSources source)
 {
     this.Damage = damage;
     this.Point = point;
     this.ShouldShowEffect = shouldShowEffect;
     this.Source = source;
 }
Exemple #2
0
        public int CalculateFinalDamage(DamageInfo damage, bool fromPlayer = false)
        {
            int final = 0;

            final = (int)(Random.Range(damage.minPhysical, damage.maxPhysical) * (1f - Mathf.Clamp(Physical, 0f, 1f)));
            final += (int)(damage.fire * (1f - Mathf.Clamp(Fire, 0f, 1f)));
            final += (int)(damage.ice * (1f - Mathf.Clamp(Ice, 0f, 1f)));
            final += (int)(damage.lightning * (1f - Mathf.Clamp(Lightning, 0f, 1f)));
            final += (int)(damage.water * (1f - Mathf.Clamp(Water, 0f, 1f)));

            return final;
        }