-
Notifications
You must be signed in to change notification settings - Fork 37
/
Buccaneer (Gottlieb 1976) v1.00.vbs
1655 lines (1454 loc) · 44 KB
/
Buccaneer (Gottlieb 1976) v1.00.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
' -------------------------------------------------
' Buccaneer by Gottlieb (1976)
'
'
' Retheme of Jungle Princess by BorgDog, 2016
' Allknowing2012, Hauntfreaks
' DOF from Argrin
'
' Lane 1 Dividers set back to the Liberal settings
' SpinNSpot coded with the conservative settings
' Outlane posts set to the liberal settings
' 127 Credit Light
' 128 knocker
' 101,102 flippers
' 126 ballrelease
' -------------------------------------------------
Option Explicit
Randomize
' Thalamus 2018-07-19
' Added/Updated "Positional Sound Playback Functions" and "Supporting Ball & Sound Functions"
' Thalamus 2018-08-09 : 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 = 2 ' Bumpers volume.
Const VolGates = 1 ' Gates volume.
Const VolMetal = 1 ' Metals volume.
Const VolRH = 1 ' Rubber hits volume.
Const VolPo = 1 ' Rubber posts volume.
Const VolPi = 1 ' Rubber pins volume.
Const VolTarg = 1 ' Targets volume.
Const VolKick = 1 ' Kicker volume.
Const VolSpin = 1.5 ' Spinners volume.
Const VolFlip = 1 ' Flipper volume.
Const cGameName = "buccaneer"
Dim PI: PI = Round(4 * Atn(1), 6)
Dim operatormenu, options
Dim bumperlitscore, bumperoffscore
Dim balls, special, spstate
Dim replays, Replay1Table(3), Replay2Table(3), Replay3Table(3)
dim replay1, replay2, replay3
Dim Add10, Add100, Add1000, hisc
Dim maxplayers, players, player
Dim credit
Dim score(4)
Dim sreels(4)
Dim p100k(4)
Dim cplay(4)
Dim Pups(4)
Dim state, freeplay, pfLightState(13),LightState(13)
Dim tilt, tiltsens
Dim dw1step, dw2step, dw3step, dw4step, dw5step, dw6step, dw7step, dw8step, dw9step, dw10step
Dim ballinplay
Dim matchnumb
dim ballrenabled
Dim rep(4)
Dim eg
Dim bell
Dim a,i,j, ii, objekt, light, wheelno, spinnspot
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "Can't open controller.vbs"
On Error Goto 0
sub AllLampsOff
DIM x
For each light in lights:light.State = 0: Next
For each Light in YLights
Light.State=LightStateOff
Next
x=0
for each Light in WLights
LightState(x) = Light.State
Light.State=LightStateOff
x=x+1
Next
x=0
for each Light in pfLights
pfLightState(x) = Light.State
Light.State=LightStateOff
x=x+1
Next
End Sub
sub Buccaneer_init
LoadEM
maxplayers=1
Replay1Table(1)=90000
Replay2Table(1)=120000
Replay3Table(1)=160000
Replay1Table(2)=100000
Replay2Table(2)=130000
Replay3Table(2)=170000
Replay1Table(3)=120000
Replay2Table(3)=150000
Replay3Table(3)=190000
set sreels(1) = ScoreReel1
set Pups(1) = Pup1
set cplay(1) = CanPlay1
set p100k(1) = P1100k
hideoptions
player=1
spinnspot=0
For each light in BumperLights:light.State = 0: Next
AllLampsOff
loadhs
if hisc="" then hisc=90000
hstxt.text=hisc
gamov.text="Game Over"
gamov.timerenabled=1
tilttxt.timerenabled=1
credittxt.setvalue(credit)
if credit=0 then
DOF 127,0
else
DOF 127,1
end if
if balls="" then balls=5
if balls<>3 and balls<>5 then balls=5
if freeplay="" or freeplay<0 or freeplay>1 then freeplay=0
if replays="" then replays=1
if replays<>1 and replays<>2 and replays<>3 then replays=1
Replay1=Replay1Table(Replays)
Replay2=Replay2Table(Replays)
Replay3=Replay3Table(Replays)
RepCard.image = "ReplayCard"&replays
OptionBalls.image="OptionsBalls"&Balls
OptionReplays.image="OptionsReplays"&replays
OptionFreeplay.image="OptionsFreeplay"&freeplay
if balls=3 then
InstCard.image="InstCard3balls"
bumperlitscore=1000
bumperoffscore=100
else
InstCard.image="InstCard5balls"
bumperlitscore=100
bumperoffscore=10
end if
If B2SOn then
setBackglass.enabled=true
for each objekt in backdropstuff : objekt.visible = 0 : next
End If
if matchnumb="" then matchnumb=0
if matchnumb=0 then
matchtxt.text="00"
else
matchtxt.text=matchnumb
end if
for i = 1 to maxplayers
sreels(i).setvalue(score(i))
next
biptext.text=" "
PlaySound "motor"
tilt=false
If credit>0 then DOF 127, DOFOn
Drain.CreateBall
'Init Lights
a=int(rnd*10)
if a=10 then a=0
YLights(a).state=LightStateOn:wheelno=a
End sub
sub setBackglass_timer
Controller.B2ssetCredits Credit
Controller.B2ssetMatch 34, Matchnumb
Controller.B2SSetGameOver 35,1
Controller.B2SSetScorePlayer 5, hisc
Controller.B2SSetScorePlayer 1, score(1)
me.enabled=0
end Sub
sub gamov_timer
if state=false then
If B2SOn then Controller.B2SSetGameOver 35,0
gamov.text=""
gtimer.enabled=true
end if
gamov.timerenabled=0
end sub
sub gtimer_timer
if state=false then
If not B2SOn then gamov.text="Game Over"
If B2SOn then Controller.B2SSetGameOver 35,1
gamov.timerenabled=1
gamov.timerinterval= (INT (RND*10)+5)*100
end if
me.enabled=0
end sub
sub tilttxt_timer
if state=false then
tilttxt.visible=0
If B2SOn then Controller.B2SSetTilt 33,0
ttimer.enabled=true
end if
tilttxt.timerenabled=0
end sub
sub ttimer_timer
if state=false then
If Buccaneer.ShowDT then tilttxt.visible=1
If B2SOn then Controller.B2SSetTilt 33,1
tilttxt.timerinterval= (INT (RND*10)+5)*100
tilttxt.timerenabled=1
end if
me.enabled=0
end sub
Sub FlashBumpers
For each light in BumperLights:light.State = 0: Next
BumperLightT.enabled=True
End Sub
Sub BumperLightT_timer
BumperLightT.enabled=False
BumperLight2.state = Light1W.state
BumperLight1.state = Light4W.state
BumperLight3.state = Light5W.state
bumperlight4.state = LightStateON
bumperlight5.state = LightStateON
Bumperlighta4.state = bumperlight4.state
Bumperlighta5.state = bumperlight5.state
End Sub
Sub Buccaneer_KeyDown(ByVal keycode)
if keycode=AddCreditKey then
playsoundAtVol "coinin", drain, 1
coindelay.enabled=true
end if
if keycode=StartGameKey and (credit>0 or freeplay=1) and OperatorMenu=0 then
if state=false then
if freeplay=0 then credit=credit-1
if credit < 1 then DOF 127, DOFOff
playsound "cluper"
credittxt.setvalue(credit)
ballinplay=1
For each light in BumperLights:light.State = 0: Next
For each light in YellowBumperLights:light.State = 1: Next
for each light in GIlights:light.state=1:next
for each light in lights:light.state=1:next
for each light in wlights:light.state=0:next
If B2SOn Then
Controller.B2ssetCredits Credit
Controller.B2sStartAnimation "Startup"
Controller.B2ssetballinplay 32, Ballinplay
Controller.B2ssetplayerup 30, 1
Controller.B2ssetcanplay 31, 1
Controller.B2SSetGameOver 0
Controller.B2SSetScorePlayer 5, hisc
End If
pups(1).state=1
tilt=false
state=true
playsound "initialize"
players=1
cplay(players).state=1
newgame.enabled=true
else if state=true and players < maxplayers and Ballinplay=1 then
if freeplay=0 then credit=credit-1
if credt < 1 then DOF 127,DOFOff
players=players+1
cplay(players).state=1
credittxt.setvalue(credit)
If B2SOn then
Controller.B2ssetCredits Credit
Controller.B2ssetcanplay 31, players
End If
playsound "cluper"
end if
end if
end if
If keycode = PlungerKey Then
Plunger.PullBack
PlaySoundAtVol "fx_plungerpull", Plunger ,1
End If
If keycode=LeftFlipperKey and State = false and OperatorMenu=0 then
OperatorMenuTimer.Enabled = true
end if
If keycode=LeftFlipperKey and State = false and OperatorMenu=1 then
Options=Options+1
If Options=5 then Options=1
playsound "target"
Select Case (Options)
Case 1:
Option1.visible=true
Option4.visible=False
Case 2:
Option2.visible=true
Option1.visible=False
Case 3:
Option3.visible=true
Option2.visible=False
Case 4:
Option4.visible=true
Option3.visible=False
End Select
end if
If keycode=RightFlipperKey and State = false and OperatorMenu=1 then
PlaySound "metalhit2"
Select Case (Options)
Case 1:
if Balls=3 then
Balls=5
InstCard.image="InstCard5balls"
else
Balls=3
InstCard.image="InstCard3balls"
end if
OptionBalls.image = "OptionsBalls"&Balls
Case 2:
if freeplay=0 Then
freeplay=1
Else
freeplay=0
end if
OptionFreeplay.image="OptionsFreeplay"&freeplay
Case 3:
Replays=Replays+1
if Replays>3 then
Replays=1
end if
Replay1=Replay1Table(Replays)
Replay2=Replay2Table(Replays)
OptionReplays.image = "OptionsReplays"&replays
repcard.image = "ReplayCard"&replays
Case 4:
OperatorMenu=0
savehs
HideOptions
End Select
End If
if tilt=false and state=true then
If keycode = LeftFlipperKey Then
LeftFlipper.RotateToEnd
PlaySoundAtVol SoundFXDOF("flipperup",101,DOFOn,DOFContactors), LeftFlipper, VolFlip
PlaySoundAtVol "Buzz", LeftFlipper, VolFlip
End If
If keycode = RightFlipperKey Then
RightFlipper.RotateToEnd
PlaySoundAtVol SoundFXDOF("flipperup",102,DOFOn,DOFContactors), RightFlipper, VolFlip
PlaySoundAtVol "Buzz1", RightFlipper, VolFlip
End If
If keycode = LeftTiltKey Then
Nudge 90, 2
checktilt
End If
If keycode = RightTiltKey Then
Nudge 270, 2
checktilt
End If
If keycode = CenterTiltKey Then
Nudge 0, 2
checktilt
End If
If keycode = MechanicalTilt Then
LeftFlipper.RotateToStart
RightFlipper.RotateToStart
StopSound "Buzz"
StopSound "Buzz1"
Tilt=true
tilttxt.visible=1
End If
end if
End Sub
Sub OperatorMenuTimer_Timer
OperatorMenu=1
Displayoptions
Options=1
End Sub
Sub DisplayOptions
OptionsBack.visible = true
Option1.visible = True
OptionBalls.visible = True
OptionReplays.visible = True
OptionFreeplay.visible = True
End Sub
Sub HideOptions
for each objekt In OptionMenu
objekt.visible = false
next
End Sub
Sub Buccaneer_KeyUp(ByVal keycode)
If keycode = PlungerKey Then
Plunger.Fire
PlaySoundAtVol "plunger", Plunger, 1
End If
if keycode = LeftFlipperKey then
OperatorMenuTimer.Enabled = false
end if
If tilt=false and state=true then
If keycode = LeftFlipperKey Then
LeftFlipper.RotateToStart
LeftFlipper.TimerEnabled = 1 ' nFozzy Flipper Code
LeftFlipper.TimerInterval = 16
LeftFlipper.return = returnspeed * 0.5
PlaySoundAtVol SoundFXDOF("flipperdown",101,DOFOff,DOFContactors), LeftFlipper, VolFlip
StopSound "Buzz"
End If
If keycode = RightFlipperKey Then
RightFlipper.RotateToStart
Rightflipper.TimerEnabled = 1 ' nFozzy Flipper Code
Rightflipper.TimerInterval = 16
Rightflipper.return = returnspeed * 0.5
PlaySoundAtVol SoundFXDOF("flipperdown",102,DOFOff,DOFContactors), RightFlipper, VolFlip
StopSound "Buzz1"
End If
End if
End Sub
sub flippertimer_timer()
LFlip.RotY = LeftFlipper.CurrentAngle
RFlip.RotY = RightFlipper.CurrentAngle
Pgate.rotz = Gate.currentangle+25
end sub
Sub PairedlampTimer_timer
bumperlighta1.state = bumperlight1.state
bumperlighta2.state = bumperlight2.state
bumperlighta3.state = bumperlight3.state
bumperlighta4.state = bumperlight4.state
bumperlighta5.state = bumperlight5.state
end sub
sub coindelay_timer
addcredit
coindelay.enabled=false
end sub
Sub addcredit
credit=credit+1
DOF 127, DOFOn
if credit>15 then credit=15
credittxt.setvalue(credit)
If B2SOn Then Controller.B2ssetCredits Credit
End sub
Sub Drain_Hit()
DOF 130, DOFPulse
PlaySoundAtVol "drain", Drain, 1
for each light in GIlights:light.state=0:next
'for each light in lights:light.state=0:next
me.timerenabled=1
FlashBumpers()
tilt=false
tilttxt.visible=0
End Sub
Sub Drain_timer
me.timerenabled=0
nextball
End Sub
sub ballhome_hit
DOF 131, DOFOn
ballrenabled=1
end sub
sub ballhome_unhit
DOF 131, DOFOff
DOF 132, DOFPulse
end sub
sub ballrel_hit
if ballrenabled=1 then
ballrenabled=0
end if
end sub
sub newgame_timer
special=0
player=1
for i = 1 to maxplayers
sreels(i).resettozero
score(i)=0
rep(i)=0
pups(i).state=0
next
pups(1).state=1
If B2SOn then
for i = 1 to maxplayers
Controller.B2SSetScorePlayer i, score(i)
Controller.B2SSetScoreRollover 24 + i, 0
next
End If
eg=0
tilttxt.visible=0
gamov.text=" "
If B2SOn then
Controller.B2SSetGameOver 35,0
Controller.B2SSetTilt 33,0
Controller.B2SSetMatch 34,0
End If
biptext.text="1"
matchtxt.text=" "
newball
ballrelTimer.enabled=true
newgame.enabled=false
end sub
sub newball
spstate=0
bumper1.hashitevent=True
bumper2.hashitevent=True
bumper3.hashitevent=True
bumper4.hashitevent=True
bumper5.hashitevent=True
'For each light in BumperLights:light.State = 0: Next
'For each light in YellowBumperLights:light.State = 1: Next
for each light in GIlights:light.state=1:next
'for each light in lights:light.state=1:next
End Sub
sub nextball
if tilt=true then
tilt=false
tilttxt.visible=0
If B2SOn then
Controller.B2SSetTilt 33,0
Controller.B2ssetdata 1, 1
End If
end if
if player=1 then ballinplay=ballinplay+1
if ballinplay>balls then
playsound "GameOver"
eg=1
ballreltimer.enabled=true
else
if state=true then
newball
ballreltimer.enabled=true
end if
end if
End Sub
sub ballreltimer_timer
if eg=1 then
turnoff
matchnum
state=false
biptext.text=" "
gamov.text="GAME OVER"
gamov.timerenabled=1
tilttxt.timerenabled=1
for i=1 to maxplayers
cplay(i).state=0
if score(i)>hisc then hisc=score(i)
pups(i).state=0
next
hstxt.text=hisc
savehs
If B2SOn then
Controller.B2SSetGameOver 35,1
Controller.B2ssetballinplay 32, 0
Controller.B2sStartAnimation "EOGame"
Controller.B2SSetScorePlayer 5, hisc
'Controller.B2ssetcanplay 31, 0
'Controller.B2ssetcanplay 30, 0
End If
For each light in GIlights:light.state=0:next
else
Drain.kick 60,38,0
biptext.text=ballinplay
If B2SOn then Controller.B2ssetballinplay 32, Ballinplay
ballreltimer.enabled=false
playsoundAtVol SoundFXDOF("kickerkick",126,DOFPulse,DOFContactors), Drain, 1
playsoundAtVol "kickerkick", Drain, 1
end if
ballreltimer.enabled=false
end sub
sub matchnum
matchnumb=(INT (RND*10))*10
if matchnumb=0 then
matchtxt.text="00"
else
matchtxt.text=matchnumb
end if
If B2SOn then Controller.B2SSetMatch 34,Matchnumb
For i=1 to players
if (matchnumb)=(score(i) mod 100) then
addcredit
playsound SoundFXDOF("knock",128,DOFPulse,DOFKnocker)
end if
next
end sub
'********** Bumpers
Sub Bumper1_Hit
if tilt=false then
playsoundAtVol SoundFXDOF("fx_bumper4",105,DOFPulse,DOFContactors), Bumper1, VolBump
if BumperLight1.state=1 then
addscore (bumperlitscore)
else
addscore (bumperoffscore)
end if
me.timerenabled=1
end if
End Sub
Sub Bumper1_timer
BumperTimerRing1.Enabled=0
if bumperring1.transz>-36 then BumperRing1.transz=BumperRing1.transz-4
if BumperRing1.transz=-36 then
BumperTimerRing1.enabled=1
me.timerenabled=0
end if
End Sub
Sub BumperTimerRing1_timer
if bumperring1.transz<0 then BumperRing1.transz=BumperRing1.transz+4
If BumperRing1.transz=0 then BumperTimerRing1.enabled=0
End sub
Sub Bumper2_Hit
if tilt=false then
playsoundAtVol SoundFXDOF("fx_bumper4",106,DOFPulse,DOFContactors), Bumper2, VolBump
if BumperLight2.state=1 then
addscore 1000 'Center Red Bumper
else
addscore 10 ' only 10 pts for 5 ball
end if
me.timerenabled=1
end if
End Sub
Sub Bumper2_timer
BumperTimerRing2.enabled=0
if BumperRing2.transz>-36 then BumperRing2.transz=BumperRing2.transz-4
if BumperRing2.transz=-36 then
BumperTimerRing2.enabled=1
me.timerenabled=0
end if
End Sub
Sub BumperTimerRing2_timer
if BumperRing2.transz<0 then BumperRing2.transz=BumperRing2.transz+4
If BumperRing2.transz=0 then BumperTimerRing2.enabled=0
End sub
Sub Bumper3_Hit
if tilt=false then
playsoundAtVol SoundFXDOF("fx_bumper4",107,DOFPulse,DOFContactors), Bumper3, VolBump
if BumperLight3.state=1 then
addscore (bumperlitscore)
else
addscore (bumperoffscore)
end if
me.timerenabled=1
end if
End Sub
Sub Bumper3_timer
BumperTimerRing3.enabled=0
if bumperring3.transz>-36 then BumperRing3.transz=BumperRing3.transz-4
if BumperRing3.transz=-36 then
BumperTimerRing3.enabled=1
me.timerenabled=0
end if
End Sub
Sub BumperTimerRing3_timer
if bumperring3.transz<0 then BumperRing3.transz=BumperRing3.transz+4
If BumperRing3.transz=0 then BumperTimerRing3.enabled=0
End sub
Sub Bumper4_Hit
if tilt=false then
playsoundAtVol SoundFXDOF("fx_bumper4",108,DOFPulse,DOFContactors), Bumper4, VolBump
if balls = 3 then
addscore 1000
else
addscore 100
end if
me.timerenabled=1
end if
End Sub
Sub Bumper4_timer
BumperTimerRing4.enabled=0
if bumperring4.transz>-36 then BumperRing4.transz=BumperRing4.transz-4
if BumperRing4.transz=-36 then
BumperTimerRing4.enabled=1
me.timerenabled=0
end if
End Sub
Sub BumperTimerRing4_timer
if bumperring4.transz<0 then BumperRing4.transz=BumperRing4.transz+4
If BumperRing4.transz=0 then BumperTimerRing4.enabled=0
End sub
Sub Bumper5_timer
BumperTimerRing5.enabled=0
if bumperring5.transz>-36 then BumperRing5.transz=BumperRing5.transz-4
if BumperRing5.transz=-36 then
BumperTimerRing5.enabled=1
me.timerenabled=0
end if
End Sub
Sub Bumper5_Hit
if tilt=false then
playsoundAtVol SoundFXDOF("fx_bumper4",109,DOFPulse,DOFContactors), Bumper5, VolBump
if balls = 3 then
addscore 1000
else
addscore 100
end if
me.timerenabled=1
end if
End Sub
Sub BumperTimerRing5_timer
if bumperring5.transz<0 then BumperRing5.transz=BumperRing5.transz+4
If BumperRing5.transz=0 then BumperTimerRing5.enabled=0
End sub
'****************************************
' CIRCLE TARGETS HANDLERS
'****************************************
Sub ctarget1_Hit()
DOF 125, DOFPulse
If Not Tilt Then
addscore(500)
End if
ChkSpinNSpot()
End Sub
Sub ctarget2_hit()
DOF 124, DOFPulse
If Not Tilt Then
addscore(500)
End if
ChkSpinNSpot()
End Sub
' SpinnerRod code from Cyperpez and http://www.vpforums.org/index.php?showtopic=35497
Sub CheckSpinnerRod_timer()
SpinnerRod.TransZ = sin( (spinner1.CurrentAngle+180) * (2*PI/360)) * 5
SpinnerRod.TransX = -1*(sin( (spinner1.CurrentAngle- 90) * (2*PI/360)) * 5)
End Sub
Sub ChkSpinNSpot ' light spin-n-spot every 3rd rollover or circletarget
if not Tilt then
spinnspot=spinnspot+1
if spinnspot > 2 then spinnspot=0
' if spinnspot = 0 or spinnspot=1 or spinnspot=2 then ' Liberal toughness
' if spinnspot = 0 or spinnspot=1 then ' Medium toughness
if spinnspot=0 then ' Conservative toughness
if spstate=0 then ' if Special is lit we dont need spinNspot
lightSpinner.state=LightStateOn
end if
else
lightSpinner.state=LightStateOff
end if
if spstate=0 then ' No Special Lit yet
if light1w.state=1 and light2w.state=1 and light3w.state=1 and light4w.state=1 and light5w.state=1 then
if light6w.state=1 and light7w.state=1 and light8w.state=1 and light9w.state=1 and light10w.state=1 And light11w.state=1 Then
spstate=1
lightSpinner.state=LightStateOff
CheckSpecial()
end If
end if
Else
CheckSpecial() 'Move Special around
end if
end if
End Sub
'****************************************
' SPINNERS HANDLERS
'****************************************
Sub Spinner1_Spin()
If Not Tilt Then
addscore(100)
Spin
Spinner1.TimerInterval = 1000
Spinner1.Timerenabled=false:Spinner1.Timerenabled=true ' reset timer and start the clock again
End if
End Sub
Sub Spinner1_Timer
Spinner1.Timerenabled=false
if lightSpinner.state=1 and light2y.state=1 and light2.state=1 then light2.state=0:light2w.state=1:ChkSpinNSpot():addscore(5000)
if lightSpinner.state=1 and light3y.state=1 and light3.state=1 then light3.state=0:light3w.state=1:ChkSpinNSpot():addscore(5000)
if lightSpinner.state=1 and light4y.state=1 and light4.state=1 then light4.state=0:light4w.state=1:light4b.state=0:ChkSpinNSpot():addscore(5000)
if lightSpinner.state=1 and light5y.state=1 and light5.state=1 then light5.state=0:light5w.state=1:light5b.state=0:ChkSpinNSpot():addscore(5000)
if lightSpinner.state=1 and light6y.state=1 and light6.state=1 then light6.state=0:light6w.state=1:ChkSpinNSpot():addscore(5000)
if lightSpinner.state=1 and light7y.state=1 and light7.state=1 then light7.state=0:light7w.state=1:ChkSpinNSpot():addscore(5000)
if lightSpinner.state=1 and light8y.state=1 and light8.state=1 then light8.state=0:light8w.state=1:ChkSpinNSpot():addscore(5000)
if lightSpinner.state=1 and light9y.state=1 and light9.state=1 then light9.state=0:light9w.state=1:ChkSpinNSpot():addscore(5000)
if lightSpinner.state=1 and light10y.state=1 and light10.state=1 then light10.state=0:light10w.state=1:ChkSpinNSpot():addscore(5000)
if lightSpinner.state=1 and light11y.state=1 and light11.state=1 then light11.state=0:light11w.state=1:ChkSpinNSpot():addscore(5000)
if lightSpinner.state=LightStateOn then lightSpinner.state=LightStateOff
End Sub
Sub Spin
If Not Tilt Then
YLights(wheelno).state=LightStateOff
wheelno = wheelno +1
if wheelno=10 then wheelno=0 ' 0-10 for ChkSpinNSpot 2-11
YLights(wheelno).state=LightStateOn
End if
End Sub
'************** Dingwalls
sub Dingwalls_hit(idx)
addscore 10
end Sub
Sub CheckSpecial()
if spstate=1 Then
for each light in Lspecial:light.state=0:Next
Lspecial(special).state=1
end if
end sub
sub dingwall1_hit
rdw1.visible=0
RDW1a.visible=1
dw1step=1
Me.timerenabled=1
end sub
sub dingwall1_timer
select case dw1step
Case 1: RDW1a.visible=0: rdw1.visible=1
case 2: rdw1.visible=0: rdw1b.visible=1
Case 3: rdw1b.visible=0: rdw1.visible=1: Me.timerenabled=0
end Select
dw1step=dw1step+1
end sub
sub dingwall2_hit
rdw2.visible=0
RDW2a.visible=1
dw2step=1
Me.timerenabled=1
end sub
sub dingwall2_timer
select case dw2step
Case 1: RDW2a.visible=0: rdw2.visible=1
case 2: rdw2.visible=0: rdw2b.visible=1
Case 3: rdw2b.visible=0: rdw2.visible=1: me.timerenabled=0
end Select
dw2step=dw2step+1
end sub
sub dingwall3_hit
Rdw3.visible=0
RDW3a.visible=1
dw3step=1
Me.timerenabled=1
end sub
sub dingwall3_timer
select case dw3step
Case 1: RDW3a.visible=0: Rdw3.visible=1
case 2: Rdw3.visible=0: rdw3b.visible=1
Case 3: rdw3b.visible=0: Rdw3.visible=1: me.timerenabled=0
end Select
dw3step=dw3step+1
end sub
sub dingwall4_hit
Rdw4.visible=0
RDW4a.visible=1
dw4step=1
Me.timerenabled=1
end sub
sub dingwall4_timer
select case dw4step
Case 1: RDW4a.visible=0: Rdw4.visible=1
case 2: Rdw4.visible=0: rdw4b.visible=1
Case 3: rdw4b.visible=0: Rdw4.visible=1: me.timerenabled=0
end Select
dw4step=dw4step+1
end sub
'**********Sling Shot Animations
' Rstep and Lstep are the variables that increment the animation
'****************
Dim RStep, Lstep
Sub RightSlingShot_Slingshot
addscore 10
playsoundAtVol SoundFXDOF("right_slingshot",104,DOFPulse,DOFContactors), sling1, 1
RSling.Visible = 0
RSling1.Visible = 1
sling1.TransZ = -10
RStep = 0
RightSlingShot.TimerEnabled = 1
lgi17.state=0:lgi18.state=0
End Sub
Sub RightSlingShot_Timer
Select Case RStep
Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -20
Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0:lgi17.state=1:lgi18.state=1
End Select
RStep = RStep + 1
End Sub
Sub LeftSlingShot_Slingshot
addscore 10
playsoundAtVol SoundFXDOF("left_slingshot",103,DOFPulse,DOFContactors), sling2, 1
LSling.Visible = 0
LSling1.Visible = 1
sling2.TransZ = -10
LStep = 0
LeftSlingShot.TimerEnabled = 1
lgi15.state=0:lgi16.state=0
End Sub
Sub LeftSlingShot_Timer
Select Case LStep
Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -20
Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0:lgi16.state=1:lgi16.state=1
End Select
LStep = LStep + 1
End Sub
Sub LeftSlingshot_Init
LSling1.Visible = 0:LSling2.Visible = 0: Sling2.TransZ = 0
End Sub
Sub RightSlingshot_Init
RSling1.Visible = 0:RSling2.Visible = 0: Sling1.TransZ = 0
End Sub
'********** Triggers
sub trigger1_hit
DOF 112, DOFPulse
if not tilt Then
if light1.state=0 then
addscore 5000 ' always 5000
else
addscore 5000
light1.state=0:light1w.state=1
BumperLight2.state=1
end if
FlashBumpers()
ChkSpinNSpot()
end if
end sub