-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.cs
10167 lines (9545 loc) · 403 KB
/
Form1.cs
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using iTextSharp.text.pdf;
using System.IO;
using System.Collections;
namespace Starfinder_Starship_Hanger
{
public partial class Form1 : Form
{
// All Global Variables
#region Global Variables
public int totalBPCount = 0; // Count of Total Build Points for a Ship
public static int BP;
public int spentBPCount = 0; // Count of BP spent
public int totalPCUCount = 0; // Count of Total Power Core Units Available
public static int PCU;
public int spentPCUCount = 0; // Count of Total Power Core Units Spent
public string shipTier; // Ship Tier
public string shipSize; // Ship Size
public int shipSizeInt = 0; // Ship Size Integer Representation
public int shipSizeMod = 0; // Ship Size Modifier
public string shipFrame; // Ship Frame
public int expBayNum = 0; // Number of Expansion Bays
public int expBPSpent = 0; // Number of Expansion Bay Build Points Spent
public int shipPCURating = 0; // Total Ship Power Core Rating
public int shipSpeed = 0; // Ship Speed
public int pilotingModAdj; // Piloting Modifer Adjusted
public int pilotingMod; // Piloting Modifer
public int ac = 10; // Base Armor Class
public int tl = 10; // Base Target Lock
public int hp = 0; // Hull Points
public int dt = 0; // Damage Threshold
public int ct = 0; // Critical Threshold
public int pilotRanks = 0; // Denotes the amount of training the pilot has.
public bool core2next = false; // Boolean to track whether or not the second power core is selected next.
public bool securitynext = false; // Boolean to track whether or not Security Options are selected next.
public int computerTier = 0; // Integer to note the tier level of the on board computer.
public int securityBPSpent = 0; // Integer to track the amount of BP spent on security options
public bool smugBay = false; // Boolean to track whether or not the ship has a smuggling bay.
public bool core2 = false; // Boolean to track whether or not the ship has a second power core
public int sensorMod = 0; // Not Currently Used
public int totSP = 0; // Not Currently Used
public bool wpnUpgradeEntered = false; // Boolean to keep the weapons slot upgrade from resetting.
// Booleans for weapons slot upgrades
public bool f1Light = false;
public bool f2Light = false;
public bool f3Light = false;
public bool f4Light = false;
public bool p1Light = false;
public bool p2Light = false;
public bool p3Light = false;
public bool p4Light = false;
public bool s1Light = false;
public bool s2Light = false;
public bool s3Light = false;
public bool s4Light = false;
public bool a1Light = false;
public bool a2Light = false;
public bool a3Light = false;
public bool a4Light = false;
public bool t1Light = false;
public bool t2Light = false;
public bool t3Light = false;
public bool t4Light = false;
public bool f1Heavy = false;
public bool f2Heavy = false;
public bool f3Heavy = false;
public bool f4Heavy = false;
public bool p1Heavy = false;
public bool p2Heavy = false;
public bool p3Heavy = false;
public bool p4Heavy = false;
public bool s1Heavy = false;
public bool s2Heavy = false;
public bool s3Heavy = false;
public bool s4Heavy = false;
public bool a1Heavy = false;
public bool a2Heavy = false;
public bool a3Heavy = false;
public bool a4Heavy = false;
public bool t1Heavy = false;
public bool t2Heavy = false;
public bool t3Heavy = false;
public bool t4Heavy = false;
public bool f1Cap = false;
public bool f2Cap = false;
public bool f3Cap = false;
public bool f4Cap = false;
public bool p1Cap = false;
public bool p2Cap = false;
public bool p3Cap = false;
public bool p4Cap = false;
public bool s1Cap = false;
public bool s2Cap = false;
public bool s3Cap = false;
public bool s4Cap = false;
public bool a1Cap = false;
public bool a2Cap = false;
public bool a3Cap = false;
public bool a4Cap = false;
// Integers to track the cost of weapons slot upgrades.
public int weaponsUpgradeBaseValue = 0;
public int weaponsUpgradeTotal = 0;
// These are the public variables that will be used to populate the Starship Sheet.
public static string sTier; //Done
public static string sBuildPointsTotal; //done
public static string sBuildPointsUsed; //done
public static string sName; //Done
public static string sMake; //done
public static string sModel; //done
public static string sFrame; //done
public static string sHPTotal; //done
public static string sCT; //done
public static string sDT; //done
public static string sManuever; //done
public static string sSize; //done
public static string sSizeNumber; //done
public static string sPowerCore1; //done
public static string sPowerCore2; //done
public static string sPCUTotal; //done
public static string sSensors; //done
public static string sSensorRange; //done
public static string sSensorMod; //done
public static string sComputer; //done
public static string sCompBonus; //done
public static string sCompNodes; //done
public static string sQuarters; //done
public static string sThrusters; //done
public static string sThrusterSpeed; //done
public static string sHyperspaceEngine; //done
public static string sHyperspaceRating; //done
public static string sShields; //done
public static string sShieldTotal; //done
public static string sShieldRegen; //done
public static string sArmor; //done
public static string sACTotal; //done
public static string sPilotMod; // NOT DONE
public static string sACBonus; //done
public static string sSizeMod; //done
public static string sACMiscMod; // left blank
public static string sCountermeasures; //done
public static string sTLTotal; //done
public static string sTLBonus; //done
public static string sTLMiscMod; // left blank
public static string sExpBay01 = ""; //done
public static string sExpBay02 = ""; //done
public static string sExpBay03 = ""; //done
public static string sExpBay04 = ""; //done
public static string sExpBay05 = ""; //done
public static string sExpBay06 = ""; //done
public static string sExpBay07 = ""; //done
public static string sExpBay08 = ""; //done
public static string sExpBay09 = ""; //done
public static string sExpBay10 = ""; //done
public static string sExpBay11 = ""; //done
public static string sExpBay12 = ""; //done
public static string sExpBay13 = ""; //done
public static string sExpBay14 = ""; //done
public static string sExpBay15 = ""; //done
public static string sExpBay16 = ""; //done
public static string sExpBay17 = ""; //done
public static string sExpBay18 = ""; //done
public static string sExpBay19 = ""; //done
public static string sExpBay20 = ""; //done
public static string sSmugglingDC; //done
public static string sCompCountermeasureNum; //done
public static bool sCompAntiHack; //done
public static string strCompAntiHack; // Added
public static string sCompHackDC; // NOT DONE
public static bool sBiolocks; //done
public static string strBiolocks; // Added
public static bool sSelfDestruct; //done
public static string strSelfDestruct; // Added
public static string sAntipersonnelWPN; // left blank
public static string sAntipersonnelDMG; // left blank
public static string sFWPNS01; //done
public static string sFDMG01; //done
public static string sFWPNS02; //done
public static string sFDMG02; //done
public static string sFWPNS03; //done
public static string sFDMG03; //done
public static string sFWPNS04; //done
public static string sFDMG04; //done
public static string sPWPNS01; //done
public static string sPDMG01; //done
public static string sPWPNS02; //done
public static string sPDMG02; //done
public static string sPWPNS03; //done
public static string sPDMG03; //done
public static string sPWPNS04; //done
public static string sPDMG04; //done
public static string sSWPNS01; //done
public static string sSDMG01; //done
public static string sSWPNS02; //done
public static string sSDMG02; //done
public static string sSWPNS03; //done
public static string sSDMG03; //done
public static string sSWPNS04; //done
public static string sSDMG04; //done
public static string sTWPNS01; //done
public static string sTDMG01; //done
public static string sTWPNS02; //done
public static string sTDMG02; //done
public static string sTWPNS03; //done
public static string sTDMG03; //done
public static string sTWPNS04; //done
public static string sTDMG04; //done
public static string sAWPNS01; //done
public static string sADMG01; //done
public static string sAWPNS02; //done
public static string sADMG02; //done
public static string sAWPNS03; //done
public static string sADMG03; //done
public static string sAWPNS04; //done
public static string sADMG04; //done
public static bool randShipBalanced = false;
public static bool randShipSpeed = false;
public static bool randShipOffense = false;
public static bool randShipDefense = false;
public static bool randShipSelected = false;
public static RandomizedSelection RandomShip = new RandomizedSelection();
public bool tierSelected = false;
public bool frameSelected = false;
public bool powerCore1Selected = false;
public bool thrustersSelected = false;
public bool armorSelected = false;
public bool computerSelected = false;
public bool quartersSelected = false;
public bool countermeasuresSelected = false;
public bool hyperspaceEngineSelected = false;
public bool expBaySelected = false;
public bool smugglingBaySelected = false;
public bool powerCore2Selected = false;
public bool securitySelected = false;
public bool sensorsSelected = false;
public bool shieldsSelected = false;
public bool weaponSlotSelected = false;
public bool weaponsSelected = false;
public bool weaponsLinkSelected = false;
// track if weapons link
public static bool forwLink1 = false; // Added
public static bool forwLink2 = false;
public static bool turLink1 = false;
public static bool turLink2 = false;
public static bool aftLink1 = false;
public static bool aftLink2 = false;
public static bool starbLink1 = false;
public static bool starbLink2 = false;
public static bool portLink1 = false;
public static bool portLink2 = false; // Added
// Tracks the type of linked weapons
public static string forWpnTypeLink1 = ""; // Added
public static string forWpnTypeLink2 = "";
public static string turWpnTypeLink1 = "";
public static string turWpnTypeLink2 = "";
public static string aftWpnTypeLink1 = "";
public static string aftWpnTypeLink2 = "";
public static string starbWpnTypeLink1 = "";
public static string starbWpnTypeLink2 = "";
public static string portWpnTypeLink1 = "";
public static string portWpnTypeLink2 = ""; // Added
// Holds total linking cost for calculation
int totalLinkCost = 0;
public static string forwLinkChkBox1Type = "";
public static string forwLinkChkBox2Type = "";
public static string turLinkChkBox1Type = "";
public static string turLinkChkBox2Type = "";
public static string aftLinkChkBox1Type = "";
public static string aftLinkChkBox2Type = "";
public static string starbLinkChkBox1Type = "";
public static string starbLinkChkBox2Type = "";
public static string portLinkChkBox1Type = "";
public static string portLinkChkBox2Type = ""; // Added
// Added for File -> new option to rebuild the form
private AssemblyBay Bay;
private List<Tier> BuildTier;
private List<BaseFrame> BuildFrames;
private List<PowerCore> BuildCores;
private List<Thruster> BuildThrusters;
private List<Armor> BuildArmor;
private List<Computer> BuildComputers;
private List<Quarters> BuildQuarters;
private List<Countermeasures> BuildCM;
private List<HyperspaceEngine> BuildHyperspaceEngine;
private List<ExpansionBay> BuildExpBays01;
private List<ExpansionBay> BuildExpBays02;
private List<ExpansionBay> BuildExpBays03;
private List<ExpansionBay> BuildExpBays04;
private List<ExpansionBay> BuildExpBays05;
private List<ExpansionBay> BuildExpBays06;
private List<ExpansionBay> BuildExpBays07;
private List<ExpansionBay> BuildExpBays08;
private List<ExpansionBay> BuildExpBays09;
private List<ExpansionBay> BuildExpBays10;
private List<ExpansionBay> BuildExpBays11;
private List<ExpansionBay> BuildExpBays12;
private List<ExpansionBay> BuildExpBays13;
private List<ExpansionBay> BuildExpBays14;
private List<ExpansionBay> BuildExpBays15;
private List<ExpansionBay> BuildExpBays16;
private List<ExpansionBay> BuildExpBays17;
private List<ExpansionBay> BuildExpBays18;
private List<ExpansionBay> BuildExpBays19;
private List<ExpansionBay> BuildExpBays20;
private List<PowerCore> BuildCores2;
private List<Sensor> BuildSensors;
private List<Shield> BuildShields;
#endregion
public Form1()
{
InitializeComponent();
statusLabel.Text = "Select Starship Tier";
Bay = new AssemblyBay();
BuildTier = Bay.ConstructTierLoad();
BuildFrames = Bay.ConstructFrameLoad();
BuildCores = Bay.ConstructPowerCoreLoad();
BuildThrusters = Bay.ConstructThrusterLoad();
BuildArmor = Bay.ConstructArmorLoad();
BuildComputers = Bay.ConstructComputerLoad();
BuildQuarters = Bay.ConstructQuartersLoad();
BuildCM = Bay.ConstructCountermeasuresLoad();
BuildHyperspaceEngine = Bay.ConstructHyperspaceEngineLoad();
BuildExpBays01 = Bay.ConstructExpansionBayLoad01();
BuildExpBays02 = Bay.ConstructExpansionBayLoad02();
BuildExpBays03 = Bay.ConstructExpansionBayLoad03();
BuildExpBays04 = Bay.ConstructExpansionBayLoad04();
BuildExpBays05 = Bay.ConstructExpansionBayLoad05();
BuildExpBays06 = Bay.ConstructExpansionBayLoad06();
BuildExpBays07 = Bay.ConstructExpansionBayLoad07();
BuildExpBays08 = Bay.ConstructExpansionBayLoad08();
BuildExpBays09 = Bay.ConstructExpansionBayLoad09();
BuildExpBays10 = Bay.ConstructExpansionBayLoad10();
BuildExpBays11 = Bay.ConstructExpansionBayLoad11();
BuildExpBays12 = Bay.ConstructExpansionBayLoad12();
BuildExpBays13 = Bay.ConstructExpansionBayLoad13();
BuildExpBays14 = Bay.ConstructExpansionBayLoad14();
BuildExpBays15 = Bay.ConstructExpansionBayLoad15();
BuildExpBays16 = Bay.ConstructExpansionBayLoad16();
BuildExpBays17 = Bay.ConstructExpansionBayLoad17();
BuildExpBays18 = Bay.ConstructExpansionBayLoad18();
BuildExpBays19 = Bay.ConstructExpansionBayLoad19();
BuildExpBays20 = Bay.ConstructExpansionBayLoad20();
BuildCores2 = Bay.ConstructPowerCore2Load();
BuildSensors = Bay.ConstructSensorLoad();
BuildShields = Bay.ConstructShieldLoad();
tierComboBox.DataSource = BuildTier;
tierComboBox.DisplayMember = "Type";
frameComboBox.DataSource = BuildFrames;
frameComboBox.DisplayMember = "Type";
powerCoreComboBox.DataSource = BuildCores;
powerCoreComboBox.DisplayMember = "Type";
thrustersComboBox.DataSource = BuildThrusters;
thrustersComboBox.DisplayMember = "Type";
armorComboBox.DataSource = BuildArmor;
armorComboBox.DisplayMember = "Type";
calcAC();
ACTextBox.Text = ac.ToString();
computerComboBox.DataSource = BuildComputers;
computerComboBox.DisplayMember = "Type";
quartersComboBox.DataSource = BuildQuarters;
quartersComboBox.DisplayMember = "Type";
countermeasuresComboBox.DataSource = BuildCM;
countermeasuresComboBox.DisplayMember = "Type";
calcTL();
TLTextBox.Text = tl.ToString();
hyperspaceEngineComboBox.DataSource = BuildHyperspaceEngine;
hyperspaceEngineComboBox.DisplayMember = "Type";
expBayComboBox1.DataSource = BuildExpBays01;
expBayComboBox1.DisplayMember = "Type";
expBayComboBox2.DataSource = BuildExpBays02;
expBayComboBox2.DisplayMember = "Type";
expBayComboBox3.DataSource = BuildExpBays03;
expBayComboBox3.DisplayMember = "Type";
expBayComboBox4.DataSource = BuildExpBays04;
expBayComboBox4.DisplayMember = "Type";
expBayComboBox5.DataSource = BuildExpBays05;
expBayComboBox5.DisplayMember = "Type";
expBayComboBox6.DataSource = BuildExpBays06;
expBayComboBox6.DisplayMember = "Type";
expBayComboBox7.DataSource = BuildExpBays07;
expBayComboBox7.DisplayMember = "Type";
expBayComboBox8.DataSource = BuildExpBays08;
expBayComboBox8.DisplayMember = "Type";
expBayComboBox9.DataSource = BuildExpBays09;
expBayComboBox9.DisplayMember = "Type";
expBayComboBox10.DataSource = BuildExpBays10;
expBayComboBox10.DisplayMember = "Type";
expBayComboBox11.DataSource = BuildExpBays11;
expBayComboBox11.DisplayMember = "Type";
expBayComboBox12.DataSource = BuildExpBays12;
expBayComboBox12.DisplayMember = "Type";
expBayComboBox13.DataSource = BuildExpBays13;
expBayComboBox13.DisplayMember = "Type";
expBayComboBox14.DataSource = BuildExpBays14;
expBayComboBox14.DisplayMember = "Type";
expBayComboBox15.DataSource = BuildExpBays15;
expBayComboBox15.DisplayMember = "Type";
expBayComboBox16.DataSource = BuildExpBays16;
expBayComboBox16.DisplayMember = "Type";
expBayComboBox17.DataSource = BuildExpBays17;
expBayComboBox17.DisplayMember = "Type";
expBayComboBox18.DataSource = BuildExpBays18;
expBayComboBox18.DisplayMember = "Type";
expBayComboBox19.DataSource = BuildExpBays19;
expBayComboBox19.DisplayMember = "Type";
expBayComboBox20.DataSource = BuildExpBays20;
expBayComboBox20.DisplayMember = "Type";
powerCore2ComboBox.DataSource = BuildCores2;
powerCore2ComboBox.DisplayMember = "Type";
sensorsComboBox.DataSource = BuildSensors;
sensorsComboBox.DisplayMember = "Type";
shieldsComboBox.DataSource = BuildShields;
shieldsComboBox.DisplayMember = "Type";
tierGB.BackColor = Color.Lime;
}
private void Form1_Load(object sender, EventArgs e)
{
}
#region Buttons
private void randomizeBTN_Click(object sender, EventArgs e)
{
if (tierSelected == true && frameSelected == true && powerCore1Selected == true)
{
randomShipGen();
}
else
{
MessageBox.Show("Please select a Ship Tier, Ship Frame, and Ship Power Core before trying to randomly generate a ship.");
}
}
private void starshipNameSelectButton_Click(object sender, EventArgs e)
{
starshipName.Text = starshipNameTextBox.Text;
sName = starshipName.Text;
}
private void starshipMakeSelectButton_Click(object sender, EventArgs e)
{
starshipMake.Text = starshipMakeTextBox.Text;
sMake = starshipMake.Text;
}
private void starshipModelSelectButton_Click(object sender, EventArgs e)
{
starshipModel.Text = starshipModelTextBox.Text;
sModel = starshipModel.Text;
}
private void tierSelectButton_Click(object sender, EventArgs e)
{
if (tierSelected == false)
{
Tier tierSelection = confirmTier();
totalBPCount = tierSelection.Bp;
totalBuildPoints.Text = totalBPCount.ToString();
sBuildPointsTotal = totalBuildPoints.Text;
currentBuildPoints.Text = calcBP().ToString();
shipTier = tierSelection.Type;
sTier = shipTier;
sBuildPointsTotal = totalBuildPoints.Text;
statusLabel.Text = "Select Starship Frame";
statusLabel.BackColor = Color.Lime;
tierGB.BackColor = Color.Khaki;
tierSelected = true;
frameGB.BackColor = Color.Lime;
tierComboBox.Enabled = false;
tierSelectButton.Text = "Undo";
}
else if (tierSelected == true)
{
tierGB.BackColor = Color.Red;
Tier tierSelection = confirmTier();
totalBPCount -= tierSelection.Bp;
totalBuildPoints.Text = totalBPCount.ToString();
currentBuildPoints.Text = calcBP().ToString();
tierComboBox.Enabled = true;
tierSelectButton.Text = "Select";
tierSelected = false;
statusLabel.Text = "Please Re-Select Tier";
statusLabel.BackColor = Color.Red;
}
}
private void frameSelectButton_Click(object sender, EventArgs e)
{
if (frameSelected == false)
{
BaseFrame frameSelection = confirmFrame();
spentBPCount += frameSelection.BPCost;
currentBuildPoints.Text = calcBP().ToString();
shipSize = frameSelection.Size;
shipFrame = frameSelection.Type;
shipFrameLabel.Text = shipFrame;
sFrame = shipFrame;
starshipSizeLabel.Text = shipSize;
calcSizeInt();
calcAC();
ACTextBox.Text = ac.ToString();
calcTL();
TLTextBox.Text = tl.ToString();
powerCoreComboBox.DataSource = FittedCores();
powerCore2ComboBox.DataSource = FittedCores2();
thrustersComboBox.DataSource = FittedThrusters();
wpnsExpBayApplication(frameSelection);
assignWeaponsDatasourceByFrame();
frameInfoApplication();
HullPointsTextBox.Text = hp.ToString();
CriticalThresholdTextBox.Text = ct.ToString();
DamageThresholdTextBox.Text = dt.ToString();
sSize = shipSize;
sSizeMod = shipSizeMod.ToString();
sSizeNumber = shipSizeInt.ToString();
sManuever = frameSelection.MR;
sHPTotal = HullPointsTextBox.Text;
sCT = CriticalThresholdTextBox.Text;
sDT = DamageThresholdTextBox.Text;
statusLabel.Text = "Select Starship Power Core";
statusLabel.BackColor = Color.Lime;
frameGB.BackColor = Color.Khaki;
frameSelected = true;
powercore01GB.BackColor = Color.Lime;
frameComboBox.Enabled = false;
frameSelectButton.Text = "Undo";
AssignUpgradeBoxesByFrame(AllUpgradeBoxes(), TSUpgradeBoxes(), MLUpgradeBoxes(), shipFrame); // Added
weaponsUpgradeBaseValue = GetSlotsValue(); // Added
if (shieldsSelected == true)
{
weaponsMainControl.SelectedIndex = 0;
weaponsMainControl.SelectedIndex = 1;
}
}
else if (frameSelected == true)
{
frameGB.BackColor = Color.Red;
BaseFrame frameSelection = confirmFrame();
spentBPCount -= frameSelection.BPCost;
currentBuildPoints.Text = calcBP().ToString();
shipSize = "";
shipFrame = "";
shipFrameLabel.Text = "";
starshipSizeLabel.Text = "";
ACTextBox.Text = "10";
TLTextBox.Text = "10";
HullPointsTextBox.Text = "0";
CriticalThresholdTextBox.Text = "0";
DamageThresholdTextBox.Text = "0";
expBayNum = 0;
expSlotsLeft.Text = expBayNum.ToString();
f1Light = false; // Added
f2Light = false;
f3Light = false;
f4Light = false;
p1Light = false;
p2Light = false;
p3Light = false;
p4Light = false;
s1Light = false;
s2Light = false;
s3Light = false;
s4Light = false;
a1Light = false;
a2Light = false;
a3Light = false;
a4Light = false;
t1Light = false;
t2Light = false;
t3Light = false;
t4Light = false;
f1Heavy = false;
f2Heavy = false;
f3Heavy = false;
f4Heavy = false;
p1Heavy = false;
p2Heavy = false;
p3Heavy = false;
p4Heavy = false;
s1Heavy = false;
s2Heavy = false;
s3Heavy = false;
s4Heavy = false;
a1Heavy = false;
a2Heavy = false;
a3Heavy = false;
a4Heavy = false;
t1Heavy = false;
t2Heavy = false;
t3Heavy = false;
t4Heavy = false;
f1Cap = false;
f2Cap = false;
f3Cap = false;
f4Cap = false;
p1Cap = false;
p2Cap = false;
p3Cap = false;
p4Cap = false;
s1Cap = false;
s2Cap = false;
s3Cap = false;
s4Cap = false;
a1Cap = false;
a2Cap = false;
a3Cap = false;
a4Cap = false;
fcb1.DataSource = null;
fcb2.DataSource = null;
fcb3.DataSource = null;
fcb4.DataSource = null;
fcb1.Items.Clear();
fcb2.Items.Clear();
fcb3.Items.Clear();
fcb4.Items.Clear();
fcb1.Enabled = true;
fcb2.Enabled = true;
fcb3.Enabled = true;
fcb4.Enabled = true;
forward01.DataSource = null;
forward02.DataSource = null;
forward03.DataSource = null;
forward04.DataSource = null;
forward01.Items.Clear();
forward02.Items.Clear();
forward03.Items.Clear();
forward04.Items.Clear();
forward01.Visible = false;
forward02.Visible = false;
forward03.Visible = false;
forward04.Visible = false;
tcb1.DataSource = null;
tcb2.DataSource = null;
tcb3.DataSource = null;
tcb4.DataSource = null;
tcb1.Items.Clear();
tcb2.Items.Clear();
tcb3.Items.Clear();
tcb4.Items.Clear();
tcb1.Enabled = true;
tcb2.Enabled = true;
tcb3.Enabled = true;
tcb4.Enabled = true;
turret01.DataSource = null;
turret02.DataSource = null;
turret03.DataSource = null;
turret04.DataSource = null;
turret01.Items.Clear();
turret02.Items.Clear();
turret03.Items.Clear();
turret04.Items.Clear();
turret01.Visible = false;
turret02.Visible = false;
turret03.Visible = false;
turret04.Visible = false;
acb1.DataSource = null;
acb2.DataSource = null;
acb3.DataSource = null;
acb4.DataSource = null;
acb1.Items.Clear();
acb2.Items.Clear();
acb3.Items.Clear();
acb4.Items.Clear();
acb1.Enabled = true;
acb2.Enabled = true;
acb3.Enabled = true;
acb4.Enabled = true;
aft01.DataSource = null;
aft02.DataSource = null;
aft03.DataSource = null;
aft04.DataSource = null;
aft01.Items.Clear();
aft02.Items.Clear();
aft03.Items.Clear();
aft04.Items.Clear();
aft01.Visible = false;
aft02.Visible = false;
aft03.Visible = false;
aft04.Visible = false;
scb1.DataSource = null;
scb2.DataSource = null;
scb3.DataSource = null;
scb4.DataSource = null;
scb1.Items.Clear();
scb2.Items.Clear();
scb3.Items.Clear();
scb4.Items.Clear();
scb1.Enabled = true;
scb2.Enabled = true;
scb3.Enabled = true;
scb4.Enabled = true;
starboard01.DataSource = null;
starboard02.DataSource = null;
starboard03.DataSource = null;
starboard04.DataSource = null;
starboard01.Items.Clear();
starboard02.Items.Clear();
starboard03.Items.Clear();
starboard04.Items.Clear();
starboard01.Visible = false;
starboard02.Visible = false;
starboard03.Visible = false;
starboard04.Visible = false;
pcb1.DataSource = null;
pcb2.DataSource = null;
pcb3.DataSource = null;
pcb4.DataSource = null;
pcb1.Items.Clear();
pcb2.Items.Clear();
pcb3.Items.Clear();
pcb4.Items.Clear();
pcb1.Enabled = true;
pcb2.Enabled = true;
pcb3.Enabled = true;
pcb4.Enabled = true;
port01.DataSource = null;
port02.DataSource = null;
port03.DataSource = null;
port04.DataSource = null;
port01.Items.Clear();
port02.Items.Clear();
port03.Items.Clear();
port04.Items.Clear();
port01.Visible = false;
port02.Visible = false;
port03.Visible = false;
port04.Visible = false;
if (shieldsSelected == true)
{
weaponsMainControl.SelectedIndex = 0;
weaponsMainControl.SelectedIndex = 1;
}
weaponsUpgradePage.BackColor = Color.Empty;
wpnsUpgradeBtn.Text = "Select"; // Added
frameComboBox.Enabled = true;
frameSelectButton.Text = "Select";
frameSelected = false;
statusLabel.Text = "Please Re-Select Frame";
statusLabel.BackColor = Color.Red;
}
}
private void powerCoreSelectButton_Click(object sender, EventArgs e)
{
if (powerCore1Selected == false)
{
PowerCore coreSelection = confirmCore();
spentBPCount += coreSelection.BPCost;
currentBuildPoints.Text = calcBP().ToString();
shipPCURating = coreSelection.PCU;
totalPCUCount = coreSelection.PCU;
totalPCU.Text = totalPCUCount.ToString();
remainingPCU.Text = calcPCU().ToString();
hyperspaceEngineComboBox.DataSource = FittedEngine();
sPowerCore1 = coreSelection.Type;
sPCUTotal = totalPCU.Text;
statusLabel.Text = "Select Starship Thrusters";
powercore01GB.BackColor = Color.Khaki;
powerCore1Selected = true;
thrustersGB.BackColor = Color.Lime;
powerCoreComboBox.Enabled = false;
statusLabel.BackColor = Color.Lime;
powerCoreSelectButton.Text = "Undo";
}
else if (powerCore1Selected == true)
{
powercore01GB.BackColor = Color.Red;
PowerCore coreSelection = confirmCore();
spentBPCount -= coreSelection.BPCost;
currentBuildPoints.Text = calcBP().ToString();
shipPCURating = 0;
totalPCUCount = 0;
totalPCU.Text = totalPCUCount.ToString();
remainingPCU.Text = calcPCU().ToString();
powerCoreComboBox.Enabled = true;
powerCoreSelectButton.Text = "Select";
powerCore1Selected = false;
statusLabel.Text = "Please Re-Select Power Core";
statusLabel.BackColor = Color.Red;
}
}
private void thrusterSelectButton_Click(object sender, EventArgs e)
{
if (thrustersSelected == false)
{
Thruster thrusterSelection = confirmThruster();
spentBPCount += thrusterSelection.BpCost;
currentBuildPoints.Text = calcBP().ToString();
spentPCUCount += thrusterSelection.Pcu;
remainingPCU.Text = calcPCU().ToString();
shipSpeed = thrusterSelection.Speed;
starshipSpeed.Text = shipSpeed.ToString();
pilotingModAdj = thrusterSelection.Piloting;
starshipPilotingMod.Text = calcPilotMod().ToString();
pilotRanks += thrusterSelection.Piloting;
calcAC();
calcTL();
ACTextBox.Text = ac.ToString();
TLTextBox.Text = tl.ToString();
sThrusters = thrusterSelection.Type;
sThrusterSpeed = shipSpeed.ToString();
statusLabel.Text = "Select Starship Armor";
thrustersGB.BackColor = Color.Khaki;
thrustersSelected = true;
armorGB.BackColor = Color.Lime;
thrustersComboBox.Enabled = false;
thrusterSelectButton.Text = "Undo";
statusLabel.BackColor = Color.Lime;
}
else if (thrustersSelected == true)
{
thrustersGB.BackColor = Color.Red;
Thruster thrusterSelection = confirmThruster();
spentBPCount -= thrusterSelection.BpCost;
currentBuildPoints.Text = calcBP().ToString();
spentPCUCount -= thrusterSelection.Pcu;
remainingPCU.Text = calcPCU().ToString();
shipSpeed = 0;
starshipSpeed.Text = shipSpeed.ToString();
pilotingModAdj = 0;
starshipPilotingMod.Text = calcPilotMod().ToString();
pilotRanks -= thrusterSelection.Piloting;
calcAC();
calcTL();
ACTextBox.Text = ac.ToString();
TLTextBox.Text = tl.ToString();
thrustersComboBox.Enabled = true;
thrusterSelectButton.Text = "Select";
thrustersSelected = false;
statusLabel.Text = "Please Re-Select Thrusters";
statusLabel.BackColor = Color.Red;
}
}
private void armorSelectionButton_Click(object sender, EventArgs e)
{
if (armorSelected == false)
{
Armor armorSelection = confirmArmor();
int computedBP = armorSelection.BpCostMulti * shipSizeInt;
spentBPCount += computedBP;
currentBuildPoints.Text = calcBP().ToString();
ac += armorSelection.Ac;
tl += armorSelection.TargetLock;
ACTextBox.Text = ac.ToString();
TLTextBox.Text = tl.ToString();
sArmor = armorSelection.Type;
sACTotal = ACTextBox.Text;
sACBonus = armorSelection.Ac.ToString();
statusLabel.Text = "Select Starship Computer";
armorGB.BackColor = Color.Khaki;
armorSelected = true;
computerGB.BackColor = Color.Lime;
armorComboBox.Enabled = false;
armorSelectionButton.Text = "Undo";
statusLabel.BackColor = Color.Lime;
}
else if (armorSelected == true)
{
armorGB.BackColor = Color.Red;
Armor armorSelection = confirmArmor();
int computedBP = armorSelection.BpCostMulti * shipSizeInt;
spentBPCount -= computedBP;
currentBuildPoints.Text = calcBP().ToString();
ac -= armorSelection.Ac;
tl -= armorSelection.TargetLock;
ACTextBox.Text = ac.ToString();
TLTextBox.Text = tl.ToString();
armorComboBox.Enabled = true;
armorSelectionButton.Text = "Select";
armorSelected = false;
statusLabel.Text = "Please Re-Select Armor";
statusLabel.BackColor = Color.Red;
}
}
private void computerSelectButton_Click(object sender, EventArgs e)
{
if (computerSelected == false)
{
Computer computerSelection = confirmComputer();
spentBPCount += computerSelection.BpCost;
currentBuildPoints.Text = calcBP().ToString();
spentPCUCount += computerSelection.Pcu;
remainingPCU.Text = calcPCU().ToString();
compBonusTextBox.Text = computerSelection.Bonus01.ToString();
compNodesTextBox.Text = computerSelection.Nodes.ToString();
computerTypeLabel.Text = computerSelection.Type;
computerTier = computerSelection.Bonus01;
sComputer = computerTypeLabel.Text;
sCompBonus = computerTier.ToString();
sCompNodes = compNodesTextBox.Text;
statusLabel.Text = "Select Starship Quarters";
computerGB.BackColor = Color.Khaki;
computerSelected = true;
quartersGB.BackColor = Color.Lime;
computerComboBox.Enabled = false;
computerSelectButton.Text = "Undo";
statusLabel.BackColor = Color.Lime;
}
else if (computerSelected == true)
{
computerGB.BackColor = Color.Red;
Computer computerSelection = confirmComputer();
spentBPCount -= computerSelection.BpCost;
currentBuildPoints.Text = calcBP().ToString();
spentPCUCount -= computerSelection.Pcu;
remainingPCU.Text = calcPCU().ToString();
computerComboBox.Enabled = true;
computerSelectButton.Text = "Select";
computerSelected = false;
statusLabel.Text = "Please Re-Select Computer";
statusLabel.BackColor = Color.Red;
}
}
private void quartersSelectButton_Click(object sender, EventArgs e)
{
if (quartersSelected == false)
{
Quarters quartersSelection = confirmQuarters();
spentBPCount += quartersSelection.BpCost;
currentBuildPoints.Text = calcBP().ToString();
quartersTypeLabel.Text = quartersSelection.Type;
sQuarters = quartersTypeLabel.Text;
statusLabel.Text = "Select Starship Countermeasures";
quartersGB.BackColor = Color.Khaki;
quartersSelected = true;
countermeasuresGB.BackColor = Color.Lime;
quartersComboBox.Enabled = false;
quartersSelectButton.Text = "Undo";