extern struct option_list Options[];
-extern void set_option(const char *key);
-extern void delete_option(const char *key);
-
-extern int WORLD_X;
-extern int WORLD_Y;
-
extern int opt_NO_FORT_FIRE;
extern int opt_TREATIES;
extern int opt_BRIDGETOWERS;
extern int opt_TECH_POP;
extern int opt_ROLLOVER_AVAIL;
-struct keymatch; /* forward decl */
-
-/* function prototype for variable setting routines */
-typedef void KmFunc(struct keymatch * kp, s_char **av);
-
-/* current known routines */
-#if defined(__cplusplus) || (defined(__STDC__) &&__STDC__)
-KmFunc optstrset, intset, floatset, doubleset, longset,
- optionset, optiondel, worldxset;
-#else
-void optstrset(), intset(), floatset(), doubleset(), longset(),
-optionset(), optiondel(), worldxset();
-#endif
+extern s_char *datadir;
+extern s_char *infodir;
+extern s_char *loginport;
+extern s_char *privname;
+extern s_char *privlog;
+extern int WORLD_X;
+extern int WORLD_Y;
+extern int update_policy;
+extern int etu_per_update;
+extern int s_p_etu;
+extern int adj_update;
+extern int update_window;
+extern s_char *update_times;
+extern int hourslop;
+extern int blitz_time;
+extern int update_demandpolicy;
+extern int update_wantmin;
+extern int update_missed;
+extern s_char *update_demandtimes;
+extern s_char *game_days;
+extern s_char *game_hours;
+extern float btu_build_rate;
+extern int m_m_p_d;
+extern int max_btus;
+extern int max_idle;
+extern int players_at_00;
+extern int at_least_one_100;
+extern double powe_cost;
+extern int War_Cost;
+extern float easy_tech;
+extern float hard_tech;
+extern float start_technology;
+extern float start_happiness;
+extern float start_research;
+extern float start_education;
+extern float level_age_rate;
+extern float tech_log_base;
+extern float ally_factor;
+extern float edu_avg;
+extern float hap_avg;
+extern double edu_cons;
+extern double hap_cons;
+extern int startmob;
+extern float sect_mob_scale;
+extern int sect_mob_max;
+extern int buil_bh;
+extern double buil_bc;
+extern double buil_bt;
+extern int buil_tower_bh;
+extern double buil_tower_bc;
+extern double buil_tower_bt;
+extern float land_mob_scale;
+extern int land_grow_scale;
+extern int land_mob_max;
+extern double money_land;
+extern int morale_base;
+extern float plane_mob_scale;
+extern int plane_grow_scale;
+extern int plane_mob_max;
+extern double money_plane;
+extern float ship_mob_scale;
+extern int ship_grow_scale;
+extern int ship_mob_max;
+extern double money_ship;
+extern int torpedo_damage;
+extern int fort_max_interdiction_range;
+extern int land_max_interdiction_range;
+extern int ship_max_interdiction_range;
+extern double flakscale;
+extern double combat_mob;
+extern double people_damage;
+extern double unit_damage;
+extern double collateral_dam;
+extern double assault_penalty;
+extern float fire_range_factor;
+extern int sect_mob_neg_factor;
+extern double mission_mob_cost;
+extern double uwbrate;
+extern double money_civ;
+extern double money_mil;
+extern double money_res;
+extern double money_uw;
+extern double babyeat;
+extern double bankint;
+extern double eatrate;
+extern double fcrate;
+extern double fgrate;
+extern double obrate;
+extern double decay_per_etu;
+extern double fallout_spread;
+extern float drnuke_const;
+extern int MARK_DELAY;
+extern int TRADE_DELAY;
+extern double maxmult;
+extern double minmult;
+extern double buytax;
+extern double tradetax;
+extern int trade_1_dist;
+extern int trade_2_dist;
+extern int trade_3_dist;
+extern float trade_1;
+extern float trade_2;
+extern float trade_3;
+extern float trade_ally_bonus;
+extern float trade_ally_cut;
+extern int fuel_mult;
+extern int lost_items_timeout;
+extern long last_demand_update;
struct keymatch {
s_char *km_key; /* the key */
- KmFunc *km_func; /* the function to call if matches */
+ void (*km_func)(struct keymatch * kp, s_char **av);
+ /* the function to call if matches */
caddr_t km_data; /* associated data */
int km_flags; /* useful flags */
#define KM_ALLOC 0x01 /* memory allocated */
int
buil(void)
{
- extern double buil_bt;
- extern double buil_tower_bt;
struct sctstr sect;
struct nstr_sect nstr;
struct natstr *natp;
int gotsect = 0;
int built;
int hold, found, number = 1, x;
- extern float drnuke_const;
int asked = 0;
s_char buf[1024];
static int
build_bridge(register struct sctstr *sp, register int *vec)
{
- extern int buil_bh;
- extern double buil_bc;
struct sctstr sect;
int val;
int newx, newy;
static int
build_tower(register struct sctstr *sp, register int *vec)
{
- extern int buil_tower_bh;
- extern double buil_tower_bc;
struct sctstr sect;
int val;
int newx, newy;
time_t now;
double tally;
double canspend;
- extern double buytax;
- extern double tradetax;
s_char buf[1024];
if (!opt_MARKET) {
int
check_market(void)
{
- extern double buytax;
struct comstr comm;
struct sctstr *sect;
struct ichrstr *ip;
docountry(s_char op, int arg, s_char *p, float farg, natid nat,
struct natstr *np)
{
- extern int m_m_p_d;
coord newx, newy;
switch (op) {
case 'n':
#include "deity.h"
#include "file.h"
#include "commands.h"
+#include "optlist.h"
int
fort(void)
struct lndstr land;
int fort_amt, hard_amt;
s_char *p;
- extern int land_mob_max;
s_char buf[1024];
if (!snxtitem(&ni, EF_LAND, player->argp[1]))
#include <unistd.h>
#endif
#include "commands.h"
+#include "optlist.h"
#if 0
static int fileselect(struct dirent *dp);
int
info(void)
{
- extern s_char *infodir;
s_char buf[255];
FILE *fp;
s_char *bp;
int
apro(void)
{
- extern s_char *infodir;
FILE *fp;
s_char *bp, *lbp;
s_char *fbuf;
register struct shpstr *sp;
register struct mchrstr *smcp;
register struct mchrstr *tmcp;
- extern int ship_max_interdiction_range;
struct sctstr sect;
int range;
int vrange;
{
time_t now;
double tleft;
- extern int MARK_DELAY;
(void)time(&now);
tleft = MARK_DELAY / 3600.0 - (now - comm->com_markettime) / 3600.0;
struct sctstr firing;
struct nstr_sect ns;
struct flist *fp;
- extern int torpedo_damage;
int gun;
if (own == 0)
#include "mission.h"
#include "genitem.h"
#include "commands.h"
+#include "optlist.h"
/*
* mission <type> <planes/ships/units> <mission type> <op sector> [<radius>]
struct genitem *gp;
int num = 0, mobmax, mobused, dist;
struct nstr_item ni;
- extern int ship_mob_max;
- extern int land_mob_max;
- extern int plane_mob_max;
- extern double mission_mob_cost;
s_char prompt[128];
s_char buf[1024];
int
mobq(void)
{
- extern int ship_mob_max;
- extern float ship_mob_scale;
- extern int etu_per_update;
struct shpstr ship;
s_char *cp, *oldmq;
int good, mobquota, count = 0;
static void
multsingle(natid us, natid them, struct natstr *natp)
{
- extern double minmult;
- extern double maxmult;
double price;
s_char *p;
s_char prompt[128];
int
nati(void)
{
- extern int etu_per_update;
- extern double obrate, uwbrate;
struct natstr *natp;
struct sctstr sect;
float hap;
int
new(void)
{
- extern int max_btus;
- extern int players_at_00;
- extern int at_least_one_100;
#ifdef START_UNITS
extern int start_unit_type[START_UNITS];
#endif /* START_UNITS */
int i;
s_char *p;
int n;
- extern int startmob;
s_char buf[1024];
natp = getnatp(player->cnum);
static int
deity_build_land(int type, coord x, coord y, natid own, int tlev)
{
- extern int land_mob_max;
struct lndstr land;
struct lchrstr *lp;
struct nstr_item nstr;
int
newe(void)
{
- extern double obrate, uwbrate;
- extern int etu_per_update;
struct natstr *natp;
struct sctstr sect;
struct nstr_sect nstr;
static void
eta_calc(struct shpstr *sp, s_char *path, int *len, int *nupdates)
{
- extern int etu_per_update;
- extern float ship_mob_scale;
struct mchrstr *mcp;
double mobcost, mobil;
int i;
struct mchrstr *mp;
int dist;
float cash = 0.0;
- extern int trade_1_dist; /* less than this gets no money */
- extern int trade_2_dist; /* less than this gets trade_1 money */
- extern int trade_3_dist; /* less than this gets trade_2 money */
- extern float trade_1; /* return on trade_1 distance */
- extern float trade_2; /* return on trade_2 distance */
- extern float trade_3; /* return on trade_3 distance */
- extern float trade_ally_bonus; /* 20% bonus for trading with allies */
-
if (!opt_TRADESHIPS) {
pr("Tradeships are not enabled.\n");
static void
gen_power(void)
{
- extern double powe_cost;
float *f_ptr;
float *f_pt2;
register struct powstr *pow;
int
prod(void)
{
- extern double obrate, uwbrate;
- extern int etu_per_update;
struct natstr *natp;
struct sctstr sect;
struct nstr_sect nstr;
#include "file.h"
#include "nat.h"
#include "commands.h"
+#include "optlist.h"
int
sate(void)
{
- extern int plane_mob_max;
double tech;
int pln_uid;
struct plnstr plane;
int
scuttle_tradeship(struct shpstr *sp, int interactive)
{
- extern int trade_1_dist; /* less than this gets no money */
- extern int trade_2_dist; /* less than this gets trade_1 money */
- extern int trade_3_dist; /* less than this gets trade_2 money */
- extern float trade_1; /* return on trade_1 distance */
- extern float trade_2; /* return on trade_2 distance */
- extern float trade_3; /* return on trade_3 distance */
- extern float trade_ally_bonus; /* 20% bonus for trading with allies */
- extern float trade_ally_cut; /* 10% bonus for ally you trade with */
float cash = 0;
float ally_cash = 0;
int dist;
struct natstr *natp;
int tlev;
s_char buf[1024];
- extern float drnuke_const;
int rlev;
if (!(p = getstarg(player->argp[1],
#include "retreat.h"
#include "damage.h"
#include "commands.h"
+#include "optlist.h"
static void anti_torp(int f, int ntorping, int vshipown);
static int candchrg(struct shpstr *, struct shpstr *);
int
torp(void)
{
- extern int torpedo_damage;
natid vshipown;
int range;
int dam;
static int
fire_torp(struct shpstr *sp, struct shpstr *targ, int range, int ntargets)
{
- extern int torpedo_damage;
int dam;
int shells;
double hitchance;
struct trdstr tmpt;
union trdgenstr tg;
int plflags;
- extern double tradetax;
- extern double buytax;
double canspend;
time_t now;
int bid;
{
int n;
int j;
- extern double tradetax;
struct nstr_item ni;
struct plnstr plane;
struct lndstr land;
FILE *fp;
struct mob_acc_globals timestamps;
extern int updating_mob;
- extern int update_window;
extern s_char *timestampfil;
if (opt_MOB_ACCESS) {
if (opt_UPDATESCHED) {
time_t now, next, delta;
extern int update_time;
- extern int update_policy;
- extern int update_demandpolicy;
- extern int update_wantmin;
- extern int blitz_time;
- extern s_char *update_times;
- extern s_char *update_demandtimes;
- extern s_char *game_days;
- extern s_char *game_hours;
if (updates_disabled())
pr("UPDATES ARE DISABLED!\n");
return (0);
} else {
- extern int s_p_etu;
- extern int etu_per_update;
- extern int adj_update;
time_t now;
time_t upd_time;
time_t next_update;
int
vers(void)
{
- extern int s_p_etu;
- extern int etu_per_update;
- extern int m_m_p_d;
- extern int players_at_00;
- extern float btu_build_rate;
- extern double fgrate, fcrate;
- extern double eatrate, babyeat;
- extern double obrate, uwbrate;
- extern double bankint;
- extern double hap_cons, edu_cons;
- extern double money_civ, money_uw, money_mil, money_res;
- extern float hap_avg, edu_avg, ally_factor;
- extern float level_age_rate;
-/* extern float easy_tech, hard_tech, tech_log_base; */
- extern float easy_tech, tech_log_base;
- extern int land_mob_max;
- extern int land_grow_scale;
- extern float land_mob_scale;
- extern int sect_mob_max;
- extern float sect_mob_scale;
- extern int ship_mob_max;
- extern float ship_mob_scale;
- extern int ship_grow_scale;
- extern int plane_mob_max;
- extern float plane_mob_scale;
- extern int plane_grow_scale;
- extern int War_Cost;
- extern float fire_range_factor;
- extern int trade_1_dist; /* less than this gets no money */
- extern int trade_2_dist; /* less than this gets trade_1 money */
- extern int trade_3_dist; /* less than this gets trade_2 money */
- extern float trade_1; /* return on trade_1 distance */
- extern float trade_2; /* return on trade_2 distance */
- extern float trade_3; /* return on trade_3 distance */
- extern float trade_ally_bonus; /* 20% bonus for trading with allies */
- extern float trade_ally_cut; /* 10% bonus for ally you trade with */
- extern double tradetax;
- extern double buytax;
struct option_list *op;
time_t now;
struct lndstr land;
int work_amt, eff_amt, w;
s_char *p;
- extern int land_mob_max;
coord donex = 0, doney = 1;
s_char buf[1024];
landdamage(struct lndstr *lp, int dam)
{
double damage_factor, m;
- extern int land_mob_max;
m = (double)land_mob_max;
int
commdamage(register int amt, int dam, int vtype)
{
- extern double people_damage;
int lost;
if (vtype == V_BAR && opt_SUPER_BARS)
#include "keyword.h"
#include "file.h"
#include "common.h"
+#include "optlist.h"
#if defined(Rel4) || defined(_WIN32)
#include <time.h>
int
gamehours(time_t now, int *hour)
{
- extern s_char *game_days, *game_hours;
extern struct tm *localtime(const time_t *);
register s_char *bp;
register struct tm *tm;
#include "deity.h"
#include "player.h"
#include "common.h"
+#include "optlist.h"
static s_char *logfile = 0;
loginit(void)
{
extern s_char program[];
- extern s_char *datadir;
s_char buf[1024];
#if !defined(_WIN32)
int
sectdamage(struct sctstr *sp, int dam, struct emp_qelem *list)
{
- extern double unit_damage;
struct nstr_item ni;
struct lndstr land;
struct plnstr plane;
{
register int i;
register int lose;
- extern double people_damage;
if (pct >= 100)
return 0;
void
update_policy_check(void)
{
- extern int update_policy, update_demandpolicy;
- extern int update_wantmin, blitz_time;
-
if (update_policy < 0)
update_policy = UDP_DEFAULT;
if (update_policy > UDP_MAX)
s_char *p;
int curtime;
int hour[2];
- extern s_char *update_demandtimes;
tm = localtime(now);
curtime = tm->tm_min + tm->tm_hour * 60;
static void
regular_update_time(time_t * now, time_t * tim, time_t * delta)
{
- extern int s_p_etu;
- extern int etu_per_update;
- extern int adj_update;
s_char *p;
time_t tw;
int secs_per_update;
s_char *p, *p1;
int curtime;
int hour;
- extern int hourslop;
- extern s_char *update_times;
*which = -1;
p = update_times;
int curtime;
int hour;
int mintime;
- extern s_char *update_times;
p = update_times;
if (*p == 0)
static int
demand_check(void)
{
- extern int update_wantmin, update_missed;
struct natstr *natp;
int want, pop, cn, veto;
time_t now;
time_t cur;
- extern long last_demand_update;
time(&cur);
int
demandupdatecheck(void)
{
- extern int update_demandpolicy;
-
if (UDDEM_COMSET != update_demandpolicy) {
logerror("no demand update, not policy.");
return (0);
int
updatetime(time_t * now)
{
- extern int update_policy;
int which;
if (opt_BLITZ && update_policy == UDP_BLITZ) {
/* Time of next update */
/* Seconds till next update */
{
- extern int update_policy;
time_t stim, sdelta;
- extern int blitz_time;
switch (update_policy) {
case UDP_NORMAL:
/* Time of next update */
/* Seconds till next update check */
{
- extern int update_policy;
time_t stim, sdelta;
- extern int blitz_time;
switch (update_policy) {
case UDP_NORMAL:
extern char *strdup();
#endif /* NOSTRDUP */
+#if 0
/* All the configurable variables ... */
extern s_char *infodir, *datadir, *loginport, *privname,
*privlog;
extern int trade_1_dist, trade_2_dist, trade_3_dist;
extern float trade_1, trade_2, trade_3, trade_ally_bonus, trade_ally_cut;
+#endif
/* Dummy one */
static int emp_config_dummy;
+static void optstrset(struct keymatch *kp, s_char **av);
+static void intset(struct keymatch *kp, s_char **av);
+static void floatset(struct keymatch *kp, s_char **av);
+static void doubleset(struct keymatch *kp, s_char **av);
+static void longset(struct keymatch *kp, s_char **av);
+static void optionset(struct keymatch *kp, s_char **av);
+static void optiondel(struct keymatch *kp, s_char **av);
+static void worldxset(struct keymatch *kp, s_char **av);
+
/* things that can be changed */
struct keymatch configkeys[] = {
{"", intset, (caddr_t)&emp_config_dummy, 0,
}
/* worldx int setting function */
-void
+static void
worldxset(struct keymatch *kp, s_char **av)
{
int *intptr = (int *)kp->km_data;
}
/* generic int setting function */
-void
+static void
intset(struct keymatch *kp, s_char **av)
{
int *intptr = (int *)kp->km_data;
}
/* generic float set function */
-void
+static void
floatset(struct keymatch *kp, s_char **av)
{
float *floatptr = (float *)kp->km_data;
/* generic string set function */
-void
+static void
optstrset(struct keymatch *kp, s_char **av)
{
s_char **confstrp = (s_char **)kp->km_data;
}
/* generic double set function */
-void
+static void
doubleset(struct keymatch *kp, s_char **av)
{
double *doublep = (double *)kp->km_data;
}
/* generic long set function */
-void
+static void
longset(struct keymatch *kp, s_char **av)
{
long int *longp = (long int *)kp->km_data;
/* add an option to the list */
-void
+static void
set_option(const char *s)
{
struct option_list *op;
}
/* delete an option from the list */
-void
+static void
delete_option(const char *s)
{
struct option_list *op;
}
/* config interface */
-void
+static void
optionset(struct keymatch *kp, s_char **av)
/* unused - we have a well known global */
{
}
/* config interface */
-void
+static void
optiondel(struct keymatch *kp, s_char **av)
/* unused - we have a well known global */
{
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 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 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 */
void
player_accept(void *argv)
{
- extern s_char *loginport;
struct sockaddr_in sin;
struct servent *sp;
int s;
{
extern struct cmndstr player_coms[];
extern int update_pending;
- extern int max_btus;
struct natstr *np;
struct cmndstr *command;
int cmd;
static int
nat_cap(int btu)
{
- extern int s_p_etu;
- extern int max_btus;
- extern float btu_build_rate;
struct sctstr sect;
struct natstr *np;
double d;
take_move_in_mob(int combat_mode, struct llist *llp, struct combat *off,
struct combat *def)
{
- extern int etu_per_update;
- extern float land_mob_scale;
int mobcost;
int new;
int
attack_val(int combat_mode, struct lndstr *lp)
{
- extern double assault_penalty;
int men;
int value;
struct lchrstr *lcp;
int
defense_val(struct lndstr *lp)
{
- extern int land_mob_max;
int men;
double value;
struct lchrstr *lcp;
int
lnd_fortify (struct lndstr *lp, int hard_amt)
{
- extern int land_mob_max;
int mob_used;
int eng;
int
collateral_damage(coord x, coord y, int dam, struct emp_qelem *list)
{
- extern double collateral_dam;
int coll;
struct sctstr sect;
perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
int mission, s_char *s, int hardtarget)
{
- extern int land_max_interdiction_range;
- extern int ship_max_interdiction_range;
struct emp_qelem *qp, missiles, bombers, escorts, airp, b, e;
struct emp_qelem *newqp;
struct genlist *glp;
natid plane_owner = 0;
int gun, shell, md, air_dam = 0;
double range2, prb, range, mobcost, hitchance;
- extern int torpedo_damage;
getsect(x, y, §);
int n_down = 0;
s_char *addendum = 0;
int theirrel;
- extern int War_Cost;
if (rel < AT_WAR)
rel = AT_WAR;
void
show_bridge(int tlev)
{
- extern double buil_bt, buil_bc;
- extern int buil_bh;
-
if (tlev < buil_bt)
return;
pr("Bridges require %g tech,", buil_bt);
void
show_tower(int tlev)
{
- extern double buil_tower_bt, buil_tower_bc;
- extern int buil_tower_bh;
-
if (tlev < buil_tower_bt)
return;
pr("Bridge Towers require %g tech,", buil_tower_bt);
register struct nchrstr *np;
register int n;
register int avail;
- extern float drnuke_const;
if (opt_DRNUKE)
pr("%13s lcm hcm oil rad avail tech res $\n", "");
register struct nchrstr *np;
register int i, j, n;
s_char *p;
- extern float drnuke_const;
if (opt_DRNUKE)
pr("%13s blst dam lbs tech res $%7s abilities\n", "", "");
shp_fort_interdiction(struct emp_qelem *list, coord newx, coord newy,
natid victim)
{
- extern int fort_max_interdiction_range;
struct nstr_sect ns;
struct sctstr fsect;
int trange;
}
if (opt_FUEL && type == I_PETROL) {
- extern float land_mob_scale;
- extern int etu_per_update;
int fuel_needed = (lp->lnd_fuelu * (((float)etu_per_update
* land_mob_scale)) / 10.0);
int can_move;
double move_cost, weight, mobcost;
int packing;
- extern double eatrate;
- extern int etu_per_update;
struct dchrstr *dp;
struct ichrstr *ip;
s_char buf[1024];
{
struct lchrstr *lcp;
int max, want = 0;
- extern double eatrate;
- extern int etu_per_update;
- extern float land_mob_scale;
lcp = &lchr[(int)lp->lnd_type];
max = vl_find(V_ITEM(type), lcp->l_vtype, lcp->l_vamt, (int)lcp->l_nv);
struct nstr_item ni;
struct plnstr p;
struct lndstr land;
- extern int etu_per_update;
- extern int sect_mob_neg_factor;
/* Wipe all the distribution info */
memset(vec, 0, sizeof(vec));
#include "file.h"
#include "update.h"
#include "gen.h"
+#include "optlist.h"
void
age_levels(int etu)
{
- extern float level_age_rate;
register float best_tech;
register float best_res;
register struct natstr *np;
do_feed(register struct sctstr *sp, register struct natstr *np, int *vec,
int *workp, int *bp, int etu)
{
- extern double eatrate;
int people;
int work_avail;
int starved, sctwork;
static int
growfood(struct sctstr *sp, register int *vec, int work, int etu)
{
- extern double fgrate;
- extern double fcrate;
double food_fertil;
double food_workers;
double food;
int
feed_people(register int *vec, int etu, int *needed)
{
- extern double eatrate;
double food_eaten;
double people_left;
int can_eat;
register struct natstr *np, int *workp, int sctwork,
register int *vec)
{
- extern double obrate;
- extern double uwbrate;
- extern double babyeat;
int newciv;
int newuw;
int new_birth;
struct natstr *np, int *bp, int build)
/* build = 1, maintain = 0 */
{
- extern int morale_base;
struct lchrstr *lcp;
int vec[I_MAX + 1];
int cvec[I_MAX + 1];
int n;
int min = morale_base - (int)np->nat_level[NAT_HLEV];
int mult;
- extern double money_land;
int needed;
int cost;
int eff;
landrepair(register struct lndstr *land, int *vec, struct natstr *np,
int *bp, int etus)
{
- extern int land_grow_scale;
register int delta;
struct sctstr *sp;
struct lchrstr *lp;
feed_land(struct lndstr *lp, register int *vec, int etus, int *needed,
int doit)
{
- extern double eatrate;
double food_eaten, ship_eaten;
double people_left;
int can_eat, need, svec[I_MAX + 1];
void
update_main(void *argv)
{
- extern int etu_per_update;
- extern double money_res;
int etu = etu_per_update;
int n;
int x;
int *ship_build, int *ship_maint, int *plane_build,
int *plane_maint, int *land_build, int *land_maint)
{
- extern double money_mil;
struct natstr *np;
np = getnatp(n);
time_t secs;
time_t now;
time_t left;
- extern long s_p_etu;
extern int updating_mob;
int newetus;
float newmob;
void
sct_do_upd_mob(register struct sctstr *sp)
{
- extern float sect_mob_scale;
int etus;
if (do_upd_checking || timestamp_fixing || update_pending)
void
shp_do_upd_mob(register struct shpstr *sp)
{
- extern float ship_mob_scale;
int etus;
if (do_upd_checking || timestamp_fixing || update_pending)
void
lnd_do_upd_mob(register struct lndstr *lp)
{
- extern float land_mob_scale;
int etus;
if (do_upd_checking || timestamp_fixing || update_pending)
void
pln_do_upd_mob(register struct plnstr *pp)
{
- extern float plane_mob_scale;
int etus;
if (do_upd_checking || timestamp_fixing || update_pending)
static void
do_mob_sect(register struct sctstr *sp, register int etus)
{
- extern float sect_mob_scale;
- extern int sect_mob_max;
register int value;
if (sp->sct_own == 0)
static void
do_mob_ship(register struct shpstr *sp, register int etus)
{
- extern int ship_mob_max;
- extern float ship_mob_scale;
int newfuel = 0;
register int value;
int can_add, have_fuel_for, total_add;
double d;
- extern int fuel_mult;
if (sp->shp_own == 0)
return;
static void
do_mob_land(register struct lndstr *lp, register int etus)
{
- extern int land_mob_max;
- extern float land_mob_scale;
int newfuel = 0;
register int value;
int can_add, have_fuel_for, total_add;
double d;
- extern int fuel_mult;
if (lp->lnd_own == 0)
return;
static void
do_mob_plane(register struct plnstr *pp, register int etus)
{
- extern int plane_mob_max;
- extern float plane_mob_scale;
register int value;
if (pp->pln_own == 0)
/*
* Begin ugly hack.
*/
- extern float easy_tech, tech_log_base;
-
level_easy[0] = easy_tech;
level_log[0] = tech_log_base;
/*
{
extern long money[MAXNOC];
extern long pops[MAXNOC];
- extern double hap_cons, edu_cons;
extern long sea_money[MAXNOC];
extern long lnd_money[MAXNOC];
extern long air_money[MAXNOC];
/* Build = 1, maintain =0 */
{
- extern double money_mil;
- extern double money_plane;
- extern int plane_grow_scale;
extern long air_money[MAXNOC];
register struct plnstr *pp;
register struct plchrstr *plp;
int *uw_tax, int *mil_pay)
{
int vec[I_MAX + 1];
- extern double money_civ, money_mil, money_uw;
*civ_tax = 0;
*uw_tax = 0;
int
upd_slmilcosts(natid n, int etu)
{
- extern double money_mil;
struct shpstr *sp;
struct lndstr *lp;
int mil = 0;
int
bank_income(struct sctstr *sp, int etu)
{
- extern double bankint;
int vec[I_MAX + 1];
if (getvec(VT_ITEM, vec, (s_char *)sp, EF_SECTOR) <= 0)
void
spread_fallout(struct sctstr *sp, int etus)
{
- extern double fallout_spread;
struct sctstr *ap;
int tvec[I_MAX + 1];
int cvec[I_MAX + 1];
void
decay_fallout(struct sctstr *sp, int etus)
{
- extern double decay_per_etu;
- extern double fallout_spread;
int cvec[I_MAX + 1];
int decay;
s_char *resource;
int n;
int mult;
- extern double money_ship;
int needed;
int cost;
int eff;
shiprepair(register struct shpstr *ship, int *vec, struct natstr *np,
int *bp, int etus)
{
- extern int ship_grow_scale;
register int delta;
struct sctstr *sp;
struct mchrstr *mp;
feed_ship(struct shpstr *sp, register int *vec, int etus, int *needed,
int doit)
{
- extern double eatrate;
double food_eaten, land_eaten;
double people_left;
int ifood_eaten;
#include "empthread.h"
#include "proto.h"
#include "prototypes.h"
+#include "optlist.h"
/*ARGSUSED*/
void
player_kill_idle(void *argv)
{
- extern int max_idle;
struct player *p;
time_t now;
#include "lost.h"
#include <stdio.h>
#include "prototypes.h"
+#include "optlist.h"
/*ARGSUSED*/
void
delete_lostitems(void *argv)
{
- extern int lost_items_timeout;
time_t now;
struct loststr lost;
int n;
int debug = 0;
int op;
char *config_file = NULL;
- extern s_char *datadir;
extern char *optarg;
s_char tbuf[256];
#ifdef POSIXSIGNALS
void
update_sched(void *argv)
{
- extern int s_p_etu;
- extern int etu_per_update;
- extern int adj_update;
- extern int update_window;
s_char *kw;
int hour[2];
int wind;
int opt;
extern int optind;
extern char *optarg;
- extern s_char *datadir;
char *config_file = NULL;
char tbuf[512];
int i = 0;
extern s_char *timestampfil;
extern s_char *infodir;
extern s_char *commfil;
- extern s_char *datadir;
s_char buf[255];
s_char tbuf[512];
s_char *filename;