-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmuggle.js
More file actions
2180 lines (1972 loc) · 122 KB
/
Copy pathsmuggle.js
File metadata and controls
2180 lines (1972 loc) · 122 KB
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
cg.createImage({
"id" : "interiorFront",
"file":"interior-front.png"
});
cg.createImage({
"id" : "interiorMiddle",
"file":"interior-middle.png"
});
cg.createImage({
"id" : "interiorBack",
"file":"interior-back.png"
});
cg.createImage({
"id" : "turntable",
"file":"turntable.png"
});
cg.createImage({
"id" : "foreground",
"file":"foreground.png"
});
cg.createImage({
"id" : "midground",
"file":"midground.png"
});
cg.createImage({
"id" : "background",
"file":"background.png"
});
cg.createImage({
"id" : "cockpitBase",
"file":"cockpit-base.png"
});
cg.createImage({
"id" : "cockpitTop",
"file":"cockpit-top.png"
});
cg.createImage({
"id" : "cockpitLightOff",
"file":"cockpit-light-off.png"
});
cg.createImage({
"id" : "cockpitLightRed",
"file":"cockpit-light-red.png"
});
cg.createImage({
"id" : "cockpitLightWhite",
"file":"cockpit-light-white.png"
});
cg.createImage({
"id" : "cockpitLightLightspeed",
"file":"cockpit-light-lightspeed.png"
});
cg.createImage({
"id" : "cockpitLightPilots",
"file":"cockpit-light-pilots.png"
});
cg.createImage({
"id" : "hondo",
"file":"hondo.png"
});
cg.createImage({
"id" : "r5p8",
"file":"r5p8.png"
});
cg.createImage({
"id" : "spark",
"file":"spark.png"
});
cg.createImage({
"id" : "preshowLight",
"file":"preshow-light.png"
});
let sparkGraphicBase = cg.createGraphic({type:"image",image:cg.images.spark,width:35,height:35})
let turntableGraphic = cg.createGraphic({type:"image",image:cg.images.turntable,width:670/2,height:670/2});
let guestGraphic = cg.createGraphic({type:"arc",radius:2.5,colour:"#ffffff",fill:true});
let cockpitBaseGraphic = cg.createGraphic({type:"image",image:cg.images.cockpitBase,width:50,height:50});
let cockpitTopGraphic = cg.createGraphic({type:"image",image:cg.images.cockpitTop,width:50,height:50});
let cockpitLightMainGraphic = cg.createGraphic({type:"image",image:cg.images.cockpitLightOff,width:50,height:50});
let cockpitLightRedGraphic = cg.createGraphic({type:"image",image:cg.images.cockpitLightRed,width:50,height:50});
let cockpitLightWhiteGraphic = cg.createGraphic({type:"image",image:cg.images.cockpitLightWhite,width:50,height:50});
let cockpitLightLightspeedGraphic = cg.createGraphic({type:"image",image:cg.images.cockpitLightLightspeed,width:50,height:50});
let cockpitLightPilotsGraphic = cg.createGraphic({type:"image",image:cg.images.cockpitLightPilots,width:50,height:50});
let TTRotationTime = 12; // Time in seconds that for the turntable to rotate one position
// TTRotationTime = 1;
let TTPos = {
"A" : [328.5,724], // Turntable A Centre position
"B" : [159,437], // Turntable B Centre position
"C" : [678,160], // Turntable C Centre position
"D" : [1010.5,160], // Turntable D Centre position
"AR" : 0, // Turntable A Base Rotation
"BR" : 23, // Turntable B Base Rotation
"CR" : 120.5, // Turntable C Base Rotation
"DR" : 143.2, // Turntable D Base Rotation
"1" : 360*(0.5/7),
"2" : 360*(1.5/7),
"3" : 360*(2.5/7),
"4" : 360*(3.5/7),
"5" : 360*(4.5/7),
"6" : 360*(5.5/7),
"7" : 360*(6.5/7),
"8" : 360*(7.5/7),
}
let leftAnim = {
"to_preshowA" : [[646,550],[641,543],[640,540],[636,536],[631,532],[622,530],[602,525],[591,516],[580,492]],
"to_preshowB" : [[646,550],[642,543],[637,537],[631,535],[626,535],[617,535],[610,532],[595,522],[585,511],[580,494]],
"exit_singlerider" : [[565,533],[561,528]],
"crewMake_pilotL" : [[546,529]],
"crewMake_pilotR" : [[547,523]],
"crewMake_gunnerL" : [[551,529]],
"crewMake_gunnerR" : [[552,522]],
"crewMake_engineerL" : [[557,529]],
"crewMake_engineerR" : [[558,522]],
"merge->chess" : [[545,525],[539,522],[535,518],[534,513],[532,509],[526,504],[519,499],[511,496],[503,496],[497,500],[489,508],[483,512],[476,515],[468,516],[464,516]],
"closeCall->Briefing" : [[377,514],[371,511],[367,509],[362,511],[358,516]],
"closeBriefing_pilotL" : [[345,540]],
"closeBriefing_pilotR" : [[339,541]],
"closeBriefing_gunnerL" : [[349,534]],
"closeBriefing_gunnerR" : [[343,534]],
"closeBriefing_engineerL" : [[354,528]],
"closeBriefing_engineerR" : [[347,528]],
"farCall->Briefing" : [[463,490],[467,490],[472,489],[475,485],[476,480],[476,473],[475,468],[472,465],[466,463],[459,463],[451,463],[442,463],[435,463],[426,463],[421,463],[416,461],[414,456],[413,449],[410,445],[404,443],[398,441],[393,440],[387,440],[379,441],[372,444],[368,447],[365,448],[363,447],[361,444],[357,440],[352,435]],
"farBriefing_pilotL" : [[329,415]],
"farBriefing_pilotR" : [[330,408]],
"farBriefing_gunnerL" : [[335,421]],
"farBriefing_gunnerR" : [[335,414]],
"farBriefing_engineerL" : [[340,426]],
"farBriefing_engineerR" : [[340,420]],
"to_farCockpit" : [[324,406],[318,400],[314,397],[310,397],[303,398],[294,400],[286,402]],
"farCockpit_pilotL" : [[270,410]],
"farCockpit_pilotR" : [[267,402]],
"farCockpit_gunnerL" : [[278,409]],
"farCockpit_gunnerR" : [[275,399]],
"farCockpit_engineerL" : [[285,408]],
"farCockpit_engineerR" : [[281,396]],
"farUnload_pilotL" : [[207,334]],
"farUnload_pilotR" : [[200,331]],
"farUnload_gunnerL" : [[211,327]],
"farUnload_gunnerR" : [[202,323]],
"farUnload_engineerL" : [[215,321]],
"farUnload_engineerR" : [[204,316]],
"to_closeCockpit" : [[336,547],[329,556],[328,559],[328,567],[328,581],[328,595]],
"closeCockpit_pilotL" : [[333,610]],
"closeCockpit_pilotR" : [[324,610]],
"closeCockpit_gunnerL" : [[334,602]],
"closeCockpit_gunnerR" : [[323,602]],
"closeCockpit_engineerL" : [[335,595]],
"closeCockpit_engineerR" : [[322,595]],
"closeUnload_pilotL" : [[420,656]],
"closeUnload_pilotR" : [[415,650]],
"closeUnload_gunnerL" : [[427,652]],
"closeUnload_gunnerR" : [[421,644]],
"closeUnload_engineerL" : [[433,648]],
"closeUnload_engineerR" : [[426,639]],
"farCall->ADABriefing" : [[462,490],[467,490],[472,489],[475,485],[477,481],[477,475],[475,472],[476,469],[480,466],[484,463],[491,457],[494,454],[494,451],[493,448]],
"ADABriefing_pilotL" : [[475,440]],
"ADABriefing_pilotR" : [[478,435]],
"ADABriefing_gunnerL" : [[480,443]],
"ADABriefing_gunnerR" : [[483,437]],
"ADABriefing_engineerL" : [[485,445]],
"ADABriefing_engineerR" : [[488,440]],
"to_ADACockpit" : [[470,435],[467,435],[463,434],[461,429],[461,420],[461,411],[461,405],[461,399],[461,397],[461,392],[460,389],[456,385],[451,380],[445,376],[441,373]],
"ADACockpit_pilotL" : [[422,364]],
"ADACockpit_pilotR" : [[428,357]],
"ADACockpit_gunnerL" : [[428,369]],
"ADACockpit_gunnerR" : [[435,361]],
"ADACockpit_engineerL" : [[433,375]],
"ADACockpit_engineerR" : [[441,365]],
"exit_close" : [[433,640],[440,635],[451,625],[455,623],[459,623],[464,624],[473,627],[493,634],[505,638],[510,639],[514,638],[517,635],[522,629],[529,625],[536,622],[538,619],[538,614],[531,586],[529,582],[523,580],[491,579],[483,580],[480,584],[479,591],[479,605]],
"exit_far" : [[211,314],[214,305],[220,292],[223,288],[227,286],[239,285],[268,281],[277,279],[281,275],[284,267],[288,260],[293,254],[295,248],[293,243],[277,220],[270,207],[268,193],[271,185],[283,182],[305,183],[314,184],[318,188],[318,199],[318,216],[317,222],[314,224],[310,225]],
"exit_ADACockpit" : [[440,372],[445,376],[451,380],[457,385],[460,389],[461,395],[461,400],[461,415],[461,425],[460,431],[458,433],[453,434],[447,434],[442,432],[439,429],[437,425],[435,420],[435,416],[435,412]],
"ADA_elevator_pilotL" : [[437,408]],
"ADA_elevator_pilotR" : [[430,406]],
"ADA_elevator_gunnerL" : [[436,401]],
"ADA_elevator_gunnerR" : [[425,401]],
"ADA_elevator_engineerL" : [[422,409]],
"ADA_elevator_engineerR" : [[417,402]],
}
let rightAnim = {
"to_preshowA" : [[646,550],[642,543],[641,539],[640,534],[640,528],[643,518],[645,505],[644,493],[642,481],[633,466]],
"to_preshowB" : [[646,550],[640,544],[638,536],[639,529],[640,517],[639,512],[638,505],[639,492],[639,482],[638,475],[635,468],[632,464]],
"exit_singlerider" : [[671,474],[671,470]],
"crewMake_pilotL" : [[678,457]],
"crewMake_pilotR" : [[679,463]],
"crewMake_gunnerL" : [[672,458]],
"crewMake_gunnerR" : [[673,464]],
"crewMake_engineerL" : [[666,459]],
"crewMake_engineerR" : [[667,465]],
"merge->chess" : [[686,459],[693,458],[703,456],[713,454],[724,452],[744,448],[753,446],[759,444],[765,443],[768,442],[773,439],[780,434],[783,431],[784,426],[784,422],[781,410],[781,399],[784,386],[787,381]],
"closeCall->Briefing" : [[835,306],[839,304],[842,302],[843,299],[842,294],[840,288]],
"closeBriefing_pilotL" : [[827,265]],
"closeBriefing_pilotR" : [[831,260]],
"closeBriefing_gunnerL" : [[830,272]],
"closeBriefing_gunnerR" : [[834,267]],
"closeBriefing_engineerL" : [[834,281]],
"closeBriefing_engineerR" : [[837,275]],
"to_closeCockpit" : [[826,256],[825,253],[823,248],[818,243],[811,238],[802,232],[796,229],[794,228]],
"closeCockpit_pilotL" : [[774,221]],
"closeCockpit_pilotR" : [[778,214]],
"closeCockpit_gunnerL" : [[780,226]],
"closeCockpit_gunnerR" : [[785,217]],
"closeCockpit_engineerL" : [[786,231]],
"closeCockpit_engineerR" : [[792,220]],
"closeUnload_pilotL" : [[690,273]],
"closeUnload_pilotR" : [[698,272]],
"closeUnload_gunnerL" : [[690,281]],
"closeUnload_gunnerR" : [[700,280]],
"closeUnload_engineerL" : [[690,288]],
"closeUnload_engineerR" : [[702,287]],
"farCall->Briefing" : [[808,397],[807,402],[808,407],[811,411],[816,415],[822,417],[827,416],[830,413],[836,404],[843,393],[850,380],[856,371],[862,369],[867,372],[876,372],[885,364],[892,354],[897,342],[899,334],[901,330],[905,328],[913,327]],
"farBriefing_pilotL" : [[944,317]],
"farBriefing_pilotR" : [[950,321]],
"farBriefing_gunnerL" : [[936,319]],
"farBriefing_gunnerR" : [[942,323]],
"farBriefing_engineerL" : [[927,321]],
"farBriefing_engineerR" : [[933,326]],
"to_farCockpit" : [[955,317],[961,316],[965,315],[968,313],[971,309],[973,301],[974,296],[975,293],[976,289]],
"farCockpit_pilotL" : [[978,269]],
"farCockpit_pilotR" : [[986,271]],
"farCockpit_gunnerL" : [[975,276]],
"farCockpit_gunnerR" : [[984,279]],
"farCockpit_engineerL" : [[972,283]],
"farCockpit_engineerR" : [[984,286]],
"farUnload_pilotL" : [[1075,254]],
"farUnload_pilotR" : [[1082,249]],
"farUnload_gunnerL" : [[1079,261]],
"farUnload_gunnerR" : [[1088,254]],
"farUnload_engineerL" : [[1083,267]],
"farUnload_engineerR" : [[1093,259]],
"farCall->ADABriefing" : [[808,396],[807,402],[808,407],[811,411],[814,413],[819,414],[821,416],[822,419],[823,424],[824,431],[825,436],[827,438],[831,440],[835,440]],
"ADABriefing_pilotL" : [[847,431]],
"ADABriefing_pilotR" : [[850,436]],
"ADABriefing_gunnerL" : [[842,434]],
"ADABriefing_gunnerR" : [[845,438]],
"ADABriefing_engineerL" : [[837,436]],
"ADABriefing_engineerR" : [[840,440]],
"to_ADACockpit" : [[853,430],[856,428],[860,426],[865,426],[871,428],[881,433],[888,438],[891,440],[894,441],[900,442],[906,441],[916,437],[919,436],[923,435]],
"ADACockpit_pilotL" : [[939,424]],
"ADACockpit_pilotR" : [[942,432]],
"ADACockpit_gunnerL" : [[932,426]],
"ADACockpit_gunnerR" : [[936,436]],
"ADACockpit_engineerL" : [[925,428]],
"ADACockpit_engineerR" : [[929,439]],
"exit_close" : [[696,293],[697,298],[698,303],[699,310],[700,316],[700,321],[697,325],[691,330],[673,345],[660,356],[657,362],[660,370],[661,379],[661,391],[662,394],[666,396],[676,398],[689,401],[697,402],[711,401],[720,404],[723,411],[724,418],[723,426],[720,430],[715,430],[699,430],[699,430],[674,430]],
"exit_far" : [[1090,266],[1093,270],[1097,276],[1103,285],[1105,290],[1105,294],[1104,299],[1103,302],[1101,308],[1093,326],[1087,340],[1086,345],[1087,349],[1092,354],[1097,360],[1099,366],[1102,372],[1105,374],[1110,374],[1126,374],[1151,374],[1164,370],[1168,364],[1169,354],[1167,345],[1161,341],[1149,341],[1114,341]],
"exit_ADACockpit" : [[923,435],[919,436],[916,437],[911,439],[905,441],[900,442],[897,442],[894,441],[891,440],[888,439],[884,436],[878,432],[870,427],[864,422],[862,416],[865,409],[870,405],[875,404],[882,405],[888,407],[893,410]],
"ADA_elevator_pilotL" : [[895,414]],
"ADA_elevator_pilotR" : [[901,418]],
"ADA_elevator_gunnerL" : [[900,407]],
"ADA_elevator_gunnerR" : [[902,398]],
"ADA_elevator_engineerL" : [[906,408]],
"ADA_elevator_engineerR" : [[910,402]],
}
// S - Set Speed
// E - Change Ease
// C - Evaluate Code
// L - Set Level
// B - Block Section Marker
// V - Set Object Value
// M - Marker (ignored)
// + - Previous Frame Positive Offsets
// - - Previous Frame Negative Offsets
// X Y ROTATION TIME OPACITY
let turntableAnims = {
// "ttA-spinny" : [[328,717,0,0],[328,717,360,100]], // These animations when appied to a turntable just make it spin endlessly, good for testing hehe
// "ttB-spinny" : [[158,431.5,23,0],[158,431.5,23-360,100]],
// "ttC-spinny" : [[678,152,360-239.384,0],[678,152,360-239.384+360,100]],
// "ttD-spinny" : [[1011,151,144,0],[1011,151,144-360,100]],
"ttA1" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[1],0]],
"ttB1" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[1],0]],
"ttC1" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[1],0]],
"ttD1" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[1],0]],
"ttA1-trans" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[1],0],[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[2],TTRotationTime]],
"ttB1-trans" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[1],0],[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[2],TTRotationTime]],
"ttC1-trans" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[1],0],[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[2],TTRotationTime]],
"ttD1-trans" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[1],0],[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[2],TTRotationTime]],
"ttA2" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[2],0]],
"ttB2" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[2],0]],
"ttC2" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[2],0]],
"ttD2" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[2],0]],
"ttA2-trans" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[2],0],[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[3],TTRotationTime]],
"ttB2-trans" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[2],0],[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[3],TTRotationTime]],
"ttC2-trans" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[2],0],[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[3],TTRotationTime]],
"ttD2-trans" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[2],0],[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[3],TTRotationTime]],
"ttA3" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[3],0]],
"ttB3" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[3],0]],
"ttC3" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[3],0]],
"ttD3" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[3],0]],
"ttA3-trans" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[3],0],[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[4],TTRotationTime]],
"ttB3-trans" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[3],0],[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[4],TTRotationTime]],
"ttC3-trans" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[3],0],[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[4],TTRotationTime]],
"ttD3-trans" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[3],0],[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[4],TTRotationTime]],
"ttA4" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[4],0]],
"ttB4" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[4],0]],
"ttC4" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[4],0]],
"ttD4" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[4],0]],
"ttA4-trans" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[4],0],[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[5],TTRotationTime]],
"ttB4-trans" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[4],0],[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[5],TTRotationTime]],
"ttC4-trans" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[4],0],[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[5],TTRotationTime]],
"ttD4-trans" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[4],0],[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[5],TTRotationTime]],
"ttA5" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[5],0]],
"ttB5" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[5],0]],
"ttC5" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[5],0]],
"ttD5" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[5],0]],
"ttA5-trans" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[5],0],[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[6],TTRotationTime]],
"ttB5-trans" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[5],0],[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[6],TTRotationTime]],
"ttC5-trans" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[5],0],[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[6],TTRotationTime]],
"ttD5-trans" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[5],0],[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[6],TTRotationTime]],
"ttA6" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[6],0]],
"ttB6" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[6],0]],
"ttC6" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[6],0]],
"ttD6" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[6],0]],
"ttA6-trans" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[6],0],[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[7],TTRotationTime]],
"ttB6-trans" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[6],0],[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[7],TTRotationTime]],
"ttC6-trans" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[6],0],[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[7],TTRotationTime]],
"ttD6-trans" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[6],0],[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[7],TTRotationTime]],
"ttA7" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[7],0]],
"ttB7" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[7],0]],
"ttC7" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[7],0]],
"ttD7" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[7],0]],
"ttA7-trans" : [[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[7],0],[TTPos.A[0],TTPos.A[1],TTPos.AR-TTPos[8],TTRotationTime]],
"ttB7-trans" : [[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[7],0],[TTPos.B[0],TTPos.B[1],TTPos.BR+TTPos[8],TTRotationTime]],
"ttC7-trans" : [[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[7],0],[TTPos.C[0],TTPos.C[1],TTPos.CR-TTPos[8],TTRotationTime]],
"ttD7-trans" : [[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[7],0],[TTPos.D[0],TTPos.D[1],TTPos.DR+TTPos[8],TTRotationTime]],
}
for (let key in turntableAnims) {
cg.createAnimation({
data : turntableAnims[key],
keys : [["Transform","x"],["Transform","y"],["Transform","r"],"time"],
id: key,
callbacks : { end: nextAnimation }
});
}
// ROLL PITCH YAW TIME
let cockpitAnims = {
"cp_wait" : [[0,0,0,0]],
"cp_delay_15" : [[0,0,0,15]], // A 15 second delay that leads into cp_movement_p1
"cp_delay_5" : [[0,0,0,5]], // A 3 second delay that leads into cp_movement_p1
"cp_movement_p1" : [[0,0,0,0],[0,0,0,0],["v",["light_pilots_mode"],2],[-2,0,-1,1.5],["v",["light_main"],true],[1,0,1,2],[0,0,1,2],["","Begin moving forwards"],["v",["light_pilots_mode"],1],[0,-5,0,2],[0,-5,0,2],[0,-2,0,2],["","Crash into the ship"],["v",["light_red_flash"],true],[0.1,-2,0,0.2],["v",["light_red_flash"],true],[-0.1,-2,-0.5,0.2],["v",["light_red_flash"],true],[0.1,-2,0.5,0.2],["v",["light_red_flash"],true],[-0.5,-2,-0.5,0.2],["v",["light_white_flash"],true],[0.5,-2,0.5,0.2],[-0.5,-2,-0.5,0.2],[0.5,-2,0.5,0.2],[-0.5,-2,-0.5,0.2],[0.5,-2,0.5,0.2],[0,-2,0,0.5],["","Pitch down to go under rocks"],[0,6,0,2],[-5,6,0,2],[-1,5,3,2],[3,3,-3,1],[2,2,-1,1.5],[0,2,0,0.8],["","Crash into rocks"],[0.1,2,0,0.1],["v",["light_red_flash"],true],[-0.1,2,0,0.1],["v",["light_white_flash"],true],[0.1,2,0,0.1],[-0.1,2,0,0.1],["v",["light_red_flash"],true],[0.1,2,0,0.1],["v",["light_white_flash"],true],[-0.1,2,0,0.1],["v",["light_red_flash"],true],[0,2,0,0.5],["","Planet Escape"],[0,2,1,2],[0,2,-1,2],[0,2,1,2],["v",["light_lightspeed_mode"],2],[0,2,-1,2],[0,2,0,2],["","Lightspeed"],["v",["light_lightspeed_mode"],0],["v",["light_pilots_mode"],0],[0,-10,0,1.8],[0,-10,0,2],[0,4,0,2],[0,0,0,2]], // Launch
"cp_movement_p2" : [[0,0,0,0],[0,0,0,0],["v",["light_pilots_mode"],2],[1,0,0,1],[-1,0,0,1],[0,0,3,1],["v",["light_pilots_mode"],1],[-7,0,10,2],[-2,0,0,2],["","Shot by ships"],[-2,0,1,0.2],["v",["light_red_flash"],true],[-1,0,-1,0.2],["v",["light_red_flash"],true],[0,0,1,0.2],[1,0,-1,0.2],["v",["light_red_flash"],true],[0,0,1,0.2],[1,0,-1,0.2],["v",["light_red_flash"],true],[0,0,0,0.2],["","Comfort lane"],[5,0,0,2],[-5,0,-1,3],[2,0,3,3],[-1,-2,-1,2],["","Pitch down into the underground area"],[2,5,-5,2.5],[-3,6,0,2],[1,3,1,1.5],[-2,1,0,2],[0,1,-2,2],["","Turn right"],[6,0,3,2],[0,0,5,1],[2,0,3,1],[-2,0,-1,3],[0,0,1,1],["","Turn left"],[3,0,-4,2],[0,0,1,1],[2,0,-2,1],[2,0,-3,1],["","Crash into train"],["v",["light_red_flash"],true],["v",["light_pilots_mode"],0],[0,-6,1,1],[0,-6,-3,1],[0,0,0,2],[0,0,0,4],["","Begin fall"],[0,12,0,2],[0,10,0,2.5],["","Caught"],[0,-2,0,1.5],["v",["light_red_flash"],true],[0,-2,0,0.5],[0,-8,0,1],["v",["light_main"],false],[1,2,0,1],[-1,-2,0,0.5],["v",["light_red_flash"],true],[1,1,0,0.5],["v",["light_red_flash"],true],[-1,-1,0,0.5],[0.5,0.5,0,0.5],[-0.5,-0.5,0,0.5],[0,0,0,0.5],[0,0,0,6],["v",["light_main"],true],["v",["light_white_flash"],true],[0,0,0,0.5],["v",["light_white_flash"],true],[0,0,0,5.5]], // First Coaxium (starts after Corelia clouds)
"cp_movement_p3" : [[0,0,0,0],[0,0,0,0],["v",["light_pilots_mode"],2],[2,0,0,2],[-2,0,0,2],["v",["light_pilots_mode"],1],["","FORWARD!"],[0,-5,0,1],[2,-2,0,1],[-2,-4,-2,1],[0,-4,0,1],[3,-3,0,1.5],[-3,-3,0,1.5],[3,-2,1,2],[-3,-4,-1,2],[-1,-1,-1,2],["","Behind train"],[-2,0,0,1.5],[3,-2,1,2],[-2,0,-1,2],["","Crash into a ring"],[-0.5,0,-1,0.3],["v",["light_red_flash"],true],[0.5,0,0,0.3],["v",["light_red_flash"],true],[-0.5,0,0,0.3],[0.5,0,0,0.3],["v",["light_red_flash"],true],[-0.5,0,0,0.3],["v",["light_red_flash"],true],[-0.5,0,0,0.3],[0.5,0,0,0.3],["v",["light_red_flash"],true],[1,1,-1,1.5],[-1,-1,-1,1.5],["","Break the cargo free"],["v",["light_pilots_mode"],0],[0,8,0,1.5],["v",["light_pilots_mode"],2],[0,7.5,0,0.3],["v",["light_pilots_mode"],1],[0,8,0,0.3],["v",["light_white_flash"],true],[0,7.5,0,0.3],[0,8,0,0.3],["v",["light_red_flash"],true],[0,7.5,0,0.3],["v",["light_red_flash"],true],[0,8,0,0.3],["v",["light_white_flash"],true],[2,0,0,2],[2,5,0,2],[0,3,0,2],["","Turn right"],[5,6,6,3],[3,4,4,1],[0,0,0,1.5],["","Crash into something"],[0.1,0,0,0.2],["v",["light_red_flash"],true],[-0.1,0,-0.5,0.2],[0.1,0,0.5,0.2],["v",["light_red_flash"],true],[-0.5,0.5,-0.5,0.2],[0.5,-1,0.5,0.2],["v",["light_red_flash"],true],[-0.5,-1,-0.5,0.2],["v",["light_red_flash"],true],[0.5,-1,0.5,0.2],
["v",["light_red_flash"],true],[-0.5,-1,-0.5,0.2],["v",["light_red_flash"],true],[0.5,-1,0.5,0.2],[0,-1,0,0.5],[3,4,4,1.5],[0,0,0,1],["","Crash into something else"],[-0.5,0,-1,0.3],["v",["light_red_flash"],true],[0.5,0,0,0.3],["v",["light_red_flash"],true],[-0.5,0,0,0.3],[0.5,0,0,0.3],["v",["light_red_flash"],true],[-0.5,0,0,0.3],[-0.5,0,0,0.3],["v",["light_red_flash"],true],[0.5,0,0,0.3],[5,0,0,2],[-5,0,-1,3],[2,0,-6,3],[0,0,-2,2],["","Crash into another thing"],[0.1,0,-1.5,0.2],["v",["light_red_flash"],true],[-0.1,0,-1,0.2],["v",["light_red_flash"],true],[0.1,0,-0.5,0.2],[-0.5,0.5,0.5,0.2],["v",["light_red_flash"],true],[0.5,-1,-0.5,0.2],[-0.5,-1,0.5,0.2],["v",["light_red_flash"],true],[0.5,-1,-0.5,0.2],[-0.5,-1,0.5,0.2],["v",["light_red_flash"],true],[0.5,-1,-0.5,0.2],[2,0,3,1],[-1,0,0,1],["","Crash into things under star destoryer"],[-0.5,0,-1,0.3],["v",["light_red_flash"],true],[0.5,0,0,0.3],["v",["light_white_flash"],true],[-0.5,0,0,0.3],["v",["light_red_flash"],true],[0.5,0,0,0.3],[-0.5,0,0,0.3],["v",["light_red_flash"],true],[-0.5,0,0,0.3],["v",["light_red_flash"],true],[0.5,0,0,0.3],["","Boost/Planet Escape"],[0,2,1,2],[0,2,-1,2],[0,2,1,2],["v",["light_lightspeed_mode"],2],[0,2,-1,2],[0,2,0,2],["","Lightspeed"],["v",["light_lightspeed_mode"],0],["v",["light_pilots_mode"],0],[0,-10,0,1.8],[0,-10,0,2],[0,4,0,2],[0,0,0,1]], // Second Coaxium (starts when the ship takes off from the bottom of the lift well)
"cp_movement_p4" : [[0,0,0,0],[0,0,0,0],["v",["light_pilots_mode"],2],[1,0,0,1],[-1,0,0,1],["v",["light_red_flash"],true],[0,0,1,1],["v",["light_pilots_mode"],1],[-5,3,0,3],[5,-3,0,2],["v",["light_red_flash"],true],[-3,1,-1,3],[5,-3,0,2],["v",["light_red_flash"],true],[0,0,1,2],[0,-3,0,2],[0,1,1,2],[2,2,0,2],["v",["light_red_flash"],true],[1,3,0,2],[0,-2,0,2],[-2,0,0,2],[0,5,0,3],[0,0,0,2.5],[-1,0,0,2],[-2,1,0,2.5],["v",["light_red_flash"],true],[0,-5,-5,1],["v",["light_red_white"],true],["v",["light_pilots_mode"],0],[0,0,0,3]], // Asteroid Field
"cp_movement_p5" : [[0,0,0,0],[0,0,0,0],[0,2,0,2],["","Bonk"],["v",["light_red_flash"],true],["v",["light_white_flash"],true],[0,-5,-10,1],[0,-2,-7,1],[0,3,-3,2],[0,-6,-2,3],["","This"],[-2,0,0,3],["","Break"],[0,-6,0,2],[0,-2,0,2],["v",["light_main"],false],[0,0,0,2]], // Return (starts after Batuu clouds)
}
for (let key in cockpitAnims) {
cg.createAnimation({
data : cockpitAnims[key],
keys : [["roll"],["pitch"],["yaw"],"time"],
id: key,
callbacks : { end: nextAnimation }
});
}
let outsideGuestAnims = {
"0" : [[426,957],[445,957],[467,945],[490,937],[507,935],[521,935],[544,937],[562,943],[579,947],[595,942],[606,932],[622,923],[647,919],[691,926],[731,927],[773,923],[801,915],[831,899],[863,879],[886,858],[908,834],[924,821],[934,808],[939,792],[939,772],[932,757],[919,742],[910,732],[908,718],[910,704],[915,685],[911,659],[901,639],[885,629],[881,631],[884,637],[888,638],[894,638],[898,644],[893,649],[890,647],[888,644],[891,641],[894,644],[894,649],[892,655],[896,688],[894,713],[891,746],[885,768],[876,788],[852,821],[834,837],[806,853],[782,861],[750,867],[715,870],[690,866],[662,862],[638,862],[622,861]],
"1" : [[835,955],[814,934],[803,919],[783,900],[764,891],[747,885],[717,877],[686,871],[643,865],[614,855]],
"2" : [[857,956],[864,934],[880,904],[894,868],[905,836],[905,813],[900,806],[892,805],[885,805],[878,808],[868,816],[859,821],[843,834],[822,849],[797,862],[774,870],[747,876],[723,877],[703,878],[676,879],[654,879],[637,876],[622,868]],
"3" : [[480,863],[491,879],[504,888],[524,892],[549,899],[575,910],[590,918],[593,925],[593,930],[585,934],[573,936],[553,929],[537,925],[515,922],[487,925],[464,929],[451,933],[442,941],[426,950]],
"4" : [[738,959],[726,942],[702,934],[676,934],[656,932],[641,927],[629,917],[621,915],[610,918],[601,925],[586,933],[573,933],[559,926],[546,921],[532,917],[512,916],[487,920],[467,925],[452,930],[434,944],[422,955]],
"5" : [[486,861],[494,873],[505,881],[519,885],[570,896],[594,904],[614,906],[634,907],[659,911],[687,913],[749,913],[797,905],[828,892],[845,872],[846,857],[848,841],[859,830],[869,821],[879,818],[898,821],[918,836],[924,851],[919,874],[896,912],[885,923],[879,932],[870,954]],
"6" : [[483,861],[494,875],[509,882],[534,888],[563,893],[593,900],[630,905],[691,918],[722,923],[728,925],[734,930],[738,938],[745,956]],
"7" : [[492,857],[504,868],[517,875],[538,882],[569,886],[590,890],[631,894],[676,892],[691,897],[704,904],[724,905],[759,903],[793,897],[818,887],[825,877],[826,868],[824,861],[822,860],[819,859],[813,859],[805,863],[776,878],[752,882],[724,886],[705,886],[676,884],[645,875],[615,865]],
"8" : [[839,960],[846,937],[853,919],[865,903],[872,895],[880,891],[885,890],[900,891],[915,894],[929,899],[938,899],[952,891],[971,876],[996,856],[1016,842],[1041,820],[1053,804],[1056,794],[1056,781],[1049,772],[1026,766],[1013,769],[991,778],[974,793],[958,810],[947,830],[942,845],[932,868],[924,881],[906,884],[887,881],[862,887],[846,900],[835,920],[834,938],[838,955]]
}
for (let key in outsideGuestAnims) {
cg.createAnimation({
data : outsideGuestAnims[key],
keys : [["Transform","x"],["Transform","y"],"time"],
consistentSpeed: true,
id: "OG-"+key
});
}
function add_guest(ani,speed,id,level=3) {
let obj = cg.createObject({"id":"OG-"+id});
obj.attach("Animator",{anim:cg.animations["OG-"+ani],speed:speed});
obj.attach("Graphic",{graphic:cg.createGraphic(guestGraphic),level:1});
return obj;
}
let LCGx = 7;
let LCGa = 1664525;
let LCGm = 2147483648;
for (let i=0;i<Object.keys(outsideGuestAnims).length;i++) {
LCGx = (LCGa * LCGx) % LCGm;
let speed = (7+((LCGx/(LCGm-1))*2)-1);
cg.createEvent({duration:5+10*LCGx/(LCGm-1),animation:i.toString(),loop:false,speed:speed,end:function(event) {
add_guest(event.animation,event.speed,event.id);
}});
LCGx = (LCGa * LCGx) % LCGm;
cg.createEvent({duration:25+10*LCGx/(LCGm-1),animation:i.toString(),loop:false,speed:speed,end:function(event) {
add_guest(event.animation,event.speed,event.id);
}});
LCGx = (LCGa * LCGx) % LCGm;
cg.createEvent({duration:45+10*LCGx/(LCGm-1),animation:i.toString(),loop:false,speed:speed,end:function(event) {
add_guest(event.animation,event.speed,event.id);
}});
}
ChoreoGraph.graphicSetupCallbacks.door = function(g) {
g.open = false;
g.lastCheckedState = g.open;
g.change = 0;
g.colour = "#7a7a7a";
g.time = 2000; // Time (ms) for the door to open or close
g.hinge = [0,0]; // The static position of the door
g.jamb = [0,0]; // The position the door extends to when closed
}
cg.graphicCallbacks.door = function(g) {
c.strokeStyle = g.colour;
c.lineWidth = 2;
if (g.open!=g.lastCheckedState) {
g.change = ChoreoGraph.nowint;
g.lastCheckedState = g.open;
}
let decimal = Math.min((ChoreoGraph.nowint-g.change)/g.time,1);
if (g.open) { decimal = 1-decimal; }
let lerp = [g.hinge[0]+(g.jamb[0]-g.hinge[0])*decimal,g.hinge[1]+(g.jamb[1]-g.hinge[1])*decimal];
c.beginPath();
c.moveTo(g.hinge[0],g.hinge[1]);
c.lineTo(lerp[0],lerp[1]);
c.stroke();
}
let doors = {};
doors.ttAb = cg.createGraphic({type:"door",hinge:[337,553],jamb:[329,547]});
doors.ttAe = cg.createGraphic({type:"door",hinge:[332,585.5],jamb:[324,585.5]});
doors.ttAx = cg.createGraphic({type:"door",hinge:[439,640.5],jamb:[433,633.5]});
doors.ttBb = cg.createGraphic({type:"door",hinge:[323,399],jamb:[316,406]});
doors.ttBe = cg.createGraphic({type:"door",hinge:[291,396],jamb:[293,404]});
doors.ttBx = cg.createGraphic({type:"door",hinge:[209,308],jamb:[216,311]});
doors.ttCb = cg.createGraphic({type:"door",hinge:[819,254],jamb:[830,250]});
doors.ttCe = cg.createGraphic({type:"door",hinge:[795,233],jamb:[799,226]});
doors.ttCx = cg.createGraphic({type:"door",hinge:[692,297],jamb:[701,295.5]});
doors.ttDb = cg.createGraphic({type:"door",hinge:[958,311],jamb:[960,321]});
doors.ttDe = cg.createGraphic({type:"door",hinge:[970,291],jamb:[979,294]});
doors.ttDx = cg.createGraphic({type:"door",hinge:[1090,273],jamb:[1097,268]});
doors.aLe = cg.createGraphic({type:"door",hinge:[441,378],jamb:[446,371.5]});
doors.aLl = cg.createGraphic({type:"door",hinge:[428,415.5],jamb:[440,415.5]}); // lift
doors.aRe = cg.createGraphic({type:"door",hinge:[918,432],jamb:[921,440]});
doors.aRl = cg.createGraphic({type:"door",hinge:[892.5,402],jamb:[886,414]});
doors.aRa = cg.createGraphic({type:"door",hinge:[818,424.5],jamb:[828,423]}); // area
doors.aLa = cg.createGraphic({type:"door",hinge:[485,468],jamb:[478,460]});
let hondo = cg.createObject({id:"hondo"});
hondo.attach("Graphic",{graphic:cg.createGraphic({type:"image",image:cg.images.hondo,width:9,height:9}),level:1});
hondo.animations = {
"hondo_wait" : [[564,382,186,0],[564,382,183,0.5],[564,382,183,0.5],[564,382,186,0.5]],
"hondo_main" : [[564,382,186,0],[564,386,330,3],[564,385,340,3],[564,385,325,3],[564,386,340,5],[563,385,345,5],[564,385,335,5],[564,386,335,3],[564,386,400,2],[563,386,420,3],[564,385,380,3],[565,386,430,3],[563,385,420,5],[564,385,410,5],[563,385,415,3],[563,385,400,5],[563,385,350,4],[564,386,330,3],[564,385,340,3],[564,385,325,3],[563,384,340,5],[564,384,320,5],[563,385,330,5],[564,382,186,5]],
}
hondo.AnimationManager = function(obj,animator) {
if (animator.anim.id=="hondo_wait"&&obj.ready) {
animator.anim = cg.animations.hondo_main;
cg.createEvent({duration:20,end:function(event) { mainPreshow.falcon_light_state = true; mainPreshow.falcon_light_change = ChoreoGraph.nowint; }});
cg.createEvent({duration:35,end:function(event) { mainPreshow.falcon_light_state = false; mainPreshow.falcon_light_change = ChoreoGraph.nowint; }});
obj.ready = false;
} else if (animator.anim.id=="hondo_main") {
animator.anim = cg.animations.hondo_wait;
}
}
for (let key in hondo.animations) {
cg.createAnimation({
data : hondo.animations[key],
keys : [["Transform","x"],["Transform","y"],["Transform","r"],"time"],
id: key,
callbacks : { end: hondo.AnimationManager }
});
}
hondo.ready = false;
hondo.attach("Animator",{anim:cg.animations.hondo_wait});
hondo.Animator.ease = "inoutA";
let r5p8 = cg.createObject({id:"r5p8"});
r5p8.attach("Graphic",{graphic:cg.createGraphic({type:"image",image:cg.images.r5p8,width:9,height:9}),level:1});
r5p8.animations = {
"r5p8_wait" : [[550,410,-40,0]],
"r5p8_shake" : [[550,410,-40,0],[549.9,409.9,-40,0.1],[550.1,410.1,-40,0.1],[549.9,409.9,-40,0.1],[550.1,410.1,-40,0.1],[549.9,409.9,-40,0.1],[550.1,410.1,-40,0.1],[549.9,409.9,-40,0.1],[550.1,410.1,-40,0.1],[549.9,409.9,-40,0.1],[550.1,410.1,-40,0.1],[549.9,409.9,-40,0.1],[550,410,-40,0.1]]
}
r5p8.AnimationManager = function(obj,animator) {
if (animator.anim.id=="r5p8_wait"&&obj.ready) {
animator.anim = cg.animations.r5p8_shake;
obj.ready = false;
} else if (animator.anim.id=="r5p8_shake") {
animator.anim = cg.animations.r5p8_wait;
}
}
for (let key in r5p8.animations) {
cg.createAnimation({
data : r5p8.animations[key],
keys : [["Transform","x"],["Transform","y"],["Transform","r"],"time"],
id: key,
callbacks : { end: r5p8.AnimationManager }
});
}
r5p8.ready = false;
r5p8.attach("Animator",{anim:cg.animations.r5p8_wait});
r5p8.Animator.ease = "inoutA";
let ttA = cg.createObject({id:"ttA"});
let ttB = cg.createObject({id:"ttB"});
let ttC = cg.createObject({id:"ttC"});
let ttD = cg.createObject({id:"ttD"});
let turntableCycleTime = 46000
let turntables = {
"A" : {
"letter" : "A",
"position" : 1,
"object" : ttA,
"nextRot" : 0,
"sparks" : false,
"sleds" : {
0 : null,
1 : null,
2 : null,
3 : null,
4 : null,
5 : null,
6 : null
}
},
"B" : {
"letter" : "B",
"position" : 1,
"object" : ttB,
"nextRot" : 0,
"sparks" : false,
"sleds" : {
0 : null,
1 : null,
2 : null,
3 : null,
4 : null,
5 : null,
6 : null
}
},
"C" : {
"letter" : "C",
"position" : 1,
"object" : ttC,
"nextRot" : 0,
"sparks" : false,
"sleds" : {
0 : null,
1 : null,
2 : null,
3 : null,
4 : null,
5 : null,
6 : null
}
},
"D" : {
"letter" : "D",
"position" : 1,
"object" : ttD,
"nextRot" : 0,
"sparks" : false,
"sleds" : {
0 : null,
1 : null,
2 : null,
3 : null,
4 : null,
5 : null,
6 : null
}
}
}
let tts = [turntables.A,turntables.B,turntables.C,turntables.D];
let abcd = ["A","B","C","D"];
for (let i=0;i<tts.length;i++) {
let tt = tts[i].object;
tt.attach("Animator",{anim:cg.animations["tt"+abcd[i]+"1"],ease:"inoutA"});
tt.attach("Graphic",{level:0,graphic:cg.createGraphic(turntableGraphic,"tt"+abcd[i])});
}
function nextAnimation(object) {
let lastAni = object.Animator.anim.id;
let Anima = object.Animator;
let ttSPos = null;
if (object.cockpit!=undefined&&object.cockpit.sled!=undefined) { ttSPos = getTurntableCockpitStoryPosition(object.cockpit); }
if (lastAni=="ttA1"&&turntables["A"].position!=1) { Anima.anim=cg.animations["ttA1-trans"]; turntable_in_motion["A"] = true; }
else if (lastAni=="ttA1-trans") { Anima.anim=cg.animations["ttA2"]; leftCrewTracker.updateGuestsUnload("close",2); turntable_in_motion["A"] = false; }
else if (lastAni=="ttA2"&&turntables["A"].position!=2) { Anima.anim=cg.animations["ttA2-trans"]; turntable_in_motion["A"] = true; }
else if (lastAni=="ttA2-trans") { Anima.anim=cg.animations["ttA3"]; leftCrewTracker.updateGuestsUnload("close",3); turntable_in_motion["A"] = false; }
else if (lastAni=="ttA3"&&turntables["A"].position!=3) { Anima.anim=cg.animations["ttA3-trans"]; turntable_in_motion["A"] = true; }
else if (lastAni=="ttA3-trans") { Anima.anim=cg.animations["ttA4"]; leftCrewTracker.updateGuestsUnload("close",4); turntable_in_motion["A"] = false; }
else if (lastAni=="ttA4"&&turntables["A"].position!=4) { Anima.anim=cg.animations["ttA4-trans"]; turntable_in_motion["A"] = true; }
else if (lastAni=="ttA4-trans") { Anima.anim=cg.animations["ttA5"]; leftCrewTracker.updateGuestsUnload("close",5); turntable_in_motion["A"] = false; }
else if (lastAni=="ttA5"&&turntables["A"].position!=5) { Anima.anim=cg.animations["ttA5-trans"]; turntable_in_motion["A"] = true; }
else if (lastAni=="ttA5-trans") { Anima.anim=cg.animations["ttA6"]; leftCrewTracker.updateGuestsUnload("close",6); turntable_in_motion["A"] = false; }
else if (lastAni=="ttA6"&&turntables["A"].position!=6) { Anima.anim=cg.animations["ttA6-trans"]; turntable_in_motion["A"] = true; }
else if (lastAni=="ttA6-trans") { Anima.anim=cg.animations["ttA7"]; leftCrewTracker.updateGuestsUnload("close",7); turntable_in_motion["A"] = false; }
else if (lastAni=="ttA7"&&turntables["A"].position!=7) { Anima.anim=cg.animations["ttA7-trans"]; turntable_in_motion["A"] = true; }
else if (lastAni=="ttA7-trans") { Anima.anim=cg.animations["ttA1"]; leftCrewTracker.updateGuestsUnload("close",1); turntable_in_motion["A"] = false; }
else if (lastAni=="ttB1"&&turntables["B"].position!=1) { Anima.anim=cg.animations["ttB1-trans"]; turntable_in_motion["B"] = true; }
else if (lastAni=="ttB1-trans") { Anima.anim=cg.animations["ttB2"]; leftCrewTracker.updateGuestsUnload("far",2); turntable_in_motion["B"] = false; }
else if (lastAni=="ttB2"&&turntables["B"].position!=2) { Anima.anim=cg.animations["ttB2-trans"]; turntable_in_motion["B"] = true; }
else if (lastAni=="ttB2-trans") { Anima.anim=cg.animations["ttB3"]; leftCrewTracker.updateGuestsUnload("far",3); turntable_in_motion["B"] = false; }
else if (lastAni=="ttB3"&&turntables["B"].position!=3) { Anima.anim=cg.animations["ttB3-trans"]; turntable_in_motion["B"] = true; }
else if (lastAni=="ttB3-trans") { Anima.anim=cg.animations["ttB4"]; leftCrewTracker.updateGuestsUnload("far",4); turntable_in_motion["B"] = false; }
else if (lastAni=="ttB4"&&turntables["B"].position!=4) { Anima.anim=cg.animations["ttB4-trans"]; turntable_in_motion["B"] = true; }
else if (lastAni=="ttB4-trans") { Anima.anim=cg.animations["ttB5"]; leftCrewTracker.updateGuestsUnload("far",5); turntable_in_motion["B"] = false; }
else if (lastAni=="ttB5"&&turntables["B"].position!=5) { Anima.anim=cg.animations["ttB5-trans"]; turntable_in_motion["B"] = true; }
else if (lastAni=="ttB5-trans") { Anima.anim=cg.animations["ttB6"]; leftCrewTracker.updateGuestsUnload("far",6); turntable_in_motion["B"] = false; }
else if (lastAni=="ttB6"&&turntables["B"].position!=6) { Anima.anim=cg.animations["ttB6-trans"]; turntable_in_motion["B"] = true; }
else if (lastAni=="ttB6-trans") { Anima.anim=cg.animations["ttB7"]; leftCrewTracker.updateGuestsUnload("far",7); turntable_in_motion["B"] = false; }
else if (lastAni=="ttB7"&&turntables["B"].position!=7) { Anima.anim=cg.animations["ttB7-trans"]; turntable_in_motion["B"] = true; }
else if (lastAni=="ttB7-trans") { Anima.anim=cg.animations["ttB1"]; leftCrewTracker.updateGuestsUnload("far",1); turntable_in_motion["B"] = false; }
else if (lastAni=="ttC1"&&turntables["C"].position!=1) { Anima.anim=cg.animations["ttC1-trans"]; turntable_in_motion["C"] = true; }
else if (lastAni=="ttC1-trans") { Anima.anim=cg.animations["ttC2"]; rightCrewTracker.updateGuestsUnload("close",2); turntable_in_motion["C"] = false; }
else if (lastAni=="ttC2"&&turntables["C"].position!=2) { Anima.anim=cg.animations["ttC2-trans"]; turntable_in_motion["C"] = true; }
else if (lastAni=="ttC2-trans") { Anima.anim=cg.animations["ttC3"]; rightCrewTracker.updateGuestsUnload("close",3); turntable_in_motion["C"] = false; }
else if (lastAni=="ttC3"&&turntables["C"].position!=3) { Anima.anim=cg.animations["ttC3-trans"]; turntable_in_motion["C"] = true; }
else if (lastAni=="ttC3-trans") { Anima.anim=cg.animations["ttC4"]; rightCrewTracker.updateGuestsUnload("close",4); turntable_in_motion["C"] = false; }
else if (lastAni=="ttC4"&&turntables["C"].position!=4) { Anima.anim=cg.animations["ttC4-trans"]; turntable_in_motion["C"] = true; }
else if (lastAni=="ttC4-trans") { Anima.anim=cg.animations["ttC5"]; rightCrewTracker.updateGuestsUnload("close",5); turntable_in_motion["C"] = false; }
else if (lastAni=="ttC5"&&turntables["C"].position!=5) { Anima.anim=cg.animations["ttC5-trans"]; turntable_in_motion["C"] = true; }
else if (lastAni=="ttC5-trans") { Anima.anim=cg.animations["ttC6"]; rightCrewTracker.updateGuestsUnload("close",6); turntable_in_motion["C"] = false; }
else if (lastAni=="ttC6"&&turntables["C"].position!=6) { Anima.anim=cg.animations["ttC6-trans"]; turntable_in_motion["C"] = true; }
else if (lastAni=="ttC6-trans") { Anima.anim=cg.animations["ttC7"]; rightCrewTracker.updateGuestsUnload("close",7); turntable_in_motion["C"] = false; }
else if (lastAni=="ttC7"&&turntables["C"].position!=7) { Anima.anim=cg.animations["ttC7-trans"]; turntable_in_motion["C"] = true; }
else if (lastAni=="ttC7-trans") { Anima.anim=cg.animations["ttC1"]; rightCrewTracker.updateGuestsUnload("close",1); turntable_in_motion["C"] = false; }
else if (lastAni=="ttD1"&&turntables["D"].position!=1) { Anima.anim=cg.animations["ttD1-trans"]; turntable_in_motion["D"] = true; }
else if (lastAni=="ttD1-trans") { Anima.anim=cg.animations["ttD2"]; rightCrewTracker.updateGuestsUnload("far",2); turntable_in_motion["D"] = false; }
else if (lastAni=="ttD2"&&turntables["D"].position!=2) { Anima.anim=cg.animations["ttD2-trans"]; turntable_in_motion["D"] = true; }
else if (lastAni=="ttD2-trans") { Anima.anim=cg.animations["ttD3"]; rightCrewTracker.updateGuestsUnload("far",3); turntable_in_motion["D"] = false; }
else if (lastAni=="ttD3"&&turntables["D"].position!=3) { Anima.anim=cg.animations["ttD3-trans"]; turntable_in_motion["D"] = true; }
else if (lastAni=="ttD3-trans") { Anima.anim=cg.animations["ttD4"]; rightCrewTracker.updateGuestsUnload("far",4); turntable_in_motion["D"] = false; }
else if (lastAni=="ttD4"&&turntables["D"].position!=4) { Anima.anim=cg.animations["ttD4-trans"]; turntable_in_motion["D"] = true; }
else if (lastAni=="ttD4-trans") { Anima.anim=cg.animations["ttD5"]; rightCrewTracker.updateGuestsUnload("far",5); turntable_in_motion["D"] = false; }
else if (lastAni=="ttD5"&&turntables["D"].position!=5) { Anima.anim=cg.animations["ttD5-trans"]; turntable_in_motion["D"] = true; }
else if (lastAni=="ttD5-trans") { Anima.anim=cg.animations["ttD6"]; rightCrewTracker.updateGuestsUnload("far",6); turntable_in_motion["D"] = false; }
else if (lastAni=="ttD6"&&turntables["D"].position!=6) { Anima.anim=cg.animations["ttD6-trans"]; turntable_in_motion["D"] = true; }
else if (lastAni=="ttD6-trans") { Anima.anim=cg.animations["ttD7"]; rightCrewTracker.updateGuestsUnload("far",7); turntable_in_motion["D"] = false; }
else if (lastAni=="ttD7"&&turntables["D"].position!=7) { Anima.anim=cg.animations["ttD7-trans"]; turntable_in_motion["D"] = true; }
else if (lastAni=="ttD7-trans") { Anima.anim=cg.animations["ttD1"]; rightCrewTracker.updateGuestsUnload("far",1); turntable_in_motion["D"] = false; }
else if (lastAni=="cp_delay_15") { Anima.anim=cg.animations["cp_movement_p1"]; }
else if (lastAni=="cp_delay_5") { Anima.anim=cg.animations["cp_movement_p1"]; }
else if (lastAni=="cp_movement_p1") { Anima.anim=cg.animations["cp_movement_p2"]; }
else if (lastAni=="cp_movement_p2") { Anima.anim=cg.animations["cp_movement_p3"]; }
else if (lastAni=="cp_movement_p3"&&ttSPos!=null&&ttSPos<=4) { Anima.anim=cg.animations["cp_movement_p4"]; }
else if (lastAni=="cp_movement_p3") { Anima.anim=cg.animations["cp_movement_p5"]; }
else if (lastAni=="cp_movement_p4") { Anima.anim=cg.animations["cp_movement_p5"]; }
else if (lastAni=="cp_movement_p5") { Anima.anim=cg.animations["cp_wait"]; }
return object;
}
cg.settings.callbacks.resume = function(ms) {
pausedTime += ms;
turntables.A.nextRot += ms;
turntables.B.nextRot += ms;
turntables.C.nextRot += ms;
turntables.D.nextRot += ms;
mainPreshow.falcon_light_change += ms;
mainPreshow.start_time += ms;
leftCrewTracker.updateChangeTimes(ms);
rightCrewTracker.updateChangeTimes(ms);
}
let selectedTurntable = "A";
let selectedADA = "left";
let keyboardMode = false;
let simSessionId = null;
cg.settings.callbacks.keyDown = function(k) {
if (interface.gameOver) { return; }
// console.log("down",k)
switch (k) {
case "b":
if (ChoreoGraph.Input.keyStates["shift"])
ChoreoGraph.plugins.Visualisation.v.blocks.active = (!(ChoreoGraph.plugins.Visualisation.v.blocks.active));
break;
case "l":
if (ChoreoGraph.Input.keyStates["shift"])
ChoreoGraph.plugins.Visualisation.v.animations.active = (!(ChoreoGraph.plugins.Visualisation.v.animations.active));
break;
case "k":
if (ChoreoGraph.Input.keyStates["shift"])
ChoreoGraph.plugins.Visualisation.v.buttons.active = (!(ChoreoGraph.plugins.Visualisation.v.buttons.active));
break;
case "d":
if (ChoreoGraph.Input.keyStates["shift"])
Debug.enabled = (!(Debug.enabled));
break;
case "a":
if (ChoreoGraph.Input.keyStates["shift"])
if (Debug.enabled) {
Debug.chessDebug = true;
Debug.queuesDebug = true;
Debug.roomsDebug = true;
}
break;
case "h":
if (ChoreoGraph.Input.keyStates["shift"])
if (Debug.enabled) { Debug.chessDebug = (!(Debug.chessDebug)); }
break;
case "u":
if (ChoreoGraph.Input.keyStates["shift"])
if (Debug.enabled) { Debug.queuesDebug = (!(Debug.queuesDebug)); }
break;
case "o":
if (ChoreoGraph.Input.keyStates["shift"])
if (Debug.enabled) { Debug.roomsDebug = (!(Debug.roomsDebug)); }
break;
case "escape":
if (pauseMenu.hasPlayedBefore) {
if (interface.pauseMenu) {
interface.pauseMenu = false;
interface.screenCover = false;
pauseMenu.hasPlayedBefore = true;
cg.unpause();
cg.settings.callbacks.resume(ChoreoGraph.nowint-pausedTime);
} else if (interface.log==false&&cg.paused==false) {
keyboardMode = false;
interface.pauseMenu = true;
interface.screenCover = true;
cg.pause();
pausedTime = ChoreoGraph.nowint;
}
}
if (interface.controlsMenu) {
interface.controlsMenu = false;
interface.pauseMenu = true;
} else if (interface.settingsMenu) {
interface.settingsMenu = false;
interface.pauseMenu = true;
} else if (interface.log) {
interface.log = false;
interface.screenCover = false;
} else if (interface.automationMenu) {
interface.automationMenu = false;
interface.pauseMenu = true;
}
break;
case "m":
if (ChoreoGraph.AudioController.masterVolume==0) {
ChoreoGraph.AudioController.masterVolume = 1;
} else {
ChoreoGraph.AudioController.masterVolume = 0;
}
break;
// TURNTABLES
case "4":
if (interface.pauseMenu) {
interface.pauseMenu = false;
interface.automationMenu = true;
}
if (cg.paused==false) {
selectedTurntable = "D";
keyboardMode = true;
}
break;
case "3":
if (interface.pauseMenu) {
interface.pauseMenu = false;
interface.settingsMenu = true;
}
if (cg.paused==false) {
selectedTurntable = "C";
keyboardMode = true;
}
break;
case "2":
if (interface.pauseMenu) {
interface.pauseMenu = false;
interface.controlsMenu = true;
}
if (cg.paused==false) {
selectedTurntable = "B";
keyboardMode = true;
}
break;
case "1":
if (interface.pauseMenu&&pauseMenu.hasPlayedBefore) {
interface.pauseMenu = false;
interface.screenCover = false;
cg.unpause();
cg.settings.callbacks.resume(ChoreoGraph.nowint-pausedTime);
}
if (cg.paused==false) {
selectedTurntable = "A";
keyboardMode = true;
}
break;
case "space":
if (keyboardMode) { rotateTurntable({turntable:turntables[selectedTurntable]}); }
break;
case "q":
if (keyboardMode) { callTurntable({turntable:turntables[selectedTurntable]}); }
break;
case "w":
if (keyboardMode) { toggleTurntableBrief({turntable:turntables[selectedTurntable]}); }
break;
case "e":
if (keyboardMode) { toggleTurntableEnter({turntable:turntables[selectedTurntable]}); }
break;
case "r":
if (keyboardMode) { toggleTurntableExit({turntable:turntables[selectedTurntable]}); }
break;
// ADA
case "up":
if (cg.paused==false) {
selectedADA = "right";
keyboardMode = true;
}
break;
case "down":
if (cg.paused==false) {
selectedADA = "left";
keyboardMode = true;
}
break;
case "left":
if (keyboardMode) { callADA({"cockpit":adaCockpits[selectedADA]}); }
break;
case "right":
if (keyboardMode) { toggleADADoor({"cockpit":adaCockpits[selectedADA]}); }
break;
// PRESHOW
case "enter":
if (cg.paused==false)
startPreshow();
break;
case "c":
if (cg.paused==false)
togglePreshowEntrance(leftCrewTracker);
break;
case "v":
if (cg.paused==false)
togglePreshowEntrance(rightCrewTracker);
break;
}
}
cg.settings.callbacks.keyUp = function(k) {
// console.log("up",k)
switch (k) {
case "h":
mainPreshow.entrance[0] = !(mainPreshow.entrance[0]);
break;
case "j":
mainPreshow.entrance[1] = !(mainPreshow.entrance[1]);
break;
}
}
function buttonClicked(button,event) {
let f = button.id;
switch (event.button) {
case 0:
if (f=="pause") { cg.pause(); keyboardMode = false; }
else if (f=="mute") { ChoreoGraph.AudioController.masterVolume=0; }
else if (f=="unmute") { ChoreoGraph.AudioController.masterVolume=1; }
break;
case 2:
break;
}
}
let pausedTime = 0;
cg.createButton({x:1485,y:858,width:100,height:80,id:"pause",check:"playing",callbacks:{down:function(){interface.pauseMenu = true; interface.screenCover = true; cg.pause(); pausedTime = ChoreoGraph.nowint;}}});
cg.createButton({x:1335,y:858,width:140,height:80,id:"log",check:"playing",callbacks:{down:function(){
interface.log = true;
interface.screenCover = true;
}}});
cg.createButton({x:1220,y:858,width:100,height:80,id:"mute",check:"unmuted",callbacks:{down:buttonClicked}});
cg.createButton({x:1220,y:858,width:100,height:80,id:"unmute",check:"muted",callbacks:{down:buttonClicked}});
cg.createButton({x:cg.cw/2-200-200,y:cg.ch/2-250-65,width:400,height:100,id:"play",check:"pauseMenu",callbacks:{down:function(){
interface.pauseMenu = false;
interface.screenCover = false;
pauseMenu.hasPlayedBefore = true;
pauseMenu.showStartWithGuests = false;
cg.unpause();
cg.settings.callbacks.resume(ChoreoGraph.nowint-pausedTime);
},enter:function(){pauseMenu.playHover = true;},exit:function(){pauseMenu.playHover = false;}}});
cg.createButton({x:cg.cw/2-200-200,y:cg.ch/2-120-65,width:400,height:100,id:"controls",check:"pauseMenu",callbacks:{down:function(){interface.controlsMenu = true; interface.pauseMenu = false;},enter:function(){pauseMenu.controlsHover = true;},exit:function(){pauseMenu.controlsHover = false;}}});
cg.createButton({x:cg.cw/2-200-200,y:cg.ch/2-120+65,width:400,height:100,id:"settings",check:"pauseMenu",callbacks:{down:function(){interface.settingsMenu = true; interface.pauseMenu = false;},enter:function(){pauseMenu.settingsHover = true;},exit:function(){pauseMenu.settingsHover = false;}}});
cg.createButton({x:cg.cw/2-200-200,y:cg.ch/2+10+65,width:400,height:100,id:"automation",check:"pauseMenu",callbacks:{down:function(){interface.automationMenu = true; interface.pauseMenu = false;},enter:function(){pauseMenu.automationHover = true;},exit:function(){pauseMenu.automationHover = false;}}});
cg.createButton({x:cg.cw/2-200-200,y:cg.ch/2+170+65,width:400,height:80,id:"startWithGuests",check:"startWithGuests",callbacks:{down:function(){pauseMenu.showStartWithGuests = false;startWithGuests();},enter:function(){pauseMenu.startWithGuestsHover = true;},exit:function(){pauseMenu.startWithGuestsHover = false;}}});
cg.createButton({x:cg.cw/2-200-225,y:cg.ch/2-200,width:100,height:100,id:"autoTogTTA",check:"automationMenu",callbacks:{down:function(){automationMenu.A = !automationMenu.A;},enter:function(){automationMenu.AHover = true;},exit:function(){automationMenu.AHover = false;}}});
cg.createButton({x:cg.cw/2-200-225+100+16.666,y:cg.ch/2-200,width:100,height:100,id:"autoTogTTB",check:"automationMenu",callbacks:{down:function(){automationMenu.B = !automationMenu.B;},enter:function(){automationMenu.BHover = true;},exit:function(){automationMenu.BHover = false;}}});
cg.createButton({x:cg.cw/2-200-225+200+16.666*2,y:cg.ch/2-200,width:100,height:100,id:"autoTogTTC",check:"automationMenu",callbacks:{down:function(){automationMenu.C = !automationMenu.C;},enter:function(){automationMenu.CHover = true;},exit:function(){automationMenu.CHover = false;}}});
cg.createButton({x:cg.cw/2-200-225+300+16.666*3,y:cg.ch/2-200,width:100,height:100,id:"autoTogTTD",check:"automationMenu",callbacks:{down:function(){automationMenu.D = !automationMenu.D;},enter:function(){automationMenu.DHover = true;},exit:function(){automationMenu.DHover = false;}}});
cg.createButton({x:cg.cw/2-200-225,y:cg.ch/2-30,width:200+16.666,height:100,id:"autoTogADAL",check:"automationMenu",callbacks:{down:function(){automationMenu.ADAL = !automationMenu.ADAL;},enter:function(){automationMenu.ADALHover = true;},exit:function(){automationMenu.ADALHover = false;}}});
cg.createButton({x:cg.cw/2-200-225+200+16.666*2,y:cg.ch/2-30,width:200+16.666,height:100,id:"autoTogADAR",check:"automationMenu",callbacks:{down:function(){automationMenu.ADAR = !automationMenu.ADAR;},enter:function(){automationMenu.ADARHover = true;},exit:function(){automationMenu.ADARHover = false;}}});
cg.createButton({x:cg.cw/2-200-225,y:cg.ch/2+100,width:450,height:100,id:"autoTogpreshow",check:"automationMenu",callbacks:{down:function(){automationMenu.preshow = !automationMenu.preshow;},enter:function(){automationMenu.preshowHover = true;},exit:function(){automationMenu.preshowHover = false;}}});
cg.createButton({x:cg.cw/2-320-225,y:cg.ch/2-250,width:135,height:100,id:"queueSRL",check:"settings",callbacks:{down:function(){optionsMenu.SRLActive = !optionsMenu.SRLActive;},enter:function(){optionsMenu.queueSRLHover = true;},exit:function(){optionsMenu.queueSRLHover = false;}}});
cg.createButton({x:cg.cw/2-320-67.5,y:cg.ch/2-250,width:135,height:100,id:"queueSRR",check:"settings",callbacks:{down:function(){optionsMenu.SRRActive = !optionsMenu.SRRActive;},enter:function(){optionsMenu.queueSRRHover = true;},exit:function(){optionsMenu.queueSRRHover = false;}}});
cg.createButton({x:cg.cw/2-320+90,y:cg.ch/2-250,width:135,height:100,id:"queueLL",check:"settings",callbacks:{down:function(){optionsMenu.LLActive = !optionsMenu.LLActive;},enter:function(){optionsMenu.queueLLHover = true;},exit:function(){optionsMenu.queueLLHover = false;}}});
cg.createButton({x:cg.cw/2-320-450/2,y:cg.ch/2-80,width:200+16.666,height:100,id:"busynessLow",check:"settings",callbacks:{down:function(){optionsMenu.busyness = 1;},enter:function(){optionsMenu.busynessLowHover = true;},exit:function(){optionsMenu.busynessLowHover = false;}}});
cg.createButton({x:cg.cw/2-320-450/2+200+16.666+17,y:cg.ch/2-80,width:200+16.666,height:100,id:"busynessHigh",check:"settings",callbacks:{down:function(){optionsMenu.busyness = 2;},enter:function(){optionsMenu.busynessHighHover = true;},exit:function(){optionsMenu.busynessHighHover = false;}}});
cg.createButton({x:cg.cw/2-320-450/2,y:cg.ch/2+50,width:450,height:100,id:"spotlight",check:"settings",callbacks:{down:function(){optionsMenu.spotlight = !optionsMenu.spotlight;},enter:function(){optionsMenu.spotlightHover = true;},exit:function(){optionsMenu.spotlightHover = false;}}});
cg.createButton({x:cg.cw/2+320-225,y:cg.ch/2-250,width:135,height:100,id:"maxGuests200",check:"settings",callbacks:{down:function(){performanceMenu.maxGuests = 200;},enter:function(){performanceMenu.maxGuests200Hover = true;},exit:function(){performanceMenu.maxGuests200Hover = false;}}});
cg.createButton({x:cg.cw/2+320-67.5,y:cg.ch/2-250,width:135,height:100,id:"maxGuests500",check:"settings",callbacks:{down:function(){performanceMenu.maxGuests = 500;},enter:function(){performanceMenu.maxGuests500Hover = true;},exit:function(){performanceMenu.maxGuests500Hover = false;}}});
cg.createButton({x:cg.cw/2+320+90,y:cg.ch/2-250,width:135,height:100,id:"maxGuests1000",check:"settings",callbacks:{down:function(){performanceMenu.maxGuests = 1000;},enter:function(){performanceMenu.maxGuests1000Hover = true;},exit:function(){performanceMenu.maxGuests1000Hover = false;}}});
cg.createButton({x:cg.cw/2+320-450/2,y:cg.ch/2-80,width:200+16.666,height:100,id:"pixelScale1X",check:"settings",callbacks:{down:function(){performanceMenu.pixelScale = 1;pixelScale = 1;},enter:function(){performanceMenu.PS1XHover = true;},exit:function(){performanceMenu.PS1XHover = false;}}});
cg.createButton({x:cg.cw/2+320-450/2+200+16.666+17,y:cg.ch/2-80,width:200+16.666,height:100,id:"pixelScale2X",check:"settings",callbacks:{down:function(){performanceMenu.pixelScale = 2;pixelScale = 2;},enter:function(){performanceMenu.PS2XHover = true;},exit:function(){performanceMenu.PS2XHover = false;}}});
cg.createButton({x:cg.cw/2+320-450/2,y:cg.ch/2+50,width:450,height:100,id:"guestRepel",check:"settings",callbacks:{down:function(){performanceMenu.guestRepel = !performanceMenu.guestRepel;},enter:function(){performanceMenu.guestRepelHover = true;},exit:function(){performanceMenu.guestRepelHover = false;}}});
cg.createButton({type:"polygon",path:[[0,0],[1600,0],[1600,950],[0,950],[0,0],[200,125],[200,725],[755,725],[755,125],[845,125],[845,725],[1400,725],[1400,125],[200,125]],id:"outsideSettingsMenu",check:"settings",cursor:"default",callbacks:{down:function(){
interface.pauseMenu = true;
interface.settingsMenu = false;
interface.automationMenu = false;
}}});
cg.createButton({type:"polygon",path:[[0,0],[1600,0],[1600,950],[0,950],[0,0],[325,175],[325,775],[875,775],[875,175],[325,175]],id:"outsideAutomationMenu",check:"automationMenu",cursor:"default",callbacks:{down:function(){
interface.pauseMenu = true;
interface.automationMenu = false;
}}});
cg.createButton({x:cg.cw/2-425,y:cg.ch/2+50,width:450,height:100,id:"logSession",check:"canLog",callbacks:{down:function(){
if (simSessionId==null) { return; }
let autoSet = "";
if (automationMenu.hasAutomated.A) { autoSet += "y"; } else { autoSet += "n"; }
if (automationMenu.hasAutomated.B) { autoSet += "y"; } else { autoSet += "n"; }
if (automationMenu.hasAutomated.C) { autoSet += "y"; } else { autoSet += "n"; }
if (automationMenu.hasAutomated.D) { autoSet += "y"; } else { autoSet += "n"; }
if (automationMenu.hasAutomated.ADALeft) { autoSet += "y"; } else { autoSet += "n"; }
if (automationMenu.hasAutomated.ADARight) { autoSet += "y"; } else { autoSet += "n"; }
if (automationMenu.hasAutomated.preshow) { autoSet += "y"; } else { autoSet += "n"; }
if (autoSet=="nnnnnnn") { autoSet = ""; }
var xhr = new XMLHttpRequest();
xhr.open("POST", "../submit.php", true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send("sid="+simSessionId+"&playtime="+Math.floor(ChoreoGraph.playtime/1000)+"&auto="+autoSet+"&guests="+pauseMenu.guests+"&dispatches="+pauseMenu.dispatches);
cg.pause()
interface.gameOver = true;
ChoreoGraph.AudioController.masterVolume = 0;
},enter:function(){logMenu.buttonHover = true;},exit:function(){logMenu.buttonHover = false;}}});
cg.createButton({type:"polygon",path:[[0,0],[1600,0],[1600,950],[0,950],[0,0],[325,275],[325,675],[875,675],[875,275],[325,275]],id:"outsideLogMenu",check:"logMenu",cursor:"default",callbacks:{down:function(){
interface.log = false;
interface.screenCover = false;
}}});