-
Notifications
You must be signed in to change notification settings - Fork 37
/
Capersville (Bally 1966) 3.2.7.vbs
2361 lines (2136 loc) · 71.5 KB
/
Capersville (Bally 1966) 3.2.7.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
'****************************************************************
'
' Capersville (Bally 1966)
' by Scottacus
' September 2017
' Revision October 2017
'
' Thanks to:
' HauntFreaks for the excellent graphics work
' BorgDog for the stripped down Gottlieb EM 4 player VPX table
' Xenonph for his many hours of testing
' Loserman76 for his coding help
' Arngrim for his help with DOF
'
' Basic DOF config
' 101 Left Flipper, 102 Right Flipper
' 103 Bumper1, 104 bumper2, 105 Bumper3
' 106 Left sling, 107 right sling
' 108 Knocker
' 109 Ball Release
' 110 Right Kicker, 111 Left Kicker
' 112 Ball In Shooter Lane
' 113 CodeZapper Kicker
' 114-116 Yellow Mushrooms
' 117-119 Blue, White & Red Mushrooms
' 121-124 Deep4Caper Capture spaces
' 140 DC4 Gate Lock
' 141 Left OutLane, 142 Right OutLane
' 143 Drain
' 150 credit light, 151 knocker Flasher, 152 Zip Flippers
' 153 Chime1-10s, 154 Chime2-100s, 155 Chime3-1000s
' 160 Left Saucer, 161 Right Saucer
'************************************************ Code Flow ***********************************************************
' EndGame
' ^
' Start Game -> New Game -> Check Continue -> Release Ball -> Drain -> Score Bouns -> Advance Player -> Next Ball
' | |
' -------------------------------------------------------------------------
'**********************************************************************************************************************
' Ball Control Subroutine developed by: rothbauerw
' Press "c" during play to activate, the arrow keys control the ball
'******************************************************************************
' Thalamus 2018-07-19
' Added/Updated "Positional Sound Playback Functions" and "Supporting Ball & Sound Functions"
' No special SSF tweaks yet.
Option Explicit
Randomize
' 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 = "Capersville"
Const Ballsize = 50 'used by ball shadow routine
Dim Balls
Dim Replays
Dim Add1, Add10, Add100, Add1000
Dim HiSc
Dim MaxPlayers
Dim Players
Dim Player
Dim Credit
Dim Score(6)
Dim SReels(6)
Dim State
Dim Tilt
Dim TiltSens
Dim Target(9)
Dim BallinPlay
Dim MatchNumber
dim BallREnabled
dim RStep, LStep
Dim Rep(4)
Dim Rst
Dim EndGame
Dim Bell
Dim i,j, f, ii, Object, Light, x, y
Dim AwardCheck
Dim BStop, DC4Stop(4)
Dim Mush
Dim FreePlay
Dim SeaRay
Dim SeaRayBonus(4)
Dim CodeZapper
Dim DC4
Dim DC4Stage
Dim BallInLane
Dim SaucerCapture
Dim CapturedBalls
Dim DCCapturedBall
Dim BallMass
Dim BallHomeCheck
Dim Button
Dim CodeZapperValue
Dim HSArray, HSiArray
Dim Shift
Dim Launched
Dim CZLaunched
Dim STAT
Dim RelGateHit
Dim CodeZapperGateHit
Dim HSInitial0, HSInitial1, HSInitial2
Dim EnableInitialEntry
Dim HSi,HSx
Dim RoundHS, RoundHSPlayer
Dim BellRing
Dim ShowBallShadow
Dim ScoreMil, Score100K, Score10K, ScoreK, Score100, Score10, ScoreUnit
HSiArray = Array("HSi_0","HSi_1","HSi_2","HSi_3","HSi_4","HSi_5","HSi_6","HSi_7","HSi_8","HSi_9","HSi_10","HSi_11","HSi_12","HSi_13","HSi_14","HSi_15","HSi_16","HSi_17","HSi_18","HSi_19","HSi_20","HSi_21","HSi_22","HSi_23","HSi_24","HSi_25","HSi_26")
HSArray = Array("HS_0","HS_1","HS_2","HS_3","HS_4","HS_5","HS_6","HS_7","HS_8","HS_9","HS_Space","HS_Comma")
BallMass = (Ballsize^3)/125000
Dim BIP
Dim Options
Dim HSUx
Dim ReplayEB
Dim Chime
Dim Language
Dim Lang
Dim STATx
Dim FirstBallLaunched
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "Can't open controller.vbs"
On Error Goto 0
Sub Table1_init
LoadEM
MaxPlayers=4
Replay(1)= 5800 'Set Value
Replay(2)= 7200 'Set Value
Replay(3)= 8700 'Set Value
SeaRay = 23
Balls = 5
Set SReels(1) = ScoreReel1
Set SReels(2) = ScoreReel2
Set SReels(3) = ScoreReel3
Set SReels(4) = ScoreReel4
Player = 1
LoadHighScore
'**** Uncomment these lines, run the table then recomment these lines ****
'************** to reset the high scores to lower values *****************
' For HSUx = 0 to 4
' HighScore(HSUx) = 2002 - (HSUx*2)
' Score(HSUx) = 0
' Next
'*************************************************************************
If HighScore(0)="" Then HighScore(0)=4500
If HighScore(1)="" Then HighScore(1)=4000
If HighScore(2)="" Then HighScore(2)=3500
If HighScore(3)="" Then HighScore(3)=3000
If HighScore(4)="" Then HighScore(4)=2500
If Initial(0,1) = "" Then
Initial(0,1) = 19: Initial(0,2) = 5: Initial(0,3) = 13
Initial(1,1) = 1: Initial(1,2) = 1: Initial(1,3) = 1
Initial(2,1) = 2: Initial(2,2) = 2: Initial(2,3) = 2
Initial(3,1) = 3: Initial(3,2) = 3: Initial(3,3) = 3
Initial(4,1) = 4: Initial(4,2) = 4: Initial(4,3) = 4
End If
If Credit = "" Then Credit = 0
If FreePlay = "" Then FreePlay = 1
If Balls = "" Then Balls = 5
If ReplayEB = "" Then ReplayEB = 1
If ShowBallShadow = "" Then ShowBallShadow = 1
If Chime ="" Then Chime = 0
If STAT = "" Then STAT = 0
If Language = "" Then Language = 0
If MatchNumber = "" Then MatchNumber = 10
SaveHS
hstxt.text = HiSc
UpdatePostIt
If Language = 0 Then
tilttxt.text = "TILT"
For i = 1 to 4
EVAL("Player" & i).text = "Player " & i
EVAL("SeaRayTxt" & i).text = "SEA RAY"
Next
Credits.text = "Credits"
CanPlay.text = "Can Play"
BallnPlay.text ="Ball in Play"
CodeZapperBox.text = "CODE ZAPPER"
Else
tilttxt.text = "GEKIPPT!"
For i = 1 to 4
EVAL("Player" & i).text = i & " Spieler"
EVAL("SeaRayTxt" & i).text = "EXTRA-BONUS"
Next
Credits.text = "Kredite"
CanPlay.text = "Kann Spielen"
BallnPlay.text ="Kugel im Spiel"
CodeZapperBox.text = "CODE-RAD"
End If
biptext.text = "0"
Matchtxt.text = MatchNumber
credittxt.text = Credit
CodeZapperValue = 100
CodeZapperTxt.text = CodeZapperValue
BIP = 0
For x = 1 to 4
Score(x) = 0
Next
If Language = 0 Then
Playfield2.visible = False
wapron.image = "Apron1"
For Lang = 24 to 29
EVAL("Light" & Lang).image = "Capersville Slide"
Next
Else
Playfield2.visible = True
wapron.image = "Apron2"
For Lang = 24 to 29
EVAL("Light" & Lang).image = "Capersville German"
Next
End If
If ShowBallShadow = 1 Then
BallShadowUpdate.enabled = True
Else
BallShadowUpdate.enabled = False
End If
If B2SOn Then
Controller.B2SSetCredits Credit
Controller.B2SSetMatch 34, MatchNumber
Controller.B2SSetData 35 + Language,1
Controller.B2SSetData 33 + Language ,1
Controller.B2SSetBallInPlay 32,0
Controller.B2SSetData 30 + Language,0
Controller.B2SSetData 50 + Language, 1
End If
If ShowDT = True Then
For each object in backdropstuff
Object.visible = 1
Next
End If
If ShowDt = False Then
For each object in backdropstuff
Object.visible = 0
Next
End If
For i = 1 to MaxPlayers
SReels(i).setvalue(score(i))
Next
PlaySound "motor"
Tilt = False
State = False
GameState
DC4 = 0
SaucerCapture = 0
CodeZapper = 1
BlockDC4Gate.isdropped = True
If FreePlay = 0 Then
CoinCard.image = Language & "FreeCoin" & Balls & "Ball0"
Else
CoinCard.image = Language & "FreeCoin" & Balls & "Ball1"
End If
If ReplayEB = 0 Then
InstructCard.image = "InstructionCardReplay" & Language
Else
InstructCard.image = "InstructionCardEB" & Language
End If
If STAT = 1 Then
For STATx = 1 to 3
EVAL ("BumperCap10pt" & STATx).visible = True
EVAL ("BumperCap" & STATx).visible = False
Next
Else
For STATx = 1 to 3
EVAL ("BumperCap10pt" & STATx).visible = False
EVAL ("BumperCap" & STATx).visible = True
Next
End If
'***********Trough Ball Creation
TroughSlot1.CreateSizedBallWithMass Ballsize/2, BallMass
TroughSlot2.CreateSizedBallWithMass Ballsize/2, BallMass
TroughSlot3.CreateSizedBallWithMass Ballsize/2, BallMass
End Sub
'***********KeyCodes
Sub Table1_KeyDown(ByVal keycode)
If EnableInitialEntry = True Then EnterIntitals(keycode)
If keycode=AddCreditKey Then
PlaySoundAtVol "coinin", drain, 1
coindelay.enabled=True
End If
If keycode=StartGameKey Then
If EnableInitialEntry = False and OperatorMenu = 0 Then
If FreePlay = 1 Then StartGame
If FreePlay = 0 and Credit > 0 and Players < MaxPlayers and FirstBallLaunched = False Then
If Credit < 1 Then DOF 150, DOFOff
Credit = Credit - 1
CreditTxt.text = Credit
If B2SOn Then Controller.B2SSetCredits Credit
StartGame
End If
End If
End If
If keycode = PlungerKey Then
Plunger.PullBack
PlaySoundAtVol "plungerpull", Plunger, 1
End If
If Tilt = False and State = True Then
If keycode = LeftFlipperKey Then
LeftFlipper.RotateToEnd
LeftFlipper1.RotateToEnd
PlaySoundAtVol SoundFXDOF("flipperup",101,DOFOn,DOFContactors), LeftFlipper, VolFlip
PlaySoundAtVol "Buzz", LeftFlipper, VolFlip
End If
If keycode = RightFlipperKey Then
RightFlipper.RotateToEnd
RightFlipper1.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
End If
If keycode = LeftFlipperKey and State = False and OperatorMenu = 0 and EnableInitialEntry = 0 Then
OperatorMenuTimer.Enabled = true
End If
If keycode = LeftFlipperKey and State = False and OperatorMenu = 1 Then
Options = Options + 1
If Options = 8 then Options = 0
TextBox1.text = options
OptionMenu.visible = true
playsound "target"
Select Case (Options)
Case 0:
OptionMenu.image = "FreeCoin" & FreePlay
Case 1:
OptionMenu.image = "BallNumber" & Balls
Case 2:
OptionMenu.image = "ReplayEB" & ReplayEB
Case 3:
OptionMenu.image = "BallShadowOption" & ShowBallShadow
Case 4:
OptionMenu.image = "Chime" & Chime
Case 5:
OptionMenu.image = "Caps" & STAT
Case 6:
OptionMenu.image = "Playfield" & Language
Case 7:
OptionMenu.image = "SaveExit"
End Select
End If
If keycode = RightFlipperKey and State = False and OperatorMenu = 1 Then
PlaySound "metalhit2"
Select Case (Options)
Case 0:
If FreePlay = 0 Then
FreePlay = 1
Else
FreePlay = 0
End If
OptionMenu.image= "FreeCoin" & FreePlay
If FreePlay = 0 Then
CoinCard.image = Language & "FreeCoin" & Balls & "Ball0"
Else
CoinCard.image = Language & "FreeCoin" & Balls & "Ball1"
End If
Case 1:
If Balls = 3 Then
Balls = 5
Else
Balls = 3
End If
OptionMenu.image = "BallNumber" & Balls
If FreePlay = 0 Then
CoinCard.image = Language & "FreeCoin" & Balls & "Ball0"
Else
CoinCard.image = Language & "FreeCoin" & Balls & "Ball1"
End If
Case 2:
If ReplayEB = 0 Then
ReplayEB = 1
InstructCard.image = "InstructionCardEB" & Language
Else
ReplayEB = 0
InstructCard.image = "InstructionCardReplay" & Language
End If
OptionMenu.image = "ReplayEB" & ReplayEB
Case 3:
If ShowBallShadow = 0 Then
ShowBallShadow = 1
Else
ShowBallShadow = 0
End If
OptionMenu.image = "BallShadowOption" & ShowBallShadow
If ShowBallShadow = 1 Then
BallShadowUpdate.enabled = True
Else
BallShadowUpdate.enabled = False
End If
Case 4:
If Chime = 0 Then
Chime= 1
If B2SOn Then DOF 155,DOFPulse
Else
Chime = 0
Playsound "Bell10"
End If
OptionMenu.image = "Chime" & Chime
Case 5:
If STAT = 0 Then
STAT = 1
Else
STAT = 0
End If
If STAT = 1 Then
For STATx = 1 to 3
EVAL ("BumperCap10pt" & STATx).visible = True
EVAL ("BumperCap" & STATx).visible = False
Next
Else
For STATx = 1 to 3
EVAL ("BumperCap10pt" & STATx).visible = False
EVAL ("BumperCap" & STATx).visible = True
Next
End If
OptionMenu.image = "Caps" & STAT
Case 6:
If Language = 0 Then
Language = 10
Playfield2.visible = True
Wapron.image = "Apron2"
For Lang = 24 to 29
EVAL("Light" & Lang).image = "Capersville German"
Next
CoinCard.image = Language & "FreeCoin" & Balls & "Ball" & FreePlay
InstructCard.image = "InstructionCardEB" & Language
If B2SOn Then
Controller.B2SSetData 50,0
Controller.B2SSetData 60,1
Controller.B2SSetTilt 33, 0
Controller.B2SSetTilt 43, 1
Controller.B2SSetGameOver 45, 1
Controller.B2SSetGameOver 35, 0
End If
tilttxt.text = "GEKIPPT!"
For i = 1 to 4
EVAL("Player" & i).text = i & " Spieler"
EVAL("SeaRayTxt" & i).text = "EXTRA-BONUS"
Next
Credits.text = "Kredite"
CanPlay.text = "Kann Spielen"
BallnPlay.text ="Kugel im Spiel"
CodeZapperBox.text = "CODE-RAD"
gamov.text = "SPIEL AUS!"
Else
Language = 0
Playfield2.visible = False
Wapron.image = "Apron1"
For Lang = 24 to 29
EVAL("Light" & Lang).image = "Capersville Slide"
Next
CoinCard.image = Language & "FreeCoin" & Balls & "Ball" & FreePlay
InstructCard.image = "InstructionCardEB" & Language
If B2SOn Then
Controller.B2SSetData 50,1
Controller.B2SSetData 60,0
Controller.B2SSetTilt 33, 1
Controller.B2SSetTilt 43, 0
Controller.B2SSetGameOver 45, 0
Controller.B2SSetGameOver 35, 1
End If
tilttxt.text = "TILT"
For i = 1 to 4
EVAL("Player" & i).text = "Player " & i
EVAL("SeaRayTxt" & i).text = "SEA RAY"
Next
Credits.text = "Credits"
CanPlay.text = "Can Play"
BallnPlay.text ="Ball in Play"
CodeZapperBox.text = "CODE ZAPPER"
gamov.text = "GAME OVER"
End If
OptionMenu.image = "Playfield" & Language
Case 7:
OperatorMenu = 0
SaveHS
DynamicUpdatePostIt.enabled = 1
OptionMenu.image = "FreeCoin" & FreePlay
OptionMenu.visible = 0
OptionsMenu.visible = 0
End Select
TextBox1.text = options
End If
If Keycode = MechanicalTilt Then
Tilt = True
If Language = 0 Then
Tilttxt.text = "TILT"
Else
Tilttxt.text = "GEKIPPT!"
End If
If B2SOn Then Controller.B2SSetTilt 33 + Language, 1
Playsound"Tilt"
UnZipFlippers
If SaucerCapture = True Then
BIP = BIP + CapturedBalls
SaucerCapture = False
BlockDC4Gate.isdropped = True
metal_uppergate.rotz = 0
DC4Light.state = 0
If B2SOn Then
DOF 160, DOFOff
DOF 161, DOFOff
End If
End If
TurnOff
End If
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 Cleft = 1' Left Arrow
If keycode = 200 Then Cup = 1' Up Arrow
If keycode = 208 Then Cdown = 1' Down Arrow
If keycode = 205 Then Cright = 1' Right Arrow
'************************Start Of Test Keys****************************
' If keycode = 30 Then
' DynamicUpdatePostIt.enabled = 0
' Score(1) = 1999
' Position(1) = 2
' Score(2) = 1997
' Position(2) = 1
' EndGame = 1
' CheckContinue.enabled = 1
' End If
' If keycode = 35 Then WhiteMushroom
' If keycode = 31 Then UnZipFlippers
'************************End Of Test Keys****************************
End Sub
Sub Table1_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
LeftFlipper1.RotateToStart
PlaySoundAtVol SoundFXDOF("flipperdown",101,DOFOff,DOFContactors), LeftFlipper, VolFlip
StopSound "Buzz"
End If
If keycode = RightFlipperKey Then
RightFlipper.RotateToStart
RightFlipper1.RotateToStart
PlaySoundAtVol SoundFXDOF("flipperdown",102,DOFOff,DOFContactors), RightFlipper, VolFlip
StopSound "Buzz1"
End If
End if
If keycode = 203 then Cleft = 0' Left Arrow
If keycode = 200 then Cup = 0' Up Arrow
If keycode = 208 then Cdown = 0' Down Arrow
If keycode = 205 then Cright = 0' Right Arrow
End Sub
Sub FlipperTimer_timer()
LFlip.RotY = LeftFlipper.CurrentAngle + 90
RFlip.RotY = RightFlipper.CurrentAngle +90
LFlip1.RotY = LeftFlipper.CurrentAngle + 60
RFlip1.RotY = RightFlipper.CurrentAngle + 120
End Sub
'***********Operator Menu
Dim operatormenu
Sub OperatorMenuTimer_Timer
Options = 0
OperatorMenu = 1
Displayoptions
End Sub
Sub DisplayOptions
DynamicUpdatePostIt.enabled = 0
UpdatePostIt
Options = 0
OptionsMenu.visible = True
OptionMenu.visible = True
OptionMenu.image = "FreeCoin" & FreePlay
End Sub
'***********Start Game
Sub StartGame
If State = False Then
BallinPlay = 1
If B2SOn Then
Controller.B2SSetCredits Credit
Controller.B2SSetData 49, 1
Controller.B2SSetBallinPlay 32, Ballinplay
Controller.B2SSetPlayerup 30 + Language, 1
Controller.B2SSetData 31, 1
Controller.B2SSetGameOver 35 + Language, 0
Controller.B2SSetData 55 + Language, 1
' Controller.B2SStopAnimation "Capersville Logo"
End If
Tilt = False
State = True
GameState
DynamicUpdatePostIt.enabled = 0
UpdatePostIt
PlaySound "initialize"
Players = 1
CanPlayTxt.text = Players
CodeZapperTxt.text = CodeZapperValue
CodeZapperBlock.isdropped = False
DC4Text.text = DC4
SaucerText.text = SaucerCapture
For x = 1 to 4
Score(x) = 0
If B2SOn Then controller.B2SSetScorePlayer x, Score(x)
SReels(x).setvalue(0)
Next
If B2SOn Then controller.B2SSetScorePlayer 6, 0 'CodeZapper Reels
Rst=0
NewGame.enabled = True
Else If State = True and Players < MaxPlayers and BallinPlay = 1 Then
Players = Players + 1
CanPlayTxt.text = Players
CreditTxt.text = Credit
If B2SOn Then
Controller.B2SSetCredits Credit
Controller.B2SSetData 31, Players
End If
Playsound "cluper"
End If
End If
End Sub
'***************New Game
Sub NewGame_timer
Player = 1
For i = 1 to MaxPlayers
Score(i) = 0
Rep(i) = 0
Next
If B2SOn Then
For i = 1 to MaxPlayers
Controller.B2SSetScorePlayer i, score(i)
Next
End If
EndGame = 0
UnZipFlippers
ShootAgainLight.state = 0
GameState
CheckContinue.enabled = True
NewGame.enabled = False
For f = 1 to 3
EVAL("Bumper"&f).hashitevent = 1
Next
For i = 1 to 4
SeaRayBonus(i) = 0
EVAL("SeaRayBonusTxt"&i).text = SeaRayBonus(i)
Next
If B2SOn Then Controller.B2SSetScorePlayer 6, 0 'SeaRay Reels are Player 6
ResetSeaRay.enabled = True
CodeZapperBlock.isdropped = False
CodeZapperLight.state = 0
Player1.intensityscale = 1.5
End Sub
'*************Check if Game Should Continue
Sub CheckContinue_timer
If EndGame = 1 Then
TurnOff
Match
State = False
GameState
DynamicUpdatePostIt.enabled = 1
CanPlayTxt.text = 0
SortScores
CheckHighScores
Players = 0
SaveHS
FirstBallLaunched = False
If B2SOn Then
Controller.B2SSetGameOver 35 + Language,1
Controller.B2SSetballinplay 32, 0
Controller.B2SSetPlayerUp 30 + Language, 0
Controller.B2SSetcanplay 31, 0
Controller.B2SSetData 49, 0
Controller.B2SSetData 55 + Language, 0
Controller.B2SStartAnimation "Capersville Logo"
End If
For each Light in GIlights:light.state = 0: Next
CheckContinue.enabled = False
Else
If BallInLane = False and BIP = 0 Then
ReleaseBall
End If
End If
CheckContinue.enabled = False
End Sub
'***************Drain and Release Ball
Sub Drain_Hit()
BIP = BIP - 1
UpdateText
PlaySoundAtVol "fx_drain", Drain, 1
If B2SOn Then DOF 143, DOFPulse
UpdateTrough
UpdateText
End Sub
Sub ReleaseBall
If BIP = 0 Then
PlaysoundAtVol SoundFXDOF("kickerkick",107,DOFPulse,DOFContactors), TroughSlot1, 1
TroughSlot1.kick 60, 20
PlaysoundAtVol "metalhit_thin", Plunger, 1
BIP = BIP + 1
UpdateText
UpdateTrough
Launched = 0
BIPText.text = BallinPlay
If B2SOn Then Controller.B2SSetBallinPlay 32, BallinPlay
End If
End Sub
'**************Advance Players
Sub ScoreBonus
If ShootAgainLight.state = 0 Then
If Players = 1 or Player = Players Then
Player = 1
UnZipFlippers
EVAL("Player"&players).intensityscale = 1
Player1.intensityscale = 1.5
Else
UnZipFlippers
Player = Player + 1
EVAL("Player" & (player-1)).intensityscale = 1
EVAL("Player" & player).intensityscale = 1.5
End If
If B2SOn Then Controller.B2SSetPlayerup 30 + Language , Player
NextBall
Else
ReleaseBall
End If
End Sub
'*********************Next Ball
Sub NextBall
If Tilt = True Then
For f = 1 to 3
EVAL("Bumper"&f).hashitevent = 1
Next
Tilt = False
TiltTxt.text = " "
If B2SOn Then
Controller.B2SSetTilt 33 + Language,0
Controller.B2SSetData 1, 1
End If
End If
ResetSeaRay.enabled = True
CodeZapperLight.state = 0
CodeZapperBlock.isdropped = False
If Player = 1 Then BallinPlay = BallinPlay + 1
If BallinPlay > Balls Then
PlaySound "GameOver"
EndGame = 1
CheckContinue.enabled = True
Else
If State = True then
CheckContinue.enabled = True
End If
End If
End Sub
'************Coin Handelers
Sub CoinDelay_timer
AddCredit
coindelay.enabled = False
End Sub
Sub AddCredit
Credit = Credit+1
DOF 150, DOFOn
If Credit > 25 Then Credit = 25
CreditTxt.text = Credit
If B2SOn Then Controller.B2SSetCredits Credit
End Sub
'************Game State Check
Sub GameState
If State = False Then
For each light in GIlights:light.state = 0: Next
flasher1.visible=0
flasher2.visible=1
metal_leftlower.blenddisablelighting = 0
metal_leftmiddle.blenddisablelighting = 0
metal_leftupper.blenddisablelighting = 0
metal_leftlower.blenddisablelighting = 0
metal_plungerplate.blenddisablelighting = 0
metal_rightlower.blenddisablelighting = 0
metal_rightupper.blenddisablelighting = 0
If Language = 0 Then
GamOv.text = "GAME OVER"
Else
GamOv.text = "SPIEL AUS!"
End If
If B2SOn Then Controller.B2SSetGameOver 35 + Language,1
For i = 1 to 4
EVAL ("Player" & i).intensityscale = 1
Next
Else
For each Light in GIlights:Light.state = 1: Next
flasher1.visible=1
flasher2.visible=0
metal_leftlower.blenddisablelighting = 0.25
metal_leftmiddle.blenddisablelighting = 0.25
metal_leftupper.blenddisablelighting = 0.25
metal_leftlower.blenddisablelighting = 0.25
metal_plungerplate.blenddisablelighting = 0.25
metal_rightlower.blenddisablelighting = 0.25
metal_rightupper.blenddisablelighting = 0.25
GamOv.text = ""
MatchTxt.text = ""
TiltTxt.text = " "
If B2SOn Then
Controller.B2SSetTilt 33 + Language,0
Controller.B2SSetMatch 34,0
Controller.B2SSetGameOver 35 + Language,0
End If
End If
End Sub
'*************Trough based on nFozzy's
Dim Trough
Sub UpdateTrough()
Trough= 0
UpdateTroughTimer.Interval = 400
UpdateTroughTimer.Enabled = 1
End Sub
Sub UpdateTroughTimer_Timer()
If TroughSlot1.BallCntOver = 0 Then TroughSlot2.kick 60, 8
If TroughSlot2.BallCntOver = 0 Then TroughSlot3.kick 60, 8
If TroughSlot3.BallCntOver = 0 Then Drain.kick 60, 30
If Trough > 3 Then
Me.Enabled = 0
If BIP = 0 Then ScoreBonus
End If
Trough = Trough + 1
End Sub
'*************Ball in Launch Lane
Sub BallHome_hit
BallREnabled = 1
If B2SOn Then DOF 112, DOFOn
RelGateHit = 0
CodeZapperGateHit = 0
Set ControlBall = ActiveBall
contballinplay = True
End Sub
Sub BallHome_unhit
If B2SOn Then DOF 112, DOFOff
End Sub
'******* For Ball Control Script
Sub EndControl_Hit()
contballinplay = False
End Sub
'************Check if Ball Out of Launch Lane
Sub BallRel_hit
If BallREnabled = 1 Then
ShootAgainLight.state = 0
BallREnabled = 0
BallInLane = False
End If
me.timerenabled = 1
End Sub
'***************Shooter Lane Gate Animation
Sub BallRel_Timer
Pgate.rotz = Gate.CurrentAngle * .6
End Sub
'***************Match
Sub Match
y = int(rnd(1)*9)
MatchNumber = y
If B2SOn Then
If MatchNumber = 0 Then
Controller.B2SSetMatch 10
Else
Controller.B2SSetMatch 34,MatchNumber
End If
End If
MatchTxt.text = MatchNumber
For i = 1 to Players
MatchScoreTxt.text = (Score(1) mod 10)
If (MatchNumber) = (Score(i) mod 10) Then
AddCredit
If B2SOn Then
DOF 108, DOFPulse
DOF 151, DOFPulse
Else
PlaySound "Knock"
End If
End If
Next