]> git.pond.sub.org Git - empserver/blob - src/lib/global/ship.c
Import of Empire 4.2.12
[empserver] / src / lib / global / ship.c
1 /*
2  *  Empire - A multi-player, client/server Internet based war game.
3  *  Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
4  *                           Ken Stevens, Steve McClure
5  *
6  *  This program 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 2 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, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  *  ---
21  *
22  *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
23  *  related information and legal notices. It is expected that any future
24  *  projects/authors will amend these files as needed.
25  *
26  *  ---
27  *
28  *  ship.c: Ship characteristics
29  * 
30  *  Known contributors to this file:
31  *     Dave Pare, 1986
32  *     Jeff Bailey
33  *     Thomas Ruschak, 1992
34  *     Ken Stevens, 1995
35  *     Steve McClure, 1998
36  */
37
38 /*
39  * marine characteristics -- ship capabilities descriptions
40  * 
41  * Note, that you should not set the flags M_XLIGHT, M_UNIT, or M_CHOPPER
42  * here.  They will be automatically set by init_global() when the server
43  * starts if the ship can carry a non-zero amount of those things.
44  * Also note that if nplanes > 0 and M_FLY is not set, then M_MSL will
45  * automatically be set.
46  */
47
48 #include "misc.h"
49 #include "var.h"
50 #include "ship.h"
51
52 struct  mchrstr mchr[]  = {
53 /*          a   s   v  v   f       E  K   f  f                                */
54 /*          r   p   i  r   r   g   |  |   u  u                                */
55 /* l   h    m   e   s  n   n   l   x  V   e  e                                */
56 /* c   c    o   e   i  g   g   i   p  p   l  l                                */
57 /* m   m    r   d   b  e   e   m   l  l   c  u  name                tech  Cost*/
58
59 {  4,
60     { V_CIVIL, V_MILIT, V_FOOD, V_UW },
61     {     300,      10,    900,   15 },
62 25, 15,  10, 10, 15, 2,  0,  0,  0, 0,  0, 0, "fb   fishing boat", 0,  180,
63     M_FOOD,  0, 0,
64 },
65
66 {  4,
67     { V_CIVIL, V_MILIT, V_FOOD, V_UW },
68     {     300,      10,    900,   15 },
69 25, 15,  10, 25, 15, 2,  0,  0,  0, 0, 20, 1, "ft   fishing trawler", 35,  300,
70     M_FOOD,  0, 0,
71 },
72
73 {  8,
74     { V_CIVIL, V_MILIT, V_SHELL, V_GUN, V_FOOD, V_LCM, V_HCM, V_UW },
75     {     600,      50,     300,    50,    900,  1400,   900,  250 },
76 60, 40,  20, 25, 35, 3,  0,  0,  1,  0,  0, 0, "cs   cargo ship", 20,  500,
77     M_SUPPLY, 0, 2,
78 },
79
80 {  7,
81     { V_CIVIL, V_MILIT, V_IRON, V_DUST, V_FOOD, V_UW, V_RAD },
82     {      30,       5,    990,    990,    200,   45,   990 },
83 60, 40,  20, 25, 35, 3,  0,  0,  1,  0,  30, 1, "os   ore ship",   20,  500,
84     0,  0, 0,
85 },
86
87 {  4,
88     { V_CIVIL, V_MILIT, V_FOOD, V_UW },
89     {      20,      80,    200, 1200 },
90 60, 40,  20, 10, 35, 3,  0,  0,  1,  0,   0, 0, "ss   slave ship",    0,  300,
91     0,  0, 0,
92 },
93
94 {  3,
95     { V_CIVIL, V_MILIT, V_FOOD },
96     {      50,      50,    100 },
97 200, 100,  20, 25, 35, 3,  0,  0, 1, 0,  30, 1, "ts   trade ship", 30, 1750,
98     M_TRADE,  0, 0,
99 },
100
101 {  4,
102     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
103     {      60,      10,     2,     60 },
104 30, 30,  50, 25, 25, 3,  1,  1,  1,  0,   0, 0, "frg  frigate",         0,  600,
105     M_SEMILAND,  0, 2,
106 },
107
108 {  4,
109     { V_CIVIL, V_MILIT, V_FOOD, V_OIL },
110     {      10,       5,    100,     1 },
111 25, 15,  10, 25, 15, 2,  0,  0,  0,  0,  20, 1, "oe   oil exploration boat", 40, 800,
112     M_OIL,  0, 0,
113 },
114
115 {  5,
116     { V_CIVIL, V_MILIT, V_FOOD, V_OIL, V_UW },
117     {     990,      80,   990,    990,  990 },
118 60, 60,  30, 15, 65, 3,  0,  0,  2,  0,   0, 0, "od   oil derrick", 50, 1500,
119     M_OIL,  0, 0,
120 },
121
122 {  4,
123     { V_MILIT, V_GUN, V_SHELL, V_FOOD },
124     {       2,     2,      12,      5 },
125 20, 10,  10, 38, 10, 2,  1,  1,  0,  0,   4, 1, "pt   patrol boat", 40, 300,
126     M_TORP,  0, 0,
127 },
128
129 {  4,
130     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
131     {     100,      40,     5,    100 },
132 30, 40,  50, 30, 30, 5, 6,  3,  1,  0,  40, 1, "lc   light cruiser", 45, 800,
133     M_MINE,  0, 2,
134 },
135
136 {  4,
137     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
138     {     120,     100,     8,    200 },
139 40, 50,  70, 30, 30, 5, 8, 4,  1,  0,  30, 1, "hc   heavy cruiser",    50, 1200,
140     0,  0, 4,
141 },
142
143 {  4,
144     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
145     {     120,      20,     4,    120 },
146 50, 50,  60, 20, 35, 3,  1,  2,  1,  0,   0, 0, "tt   troop transport",  10,  800,
147     M_SEMILAND,  0, 2,
148 },
149
150 {  4,
151     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
152     {     200,     200,    10,    900 },
153 50, 70,  95, 25, 35, 6, 10,  7,  1,  0,  50, 2, "bb   battleship", 45, 1800,
154     0,  0, 2,
155 },
156
157 {  4,
158     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
159     {     180,     100,    10,    400 },
160 50, 60,  55, 30, 35, 6, 10,  6,  1,  0,  60, 2, "bbc  battlecruiser",      75, 1500,
161     0,  0, 2,
162 },
163
164 {  6,
165     { V_CIVIL, V_MILIT, V_PETROL, V_FOOD, V_OIL, V_UW },
166     {      30,       5,      990,    200,   990,   25 },
167 60, 40,  75, 25, 45, 3,  0,  0,  1,  0,  30, 1, "tk   tanker",  35,  600,
168     M_OILER|M_SUPPLY,  0, 0,
169 },
170
171 {  4, 
172     { V_MILIT, V_FOOD, V_SHELL, V_GUN },
173     {      10,     90,     100,   1  },
174 25, 15,  10, 25, 15, 2,  0,  0,  0,  0,  20, 1, "ms   minesweeper", 40,  400,
175     M_MINE|M_SWEEP,  0, 0,
176 },
177
178 {  4,
179     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
180     {      60,      40,     4,     80 },
181 30, 30,  45, 35, 20, 4,  6,  3,  1,  0,  30, 1, "dd   destroyer",  70,  600,
182     M_MINE|M_DCH|M_SONAR,  0, 1,
183 },
184
185 {  4,
186     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
187     {      25,      36,     5,     80 },
188 30, 30,  25, 20,  5, 4,  3,  3,  0,  0,  30, 1, "sb   submarine", 60,  650,
189     M_TORP|M_SUB|M_MINE|M_SONAR,  0, 0,
190 },
191
192 {  8,
193     { V_CIVIL, V_MILIT, V_SHELL, V_GUN, V_FOOD, V_LCM, V_HCM, V_PETROL },
194     {       5,      10,     104,    20,    900,   500,   300,      100 },
195 40, 40,  50, 30,  2, 3,  0,  0,  0,  0,  50, 2, "sbc  cargo submarine", 150, 1200,
196     M_SUPPLY|M_OILER|M_SUB|M_SONAR,  0, 0,
197 },
198
199 {  5,
200     { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
201     {     175,     250,     4,      300,    180 },
202 50, 60,  60, 30, 40, 5,  2,  2,  4, 20, 50, 2, "cal  light carrier", 80, 2700,
203     M_FLY, 20, 0,
204 },
205
206 {  5,
207     { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
208     {     350,     500,     4,      500,    900 },
209 60, 70,  80, 35, 40, 7,  2,  2, 10, 40, 120, 3, "car  aircraft carrier",   160, 4500,
210     M_FLY, 40, 0,
211 },
212
213 {  5,
214     { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
215     {     350,     999,     4,      999,    900 },
216 70, 80, 100, 45, 40, 9,  2,  2, 20,  4, 0, 0, "can  nuc carrier",  305, 8000,
217     M_OILER|M_FLY|M_SUPPLY, 60, 0,
218 },
219
220 {  4,
221     { V_MILIT, V_FOOD , V_GUN , V_SHELL },
222     {     400,    300 ,     1 ,      10 },
223 60, 40,  40, 30, 30, 2,  0,  0,  2,  0, 30, 1, "ls   landing ship", 145, 1000,
224     M_LAND,  0, 6,
225 },
226
227 {  4,
228     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
229     {      60,      60,     4,    120 },
230 40, 30,  50, 35, 30, 5,  2,  2,  4,  0, 40, 1, "af   asw frigate", 220, 800,
231     M_TORP|M_SUBT|M_DCH|M_SONAR,  0, 0,
232 },
233
234 {  4,
235     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
236     {      25,      60,     6,    500 },
237 30, 40,  45, 40,  3, 6,  5,  3,  0,  0, 0, 0, "na   nuc attack sub", 260, 1200,
238     M_TORP|M_SUB|M_MINE|M_SONAR|M_SUBT,  0, 0,
239 },
240
241 {  5,
242     { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
243     {     100,      80,     6,       40,    500 },
244 40, 40,  60, 40, 35, 6,  8,  3, 10,  2,  80, 2, "ad   asw destroyer", 240, 1500,
245     M_TORP|M_SUBT|M_DCH|M_SONAR,  0, 0,
246 },
247
248 {  4,
249     { V_MILIT, V_SHELL, V_FOOD, V_GUN },
250     {      25,     200,    500,     1  },
251 30, 40,  55, 35,  2, 6,  0,  0,  0,  0,   0, 0, "nm   nuc miss sub", 270, 1500,
252     M_SUB|M_SONAR, 20, 0,
253 },
254
255 {  4,
256     { V_MILIT, V_SHELL, V_FOOD, V_GUN },
257     {      25,     100,    500,     1  },
258 30, 30,  35, 30,  3, 3,  0,  0,  0,  0, 30, 1, "msb  missile sub",   230, 1200,
259     M_SUB|M_SONAR, 10, 0,
260 },
261
262 {  4,
263     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
264     {       5,     100,     3,    500 },
265 20, 20,  15, 40, 15, 3,  2,  2,  0,  0,  7, 1, "mb   missile boat", 180,  500,
266     0, 10, 0,
267 },
268
269 {  4,
270     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
271     {      60,     220,     4,    120 },
272 40, 30,  50, 35, 30, 5,  2,  2,  2,  0, 30, 1, "mf   missile frigate",    280, 1000,
273     0, 20, 0,
274 },
275
276 {  5,
277     { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
278     {     120,     500,     6,      160,    200 },
279 50, 50,  70, 35, 35, 8,  8,  6,  8,  8, 35, 1, "mc   missile cruiser",    290, 1500,
280     M_ANTIMISSILE, 40, 0,
281 },
282
283 {  4,
284     { V_MILIT, V_SHELL, V_GUN, V_FOOD },
285     {     100,     100,    15,    200 },
286 50, 60,  80, 35, 30, 6,  1, 8,  1,  0, 60, 2, "aac  aa cruiser", 130, 1500,
287     M_ANTIMISSILE,  0, 4,
288 },
289
290 {  5,
291     { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
292     {     200,     400,    25,       40,    900 },
293 50, 60,  80, 35, 30, 6,  1, 16, 30,  2,  0, 0, "agc  aegis cruiser",    265, 4000,
294     M_ANTIMISSILE, 32, 0,
295 },
296
297 {  5,
298     { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
299     {     200,     400,     8,       40,    900 },
300 50, 50, 100, 45, 35, 6, 14,  7, 10,  2,  0, 0, "ncr  nuc cruiser", 325, 1800,
301     M_ANTIMISSILE, 20, 0,
302 },
303
304 {  5,
305     { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD },
306     {     200,     120,     6,      160,    500 },
307 50, 50,  80, 45, 35, 9, 10,  4, 25,  8,  0, 0, "nas  nuc asw cruiser", 330, 1800,
308     M_TORP|M_SUBT|M_DCH|M_SONAR,  0, 0,
309 },
310
311 {  8,
312   { V_CIVIL, V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD, V_LCM, V_HCM },
313   {      50,      50,     600,    50,     999,     999,  1500,   900  },
314 60, 40,  40, 45, 35, 6,  0,  0, 10, 2, 0, 0, "nsp  nuc supply ship",  360, 1500,
315     M_SUPPLY,0,2,
316 },
317
318 {  0, 
319     { 0 },
320     { 0 },
321  0,  0,   0,  0,  0, 0,  0,  0, 0, 0, 0, 0, "",                    0,    0,
322     0, 0, 0,
323 }
324 };
325
326 int     shp_maxno = (sizeof(mchr) / sizeof(struct mchrstr)) - 1;