-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhirlWindVpx.vbscript
3150 lines (2794 loc) · 108 KB
/
whirlWindVpx.vbscript
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
'NOTES
'if gobblelight or gobblelightred are lit then layer1d.image="layer1"
'if gobblelight or gobblelightred are NOT lit (in between roto indexes) thenlayer1d.image="layer1b"
'rototarget spins on objroty
'Texture changes for lit L/R slingshots
'cig2.visible=0 when game is only 1 player or when player 1 is up in a 2 player game
'If slingleftlit=1 Then
' For each xx in slinglampsleft:xx.State = 1: Next
' For each xx in slinglampsright:xx.State = 0: Next
' For each xx in layer1acol: xx.image = "layer1": Next
' For each xx in layer1bcol: xx.image = "layer1b": Next
' For each xx in layer2acol: xx.image = "layer2": Next
' For each xx in layer2bcol: xx.image = "layer2b": Next
' For each xx in layer3acol: xx.image = "layer3": Next
' For each xx in layer3bcol: xx.image = "layer3b": Next
'If slingrightlit=1 Then
' For each xx in slinglampsleft:xx.State = 0: Next
' For each xx in slinglampsright:xx.State = 1: Next
' For each xx in layer1acol: xx.image = "layer1b": Next
' For each xx in layer1bcol: xx.image = "layer1": Next
' For each xx in layer2acol: xx.image = "layer2b": Next
' For each xx in layer2bcol: xx.image = "layer2": Next
' For each xx in layer3acol: xx.image = "layer3b": Next
' For each xx in layer3bcol: xx.image = "layer3": Next
'dead bumpers trigger with a hit to phys_deadbumps (spin), phys_deadbumps001 (Left center), phys_deadbumps002 (Right center)
'1 pt switches trigger with scoringswitches1pt and scoringswitches.
'****************************************************************
'
' Whirl-Wind (Gottlieb 1958)
' Script by Scottacus
' v 1.0
' September 2020
'
' Basic DOF config
' 90 BackGlass On Image
' 101 Left Flipper, 102 Right Flipper
' 103 Left Sling, 104 Right Sling
' 105 Bumper1, 106 Bumper2, 107 Bumper3
' 120 Kickers
' 125 Ball Release
' 130 - 138 Wire Rollovers
' 141 Chime 1-10s, 142 Chime2-100s, 143 Chime3-1000s
' 160 - 161 Rollover Buttons
' 170 - 173 Mushrooms
' 199 credit light
' 128 Knocker
'
' Code Flow
' EndGame
' ^
' Start Game -> New Game -> Check Continue -> Release Ball -> Drain -> Score Bouns -> Advance Player -> Next Ball
' ^ |
' EndGame = True <---------------------------------------------------------------
'
' Note Score Motor Location for sound routines is at shootAgain Light
' Ball Control Subroutine developed by: rothbauerw
' Press "c" during play to activate, the arrow keys control the ball
Option Explicit
Randomize
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the Controller.vbs file in order to run this table (installed with the VPX package in the scripts folder)"
On Error Goto 0
Const cGameName = "Whirl_Wind_1958"
Const cOptions = "Whirl_Wind_1958.txt"
Const hsFileName = "Whirl Wind (Gottlieb 1958)"
'**********************************************************************************************
'Set this variable to 1 to save a PinballY High Score file to your Tables Folder
'this will let the Pinball Y front end display the high scores when searching for tables
'0 = No PinballY High Scores, 1 = Save PinballY High Scores
Const cPinballY = 2
'**********************************************************************************************
'***********************************Colored Balls**********************************************
'Uncomment the next line to make the game play with colored balls BOT(0-2) = Green, Red Blue
coloredBalls = False
'**********************************************************************************************
'**********************************************************************************************
'Set BallLift to 0 to enable Automatic Mechanical Ball Lift, 1 will require right magnasave to lift ball
dim BallLift
BallLift = 0
'**********************************************************************************************
'**********************************************************************************************
'Set to 0 to turn off cigs for player up
'Note neither the author of this table nor the surgeon general supports use of tobacco products
dim cigOn
cigOn = 1
'**********************************************************************************************
Dim balls
Dim replays
Dim maxPlayers
Dim players
Dim player
Dim credit
Dim score(6)
Dim hScore(6)
Dim sReel(4)
Dim state
Dim tilt
Dim matchNumber
Dim i,j, f, ii, Object, Light, x, y, z
Dim freePlay
Dim ballsize,BallMass
ballSize = 50
ballMass = (Ballsize^3)/125000
Dim BIP : BIP = 0
Dim options
Dim chime
Dim onBumper
Dim pfOption
Dim deathLane
Sub Table1_init
LoadEM
maxPlayers = 2
For x = 1 to maxPlayers
Set sReel(x) = EVAL("scoreReel" & x)
Next
player=1
loadHighScore
ballsInPlay = 0
If highScore(0) = "" Then highScore(0) = 500
If highScore(1) = "" Then highScore(1) = 450
If highScore(2) = "" Then highScore(2) = 400
If highScore(3) = "" Then highScore(3) = 350
If HighScore(4) = "" Then highScore(4) = 300
If matchNumber = "" Then matchNumber = 4
If ShowDT = True Then pfOption = 1
If pfOption = "" Then pfOption = 1
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 chime = "" Then chime = 0
If onBumper = "" Then onBumper = 1
If deathLane = "" Then deathLane = 0
replaySettings
firstBallOut = 0
updatePostIt
dynamicUpdatePostIt.enabled = 1
TiltReel.setValue(1)
CreditReel.setvalue(credit)
If deathLane = 1 Then
layer1cheat.visible = 1
layer1cheat.collidable = 1
Else
layer1cheat.visible = 0
layer1cheat.collidable = 0
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
ballShadowUpdate.enabled = True
MatchReel.setValue(MatchNumber) 'Need to set to change if 1 point table
tilt = False
state = False
gameState
If balls = 5 Then
' instructCard.image = "Wiggler 5 Ball Instruction"
' coincard.image = "Balls5"
Else
' coincard.image = "Balls3"
' instructCard.image = "Wiggler 3 Ball Instruction"
End If
End Sub
'***********KeyCodes
Dim enableInitialEntry, firstBallOut
Sub Table1_KeyDown(ByVal keycode)
If enableInitialEntry = True Then enterIntitals(keycode)
If keycode = addCreditKey Then
playFieldSound "coinin",0,Drain,1
addCredit = 1
scoreMotor5.enabled = 1
End If
If keycode = startGameKey Then
If enableInitialEntry = False and operatormenu = 0 and backGlassOn = 1 Then
If freePlay = 1 and players < 4 and firstBallOut = 0 Then startGame
If freePlay = 0 and credit > 0 and players < 4 and firstBallOut = 0 Then
credit = credit - 1
playsound "Reel1", 0, reelVol, 0, 0, 0, 1, 1, 0
creditReel.setvalue(credit)
If B2SOn Then
If freeplay = 0 Then controller.B2SSetCredits credit
If freePlay = 0 and credit < 1 Then DOF 199, DOFOff
End If
startGame
End If
End If
End If
If keycode = PlungerKey Then
plunger.PullBack
playFieldSound "plungerpull", 0, plunger, 1
End If
If tilt = False and state = True Then
If keycode = leftFlipperKey and contball = 0 Then
LFPress = 1
lf.fire
playFieldSound "FlipUpL", 0, leftFlipper, 1
If B2SOn Then DOF 101,DOFOn
playFieldSound "FlipBuzzL", -1, leftFlipper, 1
End If
If keycode = RightFlipperKey and contball = 0 Then
RFPress = 1
rf.fire
playFieldSound "FlipUpR", 0, RightFlipper,1
If B2SOn Then DOF 102,DOFOn
playFieldSound "FlipBuzzR", -1, RightFlipper,1
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 showDt = True Then If options = 3 Then options = 5 'skips non DT options
If options = 6 Then options = 0
optionMenu.visible = True
playFieldSound "target", 0, SoundPointScoreMotor, 1.5
Select Case (Options)
Case 0:
optionMenu.image = "FreeCoin" & freePlay
Case 1:
optionMenu.image = balls & "Balls"
Case 2:
OptionMenu.image = "DeathLane" & deathLane
Case 3:
optionMenu1.visible = 1
optionMenu1.image = "DOF"
optionMenu.image = "Chime" & chime
Case 4:
optionMenu.image = "UnderCab"
optionMenu1.visible = 1
optionMenu1.image = "Sound" & pfOption
optionMenu2.visible = 1
optionMenu2.image = "SoundChange"
Select Case (pfOption)
Case 1: speaker1.visible = 1: speaker2.visible = 1: speaker3.visible = 0: speaker4.visible = 0
Case 2: speaker5.visible = 1: speaker6.visible = 1: speaker1.visible = 0: speaker2.visible = 0
Case 3: speaker1.visible = 1: speaker2.visible = 1: speaker3.visible = 1: speaker4.visible = 1: speaker5.visible = 0: speaker6.visible = 0
End Select
Case 5:
For x = 1 to 6
EVAL("Speaker" & x).visible = 0
Next
optionMenu1.visible = 0
optionMenu.image = "SaveExit"
optionMenu2.visible = 0
End Select
End If
If keycode = RightFlipperKey and state = False and operatorMenu = 1 Then
playFieldSound "metalhit2", 0, SoundPointScoreMotor, 0.2
Select Case (options)
Case 0:
If freePlay = 0 Then
freePlay = 1
Else
freePlay = 0
End If
optionMenu.image= "FreeCoin" & freePlay
If freePlay = 0 Then
If credit > 0 and B2SOn Then DOF 199, DOFOn
If credit < 1 and B2SOn Then DOF 199, DOFOff
Else
If B2SOn Then DOF 199, DOFOn
End If
Case 1:
If balls = 3 Then
balls = 5
Else
balls = 3
End If
' InstructCard.image = "Wiggler " & balls & " Ball Instruction"
' Coincard.image = "Balls" & balls
optionMenu.image = balls & "Balls"
Case 2:
If deathLane = 0 Then
deathLane = 1
layer1cheat.visible = 1
layer1cheat.collidable = 1
Else
deathLane = 0
layer1cheat.visible = 0
layer1cheat.collidable = 0
End If
OptionMenu.image = "deathLane" & deathLane
Case 3:
If chime = 0 Then
chime= 1
If B2SOn Then DOF 142,DOFPulse
Else
chime = 0
playFieldsound "Chime10", 0, soundPoint13, 1
End If
optionMenu.image = "Chime" & chime
Case 4:
optionMenu1.visible = 1
pfOption = pfOption + 1
If pfOption = 4 Then pfOption = 1
optionMenu1.image = "Sound" & pfOption
Select Case (pfOption)
Case 1: speaker1.visible = 1: speaker2.visible = 1: speaker3.visible = 0: speaker4.visible = 0
Case 2: speaker5.visible = 1: speaker6.visible = 1: speaker1.visible = 0: speaker2.visible = 0
Case 3: speaker1.visible = 1: speaker2.visible = 1: speaker3.visible = 1: speaker4.visible = 1: speaker5.visible = 0: speaker6.visible = 0
End Select
Case 5:
operatorMenu = 0
saveHighScore
dynamicUpdatePostIt.enabled = 1
optionMenu.image = "FreeCoin" & freePlay
optionMenu1.visible = 0
optionMenu.visible = 0
optionsMenu.visible = 0
replaySettings
End Select
End If
If Keycode = mechanicalTilt Then
tilt = True
TiltReel.setValue(1)
If B2SOn Then controller.B2SSetTilt 1
turnOff
End If
If Keycode = rightmagnasave Then
if OKtoReleaseBall = 1 Then releaseBall
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
If keycode = 52 Then Zup = 1' Period
'************************Start Of Test Keys****************************
If Keycode = 30 Then 'a' key
rotoMultStep
cig1.visible = 0
End If
If Keycode= 31 Then 's' key
if rotoOn = 0 Then RotateRototarget
cig1.visible = 1
End If
If Keycode = 33 Then 'f' key
controller.B2SSetPlayerUp 30, 1
' x=x+1
' if x = 11 then x = 0
' MatchReel.setValue(x)
' if B2SOn then controller.B2SSetMatch 34, x
End If
'************************End Of Test Keys****************************
End Sub
dim TestChr1, TestChr2, TestChr3, TestChr
Sub Table1_KeyUp(ByVal keycode)
If keycode = plungerKey Then
plunger.Fire
playFieldSound "PlungerFire", 0, plunger, 1
End If
If keycode = leftFlipperKey Then
operatorMenuTimer.Enabled = False
End If
If tilt = False and state = True Then
If keycode = leftFlipperKey and contball = 0 Then
lfpress = 0
LeftFlipper.eosTorqueAngle = EOSA
LeftFlipper.eosTorque = EOST
LeftFlipper.RotateToStart
playFieldSound "FlipDownL", 0, leftFlipper, 1
If B2SOn Then DOF 101,DOFOff
stopSound "FlipBuzzLA"
stopSound "FlipBuzzLB"
stopSound "FlipBuzzLC"
stopSound "FlipBuzzLD"
End If
If keycode = RightFlipperKey and contball = 0 Then
rfpress = 0
RightFlipper.eosTorqueAngle = EOSA
RightFlipper.eosTorque = EOST
RightFlipper.rotateToStart
playFieldSound "FlipDownR", 0, RightFlipper, 1
If B2SOn Then DOF 102,DOFOff
stopSound "FlipBuzzRA"
stopSound "FlipBuzzRB"
stopSound "FlipBuzzRC"
stopSound "FlipBuzzRD"
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
If keycode = 52 Then Zup = 0' Period
End Sub
'************** Table Boot
Dim backGlassOn
Dim bootCount:bootCount = 0
Sub bootTable_Timer()
bootCount = bootCount + 1
If bootCount = 1 Then
'*****GI Lights On
dim xx
For each xx in GI:xx.State = 1: Next
For each xx in layer1col: xx.image = "layer1": Next
For each xx in layer2col: xx.image = "layer2": Next
For each xx in layer3col: xx.image = "layer3": Next
For each xx in layer4col: xx.image = "layer4": Next
' For each xx in gatescol: xx.image = "gates": Next
' bumpa002.image="caps2lit"
' bumpb002.image="caps2lit"
' bumpc002.image="caps2lit"
playfield_off.visible = 0
RM1.state = 1
rotoMultiplier = 1
' FlipInLight.state = 0
For Each xx in gobblelight: xx.state = 1: Next
If B2SOn Then
controller.B2SSetCredits credit
controller.B2SSetMatch 34, matchNumber
controller.B2SSetTilt 33,1
controller.B2SSetData 90, 1 'turns the backglass image on
controller.B2SSetPlayerUp 30,0
If credit > 0 Then DOF 199, DOFOn
If freePlay = 1 Then DOF 199, DOFOn
End If
For x = 1 to maxPlayers
If B2SOn Then controller.B2SSetScorePlayer x, score(x)
sReel(x).setvalue(score(x))
Next
AlternateLights
backGlassOn = 1
me.enabled = False
End If
End Sub
'***********Replay Settings
Sub replaySettings
If balls = 5 Then
replay(1) = 3600
replay(2) = 4800
replay(3) = 5400
replay(4) = 6000
Else
replay(1) = 2600
replay(2) = 3800
replay(3) = 4400
replay(4) = 5000
End If
End Sub
'***********Operator Menu
Dim operatormenu
Sub operatorMenuTimer_Timer
If optionMenu.visible = False Then playFieldSound "target", 0, SoundPointScoreMotor, 1.5
options = 0
operatorMenu = 1
dynamicUpdatePostIt.enabled = 0
updatePostIt
options = 0
optionsMenu.visible = True
optionMenu.visible = True
optionMenu.image = "FreeCoin" & freePlay
End Sub
'***********Start Game
Dim ballInPlay, bonusScore
Sub startGame
If state = False Then
ballInPlay = 1
If B2SOn Then
controller.B2SSetCredits credit
controller.B2SSetBallinPlay 32, ballInPlay
controller.B2SSetCanPlay 31, 1
controller.B2SSetPlayerup 30, 1
controller.B2SSetGameOver 0
End If
If cigOn = 1 then cig1.visible = 1
UP1.setValue(1)
BIPReel.setValue(ballInPlay)
dynamicUpdatePostIt.enabled = 0
updatePostIt
tilt = False
state = True
gameState
players = 1
CanPlay1.setValue(1)
for x = 1 to maxPlayers
score(x) = (score(x) mod 100000)
Next
newGame
Else If state = True and players < maxPlayers and ballinPlay = 1 Then
players = players + 1
creditReel.setvalue(credit)
If B2SOn Then controller.B2SSetCredits credit
If B2sOn Then controller.B2SSetCanPlay 31, players
EVAL("CanPlay" & players).setValue(1)
EVAL("CanPlay" & players - 1).setValue(0)
End If
End If
End Sub
'*********New Game
Dim endGame, roundHS
Sub newGame
player = 1
endGame = 0
roundHS = 0
gameState
For f = 1 to 3
EVAL("Bumper" & f).hashitevent = 1
Next
resetReel.enabled = True
End Sub
'**********Check if Game Should Continue
Dim relBall, rep(4)
Sub checkContinue
If endGame = 1 Then
turnOff
stopSound "FlipBuzzLA"
stopSound "FlipBuzzLB"
stopSound "FlipBuzzLC"
stopSound "FlipBuzzLD"
stopSound "FlipBuzzRA"
stopSound "FlipBuzzRB"
stopSound "FlipBuzzRC"
stopSound "FlipBuzzRD"
match
For x = 1 to 4
EVAL("CanPlay" & x).setValue(0)
Next
state = False
BIPReel.setValue(0)
UP1.setValue(0)
gameState
DynamicUpdatePostIt.enabled = 1
sortScores
checkHighScores
firstBallOut = 0
players = 0
For x = 1 to 4
rep(x) = 0
repAwarded(x) = 0
Next
saveHighScore
cig1.visible = 0
cig2.visible = 0
If B2SOn Then
controller.B2SSetGameOver 35,1
controller.B2SSetballinplay 32, 0
controller.B2SSetPlayerUp 30, 0
controller.B2SSetCanPlay 31, 0
If credit > 0 Then DOF 199, DOFOn
If freePlay = 1 Then DOF 199, DOFOn
End If
BIPReel.setValue(0)
Else
relBall = 1 'variable to tell score motor routine that this is a ball release run
scoreMotor5.enabled = 1
rotoKick = 1
BIPReel.setValue(ballinPlay)
End If
End Sub
'***************Drain and Release Ball
Dim drainActive
Sub drain_Hit()
playFieldSound "Drain", 0, drain, 0.001
repAwarded(Player) = 0
drainActive = 1
drain.DestroyBall 'this is used for multiball tables to avoid timing issues with balls moving in the trough
BallsInPlay = BallsInPlay - 1
If BallsInPlay = 0 Then scoreBonus
End Sub
Dim launched, BallsInPlay, OKtoReleaseBall
Sub releaseBall
drain1.CreateSizedBallWithMass Ballsize/2, BallMass 'used for multiball tables (see above)
BallsInPlay = BallsInPlay + 1
playFieldSound "FastKickIntoLaunchLane", 0, drain, 0.5
If B2SOn Then DOF 125,DOFPulse
drain1.kick 270,15 'use only this and no create/destroy ball on single ball tables
launched = 0
OKtoReleaseBall = 0
If B2SOn Then Controller.B2SSetBallinPlay 32, ballinPlay
drainActive = 0
BIPReel.setValue(ballInPlay)
End Sub
'**********Check if Scoring Bonus is True
Dim BonusFlag
Sub ScoreBonus
bonusScore = 0
' BonusFlag = 1
' Flag100 = 0: Flag10 = 0: Flag1000 = 0
' ScoreMotor.enabled = 1
' If BonusScore = 0 Then DoubleBonus.state = 0
' If BonusScore = 0 And ShootAgain.state = 1 Then ReleaseBall
If BonusScore = 0 Then AdvancePlayers 'And ShootAgain.state = 0
End Sub
'**********Advance Players
Sub advancePlayers
If players = 1 or player = players Then
player = 1
EVAL("UP" & players).SetValue(0)
Up1.SetValue(1)
if cigOn = 1 then cig2.visible = 0: cig1.visible = 1
Else
player = player + 1
EVAL ("Up" & (player - 1)).setValue(0)
EVAL ("Up" & player).setValue(1)
if cigOn = 1 then Cig1.visible = 0: cig2.visible = 1
End If
If B2SOn Then controller.B2SSetPlayerup 30, player
nextBall
End Sub
'**********Next Ball
Sub nextBall
If tilt = True Then
For f = 1 to 3 'set to number of bumpers
EVAL("Bumper" & f).hashitevent = 1
Next
tilt = False
TiltReel.setValue(0)
If B2SOn Then
controller.B2SSetTilt 33,0
controller.B2SSetData 1, 1
End If
End If
resetTable
if Player = 1 then ballinPlay = ballinPlay + 1
' If player = 4 then BallinPlay = 5 'used for match testing
If ballinPlay > balls then
endGame = 1
checkContinue
Else
If state = True Then checkContinue
End If
End Sub
'************Game State Check
Sub gameState
dim xx
If state = False Then
GameOverReel.setValue(1)
If B2SOn then controller.B2SSetGameOver 35,1
If B2SOn then controller.B2SSetData 80,0
stopSound "FlipBuzzLA"
stopSound "FlipBuzzLB"
stopSound "FlipBuzzLC"
stopSound "FlipBuzzLD"
stopSound "FlipBuzzRA"
stopSound "FlipBuzzRB"
stopSound "FlipBuzzRC"
stopSound "FlipBuzzRD"
Else
GameOverReel.setValue(0)
MatchReel.setValue(0)
TiltReel.setValue(0)
If B2SOn Then
controller.B2SSetTilt 33,0
controller.B2SSetMatch 34,0
controller.B2SSetGameOver 35,0
controller.B2SSetData 80,1
End If
End If
End Sub
'*************Ball in Launch Lane on Plunger Tip
Dim ballREnabled, relGateHit
Sub ballHome_hit
ballREnabled = 1
If B2SOn Then DOF 165, DOFOn
relGateHit = 0
Set controlBall = ActiveBall
contBallInPlay = True
End Sub
'*************Ball off of Plunger Tip
Sub ballHome_unhit
If B2SOn Then DOF 165, DOFOff
End Sub
'******* for ball control script
Sub endControl_Hit()
contBallInPlay = False
End Sub
'************Check if Ball Out of Launch Lane
Dim ballInLane
Sub ballsInPlay_hit
If ballREnabled=1 Then
ballREnabled = 0
ballInLane = False
End If
firstBallOut = 1
End Sub
'************** Reset Table
Sub resetTable
' gate1.collidable = 1: gates004.visible = 1: gates003.visible = 0
End Sub
'************** Alternate Lights
Dim Alternate
Sub AlternateLights
dim xx
If Alternate = 0 then
'If slingleftlit=1 Then
For each xx in slinglampsleft:xx.State = 1: Next
For each xx in slinglampsright:xx.State = 0: Next
For each xx in layer1acol: xx.image = "layer1": Next
For each xx in layer1bcol: xx.image = "layer1b": Next
For each xx in layer2acol: xx.image = "layer2": Next
For each xx in layer2bcol: xx.image = "layer2b": Next
For each xx in layer3acol: xx.image = "layer3": Next
For each xx in layer3bcol: xx.image = "layer3b": Next
LightRO1.state = 1
LightRO2.state = 0
LightRO3.state = 1
LightRO4.state = 0
BumpLight3001.state = 1
BumpLight3002.state = 1
BumpLight1001.state = 0
BumpLight1002.state = 0
BumpLight4001.state = 1
BumpLight4002.state = 1
BumpLight5001.state = 0
BumpLight5002.state = 0
Else
'If slingrightlit=1 Then
For each xx in slinglampsleft:xx.State = 0: Next
For each xx in slinglampsright:xx.State = 1: Next
For each xx in layer1acol: xx.image = "layer1b": Next
For each xx in layer1bcol: xx.image = "layer1": Next
For each xx in layer2acol: xx.image = "layer2b": Next
For each xx in layer2bcol: xx.image = "layer2": Next
For each xx in layer3acol: xx.image = "layer3b": Next
For each xx in layer3bcol: xx.image = "layer3": Next
LightRO1.state = 0
LightRO2.state = 1
LightRO3.state = 0
LightRO4.state = 1
BumpLight3001.state = 0
BumpLight3002.state = 0
BumpLight1001.state = 1
BumpLight1002.state = 1
BumpLight4001.state = 0
BumpLight4002.state = 0
BumpLight5001.state = 1
BumpLight5002.state = 1
End If
Alternate = Alternate + 1
If Alternate = 2 then Alternate = 0
End Sub
'************** Bumpers and Skirt Animation
dim bump1step, bump2step, bump3step
Sub bumpers_Hit(Index)
If tilt = False Then
Select Case (Index)
Case 0: If BumpLight1001.state = 0 Then
addScore 1
Else
addScore 10
End If
EVAL ("skirt" & (index + 1)).enabled = 1
PlayFieldSound "PopBump", 0, bumper1, 1
If B2SOn Then DOF 105,DOFPulse
Case 1: addScore 1
EVAL ("skirt" & (index + 1)).enabled = 1
playFieldSound "PopBump", 0, bumper2, 1
If B2SOn Then DOF 106,DOFPulse
Case 2: If BumpLight3001.state = 0 Then
EVAL ("skirt" & (index + 1)).enabled = 1
addScore 1
Else
addScore 10
End If
playFieldSound "PopBump", 0, bumper3, 1
If B2SOn Then DOF 107,DOFPulse
Case 3: addScore 10
Case 4: addScore 10
Case 5: addScore 5: if rotoOn = 0 Then RotateRototarget
End Select
End If
End Sub
Sub Skirt1_timer
Select Case bump1Step
Case 3: bumpskirt1.RotY=-3
Case 4: bumpskirt1.RotY=2
Case 5: bumpskirt1.RotY=-1
Case 6: bumpskirt1.RotY=1
Case 7: bumpskirt1.RotY=0: bump1Step = 0: Skirt1.enabled = 0
End Select
bump1Step = bump1Step + 1
End Sub
Sub Skirt2_timer
Select Case bump2Step
Case 3: bumpskirt2.RotY=-3
Case 4: bumpskirt2.RotY=2
Case 5: bumpskirt2.RotY=-1
Case 6: bumpskirt2.RotY=1
Case 7: bumpskirt2.RotY=0:bump2Step = 0: Skirt2.enabled = 0
End Select
bump2Step = bump2Step + 1
End Sub
Sub Skirt3_timer
Select Case bump3Step
Case 3: bumpskirt3.RotY=-3
Case 4: bumpskirt3.RotY=2
Case 5: bumpskirt3.RotY=-1
Case 6: bumpskirt3.RotY=1
Case 7: bumpskirt3.RotY=0: bump3Step = 0: Skirt3.enabled = 0
End Select
bump3Step = bump3Step + 1
End Sub
Sub bumper1On
bumpa001.image="caps1lit"
bumpa002.image="caps2lit"
bumplight1.state=1
bumpskirt1.image="skirts"
End Sub
Sub bumper1Off
bumpa001.image="caps1"
bumpa002.image="caps2"
bumplight1.state=0
bumpskirt1.image="skirts_off"
End Sub
Sub bumper2On
bumpb001.image="caps1lit"
bumpb002.image="caps2lit"
bumplight2.state=1
bumpskirt2.image="skirts"
End Sub
Sub bumper2Off
bumpb001.image="caps1"
bumpb002.image="caps2"
bumplight2.state=0
bumpskirt2.image="skirts_off"
End Sub
Sub bumper3On
bumpc001.image="caps1lit"
bumpc002.image="caps2lit"
bumplight3.state=1
bumpskirt3.image="skirts"
End Sub
Sub bumper3Off
bumpc001.image="caps1"
bumpc002.image="caps2"
bumplight3.state=0
bumpskirt3.image="skirts_off"
End Sub
'************** 10's Rubbers
Sub TensRubbers_Hit
addScore 10
End Sub
'************** Top 200 Lights
Sub Bands1_Hit (Index)
addScore 1
End Sub
'
'************** Wire RollOvers
Dim wire, wireNumber
Sub wireAnimation_Timer
wire = wire + 1
Select Case wire
Case 1: EVAL ("wire" & wireNumber + 1).transz = -10
Case 2: EVAL ("wire" & wireNumber + 1).transz = -4
Case 3: EVAL ("wire" & wireNumber + 1).transz = -1
Case 4: EVAL ("wire" & wireNumber + 1).transz = 0