Yet another rollup patch.
[super-star-trek.git] / src / battle.c
index 9fc6082a3a7ff11213bd77dddf86697b974622d3..ffcf55d796e325b1010ed71f979374587a987375 100644 (file)
@@ -276,7 +276,8 @@ void torpedo(double course, double r, coord in, double *hit, int i, int n)
        if (iquad==IHDOT) continue;
        /* hit something */
        setwnd(message_window);
-       skip(1);        /* start new line after text track */
+       if (damaged(DSRSENS) && !game.condition==docked)
+           skip(1);    /* start new line after text track */
        switch(iquad) {
        case IHE: /* Hit our ship */
        case IHF:
@@ -387,7 +388,7 @@ void torpedo(double course, double r, coord in, double *hit, int i, int n)
            q->planet = NOPLANET;
            DESTROY(&game.state.plnets[game.iplnet]);
            game.iplnet = 0;
-           game.plnet.x = game.plnet.y = 0;
+           invalidate(game.plnet);
            game.quad[w.x][w.y] = IHDOT;
            if (game.landed) {
                /* captain perishes on planet */
@@ -401,7 +402,7 @@ void torpedo(double course, double r, coord in, double *hit, int i, int n)
            q->planet = NOPLANET;
            DESTROY(&game.state.plnets[game.iplnet]);
            game.iplnet = 0;
-           game.plnet.x = game.plnet.y = 0;
+           invalidate(game.plnet);
            game.quad[w.x][w.y] = IHDOT;
            if (game.landed) {
                /* captain perishes on planet */
@@ -703,7 +704,6 @@ void deadkl(coord w, feature type, coord mv)
     /* Added mv to allow enemy to "move" before dying */
     int i,j;
 
-    skip(1);
     crmena(true, type, sector, mv);
     /* Decide what kind of enemy it is and update appropriately */
     if (type == IHR) {
@@ -719,7 +719,7 @@ void deadkl(coord w, feature type, coord mv)
     else if (type == IHQUEST) {
        /* Killed a Thingy */
        iqhere = iqengry = false;
-       thing.x =thing.y = 0;
+       invalidate(thing);
     }
     else {
        /* Some type of a Klingon */
@@ -812,7 +812,6 @@ void photon(void)
     double targ[4][3], course[4];
     double r, dummy;
     int key, n, i;
-    bool osuabor;
 
     game.ididit = false;
 
@@ -905,8 +904,7 @@ void photon(void)
     }
     game.ididit = true;
     /* Loop for moving <n> torpedoes */
-    osuabor = false;
-    for (i = 1; i <= n && !osuabor; i++) {
+    for (i = 1; i <= n; i++) {
        if (game.condition != docked) game.torps--;
        r = (Rand()+Rand())*0.5 -0.5;
        if (fabs(r) >= 0.47) {
@@ -919,12 +917,11 @@ void photon(void)
            skip(1);
            if (i < n)
                prout(_("  Remainder of burst aborted."));
-           osuabor = true;
            if (Rand() <= 0.2) {
                prout(_("***Photon tubes damaged by misfire."));
                game.damage[DPHOTON] = game.damfac*(1.0+2.0*Rand());
-               break;
            }
+           break;
        }
        if (game.shldup || game.condition == docked) 
            r *= 1.0 + 0.0001*game.shield;
@@ -1098,7 +1095,7 @@ void phasers(void)
        }
        if (key != IHREAL && game.nenhere != 0) {
            prout(_("Phasers locked on target. Energy available: %.2f"),
-                 ifast?game.energy-200.0:game.energy,1,2);
+                 ifast?game.energy-200.0:game.energy);
        }
        irec=0;
        do {
@@ -1169,7 +1166,7 @@ void phasers(void)
        chew();
        key = IHEOL;
        if (damaged(DCOMPTR))
-           prout(_("Battle computer damaged, manual file only."));
+           prout(_("Battle computer damaged, manual fire only."));
        else {
            skip(1);
            prouts(_("---WORKING---"));
@@ -1326,7 +1323,7 @@ void hittem(double *hits)
        else /* decide whether or not to emasculate klingon */
            if (kpow > 0 && Rand() >= 0.9 &&
                kpow <= ((0.4 + 0.4*Rand())*kpini)) {
-               prout(_("***Mr. Spock-  \"Captain, the vessel at "),
+               prout(_("***Mr. Spock-  \"Captain, the vessel at %s"),
                      cramlc(sector, w));
                prout(_("   has just lost its firepower.\""));
                game.kpower[kk] = -kpow;