/*
* 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
*
* ---
*
- * 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 */
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;
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++;
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;
putland(land.lnd_uid, &land);
putsect(§);
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",
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++;
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;
putship(ship.shp_uid, &ship);
putsect(§);
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",
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++;
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;
putplane(plane.pln_uid, &plane);
putsect(§);
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",