Beispiel #1
0
        // -----------------------------------------------------------------------------------
        // Hit
        // -----------------------------------------------------------------------------------
        public override void Hit(HitInfo hitInfo)
        {
            if (statistics.Health <= 0)
            {
                return;
            }

            DamageResult damageResult = Utl.DamageFormula(hitInfo.damage, resistances.resistances, hitInfo.source, this, hitInfo.baseAmount);

            hitInfo.amount = damageResult.amount;

            base.Hit(hitInfo);

            inventory.DamageEquipment((int)Mathf.Round(hitInfo.amount * hitInfo.damage.equipmentDamage));
        }
Beispiel #2
0
        // -----------------------------------------------------------------------------------
        // Hit
        // -----------------------------------------------------------------------------------
        public override void Hit(HitInfo hitInfo)
        {
            DamageResult damageResult = Utl.DamageFormula(hitInfo.damage, resistances.resistances, hitInfo.source, this, hitInfo.baseAmount);

            hitInfo.amount = damageResult.amount;

            base.Hit(hitInfo);

            StartShake();

            if (hitInfo.source is Player)
            {
                Obj.GetPlayer.AdjustProperty(rewardStatisticBoost);
            }

            if (hitInfo.isShowEffect && hitEffectObject != null)
            {
                GameObject hitEffect = Instantiate(hitEffectObject, hitInfo.point, Quaternion.identity) as GameObject;
                Destroy(hitEffect, 3);
            }
        }
Beispiel #3
0
 // -------------------------------------------------------------------------------
 // Death
 // -------------------------------------------------------------------------------
 protected override void Death()
 {
     Utl.SpawnItems(items, transform.position, dropPrefab);
     base.Death();
 }