/*
* 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
#include <config.h>
+#include <stdlib.h>
+#include "file.h"
+#include "land.h"
+#include "map.h"
#include "misc.h"
+#include "nat.h"
+#include "nsc.h"
+#include "optlist.h"
+#include "plane.h"
#include "player.h"
-#include "xy.h"
+#include "prototypes.h"
#include "sect.h"
#include "ship.h"
-#include "land.h"
-#include "plane.h"
-#include "nsc.h"
-#include "nat.h"
-#include "file.h"
-#include "prototypes.h"
-#include "optlist.h"
+#include "xy.h"
static char **rad;
static char *radbuf;
continue;
if (flags & P_S) {
if (sect.sct_own && sect.sct_own != player->cnum) {
- satdisp(§, acc, 0);
+ satdisp_sect(§, acc);
++count;
if (opt_HIDDEN)
setcont(player->cnum, sect.sct_own, FOUND_FLY);
while (nxtitem(&ni, &land)) {
if (land.lnd_own == 0)
continue;
+ if (lchr[(int)land.lnd_type].l_flags & L_SPY)
+ continue;
if (!chance(land.lnd_effic / 20.0))
continue;
if (++crackle == 100)
}
void
-satdisp(struct sctstr *sp, int acc, int showstuff)
+satdisp_sect(struct sctstr *sp, int acc)
{
- int first;
- struct nstr_item ni;
- struct shpstr ship;
- struct lndstr land;
-
prxy("%4d,%-4d ", sp->sct_x, sp->sct_y, player->cnum);
pr("%c %3d %3d %3d %3d %3d %4d %4d %4d %4d %4d %4d %5d\n",
dchr[sp->sct_type].d_mnem,
roundintby(sp->sct_item[I_FOOD], acc));
map_set(player->cnum, sp->sct_x, sp->sct_y, dchr[sp->sct_type].d_mnem,
0);
- if (!showstuff)
- return;
- snxtitem_xy(&ni, EF_SHIP, sp->sct_x, sp->sct_y);
+}
+
+void
+satdisp_units(coord x, coord y)
+{
+ int first;
+ struct nstr_item ni;
+ struct shpstr ship;
+ struct lndstr land;
+
+ snxtitem_xy(&ni, EF_SHIP, x, y);
first = 1;
while (nxtitem(&ni, &ship)) {
if (ship.shp_own == 0)
if (!first)
pr("\n");
- snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
+ snxtitem_xy(&ni, EF_LAND, x, y);
first = 1;
while (nxtitem(&ni, &land)) {
if (land.lnd_own == 0)
continue;
+ if (land.lnd_ship >= 0 || land.lnd_land >= 0)
+ continue;
+ if (lchr[(int)land.lnd_type].l_flags & L_SPY)
+ continue;
if (!chance(land.lnd_effic / 20.0))
continue;
if (first) {
- pr("\t own lnd# unit type sector eff\n");
+ pr("\t own lnd# unit type sector eff\n");
first = 0;
}