1require "unittable"
2
3local DebugEnabled = false
4
5local function EchoDebug(inStr)
6	if DebugEnabled then
7		game:SendToConsole("unitLists: " .. inStr)
8	end
9end
10
11factoryMobilities = {
12	corap = {"air"},
13	armap = {"air"},
14	corlab = {"bot"},
15	armlab = {"bot"},
16	corvp = {"veh", "amp"},
17	armvp = {"veh", "amp"},
18	coralab = {"bot"},
19	coravp = {"veh", "amp"},
20	corhp = {"hov"},
21	armhp = {"hov"},
22	corfhp = {"hov"},
23	armfhp = {"hov"},
24	armalab = {"bot"},
25	armavp = {"veh", "amp"},
26	coraap = {"air"},
27	armaap = {"air"},
28	corplat = {"air"},
29	armplat = {"air"},
30	corsy = {"shp", "sub"},
31	armsy = {"shp", "sub"},
32	corasy = {"shp", "sub"},
33	armasy = {"shp", "sub"},
34	csubpen = {"sub", "amp"},
35	asubpen = {"sub", "amp"},
36	corgant = {"bot"},
37	armshltx = {"bot"},
38}
39
40-- for calculating what factories to build
41-- higher values mean more effecient
42mobilityEffeciencyMultiplier = {
43	veh = 1,
44	shp = 1,
45	bot = 0.9,
46	sub = 0.9,
47	hov = 0.7,
48	amp = 0.4,
49	air = 0.55,
50}
51
52-- for calculating what factories to build
53-- higher values mean slower
54mobilitySlowMultiplier = {
55	veh = 1,
56	shp = 1,
57	sub = 1.3,
58	bot = 1.3,
59	hov = 0.75,
60	amp = 1.5,
61	air = 0.25,
62}
63
64factoryExitSides = {
65	corap = 0,
66	armap = 0,
67	corlab = 2,
68	armlab = 2,
69	corvp = 1,
70	armvp = 1,
71	coralab = 3,
72	coravp = 1,
73	corhp = 2,
74	armhp = 2,
75	corfhp = 2,
76	armfhp = 2,
77	armalab = 2,
78	armavp = 2,
79	coraap = 0,
80	armaap = 0,
81	corplat = 0,
82	armplat = 0,
83	corsy = 4,
84	armsy = 4,
85	corasy = 4,
86	armasy = 4,
87	csubpen = 4,
88	asubpen = 4,
89	corgant = 1,
90	armshltx = 1,
91}
92
93littlePlasmaList = {
94	corpun = 1,
95	armguard = 1,
96	cortoast = 1,
97	armamb = 1,
98	corbhmth = 1,
99}
100
101-- these big energy plants will be shielded in addition to factories
102bigEnergyList = {
103	cmgeo = 1,
104	amgeo = 1,
105	corfus = 1,
106	armfus = 1,
107	cafus = 1,
108	aafus = 1,
109}
110
111-- geothermal plants
112geothermalPlant = {
113	corgeo = 1,
114	armgeo = 1,
115	cmgeo = 1,
116	amgeo = 1,
117	corbhmth = 1,
118	armgmm = 1,
119}
120
121-- what mexes upgrade to what
122mexUpgrade = {
123	cormex = "cormoho",
124	armmex = "armmoho",
125	coruwmex = "coruwmme",
126	armuwmex = "armuwmme",
127}
128
129-- these will be abandoned faster
130hyperWatchdog = {
131	armmex = 1,
132	cormex = 1,
133	armgeo = 1,
134	corgeo = 1,
135}
136
137-- things we really need to construct other than factories
138-- value is max number of assistants to get if available (0 is all available)
139helpList = {
140	corfus = 0,
141	armfus = 0,
142	coruwfus = 0,
143	armuwfus = 0,
144	aafus = 0,
145	cafus = 0,
146	corgeo = 2,
147	armgeo = 2,
148	cmgeo = 0,
149	amgeo = 0,
150	cormoho = 2,
151	armmoho = 2,
152	coruwmme = 2,
153	armuwmme = 2,
154}
155
156-- priorities of things to defend that can't be accounted for by the formula in turtlehandler
157turtleList = {
158	cormakr = 0.5,
159	armmakr = 0.5,
160	corfmkr = 0.5,
161	armfmkr = 0.5,
162	cormmkr = 4,
163	armmmkr = 4,
164	coruwmmm = 4,
165	armuwmmm = 4,
166	corestor = 0.5,
167	armestor = 0.5,
168	cormstor = 0.5,
169	armmstor = 0.5,
170	coruwes = 0.5,
171	armuwes = 0.5,
172	coruwms = 0.5,
173	armuwms = 0.5,
174	coruwadves = 2,
175	armuwadves = 2,
176	coruwadvms = 2,
177	armuwadvms = 2,
178}
179
180-- factories that can build advanced construction units (i.e. moho mines)
181advFactories = {
182	coravp = 1,
183	coralab = 1,
184	corasy = 1,
185	coraap = 1,
186	corplat = 1,
187	armavp = 1,
188	armalab = 1,
189	armasy = 1,
190	armaap = 1,
191	armplat = 1,
192}
193
194-- experimental factories
195expFactories = {
196	corgant = 1,
197	armshltx = 1,
198}
199
200-- leads to experimental
201leadsToExpFactories = {
202	corlab = 1,
203	armlab = 1,
204	coralab = 1,
205	armalab = 1,
206}
207
208-- sturdy, cheap units to be built in larger numbers than siege units
209battleList = {
210	corraid = 1,
211	armstump = 1,
212	corthud = 1,
213	armham = 1,
214	corstorm = 1,
215	armrock = 1,
216	coresupp = 1,
217	decade = 1,
218	corroy = 1,
219	armroy = 1,
220	corsnap = 1,
221	armanac = 1,
222	corseal = 1,
223	armcroc = 1,
224	correap = 2,
225	armbull = 2,
226	corcan = 2,
227	armzeus = 2,
228	corcrus = 2,
229	armcrus = 2,
230	corkarg = 3,
231	armraz = 3,
232}
233
234-- sturdier units to use when battle units get killed
235breakthroughList = {
236	corlevlr = 1,
237	armwar = 1,
238	corgol = 2,
239	corsumo = 2,
240	armfboy = 2,
241	corparrow = 2,
242	nsaclash = 2,
243	corbats = 2,
244	armbats = 2,
245	corkrog = 3,
246	gorg = 3,
247	armbanth = 3,
248	corblackhy = 3,
249	aseadragon = 3,
250	corcrw = 3,
251	armcybr = 3,
252}
253
254-- for milling about next to con units and factories only
255defenderList = {
256	"armaak",
257	"corcrash",
258	"armjeth",
259	"corsent",
260	"armyork",
261	"corah",
262	"armaas",
263	"armah",
264	"corarch",
265	"armaser",
266	"armjam",
267	"armsjam",
268	"coreter",
269	"corsjam",
270	"corspec",
271	"armfig",
272	"armhawk",
273	"armsfig",
274	"corveng",
275	"corvamp",
276	"corsfig",
277}
278
279attackerlist = {
280	"armsam",
281	"corwolv",
282	"tawf013",
283	"armjanus",
284	"corlvlr",
285	"corthud",
286	"armham",
287	"corraid",
288	"armstump",
289	"correap",
290	"armbull",
291	"corstorm",
292	"armrock",
293	"cormart",
294	"armmart",
295	"cormort",
296	"armwar",
297	"armsnipe",
298	"armzeus",
299	"corlevlr",
300	"corsumo",
301	"corcan",
302	"corhrk",
303	"corgol",
304	"corvroc",
305	"cormh",
306	"armmanni",
307	"armmerl",
308	"armfido",
309	"armsptk",
310	"armmh",
311	"corwolv",
312	"cormist",
313	"armfboy",
314	"corcrw",
315	-- experimentals
316	"armraz",
317	"armshock",
318	"armbanth",
319	"shiva",
320	"armraven",
321	"corkarg",
322	"gorg",
323	"corkrog",
324	-- ships
325	"coresupp",
326	"decade",
327	"corroy",
328	"armroy",
329	"corcrus",
330	"armcrus",
331	"corblackhy",
332	"aseadragon",
333	-- hover
334	"corsnap",
335	"armanac",
336	"nsaclash",
337	-- amphib
338	"corseal",
339	"armcroc",
340	"corparrow",
341}
342
343
344scoutList = {
345	corfink = 1,
346	armpeep = 1,
347	corfav = 1,
348	armfav = 1,
349	armflea = 1,
350	corawac = 1,
351	armawac = 1,
352	corpt = 1,
353	armpt = 1,
354	corhunt = 1,
355	armsehak = 1,
356}
357
358antinukeList = {
359	corfmd = 1,
360	armamd = 1,
361	corcarry = 1,
362	armcarry = 1,
363	cormabm = 1,
364	armscab = 1,
365}
366
367shieldList = {
368	corgate = 1,
369	armgate = 1,
370}
371
372commanderList = {
373	armcom = 1,
374	corcom = 1,
375}
376
377nanoTurretList = {
378	cornanotc = 1,
379	armnanotc = 1,
380}
381
382-- cheap construction units that can be built in large numbers
383assistList = {
384	armfark = 1,
385	corfast = 1,
386	consul = 1,
387}
388
389reclaimerList = {
390	cornecro = 1,
391	armrectr = 1,
392	correcl = 1,
393	armrecl = 1,
394}
395
396-- advanced construction units
397advConList = {
398	corack = 1,
399	armack = 1,
400	coracv = 1,
401	armacv = 1,
402	coraca = 1,
403	armaca = 1,
404}
405
406groundFacList = {
407	corvp = 1,
408	armvp = 1,
409	coravp = 1,
410	armavp = 1,
411	corlab = 1,
412	armlab = 1,
413	coralab = 1,
414	armalab = 1,
415	corhp = 1,
416	armhp = 1,
417	corfhp = 1,
418	armfhp = 1,
419	csubpen = 1,
420	asubpen = 1,
421	corgant = 1,
422	armshltx = 1,
423	corfast = 1,
424	consul = 1,
425	armfark = 1,
426}
427
428-- if any of these is found among enemy units, AA units and fighters will be built
429airFacList = {
430	corap = 1,
431	armap = 1,
432	coraap = 1,
433	armaap = 1,
434	corplat = 1,
435	armplat = 1,
436}
437
438-- if any of these is found among enemy units, torpedo launchers and sonar will be built
439subFacList = {
440	corsy = 1,
441	armsy = 1,
442	corasy = 1,
443	armasy = 1,
444	csubpen = 1,
445	asubpen = 1,
446}
447
448-- if any of these is found among enemy units, plasma shields will be built
449bigPlasmaList = {
450	corint = 1,
451	armbrtha = 1,
452}
453
454-- if any of these is found among enemy units, antinukes will be built
455-- also used to assign nuke behaviour to own units
456-- values are how many frames it takes to stockpile
457nukeList = {
458	armsilo = 3600,
459	corsilo = 5400,
460	armemp = 2700,
461	cortron = 2250,
462}
463
464-- these units will be used to raid weakly defended spots
465raiderList = {
466	"armfast",
467	"corgator",
468	"armflash",
469	"corpyro",
470	"armlatnk",
471	"armpw",
472	"corak",
473	"marauder",
474	-- amphibious
475	"corgarp",
476	"armpincer",
477	-- hover
478	"corsh",
479	"armsh",
480	-- air gunships
481	"armbrawl",
482	"armkam",
483	"armsaber",
484	"blade",
485	"bladew",
486	"corape",
487	"corcut",
488	"corcrw",
489	-- subs
490	"corsub",
491	"armsub",
492	"armsubk",
493	"corsubk",
494}
495
496raiderDisarms = {
497	bladew = 1,
498}
499
500-- units in this list are bombers or torpedo bombers
501bomberList = {
502	corshad = 1,
503	armthund = 1,
504	corhurc = 2,
505	armpnix = 2,
506	armcybr = 3,
507	corsb = 2,
508	armsb = 2,
509	cortitan = 2,
510	armlance = 2,
511	corseap = 2,
512	armseap = 2,
513}
514
515seaplaneConList = {
516	corcsa = 1,
517	armcsa = 1,
518}
519
520-- minimum, maximum, starting point units required to attack, bomb
521minAttackCounter = 8
522maxAttackCounter = 30
523baseAttackCounter = 15
524breakthroughAttackCounter = 16 -- build heavier battle units
525siegeAttackCounter = 20 -- build siege units
526minBattleCount = 4 -- how many battle units to build before building any breakthroughs, even if counter is too high
527minBomberCounter = 0
528maxBomberCounter = 16
529baseBomberCounter = 2
530breakthroughBomberCounter = 8 -- build atomic bombers or air fortresses
531
532-- raid counter works backwards: it determines the number of raiders to build
533-- if it reaches minRaidCounter, none are built
534minRaidCounter = 0
535maxRaidCounter = 8
536baseRaidCounter = 5
537
538-- how many mobile con units of one type is allowed
539ConUnitPerTypeLimit = 4 --max(map:SpotCount() / 10, 2)
540ConUnitAdvPerTypeLimit = 4
541
542-- Taskqueuebehaviour was modified to skip this name
543DummyUnitName = "skipthisorder"
544
545-- Taskqueuebehaviour was modified to use this as a generic "build me a factory" order
546FactoryUnitName = "buildfactory"
547
548-- this unit is used to check for underwater metal spots
549UWMetalSpotCheckUnit = "coruwmex"
550
551mobUnitName = {}
552mobUnitName["veh"] = "armllt" -- this looks wrong, but it gives us a better picture of where vehicles can go
553mobUnitName["bot"] = "corck"
554mobUnitName["amp"] = "cormuskrat"
555mobUnitName["hov"] = "corsh"
556mobUnitName["shp"] = "corcs"
557mobUnitName["sub"] = "coracsub"
558
559-- this unit is used to check for hoverable water
560WaterSurfaceUnitName = "armfdrag"
561
562-- side names
563CORESideName = "core"
564ARMSideName = "arm"
565
566-- how much metal to assume features with these strings in their names have
567baseFeatureMetal = { rock = 30, heap = 80, wreck = 150 }