config: Add sect-chr flags, replace cost by flag "deity"

Give sector types capability flags (dchrstr member d_flags), like
ship, plane, land unit and nuke types have.

Member d_cost is effectively a flag since the previous commit.
Replace it by capability flag "deity".  This is an xdump compatibility
break.  To provide the customary grace period, we'd have make selector
cost virtual instead, and deprecate it.  But we're not bothering with
maintaining xdump compatibility in this release.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-06-05 19:22:45 +02:00
parent ba2795fbf7
commit 16bf0d28b2
12 changed files with 240 additions and 187 deletions

View file

@ -27,7 +27,7 @@
* file.h: Describes Empire tables (`files' for historical reasons)
*
* Known contributors to this file:
* Markus Armbruster, 2005-2014
* Markus Armbruster, 2005-2016
*/
#ifndef FILE_H
@ -198,6 +198,7 @@ enum {
EF_RESOURCES,
EF_RETREAT_FLAGS,
EF_SECTOR_NAVIGATION,
EF_SECTOR_CHR_FLAGS,
EF_SHIP_CHR_FLAGS,
/* Views */
EF_COUNTRY,

View file

@ -299,6 +299,7 @@ extern struct symbol agreement_statuses[];
extern struct symbol plague_stages[];
extern struct symbol packing[];
extern struct symbol resources[];
extern struct symbol sect_chr_flags[];
extern struct symbol sector_navigation[];
/* src/lib/common/nstreval.c */

View file

@ -30,7 +30,7 @@
* Dave Pare
* Ken Stevens, 1995
* Steve McClure, 1998
* Markus Armbruster, 2004-2014
* Markus Armbruster, 2004-2016
*/
@ -112,15 +112,18 @@ struct dchrstr {
float d_ostr; /* offensive strength */
float d_dstr; /* defensive strength */
int d_value; /* resale ("collect") value */
int d_cost; /* cost to designate the sect */
int d_build; /* cost multiplier for eff */
int d_lcms; /* lcm's needed per point of eff */
int d_hcms; /* hcm's needed per point of eff */
int d_maint; /* maintenance cost per ETU */
int d_maxpop; /* maximum population */
int d_flags; /* capability flags */
char *d_name; /* full name of sector type */
};
/* Sector capability flags */
#define D_DEITY bit(0) /* Only the deity can designate this */
/* Sector types, must match sect.config */
#define SCT_WATER 0 /* basics */
#define SCT_MOUNT 1