Remnove some generated autotools stuff from the repo.
[super-star-trek.git] / src / battle.c
index 8f45cfbcf682f4a44568a23d08953d331d454082..223a981b094037ef038a5584f44999b1b7f12f73 100644 (file)
@@ -239,8 +239,8 @@ void ram(bool ibumpd, feature ienm, coord w)
     }
     game.shldup = false;
     prout(_("***Shields are down."));
-    if (KLINGREM) {
-       pause_game(true);
+    if (game.state.remkl + game.state.remcom + game.state.nscrem) {
+       announce();
        damagereport();
     }
     else
@@ -399,7 +399,7 @@ void torpedo(double course, double r, coord in, double *hit, int i, int n)
            prout(_(" destroyed."));
            game.state.nplankl++;
            q->planet = NOPLANET;
-           DESTROY(&game.state.planets[game.iplnet]);
+           game.state.planets[game.iplnet].pclass = destroyed;
            game.iplnet = 0;
            invalidate(game.plnet);
            game.quad[w.x][w.y] = IHDOT;
@@ -413,7 +413,7 @@ void torpedo(double course, double r, coord in, double *hit, int i, int n)
            prout(_(" destroyed."));
            game.state.nworldkl++;
            q->planet = NOPLANET;
-           DESTROY(&game.state.planets[game.iplnet]);
+           game.state.planets[game.iplnet].pclass = destroyed;
            game.iplnet = 0;
            invalidate(game.plnet);
            game.quad[w.x][w.y] = IHDOT;
@@ -639,7 +639,7 @@ void attack(bool torps_ok)
            r = (Rand()+Rand())*0.5 -0.5;
            r += 0.002*game.kpower[loop]*r;
            torpedo(course, r, jay, &hit, 1, 1);
-           if (KLINGREM==0) 
+           if ((game.state.remkl + game.state.remcom + game.state.nscrem)==0) 
                finish(FWON); /* Klingons did themselves in! */
            if (game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova || game.alldone) 
                return; /* Supernova or finished */
@@ -789,10 +789,11 @@ void deadkl(coord w, feature type, coord mv)
     /* For each kind of enemy, finish message to player */
     prout(_(" destroyed."));
     game.quad[w.x][w.y] = IHDOT;
-    if (KLINGREM==0)
+    if ((game.state.remkl + game.state.remcom + game.state.nscrem)==0)
        return;
 
-    game.state.remtime = game.state.remres/(game.state.remkl + 4*game.state.remcom);
+    game.state.remtime = game.state.remkl + game.state.remcom > 0 ?
+           game.state.remres/(game.state.remkl + 4*game.state.remcom) : 99;
 
     /* Remove enemy ship from arrays describing local conditions */
     if (is_scheduled(FCDBAS) && same(game.battle, game.quadrant) && type==IHC)
@@ -838,8 +839,8 @@ static bool targetcheck(double x, double y, double *course)
     return false;
 }
 
-void photon(void) 
-/* launch photon torpedo */
+void torps(void) 
+/* launch photon torpedo salvo */
 {
     double targ[4][3], course[4];
     double r, dummy;
@@ -966,7 +967,7 @@ void photon(void)
        if (game.alldone || game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova)
            return;
     }
-    if (KLINGREM==0)
+    if ((game.state.remkl + game.state.remcom + game.state.nscrem)==0)
        finish(FWON);
 }
 
@@ -1368,7 +1369,7 @@ void hittem(double *hits)
        skip(1);
        if (kpow == 0) {
            deadkl(w, ienm, w);
-           if (KLINGREM==0)
+           if ((game.state.remkl + game.state.remcom + game.state.nscrem)==0)
                finish(FWON);           
            if (game.alldone)
                return;