N@Turret Swap Roll
I@Xi Yi Zi Lock
O@Pa Ya Ra Fire R1
interval(20)
Fw = extdirfw()
T = vecsub(vector(Xi, Yi, Zi+5), extpos())
P1 = angnorm(vecpitch(Fw) - vecpitch(T))
Y1 = angnorm(vecyaw(Fw) - vecyaw(T))
R1 = angnorm(extangr())
P2 = P1 + $P1 * 5
Y2 = Y1 + $Y1 * 5
R2 = angnorm($R1)
Pa = (cos(R1)*P2+sin(R1)*Y2)*Lock
Ya = (cos(R1)*Y2+sin(-R1)*P2)*Lock
Ra = (R2 + $R2 * 5) * Lock
Fire = Lock & (abs(P1) < 2) & (abs(Y1) < 2)
