static char *RCSid = "$Header: /usr/brule/guest/empire/empire/emprcs/lib/global/nsc.c,v 2.4 1995/10/11 02:58:32 empire Exp $";

/*
 * nscglb.c
 *
 * empire selection global structures.
 *
 */

#include <struct.h>
#include "misc.h"
#include "var.h"
#include "xy.h"
#include "loan.h"
#include "nsc.h"
#include "edb.h"
#include "news.h"
#include "nuke.h"
#include "plane.h"
#include "ship.h"
#include "land.h"
#include "sect.h"
#include "trade.h"
#include "treaty.h"
#include "genitem.h"
#include "nat.h"
#include "map.h"

struct  castr   var_ca[]    = {
NSC_DEITY | NSC_VAR | V_PSTAGE,	"pstage",0,0,
NSC_DEITY | NSC_VAR | V_PTIME,	"ptime",0,0,
NSC_DEITY | NSC_VAR | V_CHE,	"che",0,0,
#ifdef	FALLOUT
NSC_VAR | V_FALLOUT,	"fallout",0,0,
#endif	/* FALLOUT */
NSC_ROUND | NSC_VAR | V_CIVIL,	"civil",0,EDV_CIV,
NSC_ROUND | NSC_VAR | V_MILIT,	"milit",0,EDV_MIL,
NSC_ROUND | NSC_VAR | V_SHELL,	"shell",0,EDV_SHL,
NSC_ROUND | NSC_VAR | V_GUN,	"gun",0,EDV_GUN,
NSC_ROUND | NSC_VAR | V_PETROL,	"petrol",0,EDV_PET,
NSC_ROUND | NSC_VAR | V_IRON,	"iron",0,0,
NSC_ROUND | NSC_VAR | V_DUST,	"dust",0,0,
NSC_ROUND | NSC_VAR | V_BAR,	"bar",0,EDV_BAR,
NSC_ROUND | NSC_VAR | V_FOOD,	"food",0,EDV_FOOD,
NSC_ROUND | NSC_VAR | V_OIL,	"oil",0,0,
NSC_ROUND | NSC_VAR | V_LCM,	"lcm",0,0,
NSC_ROUND | NSC_VAR | V_HCM,	"hcm",0,0,
NSC_ROUND | NSC_VAR | V_UW,		"uw",0,0,
NSC_ROUND | NSC_VAR | V_RAD,	"rad",0,EDV_LAST_COMM,
NSC_VAR | V_CDIST,	"c_dist",0,0,
NSC_VAR | V_MDIST,	"m_dist",0,0,
NSC_VAR | V_UDIST,	"u_dist",0,0,
NSC_VAR | V_SDIST,	"s_dist",0,0,
NSC_VAR | V_GDIST,	"g_dist",0,0,
NSC_VAR | V_PDIST,	"p_dist",0,0,
NSC_VAR | V_IDIST,	"i_dist",0,0,
NSC_VAR | V_DDIST,	"d_dist",0,0,
NSC_VAR | V_BDIST,	"b_dist",0,0,
NSC_VAR | V_FDIST,	"f_dist",0,0,
NSC_VAR | V_ODIST,	"o_dist",0,0,
NSC_VAR | V_LDIST,	"l_dist",0,0,
NSC_VAR | V_HDIST,	"h_dist",0,0,
NSC_VAR | V_RDIST,	"r_dist",0,0,
NSC_VAR | V_CDEL,	"c_del",0,0,
NSC_VAR | V_MDEL,	"m_del",0,0,
NSC_VAR | V_UDEL,	"u_del",0,0,
NSC_VAR | V_SDEL,	"s_del",0,0,
NSC_VAR | V_GDEL,	"g_del",0,0,
NSC_VAR | V_PDEL,	"p_del",0,0,
NSC_VAR | V_IDEL,	"i_del",0,0,
NSC_VAR | V_DDEL,	"d_del",0,0,
NSC_VAR | V_BDEL,	"b_del",0,0,
NSC_VAR | V_FDEL,	"f_del",0,0,
NSC_VAR | V_ODEL,	"o_del",0,0,
NSC_VAR | V_LDEL,	"l_del",0,0,
NSC_VAR | V_HDEL,	"h_del",0,0,
NSC_VAR | V_RDEL,	"r_del",0,EDV_LAST_VAR,
0,	0,	0,0
};

struct	castr   sect_ca[]    = {
#ifndef apollo
NSC_UCHAR|fldoff(sctstr, sct_own),"owner",0,EDV_OWN,
NSC_XCOORD|fldoff(sctstr, sct_x), "xloc",0,EDV_ID,
NSC_YCOORD|fldoff(sctstr, sct_y), "yloc",0,EDV_ID,
NSC_UCHAR|fldoff(sctstr, sct_type), "des",0,EDV_TYPE,
NSC_ROUND|NSC_UCHAR|fldoff(sctstr, sct_effic), "effic",0,EDV_EFF,
NSC_SHORT|fldoff(sctstr, sct_mobil), "mobil",0,0,
NSC_UCHAR|fldoff(sctstr, sct_terr), "terr",0,0,
NSC_UCHAR|fldoff(sctstr, sct_work), "work",0,0,
NSC_UCHAR|fldoff(sctstr, sct_coastal), "coastal",0,0,
NSC_UCHAR|fldoff(sctstr, sct_newtype), "newdes",0,EDV_NEWTYPE,
NSC_UCHAR|fldoff(sctstr, sct_min), "min",0,0,
NSC_UCHAR|fldoff(sctstr, sct_gmin), "gold",0,0,
NSC_UCHAR|fldoff(sctstr, sct_fertil), "fert",0,0,
NSC_UCHAR|fldoff(sctstr, sct_oil), "ocon",0,0,
NSC_UCHAR|fldoff(sctstr, sct_uran), "uran",0,0,
NSC_UCHAR|fldoff(sctstr, sct_oldown), "oldown",0,0,
NSC_UCHAR|fldoff(sctstr, sct_off), "off",0,0,
NSC_XCOORD|fldoff(sctstr, sct_dist_x), "xdist",0,0,
NSC_YCOORD|fldoff(sctstr, sct_dist_y), "ydist",0,0,
NSC_SHORT|fldoff(sctstr, sct_avail), "avail",0,0,
#endif
0,	0,	0,0
};

#define NSC_GENITEM \
NSC_UCHAR | fldoff(genitem, own), "owner",0,EDV_OWN,\
NSC_SHORT | fldoff(genitem, uid), "uid",0,EDV_ID,\
NSC_XCOORD | fldoff(genitem, x), "xloc",0,EDV_XY,\
NSC_YCOORD | fldoff(genitem, y), "yloc",0,EDV_XY,\
NSC_UCHAR | fldoff(genitem, type), "type",0,EDV_TYPE,\
NSC_ROUND | NSC_UCHAR | fldoff(genitem, effic), "effic",0,EDV_EFF,\
NSC_CHAR  | fldoff(genitem, mobil), "mobil",0,0,\
NSC_SHORT | fldoff(genitem, sell), "sell",0,0,\
NSC_ROUND | NSC_SHORT | fldoff(genitem, tech), "tech",0,EDV_TECH,\
NSC_CHAR | fldoff(genitem, group), "group",0,0,\
NSC_XCOORD | fldoff(genitem, opx), "opx",0,0,\
NSC_YCOORD | fldoff(genitem, opy), "opy",0,0,\
NSC_SHORT | fldoff(genitem, mission), "mission",0,0

struct	castr	genitem_ca[] = {
#ifndef apollo
NSC_GENITEM,
#endif
0,	0,	0,0
};

struct	castr   ship_ca[]    = {
#ifndef apollo
NSC_GENITEM,
NSC_CHAR | fldoff(shpstr, shp_fleet), "fleet",0,0,
NSC_CHAR | fldoff(shpstr, shp_nplane), "nplane",0,0,
#ifdef FUEL
NSC_UCHAR | fldoff(shpstr, shp_fuel), "fuel",0,0,
#endif /* FUEL */
NSC_UCHAR | fldoff(shpstr, shp_nxlight), "nxlight",0,0,
NSC_UCHAR | fldoff(shpstr, shp_nchoppers), "nchoppers",0,0,
NSC_UCHAR | fldoff(shpstr, shp_autonav), "autonav",0,0,
#endif
0,	0,	0,0
};

struct	castr   plane_ca[]    = {
#ifndef apollo
NSC_GENITEM,
NSC_UCHAR | fldoff(plnstr, pln_wing), "wing",0,0,
NSC_UCHAR | fldoff(plnstr, pln_range), "range",0,0,
NSC_SHORT | fldoff(plnstr, pln_ship), "ship",0,0,
NSC_UCHAR | fldoff(plnstr, pln_att), "att",0,0,
NSC_UCHAR | fldoff(plnstr, pln_def), "def",0,0,
NSC_UCHAR | fldoff(plnstr, pln_harden), "harden",0,0,
NSC_UCHAR | fldoff(plnstr, pln_nuketype), "nuketype",0,0,
NSC_UCHAR | fldoff(plnstr, pln_flags), "flags",0,0,
NSC_SHORT | fldoff(plnstr, pln_land), "land",0,0,
#endif
0,	0,	0,0
};

struct	castr   land_ca[]    = {
#ifndef apollo
NSC_GENITEM,
NSC_CHAR | fldoff(lndstr, lnd_army), "army",0,0,
NSC_SHORT | fldoff(lndstr, lnd_ship), "ship",0,0,
NSC_CHAR | fldoff(lndstr, lnd_harden), "harden",0,0,
NSC_SHORT | fldoff(lndstr, lnd_retreat), "retreat",0,0,
#ifdef FUEL
NSC_UCHAR | fldoff(lndstr, lnd_fuel), "fuel",0,0,
#endif /* FUEL */
NSC_UCHAR | fldoff(lndstr, lnd_nxlight), "nxlight",0,0,
#endif
0,	0,	0,0
};

struct	castr   nuke_ca[]    = {
#ifndef apollo
NSC_UCHAR | fldoff(nukstr, nuk_own), "owner",0,EDV_OWN,
NSC_SHORT | fldoff(nukstr, nuk_uid), "uid",0,EDV_ID,
NSC_XCOORD | fldoff(nukstr, nuk_x), "xloc",0,EDV_XY,
NSC_YCOORD | fldoff(nukstr, nuk_y), "yloc",0,EDV_XY,
NSC_CHAR | fldoff(nukstr, nuk_n), "number",0,0,
NSC_CHAR | fldoff(nukstr, nuk_types[0]),"types",N_MAXNUKE,EDV_TYPE,
#endif
0,	0,	0,0
};

struct	castr   treaty_ca[]    = {
#ifndef apollo
NSC_UCHAR | fldoff(trtstr, trt_cna), "cna",0,0,
NSC_UCHAR | fldoff(trtstr, trt_cnb), "cnb",0,0,
NSC_UCHAR | fldoff(trtstr, trt_status), "status",0,0,
NSC_SHORT | fldoff(trtstr, trt_acond), "acond",0,0,
NSC_SHORT | fldoff(trtstr, trt_bcond), "bcond",0,0,
NSC_LONG | fldoff(trtstr, trt_exp), "exp",0,0,
#endif
0,	0,	0,0
};

struct	castr   loan_ca[]    = {
#ifndef apollo
NSC_UCHAR | fldoff(lonstr, l_loner), "loaner",0,0,
NSC_UCHAR | fldoff(lonstr, l_lonee), "loanee",0,0,
NSC_SHORT | fldoff(lonstr, l_sell), "sell",0,0,
NSC_LONG | fldoff(lonstr, l_irate), "irate",0,0,
NSC_LONG | fldoff(lonstr, l_ldur), "ldur",0,0,
NSC_LONG | fldoff(lonstr, l_amtpaid), "amtpaid",0,0,
NSC_LONG | fldoff(lonstr, l_amtdue), "amtdue",0,0,
NSC_LONG | fldoff(lonstr, l_lastpay), "lastpay",0,0,
NSC_LONG | fldoff(lonstr, l_duedate), "duedate",0,0,
#endif
0,	0,	0,0
};

struct	castr   news_ca[]    = {
#ifndef apollo
NSC_CHAR | fldoff(nwsstr, nws_ano), "actor",0,0,
NSC_CHAR | fldoff(nwsstr, nws_vrb), "action",0,0,
NSC_CHAR | fldoff(nwsstr, nws_vno), "victim",0,0,
NSC_CHAR | fldoff(nwsstr, nws_ntm), "times",0,0,
NSC_LONG | fldoff(nwsstr, nws_when), "time",0,0,
#endif
0,	0,	0,0
};

struct	castr   trade_ca[]    = {
#ifndef apollo
NSC_UCHAR | fldoff(trdstr, trd_type), "type",0,0,
NSC_UCHAR | fldoff(trdstr, trd_owner), "owner",0,0,
NSC_SHORT | fldoff(trdstr, trd_unitid), "unitid",0,0,
NSC_LONG | fldoff(trdstr, trd_price), "price",0,0,
#endif
0,	0,	0,0
};

struct castr	nat_ca[] = {
NSC_UCHAR | fldoff(natstr, nat_cnum),"cnum",0,EDV_ID,
NSC_CHAR | fldoff(natstr, nat_cnam[0]),"cnam",20,0,
NSC_DEITY | NSC_CHAR | fldoff(natstr, nat_pnam[0]),"pnam",20,0,
NSC_XCOORD | fldoff(natstr, nat_xstart),"xstart",0,EDV_XY,
NSC_YCOORD | fldoff(natstr, nat_ystart),"ystart",0,EDV_XY,
NSC_XCOORD | fldoff(natstr, nat_xcap),"xcap",0,EDV_XY,
NSC_YCOORD | fldoff(natstr, nat_ycap),"ycap",0,EDV_XY,
NSC_DEITY | NSC_XCOORD | fldoff(natstr, nat_xorg),"xorg",0,0,
NSC_DEITY | NSC_YCOORD | fldoff(natstr, nat_yorg),"yorg",0,0,
#ifdef MAYBE_LATER
NSC_CHAR | fldoff(natstr, nat_stat),"stat",0,0,
NSC_CHAR | fldoff(natstr, nat_dayno),"dayno",0,0,
#ifdef DEMANDUPDATE
NSC_CHAR | fldoff(natstr, nat_update),"update",0,0,
NSC_UCHAR | fldoff(natstr, nat_missed),"missed",0,0,
#endif	/* DEMANDUPDATE */
#endif /* MAYBE_LATER */
NSC_USHORT | fldoff(natstr, nat_tgms),"tgms",0,0,
NSC_USHORT | fldoff(natstr, nat_ann),"ann",0,0,
NSC_USHORT | fldoff(natstr, nat_minused),"minused",0,0,
NSC_SHORT | fldoff(natstr, nat_btu),"btu",0,0,
NSC_LONG | fldoff(natstr, nat_reserve),"reserve",0,EDV_MIL,
NSC_LONG | fldoff(natstr, nat_money),"money",0,EDV_MONEY,
#ifdef MAYBE_LATER
NSC_LONG | fldoff(natstr, nat_last_login),"last_login",0,0,
NSC_LONG | fldoff(natstr, nat_last_logout),"last_logout",0,0,
NSC_LONG | fldoff(natstr, nat_newstim),"newstim",0,0,
#endif /* MAYBE_LATER */
NSC_FLOAT | fldoff(natstr, nat_level[0]),"level",4,EDV_LEVEL, 
/* NSC_SHORT | fldoff(natstr, nat_relate[0]),"relate",MAXNOC,0, */
/* NSC_CHAR | fldoff(natstr, nat_priorities[0]),"priorities",39,0, */
/* NSC_LONG | fldoff(natstr, nat_flags),"flags",0,0, */
0,	0,	0,0
};

struct castr	map_ca[] = {
NSC_XCOORD | fldoff(mapstr, map_x),"x",0,0,
NSC_XCOORD | fldoff(mapstr, map_y),"y",0,0,
NSC_CHAR | fldoff(mapstr, map_des),"des",0,0,
0,	0,	0,0
};

struct castr	bmp_ca[] = {
NSC_XCOORD | fldoff(bmpstr, bmp_leftx),"leftx",0,0,
NSC_XCOORD | fldoff(bmpstr, bmp_rightx),"rightx",0,0,
NSC_YCOORD | fldoff(bmpstr, bmp_y),"y",0,0,
NSC_CHAR | fldoff(bmpstr, bmp_row[0]),"row",WORLD_X/2+1,0,
0,0,0,0
};

