-
Notifications
You must be signed in to change notification settings - Fork 37
/
CARtoons RC (2017) v2.3.vbs
2620 lines (2340 loc) · 68.6 KB
/
CARtoons RC (2017) v2.3.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
'**************************************************
' ____ _ ____ _
' / ___| / \ | _ \| |_ ___ ___ _ __ ___
'| | / _ \ | |_) | __/ _ \ / _ \| '_ \/ __|
'| |___ / ___ \| _ <| || (_) | (_) | | | \__ \
' \____/_/ \_\_| \_\\__\___/ \___/|_| |_|___/
'
' ___ _ ___ _
''| _ \___ __ _ __| |_ / __|___ __ _ __| |_
''| / _ / _` / _| ' \ | (__/ _ / _` / _| ' \
''|_|_\___\__,_\__|_||_| \___\___\__,_\__|_||_|
'
' >>>>>>>>>>>>started 2016 - 2017 released<<<<<<<<<<
'***************************************************
' Created by: HauntFreaks - BorgDog - SliderPoint
' ------------------------------------------------
' Roach Effect Credits: Dark / Randr / Toxie / Fuzzel / HauntFreaks / BorgDog
' ----------------------------------------------------------------------------
' Graphics/Lighting: HauntFreaks - SliderPoint - BorgDog
' -------------------------------------------------------
' Code/Animation: BorgDog - SliderPoint
'*******************************************************
Option Explicit
Randomize
' Thalamus : consider applying this fix
' https://vpinball.com/forums/topic/cartoons-2017/page/4/#post-95497
'**********************************************************
'******** 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
Const cGameName = "Cartoons"
Dim operatormenu, options
Dim bumperlitscore
Dim bumperoffscore
Dim balls
Dim replays
Dim Replay1Table(3), Replay2Table(3), Replay3Table(3)
Dim Add10, Add100, Add1000
dim replay1, replay2, replay3
dim replaytext(3)
Dim hisc, hiscstate, ebmode, extraballs, Rhisc, hircstate
Dim players
Dim player
Dim credit, freeplay
Dim score(2), RoachScore(2)
Dim sreels(2), Rreels(2)
Dim p100k(2)
Dim state
Dim tilt
Dim tiltsens
Dim target(8)
Dim StarState
Dim Bonus
Dim Bonuslight(19)
Dim ballinplay
Dim matchnumb
dim ballrenabled, PlungeBall
Dim rep(2)
Dim rst
Dim eg, goroaches
Dim scn
Dim scn1
Dim bell, saahc
Dim i,j,tnumber, light, objekt
Dim awardcount, dbonus
dim roachstep, roachxy1, roachxy2, roachxy3, roachxy4
dim RoachBall, MirrorBall, RealBall, roachran, RoachLoc
dim frameRate:frameRate=0.8
dim frame:frame=0
Dim PI:PI=3.1415926
Dim Magnet0, Magnet1, magnet2, Magnet3, Magnet4
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "Can't open controller.vbs"
On Error Goto 0
On Error Resume Next
ExecuteGlobal GetTextFile("core.vbs")
If Err Then MsgBox "You need the core.vbs in order to run this table, available in the vp10 package"
On Error Goto 0
sub CARtoons_init
LoadEM
Replay1Table(1)=90000
Replay1Table(2)=120000
Replay1Table(3)=140000
Replay2Table(1)=120000
Replay2Table(2)=150000
Replay2Table(3)=170000
Replay3Table(1)=150000
Replay3Table(2)=180000
Replay3Table(3)=200000
replaytext(1)="90000,120000,150000"
replaytext(2)="120000,150000,180000"
replaytext(3)="140000,170000,200000"
set sreels(1) = ScoreReel1
set sreels(2) = ScoreReel2
set Rreels(1) = roachReel1
set Rreels(2) = roachReel2
set p100k(1) = P1100k
set p100k(2) = P2100k
set target(1)=DTredL
set target(2)=DTredR
set target(3)=DTwhiteL
set target(4)=DTwhiteR
set target(5)=DTgreenL
set target(6)=DTgreenR
set target(7)=DTyellowL
set target(8)=DTyellowR
set bonuslight(1)=bonus1
set bonuslight(2)=bonus2
set bonuslight(3)=bonus3
set bonuslight(4)=bonus4
set bonuslight(5)=bonus5
set bonuslight(6)=bonus6
set bonuslight(7)=bonus7
set bonuslight(8)=bonus8
set bonuslight(9)=bonus9
set bonuslight(10)=bonus10
set bonuslight(11)=bonus11
set bonuslight(12)=bonus12
set bonuslight(13)=bonus13
set bonuslight(14)=bonus14
set bonuslight(15)=bonus15
set bonuslight(16)=bonus16
set bonuslight(17)=bonus17
set bonuslight(18)=bonus18
set bonuslight(19)=bonus19
roachxy1=Array(Array(195,200,215,245,285,335,390,450,500,550,600,640,660,640,610,555,500,460,435,425,430,445,460,475),Array(1430,1485,1545,1590,1625,1650,1665,1660,1655,1650,1620,1575,1520,1465,1425,1400,1410,1440,1495,1550,1605,1660,1715,1775))
roachxy2=Array(Array(640,590,540,485,425,380,335,315,310,320,340,370,400,420,440,450,450,450,450,450,450,450,450,450),Array(1310,1275,1250,1240,1250,1265,1305,1355,1415,1470,1525,1570,1615,1665,1715,1765,1765,1765,1765,1765,1765,1765,1765,1765))
roachxy3=Array(Array(110,165,215,270,330,380,430,480,515,540,555,560,555,540,525,505,495,485,475,475,480,480,480,480),Array(1020,995,980,970,975,990,1015,1045,1090,1135,1190,1250,1300,1355,1405,1455,1510,1565,1620,1670,1725,1775,1775,1775))
roachxy4=Array(Array(705,650,600,540,490,440,400,370,340,330,320,330,335,350,375,390,415,445,470,490,495,495,500,500),Array(900,880,875,880,895,925,965,1010,1060,1115,1170,1225,1285,1335,1385,1440,1490,1535,1585,1640,1695,1750,1800,1800))
hideoptions
player=1
For each light in LaneLights:light.State = 0: Next
For each light in BumperLights:light.State = 0: Next
For each light in Tlights:light.State = 0: Next
For each light in PFlights:light.State = 0: Next
TlightRL1.State = 0:light4.state = 0 'mike add
RoachLoc=0
ebmode=0
goroaches=0
hisc=50000
Rhisc=5
HSA1=4
HSA2=15
HSA3=7
RSA1=18
RSA2=1
RSA3=4
loadhs
UpdatePostIt
UpdatePostIt2
gamov.text="Game Over"
gamov.timerenabled=1
tilttxt.timerenabled=1
if credit="" then credit=0
creditreel.setvalue(credit)
if balls="" then balls=3
if balls<>3 and balls<>5 then balls=5
if freeplay="" or freeplay<0 or freeplay>1 then freeplay=0
if matchnumb<0 or matchnumb>9 then matchnumb=0
if replays="" then replays=2
if replays<>1 and replays<>2 and replays<>3 then replays=2
Replay1=Replay1Table(Replays)
Replay2=Replay2Table(Replays)
Replay3=Replay3Table(Replays)
OptionBalls.image="OptionsBalls"&Balls
OptionReplays.image="OptionsReplays"&replays
OptionEBmode.image="OptionsEBmode"&ebmode
if ebmode=0 then
RepCard.image = "ReplyCard"&replays
else
RepCard.image = "EBCard"&replays
end if
OptionFreeplay.image="OptionsFreeplay"&freeplay
if balls=3 then
bumperlitscore=1000
bumperoffscore=1000
InstCard.image="InstCard3balls"
end if
if balls=5 then
bumperlitscore=100
bumperoffscore=100
InstCard.image="InstCard5balls"
end if
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
If B2SOn then
for each objekt in backdropstuff : objekt.visible = 0 : next
End If
if matchnumb=0 then
matchtxt.text="00"
else
matchtxt.text=matchnumb*10
end if
scorereel1.setvalue(score(1) MOD 100000)
roachreel1.setvalue(RoachScore(1))
if score(1)>100000 then
p1100k.text=100000*Int(score(1)/100000)
If B2SOn then Controller.B2SSetScoreRollover 24 + 1, Int(score(1)/100000)
else
p1100k.text=" "
end if
scorereel2.setvalue(score(2) MOD 100000)
roachreel2.setvalue(RoachScore(2))
if score(2)>100000 then
p2100k.text=100000*Int(score(2)/100000)
If B2SOn then Controller.B2SSetScoreRollover 24 + 2, Int(score(2)/100000)
else
p2100k.text=" "
end if
tilt=false
IF Credit > 0 Then DOF 122, DOFOn
saahc=1
set RoachBall = EVAL("RoachHole"&RoachLoc).CreateSizedBall(20)
RoachBall.visible=0
set MirrorBall = MirrorDrain.CreateBall
MirrorBall.visible=0
set RealBall = Drain.CreateBall
startGame.enabled=true
Set Magnet0=New cvpmMagnet
with Magnet0
.InitMagnet RoachTrigger0,3
.CreateEvents "Magnet0"
.AttractBall RoachBall
.Grabcenter = 1
.magneton = 0
end With
Set Magnet1=New cvpmMagnet
with Magnet1
.InitMagnet RoachTrigger1,3
.CreateEvents "Magnet1"
.AttractBall RoachBall
.Grabcenter = 1
.magneton = 0
end With
Set magnet2=New cvpmMagnet
with magnet2
.InitMagnet RoachTrigger2,3
.CreateEvents "magnet2"
.AttractBall RoachBall
.Grabcenter = 1
.magneton = 0
end With
Set Magnet3=New cvpmMagnet
with Magnet3
.InitMagnet RoachTrigger3,3
.CreateEvents "Magnet3"
.AttractBall RoachBall
.Grabcenter = 1
.magneton = 0
end With
Set Magnet4=New cvpmMagnet
with Magnet4
.InitMagnet RoachTrigger4,3
.CreateEvents "Magnet4"
.AttractBall RoachBall
.Grabcenter = 1
.magneton = 0
end With
End sub
sub startGame_timer
playsound "poweron"
if B2SOn then
Controller.B2ssetCredits Credit
Controller.B2ssetMatch 34, Matchnumb
Controller.B2SSetGameOver 35,1
Controller.B2SSetScorePlayer 1, Score(1) MOD 100000
Controller.B2SSetScorePlayer 2, Score(2) MOD 100000
Controller.B2SSetScorePlayer 3, RoachScore(1)
Controller.B2SSetScorePlayer 4, RoachScore(2)
end if
' lightdelay.enabled=true
me.enabled=false
end sub
sub lightdelay_timer
for each light in tlights:light.state=1:next
initdelay.enabled=1
me.enabled=0
end Sub
sub initdelay_timer
saahc=4
lacucaracha.enabled=1
if goroaches=0 then
roachstep=0
roachinit.enabled=1
AnimLoopTimer.enabled=1
goroaches=1
end if
me.enabled=0
end sub
Sub roachtimer_timer
Dim roachA,dx,dy
mirrorBall.x = RealBall.x
mirrorBall.y = RealBall.y
mirrorBall.z = 359.4-(.06993*(1927-RealBall.y))
roach.x = roachBall.x
roach.y = roachBall.y
'change roach rotation
dy=-1*roachBall.vely '-1*(EVAL("roachxy"&xx)(1)(roachstep)-EVAL("roachxy"&xx)(1)(roachstep-1)) 'delta Y
if dy=0 then dy=0.0000001 'avoid divide by zero errors
dx=RoachBall.velx 'EVAL("roachxy"&xx)(0)(roachstep)-EVAL("roachxy"&xx)(0)(roachstep-1) 'delta X
roachA=atn(dX/dY) 'angle in radians
if roachA<0 then roachA=roachA+PI 'correction for negative angles
roachA=int(roachA/(pi/180)) 'convert to degrees
if dx<0 then roachA=roachA+180 'correction for negative quadrants
Roach.roty=roachA
end sub
sub roachmove
if roachtimer.enabled=0 then
RoachScore(player)=RoachScore(player)+1
Rreels(player).setvalue RoachScore(player)
if B2SOn then Controller.B2SSetScorePlayer (player+2), RoachScore(Player)
RoachMagnetsOff
Do
roachran=int(rnd*5)
Loop while roachran=roachloc
select case roachran
case 0:
magnet0.magneton=true
case 1:
Magnet1.magneton=true
case 2:
magnet2.magneton=true
case 3:
magnet3.magneton=true
case 4:
magnet4.magneton=true
end Select
roachtimer.enabled=1
RoachAnimLoopTimer.enabled=1
select case RoachLoc
case 0:
RoachHole0.kick 180,4,0
case 1:
RoachHole1.kick 315,4,0
case 2:
RoachHole2.kick 45,4,0
case 3:
RoachHole3.kick 95,4,0
case 4:
RoachHole4.kick 290,4,0
end Select
end if
end sub
sub RoachAnimLoopTimer_Timer
Roach.ShowFrame frame
frame = frame + frameRate
If frame>18 Then ' the animation is a bit rough so don't play it till the end but stop a bit earlier
frame=0
end if
end sub
Sub RoachHole0_hit
RoachAnimLoopTimer.enabled=0
' Magnet0.magneton=False
RoachMagnetsOff
roachtimer.enabled=0
roachloc=0
End Sub
Sub RoachHole1_hit
RoachAnimLoopTimer.enabled=0
' Magnet1.magneton=False
RoachMagnetsOff
roachtimer.enabled=0
roachloc=1
End Sub
Sub RoachHole2_hit
RoachAnimLoopTimer.enabled=0
' magnet2.magneton=False
RoachMagnetsOff
roachtimer.enabled=0
roachloc=2
End Sub
Sub RoachHole3_hit
RoachAnimLoopTimer.enabled=0
' Magnet3.magneton=False
RoachMagnetsOff
roachtimer.enabled=0
roachloc=3
End Sub
Sub RoachHole4_hit
RoachAnimLoopTimer.enabled=0
' Magnet4.magneton=False
RoachMagnetsOff
roachtimer.enabled=0
roachloc=4
End Sub
Sub RoachMagnetsOff
Magnet0.magneton=False
Magnet1.magneton=False
magnet2.magneton=False
Magnet3.magneton=False
Magnet4.magneton=False
End Sub
sub lacucaracha_timer()
' me.interval=100
me.interval=150
Select Case saahc
Case 4: PlaySoundAt SoundFXDOF("bell1000",133,DOFPulse,DOFChimes), TrigRout
Case 5: PlaySoundAt SoundFXDOF("bell1000",133,DOFPulse,DOFChimes), TrigRout
case 6: PlaySoundAt SoundFXDOF("bell1000",133,DOFPulse,DOFChimes), TrigRout
case 7: PlaySoundAt SoundFXDOF("bell100",132,DOFPulse,DOFChimes), TrigRout
Case 9: PlaySoundAt SoundFXDOF("bell10",131,DOFPulse,DOFChimes), TrigRout
case 10: PlaySoundAt SoundFXDOF("bell1000",133,DOFPulse,DOFChimes), TrigRout
case 11: PlaySoundAt SoundFXDOF("bell1000",133,DOFPulse,DOFChimes), TrigRout
case 12: PlaySoundAt SoundFXDOF("bell1000",133,DOFPulse,DOFChimes), TrigRout
case 13: PlaySoundAt SoundFXDOF("bell100",132,DOFPulse,DOFChimes), TrigRout
Case 15: PlaySoundAt SoundFXDOF("bell10",131,DOFPulse,DOFChimes), TrigRout
Case 16: me.enabled=0
End Select
saahc = saahc + 1
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
gamov.text="Game Over"
If B2SOn then Controller.B2SSetGameOver 35,1
gamov.timerinterval= (INT (RND*10)+5)*100
gamov.timerenabled=1
end if
me.enabled=0
end sub
sub tilttxt_timer
if state=false then
tilttxt.text=""
If B2SOn then Controller.B2SSetTilt 33,0
ttimer.enabled=true
end if
tilttxt.timerenabled=0
end sub
sub ttimer_timer
if state=false then
tilttxt.text="TILT"
If B2SOn then Controller.B2SSetTilt 33,1
tilttxt.timerenabled=1
tilttxt.timerinterval= (INT (RND*10)+5)*100
end if
me.enabled=0
end sub
Sub CARtoons_KeyDown(ByVal keycode)
if keycode=AddCreditKey then
PlaySoundAt "coin3", Drain
if state=false then
creditreel.setvalue(credit)
end if
coindelay.enabled=true
end if
if keycode = 19 and roachtimer.enabled=0 then roachmove ' R Key
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
if keycode=StartGameKey and (credit>0 or freeplay=1) and OperatorMenu=0 And Not HSEnterMode=true And Not RSEnterMode=true then
if state=false then
if freeplay=0 then credit=credit-1
If credit < 1 Then DOF 122, DOFOff
playsoundat "click", Drain
creditreel.setvalue(credit)
ballinplay=1
' if goroaches=0 then lightdelay.enabled=true
lightdelay.enabled=true
'goroaches=1
If B2SOn Then
Controller.B2ssetCredits Credit
Controller.B2sStartAnimation "Startup"
Controller.B2ssetballinplay 32, Ballinplay
Controller.B2ssetplayerup 30, 1
Controller.B2SSetScoreRollover 24 + 1, 0
Controller.B2SSetScoreRollover 24 + 2, 0
Controller.B2ssetcanplay 31, 1
Controller.B2SSetGameOver 0
End If
playsound "initialize"
PUP1.state=1
tilt=false
state=true
CanPlayReel.setvalue 1
players=1
rst=0
resettimer.enabled=true
else if state=true and players < 2 and Ballinplay=1 then
if freeplay=0 then credit=credit-1
If credit < 1 Then DOF 122, DOFOff
players=players+1
creditreel.setvalue(credit)
If B2SOn then
Controller.B2ssetCredits Credit
Controller.B2ssetcanplay 31, 2
End If
CanPlayReel.setvalue 2
PlaySoundAt "click", Drain
end if
end if
end if
If HSEnterMode Then
HighScoreProcessKey(keycode)
elseIf RSEnterMode Then
HighRoachProcessKey(keycode)
end if
If keycode = PlungerKey Then
Plunger.PullBack
PlaySoundAt "plungerpull", Plunger
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=6 then Options=1
playsound "target"
Select Case (Options)
Case 1:
Option1.visible=true
Option5.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
Case 5:
Option5.visible=true
Option4.visible=False
End Select
end if
If keycode=RightFlipperKey and State = false and OperatorMenu=1 then
PlaySound "click"
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:
if ebmode=0 Then
ebmode=1
Else
ebmode=0
end if
OptionEBmode.image="OptionsEBmode"&ebmode
if ebmode=0 then
repcard.image = "replycard"&replays
else
repcard.image = "ebcard"&replays
end if
Case 4:
Replays=Replays+1
if Replays>3 then
Replays=1
end if
Replay1=Replay1Table(Replays)
Replay2=Replay2Table(Replays)
replay3=Replay3Table(Replays)
OptionReplays.image="OptionsReplays"&replays
if ebmode=0 then
repcard.image = "replycard"&replays
else
repcard.image = "ebcard"&replays
end if
Case 5:
OperatorMenu=0
savehs
HideOptions
End Select
End If
if tilt=false and state=true then
If keycode = LeftFlipperKey Then
leftflipperdimmer.enabled=1
LeftFlipper.RotateToEnd
PlaySoundat SoundFXDOF("fx_flipperup",101,DOFOn,DOFflippers), Lflip
PlayXYSound "Buzz",LeftCurvedRail,-1,.05,0,0,0,1
End If
If keycode = RightFlipperKey Then
rightflipperdimmer.enabled=1
RightFlipper.RotateToEnd
PlaySoundAt SoundFXDOF("fx_flipperup",102,DOFOn,DOFflippers), RFlip
PlayXYSound "Buzz1",RightCurvedRail, -1,.05,0,0,0,1
End If
If keycode = LeftTiltKey Then
Nudge 90, 2
checktilt
End If
If keycode = RightTiltKey Then
Nudge 270, 2
checktilt
flickertimer.enabled = 1
End If
If keycode = CenterTiltKey Then
Nudge 0, 2
checktilt
End If
If keycode = MechanicalTilt Then
gametilted
End If
end if
End Sub
sub roachinit_timer
Dim roachA,dx,dy, xx
roach1.x=roachxy1(0)(roachstep)
roach1.y=roachxy1(1)(roachstep)
Roach2.x=roachxy2(0)(roachstep)
Roach2.y=roachxy2(1)(roachstep)
roach3.x=roachxy3(0)(roachstep)
roach3.y=roachxy3(1)(roachstep)
roach4.x=roachxy4(0)(roachstep)
roach4.y=roachxy4(1)(roachstep)
if roachstep>0 Then
for xx = 1 to 4 'change each roach rotation
dy=-1*(EVAL("roachxy"&xx)(1)(roachstep)-EVAL("roachxy"&xx)(1)(roachstep-1)) 'delta Y
if dy=0 then dy=0.0000001 'avoid divide by zero errors
dx=EVAL("roachxy"&xx)(0)(roachstep)-EVAL("roachxy"&xx)(0)(roachstep-1) 'delta X
roachA=atn(dX/dY) 'angle in radians
if roachA<0 then roachA=roachA+PI 'correction for negative angles
roachA=int(roachA/(pi/180)) 'convert to degrees
if dx<0 then roachA=roachA+180 'correction for negative quadrants
EVAL("roach"&xx).roty=roachA
Next
end If
roachstep=roachstep+1
if roachstep=24 then
AnimLoopTimer.enabled=False
me.enabled=false
end if
end Sub
sub AnimLoopTimer_Timer
Roach1.ShowFrame frame
Roach2.ShowFrame frame
Roach3.ShowFrame frame
Roach4.ShowFrame frame
frame = frame + frameRate
If frame>18 Then ' the animation is a bit rough so don't play it till the end but stop a bit earlier
frame=0
end if
end sub
Sub DisplayOptions
OptionsBack.visible = true
Option1.visible = True
OptionBalls.visible = True
OptionEBmode.visible = True
OptionReplays.visible = True
OptionFreeplay.visible = True
End Sub
Sub HideOptions
for each objekt In OptionMenu
objekt.visible = false
next
End Sub
Sub OperatorMenuTimer_Timer
OperatorMenu=1
Displayoptions
Options=1
End Sub
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
Sub CARtoons_KeyUp(ByVal keycode)
dim li
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
If keycode = PlungerKey Then
Plunger.Fire
if PlungeBall=1 then
playsoundat "plunger", Plunger
else
playsoundat "plungerreleasefree", Plunger
end if
End If
if keycode = LeftFlipperKey then
OperatorMenuTimer.Enabled = false
end if
If tilt=false and state=true then
If keycode = LeftFlipperKey Then
leftflipperdimmer.enabled=0
if RightFlipper.currentangle>-60 then
For Each li in GI
li.Intensityscale = .4
Next
else
For Each li in GI
li.Intensityscale = 1
Next
end if
LeftFlipper.RotateToStart
PlaySoundat SoundFXDOF("fx_flipperdown",101,DOFOff,DOFflippers), Lflip
StopSound "Buzz"
End If
If keycode = RightFlipperKey Then
rightflipperdimmer.enabled=0
if leftFlipper.currentangle>110 then
For Each li in GI
li.Intensityscale = .4
Next
else
For Each li in GI
li.Intensityscale = 1
Next
end if
RightFlipper.RotateToStart
PlaySoundAt SoundFXDOF("fx_flipperdown",102,DOFOff,DOFflippers), RFlip
StopSound "Buzz1"
End If
End if
End Sub
sub LeftFlipperDimmer_timer
Dim li
For Each li in GI
li.Intensityscale = li.Intensityscale * .90
if li.intensityscale < .1 then li.intensityscale = .1
Next
End Sub
Sub RightFlipperDimmer_timer
Dim li
For Each li in GI
li.Intensityscale = li.Intensityscale * .90
if li.intensityscale<.1 then li.intensityscale=.1
Next
End sub
sub flippertimer_timer()
LFlip.RotY = LeftFlipper.CurrentAngle
RFlip.RotY = RightFlipper.CurrentAngle
pup1r.state=pup1.state
pup2r.state=pup2.state
PrimGate1.Rotz = gate.CurrentAngle*.75+20
if FlipperShadows=1 then
FlipperLSh.RotZ = LeftFlipper.currentangle
FlipperRSh.RotZ = RightFlipper.currentangle
end if
End Sub
Sub EBtimer_timer
starstate=0
if starred.state=1 then starstate=starstate+1
if starwhite.state=1 then starstate=starstate+1
if stargreen.state=1 then starstate=starstate+1
if staryellow.state=1 then starstate=starstate+1
if starstate=4 then ExtraBall.state=1
end sub
Sub PairedlampTimer_timer
red2.state = red1.state
white2.state = white1.state
green2.state = green1.state
yellow2.state = yellow1.state
white3.state = white1.state
green3.state = green1.state
end sub
'mike add->
Sub FlickerTimer_timer
If TLightRL1.State = 2 Then
TLightRL1.State = 0:Light4.state = 0
elseIf TLightRL1.State = 0 Then
TLightRL1.State = 1:Light4.State = 1
elseif TLightRL1.State = 1 Then
TLightRL1.State = 2:Light4.state = 2
end If
me.enabled = 0
End Sub
'<- mike add
sub coindelay_timer
addcredit
coindelay.enabled=false
end sub
sub resettimer_timer
rst=rst+1
scorereel1.resettozero
scorereel2.resettozero
roachReel1.resettozero
roachReel2.resettozero
P1100k.text = " "
P2100k.text = " "
If B2SOn then
Controller.B2SSetScore 1, score(1)
Controller.B2SSetScore 2, score(2)
Controller.B2SSetData 3,0
Controller.B2SSetData 4,0
End If
if rst=18 then
playsoundat "kickerkick", Drain
end if
if rst=22 then
newgame
resettimer.enabled=false
end if
end sub
Sub addcredit
if freeplay=0 then
credit=credit+1
DOF 122, DOFOn
if credit>15 then credit=15
creditreel.setvalue(credit)
If B2SOn Then Controller.B2ssetCredits Credit
end if
End sub
Sub Drain_Hit()
PlaySoundat "drain", Drain
DOF 108, DOFPulse
scorebonus.enabled=true
End Sub
sub ballhome_hit
plungeball=1
end sub
sub ballhome_unhit
DOF 128, DOFPulse
plungeball=0
end sub
sub ballrel_hit
if ballrenabled=1 then
if extraballs>0 then
extraballs=extraballs-1
if extraballs>1 then
shootagain.state=2
else
shootagain.state=1
end if
end if
if extraballs=0 then shootagain.state=0
ballrenabled=0
end if
end sub
sub scorebonus_timer
if tilt=true then
bonus=0
Else
if bonusx3.state=1 then
dbonus=3
'me.interval=425
elseif bonusx2.state=1 then
dbonus=2