Answer:
v = .5 c speed of observer relative to spaceship
V1 = -.4 c speed of protons from gun (sway from observer)
V2 = (V1 - v) / (1 - v V1 / c^2) speed of protons measured by observer
V2 = (-.4 c - (.5 c)) / (1 - (.5 c) (-.4 c ) / c^2))
V2 = -.9 c / (1 + .2) = -.75 c
One must use care in assigning signs to velocities
An observer sees the spaceship moving away at -.5 c while the protons are moving at .4 c in the positive direction