]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/bomb.c
Update copyright notice
[empserver] / src / lib / commands / bomb.c
index 257d17abc75b56af74497eb1615d5da9134b5399..eb46f3917b42532b1a44011cde870209503d6998 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
+ *  Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *                Ken Stevens, Steve McClure, Markus Armbruster
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  Empire is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
+ *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  *  ---
  *
  *     Dave Pare, 1986
  *     Ken Stevens, 1995
  *     Steve McClure, 1998-2000
- *     Markus Armbruster, 2004-2009
+ *     Markus Armbruster, 2004-2016
  */
 
 #include <config.h>
 
 #include <ctype.h>
+#include "chance.h"
 #include "commands.h"
 #include "damage.h"
 #include "item.h"
@@ -60,24 +60,6 @@ static int changed_plane_aborts(struct plist *);
 static int pinflak_planedamage(struct plnstr *, struct plchrstr *,
                               natid, int);
 
-static i_type bombcomm[] = {
-    I_CIVIL,
-    I_MILIT,
-    I_SHELL,
-    I_GUN,
-    I_PETROL,
-    I_IRON,
-    I_DUST,
-    I_BAR,
-    I_FOOD,
-    I_OIL,
-    I_LCM,
-    I_HCM,
-    I_UW,
-    I_RAD
-};
-static int nbomb = sizeof(bombcomm) / sizeof(*bombcomm);
-
 int
 bomb(void)
 {
@@ -95,8 +77,6 @@ bomb(void)
     char mission;
     struct plist *plp;
     struct emp_qelem *qp, *next;
-    int rel;
-    struct natstr *natp;
     char buf[1024];
 
     if (get_planes(&ni_bomb, &ni_esc, player->argp[1], player->argp[2]) < 0)
@@ -111,8 +91,7 @@ bomb(void)
        return RET_SYN;
     ax = ap_sect.sct_x;
     ay = ap_sect.sct_y;
-    if (!getpath(flightpath, player->argp[5], ax, ay, 0, 0, P_FLYING)
-       || *flightpath == 0)
+    if (!getpath(flightpath, player->argp[5], ax, ay, 0, 0, MOB_FLY))
        return RET_SYN;
     tx = ax;
     ty = ay;
@@ -120,8 +99,6 @@ bomb(void)
     pr("target sector is %s\n", xyas(tx, ty, player->cnum));
     getsect(tx, ty, &target);
     ap_to_target = strlen(flightpath);
-    if (flightpath[ap_to_target - 1] == 'h')
-       ap_to_target--;
     pr("range to target is %d\n", ap_to_target);
     /*
      * select planes within range
@@ -160,20 +137,6 @@ bomb(void)
            }
            break;
        case 's':
-           if (opt_SLOW_WAR) {
-               natp = getnatp(player->cnum);
-               if (target.sct_own) {
-                   rel = getrel(natp, target.sct_own);
-                   if ((rel != AT_WAR) && (player->cnum != target.sct_own)
-                       && (target.sct_own) &&
-                       (target.sct_oldown != player->cnum)) {
-                       pr("You're not at war with them!\n");
-                       pln_put(&bomb_list);
-                       pln_put(&esc_list);
-                       return RET_FAIL;
-                   }
-               }
-           }
            nreport(player->cnum, N_SCT_BOMB, target.sct_own, 1);
            strat_bomb(&bomb_list, &target);
            break;
@@ -197,8 +160,6 @@ pin_bomb(struct emp_qelem *list, struct sctstr *target)
     char *p;
     int nsubs;
     int nunits;
-    struct natstr *natp;
-    int rel;
     char buf[1024];
     int i;
 
@@ -215,7 +176,7 @@ pin_bomb(struct emp_qelem *list, struct sctstr *target)
            pr("Some subs are present in the sector.\n");
     }
     nplanes = planesatxy(target->sct_x, target->sct_y, 0, 0);
-    nunits = unitsatxy(target->sct_x, target->sct_y, 0, 0);
+    nunits = unitsatxy(target->sct_x, target->sct_y, 0, L_SPY);
   retry:
     p = getstring("Bomb what? (ship, plane, land unit, efficiency, commodities) ",
                  buf);
@@ -229,18 +190,6 @@ pin_bomb(struct emp_qelem *list, struct sctstr *target)
     }
     switch (*p) {
     case 'l':
-       if (opt_SLOW_WAR) {
-           natp = getnatp(player->cnum);
-           if (target->sct_own) {
-               rel = getrel(natp, target->sct_own);
-               if ((rel != AT_WAR) && (player->cnum != target->sct_own)
-                   && (target->sct_own) &&
-                   (target->sct_oldown != player->cnum)) {
-                   pr("You're not at war with them!\n");
-                   goto retry;
-               }
-           }
-       }
        if (nunits == 0) {
            pr("no units there\n");
            goto retry;
@@ -248,18 +197,6 @@ pin_bomb(struct emp_qelem *list, struct sctstr *target)
        land_bomb(list, target);
        break;
     case 'p':
-       if (opt_SLOW_WAR) {
-           natp = getnatp(player->cnum);
-           if (target->sct_own) {
-               rel = getrel(natp, target->sct_own);
-               if ((rel != AT_WAR) && (player->cnum != target->sct_own)
-                   && (target->sct_own) &&
-                   (target->sct_oldown != player->cnum)) {
-                   pr("You're not at war with them!\n");
-                   goto retry;
-               }
-           }
-       }
        if (nplanes == 0) {
            pr("no planes there\n");
            goto retry;
@@ -281,25 +218,11 @@ pin_bomb(struct emp_qelem *list, struct sctstr *target)
        ship_bomb(list, target);
        break;
     case 'c':
-       if (opt_SLOW_WAR) {
-           natp = getnatp(player->cnum);
-           if (target->sct_own) {
-               rel = getrel(natp, target->sct_own);
-               if ((rel != AT_WAR) && (player->cnum != target->sct_own)
-                   && (target->sct_own) &&
-                   (target->sct_oldown != player->cnum)) {
-                   pr("You're not at war with them!\n");
-                   goto retry;
-               }
-           }
-       }
-
-       for (i = 0; i < nbomb; i++) {
-           if (!target->sct_item[bombcomm[i]])
-               continue;
-           break;
+       for (i = I_NONE + 1; i <= I_MAX; i++) {
+           if (target->sct_item[i])
+               break;
        }
-       if (i >= nbomb) {
+       if (i > I_MAX) {
            pr("No bombable commodities in %s\n",
               xyas(target->sct_x, target->sct_y, player->cnum));
            goto retry;
@@ -307,18 +230,6 @@ pin_bomb(struct emp_qelem *list, struct sctstr *target)
        comm_bomb(list, target);
        break;
     case 'e':
-       if (opt_SLOW_WAR) {
-           natp = getnatp(player->cnum);
-           if (target->sct_own) {
-               rel = getrel(natp, target->sct_own);
-               if ((rel != AT_WAR) && (player->cnum != target->sct_own)
-                   && (target->sct_own) &&
-                   (target->sct_oldown != player->cnum)) {
-                   pr("You're not at war with them!\n");
-                   goto retry;
-               }
-           }
-       }
        eff_bomb(list, target);
        break;
     case 'q':
@@ -343,10 +254,8 @@ eff_bomb(struct emp_qelem *list, struct sctstr *target)
        plp = (struct plist *)qp;
        if (changed_plane_aborts(plp))
            continue;
-       dam += pln_damage(&plp->plane, 'p', 1);
+       dam += pln_damage(&plp->plane, 'p', "");
     }
-    if (dam <= 0)
-       return;
     getsect(target->sct_x, target->sct_y, &sect);
     target = &sect;
     oldeff = target->sct_effic;
@@ -358,11 +267,11 @@ eff_bomb(struct emp_qelem *list, struct sctstr *target)
     pr("did %d%% damage to efficiency in %s\n",
        oldeff - target->sct_effic,
        xyas(target->sct_x, target->sct_y, player->cnum));
-    if (target->sct_own)
-       wu(0, target->sct_own,
-          "%s bombing raid did %d%% damage in %s\n",
-          cname(player->cnum), oldeff - target->sct_effic,
-          xyas(target->sct_x, target->sct_y, target->sct_own));
+    if (target->sct_own != player->cnum)
+       mpr(target->sct_own,
+           "%s bombing raid did %d%% damage in %s\n",
+           cname(player->cnum), oldeff - target->sct_effic,
+           xyas(target->sct_x, target->sct_y, target->sct_own));
     bridge_damaged(target);
     putsect(&sect);
     collateral_damage(target->sct_x, target->sct_y, dam);
@@ -380,13 +289,12 @@ comm_bomb(struct emp_qelem *list, struct sctstr *target)
     struct sctstr sect;
     int dam = 0;
 
-    for (i = 0; i < nbomb; i++) {
-       if (target->sct_item[bombcomm[i]] == 0)
+    for (i = I_NONE + 1; i <= I_MAX; i++) {
+       if (!target->sct_item[i])
            continue;
-       if (opt_SUPER_BARS && bombcomm[i] == I_BAR)
+       if (opt_SUPER_BARS && i == I_BAR)
            continue;
-       ip = &ichr[bombcomm[i]];
-       pr("some %s\n", ip->i_name);
+       pr("some %s\n", ichr[i].i_name);
     }
     for (;;) {
        ip = whatitem(NULL, "commodity to bomb? ");
@@ -394,34 +302,19 @@ comm_bomb(struct emp_qelem *list, struct sctstr *target)
            return;
        if (!ip)
            continue;
-
-       for (i = 0; i < nbomb; i++) {
-           if (opt_SUPER_BARS && bombcomm[i] == I_BAR)
-               continue;
-           if (&ichr[bombcomm[i]] == ip)
-               break;
-       }
-       if (i == nbomb) {
+       if (opt_SUPER_BARS && ip->i_uid == I_BAR) {
            pr("You can't bomb %s!\n", ip->i_name);
-           for (i = 0; i < nbomb; i++) {
-               if (opt_SUPER_BARS && bombcomm[i] == I_BAR)
-                   continue;
-               pr("%s%s", i == 0 ? "Bombable: " : ", ",
-                  ichr[bombcomm[i]].i_name);
-           }
-           pr("\n");
-       } else
-           break;
+           continue;
+       }
+       break;
     }
     for (qp = list->q_forw; qp != list; qp = next) {
        next = qp->q_forw;
        plp = (struct plist *)qp;
        if (changed_plane_aborts(plp))
            continue;
-       dam += pln_damage(&plp->plane, 'p', 1);
+       dam += pln_damage(&plp->plane, 'p', "");
     }
-    if (dam <= 0)
-       return;
     getsect(target->sct_x, target->sct_y, &sect);
     target = &sect;
     before = target->sct_item[ip->i_uid];
@@ -433,11 +326,11 @@ comm_bomb(struct emp_qelem *list, struct sctstr *target)
     pr("did %.2f%% damage to %s in %s\n",
        b, ip->i_name, xyas(target->sct_x, target->sct_y, player->cnum));
     nreport(player->cnum, N_SCT_BOMB, target->sct_own, 1);
-    if (target->sct_own != 0)
-       wu(0, target->sct_own,
-          "%s precision bombing raid did %.2f%% damage to %s in %s\n",
-          cname(player->cnum), b, ip->i_name,
-          xyas(target->sct_x, target->sct_y, target->sct_own));
+    if (target->sct_own != player->cnum)
+       mpr(target->sct_own,
+           "%s precision bombing raid did %.2f%% damage to %s in %s\n",
+           cname(player->cnum), b, ip->i_name,
+           xyas(target->sct_x, target->sct_y, target->sct_own));
     putsect(&sect);
     collateral_damage(target->sct_x, target->sct_y, dam);
 }
@@ -514,8 +407,8 @@ ship_bomb(struct emp_qelem *list, struct sctstr *target)
        mcp = &mchr[(int)ship.shp_type];
        if (gun > 0 && !(mcp->m_flags & M_SUB)) {
            flak = (int)(techfact(ship.shp_tech, gun) * 2.0);
-           PR(ship.shp_own, "Flak! Firing %d guns from ship %s\n",
-              flak, prship(&ship));
+           mpr(ship.shp_own, "Flak! Firing %d guns from ship %s\n",
+               flak, prship(&ship));
            if (pinflak_planedamage(&plp->plane, plp->pcp, ship.shp_own, flak))
                continue;
        }
@@ -525,42 +418,38 @@ ship_bomb(struct emp_qelem *list, struct sctstr *target)
        else {
            hitchance = pln_hitchance(&plp->plane,
                                      shp_hardtarget(&ship), EF_SHIP);
-           pr("%d%% hitchance...", hitchance);
+           pr("%d%% hit chance...", hitchance);
        }
-       if (roll(100) <= hitchance) {
-           /* pinbombing is more accurate than normal bombing */
-           dam = 2 * pln_damage(&plp->plane, 'p', 1);
+       if (pct_chance(hitchance)) {
+           /* pin-bombing is more accurate than normal bombing */
+           dam = 2 * pln_damage(&plp->plane, 'p', "");
        } else {
            pr("splash\n");
            /* Bombs that miss have to land somewhere! */
            dam = pln_damage(&plp->plane, 'p', 0);
            collateral_damage(target->sct_x, target->sct_y, dam);
-           dam = 0;
-       }
-       if (dam <= 0)
            continue;
+       }
        if (mcp->m_flags & M_SUB)
            nreport(player->cnum, N_SUB_BOMB, ship.shp_own, 1);
        else
            nreport(player->cnum, N_SHP_BOMB, ship.shp_own, 1);
-       if (ship.shp_own) {
-           wu(0, ship.shp_own, "%s bombs did %d damage to %s at %s\n",
-              cname(player->cnum), dam,
-              prship(&ship),
-              xyas(target->sct_x, target->sct_y, ship.shp_own));
+       if (ship.shp_own != player->cnum) {
+           mpr(ship.shp_own, "%s bombs did %d damage to %s at %s\n",
+               cname(player->cnum), dam,
+               prship(&ship),
+               xyas(target->sct_x, target->sct_y, ship.shp_own));
        }
-       pr("\n");
-       check_retreat_and_do_shipdamage(&ship, dam);
-       if (ship.shp_rflags & RET_BOMBED)
-           if (((ship.shp_rflags & RET_INJURED) == 0) || !dam)
-               retreat_ship(&ship, 'b');
-       putship(ship.shp_uid, &ship);
-       getship(ship.shp_uid, &ship);
-       if (!ship.shp_own) {
+       shipdamage(&ship, dam);
+       if (ship.shp_effic < SHIP_MINEFF)
            pr("%s at %s sunk!\n",
               prship(&ship),
               xyas(target->sct_x, target->sct_y, player->cnum));
-       }
+       if (dam && (ship.shp_rflags & RET_INJURED))
+           retreat_ship(&ship, ship.shp_own, 'i');
+       else if (ship.shp_rflags & RET_BOMBED)
+           retreat_ship(&ship, ship.shp_own, 'b');
+       putship(ship.shp_uid, &ship);
        collateral_damage(target->sct_x, target->sct_y, dam / 2);
     }
 out:
@@ -610,7 +499,7 @@ plane_bomb(struct emp_qelem *list, struct sctstr *target)
            n = atoi(q);
            if (n < 0)
                continue;
-           if (getplane(n, &plane) &&
+           if (getplane(n, &plane) && plane.pln_own &&
                plane.pln_x == target->sct_x &&
                plane.pln_y == target->sct_y &&
                plane.pln_ship < 0 && plane.pln_land < 0 &&
@@ -627,20 +516,18 @@ plane_bomb(struct emp_qelem *list, struct sctstr *target)
            hitchance = 100;
        else {
            hitchance = pln_hitchance(&plp->plane, 0, EF_PLANE);
-           pr("%d%% hitchance...", hitchance);
+           pr("%d%% hit chance...", hitchance);
        }
-       if (roll(100) <= hitchance) {
-           /* pinbombing is more accurate than normal bombing */
-           dam = 2 * pln_damage(&plp->plane, 'p', 1);
+       if (pct_chance(hitchance)) {
+           /* pin-bombing is more accurate than normal bombing */
+           dam = 2 * pln_damage(&plp->plane, 'p', "");
        } else {
            pr("thud\n");
            /* Bombs that miss have to land somewhere! */
            dam = pln_damage(&plp->plane, 'p', 0);
            collateral_damage(target->sct_x, target->sct_y, dam);
-           dam = 0;
-       }
-       if (dam <= 0)
            continue;
+       }
        if (dam > 100)
            dam = 100;
        own = plane.pln_own;
@@ -648,20 +535,11 @@ plane_bomb(struct emp_qelem *list, struct sctstr *target)
            plane.pln_effic = 0;
        else
            plane.pln_effic -= dam;
-       plane.pln_mobil = (dam * plane.pln_mobil / 100.0);
-       if (own == player->cnum) {
-           pr("%s reports %d%% damage\n", prplane(&plane), dam);
-       } else {
-           if (own != 0)
-               wu(0, own,
-                  "%s pinpoint bombing raid did %d%% damage to %s\n",
-                  cname(player->cnum), dam, prplane(&plane));
-       }
-       nreport(player->cnum, N_DOWN_PLANE, own, 1);
-       if (own != 0)
-           wu(0, own, "%s bombs did %d%% damage to %s at %s\n",
+       plane.pln_mobil = damage(plane.pln_mobil, dam);
+       mpr(own, "%s bombs did %d%% damage to %s at %s\n",
               cname(player->cnum), dam, prplane(&plane),
               xyas(target->sct_x, target->sct_y, own));
+       nreport(player->cnum, N_DOWN_PLANE, own, 1);
        putplane(plane.pln_uid, &plane);
        collateral_damage(target->sct_x, target->sct_y, dam);
     }
@@ -688,7 +566,7 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
        plp = (struct plist *)qp;
        if (changed_plane_aborts(plp))
            continue;
-       nunits = unitsatxy(target->sct_x, target->sct_y, 0, 0);
+       nunits = unitsatxy(target->sct_x, target->sct_y, 0, L_SPY);
        if (nunits == 0) {
            pr("%s could not find any units!\n", prplane(&plp->plane));
            continue;
@@ -704,7 +582,7 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
            if (*q == '~')
                break;
            if (*q == '?') {
-               unitsatxy(target->sct_x, target->sct_y, 0, 0);
+               unitsatxy(target->sct_x, target->sct_y, 0, L_SPY);
                continue;
            }
            n = atoi(q);
@@ -712,6 +590,7 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
                continue;
            if (getland(n, &land) && land.lnd_own &&
                land.lnd_ship < 0 && land.lnd_land < 0 &&
+               !(lchr[land.lnd_type].l_flags & L_SPY) &&
                land.lnd_x == target->sct_x && land.lnd_y == target->sct_y)
                unitno = n;
            else
@@ -726,9 +605,9 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
        if (aaf) {
            flak = roundavg(techfact(land.lnd_tech,
                                     aaf * 3.0 * land.lnd_effic / 100.0));
-           PR(land.lnd_own,
-              "Flak! Firing flak guns from unit %s (aa rating %d)\n",
-              prland(&land), aaf);
+           mpr(land.lnd_own,
+               "Flak! Firing flak guns from unit %s (AA rating %d)\n",
+               prland(&land), aaf);
            if (pinflak_planedamage(&plp->plane, plp->pcp, land.lnd_own, flak))
                continue;
        }
@@ -738,29 +617,29 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
        else {
            hitchance = pln_hitchance(&plp->plane,
                                      lnd_hardtarget(&land), EF_LAND);
-           pr("%d%% hitchance...", hitchance);
+           pr("%d%% hit chance...", hitchance);
        }
-       if (roll(100) <= hitchance) {
-           dam = 2 * pln_damage(&plp->plane, 'p', 1);
+       if (pct_chance(hitchance)) {
+           dam = 2 * pln_damage(&plp->plane, 'p', "");
        } else {
            pr("thud\n");
            /* Bombs that miss have to land somewhere! */
            dam = pln_damage(&plp->plane, 'p', 0);
            collateral_damage(target->sct_x, target->sct_y, dam);
-           dam = 0;
-       }
-       if (dam <= 0)
            continue;
+       }
        if (dam > 100)
            dam = 100;
        own = land.lnd_own;
-       mpr(own, "%s pinpoint bombing raid did %d damage to %s\n",
-           cname(player->cnum), dam, prland(&land));
-       check_retreat_and_do_landdamage(&land, dam);
-
-       if (land.lnd_rflags & RET_BOMBED)
-           if (((land.lnd_rflags & RET_INJURED) == 0) || !dam)
-               retreat_land(&land, 'b');
+       if (own != player->cnum)
+           mpr(own, "%s bombs did %d%% damage to %s at %s\n",
+               cname(player->cnum), dam, prland(&land),
+               xyas(target->sct_x, target->sct_y, own));
+       landdamage(&land, dam);
+       if (dam && (land.lnd_rflags & RET_INJURED))
+           retreat_land(&land, own, 'i');
+       else if (land.lnd_rflags & RET_BOMBED)
+           retreat_land(&land, own, 'b');
        nreport(player->cnum, N_UNIT_BOMB, own, 1);
        putland(land.lnd_uid, &land);
        collateral_damage(target->sct_x, target->sct_y, dam);
@@ -782,16 +661,16 @@ strat_bomb(struct emp_qelem *list, struct sctstr *target)
            detonate(&nuke, target->sct_x, target->sct_y,
                     plp->plane.pln_flags & PLN_AIRBURST);
        else
-           dam += pln_damage(&plp->plane, 's', 1);
+           dam += pln_damage(&plp->plane, 's', "");
     }
-    if (dam <= 0)              /* dam == 0 if only nukes were delivered */
+    if (dam <= 0)
        return;
     getsect(target->sct_x, target->sct_y, &sect);
     target = &sect;
-    if (target->sct_own)
-       wu(0, target->sct_own, "%s bombing raid did %d damage in %s\n",
-          cname(player->cnum), PERCENT_DAMAGE(dam),
-          xyas(target->sct_x, target->sct_y, target->sct_own));
+    if (target->sct_own != player->cnum)
+       mpr(target->sct_own, "%s bombing raid did %d damage in %s\n",
+           cname(player->cnum), PERCENT_DAMAGE(dam),
+           xyas(target->sct_x, target->sct_y, target->sct_own));
 
     sectdamage(target, dam);
 
@@ -815,39 +694,16 @@ pinflak_planedamage(struct plnstr *pp, struct plchrstr *pcp, natid from,
                    int flak)
 {
     int disp;
-    char dmess[255];
-    int eff;
-    natid plane_owner;
+    char dmess[14];
     int dam;
 
     dam = ac_flak_dam(flak, pln_def(pp), pcp->pl_flags);
-    disp = 0;
-    plane_owner = pp->pln_own;
-    eff = pp->pln_effic;
     if (dam <= 0)
        return 0;
-    memset(dmess, 0, sizeof(dmess));
-    eff -= dam;
-    if (eff < 0)
-       eff = 0;
-    if (eff < PLANE_MINEFF) {
-       sprintf(dmess, " -- shot down");
-       disp = 1;
-    } else if (chance((100 - eff) / 100.0)) {
-       sprintf(dmess, " -- aborted with %d%% damage", 100 - eff);
-       disp = 2;
-    }
-    PR(plane_owner, "    Flak! %s %s takes %d%s.\n",
-       cname(pp->pln_own), prplane(pp), dam, dmess);
+    disp = ac_damage_plane(pp, from, dam, 1, dmess);
+    mpr(pp->pln_own, "    Flak! %s takes %d%s%s.\n",
+       prplane(pp), dam, *dmess ? " --" : "", dmess);
 
-    pp->pln_effic = eff;
-    if (disp == 1) {
-       if (from != 0)
-           nreport(from, N_DOWN_PLANE, pp->pln_own, 1);
-    }
     putplane(pp->pln_uid, pp);
-
-    if (disp > 0)
-       return 1;
-    return 0;
+    return disp > 0;
 }