Castle shield damage or not?

I know when your castle gets attacked the shield takes damage. If a teammate attacks back with shield still on does it take damage or is it only the enemy attacking that does damage to shield?

Does it?

Only the troops you lose when the enemy attacks. Troops you lose in an attack don’t count towards the bubble

Oh you mean # troops to bubble. If that’s the case, then no. Troops lost by castle owner attacking someone on their own castle doesn’t count towards shield bubble.

Thank you