-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.js
6507 lines (5353 loc) · 210 KB
/
main.js
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
// -------------------------------------------------------------------------------------------------------------
// Unofficial patch 2.1 by RandomDude
// All credit to the original creator Frank Lantz, source code from https://www.decisionproblem.com/paperclips/
// -------------------------------------------------------------------------------------------------------------
// Threnody ---------------------------------------------------------
function threnodyLoaded()
{
threnodyLoadedBool = true;
}
var threnodyAudio;
function loadThrenody() {
threnodyAudio.src = "test.mp3";
threnodyAudio.addEventListener('canplaythrough', threnodyLoaded);
}
function playThrenody(){
if(threnodyLoadedBool)
{
threnodyAudio.play();
}
}
// Cache all DOM elements
function cacheDOMElements(){
wireCostElement = document.getElementById("wireCost");
wireBuyerStatusElement = document.getElementById("wireBuyerStatus");
wireElement = document.getElementById("wire");
fundsElement = document.getElementById("funds");
qCompDisplayElement = document.getElementById("qCompDisplay");
hypnoDroneTextElement = document.getElementById("hypnoDroneText");
readoutElement1 = document.getElementById("readout1");
readoutElement2 = document.getElementById("readout2");
readoutElement3 = document.getElementById("readout3");
readoutElement4 = document.getElementById("readout4");
readoutElement5 = document.getElementById("readout5");
readoutElement6 = document.getElementById("readout6");
readoutElement7 = document.getElementById("readout7");
readoutElement8 = document.getElementById("readout8");
readoutElementTime = document.getElementById("readoutClock");
mpdsDivElement = document.getElementById("mdpsDiv");
factoryRebootToolTipElement = document.getElementById("factoryRebootToolTip");
havesterRebootToolTipElement = document.getElementById("harvesterRebootToolTip");
wireDroneRebootToolTipElement = document.getElementById("wireDroneRebootToolTip");
farmRebootToolTipElement = document.getElementById("farmRebootToolTip");
batteryRebootToolTipElement = document.getElementById("batteryRebootToolTip");
swarmSliderDivElement = document.getElementById("swarmSliderDiv");
clipCountCrunchedElement = document.getElementById("clipCountCrunched");
autoTourneyStatusDivElement = document.getElementById("autoTourneyStatusDiv");
autoTourneyControlElement = document.getElementById("autoTourneyControl");
wireBuyerDivElement = document.getElementById("wireBuyerDiv");
tournamentResultsTableElement = document.getElementById("tournamentResultsTable");
tournamentStuffElement = document.getElementById("tournamentStuff");
increaseMaxTrustDivElement = document.getElementById("increaseMaxTrustDiv");
honorDivElement = document.getElementById("honorDiv");
drifterDivElement = document.getElementById("drifterDiv");
battleCanvasDivElement = document.getElementById("battleCanvasDiv");
combatButtonDivElement = document.getElementById("combatButtonDiv");
factoryUpgradeDisplayElement = document.getElementById("factoryUpgradeDisplay");
droneUpgradeDisplayElement = document.getElementById("droneUpgradeDisplay");
btnIncreaseMaxTrustElement = document.getElementById("btnIncreaseMaxTrust");
btnMakerProbeElement = document.getElementById("btnMakeProbe");
hazardBodyCountElement = document.getElementById("hazardBodyCount");
probesLostHazardsDisplayElement = document.getElementById("probesLostHazardsDisplay");
driftBodyCountElement = document.getElementById("driftBodyCount");
combatBodyCountElement = document.getElementById("combatBodyCount");
prestigeDivElement = document.getElementById("prestigeDiv");
btnMakePaperclipElement = document.getElementById("btnMakePaperclip");
btnBuyWireElement = document.getElementById("btnBuyWire");
btnMakeClipperElement = document.getElementById("btnMakeClipper");
btnExpandMarketingElement = document.getElementById("btnExpandMarketing");
btnLowerPriceElement = document.getElementById("btnLowerPrice");
btnAddProcElement = document.getElementById("btnAddProc");
btnAddMemElement = document.getElementById("btnAddMem");
btnNewTournamentElement = document.getElementById("btnNewTournament");
btnImproveInvestmentsElement = document.getElementById("btnImproveInvestments");
investmentEngineElement = document.getElementById("investmentEngine");
investmentEngineUpgradeElement = document.getElementById("investmentEngineUpgrade");
strategyEngineElement = document.getElementById("strategyEngine");
tournamentManagementElement = document.getElementById("tournamentManagement");
megaClipperDivElement = document.getElementById("megaClipperDiv");
btnMakeMegaClipperElement = document.getElementById("btnMakeMegaClipper");
autoClipperDivElement = document.getElementById("autoClipperDiv");
revPerSecDivElement = document.getElementById("revPerSecDiv");
compDivElement = document.getElementById("compDiv");
creativityDivElement = document.getElementById("creativityDiv");
projectsDivElement = document.getElementById("projectsDiv");
businessDivElement = document.getElementById("businessDiv");
manufacturingDivElement = document.getElementById("manufacturingDiv");
trustDivElement = document.getElementById("trustDiv");
creationDivElement = document.getElementById("creationDiv");
factoryDivElement = document.getElementById("factoryDiv");
wireProductionDivElement = document.getElementById("wireProductionDiv");
wireTransDivElement = document.getElementById("wireTransDiv");
harvesterDivElement = document.getElementById("harvesterDiv");
wireDroneDivElement = document.getElementById("wireDroneDiv");
tothDivElement = document.getElementById("tothDiv");
spaceDivElement = document.getElementById("spaceDiv");
factoryDivSpaceElement = document.getElementById("factoryDivSpace");
droneDivSpaceElement = document.getElementById("droneDivSpace");
probeDesignDivElement = document.getElementById("probeDesignDiv");
increaseProbeTrustDivElement = document.getElementById("increaseProbeTrustDiv");
qComputingElement = document.getElementById("qComputing");
btnMakeFactoryElement = document.getElementById("btnMakeFactory");
btnHarvesterRebootElement = document.getElementById("btnHarvesterReboot");
btnWireDroneRebootElement = document.getElementById("btnWireDroneReboot");
btnFactoryRebootElement = document.getElementById("btnFactoryReboot");
probeTrustUsedDisplayElement = document.getElementById("probeTrustUsedDisplay");
btnIncreaseProbeTrustElement = document.getElementById("btnIncreaseProbeTrust");
btnRaiseProbeSpeedElement = document.getElementById("btnRaiseProbeSpeed");
btnLowerProbeSpeedElement = document.getElementById("btnLowerProbeSpeed");
btnRaiseProbeNavElement = document.getElementById("btnRaiseProbeNav");
btnLowerProbeNavElement = document.getElementById("btnLowerProbeNav");
btnRaiseProbeRepElement = document.getElementById("btnRaiseProbeRep");
btnLowerProbeRepElement = document.getElementById("btnLowerProbeRep");
btnRaiseProbeHazElement = document.getElementById("btnRaiseProbeHaz");
btnLowerProbeHazElement = document.getElementById("btnLowerProbeHaz");
btnRaiseProbeFacElement = document.getElementById("btnRaiseProbeFac");
btnLowerProbeFacElement = document.getElementById("btnLowerProbeFac");
btnRaiseProbeHarvElement = document.getElementById("btnRaiseProbeHarv");
btnLowerProbeHarvElement = document.getElementById("btnLowerProbeHarv");
btnRaiseProbeWireElement = document.getElementById("btnRaiseProbeWire");
btnLowerProbeWireElement = document.getElementById("btnLowerProbeWire");
btnRaiseProbeCombatElement = document.getElementById("btnRaiseProbeCombat");
btnLowerProbeCombatElement = document.getElementById("btnLowerProbeCombat");
coverElement = document.getElementById("cover");
hypnoDroneEventDivElement = document.getElementById("hypnoDroneEventDiv");
unusedClipsDisplayElement = document.getElementById("unusedClipsDisplay");
transWireElement = document.getElementById("transWire");
nanoWireElement = document.getElementById("nanoWire");
clipsElement = document.getElementById("clips");
unsoldClipsElement = document.getElementById("unsoldClips");
yomiDisplayElement = document.getElementById('yomiDisplay');
projectListTopElement = document.getElementById("projectListTop");
investmentLevelElement = document.getElementById("investmentLevel");
driftersKilledElement = document.getElementById('driftersKilled');
availableMatterDisplayElement = document.getElementById('availableMatterDisplay');
honorDisplayElement = document.getElementById("honorDisplay");
clipmakerLevel2Element = document.getElementById('clipmakerLevel2');
clipperCostElement = document.getElementById('clipperCost');
acquiredMatterDisplayElement = document.getElementById('acquiredMatterDisplay');
nanoWireElement = document.getElementById('nanoWire');
probesBornDisplayElement = document.getElementById('probesBornDisplay');
probesTotalDisplayElement = document.getElementById('probesTotalDisplay');
probesLaunchedDisplayElement = document.getElementById('probesLaunchedDisplay');
probeCostDisplayElement = document.getElementById('probeCostDisplay');
probeCombatDisplayElement = document.getElementById('probeCombatDisplay');
probeWireDisplayElement = document.getElementById('probeWireDisplay');
probeHarvDisplayElement = document.getElementById('probeHarvDisplay');
probeFacDisplayElement = document.getElementById('probeFacDisplay');
probeRepDisplayElement = document.getElementById('probeRepDisplay');
probeHazDisplayElement = document.getElementById('probeHazDisplay');
probeNavDisplayElement = document.getElementById('probeNavDisplay');
probeSpeedDisplayElement = document.getElementById('probeSpeedDisplay');
probeTrustDisplayElement = document.getElementById('probeTrustDisplay');
memoryElement = document.getElementById("memory");
processorsElement = document.getElementById("processors");
marginElement = document.getElementById("margin");
marketingLvlElement = document.getElementById('marketingLvl');
adCostElement = document.getElementById('adCost');
factoryCostDisplayElement = document.getElementById('factoryCostDisplay');
factoryLevelDisplayElement = document.getElementById('factoryLevelDisplay');
wireDroneCostDisplayElement = document.getElementById('wireDroneCostDisplay');
wireDroneLevelDisplayElement = document.getElementById('wireDroneLevelDisplay');
harvesterCostDisplayElement = document.getElementById('harvesterCostDisplay');
harvesterLevelDisplayElement = document.getElementById('harvesterLevelDisplay');
megaClipperCostElement = document.getElementById('megaClipperCost');
megaClipperLevelElement = document.getElementById('megaClipperLevel');
investmentBankrollElement = document.getElementById('investmentBankroll');
secValueElement = document.getElementById('secValue');
portValueElement = document.getElementById('portValue');
investUpgradeCostElement = document.getElementById("investUpgradeCost");
prestigeUcounterElement = document.getElementById("prestigeUcounter");
prestigeScounterElement = document.getElementById("prestigeScounter");
newTourneyCostElement = document.getElementById("newTourneyCost");
maxTrustDisplayElement = document.getElementById("maxTrustDisplay");
victoryDivElement = document.getElementById("victoryDiv");
probeTrustCostDisplayElement = document.getElementById("probeTrustCostDisplay");
tournamentResultsTableElement = document.getElementById("tournamentResultsTable");
farmCostElement = document.getElementById('farmCost');
batteryCostElement = document.getElementById('batteryCost');
farmLevelElement = document.getElementById('farmLevel');
batteryLevelElement = document.getElementById('batteryLevel');
availableMatterDisplayElement = document.getElementById('availableMatterDisplay');
acquiredMatterDisplayElement = document.getElementById('acquiredMatterDisplay');
mapsElement = document.getElementById('maps');
nanoWireElement = document.getElementById('nanoWire');
wppsElement = document.getElementById('wpps');
probeDesignDivElement = document.getElementById("probeDesignDiv");
increaseProbeTrustDivElement = document.getElementById("increaseProbeTrustDiv");
increaseMaxTrustDivElement = document.getElementById("increaseMaxTrustDiv");
spaceDivElement = document.getElementById("spaceDiv");
battleCanvasDivElement = document.getElementById("battleCanvasDiv");
honorDivElement = document.getElementById("honorDiv");
wireProductionDivElement = document.getElementById("wireProductionDiv");
wireTransDivElement = document.getElementById("wireTransDiv");
swarmGiftDivElement = document.getElementById("swarmGiftDiv");
swarmEngineElement = document.getElementById("swarmEngine");
swarmSliderDivElement = document.getElementById("swarmSliderDiv");
factoryDivSpaceElement = document.getElementById("factoryDivSpace");
clipsPerSecDivElement = document.getElementById("clipsPerSecDiv");
tothDivElement = document.getElementById("tothDiv");
strategyEngineElement = document.getElementById("strategyEngine");
tournamentManagementElement = document.getElementById("tournamentManagement");
btnQcomputeElement = document.getElementById("btnQcompute");
qComputingElement = document.getElementById("qComputing");
transWireElement = document.getElementById("transWire");
processorDisplayElement = document.getElementById("processorDisplay");
compDivElement = document.getElementById("compDiv");
projectsDivElement = document.getElementById("projectsDiv");
creationDivElement = document.getElementById("creationDiv");
stratPickerElement = document.getElementById("stratPicker");
investUpgradeCostElement = document.getElementById("investUpgradeCost");
yomiDisplayElement = document.getElementById("yomiDisplay");
investmentBankrollElement = document.getElementById('investmentBankroll');
secValueElement = document.getElementById('secValue');
portValueElement = document.getElementById('portValue');
investStratElement = document.getElementById("investStrat");
btnRunTournamentElement = document.getElementById("btnRunTournament");
vertStratElement = document.getElementById("vertStrat");
horizStratElement = document.getElementById("horizStrat");
vLabelaElement = document.getElementById("vLabela");
vLabelbElement = document.getElementById("vLabelb");
hLabelaElement = document.getElementById("hLabela");
hLabelbElement = document.getElementById("hLabelb");
aaPayoffHElement = document.getElementById("aaPayoffH");
aaPayoffVElement = document.getElementById("aaPayoffV");
abPayoffHElement = document.getElementById("abPayoffH");
abPayoffVElement = document.getElementById("abPayoffV");
baPayoffHElement = document.getElementById("baPayoffH");
baPayoffVElement = document.getElementById("baPayoffV");
bbPayoffHElement = document.getElementById("bbPayoffH");
bbPayoffVElement = document.getElementById("bbPayoffV");
autoTourneyStatusElement = document.getElementById('autoTourneyStatus');
tournamentTableElement = document.getElementById("tournamentTable");
tournamentResultsTableElement = document.getElementById("tournamentResultsTable");
tourneyDisplayElement = document.getElementById("tourneyDisplay");
payoffCellAAElement = document.getElementById("payoffCellAA");
payoffCellABElement = document.getElementById("payoffCellAB");
payoffCellBAElement = document.getElementById("payoffCellBA");
payoffCellBBElement = document.getElementById("payoffCellBB");
clipmakerLevel2Element = document.getElementById('clipmakerLevel2');
clipperCostElement = document.getElementById('clipperCost');
megaClipperLevelElement = document.getElementById('megaClipperLevel');
megaClipperCostElement = document.getElementById('megaClipperCost');
nextFactoryUpgradeElement = document.getElementById("nextFactoryUpgrade");
nextDroneUpgradeElement = document.getElementById("nextDroneUpgrade");
factoryLevelDisplayElement = document.getElementById('factoryLevelDisplay');
factoryCostDisplayElement = document.getElementById('factoryCostDisplay');
harvesterLevelDisplayElement = document.getElementById('harvesterLevelDisplay');
harvesterCostDisplayElement = document.getElementById('harvesterCostDisplay');
wireDroneLevelDisplayElement = document.getElementById('wireDroneLevelDisplay');
wireDroneCostDisplayElement = document.getElementById('wireDroneCostDisplay');
btnMakeHarvesterElement = document.getElementById("btnMakeHarvester");
btnHarvesterx10Element = document.getElementById("btnHarvesterx10");
btnHarvesterx100Element = document.getElementById("btnHarvesterx100");
btnHarvesterx1000Element = document.getElementById("btnHarvesterx1000");
btnMakeWireDroneElement = document.getElementById("btnMakeWireDrone");
btnWireDronex10Element = document.getElementById("btnWireDronex10");
btnWireDronex100Element = document.getElementById("btnWireDronex100");
btnWireDronex1000Element = document.getElementById("btnWireDronex1000");
sliderElement = document.getElementById("slider");
btnSynchSwarmElement = document.getElementById("btnSynchSwarm");
btnEntertainSwarmElement = document.getElementById("btnEntertainSwarm");
swarmSizeElement = document.getElementById("swarmSize");
swarmGiftsElement = document.getElementById("swarmGifts");
swarmStatusElement = document.getElementById("swarmStatus");
giftCountdownElement = document.getElementById("giftCountdown");
giftTimerElement = document.getElementById("giftTimer");
feedButtonDivElement = document.getElementById("feedButtonDiv");
teachButtonDivElement = document.getElementById("teachButtonDiv");
swarmEntertainCostElement = document.getElementById("swarmEntertainCost");
entertainButtonDivElement = document.getElementById("entertainButtonDiv");
cladButtonDivElement = document.getElementById("cladButtonDiv");
synchButtonDivElement = document.getElementById("synchButtonDiv");
swarmStatusDivElement = document.getElementById("swarmStatusDiv");
swarmEngineElement = document.getElementById("swarmEngine");
farmLevelElement = document.getElementById('farmLevel');
farmCostElement = document.getElementById('farmCost');
batteryLevelElement = document.getElementById('batteryLevel');
batteryCostElement = document.getElementById('batteryCost');
powerProductionRateElement = document.getElementById("powerProductionRate");
powerConsumptionRateElement = document.getElementById("powerConsumptionRate");
storedPowerElement = document.getElementById("storedPower");
facPowConRateElement = document.getElementById("facPowConRate");
dronePowConRateElement = document.getElementById("dronePowConRate");
maxStorageElement = document.getElementById("maxStorage");
performanceElement = document.getElementById("performance");
btnMakeFarmElement = document.getElementById("btnMakeFarm");
btnMakeBatteryElement = document.getElementById("btnMakeBattery");
btnFarmRebootElement = document.getElementById("btnFarmReboot");
btnBatteryRebootElement = document.getElementById("btnBatteryReboot");
btnFarmx10Element = document.getElementById("btnFarmx10");
btnFarmx100Element = document.getElementById("btnFarmx100");
btnBatteryx10Element = document.getElementById("btnBatteryx10");
btnBatteryx100Element = document.getElementById("btnBatteryx100");
powerDivElement = document.getElementById("powerDiv");
adCostElement = document.getElementById('adCost');
marketingLvlElement = document.getElementById('marketingLvl');
demandElement = document.getElementById("demand");
marginElement = document.getElementById("margin");
inchSpanElement = document.getElementById("inchSpan");
demandElement = document.getElementById("demand");
operationsElement = document.getElementById("operations");
trustElement = document.getElementById("trust");
nextTrustElement = document.getElementById("nextTrust");
creativityElement = document.getElementById("creativity");
factoryLevelDisplaySpaceElement = document.getElementById("factoryLevelDisplaySpace");
harvesterLevelSpaceElement = document.getElementById("harvesterLevelSpace");
wireDroneLevelSpaceElement = document.getElementById("wireDroneLevelSpace");
maxOpsElement = document.getElementById("maxOps");
avgSalesElement = document.getElementById("avgSales");
avgRevElement = document.getElementById("avgRev");
probeTrustCostDisplayElement = document.getElementById('probeTrustCostDisplay');
mdpsElement = document.getElementById('mdps');
colonizedDisplayElement = document.getElementById('colonizedDisplay');
probesLostHazardsDisplayElement = document.getElementById('probesLostHazardsDisplay');
probesTotalDisplayElement = document.getElementById('probesTotalDisplay');
probesLostDriftDisplayElement = document.getElementById('probesLostDriftDisplay');
probesTotalDisplayElement = document.getElementById('probesTotalDisplay');
drifterCountElement = document.getElementById('drifterCount');
mapsElement = document.getElementById('maps');
swarmGiftDivElement = document.getElementById("swarmGiftDiv");
swarmEngineElement = document.getElementById("swarmEngine");
clipsPerSecDivElement = document.getElementById("clipsPerSecDiv");
tothDivElement = document.getElementById("tothDiv");
clipmakerRateElement = document.getElementById("clipmakerRate");
clipmakerRate2Element = document.getElementById("clipmakerRate2");
stockSymbolElements.push(document.getElementById("stock1Symbol"));
stockAmountElements.push(document.getElementById("stock1Amount"));
stockPriceElements.push(document.getElementById("stock1Price"));
stockTotalElements.push(document.getElementById("stock1Total"));
stockProfitElements.push(document.getElementById("stock1Profit"));
stockSymbolElements.push(document.getElementById("stock2Symbol"));
stockAmountElements.push(document.getElementById("stock2Amount"));
stockPriceElements.push(document.getElementById("stock2Price"));
stockTotalElements.push(document.getElementById("stock2Total"));
stockProfitElements.push(document.getElementById("stock2Profit"));
stockSymbolElements.push(document.getElementById("stock3Symbol"));
stockAmountElements.push(document.getElementById("stock3Amount"));
stockPriceElements.push(document.getElementById("stock3Price"));
stockTotalElements.push(document.getElementById("stock3Total"));
stockProfitElements.push(document.getElementById("stock3Profit"));
stockSymbolElements.push(document.getElementById("stock4Symbol"));
stockAmountElements.push(document.getElementById("stock4Amount"));
stockPriceElements.push(document.getElementById("stock4Price"));
stockTotalElements.push(document.getElementById("stock4Total"));
stockProfitElements.push(document.getElementById("stock4Profit"));
stockSymbolElements.push(document.getElementById("stock5Symbol"));
stockAmountElements.push(document.getElementById("stock5Amount"));
stockPriceElements.push(document.getElementById("stock5Price"));
stockTotalElements.push(document.getElementById("stock5Total"));
stockProfitElements.push(document.getElementById("stock5Profit"));
tourneyResultsElements.push(document.getElementById("results0"));
tourneyResultsElements.push(document.getElementById("results1"));
tourneyResultsElements.push(document.getElementById("results2"));
tourneyResultsElements.push(document.getElementById("results3"));
tourneyResultsElements.push(document.getElementById("results4"));
tourneyResultsElements.push(document.getElementById("results5"));
tourneyResultsElements.push(document.getElementById("results6"));
tourneyResultsElements.push(document.getElementById("results7"));
}
var clipmakerRateElement;
var clipmakerRate2Element;
var availableMatterDisplayElement;
var acquiredMatterDisplayElement;
var mapsElement;
var nanoWireElement;
var wppsElement;
var probeDesignDivElement;
var increaseProbeTrustDivElement;
var increaseMaxTrustDivElement;
var spaceDivElement;
var battleCanvasDivElement;
var honorDivElement;
var wireProductionDivElement;
var wireTransDivElement;
var swarmGiftDivElement;
var swarmEngineElement;
var swarmSliderDivElement;
var factoryDivSpaceElement;
var clipsPerSecDivElement;
var tothDivElement;
var strategyEngineElement;
var tournamentManagementElement;
var btnQcomputeElement;
var qComputingElement;
var transWireElement;
var processorDisplayElement;
var compDivElement;
var projectsDivElement;
var creationDivElement;
var stratPickerElement;
var investUpgradeCostElement;
var yomiDisplayElement;
var investmentBankrollElement;
var fundsElement;
var secValueElement;
var portValueElement;
var investStratElement;
var btnRunTournamentElement;
var vertStratElement;
var horizStratElement;
var vLabelaElement;
var vLabelbElement;
var hLabelaElement;
var hLabelbElement;
var aaPayoffHElement;
var aaPayoffVElement;
var abPayoffHElement;
var abPayoffVElement;
var baPayoffHElement;
var baPayoffVElement;
var bbPayoffHElement;
var bbPayoffVElement;
var autoTourneyStatusElement;
var tournamentTableElement;
var tournamentResultsTableElement;
var tourneyDisplayElement;
var payoffCellAAElement;
var payoffCellABElement;
var payoffCellBAElement;
var payoffCellBBElement;
var clipmakerLevel2Element;
var clipperCostElement;
var megaClipperLevelElement;
var megaClipperCostElement;
var nextFactoryUpgradeElement;
var nextDroneUpgradeElement;
var factoryLevelDisplayElement;
var factoryCostDisplayElement;
var harvesterLevelDisplayElement;
var harvesterCostDisplayElement;
var wireDroneLevelDisplayElement;
var wireDroneCostDisplayElement;
var btnMakeHarvesterElement;
var btnHarvesterx10Element;
var btnHarvesterx100Element;
var btnHarvesterx1000Element;
var btnMakeWireDroneElement;
var btnWireDronex10Element;
var btnWireDronex100Element;
var btnWireDronex1000Element;
var sliderElement;
var btnSynchSwarmElement;
var btnEntertainSwarmElement;
var swarmSizeElement;
var swarmGiftsElement;
var swarmStatusElement;
var giftCountdownElement;
var giftTimerElement;
var feedButtonDivElement;
var teachButtonDivElement;
var swarmEntertainCostElement;
var entertainButtonDivElement;
var cladButtonDivElement;
var synchButtonDivElement;
var swarmStatusDivElement;
var swarmEngineElement;
var farmLevelElement;
var farmCostElement;
var batteryLevelElement;
var batteryCostElement;
var powerProductionRateElement;
var powerConsumptionRateElement;
var storedPowerElement;
var facPowConRateElement;
var dronePowConRateElement;
var maxStorageElement;
var performanceElement;
var btnMakeFarmElement;
var btnMakeBatteryElement;
var btnFarmRebootElement;
var btnBatteryRebootElement;
var btnFarmx10Element;
var btnFarmx100Element;
var btnBatteryx10Element;
var btnBatteryx100Element;
var powerDivElement;
var adCostElement;
var marketingLvlElement;
var demandElement;
var marginElement;
var inchSpanElement;
var demandElement;
var operationsElement;
var trustElement;
var nextTrustElement;
var creativityElement;
var factoryLevelDisplaySpaceElement;
var harvesterLevelSpaceElement;
var wireDroneLevelSpaceElement;
var maxOpsElement;
var avgSalesElement;
var avgRevElement;
var probeTrustCostDisplayElement;
var mdpsElement;
var colonizedDisplayElement;
var probesLostHazardsDisplayElement;
var probesTotalDisplayElement;
var probesLostDriftDisplayElement;
var probesTotalDisplayElement;
var drifterCountElement;
var mapsElement;
var swarmGiftDivElement;
var swarmEngineElement;
var clipsPerSecDivElement;
var tothDivElement;
var prestigeUcounterElement;
var prestigeScounterElement;
var newTourneyCostElement;
var maxTrustDisplayElement;
var victoryDivElement;
var probeTrustCostDisplayElement;
var tournamentResultsTableElement;
var farmCostElement;
var batteryCostElement;
var farmLevelElement;
var batteryLevelElement;
var wireDroneCostDisplayElement;
var wireDroneLevelDisplayElement;
var harvesterCostDisplayElement;
var harvesterLevelDisplayElement;
var megaClipperCostElement;
var megaClipperLevelElement;
var investmentBankrollElement;
var secValueElement;
var portValueElement;
var investUpgradeCostElement;
var driftersKilledElement;
var availableMatterDisplayElement;
var honorDisplayElement;
var clipmakerLevel2Element;
var clipperCostElement;
var acquiredMatterDisplayElement;
var nanoWireElement;
var probesBornDisplayElement;
var probesTotalDisplayElement;
var probesLaunchedDisplayElement;
var probeCostDisplayElement;
var probeCombatDisplayElement;
var probeWireDisplayElement;
var probeHarvDisplayElement;
var probeFacDisplayElement;
var probeRepDisplayElement;
var probeHazDisplayElement;
var probeNavDisplayElement;
var probeSpeedDisplayElement;
var probeTrustDisplayElement;
var memoryElement;
var processorsElement;
var marginElement;
var marketingLvlElement;
var adCostElement;
var factoryCostDisplayElement;
var factoryLevelDisplayElement;
var yomiDisplayElement;
var projectListTopElement;
var investmentLevelElement;
var wireCostElement;
var wireBuyerStatusElement;
var wireElement;
var qCompDisplayElement;
var hypnoDroneTextElement;
var hypnoDroneEventDivElement;
var readoutElement1;
var readoutElement2;
var readoutElement3;
var readoutElement4;
var readoutElement5;
var readoutElement6;
var readoutElement7;
var readoutElement8;
var readoutElementTime;
var mpdsDivElement;
var factoryRebootToolTipElement;
var havesterRebootToolTipElement;
var wireDroneRebootToolTipElement;
var farmRebootToolTipElement;
var batteryRebootToolTipElement;
var swarmSliderDivElement;
var clipCountCrunchedElement;
var autoTourneyStatusDivElement;
var autoTourneyControlElement;
var wireBuyerDivElement;
var tournamentResultsTableElement;
var tournamentStuffElement;
var increaseMaxTrustDivElement;
var honorDivElement;
var drifterDivElement;
var battleCanvasDivElement;
var combatButtonDivElement;
var factoryUpgradeDisplayElement;
var droneUpgradeDisplayElement;
var btnIncreaseMaxTrustElement;
var btnMakerProbeElement;
var hazardBodyCountElement;
var probesLostHazardsDisplayElement;
var driftBodyCountElement;
var combatBodyCountElement;
var prestigeDivElement;
var btnMakePaperclipElement;
var btnBuyWireElement;
var btnMakeClipperElement;
var btnExpandMarketingElement;
var btnLowerPriceElement;
var btnAddProcElement;
var btnAddMemElement;
var btnNewTournamentElement;
var btnImproveInvestmentsElement;
var investmentEngineElement;
var investmentEngineUpgradeElement;
var strategyEngineElement;
var tournamentManagementElement;
var megaClipperDivElement;
var btnMakeMegaClipperElement;
var autoClipperDivElement;
var revPerSecDivElement;
var compDivElement;
var creativityDivElement;
var projectsDivElement;
var businessDivElement;
var manufacturingDivElement;
var trustDivElement;
var creationDivElement;
var factoryDivElement;
var wireProductionDivElement;
var wireTransDivElement;
var harvesterDivElement;
var wireDroneDivElement;
var tothDivElement;
var spaceDivElement;
var factoryDivSpaceElement;
var droneDivSpaceElement;
var probeDesignDivElement;
var increaseProbeTrustDivElement;
var qComputingElement;
var btnMakeFactoryElement;
var btnHarvesterRebootElement;
var btnWireDroneRebootElement;
var btnFactoryRebootElement;
var probeTrustUsedDisplayElement;
var btnIncreaseProbeTrustElement;
var btnRaiseProbeSpeedElement;
var btnLowerProbeSpeedElement;
var btnRaiseProbeNavElement;
var btnLowerProbeNavElement;
var btnRaiseProbeRepElement;
var btnLowerProbeRepElement;
var btnRaiseProbeHazElement;
var btnLowerProbeHazElement;
var btnRaiseProbeFacElement;
var btnLowerProbeFacElement;
var btnRaiseProbeHarvElement;
var btnLowerProbeHarvElement;
var btnRaiseProbeWireElement;
var btnLowerProbeWireElement;
var btnRaiseProbeCombatElement;
var btnLowerProbeCombatElement;
var coverElement;
var unusedClipsDisplayElement;
var transWireElement;
var nanoWireElement;
var clipsElement;
var unsoldClipsElement;
var stockSymbolElements = [];
var stockAmountElements = [];
var stockPriceElements = [];
var stockTotalElements = [];
var stockProfitElements = [];
var tourneyResultsElements = [];
// Cache
cacheDOMElements();
// Wire --------------------------------------------------------
function adjustWirePrice(){
wirePriceTimer++;
if (wirePriceTimer>250 && wireBasePrice>15){
wireBasePrice = wireBasePrice - (wireBasePrice/1000);
wirePriceTimer = 0;
}
if (Math.random() < .015) {
wirePriceCounter++;
var wireAdjust = 6*(Math.sin(wirePriceCounter));
wireCost = Math.ceil(wireBasePrice + wireAdjust);
wireCostElement.innerHTML = wireCost;
}
}
function toggleWireBuyer(){
if (wireBuyerStatus==1){
wireBuyerStatus=0;
wireBuyerStatusElement.innerHTML = "OFF";
} else {
wireBuyerStatus=1;
wireBuyerStatusElement.innerHTML = "ON";
}
}
function buyWire(){
if(funds >= wireCost){
wirePriceTimer = 0;
wire = wire + wireSupply;
funds = funds - wireCost;
wirePurchase = wirePurchase + 1;
wireBasePrice = wireBasePrice + .05;
wireElement.innerHTML = formatWithCommas(Math.floor(wire));
fundsElement.innerHTML = formatWithCommas(funds, 2);
}
}
// QCHIPS -----------------------------------------------------------
var qChips = [];
var qChipsElements = [];
var qChip0 = {
waveSeed: .1,
value: 0,
active: 0,
}
qChips.push(qChip0);
qChipsElements.push(document.getElementById("qChip0"));
var qChip1 = {
waveSeed: .2,
value: 0,
active: 0,
}
qChips.push(qChip1);
qChipsElements.push(document.getElementById("qChip1"));
var qChip2 = {
waveSeed: .3,
value: 0,
active: 0,
}
qChips.push(qChip2);
qChipsElements.push(document.getElementById("qChip2"));
var qChip3 = {
waveSeed: .4,
value: 0,
active: 0,
}
qChips.push(qChip3);
qChipsElements.push(document.getElementById("qChip3"));
var qChip4 = {
waveSeed: .5,
value: 0,
active: 0,
}
qChips.push(qChip4);
qChipsElements.push(document.getElementById("qChip4"));
var qChip5 = {
waveSeed: .6,
value: 0,
active: 0,
}
qChips.push(qChip5);
qChipsElements.push(document.getElementById("qChip5"));
var qChip6 = {
waveSeed: .7,
value: 0,
active: 0,
}
qChips.push(qChip6);
qChipsElements.push(document.getElementById("qChip6"));
var qChip7 = {
waveSeed: .8,
value: 0,
active: 0,
}
qChips.push(qChip7);
qChipsElements.push(document.getElementById("qChip7"));
var qChip8 = {
waveSeed: .9,
value: 0,
active: 0,
}
qChips.push(qChip8);
qChipsElements.push(document.getElementById("qChip8"));
var qChip9 = {
waveSeed: 1,
value: 0,
active: 0,
}
qChips.push(qChip9);
qChipsElements.push(document.getElementById("qChip9"));
function quantumCompute(){
qClock = qClock+.01;
for (var i = 0; i<qChips.length; i++){
qChips[i].value = Math.sin(qClock*qChips[i].waveSeed*qChips[i].active);
qChipsElements[i].style.opacity=qChips[i].value;
}
}
function qComp(){
qFade = 1;
var q = 0;
if (qChips[0].active == 0){
qCompDisplayElement.innerHTML = "Need Photonic Chips";
} else {
for (var i = 0; i<qChips.length; i++){
q = q+qChips[i].value;
}
var qq = Math.ceil(q*360);
var buffer = (memory*1000) - standardOps;
var damper = (tempOps/100)+5;
if (qq>buffer) {
tempOps = tempOps + Math.ceil(qq/damper) - buffer;
qq = buffer;
opFade = .01;
opFadeTimer = 0;
}
standardOps = standardOps + qq;
qCompDisplayElement.innerHTML = "qOps: " + formatWithCommas(Math.ceil(q*360));
}
}
function manageProjects(){
for(var i = 0; i < projects.length; i++){
if (projects[i].trigger() && (projects[i].uses > 0)){
displayProjects(projects[i]);
projects[i].uses = projects[i].uses - 1;
activeProjects.push(projects[i]);
}
}
for(var i = 0; i < activeProjects.length; i++){
if (activeProjects[i].cost()){
activeProjects[i].element.disabled = false;
} else {
activeProjects[i].element.disabled = true;
}
}
}
function displayProjects(project){
project.element = document.createElement("button");
project.element.setAttribute("id", project.id);
project.element.onclick = function(){project.effect()};
project.element.setAttribute("class", "projectButton");
projectListTopElement.appendChild(project.element, projectListTopElement.firstChild);
var span = document.createElement("span");
span.style.fontWeight = "bold";
project.element.appendChild(span);
var title = document.createTextNode(project.title);
span.appendChild(title);
var cost = document.createTextNode(project.priceTag);
project.element.appendChild(cost);
var div = document.createElement("div");
project.element.appendChild(div);
var description = document.createTextNode(project.description);
project.element.appendChild(description);
blink(project.element);
}
// HYPNODRONE EVENT ----------------------------------------------------------------
hypnoDroneEventDivElement.style.display = "none";
var longBlinkCounter = 0;
function longBlink(element){
{
var handle = setInterval(function () { longToggleVisibility(element)}, 32);
}
function longToggleVisibility(element){
longBlinkCounter++;
if (longBlinkCounter > 5 && longBlinkCounter < 10){
hypnoDroneTextElement.innerHTML="Release";
}
if (longBlinkCounter > 30 && longBlinkCounter < 40){
hypnoDroneTextElement.innerHTML="<br /><br /><br />Release";
}
if (longBlinkCounter > 45 && longBlinkCounter < 55){
hypnoDroneTextElement.innerHTML="<br />Release";
}
if (longBlinkCounter > 55){
hypnoDroneTextElement.innerHTML="Release<br/>the<br/>Hypno<br/>Drones";
}
if (longBlinkCounter >= 120){
//console.log("weed wizzard");
clearInterval(handle);
longBlinkCounter = 0;
element.style.display = "none";
} else {
if (element.style.display != ""){
element.style.display = "";
} else {
element.style.display = "none";
}
}
}
}
function hypnoDroneEvent(){
hypnoDroneTextElement.innerHTML="Release";
longBlink(hypnoDroneEventDivElement);
}
// MESSAGES ------------------------------------------------------------------------
function displayMessage(msg){
readoutElement8.innerHTML = readoutElement7.innerHTML;
readoutElement7.innerHTML = readoutElement6.innerHTML;
readoutElement6.innerHTML = readoutElement5.innerHTML;
readoutElement5.innerHTML = readoutElement4.innerHTML;
readoutElement4.innerHTML = readoutElement3.innerHTML;
readoutElement3.innerHTML = readoutElement2.innerHTML;
readoutElement2.innerHTML = readoutElement1.innerHTML;
readoutElement1.innerHTML = msg;
}