-
Notifications
You must be signed in to change notification settings - Fork 39
/
American Graffiti (Original 2024).vbs
6055 lines (5436 loc) · 200 KB
/
American Graffiti (Original 2024).vbs
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
'****************************************************************
'
' American Graffiti (Original 2024) by Onevox
' Script by Scottacus
' v 0.20
' October 2024
'
' Basic DOF config
' 101 Left Flipper, 102 Right Flipper
' 103 - 104 Slings
' 105 -107 Bumpers
' 110 DragLane Kicker
' 124 Drain, 125 Ball Release
' 127 credit light
' 128 Knocker
' 153 Chime1-10s, 154 Chime2-100s, 155 Chime3-1000s
'
' Code Flow
' EndGame
' ^
' Start Game -> New Game -> Check Continue -> Release Ball -> Drain -> Score Bouns -> Advance Players -> Next Ball
' |
' EndGame = True <-----------------------------------------------------------------
'***********************************************************************************************************************
Option Explicit
Randomize
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "Can't open controller.vbs"
On Error Goto 0
Const cGameName = "AmericanGraffiti_1962"
Const hsFileName = "American Graffiti (Original 2024)"
Const cOptions = "American_Graffiti_v1.3.txt"
Dim vrOption
'*************************** VR Room****************************************************
Dim VR_Room:
' NOTE VR Room can be toggled on/off in the left flipper options menu
If RenderingMode = 2 Then
vrOption = 1 ' used for no VR Room
'vrOption = 2 ' used to see VR Room
Else
vrOption = 0
End If
vrRoomToggle
Dim UseFlexDMD
UseFlexDMD = True
If UseFlexDMD = True Then DMD_Init
'********************************* Left Out Lane ***************************************
Dim leftOutLane
leftOutLane = 0 'set to 1 for always guide to drag race lane, 0 to only allow one ball saved to drag race lane
'*************************** Glass Scratches *******************************************
Const VRGlassScratches = 0 ' set this to 1 to turn on VR glass scratches
If vrOption > 1 and VRGlassScratches > 0 then GlassImpurities.visible = true
'*************************** PinballY Settings *****************************************
'Set this variable to 1 to save a PinballY High Score file to your Tables Folder
'this will let the Pinball Y front end display the high scores when searching for tables
'0 = No PinballY High Scores, 1 = Save PinballY High Scores
Const cPinballY = 1
'************************** New Ball Shadow Code ***************************************
Const DynamicBallShadowsOn = 1 '0 = no dynamic ball shadows, 1 = enable dynamic ball shadow
Const AmbientBallShadowOn = 0 '0 = no regular ball shadow 1 = regular ball shadow on
'***********************************************************************************************
Dim tablewidth: tablewidth = Table1.width
Dim tableheight: tableheight = Table1.height
Sub FrameTimer_Timer()
FlipperVisualUpdate 'update flipper shadows and primitives
If DynamicBallShadowsOn Or AmbientBallShadowOn Then DynamicBSUpdate 'update ball shadows
End Sub
' The game timer interval is 10 ms
Sub GameTimer_Timer()
Cor.Update 'update ball tracking (this sometimes goes in the RDampen_Timer sub)
Pgate.rotz = GateR.CurrentAngle * 0.5
Pgate001.rotz = GateL.CurrentAngle * 0.5
dim xx
For each xx in DropTargets
If xx.isDropped = 1 Then xx.visible = 0
Next
End Sub
'****** End New ball Shadow Code.. More at bottom of script ****************************************************************************
Dim bip
Dim balls
Dim replays
Dim maxPlayers
Dim players
Dim player
Dim credit
Dim score(6)
Dim hScore(6)
Dim sReel(6)
Dim state
Dim tilt
Dim i,j, f, ii, Object, Light, x, y
Dim freePlay
Dim ballsize, BallMass
ballSize = 50
ballMass = (Ballsize^3)/125000
Dim gateState
Dim staticLights
Dim playerLights(5)
Dim musicOn
Dim musicVol
Dim checkOnOff
staticLights = Array("L001","L002","L003","L004","L010","L011","L012","L014","L110","L112","L114","L116","L118","L120")
For i = 1 to 4
playerLights(i) = Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
Next
'Dim HSInitial0, HSInitial1, HSInitial2
Dim EnableInitialEntry
Dim ShowBallShadow
Dim Chime
Dim Options
Dim PFOption
Dim BonusScore
Dim FirstBallOut
Dim lutValue
'Desktop reel pans, Valid values: "Lpan", "Mpan" and "Rpan"
Const dtcrReel = "Rpan"
Const dts1Reel = "Lpan"
Const dts2Reel = "Rpan"
Const dts3Reel = "Lpan"
Const dts4Reel = "Rpan"
'Backglass reel pans, Valid values: "Lpan", "Mpan" and "Rpan"
Const bgcrReel = "Mpan"
Const bgs1Reel = "Lpan"
Const bgs2Reel = "Rpan"
Const bgs3Reel = "Lpan"
Const bgs4Reel = "Rpan"
Dim musicDir, voDir
Sub Table1_init
LoadEM
MaxPlayers=4
player = 1
loadHighScore
If highScore(0)="" Then highScore(0)=50000
If highScore(1)="" Then highScore(1)=45000
If highScore(2)="" Then highScore(2)=40000
If highScore(3)="" Then highScore(3)=35000
If highScore(4)="" Then highScore(4)=30000
For x = 1 to maxPlayers
Set sReel(x) = EVAL("scoreReel" & x)
Next
If initial(0,1) = "" Then
initial(0,1) = 19: initial(0,2) = 5: initial(0,3) = 13
initial(1,1) = 1: initial(1,2) = 1: initial(1,3) = 1
initial(2,1) = 2: initial(2,2) = 2: initial(2,3) = 2
initial(3,1) = 3: initial(3,2) = 3: initial(3,3) = 3
initial(4,1) = 4: initial(4,2) = 4: initial(4,3) = 4
End If
If credit = "" Then credit = 0
If freePlay = "" Then freePlay = 1
If balls = "" Then balls = 5
If chime = "" Then chime = 0
If showDT = True And vrOption = 0 Then pfOption = 1
If pfOption = "" Then pfOption = 1
If score(1) = "" Then score(1) = 0
If musicOn = "" Then musicOn = 1
If musicVol = "" Then musicVol = .5
oldMusicVol = musicVol
replaySettings
firstBallOut = 0
updatePostIt
tiltReel.SetValue(1)
If vrOption > 0 Then vrTilt.visible = 1
creditReel.setvalue(credit)
If vrOption > 0 Then vrCredit
For Each xx in Lights:xx.state = 0: Next
bootTable.Enabled = 1
If showDT = True And vrOption = 0 Then
For each xx in backdropstuff: xx.visible = 1: Next
Else
For each xx in backdropstuff: xx.visible = 0: Next
table1.BackdropImage_DT = ""
End If
Table1.ColorGradeImage = "AGLUT4"
musicDir = musicdirectory("AG")
voDir = musicdirectory("AGSounds")
For Each xx in MelCheckCol: xx.visible = 0 : Next
startUpSound.enabled = 1
tilt = False
state = False
gameState
gateState = 1
drain.CreateSizedBallWithMass Ballsize/2, BallMass
End Sub
Dim ssCount, lightCounter
Sub startUpSound_Timer
ssCount = ssCount + 1
If ssCount = 1 Then playOcxMusic "sfx_RadioScan.mp3"
If ssCount > 23 Then
ssCount = 0
If musicOn = 1 Then playOcxMusic "AGattract.mp3"
If B2Son Then controller.B2SsetData 140, 1
startUpSound.enabled = 0
End If
End Sub
'****************KeyCodes
Sub Table1_KeyDown(ByVal keycode)
If enableInitialEntry = True Then enterIntitals(keycode)
If keycode = addCreditKey Then
playFieldSound "coinin",0,Drain,1
addCredit = 1
scoreMotor5.enabled = 1
End If
If keycode = startGameKey Then
'StartButton.y = 755 - 5
If enableInitialEntry = False and operatorMenu = 0 Then
If freePlay = 1 and players < MaxPlayers and firstBallOut = 0 Then startGame
If freePlay = 0 and credit > 0 and players < MaxPlayers and firstBallOut = 0 Then
credit = credit - 1
If showDT = False Then PlayReelSound "Reel5", bgcrReel Else PlayReelSound "Reel5", dtcrReel
creditReel.setvalue(credit)
If B2SOn Then
If freeplay = 0 Then controller.B2SSetCredits credit
If freePlay = 0 and credit < 1 Then DOF 127, DOFOff
End If
startGame
End If
End If
End If
If keycode = rightFlipperKey Then
If vrOption > 0 Then VRFlipperButtonRight.X = 2190 - 8
End If
If keycode = leftFlipperKey and contball = 0 Then
If vrOption > 0 Then VRFlipperButtonLeft.X = 2122 + 8
End If
If keycode = PlungerKey Then
plunger.PullBack
If showDT = True Then playFieldSound "plungerpull", 0, plunger, 1
If vrOption > 0 Then
TimerVRPlunger.Enabled = True
TimerVRPlunger1.Enabled = False
PinCab_Shooter.Y = -500
End If
End If
If tilt = False and state = True Then
If keycode = leftFlipperKey and contball = 0 and tilt = False Then
FlipperActivate LeftFlipper, LFPress
lf.fire
playFieldSound "FlipUpL", 0, leftFlipper, 1
If B2SOn Then DOF 101,DOFOn
playFieldSound "FlipBuzzL", -1, leftFlipper, 1
rotateLeft
End If
If keycode = RightFlipperKey and contball = 0 and tilt = False Then
FlipperActivate RightFlipper, RFPress
rf.fire
playFieldSound "FlipUpR", 0, RightFlipper,1
If B2SOn Then DOF 102,DOFOn
playFieldSound "FlipBuzzR", -1, RightFlipper,1
rotateRight
End If
If keycode = leftTiltKey Then
Nudge 90, 2
checkTilt
End If
If keycode = rightTiltKey Then
Nudge 270, 2
checkTilt
End If
If keycode = centerTiltKey Then
Nudge 0, 2
checkTilt
End If
End If
If keycode = RightMagnaSave and contball = 0 Then
If state = True Then
If contball = 0 and musicOn = 1 Then
songNumber = songNumber + 1
If songNumber > 24 Then songNumber = 0
songPlayer
End If
End If
End If
If keycode = LeftMagnaSave And contball = 0 Then
updateMelCheck
If checkOnOff = 0 Then
checkOnOff = 1
For Each xx in MelCheckCol: xx.visible = 1: Next
Else
checkOnOff = 0
For Each xx in MelCheckCol: xx.visible = 0: Next
End If
End If
If keycode = mechanicalTilt Then
tilt = True
PlaySound "SFX_MusicOver", 0, musicVol
tiltReel.SetValue(1)
If vrOption > 0 Then vrTilt.visible = 1
If B2SOn Then Controller.B2SSetTilt 1
turnOff
End If
If keycode = leftFlipperKey and state = False and operatorMenu = 0 and enableInitialEntry = 0 Then
operatorMenuTimer.Enabled = true
end if
If keycode = leftFlipperKey and state = False and operatorMenu = 1 Then
options = options + 1
If renderingMode <> 2 Then If options = 5 Then options = 6
If showDt = True Then If options = 6 Then options = 7 'skips non DT options
If options = 8 Then options = 0
optionMenu.visible = true
playFieldSound "target", 0, SoundPointScoreMotor, .2
Select Case (Options)
Case 0:
optionMenu.image = "FreeCoin" & freePlay
Case 1:
optionMenu.image = balls & "Balls"
Case 2:
optionMenu.image = "Music" & musicOn
Case 3:
optionMenu.image = "musicVolume"
optionMenu1.visible = 1
If musicVol < 1 Then
optionMenu1.image = "vol" & (musicVol * 10)
Else
optionMenu1.image = "vol10"
End If
Case 4:
If showDT = False Then optionMenu.image = "UnderCab"
If showDT = True Then OptionMenu.visible = False
optionMenu1.visible = 1
optionMenu1.image = "Sound" & pfOption
optionMenu2.visible = 1
optionMenu2.image = "SoundChange"
Select Case (PFOption)
Case 1: speaker1.visible = 1: speaker2.visible = 1: speaker3.visible = 0: speaker4.visible = 0
Case 2: speaker5.visible = 1: speaker6.visible = 1: speaker1.visible = 0: speaker2.visible = 0
Case 3: speaker1.visible = 1: speaker2.visible = 1: speaker3.visible = 1: speaker4.visible = 1: speaker5.visible = 0: speaker6.visible = 0
End Select
Case 5:
For x = 1 to 6
EVAL("Speaker" & x).visible = 0
Next
optionMenu1.visible = 0
OptionMenu2.visible = 0
optionMenu.image = "VR" & vrOption
Case 6:
optionMenu2.visible = 0
For x = 1 to 6
EVAL("Speaker" & x).visible = 0
Next
optionMenu1.image = "DOF"
optionMenu.image = "Chime" & chime
Case 7:
For x = 1 to 6
EVAL("Speaker" & x).visible = 0
Next
optionMenu1.visible = 0
optionMenu2.visible = 0
optionMenu.image = "SaveExit"
End Select
End If
If keycode = rightFlipperKey and state = False and operatorMenu = 1 Then
playFieldSound "metalHitHigh", 0, SoundPointScoreMotor, 0.2
Select Case (options)
Case 0:
If freePlay = 0 Then
freePlay = 1
Else
freePlay = 0
End If
optionMenu.image= "FreeCoin" & freePlay
If freePlay = 0 Then
If credit > 0 and B2SOn Then DOF 127, DOFOn
If credit < 1 and B2SOn Then DOF 127, DOFOff
Else
If B2SOn Then DOF 127, DOFOn
End If
Case 1:
If balls = 3 Then
balls = 5
Else
balls = 3
End If
OptionMenu.image = balls & "Balls"
Case 2:
If musicOn = 0 Then
musicOn = 1
playOcxMusic "AGattract.mp3"
Else
musicOn = 0
ocxPlayerMusic.controls.stop
End If
optionMenu.image = "music" & musicOn
Case 3:
musicVol = musicVol + .1
If musicVol > 1 Then musicVol = .1
oldmusicVol = musicVol
If musicVol < 1 Then
optionMenu1.image = "vol" & (musicVol *10)
Else
optionMenu1.image = "vol10"
End If
ocxPlayerMusic.settings.volume = musicVol*100
Case 4:
pfOption = pfOption + 1
If showDt = True and pfOption = 2 Then pfOption = 3
If pfOption = 4 Then pfOption = 1
optionMenu1.visible = 1
optionMenu1.image = "Sound" & pfOption
Select Case (pfOption)
Case 1: speaker1.visible = 1: speaker2.visible = 1: speaker3.visible = 0: speaker4.visible = 0
Case 2: speaker5.visible = 1: speaker6.visible = 1: speaker1.visible = 0: speaker2.visible = 0
Case 3: speaker1.visible = 1: speaker2.visible = 1: speaker3.visible = 1: speaker4.visible = 1: speaker5.visible = 0: speaker6.visible = 0
End Select
Case 5:
If vrOption = 1 Then
vrOption = 2
Else
vrOption = 1
End If
vrRoomToggle
optionMenu.image = "VR" & vrOption
Case 6:
If chime = 0 Then
chime= 1
If B2SOn Then DOF 155,DOFPulse
Else
chime = 0
pts10
End If
optionMenu.image = "Chime" & chime
Case 7:
operatorMenu = 0
saveHighScore
dynamicUpdatePostIt.enabled = 1
optionMenu.image = "FreeCoin" & freePlay
optionMenu1.visible = 0
optionMenu.visible = 0
optionsMenu.visible = 0
replay(1) = 136000
replay(2) = 185000
replay(3) = 100000000
End Select
End If
If keycode = 46 Then' C Key
stopSound "FlipBuzzLA"
stopSound "FlipBuzzLB"
stopSound "FlipBuzzLC"
stopSound "FlipBuzzLD"
stopSound "FlipBuzzRA"
stopSound "FlipBuzzRB"
stopSound "FlipBuzzRC"
stopSound "FlipBuzzRD"
If contball = 1 Then
contball = 0
Else
contball = 1
End If
End If
If keycode = 48 Then 'B Key
If bcboost = 1 Then
bcboost = bcboostmulti
Else
bcboost = 1
End If
End If
If keycode = 203 Then Cleft = 1 ' Left Arrow
If keycode = 200 Then Cup = 1 ' Up Arrow
If keycode = 208 Then Cdown = 1 ' Down Arrow
If keycode = 205 Then Cright = 1 ' Right Arrow
If keycode = 52 Then Zup = 1 ' Period
'************************Start Of Test Keys****************************
If Keycode = 30 Then 'a' key
topLanes(player) = topLanes(player) + 1
updateMelCheck
End If
If Keycode= 31 Then 's' key
score(1) = 60000
score(2) = 49000
checkHighScores
End If
If Keycode = 33 Then 'f' key
check20.image = "HS_3"
End If
'************************End Of Test Keys****************************
End Sub
dim z
Sub Table1_KeyUp(ByVal keycode)
If keycode = rightFlipperKey Then
If vrOption > 0 Then VRFlipperButtonRight.X = 2190
End If
If keycode = leftFlipperKey and contball = 0 Then
If vrOption > 0 Then VRFlipperButtonLeft.X = 2122
End If
If keycode = StartGameKey Then
'StartButton.y = 1890
End If
If keycode = plungerKey Then
If vrOption > 0 Then
TimerVRPlunger.Enabled = False
TimerVRPlunger1.Enabled = True
PinCab_Shooter.Y = -500
End If
plunger.Fire
If showDt = True Then playFieldSound "PlungerFire", 0, plunger, 1
End If
If keycode = leftFlipperKey Then
operatorMenuTimer.Enabled = False
End If
If tilt = False and state = True Then
If keycode = leftFlipperKey and contBall = 0 Then
FlipperDeActivate LeftFlipper, LFPress
lfpress = 0
LeftFlipper.eosTorqueAngle = EOSA
LeftFlipper.eosTorque = EOST
LeftFlipper.RotateToStart
playFieldSound "FlipDownL", 0, leftFlipper, 1
If B2SOn Then DOF 101,DOFOff
stopSound "FlipBuzzLA"
stopSound "FlipBuzzLB"
stopSound "FlipBuzzLC"
stopSound "FlipBuzzLD"
End If
If keycode = rightFlipperKey and contBall = 0 Then
FlipperDeActivate RightFlipper, RFPress
rfpress = 0
RightFlipper.eosTorqueAngle = EOSA
RightFlipper.eosTorque = EOST
RightFlipper.rotateToStart
playFieldSound "FlipDownR", 0, RightFlipper, 1
If B2SOn Then DOF 102,DOFOff
stopSound "FlipBuzzRA"
stopSound "FlipBuzzRB"
stopSound "FlipBuzzRC"
stopSound "FlipBuzzRD"
End If
End If
If keycode = 203 Then cLeft = 0' Left Arrow
If keycode = 200 Then cUp = 0' Up Arrow
If keycode = 208 Then cDown = 0' Down Arrow
If keycode = 205 Then cRight = 0' Right Arrow
If keycode = 52 Then Zup = 0' Period
End Sub
'************** Table Boot
Dim backGlassOn
Dim bootCount:bootCount = 0
Sub bootTable_Timer()
bootCount = bootCount + 1
If freePlay = 1 Then
If B2SOn Then DOF 127, DOFOn
End If
If bootCount = 1 Then
If vrOption > 0 Then vrBGplane.image = "AG B2S VR_On"
If B2SOn Then
controller.B2SSetCredits credit
controller.B2SSetGameOver 35,1
controller.B2SSetTilt 33,1
controller.B2SSetData 80, 1 'turns the backglass image on
controller.B2SSetPlayerUp 30,0
If credit > 0 Then DOF 127, DOFOn
If freePlay = 1 Then DOF 127, DOFOn
End If
backGlassOn = 1
me.enabled = False
End If
dim xx
pfholes.image = "pfholes_on"
For each xx in filaments: xx.blenddisablelighting = 120: Next
For each xx in bulbs: xx.blenddisablelighting = 12: Next
End Sub
'***********Replay Settings
Sub replaySettings
replay(1) = 140000
replay(2) = 156000
replay(3) = 174000
End Sub
'***********Operator Menu
Dim operatorMenu
Sub operatorMenuTimer_Timer
If optionMenu.visible = False Then playFieldSound "target", 0, SoundPointScoreMotor, .2
options = 0
operatorMenu = 1
dynamicUpdatePostIt.enabled = 0
updatePostIt
options = 0
optionsMenu.visible = True
OptionsMenu.image = "AG Options"
optionMenu.visible = True
optionMenu.image = "FreeCoin" & freePlay
End Sub
'***********Start Game
Dim ballInPlay
Sub StartGame
If state = False Then
ballinPlay = 1
If B2SOn Then
controller.B2SSetCredits credit
controller.B2SSetBallinPlay 32, ballinplay
controller.B2SSetPlayerup 30, 1
controller.B2SSetData 91, 1
controller.B2SSetGameOver 0
End If
For x = 1 to 4
For y = 1 to 5
extraBall(x,y) = 0
Next
Next
dynamicUpdatePostIt.enabled = 0
giOn
updatePostIt
tilt = False
state = True
gameState
players = 1
cpReel.setValue(1)
shutOffLights
newGame
If vrOption > 0 Then
vrBipSet
vrCredit
vrGameOver.visible = 0
vrup.image = "up1"
For Each xx in vrPlayer1Reels: xx.image = "VR_BallyScoreReel_on": Next
vrCreditReel.image = "VR_BallyCreditReel_on"
End If
If showDT = True And vrOption = 0 Then
ScoreReelOff1.visible = 0
ScoreReel1.visible = 1
End If
semAttract.enabled = 0
For each xx in Lights: xx.state = 0: Next
L059.state = 1
ocxPlayerMusic.controls.stop
generateSongNumber(5)
spinnerCount = 1
XERBcycle
If L057.state = 0 And L053.state = 0 Then
L057.state = 1
End If
Else If state = True and players < maxPlayers and ballinPlay = 1 Then
players = players + 1
If showDT = True and vrOption = 0 Then
EVAL("ScoreReelOff" & players).visible = 0
EVAL("ScoreReel" & players).visible = 1
End If
cpReel.setValue(players)
creditReel.setvalue(credit)
If vrOption > 0 Then
vrCredit
For Each xx in EVAL("vrPlayer" & players & "Reels"): xx.image = "VR_BallyScoreReel_on": Next
End If
If B2SOn Then
controller.B2SSetCredits credit
controller.B2SSetData 90 + players, 1
End If
shutOffLights
End If
End If
End Sub
'***************New Game
Dim endGame
Sub newGame
startUpSound.enabled = 0
player = 1
endGame = 0
If B2SOn Then controller.B2SSetShootAgain 36,0
gameState
For x = 1 to 3
EVAL("Bumper" & x).hashitevent = 1
Next
up1Reel.setValue(1)
For x = 1 to 4
reelDone(x) = 0
playerDone(x) = 0
dragRaceCount(x) = 0
apCollect(x) = 0
allPins(x) = 0
cruiseCount(x) = 0
bumperHits(x) = 0
topLanes(x) = 0
melCount(x) = 0
dtCount(x) = 0
Next
For x = 80 to 84
EVAL("L0" & x).state = 0
Next
lightPins
resetTable
lutValue = 0
SetLUT
resetReel.enabled = True
updateMelCheck
End Sub
'**********Check if Game Should Continue
Dim relBall, rep(4)
Sub checkContinue
If endGame = 1 Then
fadeMusic.enabled = 1
turnOff
stopSound "FlipBuzzLA"
stopSound "FlipBuzzLB"
stopSound "FlipBuzzLC"
stopSound "FlipBuzzLD"
stopSound "FlipBuzzRA"
stopSound "FlipBuzzRB"
stopSound "FlipBuzzRC"
stopSound "FlipBuzzRD"
state = False
bipReel.setValue(0)
BIPText.text = " "
For x = 1 to maxPlayers
EVAL("up" & x & "Reel").setValue(0)
Next
gameState
dynamicUpdatePostIt.enabled = 1
cpReel.setValue(0)
sortScores
checkHighScores
firstBallOut = 0
players = 0
For x = 1 to 4
rep(x) = 0
repAwarded(x) = 0
Next
playOcxVo "vo_WMJGoodNight.mp3"
saveHighScore
If B2SOn Then
controller.B2SSetGameOver 35,1
controller.B2SSetballinplay 32, 0
controller.B2SSetPlayerUp 30, 0
For x = 1 to 4
controller.B2SSetData 90+x, 0
Next
If credit > 0 Then DOF 127, DOFOn
If freePlay = 1 Then DOF 127, DOFOn
End If
If vrOption > 0 Then
vrBipSet
vrGameOver.visible = 1
vrBip.image = "bip0"
vrUp.image = "up0"
vrCreditReel.image = "VR_BallyCreditReel_off"
For Each xx in vrReels: xx.image = "VR_BallyScoreReel_off": next
End If
giOff
semAttract.enabled = 1
Else
relBall = 1
setLights
scoreMotor5.enabled = 1
bipReel.setValue(ballInPlay)
BIPText.text = ballinPlay
If vrOption > 0 Then
vrBipSet
vrPlayerUP
End If
End If
End Sub
Sub resetTable
DTRaise 1: DTRaise 2: DTRaise 3: DTRaise 4
leftStar = 0
rightStar = 0
bumperCounter = 0
spinnerHit = 0
melLoop = 0
melModeActive = 0
bumperModeTimer.enabled = 0
melTimer.enabled = 0
Dim xx
For each xx in betweenBallReset: xx.state = 0: Next
End Sub
'***************Drain and Release Ball
Dim drainActive, drainCount, drainBS
Sub drain_Hit()
bip = bip - 1
If bip = 1 Then drain.destroyBall
If bip = 0 Then
If bsOn = 0 or playerDone(player) = 1 Then
sm1962Loop = 200
psmLoop = 200
clsmLoop = 200
bsmLoop = 200
msmLoop = 200
dtsmLoop = 200
phoneLoop = 200
MelLoop = 200
spinnerHit = 0
stopSound "sfx_Payphone"
scoreMotorLoop = 0
repAwarded(Player) = 0
scoreBonus
If ballInPlay +1 > Balls Then playerMusicTime.enabled = 0
drainActive = 1
LeftSlingShot.collidable = 1
RightSlingShot.collidable = 1
shutOffLights
OptionsMenu.visible = 0
raceStart = 0
ballSaveOn = 0
Else
drainBS = 1
releaseBall
End If
End If
End Sub
Sub releaseBall
playFieldSound "FastKickIntoLaunchLane", 0, drain, 0.5
If B2SOn Then DOF 125,DOFPulse
drain.kick 52, 30
bipReel.setValue(ballInPlay)
bipText.text = ballinPlay
If B2SOn Then Controller.B2SSetBallinPlay 32, ballinPlay
drainActive = 0
scoreMotorDone = 0
If vrOption > 0 Then vrBipSet
bip = bip + 1
End Sub
Sub giOn
For Each xx in GILights: xx.state = 1: Next
Photo_Debbie.image = "debbie_on"
Photo_Curt.image = "kurt_on"
Photo_Toad.image = "toad_on"
Photo_Joe.image = "joe_on"
Photo_Steve.image = "steve_on"
Photo_Laurie.image = "laurie_on"
Photo_Bob.image = "bob_on"
Photo_John.image = "john_on"
Photo_Carol.image = "carol_on"
Photo_wolfMan.image = "wolf_on"
LaneGuides.image = "laneguides_on"
Walls_Metal.image = "wallsMetal2_on"
Rubbers.image = "rubbers_on"
lsling.image = "rubbers_on"
rsling.image = "rubbers_on"
lFlip.image = "flipperLeft_on"
rFlip.image = "flipperRight_on"
ROLI001.image = "rubbers_on"
RORI001.image = "rubbers_on"
SaucerCup.image ="saucer_on"
Gilardis.image = "gilardis_on"
Walls_WoodLow.image = "wallsWood_on"
playfield_mesh2.image = "pf_on"
MelsMain.image = "melsmain_on"
MelsParking.image = "melspark_on"
MelsSign.image = "melssignbase_on"
GearShifter.image = "shifter_on"
Skull.image = "skull_on"
PhoneBooth.image = "phone_on"
Payphone.image = "payphone_on"
Posts_Orange.image = "postsOrange2_on"
Posts_Teal.image = "postsTeal2_on"
pfholes.image = "pfholes_on"
plasticBottoms.image = "plastics_on"
GIbulbs.image = "gi_on"
End Sub
Sub giOff
For Each xx in GILights: xx.state = 0: Next
Photo_Debbie.image = "debbie_off"
Photo_Curt.image = "kurt_off"
Photo_Toad.image = "toad_off"
Photo_Joe.image = "joe_off"
Photo_Steve.image = "steve_off"
Photo_Laurie.image = "laurie_off"
Photo_Bob.image = "bob_off"
Photo_John.image = "john_off"
Photo_Carol.image = "carol_off"
Photo_wolfMan.image = "wolf_off"
LaneGuides.image = "laneguides_off"
Walls_Metal.image = "wallsMetal2_off"
Rubbers.image = "rubbers_off"
lsling.image = "rubbers_off"
rsling.image = "rubbers_off"
lFlip.image = "flipperLeft_off"
rFlip.image = "flipperRight_off"
ROLI001.image = "rubbers_off"
RORI001.image = "rubbers_off"
SaucerCup.image ="saucer_off"
Gilardis.image = "gilardis_off"
Walls_WoodLow.image = "wallsWood_off"
playfield_mesh2.image = "pf_off"
MelsMain.image = "melsmain_off"
MelsParking.image = "melspark_off"
MelsSign.image = "melssignbase_off"
GearShifter.image = "shifter_off"
Skull.image = "skull_off"
PhoneBooth.image = "phone_off"
Payphone.image = "payphone_off"
Posts_Orange.image = "postsOrange2_off"
Posts_Teal.image = "postsTeal2_off"
pfholes.image = "pfholes_off"
plasticBottoms.image = "plastics_off"
GIbulbs.image = "gi_off"
Hcap.image = "bumperH_off"
Ocap.image = "bumperO_off"
Pcap.image = "bumperP_off"
End Sub
'*******************Check for Bonus Score
Dim bonusFlag
Sub scoreBonus
flag10 = 0: flag100 = 0: flag1000 = 0: flag10k = 0
If L068.state = 1 Then
For Each xx in tailLights: xx.state = 0: Next
leftStar = 0: rightStar = 0
releaseBall
Else
fadeMusic.Enabled = 1
bonusFlag = 1
If playerDone(player) = 0 Then
ScoreMotor.enabled = 1
Else
advancePlayers
End If
If laneState = 1 Then resetTopLanes
saveLights
End If
End Sub
'**************Store Player Light States
Sub saveLights
playerLights(player) = Array(L001.state, L002.state, L003.state, L004.state, L010.state, L011.state, L012.state, L013.state, L110.state, L112.state, L114.state, L116.state, L118.state, L120.state)