-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathApollo 13 (Sega 1995) V1.53.vbs
1932 lines (1648 loc) · 51.4 KB
/
Apollo 13 (Sega 1995) V1.53.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 '
' '
' Created by ICPjuggla and Herweh vp9 '
' Balater vpx '
' Contribution Thalamus, JP's, DJRobX, Rothbauerw, Amgrim, Bigus1, 32assassin,ClarKent, Chucky87 '
'==================================================================================================================================================='
Option Explicit
Randomize
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
On Error Goto 0
Const UseVPMModSol = 1
Dim varhidden, UseVPMColoredDMD, bgsko
bgsko=0
If Table1.ShowDT = true then
UseVPMColoredDMD = true
varhidden=1
Else
UseVPMColoredDMD = False
varhidden=0
End If
' ***********************************************************************************************
' OPTIONS
' ***********************************************************************************************
' VPinMAME ROM name
Const cGameName = "apollo13" ' enter string of valid ROM
' ball size
Const BallSize = 50 ' sets the ball size
' ***********************************************************************************************
' OPTIONS END
' ***********************************************************************************************
' Thalamus 2020 January : Improved directional sounds/
' !! NOTE : Table not verified yet !!
' Options
' Volume devided by - lower gets higher sound
Const VolDiv = 2000 ' Lower number, louder ballrolling/collition sound
Const VolCol = 10 ' Ball collition divider ( voldiv/volcol )
' The rest of the values are multipliers
'
' .5 = lower volume
' 1.5 = higher volume
Const VolBump = 0.2 ' Bumpers volume.
Const VolRol = 0.1 ' Rollovers volume.
Const VolGates = 0.1 ' Gates volume.
Const VolMetal = 0.1 ' Metals volume.
Const VolRB = 0.1 ' Rubber bands volume.
Const VolRH = 0.1 ' Rubber hits volume.
Const VolPo = 0.1 ' Rubber posts volume.
Const VolPi = 0.1 ' Rubber pins volume.
Const VolPlast = 0.1 ' Plastics volume.
Const VolTarg = 0.1 ' Targets volume.
Const VolWood = 0.1 ' Woods volume.
Const VolKick = 0.1 ' Kicker volume.
Const VolSpin = 0.15 ' Spinners volume.
Const VolFlip = 0.1 ' Flipper volume.
' ===============================================================================================
' some general constants and variables
' ===============================================================================================
Const UseLamps = False
Const UseGI = False
Const UseSync = True
Const HandleMech = False
Const SSolenoidOn = "SolenoidOn"
Const SSolenoidOff = "SolenoidOff"
Const SCoin = "Coin"
Const SKnocker = "Knocker"
Dim I, x, obj, bsTrough, bsTroughVUK, bsTroughSuperVUK, bsRocket, bsTrough8BL, nbb, tempo, sap, drp, rl, rfd, lfd, flipp, deb18
Dim mUpperSaucer, mRightSaucer, bsUpperSaucer, bsRightSaucer, mmoon,bsball003, bsBall002, ball8, noball8, noball8b, bkgg
Const SFlipperOn="Flipper2",SFlipperOff="Flipper"
' ===============================================================================================
' load game controller
' ===============================================================================================
deb18=0 '1 visualization of the loading of the balls before the first game
flipp=0 '1 flipper works continuously
bkgg=1 '1 GI Animation on Backglass
LoadVPM "01560000", "SEGA2.VBS", 3.56
' ===============================================================================================
' solenoids
' ===============================================================================================
SolCallback(1) = "SolTroughVUKOut"
SolCallback(2) = "SolAPlunger"
SolCallback(3) = "SolRightEject"
SolCallback(4) = "SolTopEject"
SolCallback(5) = "SolRocketEject"
SolCallback(7) = "ShakeRocket"
SolCallback(8) = "SolKnocker"
SolCallback(14) = "SolTroughSuperVUKOut"
SolCallback(15) = "SolLFlipperd"
SolCallback(16) = "SolRFlipperd"
SolCallback(17) = "SolTroughOut"
SolCallback(18) = "SolRampLift"
SolCallback(19) = "SolmoonLift"
SolCallback(20) = "SolRocketLift"
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"
' =====================================================================================================
' table events
' =====================================================================================================
Set GICallback = GetRef("GIUpdate")
Sub GIUpdate(no, Enabled)
If bgsko Then
If enabled Then
Controller.b2ssetdata 79,1
Else
Controller.b2ssetdata 79,0
End If
End If
gi1.state=Enabled
gi2.state=Enabled
gi3.state=Enabled
gi4.state=Enabled
gi5.state=Enabled
gi6.state=Enabled
gi7.state=Enabled
gi8.state=Enabled
gi9.state=Enabled
gi10.state=Enabled
gi11.state=Enabled
gi12.state=Enabled
gi13.state=Enabled
gi14.state=Enabled
gi15.state=Enabled
gi16.state=Enabled
gi17.state=Enabled
gi18.state=Enabled
gi19.state=Enabled
gi20.state=Enabled
gi21.state=Enabled
gi22.state=Enabled
gi23.state=Enabled
GI24.state=Enabled
GI25.state=Enabled
GI26.state=Enabled
GI27.state=Enabled
GI28.state=Enabled
GI29.state=Enabled
GI30.state=Enabled
GI31.state=Enabled
GI32.state=Enabled
GI33.state=Enabled
GI34.state=Enabled
GI35.state=Enabled
GI36.state=Enabled
GI37.state=Enabled
GI38.state=Enabled
GI39.state=Enabled
GI40.state=Enabled
GI41.state=Enabled
GI42.state=Enabled
GI43.state=Enabled
gi44.state=Enabled
gi45.state=Enabled
gi46.state=Enabled
Flasher001.visible = Enabled
Flasher002.visible = Enabled
Flasher003.visible = Enabled
Flasher004.visible = Enabled
GI47.state=Enabled
GI48.state=Enabled
GI49.state=Enabled
GI50.state=Enabled
GI51.state=Enabled
GI52.state=Enabled
GI53.state=Enabled
GI54.state=Enabled
GI55.state=Enabled
GI56.state=Enabled
GI57.state=Enabled
GI58.state=Enabled
GI59.state=Enabled
GI60.state=Enabled
GI61.state=Enabled
GI62.state=Enabled
GI63.state=Enabled
End Sub
Sub Table1_Init
On Error Resume Next
With Controller
.GameName=cGameName
.SplashInfoLine ="Apollo 13, Sega, 1995"
.HandleKeyboard = False
.ShowTitle = False
.ShowDMDOnly = True
.ShowFrame = False
.Hidden = VarHidden
.Games(cGameName).Settings.Value("rol") = 0
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
End With
On Error Goto 0
If b2son Then bgsko = bkgg
Controller.SolMask(0)=0
vpmTimer.AddTimer 2000,"Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the timer to renable all the solenoids after 2 seconds
' Controller.Run
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)
Set bsTroughSuperVUK = New cvpmBallStack
bsTroughSuperVUK.InitSw 0, 48, 0, 0, 0, 0, 0, 0
bsTroughSuperVUK.InitKick BallReleaseSuperVUK, 110, 0.1
bsTroughSuperVUK.InitExitSnd SoundFX("BallRelease",DOFContactors), SoundFX("SolOn",DOFContactors)
Set bsball002 = New cvpmBallStack
bsball002.InitSw 0, 15, 0, 0, 0, 0, 0, 0
bsball002.InitKick Ball002, 0, 0
bsball002.InitExitSnd SoundFX("BallRelease",DOFContactors), SoundFX("SolOn",DOFContactors)
Set bsball003 = New cvpmBallStack
bsball003.InitKick Ball003, 45, 10
' magnet
Set mmoon = New cvpmMagnet
With mmoon
.InitMagnet mMoonLock, 90
.GrabCenter = True
.MagnetOn = 0
.CreateEvents "mmoon"
End With
wall173.collidable=1
releaseout.collidable=1
moonballstop.collidable=0
moonballstopb.collidable=0
mmoon.MagnetOn = 0
moonlock.Enabled=0
Ramp139.collidable=1
Ramp029.collidable=0
BallReleaseSuperVUK.CreateSizedBall(25)
BallReleaseSuperVUK.Kick 180,0.1
BallReleaseSuperVUK001.CreateSizedBall(25)
BallReleaseSuperVUK001.Kick 180,0.1
BallReleaseSuperVUK001.enabled=false
BallReleaseSuperVUK002.CreateSizedBall(25)
BallReleaseSuperVUK002.Kick 180,0.1
BallReleaseSuperVUK002.enabled=false
BallReleaseSuperVUK003.CreateSizedBall(25)
BallReleaseSuperVUK003.Kick 1800,0.1
BallReleaseSuperVUK003.enabled=false
BallReleaseSuperVUK004.CreateSizedBall(25)
BallReleaseSuperVUK004.Kick 180,0.1
BallReleaseSuperVUK004.enabled=false
If deb18 Then
noball8b=1
noball8=1
Kicker001.enabled=1
for i = 0 to 7
Kicker001.CreateSizedBall(25)
Kicker001.Kick 110,0.1
Next
Kicker001.enabled=false
Else
sw24b.CreateSizedBall(25)
sw23b.CreateSizedBall(25)
sw22b.CreateSizedBall(25)
sw21b.CreateSizedBall(25)
sw20b.CreateSizedBall(25)
sw19b.CreateSizedBall(25)
sw18b.CreateSizedBall(25)
sw17b.CreateSizedBall(25)
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
End If
Wallpost001.collidable=0
InitMoon
InitRocket
End Sub
Sub Table1_Exit()
Controller.Stop
End Sub
Sub Table1_Paused
Controller.Pause = True
End Sub
Sub Table1_UnPaused
Controller.Pause = False
End Sub
Sub Table1_KeyDown(ByVal keycode)
If keycode = LeftFlipperKey Then SolLFlipper 1
If keycode = RightFlipperKey Then SolRFlipper 1
If vpmKeyDown(keycode) Then Exit Sub
If keycode = PlungerKey Then Controller.Switch(9) = True
End Sub
Sub Table1_KeyUp(ByVal keycode)
If keycode = LeftFlipperKey Then SolLFlipper 0
If keycode = RightFlipperKey Then SolRFlipper 0
If vpmKeyUp(KeyCode) Then Exit Sub
If keycode = PlungerKey Then Controller.Switch(9) = False
End Sub
' ===============================================================================================
' realtime updates
' ===============================================================================================
'Set MotorCallback = GetRef("RealTimeUpdates")
' ===============================================================================================
' ball draining, release and auto plunger
' ===============================================================================================
Sub SolTroughOut(Enabled)
If Enabled Then
if sap= 0 Then
If bsball003.Balls <= 0 Then
releaseout.collidable= 0
End If
End If
End If
End Sub
Sub SolTroughVUKOut(Enabled)
If Enabled Then
If Controller.Switch(16) =0 Then
bsball003.ExitSol_On
End If
End If
End Sub
Sub ball002_Hit()
releaseout.collidable=1
If bsball003.Balls <= 0 Then
me.destroyball
bsball003.AddBall Me
End If
End Sub
Sub sw10_Hit()
Controller.Switch(10) = True
End Sub
Sub sw10_Unhit()
Controller.Switch(10) = False
End Sub
Sub sw11_Hit()
Controller.Switch(11) = True
End Sub
Sub sw11_Unhit()
Controller.Switch(11) = False
End Sub
Sub sw12_Hit()
Controller.Switch(12) = True
End Sub
Sub sw12_Unhit()
Controller.Switch(12) = False
End Sub
Sub sw13_Hit()
Controller.Switch(13) = True
End Sub
Sub sw13_Unhit()
Controller.Switch(13) = False
End Sub
Sub sw14_Hit()
Controller.Switch(14) = True
End Sub
Sub sw14_Unhit()
Controller.Switch(14) = False
End Sub
Sub sw151_Hit()
Controller.Switch(15) = True
releaseout.collidable=1
End Sub
Sub sw151_Unhit()
Controller.Switch(15) = False
End Sub
Sub sw16_Hit()
Controller.Switch(16) = True
if sap Then
AutoPlunger.Kick 0, 35+Int(rnd(30))
PlaySoundAtVol SoundFX("SolenoidOn",DOFContactors), sw16, 1
End If
End Sub
sub sw16t_hit()
sap=0
End Sub
sub sw16b_hit()
If noball8b=1 then
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
sw24.enabled=1
sw23.enabled=0
sw22.enabled=0
sw21.enabled=0
sw20.enabled=0
sw19.enabled=0
sw18.enabled=0
sw17.enabled=0
noball8b=0
End If
if drp Then
Ramp139.collidable=1
ramp029.collidable=0
PlaySoundAtVol SoundFX("SolenoidOn",DOFContactors), sw16b, 1
End If
End Sub
Sub sw16_Unhit()
Controller.Switch(16) = False
End Sub
Sub sw17b_Hit()
Controller.Switch(17) = True
If noball8 Then
noball8=0
End If
End Sub
Sub sw17b_Unhit()
Controller.Switch(17) = False
End Sub
Sub sw18b_Hit()
Controller.Switch(18) = True
If noball8 Then
sw17.enabled=1
sw17b.enabled=1
End If
End Sub
Sub sw18b_Unhit()
Controller.Switch(18) = False
End Sub
Sub sw19b_Hit()
Controller.Switch(19) = True
If noball8 Then
sw18.enabled=1
sw18b.enabled=1
End If
End Sub
Sub sw19b_Unhit()
Controller.Switch(19) = False
End Sub
Sub sw20b_Hit()
Controller.Switch(20) = True
If noball8 Then
sw19.enabled=1
sw19b.enabled=1
End If
End Sub
Sub sw20b_Unhit()
Controller.Switch(20) = False
End Sub
Sub sw21b_Hit()
Controller.Switch(21) = True
If noball8 Then
sw20.enabled=1
sw20b.enabled=1
End If
End Sub
Sub sw21b_Unhit()
Controller.Switch(21) = False
End Sub
Sub sw22b_Hit()
Controller.Switch(22) = True
If noball8 Then
sw21.enabled=1
sw21b.enabled=1
End If
End Sub
Sub sw22_Unhit()
Controller.Switch(22) = False
End Sub
Sub sw23b_Hit()
Controller.Switch(23) = True
If noball8 Then
sw22.enabled=1
sw22b.enabled=1
End If
End Sub
Sub sw23b_Unhit()
Controller.Switch(23) = False
End Sub
Sub sw24b_Hit()
Controller.Switch(24) = True
If noball8 Then
sw23.enabled=1
sw23b.enabled=1
End If
End Sub
Sub sw24b_Unhit()
Controller.Switch(24) = False
End Sub
Sub sw32_hit()
vpmTimer.PulseSw 32
End Sub
Sub sw31_hit()
vpmTimer.PulseSw 31
End Sub
Sub sw30_hit()
vpmTimer.PulseSw 30
End Sub
Sub sw29_hit()
vpmTimer.PulseSw 29
End Sub
Sub sw28_hit()
vpmTimer.PulseSw 28
End Sub
Sub sw27_hit()
vpmTimer.PulseSw 27
End Sub
Sub sw26_hit()
vpmTimer.PulseSw 26
End Sub
Sub sw25_hit()
vpmTimer.PulseSw 25
End Sub
Sub sw38_hit()
vpmTimer.PulseSw 38
End Sub
Sub sw40_hit()
vpmTimer.PulseSw 40
End Sub
Sub sw49a_hit()
vpmTimer.PulseSw 49
End Sub
Sub sw49b_hit()
vpmTimer.PulseSw 49
End Sub
Sub sw49c_hit()
vpmTimer.PulseSw 49
End Sub
Sub SolAPlunger(Enabled)
if controller.Switch(16) then
AutoPlunger.Kick 0, 35-int(Rnd(30))
' PlaySound "SolenoidOn"
PlaySoundAtVol SoundFX("SolenoidOn",DOFContactors), AutoPlunger, 1
sap=1
end If
End Sub
'flipper
Sub sollFlipperd(Enabled)
lfd=Enabled
End Sub
Sub solrFlipperd(Enabled)
rfd=Enabled
End Sub
Sub sollFlipper(Enabled)
if lfd or rfd or flipp Then
If Enabled Then
PlaySoundAtVol SoundFXDOF("fx_Flipperup",101,DOFOn,DOFFlippers),LeftFlipper,1:LeftFlipper.RotateToEnd
Else
PlaySoundAtVol SoundFXDOF("fx_Flipperdown",101,DOFOff,DOFFlippers),LeftFlipper,1:LeftFlipper.RotateToStart
End If
Else
LeftFlipper.RotateToStart
End If
End Sub
Sub solrflipper(Enabled)
if rfd or lfd or flipp Then
If Enabled Then
PlaySoundAtVol SoundFXDOF("fx_Flipperup",102,DOFOn,DOFFlippers), RightFlipper, 1:RightFlipper.RotateToEnd
Else
PlaySoundAtVol SoundFXDOF("fx_Flipperdown",102,DOFOff,DOFFlippers), RightFlipper, 1:RightFlipper.RotateToStart
End If
Else
RightFlipper.RotateToStart
End If
End Sub
'Flippers()
Sub LeftFlipper_Collide(parm)
CollideWithFlipper
End Sub
Sub RightFlipper_Collide(parm)
CollideWithFlipper
End Sub
Sub CollideWithFlipper()
If BallSpeed > 4 then
RandomSoundFlipper()
Else
RandomSoundFlipperLowVolume()
End If
End Sub
Sub RandomSoundFlipper()
Select Case Int(Rnd*3)+1
Case 1 : PlaySoundAtVol "flip_hit_1", ActiveBall, 1
Case 2 : PlaySoundAtVol "flip_hit_2", ActiveBall, 1
Case 3 : PlaySoundAtVol "flip_hit_3", ActiveBall, 1
End Select
End Sub
Sub RandomSoundFlipperLowVolume()
Select Case Int(Rnd*3)+1
Case 1 : PlaySoundAtVol "flip_hit_1_low", ActiveBall, 1
Case 2 : PlaySoundAtVol "flip_hit_2_low", ActiveBall, 1
Case 3 : PlaySoundAtVol "flip_hit_3_low", ActiveBall, 1
End Select
End Sub
' ===============================================================================================
' slingshots events and slingshot animation scripting from JPSalas
' ===============================================================================================
' ===============================================================================================
' bumpers
' ===============================================================================================
Sub Bumper1_Hit()
vpmTimer.PulseSw 35
PlayBumperSound
End Sub
Sub Bumper2_Hit()
vpmTimer.PulseSw 33
PlayBumperSound
End Sub
Sub Bumper3_Hit()
vpmTimer.PulseSw 34
PlayBumperSound
End Sub
Sub PlayBumperSound()
Select Case Int(Rnd*3)+1
Case 1 : PlaySoundAtVol SoundFX("bumper_1",DOFContactors), ActiveBall, 1
Case 2 : PlaySoundAtVol SoundFX("bumper_2",DOFContactors), ActiveBall, 1
Case 3 : PlaySoundAtVol SoundFX("bumper_3",DOFContactors), ActiveBall, 1
End Select
End Sub
' ===============================================================================================
' knocker
' ===============================================================================================
Sub SolKnocker(Enabled)
If Enabled Then PlaySound SoundFX("knocker",DOFKnocker)
End Sub
' ===============================================================================================
' ramp diverter
' ===============================================================================================
Dim diverterAdd
InitDiverter
Sub InitDiverter()
Diverter2.collidable = 0
Diverter1.collidable = 1
diverterAdd = 1
End Sub
Sub DiverterTriggerLeft_Hit()
ActiveBall.VelY = 0
Diverter1.collidable = 1
Diverter2.collidable = 0
diverterAdd = -3
RampDiverterTimer.Enabled = True
End Sub
Sub DiverterTriggerRight_Hit()
ActiveBall.VelY = 0
Diverter1.collidable = 0
Diverter2.collidable = 1
diverterAdd = 3
RampDiverterTimer.Enabled = True
End Sub
Sub RampDiverterTimer_Timer()
RampDiverter.RotY = RampDiverter.RotY + diverterAdd
If RampDiverter.RotY <= 0 Or RampDiverter.RotY => 30 Then
RampDiverterTimer.Enabled = False
End If
End Sub
' ===============================================================================================
' spinner
' ===============================================================================================
Sub sw41_Spin()
vpmTimer.PulseSw 41
PlaysoundAtVol "Gate2_low", sw41, 1
End Sub
Sub sw55_Hit()
vpmTimer.PulseSw 55
Playsound "Gate2_low"
End Sub
' ===============================================================================================
' drain post
' ===============================================================================================
Sub SolDrainPost(Enabled)
If enabled Then
DrainPost.TransZ = 30
wallpost.HeightTop = 31
Wallpost001.collidable=1
PlaySound SoundFX("SolenoidOn",DOFContactors)
Else
DrainPost.TransZ = 0
wallpost.HeightTop = 1
Wallpost001.collidable=0
PlaySound SoundFX("SolenoidOff",DOFContactors)
end If
End Sub
' ===============================================================================================
' trap door to 8-ball lock
' ===============================================================================================
Sub SolTrapDoor(Enabled)
If noball8=0 Then
Ramp139.collidable=1
ramp029.collidable=0
Else
if enabled Then
Ramp139.collidable=0
ramp029.collidable=1
if sap then drp=1
PlaySound SoundFX("SolenoidOff",DOFContactors)
Else
if drp=0 Then
Ramp139.collidable=1
ramp029.collidable=0
End If
end If
End If
End Sub
Sub Sol8BLockPlunger(Enabled)
MultiBallPost.IsDropped = 1
wall173.collidable= 0
sw24b.Kick 180,0.1
sw24b.enabled=false
sw23b.Kick 180,0.1
sw23b.enabled=false
sw22b.Kick 180,0.1
sw22b.enabled=false
sw21b.Kick 180,0.1
sw21b.enabled=false
sw20b.Kick 180,0.1
sw20b.enabled=false
sw19b.Kick 180,0.1
sw19b.enabled=false
sw18b.Kick 180,0.1
sw18b.enabled=false
sw17b.Kick 180,0.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
sw24.enabled=0
sw23.enabled=0
sw22.enabled=0
sw21.enabled=0
sw20.enabled=0
sw19.enabled=0
sw18.enabled=0
sw17.enabled=0
noball8=1
noball8b=1
End Sub
' ===============================================================================================
' ramp lift
' ===============================================================================================
Dim rampIsUp, rampCountDown
rampIsUp = True
rampCountDown = 0
Sub SolRampLift(Enabled)
if enabled then
RampLift.HeightBottom = 0
RampLiftr.HeightBottom = 0
Else
RampLift.HeightBottom = 70
RampLiftr.HeightBottom = 70
end If
End Sub
' ===============================================================================================
' rocket
' ===============================================================================================
Sub sw43k_Hit()
Controller.Switch(43) = True
End Sub
Sub sw43k_Unhit()
Controller.Switch(43) = False
End Sub
Sub InitRocket()
Controller.Switch(50) = True
Controller.Switch(51) = False
End Sub
Sub SolRocketEject(Enabled)
If Enabled Then
sw43k.kick 155+int(rnd(10)), 0.1
PlaySound SoundFX("SolenoidOn",DOFContactors)
End If
End Sub
Sub SolRocketLift(Enabled)
If Enabled Then
RocketTimer.Interval = 30
RocketTimer.Enabled = True
PlaySound SoundFX("SolenoidOn",DOFContactors)
Else
RocketTimer.Interval = 30
RocketTimer.Enabled = True
PlaySound SoundFX("SolenoidOn",DOFContactors)
End If
End Sub
Sub RocketTimer_Timer()
Controller.Switch(50) = False
Controller.Switch(51) = False
if Rocket.rotx< -16 Then
RocketTrough.Enabled = True
Else
RocketTrough.Enabled = 0
End If
If controller.Solenoid(20) Then
If Rocket.RotX <= -18 Then
PlaySound SoundFX("SolenoidOff",DOFContactors)
RocketTimer.Enabled = False
Controller.Switch(51) = True
Exit Sub
End If
Rocket.RotX = Rocket.RotX - 0.1
Else
If Rocket.RotX >= 0 Then
PlaySound SoundFX("SolenoidOff",DOFContactors)
RocketTimer.Enabled = False
Controller.Switch(50) = True
Exit Sub
End If
Rocket.RotX = Rocket.RotX + 0.1
End If
End Sub
Sub RocketTrough_Hit()
PlaysoundAtVol "ball_bounce_low", RocketTrough, 1
me.destroyball
PlaysoundAtVol "jf_rollingfaster", RocketTrough, 1
bsTroughSuperVUK.AddBall Me
End Sub
'Sub ShakeRocket(direction)
Sub ShakeRocket (Enabled)
If Not RocketTimer.Enabled Then
RocketShakeTimer.Interval = 5+Int(Rnd(5))
RocketShakeTimer.Enabled = True
End If
End Sub
Sub RocketShakeTimer_Timer()
' nudging
Select Case RocketShakeTimer.Interval
Case 0
Rocket.RotX = Rocket.RotY - 1
Case 1, 2
Rocket.RotX = Rocket.RotX + 1
Case 3
Rocket.RotX = Rocket.RotY - 1
Case 5
Rocket.RotY = Rocket.RotY - 1
Case 6, 7
Rocket.RotY = Rocket.RotY + 1
Case 8
Rocket.RotY = Rocket.RotY - 1
Case 10
Rocket.RotY = Rocket.RotY + 1
Case 11, 12
Rocket.RotY = Rocket.RotY - 1
Case 13
Rocket.RotY = Rocket.RotY + 1
Case Else
RocketShakeTimer.Enabled = False
End Select
RocketShakeTimer.Interval = RocketShakeTimer.Interval + 1
End Sub
' ===============================================================================================
' moon
' ===============================================================================================
Dim MoonBall, radians, angle, radius,angleb, balx ,baly, balyb ,balz, rada, radab
Sub InitMoon()
' rotation stuff
radians = 3.1415926 / 180
angle = 0
angleb =180-Moon.objrotz
radius = 126