http://home.midmaine.com/~lilwhitemo/queen.zip
The ACS for the AI is in WAR.WAD.
I forgot to include the #INCLUDE'd file. Here's it's contents:
Spoiler:Code: Select all
world int 0:EID; world int 1:FID; world int 2:AS; world int 3:ES; function int range (int TID1, int TID2) { int rngx = (GetActorX(TID1) - GetActorX(TID2))/65536; int rngtmp = rngx * rngx; rngx = rngtmp; int rngy = (GetActorY(TID1) - GetActorY(TID2))/65536; rngtmp = rngy * rngy; rngy = rngtmp; rngtmp = rngx + rngy; return rngtmp; } function int xoffset (int t, int fo, int doff) { int facing = GetActorAngle(t) + fo; if (facing >= 65536){facing = facing - 65536;} if (facing < 0){facing = facing + 65536;} int fm = 1; if (facing >= 32768) { facing = facing - 32768; fm = -1; } int x = cos(facing) / (65536 / doff) * fm; return x; } function int yoffset (int t, int fo, int doff) { int facing = GetActorAngle(t) + fo; if (facing >= 65536){facing = facing - 65536;} if (facing < 0){facing = facing + 65536;} int fm = 1; if (facing >= 32768) { facing = facing - 32768; fm = -1; } int y = sin(facing) / (65536 / doff) * fm; return y; } function int sqrt (int x) { int r; x = (x + 1) >> 1; r = 0; while (x > r) { x -= r++; } return r; } function int abs (int x) { if (x < 0) return -x; return x; } function int neg (int x) { if (x >= 0) return 0; return (-1); } function int los (int t1, int t2) { int x = (GetActorX(t1) - GetActorX(t2)); int y = (GetActorY(t1) - GetActorY(t2)); if (abs(VectorAngle(x, y) - GetActorAngle(t2)) < 6000) return 1; return 0; } function int GetClosestE (int tid) { int cthing = 1999; int cdist; for (int i=2000; i<=EID; i++) { int dist = 0; if (ThingCount (0, i) != 0) { int x = GetActorX (tid) - GetActorX (i) >> 16; int y = GetActorY (tid) - GetActorY (i) >> 16; int z = GetActorZ (tid) - GetActorZ (i) >> 16; dist = x*x + y*y + z*z; if (dist < cdist) { cdist = dist; cthing = i; } if (cthing == 1999) { cdist = dist; cthing = i; } } } if (cthing != 1999) { return cthing; } return 0; } function int GetClosestE2 (int tid) { int cthing = 999; int cdist; for (int i=1000; i<=EID+19; i++) { int dist = 0; if (ThingCount (0, i) != 0) { int x = GetActorX (tid) - GetActorX (i) >> 16; int y = GetActorY (tid) - GetActorY (i) >> 16; int z = GetActorZ (tid) - GetActorZ (i) >> 16; dist = x*x + y*y + z*z; if (dist < cdist && random (0, 2) == 0) { cdist = dist; cthing = i; } if (cthing == 999) { cdist = dist; cthing = i; } } } if (cthing != 999) { return cthing; } return 0; } function int GetClosestSB (int tid) { int cthing = 999; int cdist; for (int i=1000; i<=EID+19; i++) { int dist = 0; if (ThingCount (0, i) != 0) { int x = GetActorX (tid) - GetActorX (i) >> 16; int y = GetActorY (tid) - GetActorY (i) >> 16; int z = GetActorZ (tid) - GetActorZ (i) >> 16; dist = x*x + y*y + z*z; if (dist < cdist & random (0, 2) == 0 && dist < 1048576) { cdist = dist; cthing = i; } if (cthing == 999) { cdist = dist; cthing = i; } } } if (cthing != 999) { return cthing; } return 0; } function int GetClosestA (int tid) { int cthing = 254; int cdist; for (int i=255; i<=FID; i++) { int dist = 0; if (ThingCount (0, i) != 0) { int x = GetActorX (tid) - GetActorX (i) >> 16; int y = GetActorY (tid) - GetActorY (i) >> 16; int z = GetActorZ (tid) - GetActorZ (i) >> 16; dist = x*x + y*y + z*z; if (dist < cdist && random (0, 2) != 0) { cdist = dist; cthing = i; } if (cthing == 254) { cdist = dist; cthing = i; } } } if (cthing != 254) { return cthing; } return 0; } function int GetClosestA2 (int tid) { int cthing = 254; int cdist; for (int i=255; i<=FID; i++) { int dist = 0; if (ThingCount (0, i) != 0) { int x = GetActorX (tid) - GetActorX (i) >> 16; int y = GetActorY (tid) - GetActorY (i) >> 16; int z = GetActorZ (tid) - GetActorZ (i) >> 16; dist = x*x + y*y + z*z; if (dist < cdist && random (0, 2) == 0) { cdist = dist; cthing = i; } if (cthing == 254) { cdist = dist; cthing = i; } } } if (cthing != 254) { return cthing; } return 0; }