forked from LegendsUnchained/vpx-standalone-alp4k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComet (Williams 1985) w VR Room v2.3.vbs
4134 lines (3388 loc) · 138 KB
/
Comet (Williams 1985) w VR Room v2.3.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
' Comet / IPD No. 548 / June, 1985 / 4 Players
' Original table done by Bord
' VR Room Mods, implementation of Fleep sounds, dynamic shadows, and other features for Version 2.0 by UnclePaulie
' Testing and feedback provided by Rawd, PinStratsDan, Rothbauerw, Bord, Apophis, Sixtoe, Fluffhead, Wylte, Remdwaas, and RIK
'******** Revisions done on VR version 1.0 by UnclePaulie *********
' - Added all the VR Cab primatives (Used from Defender VR and Space Shuttle VR, as similar Williams Table); adjusted as appropriate
' - Matched cabinet colors for flipper buttons (normally black, but also over a metal side rail, so made them red)
' - Score alphanumeric displays and code Used from Fathom VR Table and rearranged
' - Backglass Image from Hauntfreak's B2S file... Note: ONLY the image. The rest of display done in code.
' - Added plunger primary and code for movement
' - Added two different VR room environments
' - Moved ball shadows back under the apron, as you could see them in VR
' - Added GI to backglass
' - Ramp 15 and 16 removed
' - Rotated the 10 lane triggers 180 degrees, lowered the suface height by 8, and changed the width to 0.75; except for sw46
' - Moved the lane triggers forward to align with plywood holes
' - Rotated the million triggers to 190 to align with plywood hole insets better. Also moved sw26 foreward a little to align.
' - SW46 moved down a bit, made visible, and changed wire thickness to 0.1
' - Changed playfeild shadow layers to z height of .03 to avoide a z fighting issue.
' - Added an apron Wall
' - Moved the plunger back a little, so ball sits right before launch. Also increased mechanical strength to 1.2
' - Changed the ball image and added jp_scratches for decal to enhance the ball rolling realism
' - Increased light intensity from 14 to 100 for the four down lanes (1986)... they were a little hard to see through back ramp.
' - Increased the z height of the plastics_prim to 4 (from 0). The white peg holders and screws were too high, and needed to move a little.
' - Sixtoe made one mod to the bumper material to be plastic with image opacity. Made the bumpers look more realistic
' v1.1: Added the interactive backglass (game over, tilt, ball in play, etc.). Primary and several flashers were added GI was added for backglass light flashers
'******** Revisions done by UnclePaulie on Hybrid version 0.1 - 2.0 *********
' v0.1: Enabled desktop, VR, and cabinet modes
' Added LUT options with save option (all modes)
' Added lighter ball images provided by hauntfreaks and g5k ball scratches, changeable in script
' Added an optional VR Clock,
' Animated the plunger, flippers, and start button for VR mode
' Glass and scratches options added for VR mode (Rawd solution). Not used for cab or desktop
' Added new image for desktop mode backglass.
' Updated VR backglass to have dynamic off color for LED displays
' v0.2: Added interactive flashers to backglass for VR
' v0.3: Enabled show mesh on the lights on layer 6. This looks better in VR.
' Added plywood holes under sling1 and 2. Changed sling1 and 2 to better primitives. More realistic, and hang below playfield.
' Changed flipper buttons to yellow, like real table.
' v0.4: Added Fleep Sounds (part implemented), nFozzy / Roth physics and flippers.
' Added VPW Dynamic Ball Shadows to the solution done Iakki, Apophis, and Wylte
' Increased the visibility of the dynamic ball shadows.
' Bord provided updated flippers, plunger, and playfield friction
' v0.5: Fleep Sounds finished with Bord's physics primitives
' v0.6: Replaced drop target to the solution done by Rothbauerw, also enabled drop target shadows.
' Updated ramprolling sounds by fluffhead35 as well as ballroll and ramproll amplication sounds
' Made the plastics collidable to prevent a bounced ball from going in. (not sure if needed, but just in case large ball bounce.)
' v0.7 bord - bumped flipper strength slightly, added Roth's flipper dampening script (replaces Rubberizer)
' v0.8 Added a wall near the drop target and standup target. Wylte found a corner condition that if the ball slow rolls near target after drop is dropped, it pops up through plastic, or could get stuck behind target.
' The wall still allows it to pop above the plastic, but doesn't fall behind, so play continues. Mostly a corner condition. Might add something more...
' v0.8a Changed the desktop text to EM Reels to prevent not seeing correctly on 4k monitors. Bord provided advice based off @scottacus prior solutions
' v0.9 Added wall 0.1 under playfield by flippers to prevent ball from dropping below playfield when ball hung on an end of flipper. (rothbauerw suggestion)
' Added Ramp shooter lane grooves and ball release wall to better emulate ball in shooter lane (rothbauerw suggestion)
' Adjusted the friction, elasticity, and falloff of the corcscrew ramp to just allow the ball to go through from a right flipper cradle. (should be hard, not impossible)
' also had to bump the flipper strength up slightly to get ball up corkscrew.
' Adjusted friction of plastic ramp slightly. Ball went a little too fast on it.
' v0.10 Added code to correct corner condition where ball can get stuck on corkscrew. (Rothbauerw provided code)
' Changed z height of metalrails_prim to 0.5. There was a slight z fighting issue with the playfield.
' Increased height of physical wall of plastic ramp by 25. Corner condition, one time ball jumped over the ramp when entered really fast.
' v0.11 Adjusted the height of the rubbers on posts slightly for better visual placement.
' Moved outerwalls_prim forward by one vp unit. Slight "Y" fighting visual issue on back wall.
' v0.12 Added an optional topper for VR. Thanks to JoePicasso for the image.
' Fixed issue with rabbit bonus being collected when coming out of million ramp (thanks Rothbauerw for fixing, and PinStratsDan for finding)
' v0.13 Added a difficutly setting for the left outlane post. IRL, it can be moved to help nudge the ball back into the playfield. (thanks to PinStratsDan for finding)
' v0.14 Added additional tweaks to the backglass in VR.
' v0.15 Removed collidable on window glass on layer 11.
' RIK found an issue with rabbit collection bonus not working. Corrected issue in sw24_UnHit and sw25_UnHit removing bsSaucer calls
' v0.16 Rawd mentioned that tilt sensitivity for keyboard nudging takes too many times to enable. Changed sensitivity to 1.
' Removed original gate3. Ball rolled out weird. (RIK, Wylte helped)
' Added a visible gate (you can see a gate IRL). Adjusted gate4 postion and size. This was essential to getting the ball to come out correctly.
' Changed friction of right ramp to 0.275. It slowed down too much going up. (RIK)
' Adjusted the saucer24 kickout angle, force, and variability. It wasn't coming out correctly, should come out to right flipper slowly
' v0.17 Changed the windowglass on layer 11 to a toy as it seemed it was still colliding with the million ramp shot.
' Lowered the elasticity of gate4 to .45. Better bounce and slightly more variable roll out of gate.
' v2.0 Official Release
' v2.1 Astronasty indicatd that there was a flipper nudge code update needed, as the ball would hover, or get atypical bounces or roll too far on flippers. It was recently done on Indy.
' v2.2 Rothbauerw suggested changing the height of the invisible playfield flipper wall to .01. It''ll avoid the slight nudge Astronasty reported
' v2.3 Herwah noticed the plunger trigger activated when the plunger pulled back, not when ball releasd. Trigger in wrong location. Moved back 10 vp units.
' Put the million ramp to friction of .285. Still could get corner condition of the ball to jump slightly over.
Option Explicit
Randomize
'*******************************************
' OPTIONS
'*******************************************
'----- Difficulty Options -----
const leftoutlanepost = 1 '0 = hard, 1 = normal (default). Just moves a post such that it will allow for nudging the ball back into playfield if hit just right. The real table allows for this setting.
'----- Desktop, VR, or Full Cabinet Options -----
const VR_Room = 0 ' 0 is desktop or cab mode, 1 is VR Room
const cab_mode = 1 ' 1 is set for cabinet mode to turn off the desktop version of the backglass score lights
const BallBrightness = 1 '0 = dark, 1 = brighter, 2 = brightest
' *** If using VR Room:
const CustomWalls = 0 'set to 0 for Modern Minimal Walls, floor, and roof, 1 for Sixtoe's original walls and floor
const WallClock = 0 '1 Shows the clock in the VR room only
Const Glass = 0 '0 = Off 1 = On - Glass visible in VR Room
Const Scratches = 0 '0 = Off 1 = On - Glass scratches visible in VR Room
const topper = 0 '0 = Off 1= On - Topper visible in VR Room only
'----- Shadow Options -----
Const DynamicBallShadowsOn = 0 '0 = no dynamic ball shadow ("triangles" near slings and such), 1 = enable dynamic ball shadow
Const AmbientBallShadowOn = 0 '0 = Static shadow under ball ("flasher" image, like JP's)
'1 = Moving ball shadow ("primitive" object, like ninuzzu's)
'2 = flasher image shadow, but it moves like ninuzzu's
Const fovY = 0 'Offset y position under ball to account for layback or inclination (more pronounced need further back)
Const DynamicBSFactor = 1 '0 to 1, higher is darker (default is 0.95)
Const AmbientBSFactor = 1 '0 to 1, higher is darker (default is 0.7)
Const AmbientMovement = 2 '1 to 4, higher means more movement as the ball moves left and right
Const Wideness = 20 'Sets how wide the dynamic ball shadows can get (20 +5 thinness should be most realistic for a 50 unit ball)
Const Thinness = 5 'Sets minimum as ball moves away from source
'----- General Sound Options -----
Const VolumeDial = 0.8 ' Recommended values should be no greater than 1.
'/////////////////////-----BallRoll Sound Amplification -----/////////////////////
Const BallRollAmpFactor = 1 ' 0 = no amplification, 1 = 2.5db amplification, 2 = 5db amplification, 3 = 7.5db amplification, 4 = 9db amplification (aka: Tie Fighter)
'-----RampRoll Sound Amplification -----/////////////////////
Const RampRollAmpFactor = 3 ' 0 = no amplification, 1 = 2.5db amplification, 2 = 5db amplification, 3 = 7.5db amplification, 4 = 9db amplification (aka: Tie Fighter)
'----- Phsyics Mods -----
Const RubberizerEnabled = 0 '0 = normal flip rubber, 1 = more lively rubber for flips, 2 = a different rubberizer
Const FlipperCoilRampupMode = 2 '0 = fast, 1 = medium, 2 = slow (tap passes should work)
Const TargetBouncerEnabled = 1 '0 = normal standup targets, 1 = bouncy targets, 2 = orig TargetBouncer
Const TargetBouncerFactor = 0.7 'Level of bounces. Recommmended value of 0.7 when TargetBouncerEnabled=1, and 1.1 when TargetBouncerEnabled=2
'*******************************************
' LUT setup and options
'*******************************************
Dim LUTset, DisableLUTSelector, LutToggleSound, LutToggleSoundLevel
LutToggleSound = True
LutToggleSoundLevel = .1
DisableLUTSelector = 0 ' Disables the ability to change LUT option with magna saves in game when set to 1
LoadLUT
'LUTset = 17 ' Override saved LUT for debug
SetLUT
ShowLUT_Init
'*******************************************
' Table Setup, Constants, and Global Variables
'*******************************************
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
Const cGameName="comet_l5"
Const UseSolenoids=2
Const UseLamps=0
Const UseGI=0
Const SSolenoidOn="SolOn"
Const SSolenoidOff="SolOff"
Const UsingROM = True
Const BallSize = 50
Const BallMass = 1
Const tnob = 2 ' total number of balls
Const lob = 0 'number of locked balls
Dim tablewidth: tablewidth = Table1.width
Dim tableheight: tableheight = Table1.height
Dim BIPL : BIPL = False 'Ball in plunger lane
LoadVPM "01560000", "S11.VBS", 3.26
'*******************************************
' Solenoid Call backs
'*******************************************
SolCallback(1) = "bsTrough.SolOut"
SolCallback(2) = "SolDT29" 'Drop Target
SolCallback(3) = "bsSaucer.SolOut"
SolCallback(4) = "Setlamp 104," 'Corkscrew Flash
SolCallback(5) = "Setlamp 105," 'Cycle Flash
SolCallback(6) = "bsCycleSaucer.SolOut"
SolCallback(7) = "Sol7" 'BG Left Fireworks
SolCallback(8) = "Sol8" 'BG Top Fireworks
SolCallback(9) = "Sol9" 'BG Bottom Fireworks
SolCallback(10) = "Sol10" 'BG Right Fireworks
SolCallback(13) = "Sol13" 'BG General Illumination lights
SolCallback(11) = "PFGI"
SolCallback(15) = "SolKnocker" 'Knocker
SolCallback(23) = "vpmNudge.SolGameOn"
SolCallback(sLRFlipper) = "SolRFlipper"
SolCallback(sLLFlipper) = "SolLFlipper"
'*******************************************
' Timers
'*******************************************
' The game timer interval is 10 ms
Sub GameTimer_Timer()
Cor.Update 'update ball tracking
RollingUpdate 'update rolling sounds
DoDTAnim 'handle drop target animations
UpdateGates
End Sub
' The frame timer interval is -1, so executes at the display frame rate
Sub FrameTimer_Timer()
FlipperVisualUpdate 'update flipper shadows and primitives
If DynamicBallShadowsOn Or AmbientBallShadowOn Then DynamicBSUpdate
End Sub
'*******************************************
' Flipper Shadow and Gate Subs
'*******************************************
' This subroutine updates the flipper shadows and visual primitives
Sub FlipperVisualUpdate
batleftshadow.RotZ = LeftFlipper.currentangle
batrightshadow.RotZ = RightFlipper.currentangle
lflip.rotz = LeftFlipper.currentangle
rflip.rotz = RightFlipper.currentangle
End Sub
Sub UpdateGates
rampgate_prim.RotX = GateSw50.CurrentAngle
rampexitgate_prim.RotX = Gatesw28.CurrentAngle+90
corkscrewgate_prim.RotX = GateSw19.CurrentAngle
plungegate_prim.RotX = Gate4.CurrentAngle + 90
End Sub
'*******************************************
' Playfield GI
'*******************************************
dim GIIsOff
Sub PFGI(Enabled)
Dim opacityoff, opacityon
opacityoff=100
opacityon=200
If Enabled Then
GiOFF
dim xx
PlaySound "fx_relay"
GIIsOff=true
Else
GiON
PlaySound "fx_relay"
GIIsOff=false
end if
End Sub
Sub GiON
Dim x
For each x in Gi:x.State = 1:Next
FLasher1.visible=1
Flasher3.visible=0
If dtup = 1 Then
Flasher5.visible=1 'lights are on, and droptarget is up then want shadow.
Else
Flasher5.visible=0 'droptarget is down. No shadow.
End If
End Sub
Sub GiOFF
Dim x
For each x in Gi:x.State = 0:Next
FLasher1.visible=0
Flasher3.visible=1
Flasher5.visible=0
End Sub
'*******************************************
' Initiate Table
'*******************************************
Dim bsTrough, bsSaucer, bsCycleSaucer
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 = "Comet"&chr(13)&"Williams 1985"
.HandleMechanics=0
.HandleKeyboard=0
.ShowDMDOnly=1
.ShowFrame=0
.ShowTitle=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=1
vpmNudge.Sensitivity=.1
vpmNudge.TiltObj=Array(Bumper1,Bumper2,Bumper3,LeftSlingshot,RightSlingshot)
Set bsTrough = New cvpmBallStack
bsTrough.InitSw 0,45,0,0,0,0,0,0
bsTrough.InitKick BallRelease, 90, 8
bsTrough.Balls = 1
Set bsSaucer = New cvpmBallStack
bsSaucer.InitSaucer sw24,24, 190, 8
bsSaucer.KickForceVar = 0.5
bsSaucer.KickAngleVar = 0.5
Set bsCycleSaucer = New cvpmBallStack
bsCycleSaucer.InitSaucer sw25,25, 260, 8
bsCycleSaucer.KickForceVar = 2
bsCycleSaucer.KickAngleVar = 2
if VR_Room = 1 Then
setup_backglass()
SetBackglass
End If
PinCab_Backglass.blenddisablelighting = .8
End Sub
Sub table1_exit
SaveLUT
Controller.stop
End Sub
'*******************************************
' VR Plunger Code
'*******************************************
Sub TimerVRPlunger_Timer
If PinCab_Shooter.Y < -280 then
PinCab_Shooter.Y = PinCab_Shooter.Y + 5
End If
End Sub
Sub TimerVRPlunger1_Timer
PinCab_Shooter.Y = -373 + (5* Plunger.Position) -20
End Sub
'*******************************************
' Table Keys
'*******************************************
Sub Table1_KeyDown(ByVal KeyCode)
If keycode = LeftFlipperKey Then
VRFlipperButtonLeft.X = 2105.087 + 10
FlipperActivate LeftFlipper, LFPress
SolLFlipper True
End If
If keycode = RightFlipperKey Then
VRFlipperButtonRight.X = 2112.018 - 10
FlipperActivate RightFlipper, RFPress
SolRFlipper True
End If
If KeyCode = PlungerKey Then
Plunger.PullBack
Plunger.Pullback:SoundPlungerPull()
TimerVRPlunger.Enabled = True
TimerVRPlunger1.Enabled = False
PinCab_Shooter.Y = -373
End If
If keycode = LeftTiltKey Then Nudge 90, 5 : SoundNudgeLeft
If keycode = RightTiltKey Then Nudge 270, 5 : SoundNudgeRight
If keycode = CenterTiltKey Then Nudge 0, 3 : SoundNudgeCenter
If keycode = RightMagnaSave Then 'AXS 'Fleep
if DisableLUTSelector = 0 then
If LutToggleSound Then
Playsound "click", 0, LutToggleSoundLevel * VolumeDial, 0, 0.2, 0, 0, 0, 1
End If
LUTSet = LUTSet + 1
if LutSet > 17 then LUTSet = 0
SetLUT
ShowLUT
end if
end if
If keycode = LeftMagnaSave Then
if DisableLUTSelector = 0 then
If LutToggleSound Then
Playsound "click", 0, LutToggleSoundLevel * VolumeDial, 0, 0.2, 0, 0, 0, 1
End If
LUTSet = LUTSet - 1
if LutSet < 0 then LUTSet = 17
SetLUT
ShowLUT
end if
end if
If keycode = StartGameKey Then
StartButton.y = 787.454 - 5
SoundStartButton
End If
'If keycode = keyInsertCoin1 or keycode = keyInsertCoin2 or keycode = keyInsertCoin3 or keycode = keyInsertCoin4 Then 'Use this for ROM based games
If keycode = AddCreditKey or keycode = AddCreditKey2 Then
Select Case Int(rnd*3)
Case 0: PlaySound ("Coin_In_1"), 0, CoinSoundLevel, 0, 0.25
Case 1: PlaySound ("Coin_In_2"), 0, CoinSoundLevel, 0, 0.25
Case 2: PlaySound ("Coin_In_3"), 0, CoinSoundLevel, 0, 0.25
End Select
End If
If vpmKeyDown(keycode) Then Exit Sub
End Sub
Sub Table1_KeyUp(ByVal KeyCode)
If keycode = PlungerKey Then
Plunger.Fire
If BIPL = 1 Then
SoundPlungerReleaseBall() 'Plunger release sound when there is a ball in shooter lane
Else
SoundPlungerReleaseNoBall() 'Plunger release sound when there is no ball in shooter lane
End If
TimerVRPlunger.Enabled = False
TimerVRPlunger1.Enabled = True
PinCab_Shooter.Y = -373
End If
If keycode = LeftFlipperKey Then
FlipperDeActivate LeftFlipper, LFPress
SolLFlipper False
VRFlipperButtonLeft.X = 2105.087
End If
If keycode = RightFlipperKey Then
VRFlipperButtonRight.X = 2112.018
FlipperDeActivate RightFlipper, RFPress
SolRFlipper False
End If
If keycode = StartGameKey Then
StartButton.y = 787.454
End If
if vpmKeyUp(keycode) Then Exit Sub
End Sub
'*******************************************
' Flippers
'*******************************************
Const ReflipAngle = 20
' Flipper Solenoid Callbacks (these subs mimics how you would handle flippers in ROM based tables)
Sub SolLFlipper(Enabled)
If Enabled Then
LF.Fire 'leftflipper.rotatetoend
If leftflipper.currentangle < leftflipper.endangle + ReflipAngle Then
RandomSoundReflipUpLeft LeftFlipper
Else
SoundFlipperUpAttackLeft LeftFlipper
RandomSoundFlipperUpLeft LeftFlipper
End If
Else
LeftFlipper.RotateToStart
If LeftFlipper.currentangle < LeftFlipper.startAngle - 5 Then
RandomSoundFlipperDownLeft LeftFlipper
End If
FlipperLeftHitParm = FlipperUpSoundLevel
End If
End Sub
Sub SolRFlipper(Enabled)
If Enabled Then
RF.Fire 'rightflipper.rotatetoend
If rightflipper.currentangle > rightflipper.endangle - ReflipAngle Then
RandomSoundReflipUpRight RightFlipper
Else
SoundFlipperUpAttackRight RightFlipper
RandomSoundFlipperUpRight RightFlipper
End If
Else
RightFlipper.RotateToStart
If RightFlipper.currentangle > RightFlipper.startAngle + 5 Then
RandomSoundFlipperDownRight RightFlipper
End If
FlipperRightHitParm = FlipperUpSoundLevel
End If
End Sub
' Flipper collide subs
Sub LeftFlipper_Collide(parm)
CheckLiveCatch Activeball, LeftFlipper, LFCount, parm
LeftFlipperCollide parm
if RubberizerEnabled = 1 then Rubberizer(parm)
if RubberizerEnabled = 2 then Rubberizer2(parm)
End Sub
Sub RightFlipper_Collide(parm)
CheckLiveCatch Activeball, RightFlipper, RFCount, parm
RightFlipperCollide parm
if RubberizerEnabled = 1 then Rubberizer(parm)
if RubberizerEnabled = 2 then Rubberizer2(parm)
End Sub
'*******************************************
' Slings
'*******************************************
Dim RStep, Lstep ' Rstep and Lstep are the variables that increment the animation
Sub RightSlingShot_Slingshot
vpmTimer.PulseSw 48
RandomSoundSlingshotRight SLING2
RSling.Visible = 0
RSling1.Visible = 1
sling1.RotX = 26
RStep = 0
RightSlingShot.TimerEnabled = 1
End Sub
Sub RightSlingShot_Timer
Select Case RStep
Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.RotX = 14
Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.RotX = -20:RightSlingShot.TimerEnabled = 0:
End Select
RStep = RStep + 1
End Sub
Sub LeftSlingShot_Slingshot
vpmTimer.PulseSw 47
RandomSoundSlingshotLeft SLING2
LSling.Visible = 0
LSling1.Visible = 1
sling2.RotX = 26
LStep = 0
LeftSlingShot.TimerEnabled = 1
End Sub
Sub LeftSlingShot_Timer
Select Case LStep
Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.RotX = 14
Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.RotX = -20:LeftSlingShot.TimerEnabled = 0:
End Select
LStep = LStep + 1
End Sub
'*******************************************
' Rubbers, sound is done in the collection
'*******************************************
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 sw39_Hit:vpmTimer.PulseSw 39:End Sub
'*******************************************
' Bumpers
'*******************************************
Sub Bumper1_Hit
vpmTimer.PulseSw 40
RandomSoundBumperTop Bumper1
End Sub
Sub Bumper2_Hit
vpmTimer.PulseSw 41
RandomSoundBumperMiddle Bumper2
End Sub
Sub Bumper3_Hit
vpmTimer.PulseSw 42
RandomSoundBumperBottom Bumper3
End Sub
'*******************************************
' Kickers, Saucers
'*******************************************
Sub Drain_Hit
bsTrough.addball me
RandomSoundDrain Drain
End Sub
Sub sw24_Hit
bsSaucer.AddBall 0
SoundSaucerLock
End Sub
Sub sw24_UnHit
SoundSaucerKick 1, sw24
End Sub
Sub sw25_Hit
bsCycleSaucer.AddBall 0
SoundSaucerLock
End Sub
Sub sw25_UnHit
SoundSaucerKick 1, sw25
End Sub
Sub Ballrelease_UnHit
RandomSoundBallRelease Ballrelease
End Sub
'*******************************************
'Rollovers
'*******************************************
Sub sw9_Hit:Controller.Switch(9) = 1:End Sub
Sub sw9_UnHit:Controller.Switch(9) = 0:End Sub
Sub sw20_Hit:Controller.Switch(20) = 1:End Sub
Sub sw20_UnHit:Controller.Switch(20) = 0:End Sub
Sub sw21_Hit:Controller.Switch(21) = 1:End Sub
Sub sw21_UnHit:Controller.Switch(21) = 0:End Sub
Sub sw22_Hit:Controller.Switch(22) = 1:End Sub
Sub sw22_UnHit:Controller.Switch(22) = 0:End Sub
Sub sw23_Hit:Controller.Switch(23) = 1:End Sub
Sub sw23_UnHit:Controller.Switch(23) = 0:End Sub
Sub sw26_Hit:Controller.Switch(26) = 1:End Sub
Sub sw26_UnHit:Controller.Switch(26) = 0:End Sub
Sub sw27_Hit:Controller.Switch(27) = 1:End Sub
Sub sw27_UnHit:Controller.Switch(27) = 0:End Sub
Sub sw31_Hit:Controller.Switch(31) = 1:End Sub
Sub sw31_UnHit:Controller.Switch(31) = 0:End Sub
Sub sw32_Hit:Controller.Switch(32) = 1:End Sub
Sub sw32_UnHit:Controller.Switch(32) = 0:End Sub
Sub sw43_Hit:Controller.Switch(43) = 1:End Sub
Sub sw43_UnHit:Controller.Switch(43) = 0:End Sub
Sub sw44_Hit:Controller.Switch(44) = 1:End Sub
Sub sw44_UnHit:Controller.Switch(44) = 0:End Sub
Sub sw46_Hit:Controller.Switch(46) = 1:End Sub
Sub sw46_UnHit:Controller.Switch(46) = 0:End Sub
'*******************************************
'Drop Targets
'*******************************************
dim dtup ' variable used for drop shadows
Sub sw29_Hit
DTHit 29
TargetBouncer Activeball, 1
dtup=0
Flasher5.visible=0
End Sub
' Drop Target 29 Solenoid
Sub SolDT29(enabled)
If enabled Then
PlaySoundAt SoundFX(DTResetSound,DOFContactors), sw29p
DTRaise 29
dtup=1
Flasher5.visible=1
End If
End Sub
'********************************************
'Standup Targets
'********************************************
Sub sw10_Hit
vpmTimer.PulseSw 10
TargetBouncer Activeball, 1
End Sub
Sub sw11_Hit
vpmTimer.PulseSw 11
TargetBouncer Activeball, 1
End Sub
Sub sw12_Hit
vpmTimer.PulseSw 12
TargetBouncer Activeball, 1
End Sub
Sub sw13_Hit
vpmTimer.PulseSw 13
TargetBouncer Activeball, 1
End Sub
Sub sw14_Hit
vpmTimer.PulseSw 14
TargetBouncer Activeball, 1
End Sub
Sub sw15_Hit
vpmTimer.PulseSw 15
TargetBouncer Activeball, 1
End Sub
Sub sw16_Hit
vpmTimer.PulseSw 16
TargetBouncer Activeball, 1
End Sub
Sub sw17_Hit
vpmTimer.PulseSw 17
TargetBouncer Activeball, 1
End Sub
Sub sw18_Hit
vpmTimer.PulseSw 18
TargetBouncer Activeball, 1
End Sub
'*******************************************
' Ramp Triggers
'*******************************************
Sub sw19_Hit
vpmTimer.PulseSw 19
WireRampOn True 'Play Plastic Ramp Sound
End Sub
Sub sw28_Hit
vpmTimer.PulseSw 28
WireRampOff ' Turn off the Plastic Ramp Sound
End Sub
Sub sw52_Hit
PlaySoundAt "WireRamp_Stop", sw52
End Sub
Sub sw50_Hit
vpmTimer.PulseSw 50
WireRampOn True 'Play Plastic Ramp Sound
End Sub
Sub sw51_Hit
WireRampOn True 'Play Plastic Ramp Sound
End Sub
'*******************************************
' Knocker
'*******************************************
Sub SolKnocker(Enabled)
If enabled Then
KnockerSolenoid
End If
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)
Dim ChangeBGLamps(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
ChangeBGLamps(chgLamp(ii, 0)) = chgLamp(ii, 1)
Next
End If
UpdateLamps
If VR_Room = 0 and cab_mode = 0 Then
UpdateLeds
End If
If VR_Room=1 Then
DisplayTimer
Update_BGFlashers
End If
End Sub
Sub Update_BGFlashers
' backdrop lights
NumLamp 1, f1bg 'game over
NumLamp 2, f2bg 'match
NumLamp 3, f3bg 'tilt
NumLamp 4, f4bg 'highscore
NumLamp 5, f5bg 'shoots again
NumLamp 6, f6bg 'ball in play
End Sub
Sub UpdateLamps
'FadeR 1, 'GameOver
'FadeR 2, 'Match
'FadeR 3, 'Tilt
'FadeR 4, 'HS
'FadeR 5, 'Ride Again 2x
'FadeR 6, 'BIP
'FadeR 7, 'Comet Eyes
'FadeR 8, 'Comet Eyes
NFadeLm 9, l9
NFadeLm 9, l9a
NFadeLm 9, l9z
NFadeLm 10, l10
NFadeLm 10, l10a
NFadeLm 10, l10z
NFadeLm 11, l11
NFadeLm 11, l11a
NFadeLm 11, l11z
NFadeLm 12, l12
NFadeLm 12, l12a
NFadeLm 12, l12z
NFadeLm 13, l13
NFadeLm 13, l13a
NFadeLm 13, l13z
NFadeLm 14, l14
NFadeLm 14, l14a
NFadeLm 14, l14z
NFadeLm 15, l15
NFadeLm 15, l15a
NFadeLm 15, l15z
NFadeLm 16, l16
NFadeLm 16, l16a
NFadeLm 16, l16z
NFadeLm 17, l17
NFadeLm 17, l17a
NFadeLm 17, l17z
NFadeLm 18, l18
NFadeLm 18, l18a
NFadeLm 18, l18z
NFadeLm 19, l19
NFadeLm 19, l19a
NFadeLm 19, l19z
NFadeLm 20, l20
NFadeLm 20, l20a
NFadeLm 20, l20z
Flash 20, f20
NFadeLm 21, l21
NFadeLm 21, l21a
NFadeLm 21, l21z
Flash 21, f21
NFadeLm 22, l22
NFadeLm 22, l22a
NFadeLm 22, l22z
Flash 22, f22
NFadeLm 23, l23
NFadeLm 23, l23a
NFadeLm 23, l23z
Flash 23, f23
NFadeLm 24, l24
NFadeLm 24, l24a
NFadeLm 24, l24z
NFadeLm 25, l25
NFadeLm 25, l25a
NFadeLm 25, l25z
NFadeLm 26, l26
NFadeLm 26, l26a
NFadeLm 26, l26z
NFadeLm 27, l27
NFadeLm 27, l27a
NFadeLm 27, l27z
NFadeLm 28, l28
NFadeLm 28, l28a
NFadeLm 28, l28z
NFadeLm 29, l29
NFadeLm 29, l29a
NFadeLm 29, l29z
NFadeLm 30, l30
NFadeLm 30, l30a
NFadeLm 30, l30z
NFadeLm 31, l31
NFadeLm 31, l31a
NFadeLm 31, l31z
NFadeLm 32, l32
NFadeLm 32, l32a
NFadeLm 32, l32z
NFadeLm 33, l33
NFadeLm 33, l33a
NFadeLm 33, l33z
NFadeLm 34, l34
NFadeLm 34, l34a
NFadeLm 34, l34z
NFadeLm 35, l35
NFadeLm 35, l35a
NFadeLm 35, l35z
NFadeLm 36, l36
NFadeLm 36, l36a
NFadeLm 36, l36z
NFadeLm 37, l37
NFadeLm 37, l37a
NFadeLm 37, l37z
NFadeLm 38, l38
NFadeLm 38, l38a
NFadeLm 38, l38z
NFadeLm 39, l39
NFadeLm 39, l39a
NFadeLm 39, l39z
NFadeLm 40, l40
NFadeLm 40, l40a
NFadeLm 40, l40z
NFadeLm 41, l41
NFadeLm 41, l41a
NFadeLm 41, l41z
NFadeLm 42, l42
NFadeLm 42, l42a
NFadeLm 42, l42z
NFadeLm 43, l43
NFadeLm 43, l43a
NFadeLm 43, l43z
NFadeLm 44, l44
NFadeLm 44, l44a
NFadeLm 44, l44z
NFadeLm 45, l45
NFadeLm 45, l45a
NFadeLm 45, l45z
NFadeLm 46, l46
NFadeLm 46, l46a
NFadeLm 46, l46z
NFadeLm 47, l47
NFadeLm 47, l47a
NFadeLm 47, l47z
NFadeLm 48, l48
NFadeLm 48, l48a
NFadeLm 48, l48z
NFadeLm 49, l49
NFadeLm 49, l49a
NFadeLm 49, l49z
NFadeLm 50, l50