예제 #1
0
        public void ArmorDamage(coPlayerData datablock, coPlayer player, TransformF position, coPlayer sourceobject, float damage, string damageType)
            {
            if (!player.isObject())
                return;
            if (player.getState() == "Dead")
                return;
            if (damage == 0.0)
                return;


            player.applyDamage(damage);

            const string location = "Body";

            //PlayerUpdateHealth(player);

            coGameConnection client = player["client"];
            //Only continue if it is a player, if it is an AI return.
            if (!client.isObject())
                return;


            coGameConnection sourceClient = null;
            if (sourceobject != 0)
                sourceClient = sourceobject["client"];


            if (player.getDamageLevel() >= 99)
                player.unmountImage(0);

            // Determine damage direction
            if (damageType != "Suicide")
                PlayerSetDamageDirection(player, sourceobject, position);

            if (player.getState() == "Dead")
                GameConnectionOnDeath(client, sourceobject, sourceClient, damageType, location);
            }