コード例 #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
ファイル: DefenseInfo.cs プロジェクト: mengtest/2DRPG
        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;
        }