Limited Weapon usage and boss fight in a space game

I need help creating limited special weapons. I don’t know what the best way to do it is. I also need help creating a boss that won’t leave the screen have a set amount of life and fire at my character no matter where he is at.