-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathTheatre of Magic (Bally 1995).vbs
5303 lines (4563 loc) · 197 KB
/
Theatre of Magic (Bally 1995).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
' ______ __ __ ___ ____ ______ ____ ___ ___ _____ ___ ___ ____ ____ ____ __
'| || | | / _] / || || \ / _] / \ | | | | | / | / || | / ]
'| || | | / [_ | o || || D ) / [_ | || __| | _ _ || o || __| | | / /
'|_| |_|| _ || _]| ||_| |_|| / | _] | O || |_ | \_/ || || | | | |/ /
' | | | | || [_ | _ | | | | \ | [_ | || _] | | || _ || |_ | | / \_
' | | | | || || | | | | | . \| | | || | | | || | || | | \ |
' |__| |__|__||_____||__|__| |__| |__|\_||_____| \___/ |__| |___|___||__|__||___,_||____\____|
'
'
' Theatre of Magic - IPDB No. 2845
' © Bally/Midway 1995
' VPX recreation by ninuzzu & Tom Tower
' Thanks to all the authors (JPSalas, Jamin, PacDude, Fuseball, Sacha) who made this table before us.
' Thanks to Clark Kent for the pics and the advices
' Thanks to Hauntfreaks for the magnet decal
' Thanks to Flupper for retexturing and remeshing the plastic ramps
' Thanks to zany for the domes, flippers and bumpers models
' Thanks to knorr for some sound effects I borrowed from his tables
' Thanks to VPDev Team fop the freaking amazing VPX
'
' Theatre of Magic 2.0 by team - Fleep, Rothbauerw, 3rdaxis, Skitso
' Physics redesign, flashers and many logic scripts redesign by Rothbauerw
' Completely new sound system and files by Fleep
' Visuals redesign - GI, Inserts, Flasher, and partial playfield redraw by Skitso
' LUT sets by Skitso, 3rdaxis, Fleep, CalleV
' Advice, Support and Various adjustments, fixes, blade art editing, gold saw mod and script additions by 3rdaxis
' Thanks to ninuzzu & Tom Tower for their VPX recreation
' Thanks to bord for new primitive playfield
' Thanks to G5K for his primitive flippers
' Thanks to flupper for his flasher dome and texture
' Thanks to nickbuol and CalleV for their support and advice regarding TOM real table
' Thanks to CalleV for high res blade art scans
' Special thanks to:
' nickbuol, CalleV, Amazaley1, Jon Osborne - for assisting with pinball recordings of videos and sounds for this big sound project
' Notes (from experience during development):
' In rare cases restarting VPM will reset the switches without properly reinitialize the them.
' As result - the trunk does not function properly or the table has a missing ball. In such case delete NVRAM and cfg file and restart the game.
Option Explicit
Randomize
Dim FlipperType,FlipperCoilRampupMode, TDFlasher, TDFlasherColor, TrunkShake, TigerSaw, CenterPost, VROn, BladeArt, TigerSawMod, FlasherMod, GoldRails
Dim OutlaneDifficulty
Dim LUTset, DisableLUTSelector, LutToggleSound
'//////////////////////////// MECHANICAL SOUNDS OPTIONS ///////////////////////////
'// For the entire sound system scripts see mechanical sounds block at the end of this project.
'///////////////////////-----General Sound Options-----///////////////////////
'// VolumeDial:
'// VolumeDial is the actual global volume multiplier for the mechanical sounds.
'// Values smaller than 1 will decrease mechanical sounds volume.
'// Recommended values should be no greater than 1.
Const VolumeDial = 0.8
'// PositionalSoundPlaybackConfiguration:
'// Specifies the sound playback configuration. Options:
'// 1 = Mono
'// 2 = Stereo (Only L+R channels)
'// 3 = Surround (Full surround sound support for SSF - Front L + Front R + Rear L + Rear R channels)
Const PositionalSoundPlaybackConfiguration = 3
'// RelaysPosition:
'// 1 = Relays positioned with power board (Provides sound spread from the left and right back channels)
'// 2 = Relays positioned with GI strings (Provides sound spread from left/right/front/rear surround channels)
Const RelaysPosition = 2
'************************************************************************
'* TABLE OPTIONS ********************************************************
'************************************************************************
'*********** Set the default LUT set *********************************
'LUTset Types:
'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 = TT & Ninuzzu Original
'You can change LUT option within game with left and right CTRL keys
LUTset = 8
DisableLUTSelector = 0 ' Disables the ability to change LUT option with magna saves in game when set to 1
LutToggleSound = 1 '0 = Disable LUT toggle sound, 1 = Enable LUT toggle sound
' For LUT sound volume level look in sound scripts down below
'*********** Set the Flippers Type *********************************
FlipperType = 0 '0 = white , 1 = yellow , 2 = random
' FlipperCoilRampupMode
' Flipper coil ramp behavior in-game:
' Either of the following modes may feel more natural
' Depends on various factors such as system specifications, playfield monitor, GPU settings, flipper keys vs. leaf switches
' 0 - Static - flipper coil-ramp up is static; Underpowered systems may need to use this mode.
' 1 - Dynamic - flipper coil-ramp up changes dynamically for a better simulation of tap pass capabilities. Requires a fast system - otherwise may introduce a possible flipper lag
FlipperCoilRampupMode = 0
'*********** Enable Flasher under the TrapDoor *********************
TDFlasher = 1 '0 = no , 1 = yes
TDFlasherColor = 3 '0 = red, 1 = green, 2 = blue, 3 = yellow, 4 = purple, 5= cyan
'*********** Shake the Trunk on Hit *****************************
TrunkShake = 1 '0 = no , 1 = yes
'*********** Rotate the TigerSaw (only in prototypes) ****************
TigerSaw = 1 '0 = no , 1 = yes
'*********** Tiger Saw Mod ****************************************
TigerSawMod = 0 ' 0 = Silver, 1 = Gold
'*********** Enable Center Post (only in prototypes) *****************
CenterPost = 0 '0 = no , 1 = yes
'*********** Outlane gap drain difficulty adjustment ***************** 'AXS
OutlaneDifficulty = 2 ' 1 = EASY, 2 = MEDIUM (Factory), 3 = HARD
'*********** Enable VR *****************
VROn = 0 ' 0 = Off, 1 = On
'*********** Blade Art Mod ****************************************
BladeArt = 0 ' 0 = Off, 1 = On
'*********** Modulated Flashers ************************************
' Select 0 for better performance, 1 if you want more realistic Flasher effects
FlasherMod = 0 ' 0 = On/Off, 1 = Modulated
'*********** Gold Rails and Lockdown Bar **************************
GoldRails = 0 ' 0 = Chrome, 1 = Gold
'************************************************************************
'* END OF TABLE OPTIONS *************************************************
'************************************************************************
Dim Ballsize,BallMass
BallSize = 50
BallMass = 1
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 DesktopMode:DesktopMode = Table1.ShowDT
If VROn = 1 Then DesktopMode = True:ScoreText.visible = false
Dim UseVPMColoredDMD:UseVPMColoredDMD= DesktopMode
'Dim UseVPMDMD:UseVPMDMD = DesktopMode
'********************
'Standard definitions
'********************
Const UseSolenoids = 2
Const UseLamps = 0
Const UseSync = 0
Const HandleMech = 0
If FlasherMod = 1 Then Const UseVPMModSol = 1
Const cSingleLFlip = False
Const cSingleRFlip = False
' Standard Sounds
Const SSolenoidOn = ""
Const SSolenoidOff = ""
Const SFlipperOn = ""
Const SFlipperOff = ""
'Const SCoin = "Coin_In_3"
LoadVPM "01560000", "WPC.VBS", 3.50
Set GiCallback2 = GetRef("UpdateGI")
Dim LeftMagnet, RightMagnet
' using table width and height in script slows down the performance
dim tablewidth: tablewidth = Table1.width
dim tableheight: tableheight = Table1.height
'******************************************************
' TABLE INIT
'******************************************************
Const cGameName = "tom_13" '1.3x arcade rom - with credits
Dim TOMBall1, TOMBall2, TOMBall3, TOMBall4, zz
Dim CapL1, CapL2
Sub Table1_Init
vpmInit Me
With Controller
.GameName = cGameName
.SplashInfoLine = "Theatre of Magic - Bally 1995"
.HandleKeyboard = 0
.ShowTitle = 0
.ShowDMDOnly = 1
.ShowFrame = 0
.HandleMechanics = 0
.Hidden = DesktopMode
On Error Resume Next
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
On Error Goto 0
.Switch(22) = 1 'close coin door
.Switch(24) = 1 'and keep it close
End With
' Initialize Trunk
Controller.Switch(55) = 1
Controller.Switch(56) = 0
Controller.Switch(57) = 1
Controller.Switch(58) = 1
' Nudging
vpmNudge.TiltSwitch = 14
vpmNudge.Sensitivity = 3
vpmNudge.TiltObj = Array(Bumper1, Bumper2, Bumper3, LeftSlingshot, RightSlingshot)
' Left Magnet
Set LeftMagnet = New cvpmMagnet
With LeftMagnet
.InitMagnet LMagnet, 30
.CreateEvents "LeftMagnet"
.GrabCenter = 0
End With
' Right Magnet
Set RightMagnet = New cvpmMagnet
With RightMagnet
.InitMagnet RMagnet, 30
.CreateEvents "RightMagnet"
.GrabCenter = 0
End With
' Main Timer init
PinMAMETimer.Interval = PinMAMEInterval
PinMAMETimer.Enabled = 1
'************ Trough init
Set TOMBall1 = sw32.CreateSizedBallWithMass (Ballsize/2, BallMass)
Set TOMBall2 = sw33.CreateSizedBallWithMass (Ballsize/2, BallMass)
Set TOMBall3 = sw34.CreateSizedBallWithMass (Ballsize/2, BallMass)
Set TOMBall4 = sw35.CreateSizedBallWithMass (Ballsize/2, BallMass)
Controller.Switch(35) = 1
Controller.Switch(34) = 1
Controller.Switch(33) = 1
Controller.Switch(32) = 1
'************ Captive Balls
Set CapL1 = CapKicker1.CreateSizedballWithMass (Ballsize/2,Ballmass)
Set CapL2 = CapKicker.CreateSizedballWithMass (Ballsize/2,Ballmass)
CapKicker1.kick 0,0,0
CapKicker.kick 0,0,0
CapL1.FrontDecal = "NoScratches"
CapL2.FrontDecal = "NoScratches"
Controller.Switch(52) = 1
'************ Mirror Balls
Set BallM(1) = MKick(1).CreateSizedBallWithMass (Ballsize/2, BallMass)
Set BallM(2) = MKick(2).CreateSizedBallWithMass (Ballsize/2, BallMass)
Set BallM(3) = MKick(3).CreateSizedBallWithMass (Ballsize/2, BallMass)
Set BallM(4) = MKick(4).CreateSizedBallWithMass (Ballsize/2, BallMass)
'************ Mirrored Primitives and lights init
InitMirror sw66p, sw66m
InitMirror sw67p, sw67m
InitMirror LLoopGateP, LLoopGatePm
InitMirror RLoopGateP, RLoopGatePm
InitMirror2 LLoopGateSw, LLoopGateSwm
InitMirror2 RLoopGateSw, RLoopGateSwm
InitMirror Wiregate, Wiregatem
InitMirror Prim_Lane1, Prim_Lane1m
InitMirror Prim_Lane2, Prim_Lane2m
InitMirror Prim_Lane3, Prim_Lane3m
InitMirror PegMetal10, PegMetal10m
InitMirror PegPlastic19, PegPlastic19m
InitMirror PegPlastic20, PegPlastic20m
InitMirror PegPlastic21, PegPlastic21m
InitMirror PegPlastic22, PegPlastic22m
InitMirror PegPlastic23, PegPlastic23m
InitMirror PegPlastic24, PegPlastic24m 'AXS (this was missing) Fixed
InitMirror bracket14, bracket14m
InitMirror Screw3, Screw3m
InitMirror Screw4, Screw4m
InitMirror Screw5, Screw5m
InitMirror Screw6, Screw6m
InitMirror Screw7, Screw7m
InitMirror Screw8, Screw8m
InitMirror Plastics10, Plastics10m
InitMirror Plastics13, Plastics13m
InitMirror Plastics13, Plastics13m
InitMirror BS1, BS4 'AXS (these don't seem to be showing Up) Fix
InitMirror BB1, BB4
InitMirror BR1, BR4
InitMirror BC1, BC4
InitMirror Rub7, Rub7m
InitMirror Rub8, Rub8m
InitMirror Rub9, Rub9m
InitMirror Rub10, Rub10m
InitMirror Rub11, Rub11m
InitMirror Rub12, Rub12m
InitMirror Rub13, Rub13m
InitMLights l37a, - 345.9, 1
InitMLights l38a, - 345.9, 1
InitMLights GIa, - 363, 58
InitMLights GIa1, - 258, 58
InitMLights GIa2, - 263, 58
InitMLights GIa3, - 240.5, 58
InitMLights GIa4, - 223, 58
RLoopGatePm.visible = DesktopMode
RLoopGateSwm.visible = DesktopMode
LLoopGatePm.visible = DesktopMode
LLoopGateSwm.visible = DesktopMode
RailL.visible = DesktopMode And GoldRails = 0
RailR.visible = DesktopMode And GoldRails = 0
Primary_LockDownBar.visible = DesktopMode And GoldRails = 0
RailBarGold.visible = DesktopMode And GoldRails = 1
'************ Misc Stuff init
SolTrapDoorUp 0
DivPost.IsDropped = 1
LoopPost.IsDropped = 1
sw85.IsDropped = 0 ' Default start position
TrunkBlock.IsDropped = 1
CPC.IsDropped = 1
PreloadImages
'**************** Init flashers ******************
If FlasherMod = 1 Then
SetModLamp 120, 0
SetModLamp 123, 0
SetModLamp 124, 0
SetModLamp 125, 0
SetModLamp 126, 0
SetModLamp 127, 0
SetModLamp 128, 0
Else
SetLamp 120, 0
SetLamp 123, 0
SetLamp 124, 0
SetLamp 125, 0
SetLamp 126, 0
SetLamp 127, 0
SetLamp 128, 0
End If
for each zz in Inserts
zz.FadeSpeedUp = zz.FadeSpeedUp / 2
zz.FadeSpeedDown = zz.FadeSpeedDown / 2
next
End Sub
'******************************************************
' KEYS
'******************************************************
Dim SwordNum, FootStepNum
SwordNum = 0
FootStepNum = 0
Sub Table1_KeyDown(ByVal Keycode)
If keycode = StartGameKey Then soundStartButton()
If keycode = KeyFront Then Controller.Switch(23) = 1 : SoundStartButton()
If keycode = PlungerKey Then Plunger.Pullback : SoundPlungerPull()
If keycode = LeftTiltKey Then Nudge 90, 4 : SoundNudgeLeft()
If keycode = RightTiltKey Then Nudge 270, 4 : SoundNudgeRight()
If keycode = CenterTiltKey Then Nudge 0, 5 : SoundNudgeCenter()
If keycode = LeftFlipperKey Then FlipperActivate LeftFlipper, LFPress
If keycode = RightFlipperKey Then FlipperActivate RightFlipper, RFPress
If keycode = keyInsertCoin1 or keycode = keyInsertCoin2 or keycode = keyInsertCoin3 or keycode = keyInsertCoin4 Then
Select Case Int(rnd*3)
Case 0: PlaySoundAtLevelStatic ("Coin_In_1"), CoinSoundLevel, OutHole
Case 1: PlaySoundAtLevelStatic ("Coin_In_2"), CoinSoundLevel, OutHole
Case 2: PlaySoundAtLevelStatic ("Coin_In_3"), CoinSoundLevel, OutHole
End Select
End If
If vpmKeyDown(keycode) Then Exit Sub
End Sub
Sub Table1_KeyUp(ByVal Keycode)
If Keycode = KeyFront Then Controller.Switch(23) = 0
If keycode = PlungerKey Then
Plunger.Fire
If controller.switch(15) = True Then 'If true then ball in shooter lane, else no ball is shooter lane
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
End If
If keycode = LeftFlipperKey Then FlipperDeActivate LeftFlipper, LFPress
If keycode = RightFlipperKey Then FlipperDeActivate RightFlipper, RFPress
If keycode = RightMagnaSave Then 'AXS 'Fleep
if DisableLUTSelector = 0 then
If LutToggleSound Then
Playsound "LUT_Toggle_Up_Front", 0, LutToggleSoundLevel * VolumeDial, 0, 0.2, 0, 0, 0, 1
Playsound "LUT_Toggle_Up_Rear", 0, LutToggleSoundLevel * VolumeDial, 0, 0.2, 0, 0, 0, -1
End If
LUTSet = LUTSet + 1
if LutSet > 10 then LUTSet = 0
SetLUT
ShowLUT
end if
end if
If keycode = LeftMagnaSave Then
if DisableLUTSelector = 0 then
If LutToggleSound Then
Playsound "LUT_Toggle_Down_Front", 0, LutToggleSoundLevel * VolumeDial, 0, 0.2, 0, 0, 0, 1
Playsound "LUT_Toggle_Down_Rear", 0, LutToggleSoundLevel * VolumeDial, 0, 0.2, 0, 0, 0, -1
End If
LUTSet = LUTSet - 1
if LutSet < 0 then LUTSet = 10
SetLUT
ShowLUT
end if
end if
If vpmKeyUp(keycode) Then Exit Sub
End Sub
Sub Table1_Paused: Controller.Pause = 1:End Sub
Sub Table1_UnPaused: Controller.Pause = 0:End Sub
Sub Table1_Exit(): Controller.Stop:End Sub
'******************************************************
' LUT
'******************************************************
Sub SetLUT 'AXS
UpdateGI 4, 8
end sub
Sub LUTBox_Timer
LUTBox.TimerEnabled = 0
LUTBox.Visible = 0
End Sub
Sub ShowLUT
LUTBox.visible = 1
Select Case LUTSet
Case 0: LUTBox.text = "Fleep Natural Dark 1"
Case 1: LUTBox.text = "Fleep Natural Dark 2"
Case 2: LUTBox.text = "Fleep Warm Dark"
Case 3: LUTBox.text = "Fleep Warm Bright"
Case 4: LUTBox.text = "Fleep Warm Vivid Soft"
Case 5: LUTBox.text = "Fleep Warm Vivid Hard"
Case 6: LUTBox.text = "Skitso Natural and Balanced"
Case 7: LUTBox.text = "Skitso Natural High Contrast"
Case 8: LUTBox.text = "3rdaxis Referenced THX Standard"
Case 9: LUTBox.text = "CalleV Punchy Brightness and Contrast"
Case 10: LUTBox.text = "TT & Ninuzzu Original"
End Select
LUTBox.TimerEnabled = 1
End Sub
'******************************************************
' SWITCHES
'******************************************************
'**********Rollovers
Sub Switches_Hit(idx)
Controller.Switch(Switches(idx).timerinterval)=1
If Switches(idx).timerinterval = 15 Then RandomSoundRollover()
If Switches(idx).timerinterval = 25 Then RandomSoundRollover()
If Switches(idx).timerinterval = 26 Then RandomSoundRollover()
If Switches(idx).timerinterval = 27 Then RandomSoundRollover()
If Switches(idx).timerinterval = 28 Then RandomSoundRollover()
If Switches(idx).timerinterval = 52 Then RandomSoundRollover()
If Switches(idx).timerinterval = 53 Then RandomSoundRollover()
If Switches(idx).timerinterval = 54 Then RandomSoundRollover()
If Switches(idx).timerinterval = 66 Then sw66m.transZ = -30 * dCos(mAngle) : sw66m.transY = -30 * dSin(mAngle) : RandomSoundRollover()
If Switches(idx).timerinterval = 67 Then sw67m.transZ = -30 * dCos(mAngle): sw66m.transY = - 30 * dSin(mAngle) : RandomSoundRollover()
If Switches(idx).timerinterval = 77 Then RandomSoundRollover()
If Switches(idx).timerinterval = 78 Then RandomSoundRollover()
If Switches(idx).timerinterval = 81 Then RandomSoundRollover()
If Switches(idx).timerinterval = 86 Then RandomSoundRollover()
End Sub
Sub Switches_UnHit(idx)
Controller.Switch(Switches(idx).timerinterval)=0
If Switches(idx).timerinterval = 66 Then sw66m.transZ = 0 : sw66m.transY = 0
If Switches(idx).timerinterval = 67 Then sw67m.transZ = 0 : sw67m.transY = 0
End Sub
'**********Ramp Switches
Sub RampSwitches_Hit(idx)
vpmTimer.PulseSw (RampSwitches(idx).timerinterval)
If RampSwitches(idx).timerinterval = 73 Then sw73flip.RotatetoEnd
If RampSwitches(idx).timerinterval = 74 Then sw74flip.RotatetoEnd
If RampSwitches(idx).timerinterval = 75 Then If ActiveBall.VelY < 0 Then SoundRampBrktGate1(SoundOn) : Else SoundRampBrktGate1(SoundOff) : End If
If RampSwitches(idx).timerinterval = 76 Then If ActiveBall.VelY < 0 Then SoundRampBrktGate2(SoundOn) : Else SoundRampBrktGate2(SoundOff) : End If
If RampSwitches(idx).timerinterval = 87 Then sw87flip.RotatetoEnd
End Sub
Sub RampSwitches_UnHit(idx)
If RampSwitches(idx).timerinterval = 73 Then sw73flip.RotatetoStart
If RampSwitches(idx).timerinterval = 74 Then sw74flip.RotatetoStart
If RampSwitches(idx).timerinterval = 87 Then sw87flip.RotatetoStart
End Sub
'**********Spinner
Sub sw37_Spin():vpmTimer.PulseSw 37:SoundSpinner():End Sub
'**********Targets
Sub sw51_Hit
vpmTimer.PulseSw 51
dim finalspeed
finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
If finalspeed > 10 then
RandomSoundTargetHitStrong()
RandomSoundBallBouncePlayfieldSoft()
End if
If finalspeed <= 10 then
RandomSoundTargetHitWeak()
End If
End Sub
Sub sw51b_Hit
vpmTimer.PulseSw 51
dim finalspeed
finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
If finalspeed > 10 then
RandomSoundTargetHitStrong()
RandomSoundBallBouncePlayfieldSoft()
End if
If finalspeed <= 10 then
RandomSoundTargetHitWeak()
End If
End Sub
Sub sw38_Hit
vpmTimer.PulseSw 38
dim finalspeed
finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
If finalspeed > 10 then
RandomSoundTargetHitStrong()
RandomSoundBallBouncePlayfieldSoft()
End if
If finalspeed <= 10 then
RandomSoundTargetHitWeak()
End If
End Sub
Sub sw82_Hit
vpmTimer.PulseSw 82
dim finalspeed
finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
If finalspeed > 10 then
RandomSoundTargetHitStrong()
RandomSoundBallBouncePlayfieldSoft()
End if
If finalspeed <= 10 then
RandomSoundTargetHitWeak()
End If
End Sub
Sub sw82b_Hit
vpmTimer.PulseSw 82
dim finalspeed
finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
If finalspeed > 10 then
RandomSoundTargetHitStrong()
RandomSoundBallBouncePlayfieldSoft()
End if
If finalspeed <= 10 then
RandomSoundTargetHitWeak()
End If
End Sub
Sub LLoopGate_Hit() : RandomSoundMetal() : End Sub
Sub RLoopGate_Hit() : RandomSoundMetal() : End Sub
'******************************************************
' SOLENOIDS
'******************************************************
'standard coils
SolCallback(1) = "SolRelease" 'Ball Trough
SolCallback(2) = "SolSpiritRing" 'Magnet Diverter
SolCallback(3) = "SolTrapDoorUp" 'Trap Door Up
SolCallback(4) = "SolSubwayPopper" 'Subway Popper
SolCallback(5) = "SolRightMagnet" 'Right Drain Magnet
SolCallback(6) = "SolLoopPost" 'Center Loop Post
SolCallback(7) = "SolKnocker" 'Knocker
SolCallback(8) = "SolDivPost" 'Top Diverter Post
'SolCallback(9) = "SolLSling" 'Left Slingshot
'SolCallback(10) = "SolRSling" 'RIght Slingshot
'SolCallback(11) = "SolBottomJet" 'Bottom Bumper
'SolCallback(12) = "SolMiddleJet" 'Middle Bumper
'SolCallback(13) = "SolTopJet" 'Top Bumper
SolCallback(14) = "SolTrapDoorHold" 'Trap Door Hold
SolCallBack(15) = "SolGate3" 'Left Up/Down Gate
SolCallback(16) = "SolGate1" 'Right Up/Down Gate
SolCallback(17) = "SolTrunkMotorCW" 'Move Trunk Clockwise
SolCallback(18) = "SolTrunkMotorCCW" 'Move Trunk Counter Clockwise
SolCallback(21) = "SolTopKickout" 'Top Kickout
If FlasherMod = 0 Then
SolCallBack(20) = "SetLamp 120," 'Return Lane Flasher (x2)
If CenterPost Then SolCallback(23) = "SetLamp 123," 'Magic Post Flasher (***)
SolCallback(24) = "SetLamp 124," 'Trap Door Flasher (x2)
SolCallback(25) = "SetLamp 125," 'Spirit Ring Flasher (x2)
SolCallback(26) = "SetLamp 126," 'Saw Flasher (x4)
SolCallback(27) = "SetLamp 127," 'Bumper Flasher (x4)
SolCallBack(28) = "SetLamp 128," 'Trunk Flasher (x3)
Else
SolModCallBack(20) = "SetModLamp 120," 'Return Lane Flasher (x2)
If CenterPost Then SolModCallback(23) = "SetModLamp 123," 'Magic Post Flasher (***)
SolModCallback(24) = "SetModLamp 124," 'Trap Door Flasher (x2)
SolModCallback(25) = "SetModLamp 125," 'Spirit Ring Flasher (x2)
SolModCallback(26) = "SetModLamp 126," 'Saw Flasher (x4)
SolModCallback(27) = "SetModLamp 127," 'Bumper Flasher (x4)
SolModCallBack(28) = "SetModLamp 128," 'Trunk Flasher (x3)
End If
'aux board
SolCallback(33) = "SolTrunkMagnet" 'Trunk Magnet
SolCallback(34) = "SolSubBallRelease" 'Subway BallRelease
SolCallback(35) = "SolLeftMagnet" 'Left Drain Magnet
'fliptronic board
SolCallback(sLLFlipper) = "SolLFlipper" 'Left Flipper
SolCallback(sLRFlipper) = "SolRFlipper" 'Right Flipper
'prototype extra coils
If CenterPost Then SolCallback(36) = "SolMagicPost" 'Magic Post Up/Down (***)
If TigerSaw Then SolCallBack(19) = "SolTigerSaw" 'Move the TigerSaw (***)
'******************************************************
' TROUGH BASED ON FOZZY'S
'******************************************************
Dim BIP : BIP = 0
Sub sw35_Hit():Controller.Switch(35) = 1:UpdateTrough: End Sub
Sub sw35_UnHit():Controller.Switch(35) = 0:UpdateTrough:End Sub
Sub sw34_Hit():Controller.Switch(34) = 1:End Sub
Sub sw34_UnHit():Controller.Switch(34) = 0:UpdateTrough:End Sub
Sub sw33_Hit():Controller.Switch(33) = 1:End Sub
Sub sw33_UnHit():Controller.Switch(33) = 0:UpdateTrough:End Sub
Sub sw32_Hit():Controller.Switch(32) = 1:End Sub
Sub sw32_UnHit():Controller.Switch(32) = 0:UpdateTrough:End Sub
Sub sw31_Hit():vpmTimer.PulseSw 31 : BIP = BIP + 1:End Sub
Sub UpdateTrough()
Subway.TimerInterval = 300
Subway.TimerEnabled = 1
End Sub
Sub Subway_Timer()
If sw32.BallCntOver = 0 Then sw33.kick 65, 6
If sw33.BallCntOver = 0 Then sw34.kick 65, 6
If sw34.BallCntOver = 0 Then sw35.Kick 65, 6
If sw35.BallCntOver = 0 Then OutHole.kick 65,8
If sw41.BallCntOver = 0 Then sw42.kick 120, 6
If sw42.BallCntOver = 0 Then sw43.kick 120, 6
Me.TimerEnabled = 0
End Sub
'******************************************************
' DRAIN & RELEASE
'******************************************************
Sub OutHole_Hit()
RandomSoundDrain()
UpdateTrough
BIP = BIP - 1
End Sub
Sub SolRelease(enabled)
If Enabled Then
RandomSoundBallRelease()
sw32.kick 65, 8
UpdateTrough
End If
End Sub
'RandomSoundBottomArchBallGuide - Soft Bounces
Sub Wall014_Hit() : RandomSoundBottomArchBallGuide() : End Sub
Sub Wall015_Hit() : RandomSoundBottomArchBallGuide() : End Sub
'RandomSoundBottomArchBallGuide - Hard Hit
Sub Wall008_Hit() : RandomSoundBottomArchBallGuideHardHit() : End Sub
Sub Wall009_Hit() : RandomSoundBottomArchBallGuideHardHit() : End Sub
'RandomSoundFlipperBallGuide
Sub Wall2_Hit() : RandomSoundFlipperBallGuide() : End Sub
Sub Wall13_Hit() : RandomSoundFlipperBallGuide() : End Sub
'RandomSoundWireformAntiRebountRail
Sub rail001_Hit() : RandomSoundWireformAntiRebountRail() : End Sub
Sub rail002_Hit() : RandomSoundWireformAntiRebountRail() : End Sub
'******************************************************
' DIVERTERS & GATES
'******************************************************
Dim isVanishLockGranted : isVanishLockGranted = 0
Sub SolLoopPost(enabled)
If Enabled Then
LoopPost.IsDropped = 0
RandomSoundLoopPostSolenoid(Up)
SoundLoopPostMagnet(SoundOn)
Else
LoopPost.IsDropped = 1
RandomSoundLoopPostSolenoid(Down)
SoundLoopPostMagnet(SoundOff)
End If
End Sub
Sub SolDivPost(enabled)
If Enabled Then
DivPost.IsDropped = 0
SoundDiverterPostSolenoid(Up)
SoundDiverterPostMagnet(SoundOn)
isVanishLockGranted = 1
Else
DivPost.IsDropped = 1
SoundDiverterPostSolenoid(Down)
SoundDiverterPostMagnet(SoundOff)
isVanishLockGranted = 0
End If
End Sub
Sub SolGate1(enabled)
vpmSolGate Gate1,0,enabled
If enabled Then
SoundGate1Actuator(ActuatorOpened)
Else
SoundGate1Actuator(ActuatorClosed)
End If
End Sub
Sub SolGate3(enabled)
vpmSolGate Gate3,0,enabled
If enabled Then
SoundGate3Actuator(ActuatorOpened)
Else
SoundGate3Actuator(ActuatorClosed)
End If
End Sub
Dim Gate4Enabled : Gate4Enabled = 0
Sub Gate1_Hit():SoundBallGate1():End Sub
Sub Gate2_Hit():SoundBallGate2():End Sub
Sub Gate3_Hit():SoundBallGate3():End Sub
Sub Gate4_Hit():Gate4Enabled = 1:End Sub
Sub Gate6_Hit():SoundBallGate6():End Sub
Sub c1_Hit():SoundBallGate_c1():End Sub
'******************************************************
' KNOCKER
'******************************************************
Sub SolKnocker(enabled)
If enabled Then
KnockerSolenoid()
End If
End Sub
'****************************************************
' VANISH LOCK
'****************************************************
Sub sw84_Hit()
Controller.Switch(84) = 1
SoundVanishSolenoidLock(Vanish_sw84)
End Sub
Sub sw84_UnHit():Controller.Switch(84) = 0:End Sub
Sub sw83_Hit()
Controller.Switch(83) = 1
SoundVanishSolenoidLock(Vanish_sw83)
End Sub
Sub sw83_UnHit():Controller.Switch(83) = 0:End Sub
Sub SolTopKickout(Enabled)
If Enabled then
If sw83.ballcntover = 0 Then 'no ball in the vanish lock
SoundVanishSolenoidKickout(NoBallLocked)
Elseif sw84.ballcntover = 0 Then ' only one ball in the vanish lock
SoundVanishSolenoidKickout(OneBallLocked)
vpmtimer.addtimer 135, "RandomSoundVanishKickoutBallDropOnPlayfield '"
TrunkMagnets 0
Else 'two balls in the vanish lock
SoundVanishSolenoidKickout(TwoBallsLocked)
TrunkMagnets 0
End If
sw83.kick 295,20
End If
End Sub
'******************************************************
' LOCK
'******************************************************
Sub sw44_Hit():Controller.Switch(44) = 1 : RandomSoundTrunkTrough_1() : End Sub
Sub sw44_UnHit():Controller.Switch(44) = 0 :End Sub
Sub sw43_Hit():Controller.Switch(43) = 1 : UpdateTrough : RandomSoundTrunkTrough_2_Multiball() : End Sub
Sub sw43_UnHit():Controller.Switch(43) = 0 :UpdateTrough:End Sub
Sub sw42_Hit():Controller.Switch(42) = 1 : End Sub
Sub sw42_UnHit():Controller.Switch(42) = 0: UpdateTrough : End Sub
Sub sw41_Hit():Controller.Switch(41) = 1 : SoundTrunkTrough_3() : End Sub
Sub sw41_UnHit():Controller.Switch(41) = 0 : UpdateTrough:End Sub
Sub SolSubBallRelease(Enabled)
If Enabled Then
RandomSoundTrapdoorSubRelease()
sw41.kick 135,10
End If
End sub
Sub SolSubwayPopper(Enabled)
If Enabled Then
sw44.kickz 192.5 + rnd*2.5, 19 + rnd*2, 0.6, 60 '1.56
Controller.Switch(44) = 0
RandomSoundTrapdoorEjectPopper()
vpmtimer.addtimer 85, "RandomSoundTrapdoorBallDropOnPlayfield '"
End If
End Sub
'******************************************************
' SLINGSHOTS
'******************************************************
Dim LStep, RStep
Sub LeftSlingshot_Slingshot
RandomSoundSlingshotLeft()
'RandomSoundRubberStrong()
vpmTimer.PulseSw 61
LSling.Visible = 0
LSling2.Visible = 1
sling2.TransZ = -10
LStep = 0
Me.TimerEnabled = 1
End Sub
Sub LeftSlingshot_Timer
Select Case LStep
Case 0:LSLing1.Visible = 1:LSLing2.Visible = 0:sling2.TransZ = -20
Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:Me.TimerEnabled = 0
End Select
LStep = LStep + 1
End Sub
Sub RightSlingshot_Slingshot
RandomSoundSlingshotRight()
'RandomSoundRubberStrong()
vpmTimer.PulseSw 62
RSling.Visible = 0
RSling2.Visible = 1
sling1.TransZ = -10
RStep = 0
Me.TimerEnabled = 1
End Sub
Sub RightSlingshot_Timer
Select Case RStep
Case 0:RSLing1.Visible = 1:RSLing2.Visible = 0:sling1.TransZ = -20
Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:Me.TimerEnabled = 0
End Select
RStep = RStep + 1
End Sub
'******************************************************
' BUMPERS
'******************************************************
Dim dirRing1 : dirRing1 = -1
Dim dirRing2 : dirRing2 = -1
Dim dirRing3 : dirRing3 = -1
Sub Bumper1_Hit
vpmTimer.PulseSw 65
RandomSoundBumperA()
Me.TimerEnabled = 1
End Sub
Sub Bumper2_Hit
vpmTimer.PulseSw 64
RandomSoundBumperB()
Me.TimerEnabled = 1
End Sub
Sub Bumper3_Hit :
vpmTimer.PulseSw 63
RandomSoundBumperC()
Me.TimerEnabled = 1
End Sub
Sub Bumper1_timer()
BR1.Z = BR1.Z + (5 * dirRing1)
BR4.Y = mdistY - SQR((ABS(BR1.Y)-mdistY)^2 +(BR1.Z)^2) * dCos(mangle) + BR1.Z * dSin(mangle)
BR4.Z = BR1.Z * dCos(mangle) + SQR((ABS(BR1.Y)-mdistY)^2 +(BR1.Z)^2) * dSin(mangle)
If BR1.Z <= 0 Then dirRing1 = 1
If BR1.Z >= 40 Then
dirRing1 = -1
BR1.Z = 40
Me.TimerEnabled = 0
End If
End Sub
Sub Bumper2_timer()
BR2.Z = BR2.Z + (5 * dirRing2)
If BR2.Z <= 0 Then dirRing2 = 1
If BR2.Z >= 40 Then
dirRing2 = -1
BR2.Z = 40
Me.TimerEnabled = 0
End If
End Sub
Sub Bumper3_timer()
BR3.Z = BR3.Z + (5 * dirRing3)
If BR3.Z <= 0 Then dirRing3 = 1
If BR3.Z >= 40 Then
dirRing3 = -1
BR3.Z = 40
Me.TimerEnabled = 0
End If
End Sub
'******************************************************
' NFOZZY'S FLIPPERS
'******************************************************
Const ReflipAngle = 20
Sub SolLFlipper(Enabled)
If Enabled Then
LF.Fire
If leftflipper.currentangle < leftflipper.endangle + ReflipAngle Then
'Play partial flip sound
RandomSoundReflipUpLeft()
Else
'Play full flip sound
'LeftFlipper.RotateToEnd