-
Notifications
You must be signed in to change notification settings - Fork 2
/
scenario_55_defenderHunter.lua
executable file
·10900 lines (10828 loc) · 385 KB
/
scenario_55_defenderHunter.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- Name: Defender Hunter
-- Description: Defend home station and hunt down enemies
---
--- Initially, you're tasked with defending your home base. Over time, you'll discover more about the enemies harassing you and you'll be ordered to find and destroy the enemies responsible. There may be various missions given along the way, but the enemy harassment will continue. You must balance your two missions.
---
--- Designed for 1-8 cooperating player ships. Randomization makes many details different for each game, but the primary goals remain the same. Untimed variations can take an hour or longer for full mission completion. Different sub-missions may be chosen by the players or will be chosen at random. Achieving victory in a timed hunter variation is quite a challenge. Like the Waves scenario, the enemies get harder over time.
---
--- Features:
--- - Randomly selected player ship names based on type (not just the default call sign generation)
--- - Simple mix of variations based on time and difficulty
--- - Named stations with cargo type often related to name
--- - Some cargo based missions
--- - Mortal but replaceable at station repair crew
--- - Asteroids and nebulae in motion
--- - Intense pacing
--- - Player fighters may activate auto-cooling and auto-repair in engineering
---
--- Version 9 - Oct2020
-- Type: Replayable mission
-- Variation[Easy]: Easy goals and/or enemies
-- Variation[Hard]: Hard goals and/or enemies
-- Variation[Timed Defender]: Victory if home station survives after 30 minutes
-- Variation[Timed Hunter]: Victory if target enemy base destroyed in 30 minutes
-- Variation[Easy Timed Defender]: Easy goals and/or enemies, victory if home station survives after 30 minutes
-- Variation[Easy Timed Hunter]: Easy goals and/or enemies, victory if target enemy base destroyed in 30 minutes
-- Variation[Hard Timed Defender]: Hard goals and/or enemies, victory if home station survives after 30 minutes
-- Variation[Hard Timed Hunter]: Hard goals and/or enemies, victory if target enemy base destroyed in 30 minutes
-- typical colors used in ship log
-- "Red" Red Enemies spotted
-- "Blue" Blue
-- "Yellow" Yellow Maria Shrivner
-- "Magenta" Magenta Headquarters
-- "Green" Green
-- "Cyan" Cyan
-- "Black" Black
-- "#555555" Dark gray "55,55,55"
-- "#ff4500" Orange red "255,69,0" HMS Bounty
-- "#ff7f50" Coral "255,127,80"
-- "#5f9ea0" Cadet blue "95,158,160" Paul Straight
-- "#4169e1" Royal blue "65,105,225"
-- "#8a2be2" Blue violet "138,43,226"
-- "#ba55d3" Medium orchid "186,85,211" Maria's station
-- "#a0522d" Sienna "160,82,45"
-- "#b29650" Arbitrary "178,150,80"
-- "#556b2f" Dark olive green "85,107,47" Home station
-- "#228b22" Forest green "34,139,34"
-- "#b22222" Firebrick "178,34,34"
require("utils.lua")
function tableRemoveRandom(array)
-- Remove random element from array and return it.
-- Returns nil if the array is empty,
-- analogous to `table.remove`.
local array_item_count = #array
if array_item_count == 0 then
return nil
end
local selected_item = math.random(array_item_count)
array[selected_item], array[array_item_count] = array[array_item_count], array[selected_item]
return table.remove(array)
end
-------------------------------
-- Initialization routines --
-------------------------------
function init()
wfv = "nowhere" --wolf fence value - used for debugging
plot_1_diagnostic = false
plot_2_diagnostic = false
setVariations()
setMovingAsteroids()
setMovingNebulae()
setWormArt()
setConstants()
diagnostic = false
helpfulWarningDiagnostic = false
GMDiagnosticOn = "Turn On Diagnostic"
addGMFunction(GMDiagnosticOn,turnOnDiagnostic)
default_interwave_interval = 280
interWave = default_interwave_interval
GMDelayNormalToSlow = "Delay normal to slow"
addGMFunction(GMDelayNormalToSlow,delayNormalToSlow)
buildStations()
wfv = "end of init"
end
function setConstants()
player_ship_stats = { --ordered by name
["Atlantis"] = { strength = 52, cargo = 6, distance = 400, long_range_radar = 30000, short_range_radar = 5000},
["Benedict"] = { strength = 10, cargo = 9, distance = 400, long_range_radar = 30000, short_range_radar = 5000},
["Crucible"] = { strength = 45, cargo = 5, distance = 200, long_range_radar = 20000, short_range_radar = 6000},
["Ender"] = { strength = 100, cargo = 20, distance = 2000,long_range_radar = 45000, short_range_radar = 7000},
["Flavia P.Falcon"] = { strength = 13, cargo = 15, distance = 200, long_range_radar = 40000, short_range_radar = 5000},
["Hathcock"] = { strength = 30, cargo = 6, distance = 200, long_range_radar = 35000, short_range_radar = 6000},
["Kiriya"] = { strength = 10, cargo = 9, distance = 400, long_range_radar = 35000, short_range_radar = 5000},
["Maverick"] = { strength = 45, cargo = 5, distance = 200, long_range_radar = 20000, short_range_radar = 4000},
["MP52 Hornet"] = { strength = 7, cargo = 3, distance = 100, long_range_radar = 18000, short_range_radar = 4000},
["Nautilus"] = { strength = 12, cargo = 7, distance = 200, long_range_radar = 22000, short_range_radar = 4000},
["Phobos M3P"] = { strength = 19, cargo = 10, distance = 200, long_range_radar = 25000, short_range_radar = 5000},
["Piranha"] = { strength = 16, cargo = 8, distance = 200, long_range_radar = 25000, short_range_radar = 6000},
["Player Cruiser"] = { strength = 40, cargo = 6, distance = 400, long_range_radar = 30000, short_range_radar = 5000},
["Player Fighter"] = { strength = 7, cargo = 3, distance = 100, long_range_radar = 15000, short_range_radar = 4500},
["Player Missile Cr."] = { strength = 45, cargo = 8, distance = 200, long_range_radar = 35000, short_range_radar = 6000},
["Repulse"] = { strength = 14, cargo = 12, distance = 200, long_range_radar = 38000, short_range_radar = 5000},
["Striker"] = { strength = 8, cargo = 4, distance = 200, long_range_radar = 35000, short_range_radar = 5000},
["ZX-Lindworm"] = { strength = 8, cargo = 3, distance = 100, long_range_radar = 18000, short_range_radar = 5500},
}
ship_template = { --ordered by relative strength
["Gnat"] = {strength = 2, create = gnat},
["Lite Drone"] = {strength = 3, create = droneLite},
["Jacket Drone"] = {strength = 4, create = droneJacket},
["Ktlitan Drone"] = {strength = 4, create = stockTemplate},
["Heavy Drone"] = {strength = 5, create = droneHeavy},
["Adder MK3"] = {strength = 5, create = adderMk3},
["MT52 Hornet"] = {strength = 5, create = stockTemplate},
["MU52 Hornet"] = {strength = 5, create = stockTemplate},
["MV52 Hornet"] = {strength = 6, create = hornetMV52},
["Adder MK4"] = {strength = 6, create = stockTemplate},
["Fighter"] = {strength = 6, create = stockTemplate},
["Ktlitan Fighter"] = {strength = 6, create = stockTemplate},
["K2 Fighter"] = {strength = 7, create = k2fighter},
["Adder MK5"] = {strength = 7, create = stockTemplate},
["WX-Lindworm"] = {strength = 7, create = stockTemplate},
["K3 Fighter"] = {strength = 8, create = k3fighter},
["Adder MK6"] = {strength = 8, create = stockTemplate},
["Ktlitan Scout"] = {strength = 8, create = stockTemplate},
["WZ-Lindworm"] = {strength = 9, create = wzLindworm},
["Adder MK7"] = {strength = 9, create = adderMk7},
["Adder MK8"] = {strength = 10, create = adderMk8},
["Adder MK9"] = {strength = 11, create = adderMk9},
["Nirvana R3"] = {strength = 12, create = nirvanaR3},
["Phobos R2"] = {strength = 13, create = phobosR2},
["Missile Cruiser"] = {strength = 14, create = stockTemplate},
["Waddle 5"] = {strength = 15, create = waddle5},
["Jade 5"] = {strength = 15, create = jade5},
["Phobos T3"] = {strength = 15, create = stockTemplate},
["Piranha F8"] = {strength = 15, create = stockTemplate},
["Piranha F12"] = {strength = 15, create = stockTemplate},
["Phobos M3"] = {strength = 16, create = stockTemplate},
["Cruiser"] = {strength = 18, create = stockTemplate},
["Nirvana R5A"] = {strength = 20, create = stockTemplate},
["Ktlitan Worker"] = {strength = 21, create = stockTemplate},
["Storm"] = {strength = 22, create = stockTemplate},
["Stalker R5"] = {strength = 22, create = stalkerR5},
["Stalker Q5"] = {strength = 22, create = stalkerQ5},
["Ranus U"] = {strength = 25, create = stockTemplate},
["Stalker Q7"] = {strength = 25, create = stockTemplate},
["Stalker R7"] = {strength = 25, create = stockTemplate},
["Adv. Striker"] = {strength = 27, create = stockTemplate},
["Elara P2"] = {strength = 28, create = elaraP2},
["Tempest"] = {strength = 30, create = tempest},
["Strikeship"] = {strength = 30, create = stockTemplate},
["Fiend G3"] = {strength = 33, create = fiendG3},
["Fiend G4"] = {strength = 35, create = fiendG4},
["Fiend G5"] = {strength = 37, create = fiendG5},
["Fiend G6"] = {strength = 39, create = fiendG6},
["Predator"] = {strength = 42, create = predator},
["Ktlitan Breaker"] = {strength = 45, create = stockTemplate},
["Ktlitan Feeder"] = {strength = 48, create = stockTemplate},
["Atlantis X23"] = {strength = 50, create = stockTemplate},
["Ktlitan Destroyer"] = {strength = 50, create = stockTemplate},
["Atlantis Y42"] = {strength = 60, create = atlantisY42},
["Blockade Runner"] = {strength = 65, create = stockTemplate},
["Starhammer II"] = {strength = 70, create = stockTemplate},
["Enforcer"] = {strength = 75, create = enforcer},
["Dreadnought"] = {strength = 80, create = stockTemplate},
["Starhammer V"] = {strength = 90, create = starhammerV},
["Battlestation"] = {strength = 100,create = stockTemplate},
["Tyr"] = {strength = 150,create = tyr},
["Odin"] = {strength = 250,create = stockTemplate},
}
formation_delta = {
["square"] = {
x = {0,1,0,-1, 0,1,-1, 1,-1,2,0,-2, 0,2,-2, 2,-2,2, 2,-2,-2,1,-1, 1,-1,0, 0,3,-3,1, 1,3,-3,-1,-1, 3,-3,2, 2,3,-3,-2,-2, 3,-3,3, 3,-3,-3,4,0,-4, 0,4,-4, 4,-4,-4,-4,-4,-4,-4,-4,4, 4,4, 4,4, 4, 1,-1, 2,-2, 3,-3,1,-1,2,-2,3,-3,5,-5,0, 0,5, 5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,5, 5,5, 5,5, 5,5, 5, 1,-1, 2,-2, 3,-3, 4,-4,1,-1,2,-2,3,-3,4,-4},
y = {0,0,1, 0,-1,1,-1,-1, 1,0,2, 0,-2,2,-2,-2, 2,1,-1, 1,-1,2, 2,-2,-2,3,-3,0, 0,3,-3,1, 1, 3,-3,-1,-1,3,-3,2, 2, 3,-3,-2,-2,3,-3, 3,-3,0,4, 0,-4,4,-4,-4, 4, 1,-1, 2,-2, 3,-3,1,-1,2,-2,3,-3,-4,-4,-4,-4,-4,-4,4, 4,4, 4,4, 4,0, 0,5,-5,5,-5, 5,-5, 1,-1, 2,-2, 3,-3, 4,-4,1,-1,2,-2,3,-3,4,-4,-5,-5,-5,-5,-5,-5,-5,-5,5, 5,5, 5,5, 5,5, 5},
},
["hexagonal"] = {
x = {0,2,-2,1,-1, 1,-1,4,-4,0, 0,2,-2,-2, 2,3,-3, 3,-3,6,-6,1,-1, 1,-1,3,-3, 3,-3,4,-4, 4,-4,5,-5, 5,-5,8,-8,4,-4, 4,-4,5,5 ,-5,-5,2, 2,-2,-2,0, 0,6, 6,-6,-6,7, 7,-7,-7,10,-10,5, 5,-5,-5,6, 6,-6,-6,7, 7,-7,-7,8, 8,-8,-8,9, 9,-9,-9,3, 3,-3,-3,1, 1,-1,-1,12,-12,6,-6, 6,-6,7,-7, 7,-7,8,-8, 8,-8,9,-9, 9,-9,10,-10,10,-10,11,-11,11,-11,4,-4, 4,-4,2,-2, 2,-2,0, 0},
y = {0,0, 0,1, 1,-1,-1,0, 0,2,-2,2,-2, 2,-2,1,-1,-1, 1,0, 0,3, 3,-3,-3,3,-3,-3, 3,2,-2,-2, 2,1,-1,-1, 1,0, 0,4,-4,-4, 4,3,-3, 3,-3,4,-4, 4,-4,4,-4,2,-2, 2,-2,1,-1, 1,-1, 0, 0,5,-5, 5,-5,4,-4, 4,-4,3,-3, 3,-7,2,-2, 2,-2,1,-1, 1,-1,5,-5, 5,-5,5,-5, 5,-5, 0, 0,6, 6,-6,-6,5, 5,-5,-5,4, 4,-4,-4,3, 3,-3,-3, 2, 2,-2, -2, 1, 1,-1, -1,6, 6,-6,-6,6, 6,-6,-6,6,-6},
},
["pyramid"] = {
[1] = {
{angle = 0, distance = 0},
},
[2] = {
{angle = -1, distance = 1},
{angle = 1, distance = 1},
},
[3] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
},
[4] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
{angle = 0, distance = 2},
},
[5] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
{angle = -2, distance = 2},
{angle = 2, distance = 2},
},
[6] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
{angle = -2, distance = 2},
{angle = 2, distance = 2},
{angle = 0, distance = 2},
},
[7] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
{angle = -2, distance = 2},
{angle = 2, distance = 2},
{angle = -3, distance = 3},
{angle = 3, distance = 3},
},
[8] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
{angle = -2, distance = 2},
{angle = 2, distance = 2},
{angle = 0, distance = 2},
{angle = -3, distance = 3},
{angle = 3, distance = 3},
},
[9] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
{angle = -2, distance = 2},
{angle = 2, distance = 2},
{angle = -3, distance = 3},
{angle = 3, distance = 3},
{angle = -4, distance = 4},
{angle = 4, distance = 4},
},
[10] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
{angle = -2, distance = 2},
{angle = 2, distance = 2},
{angle = 0, distance = 2},
{angle = -3, distance = 3},
{angle = 3, distance = 3},
{angle = -2, distance = 3},
{angle = 2, distance = 3},
},
[11] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
{angle = -2, distance = 2},
{angle = 2, distance = 2},
{angle = -3, distance = 3},
{angle = 3, distance = 3},
{angle = -4, distance = 4},
{angle = 4, distance = 4},
{angle = -3, distance = 4},
{angle = 3, distance = 4},
},
[12] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
{angle = -2, distance = 2},
{angle = 2, distance = 2},
{angle = 0, distance = 2},
{angle = -3, distance = 3},
{angle = 3, distance = 3},
{angle = -2, distance = 3},
{angle = 2, distance = 3},
{angle = -1, distance = 3},
{angle = 1, distance = 3},
},
[13] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
{angle = -2, distance = 2},
{angle = 2, distance = 2},
{angle = -3, distance = 3},
{angle = 3, distance = 3},
{angle = 0, distance = 3},
{angle = -2, distance = 4},
{angle = 2, distance = 4},
{angle = -1, distance = 5},
{angle = 1, distance = 5},
{angle = 0, distance = 6},
},
[14] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
{angle = -2, distance = 2},
{angle = 2, distance = 2},
{angle = 0, distance = 2},
{angle = -3, distance = 3},
{angle = 3, distance = 3},
{angle = 0, distance = 4},
{angle = -2, distance = 4},
{angle = 2, distance = 4},
{angle = -1, distance = 5},
{angle = 1, distance = 5},
{angle = 0, distance = 6},
},
[15] = {
{angle = 0, distance = 0},
{angle = -1, distance = 1},
{angle = 1, distance = 1},
{angle = -2, distance = 2},
{angle = 2, distance = 2},
{angle = 0, distance = 2},
{angle = -3, distance = 3},
{angle = 3, distance = 3},
{angle = 0, distance = 3},
{angle = 0, distance = 4},
{angle = -2, distance = 4},
{angle = 2, distance = 4},
{angle = -1, distance = 5},
{angle = 1, distance = 5},
{angle = 0, distance = 6},
},
},
}
prefix_length = 0
suffix_index = 0
get_coolant_function = {}
table.insert(get_coolant_function,getCoolant1)
table.insert(get_coolant_function,getCoolant2)
table.insert(get_coolant_function,getCoolant3)
table.insert(get_coolant_function,getCoolant4)
table.insert(get_coolant_function,getCoolant5)
table.insert(get_coolant_function,getCoolant6)
table.insert(get_coolant_function,getCoolant7)
table.insert(get_coolant_function,getCoolant8)
--list of goods available to buy, sell or trade (sell still under development)
goodsList = { {"food",0},
{"medicine",0},
{"nickel",0},
{"platinum",0},
{"gold",0},
{"dilithium",0},
{"tritanium",0},
{"luxury",0},
{"cobalt",0},
{"impulse",0},
{"warp",0},
{"shield",0},
{"tractor",0},
{"repulsor",0},
{"beam",0},
{"optic",0},
{"robotic",0},
{"filament",0},
{"transporter",0},
{"sensor",0},
{"communication",0},
{"autodoc",0},
{"lifter",0},
{"android",0},
{"nanites",0},
{"software",0},
{"circuit",0},
{"battery",0} }
goods = {} --overall tracking of goods
commonGoods = {"food","medicine","nickel","platinum","gold","dilithium","tritanium","luxury","cobalt","impulse","warp","shield","tractor","repulsor","beam","optic","robotic","filament","transporter","sensor","communication","autodoc","lifter","android","nanites","software","circuit","battery"}
componentGoods = {"impulse","warp","shield","tractor","repulsor","beam","optic","robotic","filament","transporter","sensor","communication","autodoc","lifter","android","nanites","software","circuit","battery"}
mineralGoods = {"nickel","platinum","gold","dilithium","tritanium","cobalt"}
stationList = {} --friendly and neutral stations
friendlyStationList = {}
enemyStationList = {}
tradeFood = {} --stations that will trade food for other goods
tradeLuxury = {} --stations that will trade luxury for other goods
tradeMedicine = {} --stations that will trade medicine for other goods
totalStations = 0
friendlyStations = 0
neutralStations = 0
-- setListOfStations()
--gossip will have meaning for a future mission addition. Right now, it's just color
gossipSnippets = {}
table.insert(gossipSnippets,"I hear the head of operations has a thing for his administrative assistant") --1
table.insert(gossipSnippets,"My mining friends tell me Krak or Kruk is about to strike it rich") --2
table.insert(gossipSnippets,"Did you know you can usually hire replacement repair crew cheaper at friendly stations?") --3
table.insert(gossipSnippets,"Under their uniforms, the Kraylors have an extra appendage. I wonder what they use it for") --4
table.insert(gossipSnippets,"The Kraylors may be human navy enemies, but they make some mighty fine BBQ Mynock") --5
table.insert(gossipSnippets,"The Kraylors and the Ktlitans may be nearing a cease fire from what I hear. That'd be bad news for us") --6
table.insert(gossipSnippets,"Docking bay 7 has interesting mind altering substances for sale, but they're monitored between 1900 and 2300") --7
table.insert(gossipSnippets,"Watch the sky tonight in quadrant J around 2243. It should be spectacular") --8
table.insert(gossipSnippets,"I think the shuttle pilot has a tame miniature Ktlitan caged in his quarters. Sometimes I hear it at night") --9
table.insert(gossipSnippets,"Did you hear the screaming chase in the corridors on level 4 last night? Three Kraylors were captured and put in the brig") --10
table.insert(gossipSnippets,"Rumor has it that the two Lichten brothers are on the verge of a new discovery. And it's not another wine flavor either") --11
--Player ship name lists to supplant standard randomized call sign generation
playerShipNamesFor = {}
-- TODO switch to spelling with space or dash matching the type name
playerShipNamesFor["MP52Hornet"] = {"Dragonfly","Scarab","Mantis","Yellow Jacket","Jimminy","Flik","Thorny","Buzz"}
playerShipNamesFor["Piranha"] = {"Razor","Biter","Ripper","Voracious","Carnivorous","Characid","Vulture","Predator"}
playerShipNamesFor["FlaviaPFalcon"] = {"Ladyhawke","Hunter","Seeker","Gyrefalcon","Kestrel","Magpie","Bandit","Buccaneer"}
playerShipNamesFor["PhobosM3P"] = {"Blinder","Shadow","Distortion","Diemos","Ganymede","Castillo","Thebe","Retrograde"}
playerShipNamesFor["Atlantis"] = {"Excaliber","Thrasher","Punisher","Vorpal","Protang","Drummond","Parchim","Coronado"}
playerShipNamesFor["Cruiser"] = {"Excelsior","Velociraptor","Thunder","Kona","Encounter","Perth","Aspern","Panther"}
playerShipNamesFor["MissileCruiser"] = {"Projectus","Hurlmeister","Flinger","Ovod","Amatola","Nakhimov","Antigone"}
playerShipNamesFor["Fighter"] = {"Buzzer","Flitter","Zippiticus","Hopper","Molt","Stinger","Stripe"}
playerShipNamesFor["Benedict"] = {"Elizabeth","Ford","Vikramaditya","Liaoning","Avenger","Naruebet","Washington","Lincoln","Garibaldi","Eisenhower"}
playerShipNamesFor["Kiriya"] = {"Cavour","Reagan","Gaulle","Paulo","Truman","Stennis","Kuznetsov","Roosevelt","Vinson","Old Salt"}
playerShipNamesFor["Striker"] = {"Sparrow","Sizzle","Squawk","Crow","Phoenix","Snowbird","Hawk"}
playerShipNamesFor["Lindworm"] = {"Seagull","Catapult","Blowhard","Flapper","Nixie","Pixie","Tinkerbell"}
playerShipNamesFor["Repulse"] = {"Fiddler","Brinks","Loomis","Mowag","Patria","Pandur","Terrex","Komatsu","Eitan"}
playerShipNamesFor["Ender"] = {"Mongo","Godzilla","Leviathan","Kraken","Jupiter","Saturn"}
playerShipNamesFor["Nautilus"] = {"October", "Abdiel", "Manxman", "Newcon", "Nusret", "Pluton", "Amiral", "Amur", "Heinkel", "Dornier"}
playerShipNamesFor["Hathcock"] = {"Hayha", "Waldron", "Plunkett", "Mawhinney", "Furlong", "Zaytsev", "Pavlichenko", "Pegahmagabow", "Fett", "Hawkeye", "Hanzo"}
playerShipNamesFor["Maverick"] = {"Festoon", "Earp", "Schwartz", "Tentacular", "Prickly", "Thunderbird", "Hickok", "Clifton", "Fett", "Holliday", "Sundance"}
playerShipNamesFor["Crucible"] = {"Sling", "Stark", "Torrid", "Kicker", "Flummox"}
playerShipNamesFor["Leftovers"] = {"Foregone","Righteous","Masher"}
highestConcurrentPlayerCount = 0
setConcurrentPlayerCount = 0
primaryOrders = ""
secondaryOrders = ""
optionalOrders = ""
transportList = {}
homeDelivery = false
infoPromised = false
baseIntelligenceAvailable = false
spinUpgradeAvailable = false
hullUpgradeAvailable = false
rotateUpgradeAvailable = false
beamTimeUpgradeAvailable = false
missionLength = 1
initialOrderTimer = 3
plot1 = initialOrders
transportSpawnDelay = 10
plotT = transportPlot
plotH = healthCheck
plotC = autoCoolant
healthCheckTimer = 5
healthCheckTimerInterval = 5
healthCheckCount = 0
plot4choices = {}
table.insert(plot4choices,stationShieldDelay)
table.insert(plot4choices,repairBountyDelay)
table.insert(plot4choices,insertAgentDelay)
end
function setVariations()
--translate variations into a numeric difficulty value
if string.find(getScenarioVariation(),"Easy") then
difficulty = .5
adverseEffect = .999
coolant_loss = .99999
coolant_gain = .005
elseif string.find(getScenarioVariation(),"Hard") then
difficulty = 2
adverseEffect = .99
coolant_loss = .9999
coolant_gain = .0001
else
difficulty = 1 --default (normal)
adverseEffect = .995
coolant_loss = .99995
coolant_gain = .001
end
gameTimeLimit = 0
if string.find(getScenarioVariation(),"Timed") then
timedIntelligenceInterval = 200
playWithTimeLimit = true
gameTimeLimit = 30*60
plot6 = timedGame
else
timedIntelligenceInterval = 300
playWithTimeLimit = false
end
end
function GMSpawnsEnemies()
-- Let the GM spawn a random group of enemies to attack a player
local gmPlayer = nil
local gmSelect = getGMSelection()
for _, obj in ipairs(gmSelect) do
if obj.typeName == "PlayerSpaceship" then
gmPlayer = obj
break
end
end
if gmPlayer == nil then
gmPlayer = closestPlayerTo(targetEnemyStation)
end
local px, py = gmPlayer:getPosition()
local sx, sy = vectorFromAngle(random(0,360),random(20000,30000))
ntf = spawnEnemies(px+sx,py+sy,dangerValue,targetEnemyStation:getFaction())
for _, enemy in ipairs(ntf) do
enemy:orderAttack(gmPlayer)
end
end
function turnOnDiagnostic()
-- Diagnostic enable/disable buttons on GM screen
diagnostic = true
removeGMFunction(GMDiagnosticOn)
addGMFunction("Turn Off Diagnostic",turnOffDiagnostic)
end
function turnOffDiagnostic()
diagnostic = false
removeGMFunction(GMDiagnosticOff)
addGMFunction("Turn On Diagnostic",turnOnDiagnostic)
end
function populateStationPool()
station_pool = {
["Science"] = {
["Asimov"] = {
weapon_available = {
Homing = true,
HVLI = random(1,13)<=(9-difficulty),
Mine = true,
Nuke = random(1,13)<=(5-difficulty),
EMP = random(1,13)<=(6-difficulty),
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
reputation_cost_multipliers = {
friend = 1.0,
neutral = 3.0,
},
goods = {
tractor = {
quantity = 5,
cost = 48,
},
repulsor = {
quantity = 5,
cost = 48,
},
},
trade = {
food = false,
medicine = false,
luxury = false,
},
description = "Training and Coordination",
general = "We train naval cadets in routine and specialized functions aboard space vessels and coordinate naval activity throughout the sector",
history = "The original station builders were fans of the late 20th century scientist and author Isaac Asimov. The station was initially named Foundation, but was later changed simply to Asimov. It started off as a stellar observatory, then became a supply stop and as it has grown has become an educational and coordination hub for the region",
},
["Armstrong"] = {
weapon_available = {
Homing = random(1,13)<=(8-difficulty),
HVLI = true,
Mine = random(1,13)<=(7-difficulty),
Nuke = random(1,13)<=(5-difficulty),
EMP = true
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
goods = {
warp = {
quantity = 5,
cost = 77,
},
repulsor = {
quantity = 5,
cost = 62,
},
},
trade = {
food = random(1,100) <= 45,
medicine = false,
luxury = false,
},
buy = {
[randomMineral()] = math.random(40,200),
},
description = "Warp and Impulse engine manufacturing",
general = "We manufacture warp, impulse and jump engines for the human navy fleet as well as other independent clients on a contract basis",
history = "The station is named after the late 19th century astronaut as well as the fictionlized stations that followed. The station initially constructed entire space worthy vessels. In time, it transitioned into specializeing in propulsion systems.",
},
["Broeck"] = {
weapon_available = {
Homing = random(1,13)<=(8-difficulty),
HVLI = random(1,13)<=(9-difficulty),
Mine = random(1,13)<=(7-difficulty),
Nuke = random(1,13)<=(5-difficulty),
EMP = random(1,13)<=(6-difficulty),
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
goods = {
warp = {
quantity = 5,
cost = 36,
},
},
trade = {
food = random(1,100) <= 14,
medicine = false,
luxury = random(1,100) < 62,
},
buy = {
[randomMineral()] = math.random(40,200),
},
description = "Warp drive components",
general = "We provide warp drive engines and components",
history = "This station is named after Chris Van Den Broeck who did some initial research into the possibility of warp drive in the late 20th century on Earth",
},
["Coulomb"] = {
weapon_available = {
Homing = random(1,13)<=(8-difficulty),
HVLI = random(1,13)<=(9-difficulty),
Mine = random(1,13)<=(7-difficulty),
Nuke = random(1,13)<=(5-difficulty),
EMP = random(1,13)<=(6-difficulty),
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
reputation_cost_multipliers = {
friend = 1.0,
neutral = 3.0,
},
goods = {
circuit = {
quantity = 5,
cost = 50,
},
},
trade = {
food = random(1,100) <= 35,
medicine = false,
luxury = random(1,100) < 82,
},
buy = {
[randomMineral()] = math.random(40,200),
},
description = "Shielded circuitry fabrication",
general = "We make a large variety of circuits for numerous ship systems shielded from sensor detection and external control interference",
history = "Our station is named after the law which quantifies the amount of force with which stationary electrically charged particals repel or attact each other - a fundamental principle in the design of our circuits",
},
["Heyes"] = {
weapon_available = {
Homing = random(1,13)<=(8-difficulty),
HVLI = true,
Mine = random(1,13)<=(7-difficulty),
Nuke = random(1,13)<=(5-difficulty),
EMP = random(1,13)<=(6-difficulty),
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
reputation_cost_multipliers = {
friend = 1.0,
neutral = 3.0,
},
goods = {
sensor = {
quantity = 5,
cost = 72,
},
},
trade = {
food = random(1,100) <= 32,
medicine = false,
luxury = true,
},
buy = {
[randomMineral()] = math.random(40,200),
},
description = "Sensor components",
general = "We research and manufacture sensor components and systems",
history = "The station is named after Tony Heyes the inventor of some of the earliest electromagnetic sensors in the mid 20th century on Earth in the United Kingdom to assist blind human mobility",
},
["Hossam"] = {
weapon_available = {
Homing = random(1,13)<=(8-difficulty),
HVLI = random(1,13)<=(9-difficulty),
Mine = random(1,13)<=(7-difficulty),
Nuke = random(1,13)<=(5-difficulty),
EMP = random(1,13)<=(6-difficulty),
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
reputation_cost_multipliers = {
friend = 1.0,
neutral = 3.0,
},
goods = {
nanites = {
quantity = 5,
cost = 90,
},
},
trade = {
food = random(1,100) < 24,
medicine = random(1,100) < 44,
luxury = random(1,100) < 63,
},
description = "Nanite supplier",
general = "We provide nanites for various organic and non-organic systems",
history = "This station is named after the nanotechnologist Hossam Haick from the early 21st century on Earth in Israel",
},
["Maiman"] = {
weapon_available = {
Homing = random(1,13)<=(8-difficulty),
HVLI = false,
Mine = random(1,13)<=(7-difficulty),
Nuke = random(1,13)<=(5-difficulty),
EMP = random(1,13)<=(6-difficulty),
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
reputation_cost_multipliers = {
friend = 1.0,
neutral = 3.0,
},
goods = {
beam = {
quantity = 5,
cost = 70,
},
},
trade = {
food = random(1,100) <= 75,
medicine = true,
luxury = false,
},
buy = {
[randomMineral()] = math.random(40,200),
},
description = "Energy beam components",
general = "We research and manufacture energy beam components and systems",
history = "The station is named after Theodore Maiman who researched and built the first laser in the mid 20th century on Earth",
},
["Malthus"] = {
weapon_available = {
Homing = random(1,13)<=(8-difficulty),
HVLI = random(1,13)<=(9-difficulty),
Mine = random(1,13)<=(7-difficulty),
Nuke = random(1,13)<=(5-difficulty),
EMP = random(1,13)<=(6-difficulty),
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
reputation_cost_multipliers = {
friend = 1.0,
neutral = 3.0,
},
goods = {},
trade = {
food = random(1,100) <= 65,
medicine = false,
luxury = false,
},
description = "Gambling and resupply",
general = "The oldest station in the quadrant",
history = "",
},
["Marconi"] = {
weapon_available = {
Homing = random(1,13)<=(8-difficulty),
HVLI = random(1,13)<=(9-difficulty),
Mine = random(1,13)<=(7-difficulty),
Nuke = random(1,13)<=(5-difficulty),
EMP = random(1,13)<=(6-difficulty),
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
reputation_cost_multipliers = {
friend = 1.0,
neutral = 3.0,
},
goods = {
beam = {
quantity = 5,
cost = 80,
},
},
trade = {
food = random(1,100) <= 53,
medicine = false,
luxury = true,
},
description = "Energy Beam Components",
general = "We manufacture energy beam components",
history = "Station named after Guglielmo Marconi an Italian inventor from early 20th century Earth who, along with Nicolo Tesla, claimed to have invented a death ray or particle beam weapon",
},
["Miller"] = {
weapon_available = {
Homing = random(1,13)<=(8-difficulty),
HVLI = random(1,13)<=(9-difficulty),
Mine = random(1,13)<=(7-difficulty),
Nuke = random(1,13)<=(5-difficulty),
EMP = random(1,13)<=(6-difficulty),
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
reputation_cost_multipliers = {
friend = 1.0,
neutral = 3.0,
},
goods = {
optic = {
quantity = 5,
cost = 60,
},
},
trade = {
food = random(1,100) <= 68,
medicine = false,
luxury = false,
},
description = "Exobiology research",
general = "We study recently discovered life forms not native to Earth",
history = "This station was named after one of the early exobiologists from mid 20th century Earth, Dr. Stanley Miller",
},
["Shawyer"] = {
weapon_available = {
Homing = random(1,13)<=(8-difficulty),
HVLI = random(1,13)<=(9-difficulty),
Mine = random(1,13)<=(7-difficulty),
Nuke = random(1,13)<=(5-difficulty),
EMP = random(1,13)<=(6-difficulty),
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
reputation_cost_multipliers = {
friend = 1.0,
neutral = 2.0,
},
goods = {
impulse = {
quantity = 5,
cost = 100,
},
},
trade = {
food = random(1,100) <= 42,
medicine = false,
luxury = true,
},
description = "Impulse engine components",
general = "We research and manufacture impulse engine components and systems",
history = "The station is named after Roger Shawyer who built the first prototype impulse engine in the early 21st century",
},
},
["History"] = {
["Archimedes"] = {
weapon_available = {
Homing = random(1,13)<=(8-difficulty),
HVLI = random(1,13)<=(9-difficulty),
Mine = random(1,13)<=(7-difficulty),
Nuke = random(1,13)<=(5-difficulty),
EMP = random(1,13)<=(6-difficulty),
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
reputation_cost_multipliers = {
friend = 1.0,
neutral = 3.0,
},
goods = {
beam = {
quantity = 5,
cost = 80,
},
},
trade = {
food = true,
medicine = false,
luxury = true,
},
description = "Energy and particle beam components",
general = "We fabricate general and specialized components for ship beam systems",
history = "This station was named after Archimedes who, according to legend, used a series of adjustable focal length mirrors to focus sunlight on a Roman naval fleet invading Syracuse, setting fire to it",
},
["Chatuchak"] = {
weapon_available = {
Homing = random(1,10)<=(8-difficulty),
HVLI = random(1,10)<=(9-difficulty),
Mine = false,
Nuke = random(1,10)<=(5-difficulty),
EMP = random(1,10)<=(6-difficulty),
},
services = {
supplydrop = "friend",
reinforcements = "friend",
jumpsupplydrop = "friend",
},
service_cost = {
supplydrop = math.random(80,120),
reinforcements = math.random(125,175),
jumpsupplydrop = math.random(110,140),
},
reputation_cost_multipliers = {
friend = 1.0,
neutral = 2.0,
},
goods = {
luxury = {
quantity = 5,
cost = 60,
},
},
trade = {
food = false,
medicine = false,
luxury = false,