/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2004, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
#ifndef _SECT_H_
#define _SECT_H_
+#include "item.h"
#include "var.h"
/* The order of the following elements is there to match up with genitem */
natid sct_oldown; /* old owner of sector (for liberation) */
u_char sct_updated; /* Has this sect been updated? */
u_char sct_off; /* Should this sector produce? */
- u_short sct_item[I_MAX+1]; /* amount of items stored here */
- u_short sct_del[I_MAX+1]; /* delivieries */
- u_short sct_dist[I_MAX+1]; /* distribution thresholds */
- u_short sct_mines; /* number of mines */
+ short sct_item[I_MAX+1]; /* amount of items stored here */
+ short sct_del[I_MAX+1]; /* delivieries */
+ short sct_dist[I_MAX+1]; /* distribution thresholds */
+ short sct_mines; /* number of mines */
u_short sct_pstage; /* plague stage */
u_short sct_ptime; /* how many etus remain in this stage */
u_char sct_che; /* number of guerrillas */
struct dchrstr {
int d_mnem; /* map symbol */
- int d_prd; /* product vtype */
+ int d_prd; /* product type */
int d_mcst; /* movement cost */
int d_flg; /* movement cost */
- int d_pkg; /* type of packaging in these sects */
+ i_packing d_pkg; /* type of packaging in these sects */
float d_ostr; /* offensive strength */
float d_dstr; /* defensive strength */
int d_value; /* resale ("collect") value */
s_char *d_name; /* full name of sector type */
};
-#define NPKG 0 /* no special packaging */
-#define WPKG 1 /* "warehouse" packaging */
-#define UPKG 2 /* "urban" packaging */
-#define BPKG 3 /* "bank" packaging */
-
/* for d_flg */
#define NAVOK 1 /* ships can always navigate */
#define NAV_02 2 /* requires 2% effic to navigate */
#define SCT_MAXDEF 34 /* highest sector type in header files */
#define getsect(x, y, p) \
- ef_read(EF_SECTOR, sctoff((int) x, (int) y), (caddr_t)p)
+ ef_read(EF_SECTOR, sctoff((x), (y)), (p))
#define putsect(p) \
- ef_write(EF_SECTOR, sctoff((int) (p)->sct_x, \
- (int) (p)->sct_y), (caddr_t)p)
+ ef_write(EF_SECTOR, sctoff((p)->sct_x, (p)->sct_y), (p))
#define getsectp(x, y) \
- (struct sctstr *) ef_ptr(EF_SECTOR, sctoff((int)x, (int)y))
+ (struct sctstr *)ef_ptr(EF_SECTOR, sctoff((x), (y)))
#define getsectid(id) \
- (struct sctstr *) ef_ptr(EF_SECTOR, id)
+ (struct sctstr *)ef_ptr(EF_SECTOR, id)
/* things relating to sectors */
extern int sctoff(coord x, coord y);
-extern int sct_maxno;
extern struct dchrstr dchr[];
extern struct dchrstr bigcity_dchr;
+/* Minimal efficiency of sectors that can be knocked down (bridges) */
+#define SCT_MINEFF 20
+
+/* Work required for building */
+#define SCT_BLD_WORK(lcm, hcm) ((lcm) + 2 * (hcm))
+
#define MIN_MOBCOST 0.001 /* lowest cost a sector can have to move into */
#define FORTEFF 5 /* forts must be 5% efficient to fire. */
/* Sector flags */
#define MOVE_IN_PROGRESS bit(0) /* move in progress */
-/* maximum number of che, must fit into struct sctstr member sct_che */
-#define CHE_MAX 255
+/* maximum item amount, must fit into sct_item[], sct_del[], sct_dist[] */
+#define ITEM_MAX 9999
/* maximum number of mines, must fit into struct sctstr member sct_mines */
#define MINES_MAX 65535
+/* maximum number of che, must fit into struct sctstr member sct_che */
+#define CHE_MAX 255
/* maximum fallout, must fit into struct sctstr member sct_fallout */
#define FALLOUT_MAX 9999