예제 #1
0
        public bool TakeDamage(float amount, int projectileOwnerID)
        {
            if (projectileOwnerID == id || owner == projectileOwnerID)
            {
                return(false);
            }

            lastHitByPlayerID = projectileOwnerID;

            health -= amount;

            if (lastHitByPlayerID >= 0)
            {
                ServerSend.HitDamageObject(lastHitByPlayerID, health <= 0);
            }

            if (health <= 0)
            {
                health = maxHealth;
                ResetObject();
                return(true);
            }
            ServerSend.UpdateHealth(this);
            return(true);
        }