]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/detonate.c
Update copyright notice
[empserver] / src / lib / subs / detonate.c
index 8ea31991e4c7fa6cf91c1fc2e12683fabc104b54..c425f75d11605bdd1516c13b728724be9242d8af 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
  *  ---
  *
  *  detonate.c: Detonate a nuclear device in a sector.
- * 
+ *
  *  Known contributors to this file:
  *     Steve McClure, 1998-2000
  */
@@ -98,15 +98,14 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
            continue;
        if (type == SCT_SANCT) {
            mpr(bombown, "bounced off %s\n", xyas(ns.x, ns.y, bombown));
-           if (own != 0)
-               mpr(own, "%s nuclear device bounced off %s\n",
-                   cname(bombown), xyas(ns.x, ns.y, bombown));
+           mpr(own, "%s nuclear device bounced off %s\n",
+               cname(bombown), xyas(ns.x, ns.y, bombown));
            nreport(bombown, N_NUKE, own, 1);
            continue;
        }
        if (opt_FALLOUT)
            fallout = sect.sct_fallout;
-       sect_damage(&sect, damage, 0);
+       sect_damage(&sect, damage);
        if (sect.sct_x == x && sect.sct_y == y)
            retval = damage;
        if (opt_FALLOUT) {
@@ -117,7 +116,6 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
            sect.sct_fallout = MIN(fallout, FALLOUT_MAX);
        }
        if (damage > 100) {
-           makelost(EF_SECTOR, sect.sct_own, 0, sect.sct_x, sect.sct_y);
            sect.sct_oldown = 0;
            sect.sct_own = 0;
            if (type == SCT_WATER || type == SCT_BSPAN ||
@@ -136,8 +134,6 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
            sprintf(buf, "did %d%%%% damage in %%s\n", damage);
            bp = buf;
        }
-       if ((type == SCT_CAPIT || type == SCT_MOUNT) && damage >= 100)
-           caploss(&sect, own, "\n%s lost its capital!\n\n");
        (void)putsect(&sect);
        if (type != SCT_WATER)
            nreport(bombown, N_NUKE, own, 1);
@@ -191,10 +187,9 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
                prplane(&plane),
                xyas(plane.pln_x, plane.pln_y, own), damage);
        } else {
-           if (own != 0)
-               mpr(own, "%s nuclear device did %d%% damage to %s at %s\n",
-                   cname(bombown), damage,
-                   prplane(&plane), xyas(plane.pln_x, plane.pln_y, own));
+           mpr(own, "%s nuclear device did %d%% damage to %s at %s\n",
+               cname(bombown), damage,
+               prplane(&plane), xyas(plane.pln_x, plane.pln_y, own));
        }
        putplane(ni.cur, &plane);
     }
@@ -239,10 +234,9 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
            mpr(bombown, "%s at %s reports %d%% damage\n",
                prland(&land), xyas(land.lnd_x, land.lnd_y, own), damage);
        } else {
-           if (own != 0)
-               mpr(own, "%s nuclear device did %d%% damage to %s at %s\n",
-                   cname(bombown), damage,
-                   prland(&land), xyas(land.lnd_x, land.lnd_y, own));
+           mpr(own, "%s nuclear device did %d%% damage to %s at %s\n",
+               cname(bombown), damage,
+               prland(&land), xyas(land.lnd_x, land.lnd_y, own));
        }
        putland(land.lnd_uid, &land);
     }
@@ -281,10 +275,9 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
            mpr(bombown, "%s at %s reports %d%% damage\n",
                prship(&ship), xyas(ship.shp_x, ship.shp_y, own), damage);
        } else {
-           if (own != 0)
-               mpr(own, "%s nuclear device did %d%% damage to %s at %s\n",
-                   cname(bombown), damage, prship(&ship),
-                   xyas(ship.shp_x, ship.shp_y, own));
+           mpr(own, "%s nuclear device did %d%% damage to %s at %s\n",
+               cname(bombown), damage, prship(&ship),
+               xyas(ship.shp_x, ship.shp_y, own));
        }
        putship(ship.shp_uid, &ship);
     }
@@ -307,9 +300,8 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
            mpr(bombown, "%s at %s destroyed\n",
                prnuke(&nuke), xyas(nuke.nuk_x, nuke.nuk_y, own));
        } else {
-           if (own != 0)
-               mpr(own, "%s at %s destroyed\n",
-                   prnuke(&nuke), xyas(nuke.nuk_x, nuke.nuk_y, own));
+           mpr(own, "%s at %s destroyed\n",
+               prnuke(&nuke), xyas(nuke.nuk_x, nuke.nuk_y, own));
        }
        putnuke(ni.cur, &nuke);
     }