How about a way to remove the detriments of being shot by the cannon, unless there is an attack?
If an attack comes, then we add the detriments again to prevent the attackers.
When the attack ends, we can remove the detriments again.