/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2006, 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 "var.h"
#include "sect.h"
#include "item.h"
#include "file.h"
{
struct sctstr sect, ending_sect;
struct sctstr next, dsect;
- int vec[I_MAX + 1];
coord curx, cury, oldx, oldy;
coord tmpx, tmpy;
coord dx, dy;
else if (dir == DIR_VIEW) {
pr("%d%% %s with %d civilians.\n", sect.sct_effic,
dchr[sect.sct_type].d_name,
- getvar(V_CIVIL, (s_char *)§, EF_SECTOR));
+ sect.sct_item[I_CIVIL]);
continue;
}
/*
*movstr = 0;
continue;
}
- getvec(VT_ITEM, vec, (s_char *)&next, EF_SECTOR);
sect_mcost = sector_mcost(&next, MOB_ROAD);
- if ((!player->owner && (!exploring || vec[I_MILIT] || vec[I_CIVIL]))
+ if ((!player->owner && (!exploring
+ || next.sct_item[I_MILIT]
+ || next.sct_item[I_CIVIL]))
|| sect_mcost == -1.0) {
/* already-owned, or prohibited terrain */
pr("You can't go there...\n");
s_char range[128];
s_char view[7];
int i;
- int vec[I_MAX + 1];
int changed = 0;
np = getnatp(player->cnum);
writemap(player->cnum);
if (!getsect(curx, cury, §))
return RET_FAIL;
- getvec(VT_ITEM, vec, (s_char *)§, EF_SECTOR);
pr(" %c %c eff mob civ mil uw food work avail\n",
view[0], view[1]);
pr(" %c %c %c %3d %3d %4d %4d %4d %4d %3d %3d\n",
view[2], view[3], view[4],
- sect.sct_effic, sect.sct_mobil, vec[I_CIVIL], vec[I_MILIT],
- vec[I_UW], vec[I_FOOD], sect.sct_work, sect.sct_avail);
+ sect.sct_effic, sect.sct_mobil,
+ sect.sct_item[I_CIVIL], sect.sct_item[I_MILIT], sect.sct_item[I_UW],
+ sect.sct_item[I_FOOD], sect.sct_work, sect.sct_avail);
pr(" %c %c\n", view[5], view[6]);
return RET_OK;
}
check_lmines(coord x, coord y, double weight)
{
struct sctstr sect;
- int mines;
int dam = 0;
getsect(x, y, §);
- mines = getvar(V_MINE, (s_char *)§, EF_SECTOR);
- if (mines > 0 &&
+ if (sect.sct_mines > 0 &&
sect.sct_oldown != player->cnum &&
- chance(DMINE_LHITCHANCE(mines)) && chance(weight / 100.0)) {
+ chance(DMINE_LHITCHANCE(sect.sct_mines)) && chance(weight / 100.0)) {
pr_beep();
pr("Blammo! Landmines detected! in %s ",
xyas(sect.sct_x, sect.sct_y, player->cnum));
dam = roll(20);
- --mines;
- putvar(V_MINE, mines, (s_char *)§, EF_SECTOR);
+ --sect.sct_mines;
putsect(§);
pr("%d damage sustained.\n", dam);
}