/*
* 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
*
* ---
*
- * 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.
*
* ---
*
* Steve McClure, 1998-2000
*/
-#include "misc.h"
-#include "player.h"
-#include "sect.h"
+#include <config.h>
+
+#include "commands.h"
#include "item.h"
-#include "nat.h"
-#include "xy.h"
-#include "nsc.h"
-#include "news.h"
-#include "path.h"
-#include "file.h"
#include "land.h"
-#include "commands.h"
+#include "map.h"
+#include "news.h"
#include "optlist.h"
+#include "path.h"
+#include "plane.h"
/*
* format: spy <SECTS>
- *
*/
static int check(coord *table, int *len, coord x, coord y);
continue;
}
/* catch spy N/200 chance, N = # military */
- caught = chance((double)dsect.sct_item[I_MILIT] / 200.0);
+ caught = chance(dsect.sct_item[I_MILIT] / 200.0);
own = dsect.sct_own;
/* determine spyee relations with spyer */
relat = getrel(getnatp(own), player->cnum);
} else {
insert(table, &t_len, nx, ny);
spyline(&dsect);
- changed += map_set(player->cnum, dsect.sct_x,
- dsect.sct_y,
+ changed += map_set(player->cnum, dsect.sct_x, dsect.sct_y,
dchr[dsect.sct_type].d_mnem, 0);
prunits(dsect.sct_x, dsect.sct_y);
prplanes(dsect.sct_x, dsect.sct_y);
if (nrecon && caught) {
insert(table, &t_len, nx, ny);
spyline(&dsect);
- changed += map_set(player->cnum, dsect.sct_x,
- dsect.sct_y,
+ changed += map_set(player->cnum, dsect.sct_x, dsect.sct_y,
dchr[dsect.sct_type].d_mnem, 0);
prunits(dsect.sct_x, dsect.sct_y);
prplanes(dsect.sct_x, dsect.sct_y);
prxy("%4d,%-4d", sp->sct_x, sp->sct_y, player->cnum);
pr(" %c%c %3d %3d %3d %3d %3d %3d %4d %4d %4d %3d %4d %4d %4d %3d %3d\n",
dchr[sp->sct_type].d_mnem,
- (sp->sct_newtype == sp->sct_type) ? ' ' : dchr[sp->sct_newtype].d_mnem,
+ sp->sct_newtype == sp->sct_type ? ' ' : dchr[sp->sct_newtype].d_mnem,
sp->sct_own,
sp->sct_oldown,
roundintby((int)sp->sct_effic, 10),
{
struct lndstr land;
struct nstr_item ni;
- s_char report[128];
+ char report[128];
snxtitem_xy(&ni, EF_LAND, x, y);
while (nxtitem(&ni, &land)) {
}
if ((land.lnd_own != player->cnum) && land.lnd_own) {
int rel;
- s_char *format;
+ char *relstr;
rel = getrel(getnatp(player->cnum), land.lnd_own);
if (rel == ALLIED)
- format = "Allied (%s) unit in %s: ";
+ relstr = "Allied";
else if (rel == FRIENDLY || rel == NEUTRAL)
- format = "Neutral (%s) unit in %s: ";
+ relstr = "Neutral";
else
- format = "Enemy (%s) unit in %s: ";
- sprintf(report, format, cname(land.lnd_own),
+ relstr = "Enemy";
+ sprintf(report, "%s (%s) unit in %s: ",
+ relstr, cname(land.lnd_own),
xyas(land.lnd_x, land.lnd_y, player->cnum));
intelligence_report(player->cnum, &land, 3, report);
}
{
struct plnstr plane;
struct nstr_item ni;
- s_char report[128];
snxtitem_xy(&ni, EF_PLANE, x, y);
while (nxtitem(&ni, &plane)) {
continue;
if ((plane.pln_own != player->cnum) && plane.pln_own) {
int rel;
- s_char *format;
+ char *relstr;
rel = getrel(getnatp(player->cnum), plane.pln_own);
if (rel == ALLIED)
- format = "Allied (%s) plane in %s: %s\n";
+ relstr = "Allied";
else if (rel == FRIENDLY || rel == NEUTRAL)
- format = "Neutral (%s) plane in %s: %s\n";
+ relstr = "Neutral";
else
- format = "Enemy (%s) plane in %s: %s\n";
- sprintf(report, format, cname(plane.pln_own),
- xyas(plane.pln_x, plane.pln_y, player->cnum),
- prplane(&plane));
- pr(report);
+ relstr = "Enemy";
+ pr("%s (%s) plane in %s: %s\n",
+ relstr, cname(plane.pln_own),
+ xyas(plane.pln_x, plane.pln_y, player->cnum),
+ prplane(&plane));
}
}
}