Added the ability to suppress newer features with a game type option.
[super-star-trek.git] / ai.c
diff --git a/ai.c b/ai.c
index 291c2f7bc99c6799b9ec3d8aa2fa55c7171161dd..a1b4bbf6f92ef101dc9ac53ed5a8b3af39f8fcde 100644 (file)
--- a/ai.c
+++ b/ai.c
@@ -151,7 +151,7 @@ static void movebaddy(int comx, int comy, int loccom, int ienm)
        else {
            if (forces > 1000.0) /* Very strong -- move in for kill */
                motion = (1.0-square(Rand()))*dist1 + 1.0;
-           if (condit==IHDOCKED) /* protected by base -- back off ! */
+           if (condit==IHDOCKED && (game.options & OPTION_BASE)) /* protected by base -- back off ! */
                motion -= skill*(2.0-square(Rand()));
        }
 #ifdef DEBUG
@@ -213,7 +213,7 @@ static void movebaddy(int comx, int comy, int loccom, int ienm)
                looky = nexty + krawly;
                krawly = -krawly;
            }
-           else if (game.quad[lookx][looky] != IHDOT) {
+           else if ((game.options & OPTION_RAMMING) && game.quad[lookx][looky] != IHDOT) {
                /* See if we should ram ship */
                if (game.quad[lookx][looky] == ship &&
                    (ienm == IHC || ienm == IHS)) {
@@ -294,12 +294,13 @@ void movcom(void)
     /* if skill level is high, move other Klingons and Romulans too!
        Move these last so they can base their actions on what the
        commander(s) do. */
-    if (skill >= SKILL_EXPERT) for_local_enemies(i) {
-       ix = game.kx[i];
-       iy = game.ky[i];
-       if (game.quad[ix][iy] == IHK || game.quad[ix][iy] == IHR)
-           movebaddy(ix, iy, i, game.quad[ix][iy]);
-    }
+    if (skill >= SKILL_EXPERT && (game.options & OPTION_MVBADDY)) 
+       for_local_enemies(i) {
+           ix = game.kx[i];
+           iy = game.ky[i];
+           if (game.quad[ix][iy] == IHK || game.quad[ix][iy] == IHR)
+               movebaddy(ix, iy, i, game.quad[ix][iy]);
+       }
 
     sortkl();
 }
@@ -378,7 +379,7 @@ void scom(int *ipage)
 #endif
 
     /* Decide on being active or passive */
-    flag = ((game.state.killc+game.state.killk)/(game.state.date+0.01-indate) < 0.1*skill*(skill+1.0) ||
+    flag = ((NKILLC+NKILLK)/(game.state.date+0.01-indate) < 0.1*skill*(skill+1.0) ||
            (game.state.date-indate) < 3.0);
     if (iscate==0 && flag) {
        /* compute move away from Enterprise */