-
Notifications
You must be signed in to change notification settings - Fork 6
/
cpu_ship_diversification_scenario_utility.lua
executable file
·2280 lines (2280 loc) · 106 KB
/
cpu_ship_diversification_scenario_utility.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
---------- CPU Ship Diversification Utility ----------
-- Created from a desire to have a more diverse set up ships flying around out there.
-- Some of these are simple tweaks to existing ships. Some are more radically changed.
-- The intent for the armed ships is for them to be mixed in with the stock armed ships.
-- I usually end up creating a list of CPU ship templates:
-- 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},
-- }
-- I order them by relative strength. This is an arbitrary value I give each ship to
-- help create groups of ships that are a consistent degree of difficulty compared to
-- the player ship or ships in the game. It's the create portion that is more
-- interesting in this context. With the templates set up in a list like this with the
-- create function in the list, a ship can be spawned like this:
-- local ship = ship_template[selected_template].create(enemyFaction,selected_template)
-- ...where you specify selected_template and enemyFaction using whatever criteria your
-- scenario requires.
--
-- The ship creation function also adds the ship to the science database.
--
-- No global variables per se, just the function names themselves. These functions were
-- cloned from scenario to scenario until I put them in this document in an effort to
-- reduce the workload on the pull request reviewer.
--
-- Version 2.1
function stockTemplate(enemyFaction,template)
local ship = CpuShip():setFaction(enemyFaction):setTemplate(template)
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
return ship
end
--------------------------------------------------------------------------------------------
-- Additional enemy ships with some modifications from the original template parameters --
--------------------------------------------------------------------------------------------
function atlantisY42(enemyFaction)
--Relative strength reference number: 60
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Atlantis X23")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("Atlantis Y42")
ship:setShieldsMax(300,200,300,200) --stronger shields (vs 200,200,200,200)
ship:setShields(300,200,300,200)
ship:setImpulseMaxSpeed(65) --faster impulse (vs 30)
ship:setRotationMaxSpeed(15) --faster maneuver (vs 3.5)
-- Index, Arc, Dir, Range, Cycle, Damage
ship:setBeamWeapon(2, 80, 190, 1500, 6, 8) --narrower (vs 100)
ship:setBeamWeapon(3, 80, 170, 1500, 6, 8) --extra (vs 3 beams)
ship:setWeaponStorageMax("Homing",16) --more (vs 4)
ship:setWeaponStorage("Homing", 16)
local ships_key = _("scienceDB","Ships")
local corvette_key = _("scienceDB","Corvette")
local y42_key = _("scienceDB","Atlantis Y42")
local atlantis_key = _("scienceDB","Atlantis X23")
local atlantis_y42_db = queryScienceDatabase(ships_key,corvette_key,y42_key)
if atlantis_y42_db == nil then
local corvette_db = queryScienceDatabase(ships_key,corvette_key)
if corvette_db ~= nil then --added for translation issues
corvette_db:addEntry(y42_key)
atlantis_y42_db = queryScienceDatabase(ships_key,corvette_key,y42_key)
local tube_key = _("scienceDB","Tube -90")
local tube2_key = _("scienceDB"," Tube -90")
local tube3_key = _("scienceDB","Tube 90")
local tube4_key = _("scienceDB"," Tube 90")
local load_val = _("scienceDB","10 sec")
addShipToDatabase(
queryScienceDatabase(ships_key,corvette_key,atlantis_key), --base ship database entry
atlantis_y42_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The Atlantis Y42 improves on the Atlantis X23 with stronger shields, faster impulse and turn speeds, an extra beam in back and a larger missile stock"),
{
{key = tube_key, value = load_val}, --torpedo tube direction and load speed
{key = tube2_key, value = load_val}, --torpedo tube direction and load speed
{key = tube3_key, value = load_val}, --torpedo tube direction and load speed
{key = tube4_key, value = load_val}, --torpedo tube direction and load speed
},
"5 - 50 U", --jump range
"battleship_destroyer_1_upgraded"
)
end
end
return ship
end
function barracuda(enemyFaction)
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Phobos T3")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("Barracuda")
ship:setHullMax(200) --stronger hull (vs 70)
ship:setHull(200)
ship:setShieldsMax(200,100,100) --stronger shields (vs 50,40)
ship:setShields(200,100,100)
ship:setImpulseMaxSpeed(75) --faster impulse (vs 60)
ship:setRotationMaxSpeed(15) --faster maneuver (vs 10)
ship:setWeaponTubeCount(16) --more (vs 2)
ship:setWeaponTubeDirection(0, 5):setTubeSize(0, "small"):setTubeLoadTime(0, 8):setWeaponTubeExclusiveFor(0, "Homing")
ship:setWeaponTubeDirection(1, -5):setTubeSize(1, "small"):setTubeLoadTime(1, 8):setWeaponTubeExclusiveFor(1, "Homing")
ship:setWeaponTubeDirection(2, 0):setTubeSize(2, "small"):setTubeLoadTime(2, 7):setWeaponTubeExclusiveFor(2, "Homing")
ship:setWeaponTubeDirection(3, 5):setTubeSize(3, "small"):setTubeLoadTime(3, 6):setWeaponTubeExclusiveFor(3, "EMP")
ship:setWeaponTubeDirection(4, -5):setTubeSize(4, "small"):setTubeLoadTime(4, 6):setWeaponTubeExclusiveFor(4, "EMP")
ship:setWeaponTubeDirection(5, 0):setTubeSize(5, "small"):setTubeLoadTime(5, 5):setWeaponTubeExclusiveFor(5, "EMP")
ship:setWeaponTubeDirection(6, 5):setTubeSize(6, "small"):setTubeLoadTime(6, 9):setWeaponTubeExclusiveFor(6, "Nuke")
ship:setWeaponTubeDirection(7, -5):setTubeSize(7, "small"):setTubeLoadTime(7, 9):setWeaponTubeExclusiveFor(7, "Nuke")
ship:setWeaponTubeDirection(8, 0):setTubeSize(8, "small"):setTubeLoadTime(8, 8):setWeaponTubeExclusiveFor(8, "Nuke")
ship:setWeaponTubeDirection(9, 5):setTubeSize(9, "small"):setTubeLoadTime(9, 4):setWeaponTubeExclusiveFor(9, "HVLI")
ship:setWeaponTubeDirection(10, -5):setTubeSize(10, "small"):setTubeLoadTime(10, 4):setWeaponTubeExclusiveFor(10,"HVLI")
ship:setWeaponTubeDirection(11, 0):setTubeSize(11, "small"):setTubeLoadTime(11, 3):setWeaponTubeExclusiveFor(11,"HVLI")
ship:setWeaponTubeDirection(12,-10):setTubeSize(12, "small"):setTubeLoadTime(12, 5):setWeaponTubeExclusiveFor(12,"HVLI")
ship:setWeaponTubeDirection(13, 10):setTubeSize(13, "small"):setTubeLoadTime(13, 5):setWeaponTubeExclusiveFor(13,"HVLI")
ship:setWeaponTubeDirection(14, 0):setTubeSize(14,"medium"):setTubeLoadTime(14, 5):setWeaponTubeExclusiveFor(14,"Homing")
ship:setWeaponTubeDirection(15, 0):setTubeSize(15,"medium"):setTubeLoadTime(15,10):setWeaponTubeExclusiveFor(15,"Nuke")
ship:setWeaponStorageMax("Homing", 32) --more (vs 6)
ship:setWeaponStorage("Homing", 32)
ship:setWeaponStorageMax("EMP", 20) --more (vs 0)
ship:setWeaponStorage("EMP", 20)
ship:setWeaponStorageMax("Nuke", 18) --more (vs 0)
ship:setWeaponStorage("Nuke", 18)
ship:setWeaponStorageMax("HVLI", 55) --more (vs 12)
ship:setWeaponStorage("HVLI", 55)
local ships_key = _("scienceDB","Ships")
local frigate_key = _("scienceDB","Frigate")
local barracuda_key = _("scienceDB","Barracuda")
local barracuda_db = queryScienceDatabase(ships_key,frigate_key,barracuda_key)
if barracuda_db == nil then
local frigate_db = queryScienceDatabase(ships_key,frigate_key)
if frigate_db ~= nil then
frigate_db:addEntry(barracuda_key)
barracuda_db = queryScienceDatabase(ships_key,frigate_key,barracuda_key)
local small_tubes_0_key = _("scienceDB","Small tubes 0")
local small_tubes_0_val = _("scienceDB","7 sec / Homing, 8 sec / Nuke")
local small_tubes_5_1_key = _("scienceDB","Small tubes 5 & -5")
local small_tubes_5_1_val = _("scienceDB","8 sec / Homing, 9 sec / Nuke")
local small_tube_0_key = _("scienceDB","Small tube 0")
local small_tube_0_val = _("scienceDB","5 sec / EMP")
local small_tubes_5_2_key = _("scienceDB"," Small tubes 5 & -5")
local small_tubes_5_2_val = _("scienceDB","6 sec / EMP")
local small_tube_0_2_key = _("scienceDB"," Small tube 0")
local small_tube_0_2_val = _("scienceDB","3 sec / HVLI")
local small_tubes_5_3_key = _("scienceDB"," Small tubes 5 & -5")
local small_tubes_5_3_val = _("scienceDB","4 sec / HVLI")
local small_tubes_10_key = _("scienceDB","Small tubes 10 & -10")
local small_tubes_10_val = _("scienceDB","5 sec / HVLI")
local tube_0_key = _("scienceDB","Tube 0")
local tube_0_val = _("scienceDB","5 sec / Homing")
local tube_0_2_key = _("scienceDB"," Tube 0")
local tube_0_2_val = _("scienceDB","10 sec / Nuke")
local phobos_t3_key = _("scienceDB","Phobos T3")
addShipToDatabase(
queryScienceDatabase(ships_key,frigate_key,phobos_t3_key), --base ship database entry
barracuda_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The Barracuda started off as a Phobos T3. It was given massive upgrades to shields, hull and missile weapons. The impulse systems were also upgraded. It's designed to spray missiles forth at a prodigious rate.\n\nIt barely qualifies as a frigate, it's more like a mini-corvette."),
{
{key = small_tubes_0_key, value = small_tubes_0_val}, --torpedo tube direction and load speed
{key = small_tubes_5_1_key, value = small_tubes_5_1_val}, --torpedo tube direction and load speed
{key = small_tube_0_key, value = small_tube_0_val}, --torpedo tube direction and load speed
{key = small_tubes_5_2_key, value = small_tubes_5_2_val}, --torpedo tube direction and load speed
{key = small_tube_0_2_key, value = small_tube_0_2_val}, --torpedo tube direction and load speed
{key = small_tubes_5_3_key, value = small_tubes_5_3_val}, --torpedo tube direction and load speed
{key = small_tubes_10_key, value = small_tubes_10_val}, --torpedo tube direction and load speed
{key = tube_0_key, value = tube_0_val}, --torpedo tube direction and load speed
{key = tube_0_2_key, value = tube_0_2_val}, --torpedo tube direction and load speed
},
nil, --jump range
"AtlasHeavyFighterYellow"
)
end
end
return ship
end
function cruiserdrone(enemyFaction)
--Relative strength reference number: 23
--courtesy of Black Wall scenario
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Cruiser")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
local cruiserdrone_key = _("scienceDB","Cruiser Drone")
ship:setTypeName(cruiserdrone_key)
ship:setHullMax(80):setHull(80) -- stronger (vs 70)
ship:setShieldsMax(60, 60):setShields(60, 60) -- stronger (vs 40,40)
ship:setImpulseMaxSpeed(70) -- faster (vs 60)
ship:setRotationMaxSpeed(15) -- faster spin (vs 6)
local ships_key = _("scienceDB","Ships")
local frigate_key = _("scienceDB","Frigate")
local cruiser_key = _("scienceDB","Cruiser")
local cruiserdrone_db = queryScienceDatabase(ships_key,frigate_key,cruiserdrone_key)
if cruiserdrone_db == nil then
local ships_db = queryScienceDatabase(ships_key)
if ships_db == nil then
ships_db = ScienceDatabase():setName(ships_key)
ships_db = queryScienceDatabase(ships_key)
end
local frigate_db = queryScienceDatabase(ships_key,frigate_key)
if frigate_db == nil then
frigate_db = ships_db:addEntry(frigate_key)
frigate_db = queryScienceDatabase(ships_key,frigate_key)
end
frigate_db:addEntry(cruiserdrone_key)
cruiserdrone_db = queryScienceDatabase(ships_key,frigate_key,cruiserdrone_key)
addShipToDatabase(
queryScienceDatabase(ships_key,frigate_key,cruiser_key), --base ship database entry
cruiserdrone_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","A standard cruiser modifed for target practice purposes: stronger hull and shields, faster impulse and better maneuverability. Some of these may have slipped out of the automated manufacturing facility to be refurbished for actual militia use."),
nil, --tube info
nil, --jump
"small_frigate_4"
)
end
return ship
end
function cucaracha(enemyFaction)
--Relative strength reference number: 36
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Tug")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("Cucaracha")
ship:setShieldsMax(200, 50, 50, 50, 50, 50) --stronger shields (vs 20)
ship:setShields(200, 50, 50, 50, 50, 50)
ship:setHullMax(100) --stronger hull (vs 50)
ship:setHull(100)
ship:setRotationMaxSpeed(20) --faster maneuver (vs 10)
ship:setAcceleration(30) --faster acceleration (vs 15)
-- Index, Arc, Dir, Range, Cycle, Damage
ship:setBeamWeapon(0, 60, 0, 1500, 6, 10) --extra rear facing beam
local ships_key = _("scienceDB","Ships")
local no_class_key = _("scienceDB","No Class")
local cucaracha_key = _("scienceDB","Cucaracha")
local tug_key = _("scienceDB","Tug")
local cucaracha_db = queryScienceDatabase(ships_key,no_class_key,cucaracha_key)
if cucaracha_db == nil then
local no_class_db = queryScienceDatabase(ships_key,no_class_key)
if no_class_db ~= nil then --added for translation issues
no_class_db:addEntry(cucaracha_key)
cucaracha_db = queryScienceDatabase(ships_key,no_class_key,cucaracha_key)
addShipToDatabase(
queryScienceDatabase(ships_key,no_class_key,tug_key), --base ship database entry
cucaracha_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The Cucaracha is a quick ship built around the Tug model with heavy shields and a heavy beam designed to be difficult to squash"),
nil,
nil, --jump range
"space_tug"
)
end
end
return ship
end
function dreadnought2(enemyFaction)
--courtesy of Black Wall scenario
--Relative strength reference number: 85
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Dreadnought")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
local dreadnought2_key = _("scienceDB","Dreadnought II")
ship:setTypeName(dreadnought2_key)
ship:setHullMax(200):setHull(200) --stronger (vs 70)
ship:setShieldsMax(100, 100, 100, 100, 100) --weaker (vs 300x5)
ship:setImpulseMaxSpeed(90) --faster (vs 30)
ship:setRotationMaxSpeed(4) --faster (vs 1.5)
ship:setWeaponTubeCount(1) --more (vs 0)
ship:setTubeLoadTime(0, 15)
ship:setWeaponStorageMax("Homing", 8):setWeaponStorage("Homing", 8)
local ships_key = _("scienceDB","Ships")
local dreadnought_class_key = _("scienceDB","Dreadnought")
local dreadnought_ship_key = _("scienceDB","Dreadnought")
local dreadnought2_db = queryScienceDatabase(ships_key,dreadnought_class_key,dreadnought2_key)
if dreadnought2_db == nil then
local ships_db = queryScienceDatabase(ships_key)
if ships_db == nil then
ships_db = ScienceDatabase():setName(ships_key)
ships_db = queryScienceDatabase(ships_key)
end
local dreadnought_class_db = queryScienceDatabase(ships_key,dreadnought_class_key)
if dreadnought_class_db == nil then
dreadnought_class_db = ships_db:addEntry(dreadnought_class_key)
dreadnought_class_db = queryScienceDatabase(ships_key,dreadnought_class_key)
end
dreadnought_class_db:addEntry(dreadnought2_key)
dreadnought2_db = queryScienceDatabase(ships_key,dreadnought_class_key,dreadnought2_key)
local tube_key = _("scienceDB","Tube 0")
local load_val = _("scienceDB","15 sec")
addShipToDatabase(
queryScienceDatabase(ships_key,dreadnought_class_key,dreadnought_ship_key), --base ship database entry
dreadnought2_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","A modified Dreadnought: stronger hull, weaker shields, ~3x faster impulse and turn speeds. A tube that shoots homing missiles has been added.\n\nDon't forget to thank your science database librarian for making this information available. She likes cookies."),
{
{key = tube_key, value = load_val}, --torpedo tube direction and load speed
},
nil, --jump
"battleship_destroyer_1_upgraded"
)
end
return ship
end
function droneHeavy(enemyFaction)
--Relative strength reference number: 5
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Ktlitan Drone")
ship:setTypeName("Heavy Drone")
ship:setHullMax(40) --stronger hull (vs 30)
ship:setHull(40)
ship:setImpulseMaxSpeed(110) --slower impulse (vs 120)
ship:setBeamWeapon(0,40,0,600,4,8) --stronger (vs 6) beam
local ships_key = _("scienceDB","Ships")
local no_class_key = _("scienceDB","No Class")
local heavy_drone_key = _("scienceDB","Heavy Drone")
local ktlitan_key = _("scienceDB","Ktlitan Drone")
local drone_heavy_db = queryScienceDatabase(ships_key,no_class_key,heavy_drone_key)
if drone_heavy_db == nil then
local no_class_db = queryScienceDatabase(ships_key,no_class_key)
if no_class_db ~= nil then --added for translation issues
no_class_db:addEntry(heavy_drone_key)
drone_heavy_db = queryScienceDatabase(ships_key,no_class_key,heavy_drone_key)
addShipToDatabase(
queryScienceDatabase(ships_key,no_class_key,ktlitan_key), --base ship database entry
drone_heavy_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The heavy drone has a stronger hull and a stronger beam than the normal Ktlitan Drone, but it also moves slower"),
nil, --misc key value pairs
nil, --jump
"sci_fi_alien_ship_4"
)
end
end
return ship
end
function droneJacket(enemyFaction)
--Relative strength reference number: 4
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Ktlitan Drone")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("Jacket Drone")
ship:setShieldsMax(20) --stronger shields (vs none)
ship:setShields(20)
ship:setImpulseMaxSpeed(110) --slower impulse (vs 120)
ship:setBeamWeapon(0,40,0,600,4,4) --weaker (vs 6) beam
local ships_key = _("scienceDB","Ships")
local no_class_key = _("scienceDB","No Class")
local jacket_drone_key = _("scienceDB","Jacket Drone")
local ktlitan_key = _("scienceDB","Ktlitan Drone")
local drone_jacket_db = queryScienceDatabase(ships_key,no_class_key,jacket_drone_key)
if drone_jacket_db == nil then
local no_class_db = queryScienceDatabase(ships_key,no_class_key)
if no_class_db ~= nil then --added for translation issues
no_class_db:addEntry(jacket_drone_key)
drone_jacket_db = queryScienceDatabase(ships_key,no_class_key,jacket_drone_key)
addShipToDatabase(
queryScienceDatabase(ships_key,no_class_key,ktlitan_key), --base ship database entry
drone_jacket_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The Jacket Drone is a Ktlitan Drone with a shield. It's also slightly slower and has a slightly weaker beam due to the energy requirements of the added shield"),
nil, --misc key value pairs
nil, --jump
"sci_fi_alien_ship_4"
)
end
end
return ship
end
function droneLite(enemyFaction)
--Relative strength reference number: 3
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Ktlitan Drone")
ship:setTypeName("Lite Drone")
ship:setHullMax(20) --weaker hull (vs 30)
ship:setHull(20)
ship:setImpulseMaxSpeed(130) --faster impulse (vs 120)
ship:setRotationMaxSpeed(20) --faster maneuver (vs 10)
ship:setBeamWeapon(0,40,0,600,4,4) --weaker (vs 6) beam
local ships_key = _("scienceDB","Ships")
local no_class_key = _("scienceDB","No Class")
local lite_drone_key = _("scienceDB","Lite Drone")
local ktlitan_key = _("scienceDB","Ktlitan Drone")
local drone_lite_db = queryScienceDatabase(ships_key,no_class_key,lite_drone_key)
if drone_lite_db == nil then
local no_class_db = queryScienceDatabase(ships_key,no_class_key)
if no_class_db ~= nil then --added for translation issues
no_class_db:addEntry(lite_drone_key)
drone_lite_db = queryScienceDatabase(ships_key,no_class_key,lite_drone_key)
addShipToDatabase(
queryScienceDatabase(ships_key,no_class_key,ktlitan_key), --base ship database entry
drone_lite_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The light drone was pieced together from scavenged parts of various damaged Ktlitan drones. Compared to the Ktlitan drone, the lite drone has a weaker hull, and a weaker beam, but a faster turn and impulse speed"),
nil, --misc key value pairs
nil, --jump
"sci_fi_alien_ship_4"
)
end
end
return ship
end
function enforcer(enemyFaction)
--Relative strength reference number: 75
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Blockade Runner")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("Enforcer")
ship:setRadarTrace("ktlitan_destroyer.png") --different radar trace
ship:setWarpDrive(true) --warp (vs none)
ship:setWarpSpeed(600)
ship:setImpulseMaxSpeed(100) --faster impulse (vs 60)
ship:setRotationMaxSpeed(20) --faster maneuver (vs 15)
ship:setShieldsMax(200,100,100) --stronger shields (vs 100,150)
ship:setShields(200,100,100)
ship:setHullMax(100) --stronger hull (vs 70)
ship:setHull(100)
-- Index, Arc, Dir, Range, Cycle, Damage
ship:setBeamWeapon(0, 30, 5, 1500, 6, 10) --narrower (vs 60), longer (vs 1000), stronger (vs 8)
ship:setBeamWeapon(1, 30, -5, 1500, 6, 10)
ship:setBeamWeapon(2, 0, 0, 0, 0, 0) --fewer (vs 4)
ship:setBeamWeapon(3, 0, 0, 0, 0, 0)
ship:setWeaponTubeCount(3) --more (vs 0)
ship:setTubeSize(0,"large") --large (vs normal)
ship:setWeaponTubeDirection(1,-15)
ship:setWeaponTubeDirection(2, 15)
ship:setTubeLoadTime(0,18)
ship:setTubeLoadTime(1,12)
ship:setTubeLoadTime(2,12)
ship:setWeaponStorageMax("Homing",18) --more (vs 0)
ship:setWeaponStorage("Homing", 18)
local ships_key = _("scienceDB","Ships")
local frigate_key = _("scienceDB","Frigate")
local enforcer_key = _("scienceDB","Enforcer")
local blockade_runner_key = _("scienceDB","Blockade Runner")
local enforcer_db = queryScienceDatabase(ships_key,frigate_key,enforcer_key)
if enforcer_db == nil then
local frigate_db = queryScienceDatabase(ships_key,frigate_key)
if frigate_db ~= nil then --added for translation issues
frigate_db:addEntry(enforcer_key)
enforcer_db = queryScienceDatabase(ships_key,frigate_key,enforcer_key)
local tube_key = _("scienceDB","Large tube 0")
local tube2_key = _("scienceDB","Tube -15")
local tube3_key = _("scienceDB","Tube 15")
local load_val = _("scienceDB","18 sec")
local load2_val = _("scienceDB","12 sec")
addShipToDatabase(
queryScienceDatabase(ships_key,frigate_key,blockade_runner_key), --base ship database entry
enforcer_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The Enforcer is a highly modified Blockade Runner. A warp drive was added and impulse engines boosted along with turning speed. Three missile tubes were added to shoot homing missiles, large ones straight ahead. Stronger shields and hull. Removed rear facing beams and strengthened front beams."),
{
{key = tube_key, value = load_val}, --torpedo tube direction and load speed
{key = tube2_key, value = load2_val}, --torpedo tube direction and load speed
{key = tube3_key, value = load2_val}, --torpedo tube direction and load speed
},
nil, --jump
"battleship_destroyer_3_upgraded"
)
enforcer_db:setImage("radar/ktlitan_destroyer.png") --override default radar image
end
end
return ship
end
function farco3(enemyFaction)
--Relative strength reference number: 16
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Phobos T3")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("Farco 3")
ship:setShieldsMax(60, 40) --stronger shields (vs 50, 40)
ship:setShields(60, 40)
-- Index, Arc, Dir, Range, Cycle, Damage
ship:setBeamWeapon(0, 90, -15, 1500, 5.0, 6.0) --longer (vs 1200), faster (vs 8)
ship:setBeamWeapon(1, 90, 15, 1500, 5.0, 6.0)
local ships_key = _("scienceDB","Ships")
local frigate_key = _("scienceDB","Frigate")
local farco_key = _("scienceDB","Farco 3")
local phobos_key = _("scienceDB","Phobos T3")
local farco_3_db = queryScienceDatabase(ships_key,frigate_key,farco_key)
if farco_3_db == nil then
local frigate_db = queryScienceDatabase(ships_key,frigate_key)
if frigate_db ~= nil then --added for translation issues
frigate_db:addEntry(farco_key)
farco_3_db = queryScienceDatabase(ships_key,frigate_key,farco_key)
local tube_key = _("scienceDB","Tube -1")
local tube2_key = _("scienceDB","Tube 1")
local load_val = _("scienceDB","60 sec")
addShipToDatabase(
queryScienceDatabase(ships_key,frigate_key,phobos_key), --base ship database entry
farco_3_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The Farco models are evolutionary changes to the Phobos T3. In the case of the Farco 3, the beams are longer and faster and the shields are slightly stronger."),
{
{key = tube_key, value = load_val}, --torpedo tube direction and load speed
{key = tube2_key, value = load_val}, --torpedo tube direction and load speed
},
nil, --jump range
"AtlasHeavyFighterYellow"
)
end
end
return ship
end
function farco5(enemyFaction)
--Relative strength reference number: 16
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Phobos T3")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("Farco 5")
ship:setShieldsMax(60, 40) --stronger shields (vs 50, 40)
ship:setShields(60, 40)
ship:setTubeLoadTime(0,30) --faster (vs 60)
ship:setTubeLoadTime(0,30)
local ships_key = _("scienceDB","Ships")
local frigate_key = _("scienceDB","Frigate")
local farco_key = _("scienceDB","Farco 5")
local phobos_key = _("scienceDB","Phobos T3")
local farco_5_db = queryScienceDatabase(ships_key,frigate_key,farco_key)
if farco_5_db == nil then
local frigate_db = queryScienceDatabase(ships_key,frigate_key)
if frigate_db ~= nil then --added for translation issues
frigate_db:addEntry(farco_key)
farco_5_db = queryScienceDatabase(ships_key,frigate_key,farco_key)
local tube_key = _("scienceDB","Tube -1")
local tube2_key = _("scienceDB","Tube 1")
local load_val = _("scienceDB","30 sec")
addShipToDatabase(
queryScienceDatabase(ships_key,frigate_key,phobos_key), --base ship database entry
farco_5_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The Farco models are evolutionary changes to the Phobos T3. In the case of the Farco 5, the tubes load faster and the shields are slightly stronger."),
{
{key = tube_key, value = load_val}, --torpedo tube direction and load speed
{key = tube2_key, value = load_val}, --torpedo tube direction and load speed
},
nil, --jump range
"AtlasHeavyFighterYellow"
)
end
end
return ship
end
function farco8(enemyFaction)
--Relative strength reference number: 19
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Phobos T3")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("Farco 8")
ship:setShieldsMax(80, 50) --stronger shields (vs 50, 40)
ship:setShields(80, 50)
-- Index, Arc, Dir, Range, Cycle, Damage
ship:setBeamWeapon(0, 90, -15, 1500, 5.0, 6.0) --longer (vs 1200), faster (vs 8)
ship:setBeamWeapon(1, 90, 15, 1500, 5.0, 6.0)
ship:setTubeLoadTime(0,30) --faster (vs 60)
ship:setTubeLoadTime(0,30)
local ships_key = _("scienceDB","Ships")
local frigate_key = _("scienceDB","Frigate")
local farco_key = _("scienceDB","Farco 8")
local phobos_key = _("scienceDB","Phobos T3")
local farco_8_db = queryScienceDatabase(ships_key,frigate_key,farco_key)
if farco_8_db == nil then
local frigate_db = queryScienceDatabase(ships_key,frigate_key)
if frigate_db ~= nil then --added for translation issues
frigate_db:addEntry(farco_key)
farco_8_db = queryScienceDatabase(ships_key,frigate_key,farco_key)
local tube_key = _("scienceDB","Tube -1")
local tube2_key = _("scienceDB","Tube 1")
local load_val = _("scienceDB","30 sec")
addShipToDatabase(
queryScienceDatabase(ships_key,frigate_key,phobos_key), --base ship database entry
farco_8_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The Farco models are evolutionary changes to the Phobos T3. In the case of the Farco 8, the beams are longer and faster, the tubes load faster and the shields are stronger."),
{
{key = tube_key, value = load_val}, --torpedo tube direction and load speed
{key = tube2_key, value = load_val}, --torpedo tube direction and load speed
},
nil, --jump range
"AtlasHeavyFighterYellow"
)
end
end
return ship
end
function farco11(enemyFaction)
--Relative strength reference number: 21
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Phobos T3")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("Farco 11")
ship:setShieldsMax(80, 50) --stronger shields (vs 50, 40)
ship:setShields(80, 50)
ship:setRotationMaxSpeed(15) --faster maneuver (vs 10)
-- Index, Arc, Dir, Range, Cycle, Damage
ship:setBeamWeapon(0, 90, -15, 1500, 5.0, 6.0) --longer (vs 1200), faster (vs 8)
ship:setBeamWeapon(1, 90, 15, 1500, 5.0, 6.0)
ship:setBeamWeapon(2, 20, 0, 1800, 5.0, 4.0) --additional sniping beam
local ships_key = _("scienceDB","Ships")
local frigate_key = _("scienceDB","Frigate")
local farco_key = _("scienceDB","Farco 11")
local phobos_key = _("scienceDB","Phobos T3")
local farco_11_db = queryScienceDatabase(ships_key,frigate_key,farco_key)
if farco_11_db == nil then
local frigate_db = queryScienceDatabase(ships_key,frigate_key)
if frigate_db ~= nil then --added for translation issues
frigate_db:addEntry(farco_key)
farco_11_db = queryScienceDatabase(ships_key,frigate_key,farco_key)
local tube_key = _("scienceDB","Tube -1")
local tube2_key = _("scienceDB","Tube 1")
local load_val = _("scienceDB","60 sec")
addShipToDatabase(
queryScienceDatabase(ships_key,frigate_key,phobos_key), --base ship database entry
farco_11_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The Farco models are evolutionary changes to the Phobos T3. In the case of the Farco 11, the maneuver speed is faster, the beams are longer and faster, there's an added longer sniping beam and the shields are stronger."),
{
{key = tube_key, value = load_val}, --torpedo tube direction and load speed
{key = tube2_key, value = load_val}, --torpedo tube direction and load speed
},
nil, --jump range
"AtlasHeavyFighterYellow"
)
end
end
return ship
end
function farco13(enemyFaction)
--Relative strength reference number: 24
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Phobos T3")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("Farco 13")
ship:setShieldsMax(90, 70) --stronger shields (vs 50, 40)
ship:setShields(90, 70)
ship:setRotationMaxSpeed(15) --faster maneuver (vs 10)
-- Index, Arc, Dir, Range, Cycle, Damage
ship:setBeamWeapon(0, 90, -15, 1500, 5.0, 6.0) --longer (vs 1200), faster (vs 8)
ship:setBeamWeapon(1, 90, 15, 1500, 5.0, 6.0)
ship:setBeamWeapon(2, 20, 0, 1800, 5.0, 4.0) --additional sniping beam
ship:setTubeLoadTime(0,30) --faster (vs 60)
ship:setTubeLoadTime(0,30)
ship:setWeaponStorageMax("Homing",16) --more (vs 6)
ship:setWeaponStorage("Homing", 16)
ship:setWeaponStorageMax("HVLI",30) --more (vs 20)
ship:setWeaponStorage("HVLI", 30)
local ships_key = _("scienceDB","Ships")
local frigate_key = _("scienceDB","Frigate")
local farco_key = _("scienceDB","Farco 13")
local phobos_key = _("scienceDB","Phobos T3")
local farco_13_db = queryScienceDatabase(ships_key,frigate_key,farco_key)
if farco_13_db == nil then
local frigate_db = queryScienceDatabase(ships_key,frigate_key)
if frigate_db ~= nil then --added for translation issues
frigate_db:addEntry(farco_key)
farco_13_db = queryScienceDatabase(ships_key,frigate_key,farco_key)
local tube_key = _("scienceDB","Tube -1")
local tube2_key = _("scienceDB","Tube 1")
local load_val = _("scienceDB","30 sec")
addShipToDatabase(
queryScienceDatabase(ships_key,frigate_key,phobos_key), --base ship database entry
farco_13_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The Farco models are evolutionary changes to the Phobos T3. In the case of the Farco 13, the maneuver speed is faster, the beams are longer and faster, there's an added longer sniping beam, the tubes load faster, there are more missiles and the shields are stronger."),
{
{key = tube_key, value = load_val}, --torpedo tube direction and load speed
{key = tube2_key, value = load_val}, --torpedo tube direction and load speed
},
nil, --jump range
"AtlasHeavyFighterYellow"
)
end
end
return ship
end
function fighter2(enemyFaction)
--courtesy of Black Wall scenario
--Relative strength reference number: 9
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Fighter")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
local fighter2_key = _("scienceDB","Fighter II")
ship:setTypeName(fighter2_key)
ship:setBeamWeapon(0, 60, 0, 1000.0, 4.0, 6) --more damage (vs 4)
ship:setHullMax(60):setHull(60) --stronger hull (vs 30)
ship:setShieldsMax(50):setShields(50) --stronger shields (vs 30)
ship:setImpulseMaxSpeed(100) --slower impulse (vs 120)
ship:setWeaponTubeCount(1) --more tubes (vs 0)
ship:setTubeLoadTime(0, 8)
ship:setWeaponStorageMax("Homing", 2):setWeaponStorage("Homing", 2)
local ships_key = _("scienceDB","Ships")
local starfighter_key = _("scienceDB","Starfighter")
local fighter_key = _("scienceDB","Fighter")
local fighter2_db = queryScienceDatabase(ships_key,starfighter_key,fighter2_key)
if fighter2_db == nil then
local ships_db = queryScienceDatabase(ships_key)
if ships_db == nil then
ships_db = ScienceDatabase():setName(ships_key)
ships_db = queryScienceDatabase(ships_key)
end
local starfighter_db = queryScienceDatabase(ships_key,starfighter_key)
if starfighter_db == nil then
starfighter_db = ships_db:addEntry(starfighter_key)
starfighter_db = queryScienceDatabase(ships_key,starfighter_key)
end
starfighter_db:addEntry(fighter2_key)
fighter2_db = queryScienceDatabase(ships_key,starfighter_key,fighter2_key)
local tube_key = _("scienceDB","Tube 0")
local load_val = _("scienceDB","8 sec")
addShipToDatabase(
queryScienceDatabase(ships_key,starfighter_key,fighter_key), --base ship database entry
fighter2_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","Fighters are quick, agile ships that do not do a lot of damage, but usually come in larger groups. They are easy to take out, but should not be underestimated. The Fighter II is a more powerful version with stronger beams, hull and shields and an added homing missile tube. All those additions make it a bit slower, though.\n\nGive your science database librarian a big smile. She works hard for you."),
{
{key = tube_key, value = load_val}, --torpedo tube direction and load speed
},
nil, --jump
"small_fighter_1"
)
end
return ship
end
function gnat(enemyFaction)
--Relative strength reference number: 2
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Ktlitan Drone")
ship:setTypeName("Gnat")
ship:setHullMax(15) --weaker hull (vs 30)
ship:setHull(15)
ship:setImpulseMaxSpeed(140) --faster impulse (vs 120)
ship:setRotationMaxSpeed(25) --faster maneuver (vs 10)
-- Index, Arc, Dir, Range, Cycle, Damage
ship:setBeamWeapon(0, 40, 0, 600, 4, 3) --weaker (vs 6) beam
local ships_key = _("scienceDB","Ships")
local no_class_key = _("scienceDB","No Class")
local gnat_key = _("scienceDB","Gnat")
local ktlitan_key = _("scienceDB","Ktlitan Drone")
local gnat_db = queryScienceDatabase(ships_key,no_class_key,gnat_key)
if gnat_db == nil then
local no_class_db = queryScienceDatabase(ships_key,no_class_key)
if no_class_db ~= nil then --added for translation issues
no_class_db:addEntry(gnat_key)
gnat_db = queryScienceDatabase(ships_key,no_class_key,gnat_key)
addShipToDatabase(
queryScienceDatabase(ships_key,no_class_key,ktlitan_key), --base ship database entry
gnat_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The Gnat is a nimbler version of the Ktlitan Drone. It's got half the hull, but it moves and turns faster"),
nil, --misc key value pairs
nil, --jump range
"sci_fi_alien_ship_4"
)
end
end
return ship
end
function gunship2(enemyFaction)
--courtesy of Black Wall scenario
--Relative strength reference number: 20
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Adv. Gunship")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
local gunship2_key = _("scienceDB","Gunship II")
ship:setTypeName(gunship2_key)
ship:setBeamWeapon(0, 50,-15, 1000.0, 6.0, 10) --more damage (vs 8)
ship:setBeamWeapon(1, 50, 15, 1000.0, 6.0, 10)
ship:setHullMax(90):setHull(90) --weaker hull (vs 100)
local ships_key = _("scienceDB","Ships")
local frigate_key = _("scienceDB","Frigate")
local adv_gunship_key = _("scienceDB","Adv. Gunship")
local gunship2_db = queryScienceDatabase(ships_key,frigate_key,gunship2_key)
if gunship2_db == nil then
local ships_db = queryScienceDatabase(ships_key)
if ships_db == nil then
ships_db = ScienceDatabase():setName(ships_key)
ships_db = queryScienceDatabase(ships_key)
end
local frigate_db = queryScienceDatabase(ships_key,frigate_key)
if frigate_db == nil then
frigate_db = ships_db:addEntry(frigate_key)
frigate_db = queryScienceDatabase(ships_key,frigate_key)
end
frigate_db:addEntry(gunship2_key)
gunship2_db = queryScienceDatabase(ships_key,frigate_key,gunship2_key)
local tube_key = _("scienceDB","Tube 0")
local tube2_key = _("scienceDB"," Tube 0")
local load_val = _("scienceDB","8 sec")
addShipToDatabase(
queryScienceDatabase(ships_key,frigate_key,adv_gunship_key), --base ship database entry
gunship2_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The advanced gunship is a ship equiped with 2 homing missiles to do initial damage and then take out the enemy with 2 front firing beams. It's designed to quickly take out the enemies weaker then itself. Version II has stronger beams, but a weaker hull.\n\nDon't forget to tip your science database librarian."),
{
{key = tube_key, value = load_val}, --torpedo tube direction and load speed
{key = tube2_key, value = load_val}, --torpedo tube direction and load speed
},
nil, --jump
"battleship_destroyer_4_upgraded"
)
end
return ship
end
function hornetFX64(enemyFaction)
--Relative strength reference number: 8
local ship = CpuShip():setFaction(enemyFaction):setTemplate("MT52 Hornet")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("FX64 Hornet")
ship:setBeamWeapon(0, 15, 0, 1500.0, 4.0, 6.0) --longer and stronger beam (vs 700 & 2)
ship:setRotationMaxSpeed(43) --faster maneuver (vs 30)
ship:setImpulseMaxSpeed(180) --faster impulse (vs 120)
ship:setHullMax(20) --weaker hull (vs 30)
ship:setHull(20)
local ships_key = _("scienceDB","Ships")
local starfighter_key = _("scienceDB","Starfighter")
local fx64_hornet_key = _("scienceDB","FX64 Hornet")
local hornet_key = _("scienceDB","MT52 Hornet")
local hornet_fx64_db = queryScienceDatabase(ships_key,starfighter_key,fx64_hornet_key)
if hornet_fx64_db == nil then
local starfighter_db = queryScienceDatabase(ships_key,starfighter_key)
if starfighter_db ~= nil then --added for translation issues
starfighter_db:addEntry(fx64_hornet_key)
hornet_fx64_db = queryScienceDatabase(ships_key,starfighter_key,fx64_hornet_key)
addShipToDatabase(
queryScienceDatabase(ships_key,starfighter_key,hornet_key), --base ship database entry
hornet_fx64_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The FX64 Hornet is somewhat similar to the MT52 and MU52 models. The beam is longer, narrower and does more damage than both of the other Hornet models. It's max impulse speed and turn speed is faster than both of the other Hornet models. It's hull is weaker"),
nil, --misc key value pairs
nil, --jump
"WespeScoutYellow"
)
end
end
return ship
end
function hornetMT55(enemyFaction)
--Relative strength reference number: 6
local ship = CpuShip():setFaction(enemyFaction):setTemplate("MT52 Hornet"):orderRoaming()
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("MT55 Hornet")
ship:setRotationMaxSpeed(29) --slower maneuver (vs 30)
ship:setImpulseMaxSpeed(135) --faster impulse (vs 120)
ship:setAcceleration(40) --faster acceleration (vs 25)
local ships_key = _("scienceDB","Ships")
local starfighter_key = _("scienceDB","Starfighter")
local mt55_hornet_key = _("scienceDB","MT55 Hornet")
local hornet_key = _("scienceDB","MT52 Hornet")
local hornet_mt55_db = queryScienceDatabase(ships_key,starfighter_key,mt55_hornet_key)
if hornet_mt55_db == nil then
local starfighter_db = queryScienceDatabase(ships_key,starfighter_key)
if starfighter_db ~= nil then
starfighter_db:addEntry(mt55_hornet_key)
hornet_mt55_db = queryScienceDatabase(ships_key,starfighter_key,mt55_hornet_key)
addShipToDatabase(
queryScienceDatabase(ships_key,starfighter_key,hornet_key), --base ship database entry
hornet_mt55_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The MT55 Hornet is similar to the 52 series Hornet models. Its speed is faster but it turns more slowly"),
nil,
nil,
"WespeScoutYellow"
)
end
end
return ship
end
function hornetMV52(enemyFaction)
--Relative strength reference number: 6
local ship = CpuShip():setFaction(enemyFaction):setTemplate("MT52 Hornet")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("MV52 Hornet")
ship:setBeamWeapon(0, 30, 0, 1000.0, 4.0, 3.0) --longer and stronger beam (vs 700 & 2)
ship:setRotationMaxSpeed(31) --faster maneuver (vs 30)
ship:setImpulseMaxSpeed(130) --faster impulse (vs 120)
local ships_key = _("scienceDB","Ships")
local starfighter_key = _("scienceDB","Starfighter")
local mv52_hornet_key = _("scienceDB","MV52 Hornet")
local hornet_key = _("scienceDB","MT52 Hornet")
local hornet_mv52_db = queryScienceDatabase(ships_key,starfighter_key,mv52_hornet_key)
if hornet_mv52_db == nil then
local starfighter_db = queryScienceDatabase(ships_key,starfighter_key)
if starfighter_db ~= nil then --added for translation issues
starfighter_db:addEntry(mv52_hornet_key)
hornet_mv52_db = queryScienceDatabase(ships_key,starfighter_key,mv52_hornet_key)
addShipToDatabase(
queryScienceDatabase(ships_key,starfighter_key,hornet_key), --base ship database entry
hornet_mv52_db, --modified ship database entry
ship, --ship just created, long description on the next line
_("scienceDB","The MV52 Hornet is very similar to the MT52 and MU52 models. The beam does more damage than both of the other Hornet models, it's max impulse speed is faster than both of the other Hornet models, it turns faster than the MT52, but slower than the MU52"),
nil, --misc key value pairs
nil, --jump
"WespeScoutYellow"
)
end
end
return ship
end
function hurricane(enemyFaction)
--Relative strength reference number: 46
local ship = CpuShip():setFaction(enemyFaction):setTemplate("Piranha F8")
ship:onTakingDamage(function(self,instigator)
string.format("") --serious proton needs a global context
if instigator ~= nil then
self.damage_instigator = instigator
end
end)
ship:setTypeName("Hurricane")
ship:setJumpDrive(true)
ship:setJumpDriveRange(5000,40000)
ship:setWeaponTubeCount(8) --more (vs 3)
ship:setWeaponTubeExclusiveFor(1,"HVLI") --only HVLI (vs any)
ship:setWeaponTubeDirection(1, 0) --forward (vs -90)
ship:setTubeSize(3,"large")
ship:setWeaponTubeDirection(3,-90)
ship:setTubeSize(4,"small")
ship:setWeaponTubeExclusiveFor(4,"Homing")
ship:setWeaponTubeDirection(4,-15)
ship:setTubeSize(5,"small")
ship:setWeaponTubeExclusiveFor(5,"Homing")
ship:setWeaponTubeDirection(5, 15)
ship:setWeaponTubeExclusiveFor(6,"Homing")
ship:setWeaponTubeDirection(6,-30)
ship:setWeaponTubeExclusiveFor(7,"Homing")
ship:setWeaponTubeDirection(7, 30)
ship:setWeaponStorageMax("Homing",24) --more (vs 5)
ship:setWeaponStorage("Homing", 24)
local ships_key = _("scienceDB","Ships")
local frigate_key = _("scienceDB","Frigate")
local hurricane_key = _("scienceDB","Hurricane")
local pirahna_key = _("scienceDB","Piranha F8")
local hurricane_db = queryScienceDatabase(ships_key,frigate_key,hurricane_key)
if hurricane_db == nil then
local frigate_db = queryScienceDatabase(ships_key,frigate_key)
if frigate_db ~= nil then --added for translation issues