]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/upgr.c
Update copyright notice.
[empserver] / src / lib / commands / upgr.c
index bf5726220f63566b655447be7500c2d53a08af93..d3fa0917b5b70ae6624880b5b2cf96156bf9d4d1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2007, 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 "ship.h"
+#include "commands.h"
 #include "land.h"
 #include "plane.h"
-#include "sect.h"
-#include "nat.h"
-#include "nsc.h"
-#include "file.h"
-#include "commands.h"
+#include "ship.h"
 
 enum {
   UPGR_COST = 15,              /* how much avail and money to charge */
@@ -58,8 +51,8 @@ static int supgr(void);
 int
 upgr(void)
 {
-    s_char *p;
-    s_char buf[1024];
+    char *p;
+    char buf[1024];
 
     if (!(p = getstarg(player->argp[1], "Ship, land, or plane? ", buf)))
        return RET_SYN;
@@ -109,8 +102,9 @@ lupgr(void)
        if (sect.sct_type != SCT_HEADQ || sect.sct_effic < 60)
            continue;
        rel = getrel(getnatp(land.lnd_own), sect.sct_own);
-       if ((rel < FRIENDLY) && (sect.sct_own != land.lnd_own)) {
-           pr("You are not on friendly terms with the owner of unit %d!\n", land.lnd_uid);
+       if (rel < FRIENDLY && sect.sct_own != land.lnd_own) {
+           pr("You are not on friendly terms with the owner of unit %d!\n",
+              land.lnd_uid);
            continue;
        }
        n++;
@@ -127,8 +121,8 @@ lupgr(void)
            continue;
        }
        if (land.lnd_tech >= tlev) {
-           pr("%s tech: %d, yours is only %d\n", prland(&land),
-              land.lnd_tech, tlev);
+           pr("%s tech: %d, yours is only %d\n",
+              prland(&land), land.lnd_tech, tlev);
            continue;
        }
        cost = lp->l_cost * UPGR_COST / 100;
@@ -148,8 +142,8 @@ lupgr(void)
        putland(land.lnd_uid, &land);
        putsect(&sect);
        player->dolcost += cost;
-       pr("%s upgraded to tech %d, at a cost of %d\n", prland(&land),
-          land.lnd_tech, cost);
+       pr("%s upgraded to tech %d, at a cost of %d\n",
+          prland(&land), land.lnd_tech, cost);
        if (land.lnd_own != player->cnum)
            wu(0, land.lnd_own,
               "%s upgraded by %s to tech %d, at a cost of %d\n",
@@ -192,8 +186,9 @@ supgr(void)
        if (sect.sct_type != SCT_HARBR || sect.sct_effic < 60)
            continue;
        rel = getrel(getnatp(ship.shp_own), sect.sct_own);
-       if ((rel < FRIENDLY) && (sect.sct_own != ship.shp_own)) {
-           pr("You are not on friendly terms with the owner of ship %d!\n", ship.shp_uid);
+       if (rel < FRIENDLY && sect.sct_own != ship.shp_own) {
+           pr("You are not on friendly terms with the owner of ship %d!\n",
+              ship.shp_uid);
            continue;
        }
        n++;
@@ -210,8 +205,8 @@ supgr(void)
            continue;
        }
        if (ship.shp_tech >= tlev) {
-           pr("%s tech: %d, yours is only %d\n", prship(&ship),
-              ship.shp_tech, tlev);
+           pr("%s tech: %d, yours is only %d\n",
+              prship(&ship), ship.shp_tech, tlev);
            continue;
        }
        cost = mp->m_cost * UPGR_COST / 100;
@@ -230,8 +225,8 @@ supgr(void)
        putship(ship.shp_uid, &ship);
        putsect(&sect);
        player->dolcost += cost;
-       pr("%s upgraded to tech %d, at a cost of %d\n", prship(&ship),
-          ship.shp_tech, cost);
+       pr("%s upgraded to tech %d, at a cost of %d\n",
+          prship(&ship), ship.shp_tech, cost);
        if (ship.shp_own != player->cnum)
            wu(0, ship.shp_own,
               "%s upgraded by %s to tech %d, at a cost of %d\n",
@@ -274,8 +269,9 @@ pupgr(void)
        if (sect.sct_type != SCT_AIRPT || sect.sct_effic < 60)
            continue;
        rel = getrel(getnatp(plane.pln_own), sect.sct_own);
-       if ((rel < FRIENDLY) && (sect.sct_own != plane.pln_own)) {
-           pr("You are not on friendly terms with the owner of plane %d!\n", plane.pln_uid);
+       if (rel < FRIENDLY && sect.sct_own != plane.pln_own) {
+           pr("You are not on friendly terms with the owner of plane %d!\n",
+              plane.pln_uid);
            continue;
        }
        n++;
@@ -292,8 +288,8 @@ pupgr(void)
            continue;
        }
        if (plane.pln_tech >= tlev) {
-           pr("%s tech: %d, yours is only %d\n", prplane(&plane),
-              plane.pln_tech, tlev);
+           pr("%s tech: %d, yours is only %d\n",
+              prplane(&plane), plane.pln_tech, tlev);
            continue;
        }
        cost = pp->pl_cost * UPGR_COST / 100;
@@ -317,8 +313,8 @@ pupgr(void)
        putplane(plane.pln_uid, &plane);
        putsect(&sect);
        player->dolcost += cost;
-       pr("%s upgraded to tech %d, at a cost of %d\n", prplane(&plane),
-          plane.pln_tech, cost);
+       pr("%s upgraded to tech %d, at a cost of %d\n",
+          prplane(&plane), plane.pln_tech, cost);
        if (plane.pln_own != player->cnum)
            wu(0, plane.pln_own,
               "%s upgraded by %s to tech %d, at a cost of %d\n",