-
Notifications
You must be signed in to change notification settings - Fork 37
/
Beach Bums.vbs
1368 lines (1135 loc) · 39 KB
/
Beach Bums.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
Option Explicit
Randomize
'Const cGameName = "hlywoodh"
Const cGameName = "beachbms"
' Thalamus 2018-12-18 : Added FFv2
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "Can't open controller.vbs"
On Error Goto 0
LoadVPM "01210000", "sys80.VBS", 3.1
' Thalamus - for Fast Flip v2
' NoUpperRightFlipper
' NoUpperLeftFlipper
'**********************************************************
'******** OPTIONS *******************************
'**********************************************************
Dim BallShadows: Ballshadows=1 '******************set to 1 to turn on Ball shadows
Dim FlipperShadows: FlipperShadows=1 '***********set to 1 to turn on Flipper shadows
Dim ROMSounds: ROMSounds=0 '**********set to 0 for no rom sounds, 1 to play rom sounds.. mostly used for testing
'************************************************
'************************************************
'************************************************
'************************************************
'************************************************
' Const UseSolenoids = True
Const UseSolenoids = 2
Const UseLamps = True
Const UseSync = False
Const UseGI = False
' Standard Sounds
Const SSolenoidOn = "fx_solenoid"
Const SSolenoidOff = "fx_solenoidoff"
Const SCoin = "fx_coin"
Dim bsTrough, bslLock, bsrLock, dtRight, dtLeft, FastFlips, objekt, xx
Dim bMusicOn, startgamesound, multiballs
Sub BeachBums_Init
' Thalamus : Was missing 'vpminit me'
vpminit me
With Controller
.GameName = cGameName
If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
.SplashInfoLine = "Beach Bums 1.0"&chr(13)&"(HH Mod - Gottlieb 1986)"
.HandleKeyboard = 0
.ShowTitle = 0
.ShowDMDOnly = 1
.ShowFrame = 0
.HandleMechanics = False
.Games(cGameName).Settings.Value("sound") = ROMSounds
.Hidden = 0
On Error Resume Next
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
On Error Goto 0
End With
If B2SOn then
for each objekt in backdropstuff : objekt.visible = 0 : next
End If
Intensity 'sets GI brightness depending on day/night slider settings
multiballs=1
ALlightsTimer.uservalue=1
CaptiveKick.createball
CaptiveKick.kick 0,0
PinMAMETimer.Interval = PinMAMEInterval
PinMAMETimer.Enabled = 1
'************************Trough
sw76.CreateBall
sw20.CreateBall
sw10.CreateBall
Controller.Switch(76) = 1
Controller.Switch(20) = 1
Controller.Switch(10) = 1
'Kickers
Set bslLock=New cvpmBallStack
with bslLock
.InitSaucer sw46,46,-170,10
.InitExitSnd Soundfx("fx_ballrel",DOFContactors), Soundfx("HoleKick",DOFContactors)
end with
Set bsrLock=New cvpmBallStack
with bsrLock
.InitSaucer sw56,56,120,11
.InitExitSnd Soundfx("fx_ballrel",DOFContactors), Soundfx("HoleKick",DOFContactors)
end with
' Nudging
vpmNudge.TiltSwitch = 57
vpmNudge.Sensitivity = 1
vpmNudge.TiltObj = Array(leftslingshot, rightslingshot, TopSlingShot, URightSlingShot, bumper1)
Set dtLeft=New cvpmDropTarget
dtLeft.InitDrop Array(sw40,sw50,sw60),Array(40,50,60)
dtLeft.InitSnd SoundFX("",DOFDropTargets),SoundFX("DTReset",DOFDropTargets)
Set dtRight=New cvpmDropTarget
dtRight.InitDrop Array(sw41,sw51,sw61),Array(41,51,61)
dtRight.InitSnd SoundFX("",DOFDropTargets),SoundFX("DTReset",DOFDropTargets)
if ballshadows=1 then
BallShadowUpdate.enabled=1
else
BallShadowUpdate.enabled=0
end if
if flippershadows=1 then
FlipperLSh.visible=1
FlipperRSh.visible=1
else
FlipperLSh.visible=0
FlipperRSh.visible=0
end if
vpmMapLights CPULights
Set FastFlips = new cFastFlips
with FastFlips
.CallBackL = "SolLflipper" 'Point these to flipper subs
.CallBackR = "SolRflipper" '...
' .CallBackUL = "SolULflipper"'...(upper flippers, if needed)
' .CallBackUR = "SolURflipper"'...
.TiltObjects = True 'Optional, if True calls vpmnudge.solgameon automatically. IF YOU GET A LINE 1 ERROR, DISABLE THIS! (or setup vpmNudge.TiltObj!)
' .DebugOn = False 'Debug, always-on flippers. Call FastFlips.DebugOn True or False in debugger to enable/disable.
end with
startgamesound=1
PlaySound "SeaShore", -1, .05 'adjust the volume using the second parameter.
End Sub
'***************
' Random Music
'***************
Dim song, numsongs, currentsong
numsongs=6 'Set to number of songs, name songs bgout_HHsong0, bgout_HHsong1, bgout_HHsong2.. etc
Sub PlaySong 'random
If bMusicOn Then
currentsong = INT((numsongs-1) * RND(1) )
song = "bgout_HHsong" & currentsong & ".mp3"
PlayMusic song
End If
End Sub
Sub BeachBums_MusicDone
If bMusicOn Then
if multiballs>1 then
PlayMusic "BBmultiballmusic.mp3" 'if still in multiball repeat multiball music
else
PlaySong 'if not in multiball, play random song.
end if
End If
End Sub
'************************************************
' Solenoids
'************************************************
SolCallback(1) = "SolLLock"
SolCallback(2) = "SolRLock"
SolCallback(4) = "dtDrop2"
SolCallback(5) = "SolLeftTargetReset"
SolCallback(6) = "SolRightTargetReset"
SolCallback(7) = "dtDrop3"
SolCallback(8) = "solknocker"
SolCallback(9) = "solballrelease"
SolCallback(10) = "FastFlips.TiltSol"
SolCallback(sLRFlipper) = "SolRFlipper"
SolCallback(sLLFlipper) = "SolLFlipper"
Sub SolLFlipper(Enabled)
If Enabled Then
PlaySound SoundFX("fx_Flipperup",DOFFlippers):LeftFlipper.RotateToEnd: LeftFlipper1.RotateToEnd
controller.Switch(6)=1
Else
PlaySound SoundFX("fx_Flipperdown",DOFFlippers):LeftFlipper.RotateToStart: LeftFlipper1.RotateToStart
controller.Switch(6)=0
End If
End Sub
' paired drop target dropping in "In-Sync" mode
sub dtDrop2(enabled):dtLeft.hit 2:dtRight.hit 2:l7.state=0:end sub
sub dtDrop3(enabled):dtLeft.hit 3:dtRight.hit 3:l8.state=0:end sub
Sub SolRFlipper(Enabled)
If Enabled Then
PlaySound SoundFX("fx_Flipperup",DOFFlippers):RightFlipper.RotateToEnd:RightFlipper1.RotateToEnd
controller.Switch(16)=1
controller.Switch(71)=1
Else
PlaySound SoundFX("fx_Flipperdown",DOFFlippers):RightFlipper.RotateToStart:RightFlipper1.RotateToStart
controller.Switch(16)=0
controller.Switch(71)=0
End If
End Sub
Dim GILevel, DayNight
Sub Intensity
If DayNight <= 20 Then
GILevel = .5
ElseIf DayNight <= 40 Then
GILevel = .4125
ElseIf DayNight <= 60 Then
GILevel = .325
ElseIf DayNight <= 80 Then
GILevel = .2375
Elseif DayNight <= 100 Then
GILevel = .15
End If
For each xx in GI: xx.IntensityScale = xx.IntensityScale * (GILevel): Next
For each xx in DTLights: xx.IntensityScale = xx.IntensityScale * (GILevel): Next
End Sub
Sub ALlightsTimer_timer
if me.uservalue>1 then
ALlights(me.uservalue-2).state=0
ALlightsA(me.uservalue-2).state=0
elseif me.uservalue=1 then
ALlights(9).state=0
ALlightsA(9).state=0
else
ALlights(8).state=0
ALlightsA(8).state=0
end if
ALlights(me.uservalue).state=1
ALlightsA(me.uservalue).state=1
me.uservalue = me.uservalue+1
if me.uservalue>9 then me.uservalue=0
End sub
Sub FlipperTimer_Timer
'testbox1.text =
BumperLightA1.state=BumperLight1.state
LFlip.RotY = LeftFlipper.CurrentAngle
RFlip.RotY = RightFlipper.CurrentAngle
LFlip1.RotY = LeftFlipper1.CurrentAngle-90
RFlip1.RotY = RightFlipper1.CurrentAngle-90
Pgate.Rotz = Gate.CurrentAngle*0.7
if sw40.isdropped then
Lsw40.state=GI3.state
else
Lsw40.state=0
end if
if sw50.isdropped then
Lsw50.state=GI3.state
else
Lsw50.state=0
end if
if sw60.isdropped then
Lsw60.state=GI3.state
else
Lsw60.state=0
end if
if sw41.isdropped then
Lsw1.state=GI17.state
' l6.state=0
else
Lsw1.state=0
' l6.state=1
end if
if sw51.isdropped then
Lsw2.state=GI7.state
' l7.state=0
else
Lsw2.state=0
' l7.state=1
end if
if sw61.isdropped then
Lsw3.state=GI7.state
' l8.state=0
else
Lsw3.state=0
' l8.state=1
end if
if FlipperShadows=1 then
FlipperLSh.RotZ = LeftFlipper.currentangle
FlipperRSh.RotZ = RightFlipper.currentangle
end if
End Sub
' Ball locks / kickers
Sub sw46_Hit:
PlaySound "holein"
PlaySound "bigkahunabanzai"
bslLock.AddBall 0:
End Sub
Sub sw56_Hit:
PlaySound "holein"
PlaySound "nice wave"
bsrLock.AddBall 0:
End Sub
Sub SolLLock(enabled)
If enabled and LeftKickTimer.enabled=0 Then
bslLock.ExitSol_On
PkickarmL.RotZ = 15
LeftKickTimer.uservalue = 0
LeftKickTimer.Enabled = 1
End If
End Sub
Sub LeftKickTimer_timer
select case me.uservalue
case 5:
PkickarmL.rotz=0
me.enabled=0
end Select
me.uservalue = me.uservalue+1
End Sub
Sub SolRLock(enabled)
If enabled and RightKickTimer.enabled=0 Then
if multiballs<2 then
multiballs=3
if l0.state=1 and RightKickTimer.enabled=0 then 'L0 is lit when game enabled
bMusicOn=false 'turn off autoreplay
endmusic 'stop regular music
playmusic "BBmultiballmusic.mp3" 'playmultiball music
bMusicOn=true 'turn back oon auto play so when multiball music ends music starts again
end if
end if
bsrLock.ExitSol_On
PkickarmR.RotZ = 15
RightKickTimer.uservalue = 0
RightKickTimer.Enabled = 1
End If
End Sub
Sub RightKickTimer_timer
select case me.uservalue
case 5:
PkickarmR.rotz=0
me.enabled=0
end Select
me.uservalue = me.uservalue+1
End Sub
'******************************************************
' TROUGH BASED ON NFOZZY'S via bord's pink panther
'******************************************************
Sub sw10_Hit():Controller.Switch(10) = 1:UpdateTrough:End Sub
Sub sw10_UnHit():Controller.Switch(10) = 0:UpdateTrough:End Sub
Sub sw20_Hit():Controller.Switch(20) = 1:UpdateTrough:End Sub
Sub sw20_UnHit():Controller.Switch(20) = 0:UpdateTrough:End Sub
Sub sw76_Hit():Controller.Switch(76) = 1:UpdateTrough:End Sub
Sub sw76_UnHit():Controller.Switch(76) = 0:UpdateTrough:End Sub
Sub UpdateTrough()
UpdateTroughTimer.Interval = 500
UpdateTroughTimer.Enabled = 1
End Sub
Sub UpdateTroughTimer_Timer()
If sw76.BallCntOver = 0 Then sw20.kick 60, 1
UpdateTroughTimer1.Interval = 500
UpdateTroughTimer1.Enabled = 1
Me.Enabled = 0
End Sub
Sub UpdateTroughTimer1_Timer()
If sw20.BallCntOver = 0 Then sw10.kick 60, 1
Me.Enabled = 0
End Sub
'******************************************************
' DRAIN & RELEASE
'******************************************************
Sub sw66_Hit()
if l0.state=1 then PlaySoundat "drain", sw66
if multiballs>0 then multiballs=multiballs-1
if multiballs<2 then 'down to one ball after multiball
endmusic 'stop multiball music
PlayMusic "bgout_HHsong" & currentsong & ".mp3" 'play regular musuic
end if
startgamesound = 1
if sw20.BallCntOver > 0 or (sw76.ballcntover>0 and (sw46.ballcntover >0 or sw56.ballcntover>0)) or (sw46.ballcntover>0 and sw56.ballcntover>0) then
bMusicOn = False 'turn off autoreplay music
endMusic
end if
UpdateTrough
Controller.Switch(66) = 1
End Sub
Sub sw66_UnHit()
Controller.Switch(66) = 0
End Sub
Sub solballrelease(enabled)
If enabled Then
sw66.kick 60,40
PlaySoundat SoundFX("fx_Solenoid",DOFContactors), sw66
End If
End Sub
set Lights(12) = L12
Set LampCallback = GetRef("UpdateMultipleLamps")
Sub UpdateMultipleLamps
if controller.lamp(12)=true and sw76.BallCntOver > 0 then
sw76.kick 60, 7
if bMusicOn = False then
bMusicOn = TRUE 'TRUE
playsong 'play random song
end if
PlaySoundAt SoundFX("ballrelease",DOFContactors), sw76
UpdateTrough
end if
if controller.lamp(2)=true then dtleft.hit 1:dtRight.hit 1:l6.state=0
End Sub
sub startgametimer_timer '****make random sound for starting game
Dim v
if l0.state=1 then
v = INT(2 * RND(1) )
Select Case v
Case 0:PlaySound"beachbums"
Case 1:PlaySound"beachbums2"
End Select
end if
me.enabled=0
end sub
'**********************************************************************************************************
'Plunger code
'**********************************************************************************************************
Sub BeachBums_KeyDown(ByVal KeyCode)
If KeyCode = LeftFlipperKey then FastFlips.FlipL True : FastFlips.FlipUL True
If KeyCode = RightFlipperKey then FastFlips.FlipR True : FastFlips.FlipUR True
if keycode = addcreditkey then PlaySoundAt "coinin", sw66
If keycode = PlungerKey Then Plunger.Pullback:PlaySoundAt "plungerpull", Plunger
If KeyCode = startgamekey and startgametimer.enabled=0 and startgamesound=1 then
startgamesound=0
startgametimer.enabled=1
end if
'************************ Start Ball Control 1/3
if keycode = 46 then ' C Key
If contball = 1 Then
contball = 0
Else
contball = 1
End If
End If
if keycode = 48 then 'B Key
If bcboost = 1 Then
bcboost = bcboostmulti
Else
bcboost = 1
End If
End If
if keycode = 203 then bcleft = 1 ' Left Arrow
if keycode = 200 then bcup = 1 ' Up Arrow
if keycode = 208 then bcdown = 1 ' Down Arrow
if keycode = 205 then bcright = 1 ' Right Arrow
'************************ End Ball Control 1/3
If KeyDownHandler(keycode) Then Exit Sub
End Sub
Sub BeachBums_KeyUp(ByVal KeyCode)
If KeyCode = LeftFlipperKey then FastFlips.FlipL False : FastFlips.FlipUL False
If KeyCode = RightFlipperKey then FastFlips.FlipR False : FastFlips.FlipUR False
If keycode = PlungerKey Then Plunger.Fire:PlaySoundAt "plunger", Plunger
'************************ Start Ball Control 2/3
if keycode = 203 then bcleft = 0 ' Left Arrow
if keycode = 200 then bcup = 0 ' Up Arrow
if keycode = 208 then bcdown = 0 ' Down Arrow
if keycode = 205 then bcright = 0 ' Right Arrow
'************************ End Ball Control 2/3
If KeyUpHandler(keycode) Then Exit Sub
End Sub
'************************ Start Ball Control 3/3
Sub StartControl_Hit()
Set ControlBall = ActiveBall
contballinplay = true
End Sub
Sub StopControl_Hit()
contballinplay = false
End Sub
Dim bcup, bcdown, bcleft, bcright, contball, contballinplay, ControlBall, bcboost
Dim bcvel, bcyveloffset, bcboostmulti
bcboost = 1 'Do Not Change - default setting
bcvel = 4 'Controls the speed of the ball movement
bcyveloffset = -0.01 'Offsets the force of gravity to keep the ball from drifting vertically on the table, should be negative
bcboostmulti = 3 'Boost multiplier to ball veloctiy (toggled with the B key)
Sub BallControl_Timer()
If Contball and ContBallInPlay then
If bcright = 1 Then
ControlBall.velx = bcvel*bcboost
ElseIf bcleft = 1 Then
ControlBall.velx = - bcvel*bcboost
Else
ControlBall.velx=0
End If
If bcup = 1 Then
ControlBall.vely = -bcvel*bcboost
ElseIf bcdown = 1 Then
ControlBall.vely = bcvel*bcboost
Else
ControlBall.vely= bcyveloffset
End If
End If
End Sub
'************************ End Ball Control 3/3
'Drop Targets
Sub Sw40_Dropped:dtleft.Hit 1 :StopSound"tikidrop1":PlaySound"tikidrop1": End Sub
Sub Sw50_Dropped:dtleft.Hit 2 :StopSound"tikidrop2":PlaySound"tikidrop2": End Sub
Sub Sw60_Dropped:dtleft.Hit 3 :StopSound"tikidrop3":PlaySound"tikidrop3": End Sub
Sub Sw41_Dropped:dtRight.Hit 1: l6.state=0:StopSound"guitar1":PlaySound"guitar1": End Sub
Sub Sw51_Dropped:dtRight.Hit 2: l7.state=0:StopSound"guitar2":PlaySound"guitar2": End Sub
Sub Sw61_Dropped:dtRight.Hit 3: l8.state=0:StopSound"guitar3":PlaySound"guitar3": End Sub
Sub SolRightTargetReset(enabled)
dim xx
if enabled then
dtRight.SolDropUp enabled
l6.state=2
l7.state=2
l8.state=2
end if
End Sub
Sub SolLeftTargetReset(enabled)
dim xx
if enabled then
dtLeft.SolDropUp enabled
end if
End Sub
'Bumpers
Sub bumper1_Hit
vpmTimer.PulseSw 30
PlaySoundAt SoundFX("fx_bumper4",DOFContactors), Bumper1:
DOF 206, DOFPulse
BumperLight1.duration 2, 200, 1
End Sub
'Wire Triggers
Sub SW42_Hit:Controller.Switch(42)=1:
Dim w
w = INT(5 * RND(1) )
Select Case w
Case 0:PlaySound"Switch2"
Case 1:PlaySound"cowabunga"
Case 2:PlaySound"Switch2"
Case 2:PlaySound"tweekerbanzai"
Case 3:PlaySound"Switch2"
End Select
End Sub
Sub SW42_unHit:Controller.Switch(42)=0:End Sub
Sub SW52_Hit:Controller.Switch(52)=1:
PlaySound"Switch2"
End Sub
Sub SW52_unHit:Controller.Switch(52)=0:End Sub
Sub SW62_Hit:Controller.Switch(62)=1:
Dim w
w = INT(6 * RND(1) )
Select Case w
Case 0:PlaySound"Switch2"
Case 1:PlaySound"totally tubular"
Case 2:PlaySound"Switch2"
Case 3:PlaySound"niceride"
Case 4:PlaySound"Switch2"
Case 5:PlaySound"sherilaugh"
End Select
End Sub
Sub SW62_unHit:Controller.Switch(62)=0:End Sub
Sub SW73_Hit:Controller.Switch(73)=1:
End Sub
Sub SW73_unHit:Controller.Switch(73)=0:End Sub
Sub SW45_Hit:Controller.Switch(45)=1:
Playsound "Switch"
End Sub
Sub SW45_unHit:Controller.Switch(45)=0:End Sub
Sub SW55_Hit:Controller.Switch(55)=1:
PlaySound "Tweeker Laugh"
End Sub
Sub SW55_unHit:Controller.Switch(55)=0:End Sub
Sub SW65_Hit:Controller.Switch(65)=1:
PlaySound "Switch"
End Sub
Sub SW65_unHit:Controller.Switch(65)=0:End Sub
Sub SW75_Hit:Controller.Switch(75)=1:
PlaySound "guitarwhistle"
al11.Duration 2, 600, 0
End Sub
Sub SW75_unHit:Controller.Switch(75)=0:End Sub
Sub SW72_Hit:Controller.Switch(72)=1:End Sub
Sub SW72_unHit:Controller.Switch(72)=0:End Sub
Sub SW70_Hit:Controller.Switch(70)=1:
PlaySound "Switch"
End Sub
Sub SW70_unHit:Controller.Switch(70)=0:End Sub
Sub SW74_Hit:Controller.Switch(74)=1:End Sub
Sub SW74_unHit:Controller.Switch(74)=0:End Sub
Sub SW31_Hit:Controller.Switch(31)=1:End Sub
Sub SW31_unHit:Controller.Switch(31)=0:End Sub
Sub SW80_hit
BrahBody.rotz=15
me.uservalue=1
me.timerenabled= 1
Dim w
w = INT(4 * RND(1) )
Select Case w
Case 0:PlaySound"knarly"
Case 1:PlaySound"I'mstoked"
Case 2:PlaySound"hangtendude"
Case 3:PlaySound"cool"
End Select
End Sub
Sub SW80_timer
select Case me.uservalue
Case 1: BrahBody.rotz=20
Case 2: BrahBody.rotz=25
Case 4: BrahBody.rotz=20
Case 5: BrahBody.rotz=15
Case 6: BrahBody.rotz=0: me.timerenabled=0
end select
me.uservalue=me.uservalue+1
end sub
Sub SW81_hit
Surfboard.rotz=-15
me.uservalue=1
me.timerenabled= 1
end sub
Sub SW81_timer
select Case me.uservalue
Case 1: Surfboard.rotz=-20
Case 2: Surfboard.rotz=-25
Case 4: Surfboard.rotz=-20
Case 5: Surfboard.rotz=-15
Case 6: Surfboard.rotz=0: me.timerenabled=0
end select
me.uservalue=me.uservalue+1
end sub
Sub SW82_hit
BrahHead.rotz=15
me.uservalue=1
me.timerenabled= 1
end sub
Sub SW82_timer
select Case me.uservalue
Case 1: BrahHead.rotz=20
Case 2: BrahHead.rotz=25
Case 4: BrahHead.rotz=20
Case 5: BrahHead.rotz=15
Case 6: BrahHead.rotz=0: me.timerenabled=0
end select
me.uservalue=me.uservalue+1
end sub
Sub SW83_hit()
if Activeball.vely < 0 then
BrahHead.rotz=-15
me.uservalue=1
me.timerenabled= 1
end if
end sub
Sub SW83_timer
select Case me.uservalue
Case 1: BrahHead.rotz=-20
Case 2: BrahHead.rotz=-25
Case 4: BrahHead.rotz=-20
Case 5: BrahHead.rotz=-15
Case 6: BrahHead.rotz=0: me.timerenabled=0
end select
me.uservalue=me.uservalue+1
end sub
Sub SW84_hit()
BrahSBshadow.rotz=15
me.uservalue=1
me.timerenabled= 1
end sub
Sub SW84_timer
select Case me.uservalue
Case 1: BrahSBshadow.rotz=20
Case 2: BrahSBshadow.rotz=25
Case 4: BrahSBshadow.rotz=20
Case 5: BrahSBshadow.rotz=15
Case 6: BrahSBshadow.rotz=0: me.timerenabled=0
end select
me.uservalue=me.uservalue+1
end sub
Sub SW100_Hit
GI11.Duration 1, 1000, 0
end sub
Sub SW101_Hit:Controller.Switch(55)=1:
PlaySound "ramp"
if sw46.ballcntover=1 and sw56.ballcntover=1 then
l47b.duration 2, 2000, 0
l47c.duration 2, 2000, 0
end if
end sub
Sub SW102_Hit
Llsling3.Duration 2, 500, 1
PlaySound "gull"
end sub
Sub SW103_Hit
GI9.Duration 2, 400, 1
PlaySound "drain1"
end sub
Sub SW104_Hit
Llsling2.Duration 2, 500, 1
end sub
'Targets
Sub sw43_Hit:vpmTimer.PulseSw (43):
PlaySound "target1"
End Sub
Sub sw53_Hit:vpmTimer.PulseSw (53):
PlaySound "target2"
End Sub
Sub sw63_Hit:vpmTimer.PulseSw (63):
PlaySound "target3"
End Sub
Sub sw44_Hit:vpmTimer.PulseSw (44):
PlaySound "target1"
End Sub
Sub sw54_Hit:vpmTimer.PulseSw (54):
PlaySound "target2"
End Sub
Sub sw64_Hit:vpmTimer.PulseSw (64):
PlaySound "target3"
End Sub
Sub sw73_Hit:vpmTimer.PulseSw (73):
PlaySound "Switch3"
End Sub
Sub SolKnocker(Enabled)
If Enabled Then PlaySound SoundFX("Knocker",DOFKnocker)
End Sub
'*****************************************
' Ramp and Drop Sounds
'*****************************************
Sub RedRampStart_Hit()
if Activeball.vely>0 then
PlaySoundAtBall "plasticroll"
else
PlaySoundAtBall "plasticroll1"
PlaySoundAtBall ""
end if
End Sub
Sub RedRampStop_Hit()
StopSound "plasticroll"
StopSound "plasticroll1"
StopSound "ramp"
End Sub
Sub RedRampStop1_Hit()
StopSound "plasticroll"
StopSound "plasticroll1"
vpmTimer.AddTimer 200, "BallDropSound(RedRampStop1)'"
End Sub
Sub BallDropSound(loc)
PlaySoundAt "BallDrop", loc
End Sub
Sub HotShotStart_Hit()
If Activeball.vely < 0 Then
PlaySoundAtBall "plasticroll2"
End If
End Sub
Sub HotShotStart_Unhit()
If Activeball.vely > 0 Then
StopSound "plasticroll2"
End If
End Sub
Sub HotShotStop_UnHit()
If Activeball.vely < 0 Then
GI1.Duration 2, 500, 1
StopSound "plasticroll2"
vpmTimer.AddTimer 200, "BallDropSound(HotShotStop)'"
End If
End Sub
'**********Rubber Animations
sub RslingA_hit
SlingA.visible=0
SlingA1.visible=1
me.uservalue=1
Me.timerenabled=1
end sub
sub RslingA_timer 'default 50 timer
select case me.uservalue
Case 1: SlingA1.visible=0: SlingA.visible=1
case 2: SlingA.visible=0: SlingA2.visible=1
Case 3: SlingA2.visible=0: SlingA.visible=1: Me.timerenabled=0
end Select
me.uservalue=me.uservalue+1
end sub
'**********Sling Shot Animations
' Rstep and Lstep are the variables that increment the animation
'****************
Dim RStep, Lstep, Tstep, URstep
Sub RightSlingShot_Slingshot
PlaySoundAt SoundFX("fx_slingshot",DOFContactors), slingR
DOF 202, DOFPulse
vpmtimer.PulseSw(32)
RSling.Visible = 0
RSling1.Visible = 1
slingR.objroty = -15
RStep = 0
RightSlingShot.TimerEnabled = 1
GI6.Duration 2, 300, 1
End Sub
Sub RightSlingShot_Timer
Select Case RStep
Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:slingR.objroty = -7
Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:slingR.objroty = 0:RightSlingShot.TimerEnabled = 0
End Select
RStep = RStep + 1
End Sub
Sub LeftSlingShot_Slingshot
PlaySoundAt SoundFX("fx_slingshot",DOFContactors), slingL
DOF 201, DOFPulse
vpmtimer.pulsesw(32)
LSling.Visible = 0
LSling1.Visible = 1
slingL.objroty = 15
LStep = 0
LeftSlingShot.TimerEnabled = 1
GI7.Duration 2, 300, 1
End Sub
Sub LeftSlingShot_Timer
Select Case LStep
Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:slingL.objroty = 7
Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:slingL.objroty=0:LeftSlingShot.TimerEnabled = 0
End Select
LStep = LStep + 1
End Sub
Sub TopSlingShot_Slingshot
PlaySoundAt SoundFX("fx_slingshot",DOFContactors), slingT
DOF 203, DOFPulse
vpmtimer.pulsesw(32)
Tsling.Visible = 0
Tsling1.Visible = 1
slingT.objroty = 15
TStep = 0
TopSlingShot.TimerEnabled = 1
Llsling4.Duration 2, 200, 1
End Sub
Sub TopSlingShot_Timer
Select Case TStep
Case 3:Tsling1.Visible = 0:Tsling2.Visible = 1:slingT.objroty = 7
Case 4:Tsling2.Visible = 0:Tsling.Visible = 1:slingT.objroty=0:TopSlingShot.TimerEnabled = 0
End Select
TStep = TStep + 1
End Sub
Sub URightSlingShot_Slingshot
PlaySoundAt SoundFX("fx_slingshot",DOFContactors), slingUR
DOF 204, DOFPulse
vpmtimer.PulseSw(32)
URSling.Visible = 0
URSling1.Visible = 1
slingUR.objroty = -15
URStep = 0
URightSlingShot.TimerEnabled = 1
Playsound "dolphin"
GI5.Duration 2, 300, 1
End Sub
Sub URightSlingShot_Timer
Select Case URStep
Case 3:URSLing1.Visible = 0:URSLing2.Visible = 1:slingUR.objroty = -7
Case 4:URSLing2.Visible = 0:URSLing.Visible = 1:slingUR.objroty = 0:URightSlingShot.TimerEnabled = 0
End Select
URStep = URStep + 1
End Sub
'*********************************************************************
' Positional Sound Playback Functions
'*********************************************************************
' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
End Sub
' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
Sub PlaySoundAt(soundname, tableobj)
PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
End Sub
Sub PlaySoundAtBall(soundname)
PlaySoundAt soundname, ActiveBall
End Sub
'*********************************************************************