Beispiel #1
0
        public void Hit(HitInfo hitInfo)
        {
            if (health <= 0)
                return;

            int damage = hitInfo.Damage.maxPhysical;
            health -= damage;

            Debug.Log("You hit " + name + " for " + damage + ".");

            if (health <= 0)
            {
                Debug.Log("You destroyed " + name + ".");
                Die();
            }

        }
Beispiel #2
0
        public void Hit(HitInfo hitInfo)
        {
            if (health <= 0)
                return;

            int damage = defenseInfo.CalculateFinalDamage(hitInfo.Damage);
            health -= damage;

            Debug.Log("You hit " + name + " for " + damage + "!");

            if (health <= 0)
            {
                if (hitInfo.Source == HitInfo.HitSources.Player)
                {
                    Player.PlayerController.Instance.statController.AddExperience(experience);
                }  

                Debug.Log("You killed " + name + "!");
                Die();
            }

        }