-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathApollo 13 (Sega 1995) w VR Room v2.1.1.vbs
5348 lines (4447 loc) · 187 KB
/
Apollo 13 (Sega 1995) w VR Room v2.1.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
'==================================================================================================================================================='
' '
' APOLLO 13 '
' Sega Pinball (1995) '
' http://www.ipdb.org/machine.cgi?id=3592 '
' '
' Originally Created by ICPjuggla and Herweh vp9 '
' and later Balater vpx, and later UnclePaulie '
' Contributions Thalamus, JP's, DJRobX, Rothbauerw, Amgrim, 32assassin,ClarKent, Chucky87, agentEighty6 '
' Version 2.0 by UnclePaulie 2021-2023 '
' Table includes Hybrid VR/desktop/cabinet modes, VPW physics, Fleep sounds, Lampz, 3D inserts, new GI, sling corrections '
' targets, saucers, playfield mesh, etc. '
' Complete implementation details found at the bottom of the script. '
' 2.0 Contributors: retro27 - VR graphics updates, oqqsan - Flupper domes, moon corrections, Tomate - ramps, primitives, ' Skitso - GI '
' Sixtoe - some lighting and graphics tweaks, apophis - Lampz, 3D inserts, shadow updates, '
' Sheltemke - updated playfield / text overlay, Wylte - dynamic shadows '
' 2.1 UnclePaulie Updated scripts, GI, bugs, slingshot corrections, standup targets, changed to gBOT - no destroying balls, playfield mesh '
' Primitive lighting, Insert lighting and glow, physics walls to avoid ball bouncing onto apron and plastics. '
' Also physics updates, flipper updates, new bumpers, and lots of other updates.
'==================================================================================================================================================='
Option Explicit
Randomize
'*******************************************
' Desktop, Cab, and VR OPTIONS
'*******************************************
' Desktop, Cab, and VR Room are automatically selected. However if in VR Room mode, you can change the environment with the magna save buttons.
const BallLightness = 2 ' 0 = dark, 1 = not as dark, 2 = bright, 3 = medium, 4 = brightest (2 is default)
const GreenDMD = 1 ' 1 Shows a green DMD for Virtual DMD (desktop) and VR users. Only used with LUT 14
const bkgg=1 ' 1 GI Animation on Backglass
Dim LUTset, DisableLUTSelector, LutToggleSound, LutToggleSoundLevel, bLutActive
LutToggleSound = True
LutToggleSoundLevel = .1
DisableLUTSelector = 0 ' Disables the ability to change LUT option with magna saves in game when set to 1
' *** If using VR Room:
const WallClock = 1 '1 Shows the clock in the VR minimal rooms only
const CustomWalls = 0 '0 for Modern Minimal Walls, floor, and roof, 1 for Sixtoe's original walls and floor
const topper = 0 '0 = Off 1= On - Topper Picture visible in VR Room only (NOTE: this is only a simple picture, not the Fan: and disabled if VRFanON is selected)
const poster = 1 '1 Shows the flyer posters in the VR room only
const poster2 = 1 '1 Shows the flyer posters in the VR room only
' ****************************************************
'----- Shadow Options -----
Const DynamicBallShadowsOn = 1 '0 = no dynamic ball shadow ("triangles" near slings and such), 1 = enable dynamic ball shadow
Const AmbientBallShadowOn = 1 '0 = Static shadow under ball ("flasher" image, like JP's)
'1 = Moving ball shadow ("primitive" object, like ninuzzu's) - This is the only one that shows up on the pf when in ramps and fades when close to lights!
'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)
'Ambient (Room light source)
Const AmbientBSFactor = 1 '0 to 1, higher is darker
Const AmbientMovement = 2 '1 to 4, higher means more movement as the ball moves left and right
Const offsetX = 0 'Offset x position under ball (These are if you want to change where the "room" light is for calculating the shadow position,)
Const offsetY = 0 'Offset y position under ball (for example 5,5 if the light is in the back left corner)
'Dynamic (Table light sources)
Const DynamicBSFactor = 1 '0 to 1, higher is darker
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.
Const BallRollVolume = 0.5 'Level of ball rolling volume. Value between 0 and 1
Const RampRollVolume = 0.5 'Level of ramp rolling volume. Value between 0 and 1
'----- Phsyics Mods -----
Const FlipperCoilRampupMode = 0 '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
' ***********************************************************************************************
' OPTIONS END
' ***********************************************************************************************
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 UseVPMModSol = 1
'*******************************************
' Constants and Global Variables
'*******************************************
Dim UseVPMDMD, UseVPMColoredDMD, varhidden, VR_Room, cab_mode, DesktopMode: DesktopMode = Table1.ShowDT
Dim bgsko: bgsko=0
If RenderingMode = 2 Then VR_Room=1 Else VR_Room=0 'VRRoom set based on RenderingMode in version 10.72
If Not DesktopMode and VR_Room=0 Then cab_mode=1 Else cab_mode=0
Dim I, x, obj, drp, mmoon, lfd, rfd
DIM InitDMD_Color, InitDMD_Opacity
InitDMD_Color = DMD.color
InitDMD_Opacity = DMD.opacity
IF VR_Room = 0 Then
If Table1.ShowDT = True then
UseVPMColoredDMD = True
varhidden=1
Else
UseVPMColoredDMD = False
varhidden=0
End If
Else
UseVPMColoredDMD = False
UseVPMDMD = True
End If
Const UsingROM = True 'The UsingROM flag is to indicate code that requires ROM usage. Mostly for instructional purposes only.
Const BallSize = 50
Const BallMass = 1
Const tnob = 13 'Total number of balls
Const lob = 0 'Locked balls
Dim tablewidth: tablewidth = Table1.width
Dim tableheight: tableheight = Table1.height
Dim BIPL : BIPL = False 'Ball in plunger lane
Const cGameName="apollo13",UseLamps=0,UseGI=0 ',UseSolenoids=2 already in vbs file
LoadVPM "01560000", "SEGA2.VBS", 3.56
' ****************************************************
' LUT Loading
LoadLUT
'LUTset = 16 ' Override saved LUT for debug
SetLUT
ShowLUT_Init
'//////////////---- 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
'16 = Skitso New Warmer LUT, optimized for Apollo 13
'**********************************************************************************************************
'Solenoids
'**********************************************************************************************************
SolCallBack(1) = "SolBallRelease"
SolCallback(2) = "SolAPlunger"
SolCallback(3) = "SolRightEject"
SolCallback(4) = "SolTopEject"
SolCallback(5) = "SolRocketEject" 'Rocket Ball Eject
SolCallback(7) = "ShakeRocket"
SolCallback(8) = "SolKnocker"
SolCallback(14) = "SolTroughSuperVUKOut"' VUK under apron controlling rocket ball from subway to TroughVUKOut
SolCallback(15) = "SolLFlipperd" 'for DOF callout
SolCallback(16) = "SolRFlipperd" 'for DOF callout
SolCallback(sLRFlipper) = "SolRFlipper"
SolCallback(sLLFlipper) = "SolLFlipper"
SolCallback(17) = "SolTroughLock"
SolCallback(18) = "SolRampLift"
SolCallback(19) = "SolmoonLift"
SolCallback(20) = "SolRocketLift" ' Rocket motor relay
SolCallback(21) = "SolTrapDoor"
SolCallback(22) = "Sol8BLockPlunger"
SolCallback(23) = "SolDrainPost"
SolCallback(34) = "SolMoon"
' flasher
SolCallback(25) = "SolFLamp1"
SolCallback(26) = "SolFLamp2"
SolCallback(27) = "SolFLamp3"
SolCallback(28) = "SolFLamp4"
SolCallback(29) = "SolFLamp5"
SolCallback(30) = "SolFLamp6"
SolCallback(31) = "SolFLamp7"
SolCallback(32) = "SolFLamp8"
'flipper DOF callouts
Sub sollFlipperd(Enabled)
lfd=Enabled
End Sub
Sub solrFlipperd(Enabled)
rfd=Enabled
End Sub
'*******************************************
' Timers
'*******************************************
' The game timer interval is 10 ms
Sub GameTimer_Timer()
Cor.Update 'update ball tracking
RollingUpdate 'update rolling sounds
DoSTAnim 'handle stand up target animations
SpinnerTimer 'handle the spinner animation
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 'update ball shadows
UpdateBallBrightness 'GI for the ball
LampTimer 'used for Lampz. No need for separate timer.
End Sub
' This subroutine updates the flipper shadows and visual primitives
sub FlipperVisualUpdate
FlipperLSh.RotZ = LeftFlipper.currentangle
FlipperRSh.RotZ = RightFlipper.currentangle
LFLogo.RotY = LeftFlipper.CurrentAngle
RFlogo.RotY = RightFlipper.CurrentAngle
End Sub
'**********************************************************************************************************
'Initiate Table
'**********************************************************************************************************
Dim gBOT, A13Ball1, A13Ball2, A13Ball3, A13Ball4, A13Ball5, A13Ball6, A13Ball7, A13Ball8, A13Ball9, A13Ball10, A13Ball11, A13Ball12, A13Ball13
Sub Table1_Init
' Thalamus : Was missing 'vpminit me'
vpminit me
On Error Resume Next
With Controller
.GameName=cGameName
.SplashInfoLine = "Sega Apollo 13"&chr(13)&"by UnclePaulie"
If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
.HandleMechanics=0
.HandleKeyboard=0
.ShowDMDOnly=1
.ShowFrame=0
.ShowTitle=0
.Hidden=varhidden
.Games(cGameName).Settings.Value("rol") = 0
.Games(cGameName).Settings.Value("sound") = 1 ' Set sound (0=OFF, 1=ON)
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
End With
On Error Goto 0
If b2son Then bgsko = bkgg
'ignore all solenoids - then add the timer to renable all the solenoids after 2 seconds
Controller.SolMask(0)=0
vpmTimer.AddTimer 2000,"Controller.SolMask(0)=&Hffffffff'"
If Err Then MsgBox Err.Description
On Error Goto 0
' basic pinmame timer
PinMAMETimer.Interval = PinMAMEInterval
PinMAMETimer.Enabled = True
' nudging
vpmNudge.TiltSwitch = 1
vpmNudge.Sensitivity = 3
vpmNudge.TiltObj = Array(Bumper1,Bumper2,Bumper3,LeftSlingshot,RightSlingshot)
' upper trough kickers enabled
sw24b.enabled=1
sw23b.enabled=1
sw22b.enabled=1
sw21b.enabled=1
sw20b.enabled=1
sw19b.enabled=1
sw18b.enabled=1
sw17b.enabled=1
' preload 5 balls in trough
Set A13Ball1 = drain.CreateSizedballWithMass(BallSize/2,Ballmass)
Set A13Ball2 = sw11.CreateSizedballWithMass(BallSize/2,Ballmass)
Set A13Ball3 = sw12.CreateSizedballWithMass(BallSize/2,Ballmass)
Set A13Ball4 = sw13.CreateSizedballWithMass(BallSize/2,Ballmass)
Set A13Ball5 = sw14.CreateSizedballWithMass(BallSize/2,Ballmass)
' preload 8 balls in upper trough
Set A13Ball6 = sw24b.CreateSizedballWithMass(BallSize/2,Ballmass)
Set A13Ball7 = sw23b.CreateSizedballWithMass(BallSize/2,Ballmass)
Set A13Ball8 = sw22b.CreateSizedballWithMass(BallSize/2,Ballmass)
Set A13Ball9 = sw21b.CreateSizedballWithMass(BallSize/2,Ballmass)
Set A13Ball10 = sw20b.CreateSizedballWithMass(BallSize/2,Ballmass)
Set A13Ball11 = sw19b.CreateSizedballWithMass(BallSize/2,Ballmass)
Set A13Ball12 = sw18b.CreateSizedballWithMass(BallSize/2,Ballmass)
Set A13Ball13 = sw17b.CreateSizedballWithMass(BallSize/2,Ballmass)
gBOT = Array(A13Ball1, A13Ball2, A13Ball3, A13Ball4, A13Ball5, A13Ball6, A13Ball7, A13Ball8, A13Ball9, A13Ball10, A13Ball11, A13Ball12, A13Ball13)
Controller.Switch(10) = 1
Controller.Switch(11) = 1
Controller.Switch(12) = 1
Controller.Switch(13) = 1
Controller.Switch(14) = 1
Controller.Switch(15) = 0
Controller.Switch(16) = 0
' Preload 8 Balls on upper trough
Controller.Switch(17) = 1
Controller.Switch(18) = 1
Controller.Switch(19) = 1
Controller.Switch(20) = 1
Controller.Switch(21) = 1
Controller.Switch(22) = 1
Controller.Switch(23) = 1
Controller.Switch(24) = 1
' magnet
Set mmoon = New cvpmMagnet
With mmoon
.InitMagnet mMoonLock, 90
.GrabCenter = True
.MagnetOn = 0
.CreateEvents "mmoon"
End With
wall173.collidable=1
moonballstop.collidable=0
moonballstopb.collidable=0
mmoon.MagnetOn = 0
moonlock.Enabled=0
Ramp139.collidable=1
Ramp030.collidable=0
MultiBallPost.IsDropped = 0
Wallpost001.collidable=0
InitMoon
InitRocket
SetBackglass_Low
SetBackglass_Mid
SetBackglass_High
SetBackglass_BG
' initialize the attirbutes of the bumpers
initbumpers
End Sub
Sub table1_Paused:Controller.Pause = 1:End Sub
Sub table1_unPaused:Controller.Pause = 0:End Sub
Sub Table1_Exit()
SaveLUT
Controller.Stop
End Sub
'**********************************************************************************************************
' Keys and Plunger code
'**********************************************************************************************************
Sub Table1_KeyDown(ByVal keycode)
If keycode = LeftTiltKey Then Nudge 90, 1 : SoundNudgeLeft
If keycode = RightTiltKey Then Nudge 270, 1 : SoundNudgeRight
If keycode = CenterTiltKey Then Nudge 0, 1 : SoundNudgeCenter
if keycode=StartGameKey then soundStartButton()
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 keycode = PlungerKey Or keycode = LockBarKey Then Controller.Switch(9) = True
If keycode = LeftMagnaSave Then
bLutActive = True
end if
If keycode = RightMagnaSave Then
If bLutActive 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 > 16 then LUTSet = 0
SetLUT
ShowLUT
end if
end If
end if
' VR Animation of flipper buttons and launcher
If keycode = LeftFlipperKey Then
FlipperActivate LeftFlipper, LFPress
Primary_flipper_button_left.X = 2112 + 8
End If
If keycode = RightFlipperKey Then
FlipperActivate RightFlipper, RFPress
Primary_flipper_button_right.X = 2090.5 - 8
End If
If keycode = PlungerKey Or keycode = LockBarKey Then
Handle_Knob.RotZ = -90
End If
If KeyDownHandler(keycode) Then Exit Sub
End Sub
Sub Table1_KeyUp(ByVal keycode)
If keycode = PlungerKey Or keycode = LockBarKey Then Controller.Switch(9) = False
If keycode = LeftMagnaSave Then
bLutActive = False
End If
' VR Animation of flipper buttons and launcher
If keycode = LeftFlipperKey Then
FlipperDeActivate LeftFlipper, LFPress
Primary_flipper_button_left.X = 2112
End If
If keycode = RightFlipperKey Then
FlipperDeActivate RightFlipper, RFPress
Primary_flipper_button_right.X = 2090.5
End If
If keycode = PlungerKey Or keycode = LockBarKey Then
Handle_Knob.RotZ = 0
End If
If KeyUpHandler(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
if lfd or rfd Then PlaySound SoundFXDOF("",101,DOFOn,DOFFlippers) ' for DOF callout
LF.Fire 'leftflipper.rotatetoend
If leftflipper.currentangle < leftflipper.endangle + ReflipAngle Then
RandomSoundReflipUpLeft LeftFlipper
Else
SoundFlipperUpAttackLeft LeftFlipper
RandomSoundFlipperUpLeft LeftFlipper
End If
Else
PlaySound SoundFXDOF("",101,DOFOff,DOFFlippers) ' for DOF callout
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
if lfd or rfd Then PlaySound SoundFXDOF("",102,DOFOn,DOFFlippers) ' for DOF callout
RF.Fire 'rightflipper.rotatetoend
If rightflipper.currentangle > rightflipper.endangle - ReflipAngle Then
RandomSoundReflipUpRight RightFlipper
Else
SoundFlipperUpAttackRight RightFlipper
RandomSoundFlipperUpRight RightFlipper
End If
Else
PlaySound SoundFXDOF("",102,DOFOff,DOFFlippers) ' for DOF callout
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
End Sub
Sub RightFlipper_Collide(parm)
CheckLiveCatch Activeball, RightFlipper, RFCount, parm
RightFlipperCollide parm
End Sub
'*******************************************
' GI
'*******************************************
dim gilvl:gilvl = 1
set GICallback = GetRef("UpdateGI")
Sub UpdateGI(no, Enabled)
If Enabled Then
dim xx
For each xx in GI:xx.State = 1: Next
gilvl=1
Flasher001.visible = 1
Flasher002.visible = 1
Flasher003.visible = 1
Flasher004.visible = 1
if vr_room = 0 and cab_mode = 0 then
L_DT_Apollo.state = 1
L_DT_Apollo2.state = 1
end if
Sound_GI_Relay 1, Relay_GI
SetLamp 110, 1 'Controls GI
SetLamp 111, 1 'Prim and Ball GI Updates
Else
For each xx in GI:xx.State = 0: Next
gilvl=0
Flasher001.visible = 0
Flasher002.visible = 0
Flasher003.visible = 0
Flasher004.visible = 0
if vr_room = 0 and cab_mode = 0 then
L_DT_Apollo.state = 0
L_DT_Apollo2.state = 0
end if
Sound_GI_Relay 0, Relay_GI
SetLamp 110, 0 'Controls GI
SetLamp 111, 0 'Prim and Ball GI Updates
End If
If bgsko Then
If enabled Then
Controller.b2ssetdata 79,1
Else
Controller.b2ssetdata 79,0
End If
End If
' *** Backglass flasher lamps for GI ***
For each xx in VRBackglassGI:xx.visible = enabled: Next
End Sub
'********************************************
' Drain hole and Trough
'********************************************
' Main Trough
Sub Drain_Hit():Controller.Switch(10) = 1:RandomSoundDrain Drain:UpdateTrough:End Sub
Sub Drain_UnHit():Controller.Switch(10) = 0:UpdateTrough:End Sub
Sub sw11_Hit():Controller.Switch(11) = 1:UpdateTrough:End Sub
Sub sw11_UnHit():Controller.Switch(11) = 0:UpdateTrough:End Sub
Sub sw12_Hit():Controller.Switch(12) = 1:UpdateTrough:End Sub
Sub sw12_UnHit():Controller.Switch(12) = 0:UpdateTrough:End Sub
Sub sw13_Hit():Controller.Switch(13) = 1:UpdateTrough:End Sub
Sub sw13_UnHit():Controller.Switch(13) = 0:UpdateTrough:End Sub
Sub sw14_Hit():Controller.Switch(14) = 1:UpdateTrough:End Sub
Sub sw14_UnHit():Controller.Switch(14) = 0:UpdateTrough:End Sub
Sub sw15_Hit():Controller.Switch(15) = 1:UpdateTrough:End Sub
Sub sw15_UnHit():Controller.Switch(15) = 0:UpdateTrough:End Sub
Sub UpdateTrough
UpdateTroughTimer.Interval = 300
UpdateTroughTimer.Enabled = 1
End Sub
Sub UpdateTroughTimer_Timer
If sw14.BallCntOver = 0 Then sw13.kick 60, 9
If sw13.BallCntOver = 0 Then sw12.kick 60, 9
If sw12.BallCntOver = 0 Then sw11.kick 60, 9
If sw11.BallCntOver = 0 Then drain.kick 60, 12
Me.Enabled = 0
End Sub
Sub SolBallRelease(Enabled)
If Enabled Then
RandomSoundBallRelease sw15
sw15.Kick 70, 25
End If
End Sub
Sub SolTroughLock(Enabled)
If Enabled Then
sw14.Kick 60,12
UpdateTrough
End If
End Sub
'********************************************
' Saucers
'********************************************
' top saucer
Sub sw54k_Hit()
Controller.Switch(54) = True
SoundSaucerLock
End Sub
Sub sw54k_Unhit()
Controller.Switch(54) = False
End Sub
Sub SolTopEject(Enabled)
If Enabled Then
sw54k.Kick 220,10+ Int(Rnd()*5)
SoundSaucerKick 1, sw54k
End If
End Sub
' right saucer
Sub sw47k_Hit()
Controller.Switch(47) = True
SoundSaucerLock
End Sub
Sub sw47k_Unhit()
Controller.Switch(47) = False
End Sub
Sub SolRightEject(Enabled)
If Enabled Then
sw47k.Kick 200,10+ Int(Rnd()*5)
SoundSaucerKick 1, sw47k
End If
End Sub
'********************************************
' drain post
'********************************************
Sub SolDrainPost(Enabled)
If enabled Then
DrainPost.TransZ = 30
wallpost.HeightTop = 31
Wallpost001.collidable=1
PlaySoundAtLevelStatic SoundFX("DropTarget_Up", DOFContactors), 1, DrainPost
Else
DrainPost.TransZ = 0
wallpost.HeightTop = 1
Wallpost001.collidable=0
PlaySoundAtLevelStatic SoundFX("DropTarget_Down", DOFContactors), 1, DrainPost
end If
End Sub
'********************************************
' super VUK and VUK trough logic
'********************************************
Sub SubwayBallReleaseSuperVUK_Hit()
Controller.Switch(48) = 1
Playsound SoundFX("Ball_Bounce_Playfield_Soft_1",DOFContactors)
UpdateSubTrough
End Sub
Sub SubwayBallReleaseSuperVUK_UnHit()
Controller.Switch(48) = 0
UpdateSubTrough
End Sub
Sub SolTroughSuperVUKOut(Enabled)
If Enabled Then
SubwayBallReleaseSuperVUK.kick 120,25, 1.56
End If
End Sub
Sub SubSlot_008_Hit : UpdateSubTrough : End Sub
Sub SubSlot_008_UnHit : UpdateSubTrough : End Sub
Sub SubSlot_007_Hit : UpdateSubTrough : End Sub
Sub SubSlot_007_UnHit : UpdateSubTrough : End Sub
Sub SubSlot_006_Hit : UpdateSubTrough : End Sub
Sub SubSlot_006_UnHit : UpdateSubTrough : End Sub
Sub SubSlot_005_Hit : UpdateSubTrough : End Sub
Sub SubSlot_005_UnHit : UpdateSubTrough : End Sub
Sub SubSlot_004_Hit : UpdateSubTrough : End Sub
Sub SubSlot_004_UnHit : UpdateSubTrough : End Sub
Sub SubSlot_003_Hit : UpdateSubTrough : End Sub
Sub SubSlot_003_UnHit : UpdateSubTrough : End Sub
Sub SubSlot_002_Hit : UpdateSubTrough : End Sub
Sub SubSlot_002_UnHit : UpdateSubTrough : End Sub
Sub SubSlot_001_Hit : UpdateSubTrough : End Sub
Sub SubSlot_001_UnHit : UpdateSubTrough : End Sub
Sub UpdateSubTrough
UpdateSubTroughTimer.Interval = 50
UpdateSubTroughTimer.Enabled = 1
End Sub
Sub UpdateSubTroughTimer_Timer
If SubwayBallReleaseSuperVUK.BallCntOver = 0 Then SubSlot_008.kick 185, 3
If SubSlot_008.BallCntOver = 0 Then SubSlot_007.kick 185, 3
If SubSlot_007.BallCntOver = 0 Then SubSlot_006.kick 185, 3
If SubSlot_006.BallCntOver = 0 Then SubSlot_005.kick 185, 3
If SubSlot_005.BallCntOver = 0 Then SubSlot_004.kick 185, 3
If SubSlot_004.BallCntOver = 0 Then SubSlot_003.kick 185, 3
If SubSlot_003.BallCntOver = 0 Then SubSlot_002.kick 185, 3
If SubSlot_002.BallCntOver = 0 Then SubSlot_001.kick 185, 3
Me.Enabled = 0
End Sub
'********************************************
' trap door to 8-ball lock
'********************************************
dim TrapDoorDir, TrapDoorHeight
Sub SolTrapDoor(Enabled)
if enabled Then
Ramp139.collidable=0
ramp030.collidable=1
TrapDoorDir=1 'Go Up
TrapDoorHeight= 155
TrapDoorTimer.Interval=5
TrapDoorTimer.Enabled=True
Else
Ramp139.collidable=1
TrapDoorDir=0 'Go Down
TrapDoorHeight= 260
TrapDoorTimer.Interval=5
TrapDoorTimer.Enabled=True
ramp030.collidable=0
end If
End Sub
Sub TrapDoorTimer_Timer()
if TrapDoorDir=1 then
TrapDoorHeight=TrapDoorHeight+TrapDoorTimer.Interval
If TrapDoorHeight >= 260 then TrapDoorTimer.enabled=False:PlaySound SoundFX("DropTarget_Down",DOFContactors)
Ramp029.HeightBottom=TrapDoorHeight
trapDoorPrim.RotZ=-45
Else
TrapDoorHeight=TrapDoorHeight-TrapDoorTimer.Interval
If TrapDoorHeight <= 155 then TrapDoorTimer.enabled=False:PlaySound SoundFX("DropTarget_Down",DOFContactors)
Ramp029.HeightBottom=TrapDoorHeight
trapDoorPrim.RotZ=0
end If
Ramp029.HeightBottom=TrapDoorHeight
End Sub
sub Sol8BLockPlunger(Enabled)
MultiBallPost.IsDropped = 1
wall173.collidable= 0
drp=1
sw24b.Kick 180,1
sw24b.enabled=false
sw23b.Kick 180,1
sw23b.enabled=false
sw22b.Kick 180,1
sw22b.enabled=false
sw21b.Kick 180,1
sw21b.enabled=false
sw20b.Kick 180,1
sw20b.enabled=false
sw19b.Kick 180,1
sw19b.enabled=false
sw18b.Kick 180,1
sw18b.enabled=false
sw17b.Kick 180,1
sw17b.enabled=false
Controller.Switch(17) = 0
Controller.Switch(18) = 0
Controller.Switch(19) = 0
Controller.Switch(20) = 0
Controller.Switch(21) = 0
Controller.Switch(22) = 0
Controller.Switch(23) = 0
Controller.Switch(24) = 0
End Sub
Sub sw16b_hit()
If drp=1 Then
drp=0
MultiBallPost.IsDropped = 0
wall173.collidable= 1
sw24b.enabled=1
sw23b.enabled=0
sw22b.enabled=0
sw21b.enabled=0
sw20b.enabled=0
sw19b.enabled=0
sw18b.enabled=0
sw17b.enabled=0
End If
End Sub
'********************************************
' Rollovers
'********************************************
Sub sw16_Hit
Controller.Switch(16) = 1
BIPL = True
End Sub
Sub sw16_UnHit
Controller.Switch(16) = 0
BIPL = False
End Sub
Sub sw17b_Hit()
Controller.Switch(17) = True
End Sub
Sub sw17b_Unhit()
Controller.Switch(17) = False
End Sub
Sub sw18b_Hit()
Controller.Switch(18) = True
sw17b.enabled=1
End Sub
Sub sw18b_Unhit()
Controller.Switch(18) = False
sw17b.enabled=0
End Sub
Sub sw19b_Hit()
Controller.Switch(19) = True
sw18b.enabled=1
End Sub
Sub sw19b_Unhit()
Controller.Switch(19) = False
sw18b.enabled=0
End Sub
Sub sw20b_Hit()
Controller.Switch(20) = True
sw19b.enabled=1
End Sub
Sub sw20b_Unhit()
Controller.Switch(20) = False
sw19b.enabled=0
End Sub
Sub sw21b_Hit()
Controller.Switch(21) = True
sw20b.enabled=1
End Sub
Sub sw21b_Unhit()
Controller.Switch(21) = False
sw20b.enabled=0
End Sub
Sub sw22b_Hit()
Controller.Switch(22) = True
sw21b.enabled=1
End Sub
Sub sw22_Unhit()
Controller.Switch(22) = False
sw21b.enabled=0
End Sub
Sub sw23b_Hit()
Controller.Switch(23) = True
sw22b.enabled=1
End Sub
Sub sw23b_Unhit()
Controller.Switch(23) = False
sw22b.enabled=0
End Sub
Sub sw24b_Hit()
Controller.Switch(24) = True
sw23b.enabled=1
End Sub
Sub sw24b_Unhit()
Controller.Switch(24) = False
sw23b.enabled=0
End Sub
'********************************************
' Targets
'********************************************
' Round Targets
Sub sw25_Hit
STHit 25
End Sub
Sub sw25o_Hit
TargetBouncer Activeball, 1
End Sub
Sub sw26_Hit
STHit 26
End Sub
Sub sw26o_Hit
TargetBouncer Activeball, 1
End Sub
Sub sw27_Hit
STHit 27
End Sub
Sub sw27o_Hit
TargetBouncer Activeball, 1
End Sub
Sub sw28_Hit
STHit 28
End Sub
Sub sw28o_Hit
TargetBouncer Activeball, 1
End Sub
' Vertical Rectangle Targets
Sub sw29_Hit
STHit 29
End Sub
Sub sw29o_Hit
TargetBouncer Activeball, 1
End Sub
Sub sw30_Hit
STHit 30
End Sub
Sub sw30o_Hit
TargetBouncer Activeball, 1
End Sub
Sub sw31_Hit
STHit 31
End Sub
Sub sw31o_Hit
TargetBouncer Activeball, 1
End Sub
Sub sw32_Hit
STHit 32
End Sub
Sub sw32o_Hit
TargetBouncer Activeball, 1
End Sub
Sub sw38_Hit
STHit 38
End Sub