]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/laun.c
Update copyright notice
[empserver] / src / lib / commands / laun.c
index 1478e71b09711f20d1a2dca4e6c831cd0cba7aaf..5d9e73962e704a5a72ad8d4a65751056399e2d7a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -19,9 +19,9 @@
  *
  *  ---
  *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
+ *  See files README, COPYING and CREDITS in the root of the source
+ *  tree for related information and legal notices.  It is expected
+ *  that future projects/authors will amend these files as needed.
  *
  *  ---
  *
 
 #include <config.h>
 
-#include "misc.h"
-#include "player.h"
-#include "xy.h"
-#include "sect.h"
-#include "plane.h"
-#include "news.h"
+#include "commands.h"
+#include "damage.h"
 #include "mission.h"
-#include "ship.h"
-#include "nsc.h"
-#include "nat.h"
-#include "path.h"
-#include "file.h"
+#include "news.h"
 #include "optlist.h"
-#include "damage.h"
-#include "commands.h"
+#include "path.h"
+#include "plane.h"
+#include "ship.h"
 
 static int launch_as(struct plnstr *pp);
 static int launch_missile(struct plnstr *pp, int sublaunch);
@@ -94,7 +87,7 @@ laun(void)
            continue;
        }
        if (opt_MARKET) {
-           if (ontradingblock(EF_PLANE, (int *)&plane)) {
+           if (ontradingblock(EF_PLANE, &plane)) {
                pr("plane #%d inelligible - it's for sale.\n",
                   plane.pln_uid);
                continue;
@@ -107,9 +100,7 @@ laun(void)
            if (!ship.shp_own) {
                pr("%s: ship #%d was sunk!\n",
                   prplane(&plane), ship.shp_uid);
-               makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
-                        plane.pln_x, plane.pln_y);
-               plane.pln_own = 0;
+               plane.pln_effic = 0;
                putplane(plane.pln_uid, &plane);
                continue;
            }
@@ -118,9 +109,7 @@ laun(void)
            if (ship.shp_own != player->cnum && rel != ALLIED) {
                pr("%s: you or an ally do not own ship #%d\n",
                   prplane(&plane), ship.shp_uid);
-               makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
-                        plane.pln_x, plane.pln_y);
-               plane.pln_own = 0;
+               plane.pln_effic = 0;
                putplane(plane.pln_uid, &plane);
                continue;
            }
@@ -159,9 +148,7 @@ laun(void)
        if (retval != RET_OK)
            return retval;
        if (gone) {
-           makelost(EF_PLANE, plane.pln_own, plane.pln_uid, plane.pln_x,
-                    plane.pln_y);
-           plane.pln_own = 0;
+           plane.pln_effic = 0;
            putplane(plane.pln_uid, &plane);
        }
     }
@@ -177,7 +164,7 @@ static int
 launch_as(struct plnstr *pp)
 {
     coord sx, sy;
-    s_char *cp, buf[1024];
+    char *cp, buf[1024];
     struct plnstr plane;
     struct nstr_item ni;
     int goodtarget;
@@ -221,8 +208,7 @@ launch_as(struct plnstr *pp)
        oldown = plane.pln_own;
        planedamage(&plane, dam);
        pr("Hit satellite for %d%% damage!\n", dam);
-       mpr(oldown,
-           "%s anti-sat did %d%% damage to %s over %s\n",
+       mpr(oldown, "%s anti-sat did %d%% damage to %s over %s\n",
            cname(player->cnum), dam, prplane(&plane),
            xyas(plane.pln_x, plane.pln_y, plane.pln_own));
        putplane(plane.pln_uid, &plane);
@@ -244,14 +230,14 @@ launch_missile(struct plnstr *pp, int sublaunch)
     struct plchrstr *pcp = plchr + pp->pln_type;
     coord sx, sy;
     int n, dam;
-    s_char *cp;
+    char *cp;
     struct mchrstr *mcp;
     struct shpstr target_ship;
     struct sctstr sect;
     int nukedam;
     int rel;
     struct natstr *natp;
-    s_char buf[1024];
+    char buf[1024];
 
     if (pcp->pl_flags & P_MAR)
        cp = getstarg(player->argp[2], "Target ship? ", buf);
@@ -381,9 +367,9 @@ launch_sat(struct plnstr *pp, int sublaunch)
     int i;
     int dist;
     int dir;
-    s_char *cp;
-    s_char *p;
-    s_char buf[1024];
+    char *cp;
+    char *p;
+    char buf[1024];
 
     pr("\n");
     cp = getstarg(player->argp[2], "Target sector? ", buf);
@@ -411,8 +397,7 @@ launch_sat(struct plnstr *pp, int sublaunch)
     pr("3... 2... 1... Blastoff!!!\n");
     if (chance(0.07 + (100 - pp->pln_effic) / 100.0)) {
        pr("KABOOOOM!  Range safety officer detonates booster!\n");
-       makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
-       pp->pln_own = 0;
+       pp->pln_effic = 0;
        return RET_OK;
     }
     i = pp->pln_tech + pp->pln_effic;
@@ -430,8 +415,9 @@ launch_sat(struct plnstr *pp, int sublaunch)
     pp->pln_x = sx;
     pp->pln_y = sy;
     pp->pln_flags |= PLN_LAUNCHED;
-    pp->pln_mobil = (pp->pln_mobil > dist) ? (pp->pln_mobil - dist) : 0;
+    pp->pln_mobil = pp->pln_mobil > dist ? pp->pln_mobil - dist : 0;
     putplane(pp->pln_uid, pp);
-    pr(", will be ready for use in %d time units\n", plane_mob_max - pp->pln_mobil);
+    pr(", will be ready for use in %d time units\n",
+       plane_mob_max - pp->pln_mobil);
     return RET_OK;
 }