public bool ProtectedByShield(GameObject player)
    {
        // Check for player proximity to mage with activated shield
        if (isPowerOn)
        {
            if (Vector2.Distance(player.transform.position, transform.position) <= shieldArea)
            {
                return(true);
            }
        }

        PowerableObject[] powerables = FindObjectsOfType <PowerableObject>();

        foreach (PowerableObject powerable in powerables)
        {
            if (powerable.IsPowered())
            {
                PowerableObject.Power power = powerable.GetActivatedPower();

                if (power.caster != null)
                {
                    if (power.caster.Equals(this))
                    {
                        if (power.InPowerArea(player, true))
                        {
                            return(true);
                        }
                    }
                }
                else if (power.attack != null)
                {
                    if (power.attack.GetType().Equals(new FireballController().GetType()))
                    {
                        if (power.InPowerArea(player, true))
                        {
                            return(true);
                        }
                    }
                }

                else if (power.expectedParticle != null)
                {
                    if (power.expectedParticle.GetType().Equals(new MagePoweredParticles().GetType()))
                    {
                        if (power.InPowerArea(player, true))
                        {
                            return(true);
                        }
                    }
                }
            }
        }
        return(false);
    }
    public bool IsElectrified(GameObject playerOrMovable)
    {
        PowerableObject[] powerables = FindObjectsOfType <PowerableObject>();

        foreach (PowerableObject powerable in powerables)
        {
            if (powerable.IsPowered())
            {
                PowerableObject.Power power = powerable.GetActivatedPower();

                if (power.caster != null)
                {
                    if (power.caster.Equals(this))
                    {
                        if (power.InPowerArea(playerOrMovable, true))
                        {
                            return(true);
                        }
                    }
                }
                else if (power.attack != null)
                {
                    if (power.attack.GetType().Equals(new ProjectileController().GetType()))
                    {
                        if (power.InPowerArea(playerOrMovable, true))
                        {
                            return(true);
                        }
                    }
                }

                else if (power.expectedParticle != null)
                {
                    if (power.expectedParticle.GetType().Equals(new EngineerPoweredParticles().GetType()))
                    {
                        if (power.InPowerArea(playerOrMovable, true))
                        {
                            return(true);
                        }
                    }
                }
            }
        }
        return(false);
    }