buttonState = analogRead(photosensor) < 700;
I find code like this rather annoying. That the sensor reading is less than 700 has nothing to do with the state of a button.
Don't use names that require thinking.
int buttonState = 0;
if (buttonState != lastButtonState && buttonState == HIGH && AmmoCount>0) {
buttonState is NOT a boolean. Don't use it like one.