예제 #1
0
파일: HitInfo.cs 프로젝트: mengtest/2DRPG
 public HitInfo(DamageInfo damage, Vector3 point, bool shouldShowEffect, HitSources source)
 {
     this.Damage = damage;
     this.Point = point;
     this.ShouldShowEffect = shouldShowEffect;
     this.Source = source;
 }
예제 #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;
        }