forked from LegendsUnchained/vpx-standalone-alp4k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
F-14 Tomcat (Williams 1987) 1.6.vbs
executable file
·1428 lines (1185 loc) · 43.1 KB
/
F-14 Tomcat (Williams 1987) 1.6.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
'**********************************************************
' ____ _______ __________ __ ___________ ______
' / __/__< / / / /_ __/ __ \/ |/ / ___/ _ /_ __/
' / _//___/ /_ _/ / / / /_/ / /|_/ / /__/ __ |/ /
' /_/ /_/ /_/ /_/ \____/_/ /_/\___/_/ |_/_/
'
'**********************************************************
'
' Williams 1987, F-14 Tomcat
'
' Concept by: Steve Ritchie
' Design by: Steve Ritchie
' Art by: Doug Watson
' Mechanics by: Craig Fitpold
' Music by: Steve Ritchie, Chris Granner
' Sound by: Bill Parod, Chris Granner
' Software by: Eugene Jarvis, Ed Boon
' Notes: This game has two 7-digit alphanumeric score displays and two 7-digit numeric-only score displays.
'
'
'
' Credits:
'
' flupper1 - plastic ramp, wire ramps,
' playfield shadows, primitive flippers
'
' assassin32 - script, playfield scan, table template
'
' ganjafarmer - plastics redraw, lighting, physics
'
'
' Thanks to: wrd1972, vogliadicane, senseless, Nemo, bjschneider93, bassgeige
'
'
' Hanibal -playfield upscale and update + music and lights
'
' www.vpforums.org
'
'
'**********************************************************
Option Explicit
Randomize
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
On Error Goto 0
Dim ChooseBats, Sticker, EdBoon, BumperColor, CustomBackwall, CustomCards
Const BallSize = 50 'do not change
'**********************************************************
'
' OPTIONS
'
'**********************************************************
ChooseBats = 2 '0=default flipper, 1=prim flipper yellow/red, 2=prim flipper white/red, 3=prim flipper white/blue
Sticker = 0 'aplly sticker on top of that beatiful ramp created by flupper1 - 0=OFF, 1=ON
EdBoon = 1 ' Yagov kicker with Ed Boon voice (Scorpion from Mortal Kombat 2) - 0=OFF, 1=ON
BumperColor = 2 '1=blue , 2=red
CustomBackwall = 1 'enable/disable custom backwall graphics
CustomCards = 1 'enable/disable custom cards
'**********************************************************
'
' END OF OPTIONS
'
'**********************************************************
Const cGameName="f14_l1",UseSolenoids=1,UseLamps=0,UseGI=0,SSolenoidOn="SolOn",SSolenoidOff="SolOff", SCoin="coin"
LoadVPM "01560000", "S11.VBS", 3.26
Dim DesktopMode: DesktopMode = Table1.ShowDT
If DesktopMode = True Then 'Show Desktop components
Ramp16.visible=1
Ramp15.visible=1
Primitive13.visible=1
ref1.visible=0
ref2.visible=0
ref3.visible=0
Else
Ramp16.visible=0
Ramp15.visible=0
Primitive13.visible=0
End if
If Sticker = 1 Then
Ramp17.visible=1
Ramp18.visible=0
Else
Ramp17.visible=0
Ramp18.visible=1
End if
If BumperColor = 1 Then
GI_Bumper_1.color = RGB(0,0,255)
GI_Bumper_1.colorfull = RGB(0,0,255)
Else
Bumper.image = "bumper_red"
GI_Bumper_1.color = RGB(255,0,0)
GI_Bumper_1.colorfull = RGB(255,0,0)
End If
If CustomBackwall = 1 Then
Wall21.sidevisible=1
Else
Wall21.sidevisible=0
End If
If CustomCards = 1 Then
Primitive68.image = "apron_custom"
End If
'*************************************************************
'Solenoid Call backs
'**********************************************************************************************************
SolCallback(1) = "bsTrough.SolIn"
SolCallback(2) = "bsTrough.SolOut"
SolCallback(3) = "SolPopper"
SolCallback(5) = "bsRC.SolOut"
SolCallback(6) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
SolCallback(7) = "bsRE.SolOut"
SolCallback(10) = "bsLC.SolOut"
SolCallback(12) = "bsKB.SolOut"
SolCallback(13) = "SolKickback"
Solcallback(14) = "PFGI"
SolCallback(16) = "SolRotateBeacons"
SolCallback(21) = "SolDiverter1"
SolCallback(22) = "SolDiverter2"
SolCallback(sLRFlipper) = "SolRFlipper"
SolCallback(sLLFlipper) = "SolLFlipper"
Sub SolLFlipper(Enabled)
If Enabled Then
PlaySound SoundFX("fx_Flipperup",DOFContactors):LeftFlipper.RotateToEnd:LeftFlipper1.RotateToEnd
Else
PlaySound SoundFX("fx_Flipperdown",DOFContactors):LeftFlipper.RotateToStart:LeftFlipper1.RotateToStart
End If
End Sub
Sub SolRFlipper(Enabled)
If Enabled Then
PlaySound SoundFX("fx_Flipperup",DOFContactors):RightFlipper.RotateToEnd:RightFlipper1.RotateToEnd
Else
PlaySound SoundFX("fx_Flipperdown",DOFContactors):RightFlipper.RotateToStart:RightFlipper1.RotateToStart
End If
End Sub
SolCallback(9) = "Flasher9" 'top blue
SolCallback(15) = "Flasher15" 'top red
SolCallback(25) = "Flasher25" 'yagov white
SolCallback(26) = "Flasher26" 'left lane
SolCallback(27) = "Flasher27" 'right lane
SolCallback(28) = "Flasher28" 'bottom red
SolCallback(29) = "Flasher29" 'bottom white
SolCallback(30) = "Flasher30" 'bottom blue
SolCallback(31) = "Flasher31" 'top white and red
SolCallback(32) = "SetLamp 132," 'radar flashers
Sub Flasher9(value)
SetLamp 109, value
If value Then
FlasherDome9.disablelighting = 1
FlasherDome9.image = "dome3_blue_lit"
'FlasherDome9.material = "Flasherlit"
PlaySound "fx_relay"
Else
FlasherDome9.disablelighting = 0
FlasherDome9.image = "dome3_blue"
'FlasherDome9.material = "Flasherunlit"
End If
End Sub
Sub Flasher15(value)
SetLamp 115, value
If value Then
Primitive2.image="dome3_red_lit"
'Primitive2.material="Flasherlit"
Primitive2.disablelighting=1
PlaySound "fx_relay"
Else
Primitive2.image="dome3_red"
'Primitive2.material="Flasherunlit"
Primitive2.disablelighting=0
End If
End Sub
Sub Flasher25(value)
SetLamp 125, value
if value Then
Primitive4.image="dome3_clear_lit"
'Primitive4.material="Flasherlit"
Primitive4.disablelighting=1
PlaySound "fx_relay"
Dome125.image="dome2_0_red_lit"
Dome125.disablelighting=1
topred.state=1 'backwall reflection
Wall21.sideimage = "backdrop_lit"
Wall21.disablelighting=1
Else
Primitive4.image="dome3_clear"
'Primitive4.material="Flasherunlit"
Primitive4.disablelighting=0
Dome125.image="dome2_0_red_dark"
Dome125.disablelighting=0
topred.state=0 'backwall reflection
Wall21.sideimage = "backdrop"
Wall21.disablelighting=0
End If
End Sub
Sub Flasher26(value)
SetLamp 126, value
if value Then
Dome126.image="dome2_0_red_lit"
Dome126.disablelighting=1
topred.state=1 'backwall reflection
'Wall21.sideimage = "backdrop_lit"
Else
Dome126.image="dome2_0_red_dark"
Dome126.disablelighting=0
topred.state=0 'backwall reflection
'Wall21.sideimage = "backdrop"
End If
End Sub
Sub Flasher27(value)
SetLamp 127, value
if value Then
Dome127.image="dome2_0_red_lit"
Dome127.disablelighting=1
topred.state=1 'backwall reflection
Wall21.sideimage = "backdrop_lit"
Wall21.disablelighting=1
Else
Dome127.image="dome2_0_red_dark"
Dome127.disablelighting=0
topred.state=0 'backwall reflection
Wall21.sideimage = "backdrop"
Wall21.disablelighting=0
End If
End Sub
Sub Flasher28(value)
SetLamp 128, value
if value Then
Primitive16.image="dome3_red_lit"
'Primitive16.material="Flasherlit"
Primitive16.disablelighting=1
PlaySound "fx_relay"
Dome128.image="dome2_0_red_lit"
Dome128.disablelighting=1
topred.state=1 'backwall reflection
'Wall21.sideimage = "backdrop_lit"
Else
Primitive16.image="dome3_red"
'Primitive16.material="Flasherunlit"
Primitive16.disablelighting=0
Dome128.image="dome2_0_red_dark"
Dome128.disablelighting=0
topred.state=0 'backwall reflection
'Wall21.sideimage = "backdrop"
End If
End Sub
Sub Flasher29(value)
SetLamp 129, value
if value Then
Primitive5.image="dome3_clear_lit"
'Primitive5.material="Flasherlit"
Primitive5.disablelighting=1
PlaySound "fx_relay"
Dome129.image="dome2_0_red_lit"
Dome129.disablelighting=1
topred.state=1 'backwall reflection
Wall21.sideimage = "backdrop_lit"
Wall21.disablelighting=1
Else
Primitive5.image="dome3_clear"
'Primitive5.material="Flasherunlit"
Primitive5.disablelighting=0
Dome129.image="dome2_0_red_dark"
Dome129.disablelighting=0
topred.state=0 'backwall reflection
Wall21.sideimage = "backdrop"
Wall21.disablelighting=0
End If
End Sub
Sub Flasher30(value)
SetLamp 130, value
if value Then
Primitive6.image="dome3_blue_lit"
'Primitive6.material="Flasherlit"
Primitive6.disablelighting=1
PlaySound "fx_relay"
Dome130.image="dome2_0_red_lit"
Dome130.disablelighting=1
topred.state=1 'backwall reflection
'Wall21.sideimage = "backdrop_lit"
Else
Primitive6.image="dome3_blue"
'Primitive6.material="Flasherunlit"
Primitive6.disablelighting=0
Dome130.image="dome2_0_red_dark"
Dome130.disablelighting=0
topred.state=0 'backwall reflection
'Wall21.sideimage = "backdrop"
End If
End Sub
Sub Flasher31(value)
SetLamp 131, value
if value Then
Primitive3.image="dome3_clear_lit"
'Primitive3.material="Flasherlit"
Primitive3.disablelighting=1
Primitive1.image="dome3_red_lit"
'Primitive1.material="Flasherlit"
Primitive1.disablelighting=1
PlaySound "fx_relay"
Else
Primitive3.image="dome3_clear"
'Primitive3.material="Flasherunlit"
Primitive3.disablelighting=0
Primitive1.image="dome3_red"
'Primitive1.material="Flasherunlit"
Primitive1.disablelighting=0
End If
End Sub
'**********
' Music
'**********
Dim musicNum
musicNum = int ( rnd * 12)
NextTrack
Sub NextTrack
If musicNum = 0 Then PlayMusic "F14/1.mp3" End If
If musicNum = 1 Then PlayMusic "F14/2.mp3" End If
If musicNum = 2 Then PlayMusic "F14/3.mp3" End If
If musicNum = 3 Then PlayMusic "F14/4.mp3" End If
If musicNum = 4 Then PlayMusic "F14/5.mp3" End If
If musicNum = 5 Then PlayMusic "F14/6.mp3" End If
If musicNum = 6 Then PlayMusic "F14/7.mp3" End If
If musicNum = 7 Then PlayMusic "F14/8.mp3" End If
If musicNum = 8 Then PlayMusic "F14/9.mp3" End If
If musicNum = 9 Then PlayMusic "F14/10.mp3" End If
If musicNum = 10 Then PlayMusic "F14/11.mp3" End If
If musicNum = 11 Then PlayMusic "F14/12.mp3" End If
If musicNum = 12 Then PlayMusic "F14/1.mp3" End If
musicNum = (musicNum + 1) mod 13
End Sub
Sub table1_MusicDone
NextTrack
End Sub
'**********************************************************************************************************
'Solenoid Controlled toys
'**********************************************************************************************************
'Playfield GI
Sub PFGI(Enabled)
If Enabled Then
dim xx
For each xx in GI:xx.State = 1: Next
PlaySound "fx_relay"
ref1.visible=1
ref2.visible=1
ref3.visible=1
Else
For each xx in GI:xx.State = 0: Next
PlaySound "fx_relay"
ref1.visible=0
ref2.visible=0
ref3.visible=0
End If
End Sub
Dim popperBall, popperZpos
Sub SolPopper(Enabled)
If Enabled Then
If bsBP.Balls Then
Set popperBall = sw24a.Createball
popperBall.Z = 0
popperZpos = 0
PlaySound SoundFX("Popper",DOFContactors)
sw24a.TimerInterval = 2
sw24a.TimerEnabled = 1
End If
End If
End Sub
Sub sw24a_Timer
popperBall.Z = popperZpos
popperZpos = popperZpos + 10
If popperZpos> 210 Then
sw24a.TimerEnabled = 0
sw24a.DestroyBall
bsBP.ExitSol_On
End If
End Sub
Sub SolKickBack(enabled)
If enabled Then
KickBack.Fire
PlaySound SoundFX("Popper",DOFContactors)
Else
KickBack.PullBack
End If
End Sub
Sub SolDiverter1(enabled)
If enabled Then
Diverter1.RotateToEnd
PlaySound SoundFX("Popper_Ball",DOFContactors)
PlaySound "fx_relay"
Else
Diverter1.RotateToStart
PlaySound SoundFX("Popper_Ball",DOFContactors)
PlaySound "fx_relay"
End If
End Sub
Sub SolDiverter2(enabled)
If enabled Then
Diverter2.RotateToEnd
PlaySound SoundFX("Popper_Ball",DOFContactors)
PlaySound "fx_relay"
Else
Diverter2.RotateToStart
PlaySound SoundFX("Popper_Ball",DOFContactors)
PlaySound "fx_relay"
End If
End Sub
Sub SolRotateBeacons(Enabled)
If enabled then
Else
End If
End Sub
'**********************************************************************************************************
'Initiate Table
'**********************************************************************************************************
dim bsTrough, bsRE, bsLC, bsRC, bsBP, bsKB
Sub Table1_Init
vpmInit Me
On Error Resume Next
With Controller
.GameName = cGameName
If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
.SplashInfoLine = "F-14 Tomcat (Williams 1987)"&chr(13)&"You Suck"
.HandleMechanics=0
.HandleKeyboard=0
.ShowDMDOnly=1
.ShowFrame=0
.ShowTitle=0
.hidden = 0
On Error Resume Next
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
On Error Goto 0
End With
On Error Goto 0
PinMAMETimer.Interval = PinMAMEInterval
PinMAMETimer.Enabled = 1
vpmNudge.TiltSwitch = swTilt
vpmNudge.Sensitivity = 5
vpmNudge.TiltObj = Array(Bumper1, LeftSlingshot, RightSlingshot)
'Change flippers
ChangeBats(ChooseBats)
' Trough
Set bsTrough = New cvpmBallStack
bsTrough.InitSw 10, 14, 13, 12, 11, 0, 0, 0
bsTrough.InitKick BallRelease, 135, 6
bsTrough.InitExitSnd SoundFX("ballrelease",DOFContactors), SoundFX("Solenoid",DOFContactors)
bsTrough.Balls = 4
' Right Eject
Set bsRE = New cvpmBallStack
bsRE.InitSaucer sw21, 21, 0, 38
bsRE.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
' Left Center Eject
Set bsLC = New cvpmBallStack
bsLC.InitSaucer sw22, 22, 335, 45
bsLC.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
' Right Center Eject
Set bsRC = New cvpmBallStack
bsRC.InitSaucer sw23, 23, 27, 45
bsRC.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
bsRC.KickAngleVar = 4
bsRC.KickForceVar = 1
' Ball Popper
Set bsBP = New cvpmBallStack
bsBP.InitSaucer sw24, 24, 0, 0
bsBP.InitKick sw24a, 270, 40
bsBP.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
' Line of Death Kickback
Set bsKB = New cvpmBallStack
bsKB.InitSaucer sw55, 55, 178, 55
bsKB.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
bsKB.KickAngleVar = 1
bsKB.KickForceVar = 3
' Init ramp diverter
Diverter1.RotatetoStart
Diverter2.RotatetoStart
' Init Rescue Kickback
KickBack.Pullback
End Sub
'Change flippers
Sub ChangeBats(Bats)
Select Case Bats
Case 0
batleft.visible = 0 : batright.visible = 0 : batleft1.visible = 0 : batright1.visible = 0 : LeftFlipper.visible = 1 : RightFlipper.visible = 1 : LeftFlipper1.visible = 1 : RightFlipper1.visible = 1
batleftshadow.visible = 0 : batrightshadow.visible = 0 : batleftshadow1.visible = 0 : batrightshadow1.visible = 0 : GraphicsTimer.enabled = False
Case 1
batleft.visible = 1 : batright.visible = 1 : batleft1.visible = 1 : batright1.visible = 1 : LeftFlipper.visible = 0 : RightFlipper.visible = 0 : LeftFlipper1.visible = 0 : RightFlipper1.visible = 0
batleftshadow.visible = 1 : batrightshadow.visible = 1 : batleftshadow1.visible = 1 : batrightshadow1.visible = 1 : GraphicsTimer.enabled = True
Case 2
batleft.visible = 1 : batright.visible = 1 : batleft1.visible = 1 : batright1.visible = 1 : LeftFlipper.visible = 0 : RightFlipper.visible = 0 : LeftFlipper1.visible = 0 : RightFlipper1.visible = 0
batleftshadow.visible = 1 : batrightshadow.visible = 1 : batleftshadow1.visible = 1 : batrightshadow1.visible = 1 : GraphicsTimer.enabled = True
batleft.image = "flipper_white_red" : batright.image = "flipper_white_red" : batleft1.image = "flipper_white_red" : batright1.image = "flipper_white_red"
Case 3
batleft.visible = 1 : batright.visible = 1 : batleft1.visible = 1 : batright1.visible = 1 : LeftFlipper.visible = 0 : RightFlipper.visible = 0 : LeftFlipper1.visible = 0 : RightFlipper1.visible = 0
batleftshadow.visible = 1 : batrightshadow.visible = 1 : batleftshadow1.visible = 1 : batrightshadow1.visible = 1 : GraphicsTimer.enabled = True
batleft.image = "flipper_white_blue" : batright.image = "flipper_white_blue" : batleft1.image = "flipper_white_blue" : batright1.image = "flipper_white_blue"
End Select
End Sub
'**********************************************************************************************************
'Plunger code
'**********************************************************************************************************
Sub Table1_KeyDown(ByVal KeyCode)
If KeyDownHandler(keycode) Then Exit Sub
If keycode = PlungerKey Then Plunger.Pullback:playsound"plungerpull"
If keycode = RightFlipperKey Then Controller.Switch(63) = 1
If keycode = LeftFlipperKey Then Controller.Switch(15) = 1
End Sub
Sub Table1_KeyUp(ByVal KeyCode)
If KeyUpHandler(keycode) Then Exit Sub
If keycode = PlungerKey Then Plunger.Fire:PlaySound"plunger"
If keycode = RightFlipperKey Then Controller.Switch(63) = 0
If keycode = LeftFlipperKey Then Controller.Switch(15) = 0
End Sub
'**********************************************************************************************************
' Drain and Kickers
Sub Drain_Hit:bsTrough.addball me : playsound"drain" : End Sub
Sub sw21_Hit:bsRE.AddBall Me : playsound"popper_ball" : End Sub
Sub sw22_Hit:bsLC.AddBall Me : playsound"popper_ball" : End Sub
Sub sw23_Hit:bsRC.AddBall Me : playsound"popper_ball" : End Sub
Sub sw24_Hit:bsBP.AddBall Me : playsound"popper_ball" : End Sub
Sub Triggerright_Hit:l141.state = 1: End Sub
Sub Triggerright_UnHit:l141.state = 0: End Sub
Sub Triggerleft_Hit:l140.state = 1: End Sub
Sub Triggerleft_UnHit:l140.state = 0: End Sub
'YAGOV KICKER
Sub sw55_Hit
bsKB.AddBall Me
playsound"popper_ball"
If EdBoon = 1 Then
Select Case Int(Rnd*2)+1
Case 1 : playsound "scorpion"
Case 2 : playsound "scorpion2"
End Select
End If
End Sub
'Bumpers with lights
Sub Bumper1_Hit : vpmTimer.PulseSw(28) : playsound SoundFX("fx_bumper",DOFContactors): B1.state = 1:B1a.state = 1: End Sub
Sub Bumper1_Unhit:B1.state = 0:B1a.state = 0: End Sub
' Stand Up Targets
Sub sw25_Hit:vpmTimer.PulseSw(25):End Sub
Sub sw26_Hit:vpmTimer.PulseSw(26):End Sub
Sub sw33_Hit:vpmTimer.PulseSw(33):End Sub
Sub sw34_Hit:vpmTimer.PulseSw(34):End Sub
Sub sw35_Hit:vpmTimer.PulseSw(35):End Sub
Sub sw36_Hit:vpmTimer.PulseSw(36):End Sub
Sub sw37_Hit:vpmTimer.PulseSw(37):End Sub
Sub sw38_Hit:vpmTimer.PulseSw(38):End Sub
Sub sw41_Hit:vpmTimer.PulseSw(41):End Sub
Sub sw42_Hit:vpmTimer.PulseSw(42):End Sub
Sub sw43_Hit:vpmTimer.PulseSw(43):End Sub
Sub sw44_Hit:vpmTimer.PulseSw(44):End Sub
Sub sw45_Hit:vpmTimer.PulseSw(45):End Sub
Sub sw46_Hit:vpmTimer.PulseSw(46):End Sub
Sub sw49_Hit:vpmTimer.PulseSw(49):End Sub
Sub sw50_Hit:vpmTimer.PulseSw(50):End Sub
Sub sw51_Hit:vpmTimer.PulseSw(51):End Sub
Sub sw52_Hit:vpmTimer.PulseSw(52):End Sub
Sub sw53_Hit:vpmTimer.PulseSw(53):End Sub
Sub sw54_Hit:vpmTimer.PulseSw(54):End Sub
' Wire Triggers
Sub sw16_Hit:Controller.Switch(16) = 1 : playsound"rollover" : End Sub
Sub sw16_Unhit:Controller.Switch(16) = 0:End Sub
Sub sw59_Hit:Controller.Switch(59) = 1 : playsound"rollover" : End Sub
Sub sw59_UnHit:Controller.Switch(59) = 0:End Sub
Sub sw60_Hit:Controller.Switch(60) = 1 : playsound"rollover" : End Sub
Sub sw60_UnHit:Controller.Switch(60) = 0:End Sub
Sub sw61_Hit:Controller.Switch(61) = 1 : playsound"rollover" : End Sub
Sub sw61_UnHit:Controller.Switch(61) = 0:End Sub
Sub sw62_Hit:Controller.Switch(62) = 1 : playsound"rollover" : End Sub
Sub sw62_UnHit:Controller.Switch(62) = 0:End Sub
'Ramp Triggers
Sub sw20_Hit:Controller.Switch(20) = 1 : playsound"fx_metalrolling" : End Sub
Sub sw20_Unhit:Controller.Switch(20) = 0:End Sub
Sub sw30_Hit:Controller.Switch(30) = 1 : playsound"fx_metalrolling" : End Sub
Sub sw30_Unhit:Controller.Switch(30) = 0:End Sub
Sub sw31_Hit:Controller.Switch(31) = 1 : playsound"fx_rrenter" : End Sub
Sub sw31_Unhit:Controller.Switch(31) = 0:End Sub
Sub sw32_Hit:Controller.Switch(32) = 1 : playsound"fx_rrenter" : End Sub
Sub sw32_Unhit:Controller.Switch(32) = 0:End Sub
Sub Trigger1_hit: playsound"fx_rr5" : End Sub
Sub Trigger2_hit: playsound"fx_rr6" : End Sub
Sub Trigger3_hit: playsound"fx_rr7" : End Sub
Sub Trigger4_hit: playsound"fx_rr5" : End Sub
'Gate Triggers
Sub sw47_Hit:vpmTimer.PulseSw(47):End Sub
Sub sw56_Hit:vpmTimer.PulseSw(56):End Sub
'Spinners
Sub sw48_Spin:vpmTimer.PulseSw 48 : playsound"fx_spinner" : End Sub
'***************************************************
' JP's VP10 Fading Lamps & Flashers
' Based on PD's Fading Light System
' SetLamp 0 is Off
' SetLamp 1 is On
' fading for non opacity objects is 4 steps
'***************************************************
Dim LampState(200), FadingLevel(200)
Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
InitLamps() ' turn off the lights and flashers and reset them to the default parameters
LampTimer.Interval = 5 'lamp fading speed
LampTimer.Enabled = 1
' Lamp & Flasher Timers
Sub LampTimer_Timer()
Dim chgLamp, num, chg, ii
chgLamp = Controller.ChangedLamps
If Not IsEmpty(chgLamp) Then
For ii = 0 To UBound(chgLamp)
LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
Next
End If
UpdateLamps
End Sub
Sub UpdateLamps
NFadeL 1, l1
NFadeL 2, l2
NFadeL 3, l3
NFadeL 4, l4
NFadeL 5, l5
NFadeL 6, l6
NFadeL 7, l7
NFadeL 8, l8
NFadeL 9, l9
NFadeL 10, l10
NFadeL 11, l11
NFadeL 12, l12
NFadeL 13, l13
NFadeL 14, l14
NFadeL 15, l15
NFadeL 16, l16
NFadeL 17, l17
NFadeL 18, l18
NFadeL 19, l19
NFadeL 20, l20
NFadeL 21, l21
NFadeL 22, l22
NFadeL 23, l23
NFadeLm 24, l24a
NFadeL 24, l24
NFadeL 25, l25
NFadeL 26, l26
NFadeL 27, l27
NFadeL 28, l28
NFadeL 29, l29
NFadeL 30, l30
NFadeL 31, l31
NFadeL 32, l32
NFadeL 33, l33
NFadeL 34, l34
NFadeL 35, l35
NFadeL 36, l36
NFadeL 37, l37
NFadeL 38, l38
NFadeLm 39, l39a
NFadeL 39, l39
NFadeL 40, l40
NFadeL 41, l41
NFadeL 42, l42
NFadeL 43, l43
NFadeL 44, l44
NFadeL 45, l45
NFadeL 46, l46
NFadeL 47, l47
NFadeL 48, l48
NFadeL 49, l49
NFadeL 50, l50
NFadeL 51, l51
NFadeL 52, l52
NFadeL 53, l53
NFadeL 54, l54
NFadeL 55, l55
NFadeL 56, l56
NFadeLm 57, l57a 'Left Ramp LEDs
NFadeObj 57, l57, "bulbcover1_redOn", "bulbcover1_red"
NFadeLm 58, l58a 'Left Ramp LEDs
NFadeObj 58, l58, "bulbcover1_redOn", "bulbcover1_red"
NFadeLm 59, l59a 'Left Ramp LEDs
NFadeObj 59, l59, "bulbcover1_redOn", "bulbcover1_red"
NFadeLm 60, l60a 'Left Ramp LEDs
NFadeObj 60, l60, "bulbcover1_blueOn", "bulbcover1_blue"
NFadeLm 61, l61a 'Left Ramp LEDs
NFadeObj 61, l61, "bulbcover1_blueOn", "bulbcover1_blue"
NFadeLm 62, l62a 'Left Ramp LEDs
NFadeObj 62, l62, "bulbcover1_blueOn", "bulbcover1_blue"
NFadeL 63, l63
NFadeL 64, l64
'Solenoid Controlled lamps
NFadeLm 109, f109
NFadeLm 109, f109a
NFadeLm 115, f115
NFadeLm 115, f115a
NFadeLm 125, f125a
NFadeLm 125, f125b
NFadeLm 125, f125 'Backwall
NFadeLm 126, f126a
NFadeL 126, f126 'Backwall
NFadeLm 127, f127a
NFadeL 127, f127 'Backwall
NFadeLm 128, f128a
NFadeLm 128, f128b
NFadeL 128, f128 'Backwall
NFadeLm 129, f129a
NFadeLm 129, f129b
NFadeL 129, f129 'Backwall
NFadeLm 130, f130a
NFadeLm 130, f130b
NFadeL 130, f130 'Backwall
NFadeLm 131, f131
NFadeLm 131, f131a
NFadeLm 131, f131b
NFadeLm 131, f131c
NFadeLm 132, f132
NFadeLm 132, f132b
End Sub
' div lamp subs
Sub InitLamps()
Dim x
For x = 0 to 200
LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
FadingLevel(x) = 4 ' used to track the fading state
FlashSpeedUp(x) = 0.4 ' faster speed when turning on the flasher
FlashSpeedDown(x) = 0.2 ' slower speed when turning off the flasher
FlashMax(x) = 1 ' the maximum value when on, usually 1
FlashMin(x) = 0 ' the minimum value when off, usually 0
FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
Next
End Sub
Sub AllLampsOff
Dim x
For x = 0 to 200
SetLamp x, 0
Next
End Sub
Sub SetLamp(nr, value)
If value <> LampState(nr) Then
LampState(nr) = abs(value)
FadingLevel(nr) = abs(value) + 4
End If
End Sub
' Lights: used for VP10 standard lights, the fading is handled by VP itself
Sub NFadeL(nr, object)
Select Case FadingLevel(nr)
Case 4:object.state = 0:FadingLevel(nr) = 0
Case 5:object.state = 1:FadingLevel(nr) = 1
End Select
End Sub
Sub NFadeLm(nr, object) ' used for multiple lights
Select Case FadingLevel(nr)
Case 4:object.state = 0
Case 5:object.state = 1
End Select
End Sub
'Lights, Ramps & Primitives used as 4 step fading lights
'a,b,c,d are the images used from on to off
Sub FadeObj(nr, object, a, b, c, d)
Select Case FadingLevel(nr)
Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
Case 5:object.image = a:FadingLevel(nr) = 1 'ON
Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
Case 13:object.image = d:FadingLevel(nr) = 0 'Off
End Select
End Sub
Sub FadeObjm(nr, object, a, b, c, d)
Select Case FadingLevel(nr)
Case 4:object.image = b
Case 5:object.image = a
Case 9:object.image = c
Case 13:object.image = d
End Select
End Sub
Sub NFadeObj(nr, object, a, b)
Select Case FadingLevel(nr)
Case 4:object.image = b:FadingLevel(nr) = 0 'off
Case 5:object.image = a:FadingLevel(nr) = 1 'on
End Select
End Sub
Sub NFadeObjm(nr, object, a, b)
Select Case FadingLevel(nr)
Case 4:object.image = b
Case 5:object.image = a
End Select
End Sub
' Flasher objects
Sub Flash(nr, object)
Select Case FadingLevel(nr)
Case 4 'off
FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
If FlashLevel(nr) < FlashMin(nr) Then
FlashLevel(nr) = FlashMin(nr)
FadingLevel(nr) = 0 'completely off
End if
Object.IntensityScale = FlashLevel(nr)
Case 5 ' on
FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
If FlashLevel(nr) > FlashMax(nr) Then
FlashLevel(nr) = FlashMax(nr)
FadingLevel(nr) = 1 'completely on
End if
Object.IntensityScale = FlashLevel(nr)
End Select
End Sub
Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
Object.IntensityScale = FlashLevel(nr)
End Sub
'**********************************************************************************************************
'Digital Display
'**********************************************************************************************************
Dim Digits(28)
Digits(0)=Array(a00, a05, a0c, a0d, a08, a01, a06, a0f, a02, a03, a04, a07, a0b, a0a, a09, a0e)
Digits(1)=Array(a10, a15, a1c, a1d, a18, a11, a16, a1f, a12, a13, a14, a17, a1b, a1a, a19, a1e)
Digits(2)=Array(a20, a25, a2c, a2d, a28, a21, a26, a2f, a22, a23, a24, a27, a2b, a2a, a29, a2e)
Digits(3)=Array(a30, a35, a3c, a3d, a38, a31, a36, a3f, a32, a33, a34, a37, a3b, a3a, a39, a3e)
Digits(4)=Array(a40, a45, a4c, a4d, a48, a41, a46, a4f, a42, a43, a44, a47, a4b, a4a, a49, a4e)
Digits(5)=Array(a50, a55, a5c, a5d, a58, a51, a56, a5f, a52, a53, a54, a57, a5b, a5a, a59, a5e)
Digits(6)=Array(a60, a65, a6c, a6d, a68, a61, a66, a6f, a62, a63, a64, a67, a6b, a6a, a69, a6e)
Digits(7)=Array(a70, a75, a7c, a7d, a78, a71, a76, a7f, a72, a73, a74, a77, a7b, a7a, a79, a7e)
Digits(8)=Array(a80, a85, a8c, a8d, a88, a81, a86, a8f, a82, a83, a84, a87, a8b, a8a, a89, a8e)
Digits(9)=Array(a90, a95, a9c, a9d, a98, a91, a96, a9f, a92, a93, a94, a97, a9b, a9a, a99, a9e)
Digits(10)=Array(aa0, aa5, aac, aad, aa8, aa1, aa6, aaf, aa2, aa3, aa4, aa7, aab, aaa, aa9, aae)
Digits(11)=Array(ab0, ab5, abc, abd, ab8, ab1, ab6, abf, ab2, ab3, ab4, ab7, abb, aba, ab9, abe)
Digits(12)=Array(ac0, ac5, acc, acd, ac8, ac1, ac6, acf, ac2, ac3, ac4, ac7, acb, aca, ac9, ace)
Digits(13)=Array(ad0, ad5, adc, add, ad8, ad1, ad6, adf, ad2, ad3, ad4, ad7, adb, ada, ad9, ade)
' 3rd Player
Digits(14) = Array(LED150,LED151,LED152,LED153,LED154,LED155,LED156)
Digits(15) = Array(LED160,LED161,LED162,LED163,LED164,LED165,LED166)
Digits(16) = Array(LED170,LED171,LED172,LED173,LED174,LED175,LED176)
Digits(17) = Array(LED180,LED181,LED182,LED183,LED184,LED185,LED186)
Digits(18) = Array(LED190,LED191,LED192,LED193,LED194,LED195,LED196)
Digits(19) = Array(LED200,LED201,LED202,LED203,LED204,LED205,LED206)
Digits(20) = Array(LED210,LED211,LED212,LED213,LED214,LED215,LED216)
' 4th Player
Digits(21) = Array(LED220,LED221,LED222,LED223,LED224,LED225,LED226)
Digits(22) = Array(LED230,LED231,LED232,LED233,LED234,LED235,LED236)
Digits(23) = Array(LED240,LED241,LED242,LED243,LED244,LED245,LED246)
Digits(24) = Array(LED250,LED251,LED252,LED253,LED254,LED255,LED256)
Digits(25) = Array(LED260,LED261,LED262,LED263,LED264,LED265,LED266)
Digits(26) = Array(LED270,LED271,LED272,LED273,LED274,LED275,LED276)
Digits(27) = Array(LED280,LED281,LED282,LED283,LED284,LED285,LED286)
Sub DisplayTimer_Timer
Dim ChgLED, ii, jj, num, chg, stat, obj, b, x
ChgLED=Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
If Not IsEmpty(ChgLED)Then
If DesktopMode = True Then
For ii=0 To UBound(chgLED)
num=chgLED(ii, 0) : chg=chgLED(ii, 1) : stat=chgLED(ii, 2)
if (num < 28) then
For Each obj In Digits(num)
If chg And 1 Then obj.State=stat And 1
chg=chg\2 : stat=stat\2
Next
Else
end if
Next
end if
End If
End Sub