extern void lnd_takemob(struct emp_qelem *, double);
extern int lnd_spyval(struct lndstr *);
extern void intelligence_report(int, struct lndstr *, int, char *);
-extern int count_sect_units(struct sctstr *);
extern void count_units(struct shpstr *);
extern void lnd_count_units(struct lndstr *);
extern void lnd_mar(struct emp_qelem *, double *, double *, int *, natid);
extern void take_plane_off_land(struct plnstr *, struct lndstr *);
extern void plane_sweep(struct emp_qelem *, coord, coord);
extern void count_land_planes(struct lndstr *);
-extern int count_sect_planes(struct sctstr *);
extern int put_plane_on_land(struct plnstr *, struct lndstr *);
extern int pln_hitchance(struct plnstr *, int, int);
extern int pln_damage(struct plnstr *, coord, coord, char, int *, int);
pr("SPY report\n");
prdate();
pr(" old sct rd rl def\n");
- pr(" sect de own own eff eff eff eff civ mil shl gun pet food bars lnd pln\n");
+ pr(" sect de own own eff eff eff eff civ mil shl gun pet food bars\n");
while (nxtsct(&nstr, &from)) {
if (!player->owner && !player->god)
continue;
spy_report(struct sctstr *sp)
{
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",
+ pr(" %c%c %3d %3d %3d %3d %3d %3d %4d %4d %4d %3d %4d %4d %4d\n",
dchr[sp->sct_type].d_mnem,
sp->sct_newtype == sp->sct_type ? ' ' : dchr[sp->sct_newtype].d_mnem,
sp->sct_own,
roundintby(sp->sct_item[I_GUN], 10),
roundintby(sp->sct_item[I_PETROL], 10),
roundintby(sp->sct_item[I_FOOD], 10),
- roundintby(sp->sct_item[I_BAR], 10),
- count_sect_units(sp),
- count_sect_planes(sp));
+ roundintby(sp->sct_item[I_BAR], 10));
prunits(sp->sct_x, sp->sct_y);
prplanes(sp->sct_x, sp->sct_y);
}
* defending unit.. find a place to send it
* strategy: look for the most-populated
* adjacent sector that is owned by the unit
- * player->owner. Charge mob..
+ * owner. Charge mob..
*/
biggest = -1;
nowned = 0;
}
}
-/* Used by the spy command to count land units in a sector. If used
- for anything else, you may want to reconsider, because this doesn't
- always count spies. :) */
-int
-count_sect_units(struct sctstr *sp)
-{
- int count = 0;
- struct nstr_item ni;
- struct lndstr land;
-
- snxtitem_all(&ni, EF_LAND);
- while (nxtitem(&ni, &land)) {
- if (!land.lnd_own)
- continue;
- if (land.lnd_x != sp->sct_x || land.lnd_y != sp->sct_y)
- continue;
- /* Don't always see spies */
- if (lchr[(int)land.lnd_type].l_flags & L_SPY) {
- if (!(chance(LND_SPY_DETECT_CHANCE(land.lnd_effic))))
- continue;
- }
- /* Got here, report it */
- ++count;
- }
-
- return count;
-}
-
void
count_units(struct shpstr *sp)
{
putland(lp->lnd_uid, lp);
}
-int
-count_sect_planes(struct sctstr *sp)
-{
- int count = 0;
- struct nstr_item ni;
- struct plnstr plane;
-
- snxtitem_all(&ni, EF_PLANE);
- while (nxtitem(&ni, &plane)) {
- if (!plane.pln_own)
- continue;
- if (plane.pln_flags & PLN_LAUNCHED)
- continue;
- if (plane.pln_x == sp->sct_x && plane.pln_y == sp->sct_y)
- ++count;
- }
-
- return count;
-}
-
int
pln_hitchance(struct plnstr *pp, int hardtarget, int type)
{