]> git.pond.sub.org Git - empserver/blob - include/update.h
budget: Fix military count (but not yet their pay)
[empserver] / include / update.h
1 /*
2  *  Empire - A multi-player, client/server Internet based war game.
3  *  Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
4  *                Ken Stevens, Steve McClure, Markus Armbruster
5  *
6  *  Empire is free software: you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation, either version 3 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  *
19  *  ---
20  *
21  *  See files README, COPYING and CREDITS in the root of the source
22  *  tree for related information and legal notices.  It is expected
23  *  that future projects/authors will amend these files as needed.
24  *
25  *  ---
26  *
27  *  update.h: Definitions related to the update
28  *
29  *  Known contributors to this file:
30  *     Ville Virrankoski, 1995
31  *     Markus Armbruster, 2004-2016
32  */
33
34 #ifndef UPDATE_H
35 #define UPDATE_H
36
37 #include "sect.h"
38
39 #define IMPORT  0
40 #define EXPORT  1
41
42 #define SCT_EFFIC (SCT_TYPE_MAX + 1)
43 #define SCT_MAINT (SCT_TYPE_MAX + 2)
44 #define SCT_BUDG_MAX SCT_MAINT
45
46 struct budg_item {
47     int money;                  /* money delta */
48     int count;                  /* #things making/consuming the money */
49 };
50
51 /* A nation's budget for an update */
52 struct budget {
53     /* military payroll */
54     struct budg_item mil;
55 };
56
57 /* main.c */
58 extern struct budget nat_budget[MAXNOC];
59 extern int money[MAXNOC];
60 extern int pops[MAXNOC];
61 extern int sea_money[MAXNOC];
62 extern int lnd_money[MAXNOC];
63 extern int air_money[MAXNOC];
64 extern int tpops[MAXNOC];
65 /* nat.c */
66 extern float levels[MAXNOC][4];
67
68 /* age.c */
69 extern int age_people(int, int);
70 extern void age_levels(int);
71 /* anno.c */
72 extern void delete_old_announcements(void);
73 /* bp.c */
74 extern struct bp *bp_alloc(void);
75 extern void bp_set_from_sect(struct bp *, struct sctstr *);
76 extern void bp_to_sect(struct bp *, struct sctstr *);
77 /* deliver.c */
78 extern void dodeliver(struct sctstr *);
79 /* distribute.c */
80 extern int dodistribute(struct sctstr *, int, double);
81 /* finish.c */
82 extern void finish_sects(int);
83 /* human.c */
84 extern void do_feed(struct sctstr *, struct natstr *, int, int);
85 extern int feed_people(short *, int);
86 extern double food_needed(short *, int);
87 extern int famine_victims(short *, int);
88 /* land.c */
89 extern int prod_land(int, int, struct bp *, int);
90 /* main.c */
91 /* in server.h */
92 /* material.c */
93 extern int get_materials(struct sctstr *, short[], int);
94 /* mobility.c */
95 extern void mob_sect(void);
96 extern void mob_ship(void);
97 extern void mob_land(void);
98 extern void mob_plane(void);
99 extern void sct_do_upd_mob(struct sctstr *sp);
100 extern void shp_do_upd_mob(struct shpstr *sp);
101 extern void lnd_do_upd_mob(struct lndstr *lp);
102 extern void pln_do_upd_mob(struct plnstr *pp);
103 /* move_sat.c */
104 extern void move_sat(struct plnstr *);
105 /* nat.c */
106 extern void prod_nat(int);
107 /* nxtitemp.c */
108 /* in nsc.h */
109 /* plague.c */
110 extern void do_plague(struct sctstr *, int);
111 extern int plague_people(struct natstr *, short *, int *, int *, int);
112 /* plane.c */
113 extern int prod_plane(int, int, struct bp *, int);
114 /* populace.c */
115 extern void populace(struct sctstr *, int);
116 extern int total_work(int, int, int, int, int, int);
117 /* prepare.c */
118 extern void prepare_sects(int);
119 extern void tax(struct sctstr *, int, int *, int *, int *);
120 extern void upd_slmilcosts(int, natid);
121 extern int bank_income(struct sctstr *, int);
122 extern void pay_reserve(struct natstr *, int);
123 /* produce.c */
124 extern int produce(struct natstr *, struct sctstr *, int *);
125 extern int prod_materials_cost(struct pchrstr *, short[], int *);
126 extern int prod_resource_limit(struct pchrstr *, unsigned char *);
127 extern double prod_eff(int, float);
128 /* removewants.c */
129 extern int update_removewants(void);
130 /* revolt.c */
131 extern void revolt(struct sctstr *);
132 extern void guerrilla(struct sctstr *);
133 /* sect.c */
134 extern double buildeff(struct sctstr *);
135 extern void do_fallout(struct sctstr *, int);
136 extern void spread_fallout(struct sctstr *, int);
137 extern void decay_fallout(struct sctstr *, int);
138 extern void produce_sect(struct natstr *, int, struct bp *, int[][2]);
139 /* ship.c */
140 extern int prod_ship(int, int, struct bp *, int);
141
142 #endif