forked from LegendsUnchained/vpx-standalone-alp4k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPink Panther (Gottlieb 1981) SoundMod Hybrid v1.1.vbs
2255 lines (1917 loc) · 73.3 KB
/
Pink Panther (Gottlieb 1981) SoundMod Hybrid v1.1.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
Option Explicit
Randomize
Const cGameName = "pnkpnthr"
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "Can't open controller.vbs"
On Error Goto 0
LoadVPM "01210000", "sys80.VBS", 3.1
'*********** LUT TOGGLE OPTION *******************************
Dim LTOG: LTOG=1 '*********** set to 0 to turn off LUT Toggle
'*********** COLOR LED TOGGLE OPTION *******************************
Dim CLED: CLED=1 '*********** 1=BLUE:2=PINK:3=ORANGE
'*********** Desktop/Cabinet settings ************************
Dim DesktopMode: DesktopMode = Table1.ShowDT
Dim hiddenvalue
If DesktopMode = True Then 'Show Desktop components
hiddenvalue=0
SideRailRight.Visible = 1
SideRailLeft.Visible = 1
Else
hiddenvalue=1
SideRailRight.Visible = 0
SideRailLeft.Visible = 0
End if
If VRRoom=1 Or VRRoom=2 Then 'Hide Desktop Siderails
SideRailRight.Visible = 0
SideRailLeft.Visible = 0
End if
'****************************** Script for VR Rooms ********************
' VR Option
Dim VRRoom, Object, UseVPMDMD, InfoBox
'VR Room
VRRoom = 0 ' 0 = desktop/fullscreen, 1 = pink room, 2 = minimal VR Room
Infobox = 0 ' 0 = huge infobox in rooms, 1 = no infobox
If VRRoom = 1 Or VRRoom = 2 then UseVPMDMD = true Else UseVPMDMD = DesktopMode
If VRRoom = 0 Then
for each Object in ColVR : object.visible = 0 : next
End If
If VRRoom = 1 Then ' pink room
for each Object in ColRoom1 : object.visible = 1 : next
for each Object in ColRoomMinimal : object.visible = 0 : next
for each Object in ColBackdrop : object.visible = 0 : next
If InfoBox = 0 Then for each Object in ColInfobox : object.visible = 1 : next
If InfoBox = 1 Then for each Object in ColInfobox : object.visible = 0 : next
End If
If VRRoom = 2 Then ' minimal room
for each Object in ColRoom1 : object.visible = 0 : next
for each Object in ColRoomMinimal : object.visible = 1 : next
for each Object in ColBackdrop : object.visible = 0 : next
If InfoBox = 0 Then for each Object in ColInfobox : object.visible = 1 : next
If InfoBox = 1 Then for each Object in ColInfobox : object.visible = 0 : next
End If
'**********************************************************
'******** OPTIONS *******************************
'**********************************************************
Dim BallShadows: Ballshadows=1 '******************set to 1 to turn on Ball shadows
Dim FlipperShadows: FlipperShadows=1 '***********set to 1 to turn on Flipper shadows
' Block shadow from playfield in plungerlane
Dim ControlBall, contballinplay
Sub StartControl_Hit()
Set ControlBall = ActiveBall
contballinplay = True
VR_ShadowBlocker.visible = False
End Sub
Sub ShadowOn_Hit()
VR_ShadowBlocker.visible = True
End Sub
'*************
'//////////////---- LUT (Colour Look Up Table) ----//////////////
'*************
'0 = Fleep Natural Dark 1
'1 = Fleep Natural Dark 2
'2 = Fleep Warm Dark
'3 = Fleep Warm Bright
'4 = Fleep Warm Vivid Soft
'5 = Fleep Warm Vivid Hard
'6 = Skitso Natural and Balanced
'7 = Skitso Natural High Contrast
'8 = 3rdaxis Referenced THX Standard
'9 = CalleV Punchy Brightness and Contrast
'10 = HauntFreaks Desaturated
'11 = Tomate Washed Out
'12 = VPW Original 1 to 1
'13 = Bassgeige
'14 = Blacklight
'15 = B&W Comic Book
Dim LUTset, LutToggleSound
LutToggleSound = True
LoadLUT
SetLUT
'*************
'//////////////---- Flyer ----//////////////
'*************
Dim FlyerSet, DisableFlyerSelector
DisableFlyerSelector = 1
'************************************************
'************************************************
'************************************************
'************************************************
'************************************************
Const UseSolenoids = True
Const UseLamps = True
Const UseSync = False
Const UseGI = False
' Standard Sounds
Const SSolenoidOn = "fx_solenoid"
Const SSolenoidOff = "fx_solenoidoff"
Const SCoin = "fx_coin"
Dim bsTrough, bskicker, bslLock, bsrLock, dttop, dtleft, FastFlips
DisplayTimer.Enabled = true
Sub FlipperTimer_Timer
'Add flipper, gate and spinner rotations here
FlipperLB.Rotz = LeftFlipper.CurrentAngle
FlipperLR.Rotz = LeftFlipper.CurrentAngle
FlipperRB1.Rotz = RightFlipper.CurrentAngle
FlipperRR1.Rotz = RightFlipper.CurrentAngle
FlipperRB.Rotz = RightFlipper.CurrentAngle
FlipperRR.Rotz = RightFlipper.CurrentAngle
FlipperLSh.rotz = LeftFlipper.currentangle '+ 45
FlipperRSh.rotz = RightFlipper1.currentangle '+ 45
FlipperRSh1.rotz = RightFlipper1.currentangle '+ 45
BGDisplayTimer
End Sub
'*****************************************************************************************************
' VR PLUNGER ANIMATION
'
' Code needed to animate the plunger. If you pull the plunger it will move in VR.
' IMPORTANT: there are two numeric values in the code that define the postion of the plunger and the
' range in which it can move. The first numeric value is the actual y position of the plunger primitive
' and the second is the actual y position + 135 to determine the range in which it can move.
'
' You need to to select the Primary_plunger primitive you copied from the
' template and copy the value of the Y position
' (e.g. 2114) into the code. The value that determines the range of the plunger is always the y
' position + 135 (e.g. 2249).
'
'*****************************************************************************************************
Sub TimerPlunger_Timer
If VR_Primary_plunger.Y < 2485 then
VR_Primary_plunger.Y = VR_Primary_plunger.Y + 5
End If
End Sub
Sub TimerPlunger2_Timer
'debug.print plunger.position
VR_Primary_plunger.Y = 2350 + (5* Plunger.Position) -20
End Sub
'*****************************************************
' Table Init
'*****************************************************
Sub Table1_Init
With Controller
.GameName = cGameName
If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
.SplashInfoLine = "Pink Panther (Gottlieb 1981) SoundMOD Hybrid v1.1"&chr(13)&"By Bord and Xenonph"
.HandleKeyboard = 0
.ShowTitle = 0
.ShowDMDOnly = 1
.ShowFrame = 0
.HandleMechanics = False
.Hidden = HiddenValue
If CLED=2 Then
Controller.Games("pnkpnthr").Settings.Value("dmd_red") = 238 'PINK LED
Controller.Games("pnkpnthr").Settings.Value("dmd_green") = 133 'PINK LED
Controller.Games("pnkpnthr").Settings.Value("dmd_blue") = 155 'PINK LED
End If
If CLED=3 Then
Controller.Games("pnkpnthr").Settings.Value("dmd_red") = 255 'ORANGE LED
Controller.Games("pnkpnthr").Settings.Value("dmd_green") = 88 'ORANGE LED
Controller.Games("pnkpnthr").Settings.Value("dmd_blue") = 32 'ORANGE LED
End If
If CLED=1 Then
Controller.Games("pnkpnthr").Settings.Value("dmd_red") = 0 'BLUE LED
Controller.Games("pnkpnthr").Settings.Value("dmd_green") = 150 'BLUE LED
Controller.Games("pnkpnthr").Settings.Value("dmd_blue") = 250 'BLUE LED
End If
.Games(cGameName).Settings.Value("sound")=0 'TURNS OFF ROM SOUNDS
On Error Resume Next
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
On Error Goto 0
End With
PinMAMETimer.Interval = PinMAMEInterval
PinMAMETimer.Enabled = 1:GB01.enabled=True
'Trough
Set bsTrough=New cvpmBallStack
with bsTrough
.InitSw 63,73,0,0,0,0,0,0
.InitKick ballrelease, 110, 12
.InitExitSnd Soundfx("fx_ballrel",DOFContactors), Soundfx("fx_solenoid",DOFContactors)
.Balls=3
end with
'Kickers
Set bskicker=New cvpmBallStack
with bskicker
.InitSaucer sw13,13,255,12
.InitExitSnd Soundfx("fx_ballrel",DOFContactors), Soundfx("fx_solenoid",DOFContactors)
.kickanglevar=2
end with
Set bslLock=New cvpmBallStack
with bslLock
.InitSaucer sw43,43,-170,10
.InitExitSnd Soundfx("fx_ballrel",DOFContactors), Soundfx("fx_solenoid",DOFContactors)
end with
Set bsrLock=New cvpmBallStack
with bsrLock
.InitSaucer sw53,53,320,11
.InitExitSnd Soundfx("fx_ballrel",DOFContactors), Soundfx("fx_solenoid",DOFContactors)
end with
' Nudging
vpmNudge.TiltSwitch = 57
vpmNudge.Sensitivity = 3
vpmNudge.TiltObj = Array(leftslingshot, rightslingshot, bumper1, bumper2, bumper3, bumper4)
Set dtTop=New cvpmDropTarget
dtTop.InitDrop Array(sw51,sw61,sw71),Array(51,61,71)
dtTop.InitSnd SoundFX("fx_droptarget",DOFDropTargets),SoundFX("fx_DTReset",DOFDropTargets)
Set dtLeft=New cvpmDropTarget
dtLeft.InitDrop Array(sw40,sw50,sw60,sw70),Array(40,50,60,70)
dtLeft.InitSnd SoundFX("fx_droptarget",DOFDropTargets),SoundFX("fx_DTReset",DOFDropTargets)
if ballshadows=1 then
BallShadowUpdate.enabled=1
else
BallShadowUpdate.enabled=0
end if
if flippershadows=1 then
FlipperLSh.visible=1
FlipperRSh.visible=1
FlipperRSh1.visible=1
else
FlipperLSh.visible=0
FlipperRSh.visible=0
FlipperRSh1.visible=0
end if
Set FastFlips = new cFastFlips
with FastFlips
.CallBackL = "SolLflipper" 'Point these to flipper subs
.CallBackR = "SolRflipper" '...
' .CallBackUL = "SolULflipper"'...(upper flippers, if needed)
' .CallBackUR = "SolURflipper"'...
.TiltObjects = True 'Optional, if True calls vpmnudge.solgameon automatically. IF YOU GET A LINE 1 ERROR, DISABLE THIS! (or setup vpmNudge.TiltObj!)
' .DebugOn = False 'Debug, always-on flippers. Call FastFlips.DebugOn True or False in debugger to enable/disable.
end with
If VRRoom = 1 Or VRRoom = 2 Then
setup_backglass()
End If
End Sub
'************************************************
' Solenoids
'************************************************
SolCallback(1) = "SolKicker"
SolCallback(2) = "SolTopTargetReset"
'SolCallback(3) = coin1
'SolCallback(4) = coin2
SolCallback(5) = "SolLeftTargetReset"
SolCallback(6) = "delayedSolOut"
'SolCallback(7) = coin3
SolCallback(8) = "solknocker"
SolCallback(9) = "bstrough.SolIn"
SolCallback(10) = "FastFlips.TiltSol"
SolCallback(sLRFlipper) = "SolRFlipper"
SolCallback(sLLFlipper) = "SolLFlipper"
Sub SolLFlipper(Enabled)
If Enabled Then
PlaySound SoundFX("fx_Flipperup",DOFContactors)
'LeftFlipper.RotateToEnd
lf.fire
Else
PlaySound SoundFX("fx_Flipperdown",DOFContactors):LeftFlipper.RotateToStart
End If
End Sub
Sub SolRFlipper(Enabled)
If Enabled Then
PlaySound SoundFX("fx_Flipperup",DOFContactors)
'RightFlipper.RotateToEnd
'RightFlipper1.RotateToEnd
RF.fire
RF1.fire
Else
PlaySound SoundFX("fx_Flipperdown",DOFContactors):RightFlipper.RotateToStart:RightFlipper1.RotateToStart
End If
End Sub
'***** EM kicker animation
Dim RightEMPos
Sub SolKicker(enabled)
If enabled Then
bskicker.ExitSol_On
RightEMpos = 0
PkickarmR.RotZ = 2
RightEMTimer.Enabled = 1
End If
End Sub
Sub RightEMTimer_Timer
Select Case RightEMpos
Case 1:PkickarmR.Rotz = 15
Case 2:PkickarmR.Rotz = 15
Case 3:PkickarmR.Rotz = 15
Case 4:PkickarmR.Rotz = 8
Case 5:PkickarmR.Rotz = 4
Case 6:PkickarmR.Rotz = 2
Case 7:PkickarmR.Rotz = 0:RightEMTimer.Enabled = 0
End Select
RightEMpos = RightEMpos + 1
End Sub
Dim timer
Sub delayedSolOut(enabled)
if not timer then bsTrough.SolOut enabled
if not enabled then timer = True : ballrelease.TimerEnabled = True
End Sub
Sub ballrelease_Timer()
ballrelease.TimerEnabled = False
timer = False
End Sub
'*****Drop Lights Off
dim xx
For each xx in dtLeftLights: xx.state=0:Next
'**********************************************************************************************************
'Plunger code
'**********************************************************************************************************
Sub Table1_KeyDown(ByVal KeyCode)
KeyDownHandler(KeyCode)
If Keycode = LeftMagnaSave And LTOG=1 Then ' Change LUT with magna-save buttons
LUTSet = LUTSet + 1
if LutSet > 15 then LUTSet = 0
lutsetsounddir = 1
If LutToggleSound then
If lutsetsounddir = 1 And LutSet <> 15 Then
Playsound "click", 0, 1, 0.1, 0.25
End If
If lutsetsounddir = -1 And LutSet <> 15 Then
Playsound "click", 0, 1, 0.1, 0.25
End If
If LutSet = 15 Then
Playsound "gun", 0, 1, 0.1, 0.25
End If
LutSlctr.enabled = true
SetLUT
ShowLUT
End If
End If
If keycode = LeftFlipperKey Then
FastFlips.FlipL True
FastFlips.FlipUL True
End If
If KeyCode = RightFlipperKey then
FastFlips.FlipR True
FastFlips.FlipUR True
End If
If VRRoom = 1 Or VRRoom = 2 Then
If keycode = LeftFlipperKey Then
VR_CabFlipperLeft.X = VR_CabFlipperLeft.X +10 ' Animate VR Left flipperbutton
If DisableFlyerSelector = 0 Then
FlyerSet = Flyerset - 1
if FlyerSet < 0 then FlyerSet = 3
End If
End If
If keycode = RightFlipperKey Then
VR_CabFlipperRight.X = VR_CabFlipperRight.X - 10 ' Animate VR Right flipperbutton
If DisableFlyerSelector = 0 Then
FlyerSet = FlyerSet + 1
if FlyerSet > 3 then FlyerSet = 0
End If
End If
End If
If Keycode = StartGameKey Then
VR_Cab_StartButton.y = VR_Cab_StartButton.y -5 ' Animate VR Startbutton
DisableFlyerSelector = 1
PS01.enabled=True
End If
If keycode = PlungerKey Then
Plunger.Pullback
playsound"plungerpull"
TimerPlunger.Enabled = True
TimerPlunger2.Enabled = False
End If
If keycode=AddCreditKey then
PlaySound "fx_coin", 0, 1, 0.1, 0.25
CI01.enabled=True
end if
End Sub
Sub Table1_KeyUp(ByVal KeyCode)
KeyUpHandler(KeyCode)
If KeyCode = LeftFlipperKey then
FastFlips.FlipL False
FastFlips.FlipUL False
End If
If KeyCode = RightFlipperKey then
FastFlips.FlipR False
FastFlips.FlipUR False
End If
If VRRoom = 1 Or VRRoom = 2 Then
If keycode = LeftFlipperKey Then
VR_CabFlipperLeft.X = VR_CabFlipperLeft.X -10 ' Animate VR Left flipper
End If
If keycode = RightFlipperKey Then
VR_CabFlipperRight.X = VR_CabFlipperRight.X +10 ' Animate VR Right flipperbutton
End If
If Keycode = StartGameKey Then
VR_Cab_StartButton.y = VR_Cab_StartButton.y +5 ' Animate VR Startbutton
End If
End If
If keycode = PlungerKey Then
Plunger.Fire
PlaySound "plunger", 0, 1, 0.1, 0.25
TimerPlunger.Enabled = False
TimerPlunger2.Enabled = True
VR_Primary_plunger.Y = 2350
end if
If keycode = PlungerKey and PRF=1 Then
PlaySound"plungerreleasefree"
End If
If Keycode = StartGameKey Then
VR_Cab_StartButton.y = VR_Cab_StartButton.y +5 ' Animate VR Startbutton
End If
End Sub
'**********************************************************************************************************
'LUT selector timer
'**********************************************************************************************************
dim lutsetsounddir
sub LutSlctr_timer
If lutsetsounddir = 1 And LutSet <> 15 Then
Playsound "click", 0, 1, 0.1, 0.25
End If
If lutsetsounddir = -1 And LutSet <> 15 Then
Playsound "click", 0, 1, 0.1, 0.25
End If
If LutSet = 15 Then
Playsound "gun", 0, 1, 0.1, 0.25
End If
LutSlctr.enabled = False
end sub
'**********************************************************************************************************
Sub Drain_Hit():PlaySound "fx_drain":bstrough.addball me:DR01.enabled=True:End Sub
Sub sw13_Hit:PlaySound "kicker_enter_center":bskicker.AddBall 0:CK01.enabled=True:End Sub
Sub sw13_unHit:PlaySound"0PP21":End Sub
Sub sw43_Hit:PlaySound "kicker_enter_center":bslLock.AddBall 0:LK=1:CK01.enabled=True:End Sub
Sub sw43_unHit:
If l11.state=1 Then PlaySound"0PP09a":LK=0: Exit Sub: End If
PlaySound"0PP09"
LK=0
End Sub
Sub sw53_Hit:PlaySound "kicker_enter_center":bsrLock.AddBall 0:RK=1:CK01.enabled=True:End Sub
Sub sw53_unHit:
If l11.state=1 Then PlaySound"0PP09a":RK=0: Exit Sub: End If
PlaySound"0PP09"
RK=0
End Sub
'Drop Targets
Sub Sw51_Dropped:dtTop.Hit 1 :DT01.enabled=True: End Sub
Sub Sw61_Dropped:dtTop.Hit 2 :DT01.enabled=True: End Sub
Sub Sw71_Dropped:dtTop.Hit 3 :DT01.enabled=True: End Sub
Sub Sw40_Dropped:dtLeft.Hit 1 : D1L1.state=1 :DT01.enabled=True: End Sub
Sub Sw50_Dropped:dtLeft.Hit 2 : D2L1.state=1 : D2L2.state=1 :DT01.enabled=True: End Sub
Sub Sw60_Dropped:dtLeft.Hit 3 : D3L1.state=1 : D3L2.state=1 :DT01.enabled=True: End Sub
Sub Sw70_Dropped:dtLeft.Hit 4 : D4L1.state=1 : D4L2.state=1 :DT01.enabled=True: End Sub
Sub SolTopTargetReset(enabled)
dim xx
if enabled then
dtTop.SolDropUp enabled
end if
End Sub
Sub SolLeftTargetReset(enabled)
dim xx
if enabled then
dtLeft.SolDropUp enabled
For each xx in DTLeftLights: xx.state=0:Next
end if
End Sub
'Bumpers
Sub bumper1_Hit : vpmTimer.PulseSw 23 : playsound SoundFX("fx_bumper1",DOFContactors): DOF 206, DOFPulse:BU01.enabled=True:End Sub
Sub bumper2_Hit : vpmTimer.PulseSw 23 : playsound SoundFX("fx_bumper2",DOFContactors): DOF 209, DOFPulse:BU01.enabled=True:End Sub
Sub bumper3_Hit : vpmTimer.PulseSw 23 : playsound SoundFX("fx_bumper3",DOFContactors): DOF 208, DOFPulse:BU01.enabled=True:End Sub
Sub bumper4_Hit : vpmTimer.PulseSw 23 : playsound SoundFX("fx_bumper4",DOFContactors): DOF 207, DOFPulse:BU01.enabled=True:End Sub
'Wire Triggers
Sub SW02_Hit:Controller.Switch(02)=1:PlaySound"rollover":WR01.enabled=True:End Sub 'P
Sub SW02_unHit:Controller.Switch(02)=0:End Sub
Sub SW12_Hit:Controller.Switch(12)=1:PlaySound"rollover":WR01.enabled=True:End Sub 'I
Sub SW12_unHit:Controller.Switch(12)=0:End Sub
Sub SW22_Hit:Controller.Switch(22)=1:PlaySound"rollover":WR01.enabled=True:End Sub 'N
Sub SW22_unHit:Controller.Switch(22)=0:End Sub
Sub SW32_Hit:Controller.Switch(32)=1:PlaySound"rollover":WR01.enabled=True:End Sub 'K
Sub SW32_unHit:Controller.Switch(32)=0:End Sub
Sub SW03_Hit:Controller.Switch(03)=1:PlaySound"rollover":WR01.enabled=True:End Sub 'right inlane
Sub SW03_unHit:Controller.Switch(03)=0:End Sub
Sub SW42_Hit:Controller.Switch(42)=1:PlaySound"rollover":WR01.enabled=True:End Sub 'left inlane
Sub SW42_unHit:Controller.Switch(42)=0:End Sub
Sub SW62_Hit:Controller.Switch(62)=1:PlaySound"rollover":PlaySound"0PP09":End Sub 'left outlane
Sub SW62_unHit:Controller.Switch(62)=0:End Sub
Sub SW72_Hit:Controller.Switch(72)=1:PlaySound"rollover":PlaySound"0PP09":End Sub 'right outlane
Sub SW72_unHit:Controller.Switch(72)=0:End Sub
'Targets
Sub sw00_Hit:vpmTimer.PulseSw (00):playsound"target":PlaySound"0PP10":End Sub
Sub sw10_Hit:vpmTimer.PulseSw (10):playsound"target":PlaySound"0PP10":End Sub
Sub sw20_Hit:vpmTimer.PulseSw (20):playsound"target":PlaySound"0PP10":End Sub
Sub sw30_Hit:vpmTimer.PulseSw (30):playsound"target":PlaySound"0PP10":End Sub
Sub sw01_Hit:vpmTimer.PulseSw (01):playsound"target":PlaySound"0PP10":End Sub
Sub sw11_Hit:vpmTimer.PulseSw (11):playsound"target":PlaySound"0PP10":End Sub
Sub sw21_Hit:vpmTimer.PulseSw (21):playsound"target":PlaySound"0PP10":End Sub
Sub sw31_Hit:vpmTimer.PulseSw (31):playsound"target":PlaySound"0PP10":End Sub
Sub sw41_Hit:vpmTimer.PulseSw (41):playsound"target":PlaySound"0PP10":End Sub
Sub SolKnocker(Enabled)
If Enabled Then PlaySound SoundFX("Knocker",DOFKnocker)
End Sub
'**********Sling Shot Animations
' Rstep and Lstep are the variables that increment the animation
'****************
Dim RStep, Lstep, D1Step, D2Step, D3Step, D4Step, D5Step, D6Step
Sub RightSlingShot_Slingshot
PlaySound SoundFX("fx_slingshot",DOFContactors), 0, 1, 0.05, 0.05
DOF 202, DOFPulse
vpmtimer.PulseSw(33)
RSling.Visible = 0
RSling1.Visible = 1
sling1.TransZ = -20
RStep = 0
RightSlingShot.TimerEnabled = 1
PlaySound"0PP11"
End Sub
Sub RightSlingShot_Timer
Select Case RStep
Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
Case 4:RSLing2.Visible = 0:RSLing3.Visible = 1:sling1.TransZ = 0
Case 5:RSLing3.Visible = 0:RSLing.Visible = 1:RightSlingShot.TimerEnabled = 0
End Select
RStep = RStep + 1
End Sub
Sub LeftSlingShot_Slingshot
PlaySound SoundFX("fx_slingshot",DOFContactors),0,1,-0.05,0.05
DOF 201, DOFPulse
vpmtimer.pulsesw(33)
LSling.Visible = 0
LSling1.Visible = 1
sling2.TransZ = -20
LStep = 0
LeftSlingShot.TimerEnabled = 1
PlaySound"0PP11"
End Sub
Sub LeftSlingShot_Timer
Select Case LStep
Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
Case 4:LSLing2.Visible = 0:LSLing3.Visible = 1:sling2.TransZ = 0
Case 5:LSLing3.Visible = 0:LSLing.Visible = 1:LeftSlingShot.TimerEnabled = 0
End Select
LStep = LStep + 1
End Sub
Sub Dingwall1_Slingshot
vpmtimer.pulsesw(33)
Rubber7a.Visible = 0
Rubber7a1.Visible = 1
D1Step = 0
Dingwall1.TimerEnabled = 1
PlaySound"0PP11"
End Sub
Sub Dingwall1_Timer
Select Case D1Step
Case 3:Rubber7a1.Visible = 0:Rubber7a2.Visible = 1
Case 4:Rubber7a2.Visible = 0:Rubber7a.Visible = 1:Dingwall1.TimerEnabled = 0
End Select
D1Step = D1Step + 1
End Sub
Sub Dingwall2_Slingshot
Rubber7a.Visible = 0
Rubber7a3.Visible = 1
D2Step = 0
Dingwall2.TimerEnabled = 1
PlaySound"0PP11"
End Sub
Sub Dingwall2_Timer
Select Case D2Step
Case 3:Rubber7a3.Visible = 0:Rubber7a4.Visible = 1
Case 4:Rubber7a4.Visible = 0:Rubber7a.Visible = 1:Dingwall2.TimerEnabled = 0
End Select
D2Step = D2Step + 1
End Sub
Sub Dingwall3_Slingshot
Rubberc.Visible = 0
Rubberc1.Visible = 1
D3Step = 0
Dingwall3.TimerEnabled = 1
PlaySound"0PP11"
End Sub
Sub Dingwall3_Timer
Select Case D3Step
Case 3:Rubberc1.Visible = 0:Rubberc2.Visible = 1
Case 4:Rubberc2.Visible = 0:Rubberc.Visible = 1:Dingwall3.TimerEnabled = 0
End Select
D3Step = D3Step + 1
End Sub
Sub Dingwall4_Slingshot
Rubberd.Visible = 0
Rubberd1.Visible = 1
D4Step = 0
Dingwall4.TimerEnabled = 1
PlaySound"0PP11"
End Sub
Sub Dingwall4_Timer
Select Case D4Step
Case 3:Rubberd1.Visible = 0:Rubberd2.Visible = 1
Case 4:Rubberd2.Visible = 0:Rubberd.Visible = 1:Dingwall4.TimerEnabled = 0
End Select
D4Step = D4Step + 1
End Sub
Sub Dingwall5_Slingshot
vpmtimer.pulsesw(33)
Rubbere.Visible = 0
Rubbere1.Visible = 1
D5Step = 0
Dingwall5.TimerEnabled = 1
PlaySound"0PP11"
End Sub
Sub Dingwall5_Timer
Select Case D5Step
Case 3:Rubbere1.Visible = 0:Rubbere2.Visible = 1
Case 4:Rubbere2.Visible = 0:Rubbere.Visible = 1:Dingwall5.TimerEnabled = 0
End Select
D5Step = D5Step + 1
End Sub
Sub Dingwall6_Slingshot
vpmtimer.pulsesw(33)
Rubberf.Visible = 0
Rubberf1.Visible = 1
D6Step = 0
Dingwall6.TimerEnabled = 1
PlaySound"0PP11"
End Sub
Sub Dingwall6_Timer
Select Case D6Step
Case 3:Rubberf1.Visible = 0:Rubberf2.Visible = 1
Case 4:Rubberf2.Visible = 0:Rubberf.Visible = 1:Dingwall6.TimerEnabled = 0
End Select
D6Step = D6Step + 1
End Sub
' *********************************************************************
' Supporting Ball & Sound Functions
' *********************************************************************
Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed, decrease the default 2000 to hear a louder rolling ball sound
Vol = Csng(BallVel(ball) ^2 / 1000)
End Function
Function Pan(ball) ' Calculates the pan for a ball based on the X position on the Table. "Table" is the name of the table
Dim tmp
tmp = ball.x * 2 / Table1.width-1
If tmp> 0 Then
Pan = Csng(tmp ^10)
Else
Pan = Csng(-((- tmp) ^10) )
End If
End Function
Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
Pitch = BallVel(ball) * 20
End Function
Function BallVel(ball) 'Calculates the ball speed
BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
End Function
'*****************************************
' JP's VP10 Rolling Sounds
'*****************************************
Const tnob = 3 ' total number of balls
ReDim rolling(tnob)
InitRolling
Sub InitRolling
Dim i
For i = 0 to tnob
rolling(i) = False
Next
End Sub
Sub RollingTimer_Timer()
Dim BOT, b
BOT = GetBalls
' stop the sound of deleted balls
For b = UBound(BOT) + 1 to tnob
rolling(b) = False
StopSound("fx_ballrolling" & b)
Next
' exit the sub if no balls on the table
If UBound(BOT) = -1 Then Exit Sub
' play the rolling sound for each ball
For b = 0 to UBound(BOT)
If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
rolling(b) = True
PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
Else
If rolling(b) = True Then
StopSound("fx_ballrolling" & b)
rolling(b) = False
End If
End If
Next
End Sub
'**********************
' Ball Collision Sound
'**********************
Sub OnBallBallCollision(ball1, ball2, velocity)
PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
End Sub
'******************************
' Diverse Collection Hit Sounds
'******************************
'Sub aMetals_Hit(idx):PlaySound "fx_MetalHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
'Sub aRubber_Bands_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
'Sub aRubbers_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
'Sub aRubber_Posts_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
'Sub aRubber_Pins_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aPlastics_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
'Sub aTargets_Hit(idx):PlaySound "fx2_target", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aRubber_Pins_Hit (idx)
PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
End Sub
Sub aTargets_Hit (idx)
PlaySound "target", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
End Sub
Sub aMetals_Hit (idx)
PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
End Sub
Sub aGates_Hit (idx)
PlaySound "gate4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
End Sub
Sub aRubber_Bands_Hit(idx)
dim finalspeed
finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
If finalspeed > 20 then
PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
End if
If finalspeed >= 6 AND finalspeed <= 20 then
RandomSoundRubber()
End If
End Sub
Sub aRubber_Posts_Hit(idx)
dim finalspeed
finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
If finalspeed > 16 then
PlaySound "fx_postrubber", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
End if
If finalspeed >= 6 AND finalspeed <= 16 then
RandomSoundRubber()
End If
End Sub
Sub RandomSoundRubber()
Select Case Int(Rnd*3)+1
Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
End Select
End Sub
Sub LeftFlipper_Collide(parm)
RandomSoundFlipper()
End Sub
Sub RightFlipper_Collide(parm)
RandomSoundFlipper()
End Sub
Sub RandomSoundFlipper()
Select Case Int(Rnd*3)+1
Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
End Select
End Sub
'GI uselamps workaround
dim GIlamps : set GIlamps = New GIcatcherobject
Class GIcatcherObject 'object that disguises itself as a light. (UseLamps workaround for System80 GI circuit)
Public Property Let State(input)
dim x
if input = 1 then 'If GI switch is engaged, turn off GI.
for each x in gi : x.state = 0 : next
elseif input = 0 then
for each x in gi : x.state = 1 : next
end if
'tb.text = "gitcatcher.state = " & input 'debug
End Property
End Class
'-------------------------------------
' Map lights into array
' Set unmapped lamps to Nothing
'-------------------------------------
Set Lights(0) = l0 'ball in play
'Set Lights(1) = l1 'tilt
set Lights(1) = GIlamps 'GI circuit
'Set Lights(2) = l2 coin lockout coil
Set Lights(3) = l3 'shoot again
Set Lights(8) = l8 'left capture release
Set Lights(9) = l9 'right capture release
'Set Lights(10) = l10 high score
Set Lights(11) = l11 'game over
Set Lights(12) = l12
Set Lights(13) = l13
Set Lights(14) = l14
Set Lights(15) = l15
Set Lights(16) = l16
Set Lights(17) = l17
Set Lights(18) = l18
Set Lights(19) = l19
Set Lights(20) = l20
Set Lights(21) = l21
Set Lights(22) = l22
Set Lights(23) = l23
Set Lights(24) = l24
Set Lights(25) = l25
Set Lights(26) = l26
Set Lights(27) = l27
Set Lights(28) = l28
Set Lights(29) = l29
Set Lights(30) = l30
Set Lights(31) = l31
Set Lights(32) = l32
Set Lights(33) = l33
Set Lights(34) = l34
Set Lights(35) = l35
Set Lights(36) = l36
Set Lights(37) = l37
Set Lights(38) = l38
Set Lights(39) = l39
Set Lights(40) = l40
Set Lights(41) = l41
Set Lights(42) = l42
Set Lights(43) = l43
Set Lights(44) = l44
Set Lights(45) = l45
Set Lights(46) = l46
Set Lights(47) = l47
Set Lights(48) = l48
Set Lights(49) = l49
Set Lights(50) = l50
Set Lights(51) = l51
'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
' LL EEEEEE DDDD ,, SSSSS
' LL EE DD DD ,, SS
' LL EE DD DD , SS
' LL EEEE DD DD SS
' LL EE DD DD SS
' LLLLLL EEEEEE DDDD SSSSS
'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
' 7 Digit Array
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dim LED7(36)
LED7(0)=Array()
LED7(1)=Array()
LED7(2)=Array()
LED7(3)=Array()
LED7(4)=Array()
LED7(5)=Array()
LED7(6)=Array()
LED7(7)=Array()
LED7(8)=Array()
LED7(9)=Array()
LED7(10)=Array()
LED7(11)=Array()
LED7(12)=Array()
LED7(13)=Array()
LED7(14)=Array()
LED7(15)=Array()
LED7(16)=Array()
LED7(17)=Array()
LED7(18)=Array()
LED7(19)=Array()
LED7(20)=Array()
LED7(21)=Array()
LED7(22)=Array()