Ejemplo n.º 1
0
        /// <summary>
        /// Called when the mob's health reaches 0.
        /// </summary>
        public override void OnDeath(DamageSource par1DamageSource)
        {
            base.OnDeath(par1DamageSource);

            if ((par1DamageSource.GetSourceOfDamage() is EntityArrow) && (par1DamageSource.GetEntity() is EntityPlayer))
            {
                EntityPlayer entityplayer = (EntityPlayer)par1DamageSource.GetEntity();
                double       d            = entityplayer.PosX - PosX;
                double       d1           = entityplayer.PosZ - PosZ;

                if (d * d + d1 * d1 >= 2500D)
                {
                    entityplayer.TriggerAchievement(AchievementList.SnipeSkeleton);
                }
            }
        }