Import of Empire 4.2.12

This commit is contained in:
Markus Armbruster 2003-08-23 12:23:04 +00:00
commit d8b7fdfae1
817 changed files with 126589 additions and 0 deletions

64
src/lib/global/Makefile Normal file
View file

@ -0,0 +1,64 @@
#
# Empire - A multi-player, client/server Internet based war game.
# Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Ken Stevens, Steve McClure
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# ---
#
# 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.
#
# Makefile - Wolfpack, 1996
# Note that these could have been listed 1 per line, but I chose to just
# stick them all together this way to shorten the file.
include ../../../build.conf
include ../../make.src
include ../../make.defs
LIB = $(SRCDIR)/lib/libglobal.a
NTLIB = $(SRCDIR)\lib\libglobal.lib
OBJS = constants.o dir.o file.o init.o item.o land.o misc.o news.o nsc.o \
nuke.o numnames.o options.o path.o plane.o product.o sect.o ship.o\
treaty.o
NTOBJS = constants.obj dir.obj file.obj init.obj item.obj land.obj misc.obj \
news.obj nsc.obj nuke.obj numnames.obj options.obj path.obj plane.obj \
product.obj sect.obj ship.obj treaty.obj
all: $(LIB)
nt: $(NTLIB)
$(NTLIB): $(NTOBJS)
-del /q $@
lib /OUT:$@ /DEBUGTYPE:CV $(NTOBJS)
$(LIB): $(OBJS)
rm -f $(LIB)
ar cq $(LIB) $(OBJS)
$(RANLIB) $(LIB)
clean:
-(rm -f $(OBJS))
-(del /q $(NTOBJS))
include ../../make.rules
include Makedepend

251
src/lib/global/constants.c Normal file
View file

@ -0,0 +1,251 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* constants.c: Global constants file. Note that the "hours" file can
* override these, as does the global "econfig" file.
*
* Known contributors to this file:
* Ken Stevens, 1995
* Steve McClure, 1996
*
*/
#include "gamesdef.h"
#include "misc.h"
#include "xy.h"
s_char *privname = PRVNAM; /* name of priv user */
s_char *privlog = PRVLOG; /* logname of priv user */
int WORLD_X = DEF_WORLD_X; /* World size - x */
int WORLD_Y = DEF_WORLD_Y; /* World size - y */
int MARK_DELAY = 7200; /* Seconds to bid on commodities */
int TRADE_DELAY = 7200; /* Seconds to bid on units */
int m_m_p_d = 1440; /* max mins of play per day (per country) */
long s_p_etu = DEF_S_P_ETU; /* seconds per Empire time unit */
int etu_per_update = ETUS; /* # of etu's per update, from misc.h */
long adj_update = 0; /* update time adjustment */
int update_window = 0; /* update window adjustment */
int hourslop = 5; /* amount of slop to match update times */
s_char *update_times = ""; /* times regular update is allowed */
int update_policy = 0; /* update policy for regular updates */
int update_demandpolicy = 2;/* update policy for demand updates */
int update_missed = 999; /* demand updates missed before veto */
int update_wantmin = 0; /* number of votes required for demand update */
int blitz_time = 10; /* number of minutes between blitz updates */
s_char *update_demandtimes = "";/* times demand update is allowed */
s_char *game_days = ""; /* days game is running */
s_char *game_hours = ""; /* hours game is running */
int max_idle = 15; /* session dies after max_idle minutes idle */
int sect_mob_max = 127; /* sector mobility limits */
float sect_mob_scale = 1.0; /* accumulation multiplier */
int land_mob_max = 127; /* land mobility limits */
float land_mob_scale = 1.0; /* accumulation multiplier */
int ship_mob_max = 127; /* ship mobility limits */
float ship_mob_scale = 1.5; /* accumulation multiplier */
int plane_mob_max = 127; /* plane mobility limits */
float plane_mob_scale = 1.0; /* accumulation multiplier */
float fire_range_factor = 1.0;/* Increase/reduce firing ranges */
int morale_base = 42; /* base for morale */
/* opt_MOB_ACCESS */
int sect_mob_neg_factor = 2;/* ETU/neg_factor = negative amount of mobility
a sector has after being taken */
int updating_mob = 1; /* If we are currently updating mob */
int timestamp_fixing = 0; /* If we are currently fixing timestamps */
int lost_items_timeout = 172800; /* How long before removing from database */
double combat_mob=5.0; /* how much mob do units spend for combat? */
/* if you find that naving is taking too long, try reducing these */
int fort_max_interdiction_range = 8;
int ship_max_interdiction_range = 8;
int land_max_interdiction_range = 8;
double mission_mob_cost = 0.0; /* Cost is percentage of max mob */
double unit_damage = 0.30; /* Units take this % of normal damage */
double people_damage = 1.00; /* Civs/Mil/Uw take this % of normal damage */
double collateral_dam = 0.10; /* Side effect damage to sector */
double assault_penalty = 0.50; /* attack factor for para & assault troops */
/* START_UNITS */
#ifdef START_UNITS
int start_unit_type[START_UNITS] = {0, 1}; /* type of unit */
#endif /* START_UNITS */
/* opt_FUEL */
int fuel_mult = 10; /* 1 fuel = 10 mob */
int land_grow_scale = 2; /* how fast eff grows for land units (xETUS) */
int ship_grow_scale = 3; /* how fast eff grows for ships (xETUS) */
int plane_grow_scale = 2; /* how fast eff grows for planes (xETUS) */
double fgrate = 0.0012; /* food growth rate (dt * fert) */
double fcrate = 0.0013; /* food cultivate rate (dt * workforce) */
double eatrate = 0.0005; /* food eating rate (dt * people) */
/*double eatrate = 0.0001;*/ /* food eating rate (dt * people) */
double babyeat = 0.0060; /* food to mature 1 baby into a civilian */
/*double babyeat = 0.0000;*/ /* food to mature 1 baby into a civilian */
double obrate = 0.005; /* other sectors birth rate */
double uwbrate = 0.0025; /* uncompensated worker birth rate */
/* values > 0.25 for either will overflow */
/* opt_FALLOUT */
/* these are the radioactive decay constants */
/* fraction of commodity destroyed is
etus*fallout/(1000*melt_item_denom[item])
higher denominators for tougher commodities */
int melt_item_denom[] =
/* civ mil shell gun pet iron dust bar*/
{ 0, 4, 20, 80, 100,50, 100, 100, 200,
2, 50, 100,100,2, 1000 };
/*food oil lcm hcm UW rads */
double decay_per_etu = 0.006; /* This gives a half life of ? etus,
about ? days.
half life in Jt
log(.5) / log(1-decay_per_etu)
Calculate your own if you don't like it.
If you want a specific half life you can
calc it with this formula:
decay_per_etu = 1 - (.5)^(1/etus)
due to the discrete nature of empire
you can not get a precise number
without intensive simulation
(more than 3 digits). */
double fallout_spread = 0.005; /* fraction of fallout that leaks into
each surrounding sector */
/* end opt_FALLOUT */
double bankint = 0.25; /* bank interest rate (dt * bars) */
/* Note in the taxes below:
tradetax - this is charged to the seller, so it is < 1 (because the seller
gets the (price paid * tradetax)
buytax - this is charged to the buyer, so it is > 1 (because the buyer is
charged (price paid * buytax).
Not perfect, but it works. :) */
double minmult = 0.5; /* minimum trade mulitple */
double maxmult = 10.0; /* maximum trade multiple */
double tradetax = 0.99; /* Tax charged on trade */
double buytax = 1.0; /* Tax charged on market purchases */
int startmob = 127; /* Sanctuary starting mobility */
double flakscale = 1.75; /* Scale factor for flak damage */
/* money gained from taxes, paid to military, and reservists */
double money_civ = 0.0083333;
double money_uw = 0.0017777;
double money_mil = -0.0833333;
double money_res = -0.0083333;
/* pct cost per ETU for maintaining a ship or plane or land unit */
double money_plane = -0.001;
double money_ship = -0.001;
double money_land = -0.001;
/* edu and hap consumption factors -- hap_cons civs need 1 hap --> hlev++ */
double hap_cons = 600000.0;
double edu_cons = 600000.0;
/* hap and edu avg mean that the weight on current happiness is
* (cur_hap * hap_avg + hap_prod * etu) / (hap_avg + etu); */
float hap_avg = 16.0 * 3.0;
float edu_avg = 16.0 * 12.0;
/* tech build limitations. Tech limits only apply after easy_tech.
* Two ways of limiting tech: asymptotic or logrithmic:
* tech_hard is asymptopic limitation, tech_log_base is the logrithmic
* limitation. set tech_log_base > 1.0 to have it take effect,
* set hard_tech > 0 to have it take effect
* for log based, only tech values where the slop is < 1 are used */
float easy_tech = 1.00; /* amount of tech built with no penality */
float hard_tech = 10.0; /* amount of in-efficiently built tech */
float tech_log_base = 2.0; /* base of log to take of in-efficient tech */
float ally_factor = 2.0; /* shared tech with allies = 1/factor */
float level_age_rate = 96.0; /* 1% per 96 etu's; 0 -> no decline */
int players_at_00 = 0; /* players coord system on deity 0,0? */
int at_least_one_100 = 1; /* init player with 100/100/100/100 sector? */
float btu_build_rate = 0.0012;/* etu * civ * eff * btu_build_rate */
/* 8 * 999 * 100 * 0.0004 = 319 */
int max_btus = 640; /* maximum # of btu's */
double powe_cost = 10.0; /* btu cost to gen a power report */
double buil_bt = 10.0; /* tech level required to build a bridge */
int buil_bh = 100; /* hcm required to build a bridge */
double buil_bc = 2000.0; /* cash required to build a bridge */
double buil_tower_bt = 100.0; /* tech level required to build a tower */
int buil_tower_bh = 400; /* hcm required to build a bridge tower */
double buil_tower_bc = 7500.0; /* cash required to build a bridge tower */
/* opt_SLOW_WAR */
int War_Cost = 1000; /* Cost to declare war */
/* opt_DEMANDUPDATE */
long last_demand_update=0; /* When was last demand update? */
/* opt_DRNUKE */
float drnuke_const = .33; /* research must be at least drnuke_const*tech*/
/* in order to build a nuke. For example, if
* drnuke_const is .25, you need a 75 res to
* build a nuke that takes 300 tech
*/
/* opt_TRADESHIPS */
int trade_1_dist = 8; /* less than this gets no money */
int trade_2_dist = 14; /* less than this gets trade_1 money */
int trade_3_dist = 25; /* less than this gets trade_2 money */
float trade_1 = 0.025; /* return on trade_1 distance */
float trade_2 = 0.035; /* return on trade_2 distance */
float trade_3 = 0.050; /* return on trade_3 distance */
float trade_ally_bonus = 0.20; /* 20% bonus for trading with allies */
float trade_ally_cut = 0.10; /* 10% bonus for ally you trade with */
/* end opt_TRADESHIPS */
int torpedo_damage = 40; /* damage is X + 1dX + 1dX, so 40+1d40+1d40 */
/* initial levels */
float start_education = 0.0;
float start_happiness = 0.0;
float start_technology = 0.0;
float start_research = 0.0;

71
src/lib/global/dir.c Normal file
View file

@ -0,0 +1,71 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* dir.c: Directional orientation descriptions. Must agree with defines
* in path.h
*
* Known contributors to this file:
*/
#include "misc.h"
#include "var.h"
#include "xy.h"
/* must agree with DIR_ defines */
s_char dirch[] = {
'h', /* stop */
'u', /* up-right */
'j', /* right */
'n', /* down-right */
'b', /* down-left */
'g', /* left */
'y', /* up-left */
'v', /* view */
'm', /* map */
'\0',
};
/* must agree with dirch[] and DIR_ defines */
int diroff[][2] = {
{0,0}, {1,-1}, {2,0}, {1,1}, {-1,1}, {-2,0}, {-1,-1}, {0,0}, {0,0}
};
/* this maps a character from a to z into the diroff mappings. It
keeps us from having to loop if we don't want to */
int dirindex[] = { 0, 4, 0, 0, 0, 0, 5, 0, 0, 2, 0, 0, 8,
3, 0, 0, 0, 0, 0, 0, 1, 7, 0, 0, 6, 0 };
/* must agree with dirch[] and DIR_ defines */
s_char *routech[7][2] = {
{ " ", "$ $" },
{ " /", "$ /" },
{ " >", "$ >" },
{ " \\", "$ \\" },
{ "/ ", "/ $" },
{ "< ", "< $" },
{ "\\ ", "\\ $" }
};

106
src/lib/global/file.c Normal file
View file

@ -0,0 +1,106 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* fileglb.c: Empire selection global structures.
*
* Known contributors to this file:
*
*/
#include <struct.h>
#include "misc.h"
#include "var.h"
#include "xy.h"
#include "loan.h"
#include "nsc.h"
#include "nuke.h"
#include "plane.h"
#include "ship.h"
#include "land.h"
#include "sect.h"
#include "trade.h"
#include "treaty.h"
#include "file.h"
#include "power.h"
#include "news.h"
#include "nat.h"
#include "lost.h"
#include "optlist.h"
#include "gamesdef.h"
#include "commodity.h"
#if !defined(_WIN32)
#define FILEPATH(p) EMPPATH(data/p)
#else
#define FILEPATH(p) EMPPATH(data\\p)
#endif
struct empfile empfile[] = {
{ "sect", FILEPATH(sector), EFF_COM|EFF_XY|EFF_OWNER,
0, sizeof(struct sctstr),
0, 0, 0, { fldoff(sctstr, sct_nv), fldoff(sctstr, sct_vtype[0]),
fldoff(sctstr, sct_vamt[0]) }, MAXSCTV,
-1, -1, 0, 0, 0, 0, 0 },
{ "ship", FILEPATH(ship), EFF_COM|EFF_XY|EFF_OWNER|EFF_GROUP,
0, sizeof(struct shpstr),
0, 0, 0, { fldoff(shpstr, shp_nv), fldoff(shpstr, shp_vtype[0]),
fldoff(shpstr, shp_vamt[0]) }, MAXSHPV,
-1, -1, 0, 0, 0, 0, 0 },
{ "plane", FILEPATH(plane), EFF_XY|EFF_OWNER|EFF_GROUP,
0, sizeof(struct plnstr),
0, 0, 0, { 0, 0, 0 }, 0, -1, -1, 0, 0, 0, 0, 0 },
{ "land", FILEPATH(land), EFF_COM|EFF_XY|EFF_OWNER|EFF_GROUP,
0, sizeof(struct lndstr),
0, 0, 0, { fldoff(lndstr, lnd_nv), fldoff(lndstr, lnd_vtype[0]),
fldoff(lndstr, lnd_vamt[0]) }, MAXLNDV,
-1, -1, 0, 0, 0, 0, 0 },
{ "nuke", FILEPATH(nuke), EFF_XY|EFF_OWNER, 0, sizeof(struct nukstr),
0, 0, 0, { 0, 0, 0 }, 0, -1, -1, 0, 0, 0, 0, 0 },
{ "news", FILEPATH(news), 0,
0, sizeof(struct nwsstr),
0, 0, 0, { 0, 0, 0 }, 0, -1, -1, 0, 0, 0, 0, 0 },
{ "treaty", FILEPATH(treaty), 0, 0, sizeof(struct trtstr),
0, 0, 0, { 0, 0, 0 }, 0, -1, -1, 0, 0, 0, 0, 0 },
{ "trade", FILEPATH(trade), 0, 0, sizeof(struct trdstr),
0, 0, 0, { 0, 0, 0 }, 0, -1, -1, 0, 0, 0, 0, 0 },
{ "pow", FILEPATH(power), 0, 0, sizeof(struct powstr),
0, 0, 0, { 0, 0, 0 }, 0, -1, -1, 0, 0, 0, 0, 0 },
{ "nat", FILEPATH(nation), 0, 0, sizeof(struct natstr),
0, 0, 0, { 0, 0, 0 }, 0, -1, -1, 0, 0, 0, 0, 0 },
{ "loan", FILEPATH(loan), 0,
0, sizeof(struct lonstr),
0, 0, 0, { 0, 0, 0 }, 0, -1, -1, 0, 0, 0, 0, 0 },
{ "map", FILEPATH(map), 0, 0, DEF_WORLD_X*DEF_WORLD_Y/2,
0, 0, 0, { 0, 0, 0 }, 0, -1, -1, 0, 0, 0, 0, 0 },
{ "bmap", FILEPATH(bmap), 0, 0, DEF_WORLD_X*DEF_WORLD_Y/2,
0, 0, 0, { 0, 0, 0 }, 0, -1, -1, 0, 0, 0, 0, 0 },
{ "commodity", FILEPATH(commodity),0,0,sizeof(struct comstr),
0, 0, 0, { 0, 0, 0 }, 0, -1, -1, 0, 0, 0, 0, 0 },
{ "lost", FILEPATH(lostitems), 0, 0, sizeof(struct loststr),
0, 0, 0, { 0, 0, 0 }, 0, -1, -1, 0, 0, 0, 0, 0 }
};

95
src/lib/global/init.c Normal file
View file

@ -0,0 +1,95 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* init.c: Initialize global unit arrays
*
* Known contributors to this file:
* Ken Stevens, 1995
* Steve McClure, 1997
*/
#include "misc.h"
#include "var.h"
#include "ship.h"
#include "plane.h"
#include "product.h"
#include "nat.h"
#include "optlist.h"
#include "global.h"
void
global_init(void)
{
init_pchr();
init_mchr();
init_plchr();
/* the same thing should be done for units... */
}
void
init_mchr(void)
{
register struct mchrstr *mp;
register int n;
for (mp = mchr, n = 0; n < shp_maxno; n++, mp++) {
if (mp->m_nxlight)
mp->m_flags |= M_XLIGHT;
if (mp->m_nchoppers)
mp->m_flags |= M_CHOPPER;
if (mp->m_nplanes && !(mp->m_flags & M_MSL || mp->m_flags & M_FLY))
mp->m_flags |= M_MSL;
if (mp->m_nland)
mp->m_flags |= M_UNIT;
}
}
void
init_plchr(void)
{
register struct plchrstr *pp;
int pcount;
for (pp = plchr, pcount = 0; pcount < pln_maxno; pcount++, pp++) {
if (pp->pl_flags & P_M)
pp->pl_flags |= P_V;
}
}
void
init_pchr(void)
{
register struct pchrstr *p;
int pcount;
for (p = pchr, pcount = 0; pcount < prd_maxno; pcount++, p++) {
if (opt_GO_RENEW) {
if (p->p_type == V_DUST || p->p_type == V_OIL)
p->p_nrdep = 0;
}
}
}

63
src/lib/global/item.c Normal file
View file

@ -0,0 +1,63 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* item.c: Item characteristics
*
* Known contributors to this file:
*
*/
/*
* must be in same order as defines in var.h
*/
#include "misc.h"
#include "var.h"
#include "item.h"
struct ichrstr ichr[I_MAX+2] = {
/* mnem vtype val sell lbs rg,wh,ur,bnk name */
{ '?', 0, 0, 0, 0, { 0, 0, 0, 0}, "unused" },
/* STM CHANGED HERE */
{ 'c', V_CIVIL, 1, 0, 1, {10,10,10,10}, "civilians" },
{ 'm', V_MILIT, 0, 0, 1, { 1, 1, 1, 1}, "military" },
{ 's', V_SHELL, 5, 1, 1, { 1,10, 1, 1}, "shells" },
{ 'g', V_GUN, 60, 1, 10,{ 1,10, 1, 1}, "guns" },
{ 'p', V_PETROL, 4, 1, 1, { 1,10, 1, 1}, "petrol" },
{ 'i', V_IRON, 2, 1, 1, { 1,10, 1, 1}, "iron ore" },
{ 'd', V_DUST, 20, 1, 5, { 1,10, 1, 1}, "dust (gold)" },
{ 'b', V_BAR, 280, 1, 50,{ 1, 5, 1, 4}, "bars of gold" },
{ 'f', V_FOOD, 0, 1, 1, { 1,10, 1, 1}, "food" },
{ 'o', V_OIL, 8, 1, 1, { 1,10, 1, 1}, "oil" },
{ 'l', V_LCM, 2, 1, 1, { 1,10, 1, 1}, "light products" },
{ 'h', V_HCM, 4, 1, 1, { 1,10, 1, 1}, "heavy products" },
{ 'u', V_UW, 1, 1, 2, { 1, 2, 1, 1}, "uncompensated workers"},
{ 'r', V_RAD, 150, 1, 8, { 1,10, 1, 1}, "radioactive materials"},
{ 0, 0, 0, 0, 0, { 0, 0, 0, 0}, 0 }
};
int itm_maxno = (sizeof(ichr) / sizeof(struct ichrstr)) - 1;

266
src/lib/global/land.c Normal file
View file

@ -0,0 +1,266 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* land.c: Land unit characteristics
*
* Known contributors to this file:
* Thomas Ruschak, 1992
* Ken Stevens, 1995
* Steve McClure, 1998-2000
*/
#include "misc.h"
#include "var.h"
#include "land.h"
struct lchrstr lchr[] = {
/* name
lcm, hcm, mil, gun, shell, tech, $,
att, def, vul, spd, vis, spy, rad, frg, acc, dam, amm, aaf, fc, fu, xpl, mxl
flags, nv
cargo
*/
/* ((int)((ETUS*4)/(mil/1000)) is enough food for 3 updates */
{ 2,
{ V_FOOD, V_MILIT },
{ ((int)((ETUS*4)/20)), 20 },
"cav cavalry",
10, 5, 0, 0, 0, 30, 500,
1.2, 0.5, 80, 32, 18, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
L_RECON|L_LIGHT,
},
{ 3,
{ V_FOOD, V_SHELL, V_MILIT },
{ ((int)((ETUS)/4)), 1, 25 },
"linf light infantry",
8, 4, 0, 0, 0, 40, 300,
1.0, 1.5, 60, 28, 15, 2, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0,
L_ASSAULT|L_LIGHT,
},
{ 2,
{ V_FOOD, V_MILIT },
{ ((int)((ETUS*4)/10)), 100 },
"inf infantry",
10, 5, 0, 0, 0, 50, 500,
1.0, 1.5, 60, 25, 15, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
L_ASSAULT|L_LIGHT,
},
{ 3,
{ V_FOOD, V_SHELL, V_MILIT },
{ ((int)((ETUS*5)/5)), 8, 100 },
"mtif motor inf",
15, 10, 0, 0, 0, 190, 400,
1.2, 2.2, 60, 33, 17, 1, 3, 0, 0, 0, 2, 3, 13, 1, 0, 0,
L_LIGHT,
},
{ 3,
{ V_FOOD, V_SHELL, V_MILIT },
{ ((int)((ETUS*5)/5)), 8, 100 },
"mif mech inf",
15, 10, 0, 0, 0, 190, 800,
1.5, 2.5, 50, 33, 17, 1, 3, 0, 0, 0, 2, 3, 13, 1, 0, 0,
L_LIGHT,
},
{ 3,
{ V_FOOD, V_SHELL, V_MILIT },
{ ((int)((ETUS*5)/5)), 4, 100 },
"mar marines",
10, 5, 0, 0, 0, 140,1000,
1.4, 2.4, 60, 25, 14, 2, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0,
L_MARINE|L_ASSAULT|L_LIGHT,
},
{ 10,
{ V_SHELL,V_GUN,V_FOOD,V_LCM,V_HCM,V_DUST,V_BAR,V_IRON,V_PETROL,V_MILIT},
{ 200, 10, 300, 200, 100, 100, 10, 100, 300, 25},
"sup supply",
10, 5, 0, 0, 0, 50, 500,
0.1, 0.2, 80, 25, 20, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
L_LIGHT|L_SUPPLY,
},
{ 12,
{ V_SHELL,V_GUN,V_FOOD,V_LCM,V_HCM,V_DUST,V_BAR,V_IRON,V_PETROL,V_MILIT,V_OIL,V_RAD},
{ 990, 200, 990, 990, 990, 500, 100, 500, 990, 990, 990, 150},
"tra train",
100, 50, 0, 0, 0, 40, 3500,
0.0, 0.0, 120, 10, 25, 3, 0, 0, 0, 0, 0, 0, 0, 0, 5, 12,
L_XLIGHT|L_TRAIN|L_HEAVY|L_SUPPLY,
},
{ 0,
{ V_FOOD },
{ 0, },
"spy infiltrator",
10, 5, 0, 0, 0, 40, 750,
0.0, 0.0, 80, 32, 18, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
L_ASSAULT|L_RECON|L_LIGHT|L_SPY,
},
{ 1,
{ V_SHELL },
{ 3, },
"com commando",
10, 5, 0, 0, 0, 55, 1500,
0.0, 0.0, 80, 32, 18, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
L_ASSAULT|L_RECON|L_LIGHT|L_SPY,
},
{ 3,
{ V_FOOD, V_SHELL, V_MILIT },
{ ((int)((ETUS)/5)), 5, 20 },
"aau aa unit",
20, 10, 0, 0, 0, 70, 500,
0.5, 1.0, 60, 18, 20, 1, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0,
L_FLAK|L_LIGHT,
},
{ 4,
{ V_FOOD, V_SHELL, V_MILIT, V_GUN},
{ ((int)((ETUS*4)/10)), 40, 25, 10 },
"art artillery",
20, 10, 0, 0, 0, 35, 800,
0.1, 0.4, 70, 18, 20, 1, 0, 8, 50, 5, 2, 1, 0, 0, 0, 0,
L_LIGHT,
},
{ 4,
{ V_FOOD, V_SHELL, V_MILIT, V_GUN },
{ ((int)((ETUS*4)/20)), 20, 25, 6 },
"lat lt artillery",
20, 10, 0, 0, 0, 70, 500,
0.2, 0.6, 60, 30, 18, 1, 1, 5, 10, 3, 1, 1, 0, 0, 0, 0,
L_LIGHT,
},
{ 4,
{ V_FOOD, V_SHELL, V_MILIT, V_GUN },
{ ((int)((ETUS*4)/10)), 80, 25, 12 },
"hat hvy artillery",
40, 20, 0, 0, 0, 100, 800,
0.0, 0.2, 60, 12, 20, 1, 0, 11, 99, 8, 4, 1, 0, 0, 0, 0,
0,
},
{ 4,
{ V_FOOD, V_SHELL, V_MILIT, V_GUN },
{ ((int)((ETUS*5)/20)), 40, 25, 10 },
"mat mech artillery",
20, 10, 0, 0, 0, 200, 1000,
0.2, 0.6, 50, 35, 17, 1, 1, 8, 35, 6, 3, 3, 13, 1, 0, 0,
L_LIGHT,
},
{ 3,
{ V_FOOD, V_SHELL, V_MILIT },
{ ((int)((ETUS*4)/20)), 3, 20},
"eng engineer",
10, 5, 0, 0, 0, 130,3000,
1.2, 2.4, 50, 25, 14, 2, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0,
L_ENGINEER|L_ASSAULT|L_LIGHT,
},
{ 3,
{ V_FOOD, V_SHELL, V_MILIT },
{ ((int)((ETUS*5)/20)), 4, 20 },
"meng mech engineer",
10, 5, 0, 0, 0, 260,4500,
1.8, 3.5, 45, 33, 15, 3, 3, 0, 0, 0, 1, 5, 25, 2, 0, 0,
L_ENGINEER|L_ASSAULT|L_LIGHT,
},
{ 3,
{ V_FOOD, V_SHELL,V_MILIT },
{ ((int)((ETUS*5)/10)), 4, 50},
"lar lt armor",
10, 5, 0, 0, 0, 150, 600,
2.0, 1.0, 50, 42, 15, 4, 4, 0, 0, 0, 1, 2, 25, 1, 0, 0,
L_RECON|L_LIGHT,
},
{ 3,
{ V_FOOD, V_SHELL, V_MILIT },
{ ((int)((ETUS*4)/5)), 3, 100 },
"har hvy armor",
20, 10, 0, 0, 0, 120, 500,
2.0, 0.8, 50, 18, 17, 1, 1, 0, 0, 0, 2, 1, 10, 2, 0, 0,
0,
},
{ 3,
{ V_FOOD, V_SHELL, V_MILIT},
{ ((int)((ETUS*5)/10)), 4, 50 },
"arm armor",
20, 10, 0, 0, 0, 170,1000,
3.0, 1.5, 40, 33, 16, 2, 2, 0, 0, 0, 1, 2, 13, 1, 0, 0,
L_LIGHT,
},
{ 3,
{ V_FOOD, V_SHELL, V_MILIT },
{ ((int)((ETUS*5)/10)), 4, 50 },
"sec security",
10, 5, 0, 0, 0, 170, 600,
1.0, 2.0, 60, 25, 15, 2, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0,
L_SECURITY|L_LIGHT,
},
{ 2,
{ V_FOOD, V_MILIT },
{ ((int)((ETUS*5)/40)), 10 },
"rad radar unit",
10, 5, 0, 0, 0, 270,1000,
0.0, 0.0, 50, 33, 15, 3, 0, 0, 0, 0, 0, 2, 25, 2, 1, 0,
L_XLIGHT|L_RADAR|L_LIGHT,
},
/* name
lcm, hcm, mil, gun, shell, tech, $,
att, def, vul, spd, vis, spy, rad, frg, acc, dam, amm, aaf, fc, fu, xpl,
flags, nv
cargo
*/
{ 0,
{ 0 },
{ 0 },
"",
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,
}
};
int lnd_maxno = (sizeof(lchr) / sizeof(struct lchrstr)) - 1;

72
src/lib/global/misc.c Normal file
View file

@ -0,0 +1,72 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* misc.c: Misc type description lists
*
* Known contributors to this file:
*
*/
#include "misc.h"
s_char *effadv_list[] = {
"minimally", "partially", "moderately", "completely", 0,
};
/* must follow nation relation defines in nat.h */
s_char *relates[] = {
"At War", "Sitzkrieg", "Mobilizing", "Hostile", "Neutral", "Friendly", "Allied"
};
/* must follow reject flags defined in nat.h */
s_char *rejects[] = {
" YES YES YES YES",
" NO YES YES YES",
" YES NO YES YES",
" NO NO YES YES",
" YES YES NO YES",
" NO YES NO YES",
" YES NO NO YES",
" NO NO NO YES",
" YES YES YES NO ",
" NO YES YES NO ",
" YES NO YES NO ",
" NO NO YES NO ",
" YES YES NO NO ",
" NO YES NO NO ",
" YES NO NO NO ",
" NO NO NO NO "
};
/* must follow TEL_ defines in tel.h */
s_char *telnames[] = {
"Telegram", "Announcement", "BULLETIN", "Production Report"
};
s_char *att_mode[] = {
"defend", "attack", "assault", "paradrop", "board", "lboard"
};

229
src/lib/global/news.c Normal file
View file

@ -0,0 +1,229 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* news.c: News item characteristics
*
* Known contributors to this file:
*
*/
/*
* News item characteristics; one entry (and two different
* strings) per news item. Be sure and increase N_MAX_VERB
* in news.h if you add a news item.
*
* Order must correspond to ordering in news.h
*/
#include "misc.h"
#include "news.h"
s_char *page_headings[N_MAX_PAGE+1] = {
/* not used */ "Comics",
/* N_FOR */ "Foreign Affairs",
/* N_FRONT */ "The Front Line",
/* N_SEA */ "The High Seas",
/* N_SKY */ "Sky Watch",
/* N_MISS */ "Guidance Systems",
/* N_ARTY */ "Firestorms",
/* N_ECON */ "Business & Economics",
/* N_COLONY */ "The Frontier",
/* N_HOME */ "The Home Front",
/* N_SPY */ "Espionage",
/* N_TELE */ "Telecommunications"
};
struct rptstr rpt[N_MAX_VERB+1] = {
/* nice page text
*/{ 0, 0, { "does nothing in particular to %s",
/* 0*/ "does nothing to %s" } },
{ -4, N_FRONT, { "infantry capture %s territory",
/* 1*/ "shock troops overrun one of %s's sectors" } },
{ -4, N_FRONT, { "infantry beaten back by %s troops",
/* 2*/ "shock troops annihilated in failed attack on %s" } },
{ -1, N_SPY, { "spy shot by %s firing squad",
/* 3*/ "spy captured and shot by %s" } },
{ 1, N_TELE, { "sends a telegram to %s",
/* 4*/ "telexes %s" } },
{ 3, N_FOR, { "diplomats sign a treaty with %s",
/* 5*/ "ambassador agrees to a treaty with %s" } },
{ 2, N_ECON, { "bankers make a loan to %s",
/* 6*/ "Ministry of Finance lends money to %s" } },
{ 1, N_ECON, { "repays a loan from %s",
/* 7*/ "makes last payment on loan from %s" } },
{ 0, N_ECON, { "makes a sale to %s",
/* 8*/ "sells goods to %s" } },
{ -1, N_SKY, { "violates %s airspace",
/* 9*/ "overflies %s territory" } },
{ -2, N_ARTY, { "gunners bombard %s territory",
/* 10*/ "artillery fires on %s sectors" } },
{ -2, N_SEA, { "shells a ship owned by %s",
/* 11*/ "fires on %s ships" } },
{ 0, N_FRONT, { "takes over unoccupied land",
/* 12*/ "attacks unowned land for some reason" } },
{ 0, N_SEA, { "ships torpedoed by enemy wolf-packs",
/* 13*/ "ships torpedoed by marauding U-boats" } },
{ 0, N_ARTY, { "gunners fire on %s in self-defense",
/* 14*/ "gunners decimate %s aggressors" } },
{ 0, N_FOR, { "breaks sanctuary",
/* 15*/ "no longer has a sanctuary" } },
{ -2, N_SKY, { "planes divebomb one of %s's sectors",
/* 16*/ "bombers wreak havoc on %s" } },
{ -2, N_SEA, { "divebombs a ship flying the flag of %s",
/* 17*/ "airforce bombs %s ships" } },
{ -2, N_SEA, { "seadogs board one of %s's ships",
/* 18*/ "pirates board %s ship" } },
{ -3, N_SEA, { "is repelled by %s while attempting to board a ship",
/* 19*/ "pirates prove inept at boarding %s's ships" } },
{ -1, N_SKY, { "anti-aircraft gunners fire on %s airforce",
/* 20*/ "attempts to shoot down %s aircraft" } },
{ -2, N_ECON, { "seizes a sector from %s to collect on a loan",
/* 21*/ "collects one of %s's sectors in repayment of a loan" } },
{ -1, N_FOR, { "considers an action which would violate a treaty with %s",
/* 22*/ "decides not to violate treaty with %s (yet)" } },
{ -4, N_FOR, { "violates a treaty with %s",
/* 23*/ "actions violate treaty with %s" } },
{ 0, N_FOR, { "dissolves its government",
/* 24*/ "throws in the towel" } },
{ 0, N_SEA, { "ship hits a mine",
/* 25*/ "ship severely damaged in mine field" } },
{ 5, N_FOR, { "announces an alliance with %s",
/* 26*/ "/ %s alliance declared" } },
{ 0, N_FOR, { "declares their neutrality toward %s", /* no longer used */
/* 27*/ "announces neutral relations with %s" } },
{ -5, N_FOR, { "declares TOTAL WAR on %s",
/* 28*/ "gets serious with %s and declares WAR" } },
{ 0, N_FOR, { "diplomats disavow former alliance with %s",
/* 29*/ "is no longer allied with %s" } },
{ 5, N_FOR, { "is no longer at war with %s",
/* 30*/ "Foreign Ministry declares \"No more war with %s\"" } },
{ 0, N_HOME, { "reports outbreak of the black plague",
/* 31*/ "sector infected with bubonic plague" } },
{ 0, N_HOME, { "citizens die from bubonic plague",
/* 32*/ "sector reports plague deaths" } },
{ 0, N_FOR, { "goes through a name change",
/* 33*/ "adopts a new country name" } },
{ 0, N_HOME, { "citizens starve in disastrous famine",
/* 34*/ "loses citizens to mass starvation" } },
{ 0, N_HOME, { "endures lawless rioting",
/* 35*/ "suffers from outbreaks of rioting" } },
{ -3, N_SKY, { "pilots down %s planes",
/* 36*/ "victorious in air-to-air combat against %s" } },
{ -10, N_MISS, { "nuclear device devastates %s sector",
/* 37*/ "explodes a nuclear device damaging %s territory" } },
{ 0, N_HOME, { "terrorists shoot it out with %s special forces",
/* 38*/ "underground rises up against %s occupation" } },
{ -2, N_HOME, { "execution squads gun down helpless %s civilians",
/* 39*/ "firing squads massacre defenseless %s workers" } },
{ 0, N_MISS, { "launches a satellite into orbit",
/* 40*/ "continues its conquest of space with a successful launch" } },
{ -8, N_MISS, { "strikes a %s big bird",
/* 41*/ "rockets damage a %s satellite" } },
{ 4, N_ECON, { "makes a contribution to %s",
/* 42*/ "helps out %s" } },
{ 2, N_HOME, { "aids %s with divine intervention",
/* 43*/ "smiles upon %s" } },
{ -3, N_HOME, { "hurts %s with divine intervention",
/* 44*/ "frowns upon %s" } },
{ -4, N_ECON, { "sacrifices to %s",
/* 45*/ "makes divine payment to %s" } },
{ -10, N_MISS, { "abms intercept a %s missile",
/* 46*/ "strategic defense systems destroy a %s missile" } },
{ -2, N_MISS, { "missile fired at one of %s's sectors",
/* 47*/ "missile wreaks havoc on %s" } },
{ -2, N_MISS, { "missile fired at a ship flying the flag of %s",
/* 48*/ "missiles hit %s ships" } },
{ 2, N_ECON, { "engages in friendly trade with %s",
/* 49*/ "profits from a merchant venture with %s" } },
{ 0, N_ECON, { "pirates dispose of %s booty in trade",
/* 50*/ "buccaneers sell their %s goods" } },
{ 0, N_ECON, { "pirates keep their %s booty",
/* 51*/ "buccaneers laugh and bury their %s goods" } },
{ 0, N_SEA, { "ships torpedoed by %s torpedo-boats",
/* 52*/ "ships sunk by marauding %s torpedo-boats" } },
{ 0, N_SEA, { "planes bomb a skulking %s submarine",
/* 53*/ "planes drop depth-charges on a %s sub" } },
{ -2, N_SEA, { "ship is blown up in a failed assault on %s",
/* 54*/ "has a ship destroyed while assaulting %s" } },
{ -2, N_SKY, { "divebombs a brave %s unit",
/* 55*/ "airforce bombs %s units" } },
{ 0, N_FRONT, { "troops run afoul of a landmine",
/* 56*/ "troops severely damaged in mine field" } },
{ -2, N_ARTY, { "fortress gunners support troops attacking %s",
/* 57*/ "fortress artillery massacres %s defenders" } },
{ -2, N_ARTY, { "gunners support troops attacking %s",
/* 58*/ "artillery battery massacres %s defenders" } },
{ -2, N_ARTY, { "naval gunners support troops attacking %s",
/* 59*/ "naval gunfire massacres %s defenders" } },
{-10, N_FOR, { "sacks %s capital",
/* 60*/ "captures and pillages %s's capital" } },
{ 3, N_FOR, { "announces friendly trade relations with %s",
/* 61*/ "upgrades %s's trade status to triple-A" } },
{ 0, N_FOR, { "downgrades relations with %s to friendly",
/* 62*/ "cools relations with %s to friendly" } },
{ 2, N_FOR, { "upgrades relations with %s to neutral",
/* 63*/ "Foreign Ministry declares \"%s is A-OK.\"" } },
{ 0, N_FOR, { "downgrades relations with %s to neutral",
/* 64*/ "gives the cold shoulder to %s and declares neutral relations" } },
{ 3, N_FOR, { "upgrades relations with %s to hostile",
/* 65*/ "forgives %s of past war crimes but remains hostile" } },
{-3, N_FOR, { "downgrades relations with %s to hostile",
/* 66*/ "is suspicious that %s has hostile intentions" } },
{ 0, N_MISS, { "sector is struck by a sub-launched missile",
/* 67*/ "sector devastated by missile" } },
{ 0, N_MISS, { "ship is hit by a sub-launched missile",
/* 68*/ "ship damaged by marine missile" } },
{ 0, N_COLONY,{ "pilgrims settle on a new island",
/* 69*/ "discovers new land and starts a colony" } },
{ 0, N_MISS, { "abms intercept an incoming nuclear device",
/* 70*/ "strategic defense systems destroy an incoming nuclear warhead" } },
{-2, N_MISS, { "missile fired at %s ground troops",
/* 71*/ "missile hits %s troops" } },
{ 0, N_MISS, { "regiment struck by sub-launched missile",
/* 72*/ "ground troops hit by missile" } },
{ -4, N_FRONT, { "navy secures a beachhead on %s territory",
/* 73*/ "sailors take a coastal sector from %s" } },
{ -4, N_FRONT, { "paratroopers comandeer a sector from %s",
/* 74*/ "air force parachutists overwhelm a %s sector" } },
{ 0, N_COLONY,{ "parachutists grab unoccupied land",
/* 75*/ "paratroopers break new ground" } },
{-4, N_FRONT, { "sailors repelled by %s coast-guard",
/* 76*/ "naval forces massacred in failed assault of %s" } },
{-4, N_FRONT, { "paratroopers destroyed in failed air-assault on %s",
/* 77*/ "loses parachutists in failed air-assault of %s" } },
{ 0, N_ECON, { "is forced into debt to %s by bad management",
/* 78*/ "shows bad financial planning" } },
{ 0, N_ECON, { "has its credit rating downgraded to unworthy status",
/* 79*/ "is denied credit by %s due to lack of collatoral" } },
{ 0, N_ECON, { "is unable to fulfill its financial obligations to %s",
/* 80*/ "welches on a deal with %s" } },
{ -3, N_FRONT, { "is repelled by %s while attempting to board a land unit",
/* 81*/ "forces prove inept at boarding %s's land unit" } },
{ -2, N_FRONT, { "mercenaries board one of %s's land units",
/* 82*/ "elite forces board %s land unit" } }
};
int nws_maxno = (sizeof(rpt) / sizeof(struct rptstr)) - 1;

370
src/lib/global/nsc.c Normal file
View file

@ -0,0 +1,370 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* nscglb.c: Empire selection global structures
*
* Known contributors to this file:
*
*/
#include <struct.h>
#include "misc.h"
#include "var.h"
#include "xy.h"
#include "loan.h"
#include "nsc.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"
#include "commodity.h"
#include "lost.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 },
{ NSC_DEITY | NSC_VAR | V_MINE, "lmine",0,0 },
{ NSC_VAR | V_FALLOUT, "fallout",0,0 },
{ NSC_ROUND | NSC_VAR | V_CIVIL, "civil",0,0 },
{ NSC_ROUND | NSC_VAR | V_MILIT, "milit",0,0 },
{ NSC_ROUND | NSC_VAR | V_SHELL, "shell",0,0 },
{ NSC_ROUND | NSC_VAR | V_GUN, "gun",0,0 },
{ NSC_ROUND | NSC_VAR | V_PETROL, "petrol",0,0 },
{ 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,0 },
{ NSC_ROUND | NSC_VAR | V_FOOD, "food",0,0 },
{ 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,0 },
{ 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,0 },
{ 0, 0, 0,0 }
};
struct castr sect_ca[] = {
#ifndef apollo
{ NSC_UCHAR|fldoff(sctstr, sct_own),"owner",0,0 },
{ NSC_XCOORD|fldoff(sctstr, sct_x), "xloc",0,0 },
{ NSC_YCOORD|fldoff(sctstr, sct_y), "yloc",0,0 },
{ NSC_UCHAR|fldoff(sctstr, sct_type), "des",0,0 },
{ NSC_ROUND|NSC_UCHAR|fldoff(sctstr, sct_effic), "effic",0,0 },
{ NSC_SHORT|fldoff(sctstr, sct_mobil), "mobil",0,0 },
{ NSC_UCHAR|fldoff(sctstr, sct_terr), "terr",0,0 },
{ NSC_UCHAR|fldoff(sctstr, sct_terr), "terr0",0,0 },
{ NSC_UCHAR|fldoff(sctstr, sct_terr1), "terr1",0,0 },
{ NSC_UCHAR|fldoff(sctstr, sct_terr2), "terr2",0,0 },
{ NSC_UCHAR|fldoff(sctstr, sct_terr3), "terr3",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,0 },
{ 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), "ocontent",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 },
{ NSC_UCHAR|fldoff(sctstr, sct_road), "road",0,0 },
{ NSC_UCHAR|fldoff(sctstr, sct_rail), "rail",0,0 },
{ NSC_UCHAR|fldoff(sctstr, sct_defense), "dfense",0,0 },
{ NSC_TIME|fldoff(sctstr, sct_timestamp), "timestamp",0,0 },
#endif
{ 0, 0, 0,0 }
};
#define NSC_GENITEM \
{ NSC_UCHAR | fldoff(genitem, own), "owner",0,0 },\
{ NSC_SHORT | fldoff(genitem, uid), "uid",0,0 },\
{ NSC_XCOORD | fldoff(genitem, x), "xloc",0,0 },\
{ NSC_YCOORD | fldoff(genitem, y), "yloc",0,0 },\
{ NSC_UCHAR | fldoff(genitem, type), "type",0,0 },\
{ NSC_ROUND | NSC_UCHAR | fldoff(genitem, effic), "effic",0,0 },\
{ 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,0 },\
{ 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 },
{ NSC_TIME | fldoff(shpstr, shp_timestamp), "timestamp",0,0 },
{ NSC_UCHAR | fldoff(shpstr, shp_fuel), "fuel",0,0 },
{ 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 },
{ NSC_TIME | fldoff(plnstr, pln_timestamp), "timestamp",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_SHORT | fldoff(lndstr, lnd_land), "land",0,0 },
{ NSC_CHAR | fldoff(lndstr, lnd_harden), "harden",0,0 },
{ NSC_SHORT | fldoff(lndstr, lnd_retreat), "retreat",0,0 },
{ NSC_UCHAR | fldoff(lndstr, lnd_fuel), "fuel",0,0 },
{ NSC_UCHAR | fldoff(lndstr, lnd_nxlight), "nxlight",0,0 },
{ NSC_FLOAT | fldoff(lndstr, lnd_att), "att",0,0 },
{ NSC_FLOAT | fldoff(lndstr, lnd_def), "def",0,0 },
{ NSC_INT | fldoff(lndstr, lnd_vul), "vul",0,0 },
{ NSC_INT | fldoff(lndstr, lnd_spd), "spd",0,0 },
{ NSC_INT | fldoff(lndstr, lnd_vis), "vis",0,0 },
{ NSC_INT | fldoff(lndstr, lnd_spy), "spy",0,0 },
{ NSC_INT | fldoff(lndstr, lnd_rad), "rad",0,0 },
{ NSC_INT | fldoff(lndstr, lnd_frg), "frg",0,0 },
{ NSC_INT | fldoff(lndstr, lnd_acc), "acc",0,0 },
{ NSC_INT | fldoff(lndstr, lnd_dam), "dam",0,0 },
{ NSC_INT | fldoff(lndstr, lnd_ammo), "ammo",0,0 },
{ NSC_INT | fldoff(lndstr, lnd_aaf), "aaf",0,0 },
{ NSC_UCHAR | fldoff(lndstr, lnd_fuelc), "fuelc",0,0 },
{ NSC_UCHAR | fldoff(lndstr, lnd_fuelu), "fuelu",0,0 },
{ NSC_UCHAR | fldoff(lndstr, lnd_maxlight), "maxlight",0,0 },
{ NSC_TIME | fldoff(lndstr, lnd_timestamp), "timestamp",0,0 },
#endif
{ 0, 0, 0,0 }
};
struct castr nuke_ca[] = {
#ifndef apollo
{ NSC_UCHAR | fldoff(nukstr, nuk_own), "owner",0,0 },
{ NSC_SHORT | fldoff(nukstr, nuk_uid), "uid",0,0 },
{ NSC_XCOORD | fldoff(nukstr, nuk_x), "xloc",0,0 },
{ NSC_YCOORD | fldoff(nukstr, nuk_y), "yloc",0,0 },
{ NSC_CHAR | fldoff(nukstr, nuk_n), "number",0,0 },
#if !defined(_WIN32)
{ NSC_CHAR | fldoff(nukstr, nuk_types[0]),"types",N_MAXNUKE,0 },
#else
{ NSC_CHAR | fldoff(nukstr, nuk_types),"types",N_MAXNUKE,0 },
#endif
{ NSC_TIME | fldoff(nukstr, nuk_timestamp), "timestamp",0,0 },
#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_SHORT | fldoff(lonstr, l_uid), "uid", 0, 0 },
{ NSC_UCHAR | fldoff(lonstr, l_lonee), "loanee",0,0 },
{ NSC_CHAR | fldoff(lonstr, l_status), "status",0,0 },
{ NSC_SHORT | fldoff(lonstr, l_sell), "sell",0,0 },
{ NSC_INT | fldoff(lonstr, l_irate), "irate",0,0 },
{ NSC_INT | 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_TIME | fldoff(lonstr, l_lastpay), "lastpay",0,0 },
{ NSC_TIME | 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 lost_ca[] = {
{ NSC_UCHAR | fldoff(loststr, lost_owner), "owner", 0, 0 },
{ NSC_INT | fldoff(loststr, lost_uid), "uid", 0, 0 },
{ NSC_UCHAR | fldoff(loststr, lost_type), "type", 0, 0 },
{ NSC_XCOORD | fldoff(loststr, lost_x), "x", 0, 0 },
{ NSC_YCOORD | fldoff(loststr, lost_y), "y", 0, 0 },
{ NSC_TIME | fldoff(loststr, lost_timestamp), "timestamp", 0, 0 },
{ 0, 0, 0, 0 }
};
struct castr commodity_ca[] = {
{ NSC_UCHAR | fldoff(comstr, com_owner), "owner",0,0 },
{ NSC_SHORT | fldoff(comstr, com_uid), "uid",0,0 },
{ NSC_UCHAR | fldoff(comstr, com_type), "type",0,0 },
{ NSC_INT | fldoff(comstr, com_amount), "amount",0,0 },
{ NSC_FLOAT | fldoff(comstr, com_price), "price",0,0 },
{ NSC_INT | fldoff(comstr, com_maxbidder), "maxbidder",0,0 },
{ NSC_FLOAT | fldoff(comstr, com_maxprice), "maxprice",0,0 },
{ NSC_TIME | fldoff(comstr, com_markettime), "markettime",0,0 },
{ NSC_INT | fldoff(comstr, com_x), "xloc",0,0 },
{ NSC_INT | fldoff(comstr, com_y), "yloc",0,0 },
{ NSC_XCOORD | fldoff(comstr, sell_x), "xsell",0,0 },
{ NSC_YCOORD | fldoff(comstr, sell_y), "ysell",0,0 },
{ 0, 0, 0,0 }
};
struct castr trade_ca[] = {
#ifndef apollo
{ NSC_UCHAR | fldoff(trdstr, trd_owner), "owner",0,0 },
{ NSC_SHORT | fldoff(trdstr, trd_uid), "uid", 0, 0 },
{ NSC_UCHAR | fldoff(trdstr, trd_type), "type",0,0 },
{ NSC_SHORT | fldoff(trdstr, trd_unitid), "unitid",0,0 },
{ NSC_LONG | fldoff(trdstr, trd_price), "price",0,0 },
{ NSC_INT | fldoff(trdstr, trd_maxbidder), "maxbidder",0,0 },
{ NSC_INT | fldoff(trdstr, trd_maxprice), "maxprice",0,0 },
{ NSC_TIME | fldoff(trdstr, trd_markettime), "markettime",0,0 },
{ NSC_XCOORD | fldoff(trdstr, trd_x), "xloc",0,0 },
{ NSC_YCOORD | fldoff(trdstr, trd_y), "yloc",0,0 },
#endif
{ 0, 0, 0,0 }
};
struct castr nat_ca[] = {
{ NSC_UCHAR | fldoff(natstr, nat_cnum),"cnum",0,0 },
#if !defined(_WIN32)
{ NSC_CHAR | fldoff(natstr, nat_cnam[0]),"cnam",20,0 },
{ NSC_DEITY | NSC_CHAR | fldoff(natstr, nat_pnam[0]),"pnam",20,0 },
#else
{ NSC_CHAR | fldoff(natstr, nat_cnam),"cnam",20,0 },
{ NSC_DEITY | NSC_CHAR | fldoff(natstr, nat_pnam),"pnam",20,0 },
#endif
{ NSC_XCOORD | fldoff(natstr, nat_xstart),"xstart",0,0 },
{ NSC_YCOORD | fldoff(natstr, nat_ystart),"ystart",0,0 },
{ NSC_XCOORD | fldoff(natstr, nat_xcap),"xcap",0,0 },
{ NSC_YCOORD | fldoff(natstr, nat_ycap),"ycap",0,0 },
{ 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 },
{ NSC_CHAR | fldoff(natstr, nat_update),"update",0,0 },
{ NSC_UCHAR | fldoff(natstr, nat_missed),"missed",0,0 },
#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,0 },
{ NSC_LONG | fldoff(natstr, nat_money),"money",0,0 },
#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 */
#if !defined(_WIN32)
{ NSC_FLOAT | fldoff(natstr, nat_level[0]),"level",4,0 },
#else
{ NSC_FLOAT | fldoff(natstr, nat_level),"level",4,0 },
#endif
/* 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_YCOORD | fldoff(mapstr, map_y),"y",0,0 },
{ NSC_CHAR | fldoff(mapstr, map_des),"des",0,0 },
{ 0, 0, 0,0 }
};

57
src/lib/global/nuke.c Normal file
View file

@ -0,0 +1,57 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* nuke.c: Nuke characteristics
*
* Known contributors to this file:
*
*/
#include "misc.h"
#include "nuke.h"
struct nchrstr nchr[N_MAXNUKE] = {
/* name lcm hcm oil rads blst dam cost tech lbs flags */
{ "10kt fission", 50, 50, 25, 70, 3, 70, 10000, 280, 4, 0 },
{ "15kt fission", 50, 50, 25, 80, 3, 90, 15000, 290, 5, 0 },
{ "50kt fission", 60, 60, 30, 90, 3, 100, 25000, 300, 6, 0 },
{ "100kt fission", 75, 75, 40, 120, 4, 125, 30000, 310, 8, 0 },
{ "5kt fusion", 15, 15, 15, 30, 2, 80, 12500, 315, 1, 0 },
{ "75kt fusion", 40, 40, 35, 50, 3, 90, 20000, 320, 3, 0 },
{ "250kt fusion", 50, 50, 45, 60, 4, 110, 25000, 330, 4, 0 },
{ "500kt fusion", 60, 60, 50, 80, 5, 120, 35000, 340, 5, 0 },
{ "1mt fusion", 75, 75, 50, 110, 6, 150, 40000, 350, 5, 0 },
{ "60kt neutron", 60, 60, 30, 100, 3, 30, 30000, 355, 2, N_NEUT },
{ "3mt fusion", 100, 100, 75, 130, 7, 170, 45000, 360, 6, 0 },
{ "5mt fusion", 120, 120, 100, 150, 8, 190, 50000, 370, 8, 0 },
{ "120kt neutron", 75, 75, 40, 120, 5, 50, 36000, 375, 3, N_NEUT },
{ "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
int nuk_maxno = (sizeof(nchr) / sizeof(struct nchrstr)) - 1;

48
src/lib/global/numnames.c Normal file
View file

@ -0,0 +1,48 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* numnames.c: Strings used to convert numbers to strings
*
* Known contributors to this file:
*
*/
#include "misc.h"
s_char *numnames[] = {
"zero", "one", "two", "three", "four", "five", "six",
"seven", "eight", "nine", "ten", "eleven", "twelve",
"thirteen", "fourteen", "fifteen", "sixteen",
"seventeen", "eighteen", "nineteen",
};
s_char *tennames[] = {
"", "", "twenty", "thirty", "forty", "fifty",
"sixty", "seventy", "eighty", "ninety",
"hundred", "hundred ten", "hundred twenty",
"hundred thirty", 0,
};

380
src/lib/global/options.c Normal file
View file

@ -0,0 +1,380 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* options.c: Options definitions
*
* Known contributors to this file:
* Steve McClure, 1998
*
*/
#include <stdio.h>
#include "misc.h"
#include "options.h"
#include "optlist.h"
/* there must be an easier way - but can't think of one off hand */
#ifdef NO_FORT_FIRE
int opt_NO_FORT_FIRE = 1;
#else
int opt_NO_FORT_FIRE = 0;
#endif
#ifdef BRIDGETOWERS
int opt_BRIDGETOWERS = 1;
#else
int opt_BRIDGETOWERS = 0;
#endif
#ifdef GODNEWS
int opt_GODNEWS = 1;
#else
int opt_GODNEWS = 0;
#endif
#ifdef TREATIES
int opt_TREATIES = 1;
#else
int opt_TREATIES = 0;
#endif
#ifdef GO_RENEW
int opt_GO_RENEW = 1;
#else
int opt_GO_RENEW = 0;
#endif
#ifdef DEFENSE_INFRA
int opt_DEFENSE_INFRA = 1;
#else
int opt_DEFENSE_INFRA = 0;
#endif
#ifdef SHIP_DECAY
int opt_SHIP_DECAY = 1;
#else
int opt_SHIP_DECAY = 0;
#endif
#ifdef NO_HCMS
int opt_NO_HCMS = 1;
#else
int opt_NO_HCMS = 0;
#endif
#ifdef NO_LCMS
int opt_NO_LCMS = 1;
#else
int opt_NO_LCMS = 0;
#endif
#ifdef NO_OIL
int opt_NO_OIL = 1;
#else
int opt_NO_OIL = 0;
#endif
#ifdef PLANENAMES
int opt_PLANENAMES = 1;
#else
int opt_PLANENAMES = 0;
#endif
#ifdef LANDSPIES
int opt_LANDSPIES = 1;
#else
int opt_LANDSPIES = 0;
#endif
#ifdef MOB_ACCESS
int opt_MOB_ACCESS = 1;
#else
int opt_MOB_ACCESS = 0;
#endif
#ifdef LOANS
int opt_LOANS = 1;
#else
int opt_LOANS = 0;
#endif
#ifdef MARKET
int opt_MARKET = 1;
#else
int opt_MARKET = 0;
#endif
#ifdef NOFOOD
int opt_NOFOOD = 1;
#else
int opt_NOFOOD = 0;
#endif
#ifdef SNEAK_ATTACK
int opt_SNEAK_ATTACK = 1;
#else
int opt_SNEAK_ATTACK = 0;
#endif
#ifdef BLITZ
int opt_BLITZ = 1;
#else
int opt_BLITZ = 0;
#endif
#ifdef HIDDEN
int opt_HIDDEN = 1;
#else
int opt_HIDDEN = 0;
#endif
#ifdef LOSE_CONTACT
int opt_LOSE_CONTACT = 1;
#else
int opt_LOSE_CONTACT = 0;
#endif
#ifdef NONUKES
int opt_NONUKES = 1;
#else
int opt_NONUKES = 0;
#endif
#ifdef FUEL
int opt_FUEL = 1;
#else
int opt_FUEL = 0;
#endif
#ifdef TRADESHIPS
int opt_TRADESHIPS = 1;
#else
int opt_TRADESHIPS = 0;
#endif
#ifdef NEWPOWER
int opt_NEWPOWER = 1;
#else
int opt_NEWPOWER = 0;
#endif
#ifdef NOMOBCOST
int opt_NOMOBCOST = 1;
#else
int opt_NOMOBCOST = 0;
#endif
#ifdef SUPER_BARS
int opt_SUPER_BARS = 1;
#else
int opt_SUPER_BARS = 0;
#endif
#ifdef EASY_BRIDGES
int opt_EASY_BRIDGES = 1;
#else
int opt_EASY_BRIDGES = 0;
#endif
#ifdef ALL_BLEED
int opt_ALL_BLEED = 1;
#else
int opt_ALL_BLEED = 0;
#endif
#ifdef DRNUKE
int opt_DRNUKE = 1;
#else
int opt_DRNUKE = 0;
#endif
#ifdef SLOW_WAR
int opt_SLOW_WAR = 1;
#else
int opt_SLOW_WAR = 0;
#endif
#ifdef NO_PLAGUE
int opt_NO_PLAGUE = 1;
#else
int opt_NO_PLAGUE = 0;
#endif
#ifdef NEW_STARVE
int opt_NEW_STARVE = 1;
#else
int opt_NEW_STARVE = 0;
#endif
#ifdef NEW_WORK
int opt_NEW_WORK = 1;
#else
int opt_NEW_WORK = 0;
#endif
#ifdef RES_POP
int opt_RES_POP = 1;
#else
int opt_RES_POP = 0;
#endif
#ifdef GRAB_THINGS
int opt_GRAB_THINGS = 1;
#else
int opt_GRAB_THINGS = 0;
#endif
#ifdef SHOWPLANE
int opt_SHOWPLANE = 1;
#else
int opt_SHOWPLANE = 0;
#endif
#ifdef ORBIT
int opt_ORBIT = 1;
#else
int opt_ORBIT = 0;
#endif
#ifdef PINPOINTMISSILE
int opt_PINPOINTMISSILE = 1;
#else
int opt_PINPOINTMISSILE = 0;
#endif
#ifdef FALLOUT
int opt_FALLOUT = 1;
#else
int opt_FALLOUT = 0;
#endif
#ifdef SAIL
int opt_SAIL = 1;
#else
int opt_SAIL = 0;
#endif
#ifdef NUKEFAILDETONATE
int opt_NUKEFAILDETONATE = 1;
#else
int opt_NUKEFAILDETONATE = 0;
#endif
#ifdef SHIPNAMES
int opt_SHIPNAMES = 1; /* not used currently */
#else
int opt_SHIPNAMES = 0; /* not used currently */
#endif
#ifdef NEUTRON
int opt_NEUTRON = 1;
#else
int opt_NEUTRON = 0;
#endif
#ifdef UPDATESCHED
int opt_UPDATESCHED = 1;
#else
int opt_UPDATESCHED = 0;
#endif
#ifdef DEMANDUPDATE
int opt_DEMANDUPDATE = 1;
#else
int opt_DEMANDUPDATE = 0;
#endif
#ifdef BIG_CITY
int opt_BIG_CITY = 1;
#else
int opt_BIG_CITY = 0;
#endif
#ifdef INTERDICT_ATT
int opt_INTERDICT_ATT = 1;
#else
int opt_INTERDICT_ATT = 0;
#endif
#ifdef TECH_POP
int opt_TECH_POP = 1;
#else
int opt_TECH_POP = 0;
#endif
struct option_list Options[] = {
{ "ALL_BLEED", &opt_ALL_BLEED },
{ "BIG_CITY", &opt_BIG_CITY },
{ "BLITZ", &opt_BLITZ },
{ "BRIDGETOWERS", &opt_BRIDGETOWERS },
{ "DEFENSE_INFRA", &opt_DEFENSE_INFRA },
{ "DEMANDUPDATE", &opt_DEMANDUPDATE },
{ "DRNUKE", &opt_DRNUKE },
{ "EASY_BRIDGES", &opt_EASY_BRIDGES },
{ "FALLOUT", &opt_FALLOUT },
{ "FUEL", &opt_FUEL },
{ "GODNEWS", &opt_GODNEWS },
{ "GO_RENEW", &opt_GO_RENEW },
{ "GRAB_THINGS", &opt_GRAB_THINGS },
{ "HIDDEN", &opt_HIDDEN },
{ "INTERDICT_ATT", &opt_INTERDICT_ATT },
{ "LANDSPIES", &opt_LANDSPIES },
{ "LOANS", &opt_LOANS },
{ "LOSE_CONTACT", &opt_LOSE_CONTACT },
{ "MARKET", &opt_MARKET },
{ "MOB_ACCESS", &opt_MOB_ACCESS },
{ "NEUTRON", &opt_NEUTRON },
{ "NEW_STARVE", &opt_NEW_STARVE },
{ "NEW_WORK", &opt_NEW_WORK },
{ "NEWPOWER", &opt_NEWPOWER },
{ "NO_FORT_FIRE", &opt_NO_FORT_FIRE },
{ "NO_HCMS", &opt_NO_HCMS },
{ "NO_LCMS", &opt_NO_LCMS },
{ "NO_OIL", &opt_NO_OIL },
{ "NO_PLAGUE", &opt_NO_PLAGUE },
{ "NOFOOD", &opt_NOFOOD },
{ "NOMOBCOST", &opt_NOMOBCOST },
{ "NONUKES", &opt_NONUKES },
{ "NUKEFAILDETONATE", &opt_NUKEFAILDETONATE },
{ "ORBIT", &opt_ORBIT },
{ "PINPOINTMISSILE", &opt_PINPOINTMISSILE },
{ "PLANENAMES", &opt_PLANENAMES },
{ "RES_POP", &opt_RES_POP },
{ "SAIL", &opt_SAIL },
{ "SHIP_DECAY", &opt_SHIP_DECAY },
{ "SHIPNAMES", &opt_SHIPNAMES },
{ "SHOWPLANE", &opt_SHOWPLANE },
{ "SLOW_WAR", &opt_SLOW_WAR },
{ "SNEAK_ATTACK", &opt_SNEAK_ATTACK },
{ "SUPER_BARS", &opt_SUPER_BARS },
{ "TECH_POP", &opt_TECH_POP },
{ "TRADESHIPS", &opt_TRADESHIPS },
{ "TREATIES", &opt_TREATIES },
{ "UPDATESCHED", &opt_UPDATESCHED },
{ NULL, NULL },
};

71
src/lib/global/path.c Normal file
View file

@ -0,0 +1,71 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* path.c: Path initializations needed outside of the file initialization
* tables
*
* Known contributors to this file:
*
*/
#include "gamesdef.h"
#include "misc.h"
#if !defined(_WIN32)
#define FILEPATH(p) EMPPATH(data/p)
#else
#define FILEPATH(p) EMPPATH(data\\p)
#endif
s_char *gamedir = EMPPATH(.);
s_char *infodir = EMPPATH(info.nr);
s_char *datadir = EMPPATH(data);
s_char *teldir = FILEPATH(tel);
s_char *upfil = FILEPATH(up);
s_char *downfil = FILEPATH(down);
s_char *disablefil = FILEPATH(disable);
#if !defined(_WIN32)
s_char *telfil = FILEPATH(tel/tel);
#else
s_char *telfil = FILEPATH(tel\\tel);
#endif
s_char *annfil = FILEPATH(ann);
s_char *commfil = FILEPATH(comm);
s_char *banfil = FILEPATH(ban);
s_char *authfil = FILEPATH(auth);
s_char *timestampfil = FILEPATH(timestamp);
s_char *lostfil = FILEPATH(lostitems);
#if !defined(_WIN32)
s_char *playerbin = EMPPATH(bin/emp_player);
s_char *updatebin = EMPPATH(bin/emp_update);
#else
s_char *playerbin = EMPPATH(bin\\emp_player);
s_char *updatebin = EMPPATH(bin\\emp_update);
#endif
s_char *loginport = EMP_PORT;

344
src/lib/global/plane.c Normal file
View file

@ -0,0 +1,344 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* plane.c: Plane characteristics
*
* Known contributors to this file:
* Dave Pare, 1986
* Jeff Bailey
* Thomas Ruschak, 1992
* Ken Stevens, 1995
* Steve McClure, 1998
*/
/*
* plane characteristics
* flags indicate capabilities of craft...
* P_T: tactical, P_F: fighter/interceptor, P_B: bomber,
* P_C: cargo, P_G: glider, P_V: vtol, P_M: (one-shot) missile
* P_L: light, can land on carriers.
* P_O: orbits (sat's & anti-sats), P_N: nuke killer (SDI)
* P_X: stealthy
* P_E: Extra light
* P_K: Chopper
* P_P: Can paratroop
* P_A: ASW plane, can find subs when reconning, can bomb subs
* P_R: recon plane, gets some info
* P_I: Image capability (advanced spying)
*
* Note if a plane is P_M (a missile) then it will automatically be made
* P_V (vtol) in init_global()
*/
#include "misc.h"
#include "plane.h"
struct plchrstr plchr[] = {
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"f1 fighter 1",
"f1 Sopwith Camel",
8, 2, 400, 50, 90, 1, 1,1, 4, 1, 1,
0,
P_V|P_T|P_F },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"f2 fighter 2",
"f2 P-51 Mustang",
8, 2, 400, 80, 80, 1, 4,4, 8, 1, 1,
0,
P_L|P_T|P_F },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"jf1 jet fighter 1",
"jf1 F-4 Phantom",
12, 4, 1000, 125, 45, 1, 14,14, 11, 2, 3,
0,
P_T|P_F|P_L },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"jf2 jet fighter 2",
"jf2 AV-8B Harrier",
12, 4, 1400, 195, 30, 1, 17,17, 14, 2, 3,
0,
P_T|P_F|P_L|P_V },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"sf stealth fighter",
"sf F-117A Nighthawk",
15, 5, 3000, 325, 45, 3, 19,19, 20, 2, 4,
80,
P_T|P_F|P_L },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"es escort",
"es P-38 Lightning",
9, 3, 700, 90, 60, 1, 5,5, 15, 1, 2,
0,
P_ESC|P_T },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"jes jet escort",
"jes F-14E jet escort",
14, 8,1400,160, 60, 1, 10,10, 25, 2, 3,
0,
P_ESC|P_T },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"lb lt bomber",
"lb TBD-1 Devastator",
10, 3, 550, 60, 50, 2, 0,3, 7, 1, 1,
0,
P_L|P_V|P_T|P_B },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"jl jet lt bomber",
"jl A-6 Intruder",
14, 4, 1000, 130, 25, 3, 0,9, 11, 2, 3,
0,
P_T|P_B|P_L },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"mb medium bomber",
"mb medium bomber",
14, 5, 1000, 80, 45, 4, 0,5, 14, 3, 3,
0,
P_T|P_B },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"jmb jet med bomber",
"jfb FB-111 Aardvark f/b",
20, 10, 1800, 140, 30, 7, 8, 8, 20, 5, 5,
0,
P_T|P_B },
{
"hb hvy bomber",
"hb B-26B Marauder",
20, 6, 1100, 90, 90, 5, 0,4, 15, 2, 2,
0,
P_B },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"jhb jet hvy bomber",
"jhb B-52 Strato-Fortress",
26, 13, 3200, 150, 80,12, 0,11, 35, 5, 6,
0,
P_B },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"sb stealth bomber",
"sb B-2 stealth bomber",
15, 5, 4000, 325, 25, 8, 0,15, 28, 2, 5,
80,
P_T|P_B },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"as anti-sub plane",
"as anti-sub plane",
10, 3, 550, 100, 85, 2, 0,3, 15, 2, 2,
0,
P_SWEEP|P_MINE|P_T|P_A },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"np naval plane",
"np naval plane",
20, 10, 1800, 135, 70, 3, 0,4, 28, 4, 2,
0,
P_SWEEP|P_MINE|P_C|P_T|P_A|P_L },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"nc naval chopper",
"nc AH-1 Cobra",
8, 2, 800, 160, 55, 2, 0,3, 11, 2, 2,
0,
P_V|P_SWEEP|P_T|P_A|P_K },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"ac attack chopper",
"ac AH-64 Apache",
8, 2, 800, 200, 15, 1, 0,9, 11, 2, 2,
40,
P_V|P_T|P_K },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"tc transport chopper",
"tc transport chopper",
8, 2, 800, 135, 0, 5, 0,3, 7, 2, 2,
40,
P_V|P_C|P_P|P_L|P_K },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"tr transport",
"tr C-56 Lodestar",
14, 5, 1000, 85, 0, 7, 0,2, 15, 3, 3,
0,
P_C|P_P },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"jt jet transport",
"jt C-141 Starlifter",
18, 5, 1500, 160, 0,16, 0,9, 35, 3, 4,
0,
P_C|P_P },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"zep Zeppelin",
"zep Zeppelin",
6, 2, 1000, 70, 60, 2, 0,-3, 15, 3, 2,
0,
P_S|P_V|P_T|P_C },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"re recon",
"re recon",
12, 4, 800, 130, 0, 0, 0,4, 15, 2, 2,
20,
P_S },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"sp spyplane",
"sp E2-C Hawkeye",
15, 5, 2000, 190, 0, 0, 0,11, 32, 2, 5,
50,
P_S },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"lst landsat",
"lst landsat",
20, 20, 2000, 245, 0, 0, 0,3, 41, 0, 9,
0,
P_O },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"ss spysat",
"ss KH-7 spysat",
20, 20, 4000, 305, 0, 0, 0,3, 61, 0, 9,
0,
P_I|P_O|P_S },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"mi naval missile",
"mi Harpoon",
8, 2, 300, 160, 50, 6, 0,5, 6, 0, 0,
0,
P_L|P_T|P_M|P_MAR },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"sam sam",
"sam Sea Sparrow",
3, 1, 200, 180, 0, 0, 0,18, 2, 0, 0,
0,
P_L|P_F|P_E|P_M },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"ssm",
"ssm V2",
15, 15, 800, 145, 60, 3, 0,3, 4, 0, 0,
0,
P_T|P_M },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"srbm",
"srbm Atlas",
20, 20, 1000, 200, 60, 6, 0,5, 9, 0, 0,
0,
P_T|P_M },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"irbm",
"irbm Titan",
20, 20, 1500, 260, 60, 8, 0,10, 15, 0, 0,
0,
P_T| P_M },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"icbm",
"icbm Minuteman",
20, 20, 3000, 310, 60,10, 0,15, 41, 0, 0,
0,
P_T|P_M },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"slbm",
"slbm Trident",
20, 20, 2000, 280, 60, 8, 0,6, 23, 0, 0,
0,
P_T|P_L|P_M },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"asat anti-sat",
"asat anti-sat",
20, 20, 2000, 305, 50, 6, 0,7, 13, 0, 4,
0,
P_O|P_M },
/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */
{
"abm anti-ballistic missile",
"abm Patriot",
16, 8, 1500, 270, 50, 0, 0,31, 12, 0, 0,
0,
P_N|P_M },
{
"", "", 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0,
0,
0 }
};
int pln_maxno = (sizeof(plchr) / sizeof(struct plchrstr)) - 1;

98
src/lib/global/product.c Normal file
View file

@ -0,0 +1,98 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* product.c: Product information
*
* Known contributors to this file:
*
*/
#include "misc.h"
#include "product.h"
#include "sect.h"
#include "nat.h"
#include "var.h"
struct pchrstr pchr[] = {
/* level cost nrndx nrdep nlndx nlmin nllag effic sname name */
{ 0, { 0 }, { 0 },
0, 0, 0, 0, 0, 0, 0, 0, 0,
"unused", "", },
{ 2, { V_LCM, V_HCM}, { 2, 1 },
V_SHELL, -1, 3, 0, 0, NAT_TLEV, 20, 10, 100,
"shells", "shells", },
{ 3, { V_OIL, V_LCM, V_HCM }, { 1, 5, 10 },
V_GUN, -1, 30, 0, 0, NAT_TLEV, 20, 10, 100,
"guns", "guns",},
{ 1, { V_OIL }, { 1 },
V_PETROL,-1, 1, 0, 0, NAT_TLEV, 20, 10, 1000,
"petrol", "petrol",},
{ 0, { 0 }, { 0 },
V_IRON, -1, 0,OFFSET(sctstr, sct_min),0, -1, 0, 0, 100,
"iron ore", "iron", },
{ 0, { 0 }, { 0 },
V_DUST, -1, 0,OFFSET(sctstr, sct_gmin),20, -1, 0, 0, 100,
"gold dust", "dust",},
{ 1, { V_DUST }, { 5 },
V_BAR, -1, 10, 0, 0, -1, 0, 0, 100,
"gold bars", "bars",},
{ 0, { 0 }, { 0 },
V_FOOD, -1, 0,OFFSET(sctstr, sct_fertil),0, NAT_TLEV, -10, 10, 900,
"food", "food",},
{ 0, { 0 }, { 0 },
V_OIL, -1, 0,OFFSET(sctstr, sct_oil),10, NAT_TLEV, -10, 10, 100,
"oil", "oil",},
{ 1, { V_IRON }, { 1 },
V_LCM, -1, 0, 0, 0, NAT_TLEV, -10, 10, 100,
"light construction materials", "lcm",},
{ 1, { V_IRON }, { 2 },
V_HCM, -1, 0, 0, 0, NAT_TLEV, -10, 10, 100,
"heavy construction materials", "hcm", },
{3,{V_DUST,V_OIL,V_LCM}, {1,5,10},
0, NAT_TLEV, 5*ETUS, 0, 0, NAT_ELEV, 5, 10, 100,
"technological breakthroughs", "tech",},
{3,{V_DUST,V_OIL,V_LCM }, { 1, 5, 10 },
0, NAT_RLEV, 90, 0, 0, NAT_ELEV, 5, 10, 100,
"medical discoveries", "medical",},
{ 1, { V_LCM }, { 1 },
0, NAT_ELEV, 9, 0, 0, -1, 0, 0, 100,
"a class of graduates", "edu",},
{ 1, { V_LCM }, { 1 },
0, NAT_HLEV, 9, 0, 0, -1, 0, 0, 100,
"happy strollers", "happy",},
{ 0, { 0 }, { 0 },
V_RAD, -1, 2,OFFSET(sctstr, sct_uran),35, NAT_TLEV, 40, 10, 100,
"radioactive materials", "rad",},
{ 0, { 0 }, { 0 },
V_DUST, -1, 0,OFFSET(sctstr, sct_gmin),20, -1, 0, 0, 75,
"gold dust", "dust",},
{ 0, {0}, {0},
0, 0, 0, 0, 0, 0, 0, 0, 0, "", "",}
};
int prd_maxno = (sizeof(pchr) / sizeof(struct pchrstr)) - 1;

97
src/lib/global/sect.c Normal file
View file

@ -0,0 +1,97 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* sect.c: Sector designation characteristics
*
* Known contributors to this file:
* Dave Pare, 1986
* Jeff Bailey
* Thomas Ruschak, 1992
* Ken Stevens, 1995
* Steve McClure, 1998
*/
/* order must agree with sect.h */
#include "misc.h"
#include "sect.h"
#include "product.h"
struct dchrstr bigcity_dchr = {
'c', 0, 2, NAV_02, UPKG,1.0, 2.0, 30, 0, 10, 1, 2, "city"
};
struct dchrstr dchr[SCT_MAXDEF+2] = {
/*
mnem prd mcst flg pkg ostr dstr value $ bld lcm hcm name */
{ '.', 0, 0, NAVOK, NPKG,0.0, 0.0, 0, 0, 0, 0, 0, "sea" },
{ '^', P_MDUST, 25, 0, NPKG,1.0, 4.0, 5, 0, 1, 0, 0, "mountain" },
{ 's', 0, 0, 0, NPKG,0.0,99.0, 127, 0, 0, 0, 0, "sanctuary" },
{ '\\',0, 0, 0, NPKG,0.0,99.0, 0, 0, 0, 0, 0, "wasteland" },
{ '-', 0, 3, 0, NPKG,1.0, 2.0, 1, 0, 0, 0, 0, "wilderness" },
{ 'c', 0, 2, 0, NPKG,1.0, 2.0, 30, 0, 1, 0, 0, "capital" },
{ 'u', P_URAN, 2, 0, NPKG,1.0, 2.0, 15, 0, 1, 0, 0, "uranium mine" },
{ 'p', P_HLEV, 2, 0, NPKG,1.0, 1.5, 5, 0, 1, 0, 0, "park" },
{ 'd', P_GUN, 2, 0, NPKG,1.0, 1.5, 7, 0, 1, 0, 0, "defense plant" },
{ 'i', P_SHELL, 2, 0, NPKG,1.0, 1.5, 6, 0, 1, 0, 0, "shell industry" },
{ 'm', P_IRON, 2, 0, NPKG,1.0, 2.0, 5, 0, 1, 0, 0, "mine" },
{ 'g', P_DUST, 2, 0, NPKG,1.0, 2.0, 8, 0, 1, 0, 0, "gold mine" },
{ 'h', 0, 2, NAV_02, WPKG,1.0, 1.5, 12, 0, 1, 0, 0, "harbor" },
{ 'w', 0, 2, 0, WPKG,1.0, 1.5, 7, 0, 1, 0, 0, "warehouse" },
{ '*', 0, 2, 0, NPKG,1.0,1.25, 12, 0, 1, 0, 0, "airfield" },
{ 'a', P_FOOD, 2, 0, NPKG,1.0, 1.5, 2, 0, 1, 0, 0, "agribusiness" },
{ 'o', P_OIL, 2, 0, NPKG,1.0, 1.5, 5, 0, 1, 0, 0, "oil field" },
{ 'j', P_LCM, 2, 0, NPKG,1.0, 1.5, 3, 0, 1, 0, 0, "light manufacturing" },
{ 'k', P_HCM, 2, 0, NPKG,1.0, 1.5, 4, 0, 1, 0, 0, "heavy manufacturing" },
{ 'f', 0, 2, 0, NPKG,2.0, 4.0, 10, 0, 5, 0, 1, "fortress" },
{ 't', P_TLEV, 2, 0, NPKG,1.0, 1.5, 10, 0, 1, 0, 0, "technical center" },
{ 'r', P_RLEV, 2, 0, NPKG,1.0, 1.5, 9, 0, 1, 0, 0, "research lab" },
{ 'n', 0, 2, 0, NPKG,1.0, 2.0, 10, 0, 1, 0, 0, "nuclear plant" },
{ 'l', P_ELEV, 2, 0, NPKG,1.0, 1.5, 4, 0, 1, 0, 0, "library/school" },
{ '+', 0, 1, 0, NPKG,1.0, 1.0, 3, 0, 1, 0, 0, "highway" },
{ ')', 0, 2, 0, NPKG,1.0, 1.5, 4, 0, 1, 0, 0, "radar installation" },
{ '!', 0, 2, 0, NPKG,1.0, 1.5, 12, 0, 1, 0, 0, "headquarters" },
{ '#', 0, 1, 0, NPKG,1.0, 1.5, 4, 0, 1, 0, 0, "bridge head" },
{ '=', 0, 1, NAV_60, NPKG,1.0, 1.0, 5, 0, 1, 0, 0, "bridge span" },
{ 'b', P_BAR, 2, 0, BPKG,1.0,2.25, 10, 0, 1, 0, 0, "bank" },
{ '%', P_PETROL, 2, 0, NPKG,1.0, 1.5, 2, 0, 1, 0, 0, "refinery" },
{ 'e', 0, 2, 0, NPKG,1.0, 2.0, 7, 0, 1, 0, 0, "enlistment center" },
{ '~', 0, 2, 0, NPKG,1.0, 1.5, 1, 0, 1, 0, 0, "plains" },
{ '@', 0, 1, 0, NPKG,1.0, 1.5, 4, 0, 1, 0, 0, "bridge tower" },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
int sct_maxno = (sizeof(dchr) / sizeof(struct dchrstr)) - 1;
struct sctintrins intrchr[] = {
/* name lcm hcm dollars mobility */
{ "road network", 2, 2, 2, 1 },
{ "rail network", 1, 1, 1, 1 },
{ "defense factor", 1, 1, 1, 1 },
{ 0, 0, 0, 0, 0 }
};

326
src/lib/global/ship.c Normal file
View file

@ -0,0 +1,326 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* ship.c: Ship characteristics
*
* Known contributors to this file:
* Dave Pare, 1986
* Jeff Bailey
* Thomas Ruschak, 1992
* Ken Stevens, 1995
* Steve McClure, 1998
*/
/*
* marine characteristics -- ship capabilities descriptions
*
* Note, that you should not set the flags M_XLIGHT, M_UNIT, or M_CHOPPER
* here. They will be automatically set by init_global() when the server
* starts if the ship can carry a non-zero amount of those things.
* Also note that if nplanes > 0 and M_FLY is not set, then M_MSL will
* automatically be set.
*/
#include "misc.h"
#include "var.h"
#include "ship.h"
struct mchrstr mchr[] = {
/* a s v v f E K f f */
/* r p i r r g | | u u */
/* l h m e s n n l x V e e */
/* c c o e i g g i p p l l */
/* m m r d b e e m l l c u name tech Cost*/
{ 4,
{ V_CIVIL, V_MILIT, V_FOOD, V_UW },
{ 300, 10, 900, 15 },
25, 15, 10, 10, 15, 2, 0, 0, 0, 0, 0, 0, "fb fishing boat", 0, 180,
M_FOOD, 0, 0,
},
{ 4,
{ V_CIVIL, V_MILIT, V_FOOD, V_UW },
{ 300, 10, 900, 15 },
25, 15, 10, 25, 15, 2, 0, 0, 0, 0, 20, 1, "ft fishing trawler", 35, 300,
M_FOOD, 0, 0,
},
{ 8,
{ V_CIVIL, V_MILIT, V_SHELL, V_GUN, V_FOOD, V_LCM, V_HCM, V_UW },
{ 600, 50, 300, 50, 900, 1400, 900, 250 },
60, 40, 20, 25, 35, 3, 0, 0, 1, 0, 0, 0, "cs cargo ship", 20, 500,
M_SUPPLY, 0, 2,
},
{ 7,
{ V_CIVIL, V_MILIT, V_IRON, V_DUST, V_FOOD, V_UW, V_RAD },
{ 30, 5, 990, 990, 200, 45, 990 },
60, 40, 20, 25, 35, 3, 0, 0, 1, 0, 30, 1, "os ore ship", 20, 500,
0, 0, 0,
},
{ 4,
{ V_CIVIL, V_MILIT, V_FOOD, V_UW },
{ 20, 80, 200, 1200 },
60, 40, 20, 10, 35, 3, 0, 0, 1, 0, 0, 0, "ss slave ship", 0, 300,
0, 0, 0,
},
{ 3,
{ V_CIVIL, V_MILIT, V_FOOD },
{ 50, 50, 100 },
200, 100, 20, 25, 35, 3, 0, 0, 1, 0, 30, 1, "ts trade ship", 30, 1750,
M_TRADE, 0, 0,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 60, 10, 2, 60 },
30, 30, 50, 25, 25, 3, 1, 1, 1, 0, 0, 0, "frg frigate", 0, 600,
M_SEMILAND, 0, 2,
},
{ 4,
{ V_CIVIL, V_MILIT, V_FOOD, V_OIL },
{ 10, 5, 100, 1 },
25, 15, 10, 25, 15, 2, 0, 0, 0, 0, 20, 1, "oe oil exploration boat", 40, 800,
M_OIL, 0, 0,
},
{ 5,
{ V_CIVIL, V_MILIT, V_FOOD, V_OIL, V_UW },
{ 990, 80, 990, 990, 990 },
60, 60, 30, 15, 65, 3, 0, 0, 2, 0, 0, 0, "od oil derrick", 50, 1500,
M_OIL, 0, 0,
},
{ 4,
{ V_MILIT, V_GUN, V_SHELL, V_FOOD },
{ 2, 2, 12, 5 },
20, 10, 10, 38, 10, 2, 1, 1, 0, 0, 4, 1, "pt patrol boat", 40, 300,
M_TORP, 0, 0,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 100, 40, 5, 100 },
30, 40, 50, 30, 30, 5, 6, 3, 1, 0, 40, 1, "lc light cruiser", 45, 800,
M_MINE, 0, 2,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 120, 100, 8, 200 },
40, 50, 70, 30, 30, 5, 8, 4, 1, 0, 30, 1, "hc heavy cruiser", 50, 1200,
0, 0, 4,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 120, 20, 4, 120 },
50, 50, 60, 20, 35, 3, 1, 2, 1, 0, 0, 0, "tt troop transport", 10, 800,
M_SEMILAND, 0, 2,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 200, 200, 10, 900 },
50, 70, 95, 25, 35, 6, 10, 7, 1, 0, 50, 2, "bb battleship", 45, 1800,
0, 0, 2,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 180, 100, 10, 400 },
50, 60, 55, 30, 35, 6, 10, 6, 1, 0, 60, 2, "bbc battlecruiser", 75, 1500,
0, 0, 2,
},
{ 6,
{ V_CIVIL, V_MILIT, V_PETROL, V_FOOD, V_OIL, V_UW },
{ 30, 5, 990, 200, 990, 25 },
60, 40, 75, 25, 45, 3, 0, 0, 1, 0, 30, 1, "tk tanker", 35, 600,
M_OILER|M_SUPPLY, 0, 0,
},
{ 4,
{ V_MILIT, V_FOOD, V_SHELL, V_GUN },
{ 10, 90, 100, 1 },
25, 15, 10, 25, 15, 2, 0, 0, 0, 0, 20, 1, "ms minesweeper", 40, 400,
M_MINE|M_SWEEP, 0, 0,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 60, 40, 4, 80 },
30, 30, 45, 35, 20, 4, 6, 3, 1, 0, 30, 1, "dd destroyer", 70, 600,
M_MINE|M_DCH|M_SONAR, 0, 1,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 25, 36, 5, 80 },
30, 30, 25, 20, 5, 4, 3, 3, 0, 0, 30, 1, "sb submarine", 60, 650,
M_TORP|M_SUB|M_MINE|M_SONAR, 0, 0,
},
{ 8,
{ V_CIVIL, V_MILIT, V_SHELL, V_GUN, V_FOOD, V_LCM, V_HCM, V_PETROL },
{ 5, 10, 104, 20, 900, 500, 300, 100 },
40, 40, 50, 30, 2, 3, 0, 0, 0, 0, 50, 2, "sbc cargo submarine", 150, 1200,
M_SUPPLY|M_OILER|M_SUB|M_SONAR, 0, 0,
},
{ 5,
{ V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
{ 175, 250, 4, 300, 180 },
50, 60, 60, 30, 40, 5, 2, 2, 4, 20, 50, 2, "cal light carrier", 80, 2700,
M_FLY, 20, 0,
},
{ 5,
{ V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
{ 350, 500, 4, 500, 900 },
60, 70, 80, 35, 40, 7, 2, 2, 10, 40, 120, 3, "car aircraft carrier", 160, 4500,
M_FLY, 40, 0,
},
{ 5,
{ V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
{ 350, 999, 4, 999, 900 },
70, 80, 100, 45, 40, 9, 2, 2, 20, 4, 0, 0, "can nuc carrier", 305, 8000,
M_OILER|M_FLY|M_SUPPLY, 60, 0,
},
{ 4,
{ V_MILIT, V_FOOD , V_GUN , V_SHELL },
{ 400, 300 , 1 , 10 },
60, 40, 40, 30, 30, 2, 0, 0, 2, 0, 30, 1, "ls landing ship", 145, 1000,
M_LAND, 0, 6,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 60, 60, 4, 120 },
40, 30, 50, 35, 30, 5, 2, 2, 4, 0, 40, 1, "af asw frigate", 220, 800,
M_TORP|M_SUBT|M_DCH|M_SONAR, 0, 0,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 25, 60, 6, 500 },
30, 40, 45, 40, 3, 6, 5, 3, 0, 0, 0, 0, "na nuc attack sub", 260, 1200,
M_TORP|M_SUB|M_MINE|M_SONAR|M_SUBT, 0, 0,
},
{ 5,
{ V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
{ 100, 80, 6, 40, 500 },
40, 40, 60, 40, 35, 6, 8, 3, 10, 2, 80, 2, "ad asw destroyer", 240, 1500,
M_TORP|M_SUBT|M_DCH|M_SONAR, 0, 0,
},
{ 4,
{ V_MILIT, V_SHELL, V_FOOD, V_GUN },
{ 25, 200, 500, 1 },
30, 40, 55, 35, 2, 6, 0, 0, 0, 0, 0, 0, "nm nuc miss sub", 270, 1500,
M_SUB|M_SONAR, 20, 0,
},
{ 4,
{ V_MILIT, V_SHELL, V_FOOD, V_GUN },
{ 25, 100, 500, 1 },
30, 30, 35, 30, 3, 3, 0, 0, 0, 0, 30, 1, "msb missile sub", 230, 1200,
M_SUB|M_SONAR, 10, 0,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 5, 100, 3, 500 },
20, 20, 15, 40, 15, 3, 2, 2, 0, 0, 7, 1, "mb missile boat", 180, 500,
0, 10, 0,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 60, 220, 4, 120 },
40, 30, 50, 35, 30, 5, 2, 2, 2, 0, 30, 1, "mf missile frigate", 280, 1000,
0, 20, 0,
},
{ 5,
{ V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
{ 120, 500, 6, 160, 200 },
50, 50, 70, 35, 35, 8, 8, 6, 8, 8, 35, 1, "mc missile cruiser", 290, 1500,
M_ANTIMISSILE, 40, 0,
},
{ 4,
{ V_MILIT, V_SHELL, V_GUN, V_FOOD },
{ 100, 100, 15, 200 },
50, 60, 80, 35, 30, 6, 1, 8, 1, 0, 60, 2, "aac aa cruiser", 130, 1500,
M_ANTIMISSILE, 0, 4,
},
{ 5,
{ V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
{ 200, 400, 25, 40, 900 },
50, 60, 80, 35, 30, 6, 1, 16, 30, 2, 0, 0, "agc aegis cruiser", 265, 4000,
M_ANTIMISSILE, 32, 0,
},
{ 5,
{ V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
{ 200, 400, 8, 40, 900 },
50, 50, 100, 45, 35, 6, 14, 7, 10, 2, 0, 0, "ncr nuc cruiser", 325, 1800,
M_ANTIMISSILE, 20, 0,
},
{ 5,
{ V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
{ 200, 120, 6, 160, 500 },
50, 50, 80, 45, 35, 9, 10, 4, 25, 8, 0, 0, "nas nuc asw cruiser", 330, 1800,
M_TORP|M_SUBT|M_DCH|M_SONAR, 0, 0,
},
{ 8,
{ V_CIVIL, V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD, V_LCM, V_HCM },
{ 50, 50, 600, 50, 999, 999, 1500, 900 },
60, 40, 40, 45, 35, 6, 0, 0, 10, 2, 0, 0, "nsp nuc supply ship", 360, 1500,
M_SUPPLY,0,2,
},
{ 0,
{ 0 },
{ 0 },
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, 0,
0, 0, 0,
}
};
int shp_maxno = (sizeof(mchr) / sizeof(struct mchrstr)) - 1;

53
src/lib/global/treaty.c Normal file
View file

@ -0,0 +1,53 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* 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.
*
* ---
*
* treaty.c: Treaty clause characteristics
*
* Known contributors to this file:
* Steve McClure, 1998
*
*/
#include "misc.h"
#include "treaty.h"
struct tchrstr tchr[] = {
{ LNDATT, "no attacks on any land units" },
{ SEAATT, "no attacks on any ships" },
{ SEAFIR, "no shelling any ships" },
{ SUBFIR, "no depth-charging any subs" },
{ LANATT, "no sector attacks" },
{ LANFIR, "no shelling any land" },
{ NEWSHP, "no building ships" },
{ NEWNUK, "no new nuclear weapons" },
{ NEWPLN, "no building planes" },
{ NEWLND, "no building land units" },
{ TRTENL, "no enlistment" },
{ 0, 0 }
};
int trt_maxno = (sizeof(tchr) / sizeof(struct tchrstr)) - 1;