-
Notifications
You must be signed in to change notification settings - Fork 37
/
Champions League (Season 18) TT&NZ v1.0.vbs
5527 lines (5132 loc) · 270 KB
/
Champions League (Season 18) TT&NZ v1.0.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
' `.:/+osyhhdddddddddhyys+/:.`
' ./oyddhyo+/:-.``` ``.--:+oshddyo/-`
' `:oymhs+:. `.-:` `-/shmho:`
' .+ymho:` .oyhdmmmd/ `+yyys+/-. `-+ydho-
' .+hdy/. -mms:-.` smd++syhmo `:sddo-
' `/hmy/` `- hmy-:/+oo -mms.` `` `:sdh+.
' .oddo. `hmy- /mmmdhyso` ymmdmmdyo ` `/hms-
' .omh/` .smmo` `dms`` `.` -mm/``-/+: ./ydh. `:ymy.
' `o/` .+- :dmh: +mmysyddm+ ymd` ./ymmmmm` -/`
' ommo` `smm: -+oo+/:.` ./- .+hmdy/:mm+
' :hmh: `mms `.-:::::::--.` :hmdy/.:-ymd`
' :hmh: `mms `.-:::::::--.` :hmdy/.:-ymd`
' `+mmy:..:ymd. `-/oyhyyssooooosssyhhyo/-` `-:` +hmmm/
' -sdmddmh+` `-+yhyo/-``` ``.-/syhy/- .mmh
' `.--.` -ohyo-` `.:shh+. .hm-
' `:yho-` `:yds- `:
' .hh+. .ods-
' `:` .o-
' ``.....``
' `-+yhdddddddho .-....-. .-....-. .....-` `-....- -....-` `...........` -.....-` `--:::-. -...... -..... `.-://///:-.
' `+hmmmdysooshmmy .odddd+` .odddd/` .sdddmo `/ddddm+ :ddddd+` `/dddddddddddhs: -ydddd:` .+yddmmmmmdho- -yddddh- .+dds. -shdmdhhhhdmmd-
' .hmmmh:` `-yh :mmmm- /mmmm. .dmmmmm- .mmmmmm- `dmmmmm/ dmmmy:--/odmmms` smmmd `odmmy/---:odmmms. smmmmmd/ .mm+ +mmmd:.````./ym:
'.dmmmy` `s :mmmm- /mmmm. `hmm+mmmh` -mmhmmmd` smddmmm+ dmmmo :mmmm: smmmd `ymmm+` .ymmmd. smm/dmmmo` .mm+ mmmmy` `o/
'ommmm. :mmmm:......+mmmm. smm+ hmmm+ :mm/smmms :mm/smmms dmmmo .mmmm: smmmd +mmmh `dmmmy smm`-hmmmy` .mm+ hmmmmhs/:-.` ``
'hmmmd :mmmmdddddddmmmmm. /mmy /mmmm. /mm/`hmmm+ `dmy ommmh dmmmo `.ymmms` smmmd hmmmy ommmm` smm` `smmmh- .mm+ .sdmmmmmmmdhs+-`
'hmmmd :mmmmdddddddmmmmm. /mmy /mmmm. /mm/`hmmm+ `dmy ommmh dmmmo `.ymmms` smmmd hmmmy ommmm` smm` `smmmh- .mm+ .sdmmmmmmmdhs+-`
'hmmmm. :mmmmo//////smmmm. -mmm+///mmmmy +mm: .dmmm- smd. /mmmd dmmmo/+syddhs:` smmmd ymmmd` /mmmm` smm` `+mmmd:.mm+ .:+shddmmmmmmy.
'/mmmmy` :mmmm- /mmmm. .dmmyyyyyymmmm/ smm- /mmmd/mm/ -mmmm` dmmmo `.-..` smmmd :mmmm+ ommmy smm` :dmmmsmm+ -. `-:+hmmmmy
' smmmmh:` `- :mmmm- /mmmm. `ymm+ ommmd. ymm. ommmmmy `mmmm- dmmmo smmmd ommmm+` `/mmmh. smm` .hmmmmm+ /h. .mmmmh
' +dmmmmho:-.-:+shh :mmmm- /mmmm. ommy `dmmms hmm. `hmmmd. mmmm/ mmmmo smmmd /hmmmho/::+ymmdo` smm` `smmmm+ :md+-.```.-smmmh-
' .+hdmmmmmmmmmdh/ -odddd+. -odddd+. .+hdds- `:hddddo. ./hddo: .ddd/ -+dddds: `/ddddy/. :ydddh:` `:shddmmddhy/. :ydd+- +ddd+ -hdmmdhhddmddy/`
' .:/+ooo+/:. ```````` ```````` ``````` .``````` ``````. ... ```````. `.``````` .``````` ..--..` `````` ...` `.--::/::-.`
'
'
'
' .....` ............ ....` ``--::-.` .....` `..... `...........
' `/mmmo. :mmmdhhhhhdh `smmms -ohddhyhdmd: -mmmy. .ommm/` -hmmmhhhhhhm.
' .mmm: `mmm/ `o .dmdmm: ommh:` `-y/ mmmo /mmm. ymmy /.
' .mmm: `mmm+```.- `hm+/mmd` +mmd` `. mmmo /mmm. ymmy````/
' .mmm: `mmmdhhhd+ smy``dmmo hmms `````` mmmo /mmm. ymmmhhhdh
' .mmm: `mmmo---// +mmysshmmm- ymmd -oddd/` mmmo /mmm. ymmh...-o
' .mmm: + `mmm/ .: -mm/----smmh` -mmmo` :mmm dmms /mmm` ymmy +
' .mmmo::::/sy `mmms:::::/h+ .dmo `mmm+ -hmmh+::/hmmm /mmm+-.-/dmmo ymmh:::::/sy
' `+yyyyyyyyyy/ `/yyyyyyyyyyy- .oss+. /ssss/ :oyhdhy+./y .+shhdhhy+- :syyyyyyyyyy+
' ````
'
' An original table created by Tom Tower & Ninuzzu
' Thanks to flupper for the domes and the bumper caps
' Thanks to VPDev team for the amazing VPX!
' All rights belong to UEFA and to their European Teams.
' All resources and musics have been found online, we hold no rights to any media used.
' Thalamus 2018-07-20
' This table has already its own version of "Positional Sound Playback Functions" and "Supporting Ball & Sound Functions"
Option Explicit
Randomize
' Thalamus - converted from wmv to mp4 - UltraDMD
Const Ballsize=51
Const BallMass=1.25
On Error Resume Next
ExecuteGlobal GetTextFile("Controller.vbs")
If Err Then MsgBox "Unable to open Controller.vbs. Ensure that it is placed in the Scripts folder"
On Error Goto 0
On Error Resume Next
ExecuteGlobal GetTextFile("Core.vbs")
If Err Then MsgBox "Unable to open Core.vbs. Ensure that it is placed in the Scripts folder"
On Error Goto 0
On Error Resume Next
ExecuteGlobal GetTextFile("UltraDMD_Options.vbs")
If Err Then MsgBox "Unable to open UltraDMD_Options.vbs. Ensure that it is placed in the Scripts folder"
On Error Goto 0
Const cGameName = "uefa_cl18" 'this is the table name needed by DOF and by VPreg.stg
Const cAssetsFolder="ChampionsLeague" 'the folder that contains gifs, videos (the assets folder) used for DMD
Const cDefaultDMDColor = "PowderBlue" 'this is the default DMD text color defined for this table
'************************************************************************
'*ULTRADMD STUFF*********************************************************
'************************************************************************
'*DMD SCENES WITH PRIORITY***********************************************
Dim OldPriority:Oldpriority=0
Sub UDMD_Display(bkgnd,toptext,topBrightness, topOutlineBrightness, bottomtext, bottomBrightness, bottomOutlineBrightness, animateIn,pauseTime,animateOut,priority)
If priority >= OldPriority Then
UltraDMD.CancelRendering
UltraDMD.DisplayScene00Ex bkgnd, toptext, topBrightness, topOutlineBrightness, bottomtext, bottomBrightness, bottomOutlineBrightness, animateIn, pauseTime, animateOut
SCReset.Enabled=1
End If
OldPriority = priority
End Sub
Sub SCReset_Timer()
If Not UltraDMD.IsRendering Then
'When the scene finishes rendering, Then immediately display the scoreboard
Me.Enabled=0
OnScoreboardChanged
If OptMusicEnabled Then OptMusicEnabled=False
End If
End Sub
'*DMD SCORING*********************************************************
Dim p1score, p2score, p3score, p4score, creditString
Sub GetPricing
If FreePlay=0 Then
creditString = "credits " & creditgame
Else
creditString = "FREE PLAY"
End If
End Sub
Sub SetScoring
For ii=1 to NewPlayer
ExecuteGlobal ("p" & ii & "score=" & scores(ii-1) & ":")
Next
If NewPlayer<>4 Then
For ii=(NewPlayer+1) to 4
ExecuteGlobal ("p" & ii & "score=0" & ":")
Next
End If
End Sub
Sub OnScoreboardChanged
SetScoring:GetPricing:Oldpriority=0
If gmover= 0 Then
On Error Resume Next
UltraDMD.DisplayScoreboard00 NewPlayer, CurrentPlayer+1, p1score, p2score, p3score, p4score, creditString, "ball " & ballinplay(CurrentPlayer)
If Err.number <> 0 Then UltraDMD.DisplayScoreboard NewPlayer, CurrentPlayer+1, p1score, p2score, p3score, p4score, creditString, "ball " & ballinplay(CurrentPlayer)
Else
On Error Resume Next
UltraDMD.DisplayScoreboard00 NewPlayer, CurrentPlayer+1, p1score, p2score, p3score, p4score, creditString, " "
If Err.number <> 0 Then UltraDMD.DisplayScoreboard NewPlayer, CurrentPlayer+1, p1score, p2score, p3score, p4score, creditString, " "
End If
End Sub
'************************************************************************
'*BALL TYPE *************************************************************
'************************************************************************
Sub UpdateBall
Dim b,BOT:BOT=GetBalls:B2SEffect B2SLight4,3,50
For b=0 to Ubound(BOT)
If Table1.VersionMajor > 10 OR (Table1.VersionMajor = 10 AND Table1.VersionMinor > 3) Then
If GKMM=0 AND MVPOfTheYear(CurrentPlayer)=0 AND progress(CurrentPlayer)<5 Then
If BallType=1 Then
On Error Resume Next
BOT(b).DecalMode=True
BOT(b).image="black":BOT(b).FrontDecal="ball_decal1" 'CL 18 MatchBall
BOT(b).BulbIntensityScale=0.1:BOT(b).PlayfieldReflectionScale=0
Else
On Error Resume Next
BOT(b).DecalMode=False
BOT(b).image="ball":BOT(b).FrontDecal="Scratches" 'Steel Ball
BOT(b).BulbIntensityScale=1:BOT(b).PlayfieldReflectionScale=1
End If
End If
If GKMM=0 AND MVPOfTheYear(CurrentPlayer)=0 AND progress(CurrentPlayer)>=5 Then
On Error Resume Next
BOT(b).DecalMode=True
BOT(b).image="black":BOT(b).FrontDecal="ball_decal2" 'CL 18 Finale
BOT(b).BulbIntensityScale=0.1:BOT(b).PlayfieldReflectionScale=0
End If
If GKMM=1 Then
On Error Resume Next
BOT(b).DecalMode=True
BOT(b).image="black":BOT(b).FrontDecal="ball_decal3" 'CL 18 Orange
BOT(b).BulbIntensityScale=0.1:BOT(b).PlayfieldReflectionScale=0
End If
If MVPOfTheYear(CurrentPlayer)=1 Then 'Ballon d'Or
On Error Resume Next
BOT(b).DecalMode=False
BOT(b).image="ball":BOT(b).color=RGB(250,180,90):BOT(b).FrontDecal="ball_decal4"
BOT(b).BulbIntensityScale=0.25:BOT(b).PlayfieldReflectionScale=1
End If
Else
BOT(b).image="ball":BOT(b).FrontDecal="Scratches" 'Steel Ball
BOT(b).BulbIntensityScale=1:BOT(b).PlayfieldReflectionScale=1
End If
Next
End Sub
'************************************************************************
'*GAME MUSIC*************************************************************
'************************************************************************
Dim rMusic,MusicList,optMusicVolume,optMusicEnabled
Sub InitMusic
Set MusicList = CreateObject("System.Collections.ArrayList")
MusicList.Add "bgout_UEFACL - ACDC - Thunderstruck.mp3" 'index 0
MusicList.Add "bgout_UEFACL - Deep Purple - Smoke On The Water.mp3" 'index 1
MusicList.Add "bgout_UEFACL - Guns N Roses - Welcome To The Jungle.mp3" 'index 2
MusicList.Add "bgout_UEFACL - Iggy Pop - Lust for Life.mp3" 'index 3
MusicList.Add "bgout_UEFACL - Iron Maiden - The Trooper.mp3" 'index 4
MusicList.Add "bgout_UEFACL - Jethro Tull - Locomotive Breath.mp3" 'index 5
MusicList.Add "bgout_UEFACL - Jimi Hendrix - Voodoo Child.mp3" 'index 6
MusicList.Add "bgout_UEFACL - Pink Floyd - One of These Days.mp3" 'index 7
MusicList.Add "bgout_UEFACL - Ram Jam - Black Betty.mp3" 'index 8
MusicList.Add "bgout_UEFACL - Ramones - Blitzkrieg Bop.mp3" 'index 9
MusicList.Add "bgout_UEFACL - RATM - Killing In The Name.mp3" 'index 10
MusicList.Add "bgout_UEFACL - Sex Pistols - God save the queen.mp3" 'index 11
MusicList.Add "bgout_UEFACL - Survivor - Eye of the Tiger.mp3" 'index 12
MusicList.Add "bgout_UEFACL - MultiMode.mp3" 'index 13
MusicList.Add "bgout_UEFACL - MultiMode2.mp3" 'index 14
MusicList.Add "bgout_UEFACL - GKMode.mp3" 'index 15
MusicList.Add "bgout_UEFACL - HighScore.mp3" 'index 16
MusicList.Add "bgout_UEFACL - IntroHS.mp3" 'index 17
MusicList.Add "bgout_UEFACL - finalVideo.mp3" 'index 18
MusicList.Add "bgout_UEFACL - win.mp3" 'index 19
MusicList.Add "bgout_UEFACL - MVPMode.mp3" 'index 20
MusicList.Add "bgout_UEFACL - Intro.mp3" 'index 21
MusicList.Add "bgout_UEFACL - Intro2.mp3" 'index 22
optMusicVolume=LoadValue (cGameName, "Volume")
If optMusicVolume = "" then
optMusicVolume = 1
SaveValue cGameName, "Volume", 100
Else
optMusicVolume=optMusicVolume/100
End If
optMusicEnabled=False
End Sub
Sub Music
If cAttractMode=0 AND gkmm=0 AND VMOn=0 AND MVPOfTheYear(CurrentPlayer)=0 AND NOT (lmultilock.state=1 OR Lmultiticket.state=1 OR Lmultiskill.state=1) Then rMusic=RndNum(0,12):PlayMusic MusicList(rMusic), optMusicVolume
If cAttractMode=0 AND gkmm=0 AND VMOn=0 AND MVPOfTheYear(CurrentPlayer)=0 AND (lmultilock.state=1 OR Lmultiticket.state=1 OR Lmultiskill.state=1) Then rMusic=RndNum(13,14):PlayMusic MusicList(rMusic), optMusicVolume
If GKMM=1 OR VMOn=1 Then PlayMusic MusicList(15),optMusicVolume
If HSPlace>=0 Then PlayMusic MusicList(16),optMusicVolume
If MVPOfTheYear(CurrentPlayer)=1 Then PlayMusic MusicList(20),optMusicVolume
End Sub
Sub Table1_MusicDone():Music:End Sub
Sub StopMusic:EndMusic:End Sub
'************************************************************************
'*TABLE INIT*************************************************************
'************************************************************************
Const MaximumCredits=9 'set the max number of credits the rom can support
Dim LockMultiMode,TicketMultiMode,SkillMultiMode '0=off,1=on(light blinking),2=running (light On)
Dim bip,creditgame,b1force,b2force,flforce,TeamSelection,SelectedTeams,CurrentPlayer,NewPlayer,ii
ReDim Lampstate(AllInserts.count),AllPlayersLampStates(3,AllInserts.count)
Dim choiceteam(3),numBump(3), JetLevel(3), SkillShotMade(3)
Dim ballinplay(3),extraball(3),extraballmax(3),maxballs(3),completed(3)
Dim win(3),defencestate(3),progress(3),DefenceLocked(3),BLhit(3),BRhit(3),FKGoal(3)
Dim StrikerMode(3),StrikerModeStart(3),FKAward(3),SemiFinalAward(3),BSMODE(3),MVPOfTheYear(3),TDState(3)
Dim teamsix(3),teamfive(3),teamfour(3),teamthree(3),teamtwo(3),teamone(3)
Dim vs1(3),vs2(3),vs3(3),vs4(3),vs5(3),vs6(3)
Dim scores(3),CLChamp(3),FKChamp(3),LockMScoreBest(3),VMChamp(3),GKMChamp(3)
Sub Table1_Init()
LoadEM
LoadTableOptions
GameInit:InitMusic:GiOff
InitUltraDMD cAssetsFolder,cGameName
RailL.visible=Table1.ShowDT:RailLb.visible=Table1.ShowDT
RailR.visible=Table1.ShowDT:RailRb.visible=Table1.ShowDT
RailLC.visible=Table1.ShowDT
If Table1.VersionMajor>10 OR (Table1.VersionMajor=10 AND Table1.VersionMinor>3) Then ToysBar.BlendDisableLightingFromBelow=0.9
If Table1.VersionMajor=10 AND Table1.VersionMinor=3 Then hotdogTL.intensity=0:canTL.intensity=0:chipsTL.intensity=0
b1force=Bumper1.Force:b2force=Bumper2.Force:flforce=RightFlipper.Strength:Plunger.MechStrength=BallMass*100
LoadHighScores
End Sub
Sub Table1_Exit()
If B2SOn Then Controller.Stop
ExitUltraDMD
SaveHighScores
SaveValue cGameName, "Volume", 100*optMusicVolume
End Sub
'************************************************************************
'*GAME INTRO*************************************************************
'************************************************************************
Dim rndIntro,introtime,displaystart,introtxt,opadir:displaystart=0:introtxt=0:opadir=-1
Sub skipultradmd_timer
If NOT UltraDMD.IsRendering Then
me.enabled=0
GIOn:StartAttractMode:PlaySound "reset"
DisplayIntro.Interval=100:DisplayIntro.enabled=1
End If
End Sub
Sub DisplayIntro_timer()
If NOT UltraDMD.IsRendering AND cAttractMode=1 Then
Me.Enabled=0:Randomize
rndIntro=RndNum(1,2)
If displaystart=0 Then
UltraDMD.DisplayScene00Ex "ttnzprsent.png", "", -1,-1, "", -1,-1, UltraDMD_Animation_ScrollOnDown, 2000, UltraDMD_Animation_FadeOut
If rndIntro=1 Then PlayMusic MusicList(21),optMusicVolume:introtime=41500
If rndIntro=2 Then PlayMusic MusicList(22),optMusicVolume:introtime=38000
End If
If displaystart=1 Then introtime=10000
If rndIntro=1 Then UltraDMD.DisplayScene00Ex "CLIntro.gif", "", -1, -1,"", -1, -1, UltraDMD_Animation_FadeIn, introtime, UltraDMD_Animation_FadeOut
If rndIntro=2 Then UltraDMD.DisplayScene00Ex "CLIntro2.mp4", "", -1, -1,"", -1, -1, UltraDMD_Animation_FadeIn, introtime, UltraDMD_Animation_FadeOut
DisplayIntroHS.enabled=1
End If
End Sub
Sub DisplayIntro1_timer()
Select Case introtxt
Case 0
If SCframe.opacity>100 Then opadir=-1
If SCframe.opacity=0 Then SCframe.imageA="LCD_introtxt_0":introtxt=1:opadir=1
Case 1
If SCframe.opacity>100 Then opadir=-1
If SCframe.opacity=0 Then SCframe.imageA="LCD_introtxt_1":introtxt=2:opadir=1
Case 2
If SCframe.opacity>100 Then opadir=-1
If SCframe.opacity=0 Then SCframe.imageA="LCD_introtxt_2":introtxt=3:opadir=1
Case 3
If SCframe.opacity>100 Then opadir=-1
If SCframe.opacity=0 Then SCframe.imageA="LCD_introtxt_3":introtxt=4:opadir=1
Case 4
If SCframe.opacity>100 Then opadir=-1
If SCframe.opacity=0 Then SCframe.imageA="LCD_introtxt_4":introtxt=5:opadir=1
Case 5
If SCframe.opacity>100 Then opadir=-1
If SCframe.opacity=0 Then SCframe.imageA="LCD_introtxt_00":introtxt=0:opadir=1
End Select
SCframe.Opacity=SCframe.Opacity+5*opadir
End Sub
Sub DisplayIntroHS_Timer()
If Not UltraDMD.IsRendering Then
Me.Enabled=0
If displaystart=0 Then
PlayMusic MusicList(17),optMusicVolume
UltraDMD.DisplayScene00 "", HSStrings(0),15, highScoreName(0) & " " & formatnumber(highScore(0),0), 15, UltraDMD_Animation_None, 3000, UltraDMD_Animation_None
UltraDMD.DisplayScene00 "", "HIGHSCORES",15, "", 15, UltraDMD_Animation_None, 1300, UltraDMD_Animation_None
UltraDMD.DisplayScene00 "", "1) " & bestnames(0) & " " & formatnumber(bestscores(0),0),15, "2) " & bestnames(1) & " " & formatnumber(bestscores(1),0), 15, UltraDMD_Animation_None, 3000, UltraDMD_Animation_None
UltraDMD.DisplayScene00 "", "3) " & bestnames(2) & " " & formatnumber(bestscores(2),0),15, "4) " & bestnames(3) & " " & formatnumber(bestscores(3),0), 15, UltraDMD_Animation_None, 3000, UltraDMD_Animation_None
UltraDMD.DisplayScene00 "", HSStrings(1),15, highScoreName(1) & " " & highScore(1) & " CL WINS", 15, UltraDMD_Animation_None, 3000, UltraDMD_Animation_None
UltraDMD.DisplayScene00 "", HSStrings(2),15, highScoreName(2) & " " & highScore(2) & " FREE KICKS", 15, UltraDMD_Animation_None, 3000, UltraDMD_Animation_None
UltraDMD.DisplayScene00 "", HSStrings(3),15, highScoreName(3) & " " & formatnumber(highScore(3),0), 15, UltraDMD_Animation_None, 3000, UltraDMD_Animation_None
UltraDMD.DisplayScene00 "", HSStrings(4),15, highScoreName(4) & " " & formatnumber(highScore(4),0), 15, UltraDMD_Animation_None, 3000, UltraDMD_Animation_None
UltraDMD.DisplayScene00 "", HSStrings(5),15, highScoreName(5) & " " & formatnumber(highScore(5),0), 15, UltraDMD_Animation_None, 3000, UltraDMD_Animation_None
End If
DisplayIntro.enabled=1
End If
End Sub
Sub DisplayStartScreen_Timer()
If Not UltraDMD.IsRendering Then
Me.Enabled=0
If FreePlay=1 Then UltraDMD.DisplayScene00Ex "freeplay.gif", " ", 14, 2, "", -1, -1, UltraDMD_Animation_ScrollOnUp, 4000, UltraDMD_Animation_ScrollOffDown
UltraDMD.DisplayScene00Ex "press_start.gif", " ", 14, 2, "", -1, -1, UltraDMD_Animation_ScrollOnUp, 10000, UltraDMD_Animation_ScrollOffDown
displaystart=1:DisplayIntro.enabled=1
End If
End Sub
'************************************************************************
'* GAME INIT ************************************************************
'************************************************************************
Sub GameInit
For ii=0 to 3
scores(ii)=0:choiceteam(ii)=1:completed(ii)=0:numBump(ii)=0:JetLevel(ii)=1:SkillShotMade(ii)=0
ballinplay(ii)=1:extraball(ii)=0:extraballmax(ii)=0:maxballs(ii)=0
win(ii)=0:defencestate(ii)=0:progress(ii)=0:DefenceLocked(ii)=0:BLhit(ii)=0:BRhit(ii)=0
StrikerMode(ii)=0:StrikerModeStart(ii)=0:FKAward(ii)=0:SemiFinalAward(ii)=0:BSMODE(ii)=0:MVPOfTheYear(ii)=0:TDState(ii)=0
CLChamp(ii)=0:FKChamp(ii)=0:FKGoal(ii)=0:LockMScoreBest(ii)=0:VMChamp(ii)=0:GKMChamp(ii)=0
Next
NewPlayer=0:CurrentPlayer=0:TeamSelection=0:SelectedTeams=0
LockMultiMode=0:TicketMultiMode=0:SkillMultiMode=0
lpin.isdropped=1:rpin.isdropped=1:wall61.isdropped=1
wkl1.isdropped=1:Wkl2.isdropped=1:wkc1.isdropped=1:Wkc2.isdropped=1:wkr1.isdropped=1:Wkr2.isdropped=1
GKMHelper1.IsDropped=1:GKMHelper2.IsDropped=1
hitLD.isdropped=1:WALL32.isdropped=1
hitRD.isdropped=1:WALL33.isdropped=1
screenprim.visible=1:screenprim.image="logoCL"
LeftFlipper.RotatetoStart:RightFlipper.RotatetoStart
LeftFlipper1.RotatetoStart:RightFlipper1.RotatetoStart
LdefL.Height=headDEF1.Z+100:LdefC.Height=headDEF2.Z+100:LdefR.Height=headDEF3.Z+100
LbombL.Height=-140:LbombR.Height=-140
ResetAllToys:ResetGK:WallDrain.IsDropped=1
For each ii in AllInserts:ii.state=0:Next
For each ii in TeamLogos:StopFlash ii,0:Next
For each ii in VMFlashers:StopFlash ii,0:next
StopFlash TDFL1,0:StopFlash TDFL2,0:StopFlash TDFL3,0:StopFlash VMFlasher,0:StopFlash lClwin,0:UpdateB2SLogos
StopFlash Fl1a,0:StopFlash Fl2a,0:StopFlash Fl3a,0:StopFlash Fl4a,0
StopFlash FKFL1,0:StopFlash FKFL2,0:StopFlash FKFL3,0:StopFlash FKFL4,0:StopFlash FKFL5,0
End Sub
Sub ResetAllToys
If headGK.Z>0 Then GKHOLEin.enabled=1
defencedown.enabled=1
If headLD.Z>0 Then bomberLdown.enabled=1:PlaySoundAt SoundFXDOF("fx_postdown",134,DOFPulse,DOFDropTargets),headLD
If headRD.Z>0 Then bomberRdown.enabled=1:PlaySoundAt SoundFXDOF("fx_postdown",135,DOFPulse,DOFDropTargets),headRD
If TrapDoorP.Z>0 then OpenTrapDoor False
If DiverterP.Z<50 Then TicketDiverter True
TabletDown
End Sub
Sub ResetGK
For each ii in GkWalls:ii.IsDropped=1:Next
GKwalls(4).isdropped=0:GKwalls(5).isdropped=0
ResetGKTimer.enabled=1
End Sub
Sub ResetGKTimer_Timer
If headGK.transx>0 Then
headGK.transx=headGK.transx-1
bootsGK.transx=headGK.transx-1
kitGK.transx=headGK.transx-1
bodyGK.transx=headGK.transx-1
GKpost.transx=headGK.transx-1
End If
If headGK.transx<0 Then
headGK.transx=headGK.transx+1
bootsGK.transx=headGK.transx+1
kitGK.transx=headGK.transx+1
bodyGK.transx=headGK.transx+1
GKpost.transx=headGK.transx+1
End If
If headGK.transx=0 Then ResetGKTimer.enabled=0
End Sub
Sub DisableTable(Enabled)
If Enabled Then
'turn off GI
GiOff
'turn off kick again light
If kickagainT.enabled OR Lkag.state=1 Then kickagainT.enabled=0:kickcount=0:kicked=0:Lkag.state=0:BSaverAward=0
'turn off multiball modes lights
If Lmultilock.state=1 Then
Lmultilock.state=0:LockMultiMode=0
lockjackpot.state=0:skilljackpot.state=0:ticketjackpot.state=0:superjackpot.state=0
Llock.state=2:Llock1.state=2:Llock2.state=2:Llock3.state=2
TicketDiverter True
If subwall.Z > 140 Then TabletDown
subwall.image = "sub_text"
njack=0:kicked=0:bonus=0
End If
If Lmultiskill.state=1 Then
Lmultiskill.state=0:SkillMultiMode=0
skilljackpot.state=0:superjackpot.state=0
skill1.state=2:skill2.state=2:skill3.state=2
TicketDiverter True
skill=0:kicked=0:bonus=0
End If
If Lmultiticket.state=1 Then
Lmultiticket.state=0:TicketMultiMode=0
ticketjackpot.state=0:superjackpot.state=0
ticket1.state=2:ticket2.state=2:ticket3.state=2
TicketDiverter True
ticket=0:kicked=0:bonus=0
End If
'Disable slings, bumpers ...
LeftFlipper.RotatetoStart:RightFlipper.RotatetoStart
LeftFlipper1.RotatetoStart:RightFlipper1.RotatetoStart
LeftSlingshot.Disabled=1:RightSlingshot.Disabled=1
Bumper1.Force=0
Bumper2.Force=0
If moveGK.enabled AND GKMM=0 Then moveback=1:moveGK.enabled=0:ResetGK
kickagain=0:cBonusM=0 'disable bonus
DisplayInfoTimer.Enabled=0:DisplayRulesTimer.Enabled=0
If cGameRules Then cGameRules=False:RulesDT.visible=0:RulesFS.visible=0
If cInstantInfo Then CheckGameInfo.Enabled=0:UltraDMD.CancelRendering:cInstantInfo=False
Else
'turn back on GI
GiOn
'Enable slings, bumpers ....
LeftSlingshot.Disabled=0:RightSlingshot.Disabled=0
Bumper1.Force=b1force:Bumper2.Force=b2force
If moveback=1 Then ResetGKTimer.Enabled=0:moveGK.enabled=1:moveback=0:Lshoot.state=2
kickagain=1
End If
End Sub
'************************************************************************
'*GAME OVER *************************************************************
'************************************************************************
Dim gmover:gmover=0
Sub GameOver_Timer()
gmover=1
If Not UltraDMD.IsRendering Then
'When the scene finishes, display the game over screen, after 4 seconds display the final score
Me.Enabled=0:moveGK.enabled=0:StopMusic
UDMD_Display "", "GAME OVER", 14, 2, "", -1, -1, UltraDMD_Animation_ScrollOnUp, 4000, UltraDMD_Animation_FadeOut,10
CheckforNewGame.Interval=8000
CheckforNewGame.Enabled=1
End If
End Sub
Sub CheckforNewGame_Timer()
Me.Enabled=0:gmover=0
If creditgame=0 AND FreePlay=0 Then UltraDMD.CancelRendering:DisplayIntro.enabled=1:GameInit:StartAttractMode
If (creditgame>0 or FreePlay=1) AND resetcomplete=1 Then UltraDMD.CancelRendering:DisplayStartScreen.Enabled=1:GameInit:StartAttractMode
End Sub
'*********************************************************************
'*****TILT************************************************************
'*********************************************************************
Dim TiltLevel, TiltWarnings, Tilted, RndNudge
TiltLevel=0:TiltWarnings=0:Tilted=0
Sub AddToTilt(byVal Power)
TiltLevel=TiltLevel+(10*Power*TiltSensitivity)
TiltDecrease.Enabled=1
TiltDecrease.Interval=50
If TiltLevel>200 Then
TiltWarnings=TiltWarnings+1
If TiltLevel>400 Then TiltWarnings=TiltWarnings+1
If TiltLevel>600 Then TiltWarnings=TiltWarnings+1
If TiltWarnings>TiltMaxWarnings Then
PlaySound "V.red card"
StopMusic
DisableTable 1:Tilted=1:bonus=0:bonusP=0
LightSeqTilt.Play SeqAllOff
UltraDMD.CancelRendering:UltraDMD.DisplayScene00Ex "redcard.gif", " TILT ", 15,0,"",15,0,UltraDMD_Animation_None, 6000, UltraDMD_Animation_None
'start the Tilt recovery to check for all the balls to be drained
TiltRecovery.Interval=3000
TiltRecovery.Enabled=1
Else
PlaySound "V.yellowcard":UltraDMD.CancelRendering
UDMD_Display "yellowcard.gif", "* WARNING *", 15,0,"",15,0,UltraDMD_Animation_FadeIn, 1500, UltraDMD_Animation_FadeOut,10
End If
End If
End Sub
Sub TiltDecrease_Timer
TiltLevel=TiltLevel-(TiltLevel*.1)
If TiltLevel < 1 Then TiltDecrease.Enabled=0:TiltLevel=0
End Sub
Sub TiltRecovery_Timer
Me.Enabled=0
If BIP=0 Then
TiltDelay.Interval=1000
TiltDelay.Enabled=1
If UltraDMD.IsRendering Then UltraDMD.CancelRendering
OnScoreboardChanged
Else
TiltRecovery.Interval=1000
TiltRecovery.Enabled=1
End If
End Sub
Sub TiltDelay_Timer
Me.Enabled=0
DisableTable 0:Tilted=0:TiltLevel=0:TiltWarnings=0:LightSeqTilt.StopPlay:PlayerCheck
End Sub
Sub SlamTilt_Timer
Me.Enabled=0
Tilted=0:kicked=0:TiltWarnings=0
' If all the balls have been drained Then.
If BIP=0 Then
DisableTable 0:LightSeqTilt.StopPlay
For each ii in TeamLogos:StopFlash ii,0:Next
SCFrame.opacity=100:SCFrame.imageA="LCD_Introtxt_00":SCFrame.visible=1
GameOver.Enabled=1
Else
SlamTilt.Interval=1000
SlamTilt.Enabled=1
End If
End Sub
Sub LightSeqTilt_PlayDone()
'when finishes the queue it restarts the sequence again
LightSeqTilt.Play SeqAllOff
End Sub
'************************************************************************
'*KEYS*******************************************************************
'************************************************************************
Sub Table1_KeyDown(ByVal keycode)
If keycode = LeftFlipperKey AND cAttractMode=0 AND GKMM=0 AND VMOn=0 AND Tilted=0 AND cursorPos=40 Then
LeftFlipper.RotateToEnd
leftFlipper1.RotateToEnd
PlaySoundAt SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), LeftFlipper
End If
If keycode = RightFlipperKey AND cAttractMode=0 AND GKMM=0 AND VMOn=0 AND Tilted=0 AND cursorPos=40 Then
RightFlipper.RotateToEnd
RightFlipper1.RotateToEnd
PlaySoundAt SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), RightFlipper
End If
'****CREDITS************************************************************
If keycode=AddCreditKey AND Not skipultradmd.Enabled AND Tilted=0 AND Not OptMenuEnabled Then
PlaySound "fx_coin"
If creditgame<MaximumCredits AND FreePlay=0 Then creditgame=creditgame+1
DOF 150, DOFOn:GiEffect 0
If cAttractMode=1 Then
If NOT DisplayStartScreen.Enabled Then
DisplayIntroHS.Enabled=0:DisplayIntro.Enabled=0:StopMusic
UltraDMD.CancelRendering
DisplayStartScreen.Enabled=1
Else
If FreePlay=0 Then OnScoreboardChanged
End If
Else
If FreePlay=0 Then OnScoreboardChanged
End If
End If
'****ADD NEW PLAYERS ************************************************************
If keycode=StartGameKey AND cAttractMode=1 AND Not skipultradmd.Enabled AND Tilted=0 AND resetcomplete=1 AND Not OptMenuEnabled Then AddNewPlayers
If keycode=StartGameKey AND cAttractMode=0 AND Not skipultradmd.Enabled AND Tilted=0 AND ballinplay(0)=1 AND (creditgame>0 or FreePlay=1) Then AddNewPlayers 'new players can be added also when player1 is playing the first ball
'****TEAM SELECTION************************************************************
If keycode = LeftFlipperKey AND TeamSelection=1 Then
If TeamLogos(0).timerEnabled OR TeamLogos(1).timerEnabled OR TeamLogos(2).timerEnabled OR TeamLogos(3).timerEnabled OR TeamLogos(4).timerEnabled OR TeamLogos(5).timerEnabled OR TeamLogos(6).timerEnabled Then
For Each ii in TeamLogos:StopFlash ii,0:Next
End If
choiceteam(CurrentPlayer)=choiceteam(CurrentPlayer)-1
If choiceteam(CurrentPlayer)>32 Then choiceteam(CurrentPlayer)=1
If choiceteam(CurrentPlayer)<1 Then choiceteam(CurrentPlayer)=32
screenprim.image="logo" & choiceteam(CurrentPlayer):TeamLogos(3).imageA="logo" & choiceteam(CurrentPlayer):Flash TeamLogos(3),250
UltraDMD.CancelRendering
UltraDMD.DisplayScene00Ex "logo" & choiceteam(CurrentPlayer) &".png","SELECT YOUR TEAM", 14, 3, TeamList(choiceteam(CurrentPlayer)-1), 1, 14, UltraDMD_Animation_None, 999999, UltraDMD_Animation_None
End If
If keycode = RightFlipperKey AND TeamSelection=1 Then
If TeamLogos(0).timerEnabled OR TeamLogos(1).timerEnabled OR TeamLogos(2).timerEnabled OR TeamLogos(3).timerEnabled OR TeamLogos(4).timerEnabled OR TeamLogos(5).timerEnabled OR TeamLogos(6).timerEnabled Then
For Each ii in TeamLogos:StopFlash ii,0:Next
End If
choiceteam(CurrentPlayer)=choiceteam(CurrentPlayer)+1
If choiceteam(CurrentPlayer)>32 Then choiceteam(CurrentPlayer)=1
If choiceteam(CurrentPlayer)<1 Then choiceteam(CurrentPlayer)=32
screenprim.image="logo" & choiceteam(CurrentPlayer):TeamLogos(3).imageA="logo" & choiceteam(CurrentPlayer):Flash TeamLogos(3),250
UltraDMD.CancelRendering
UltraDMD.DisplayScene00Ex "logo" & choiceteam(CurrentPlayer) &".png","SELECT YOUR TEAM", 14, 3, TeamList(choiceteam(CurrentPlayer)-1) , 1, 14, UltraDMD_Animation_None, 999999, UltraDMD_Animation_None
End If
'****SHOW STATUS REPORT ******************************************************
If keycode = LeftFlipperKey AND bip>0 AND cAttractMode=0 AND TeamSelection=0 AND FK=0 AND GKMM=0 AND VMOn=0 AND Tilted=0 Then DisplayInfoTimer.Enabled=1
If keycode = RightFlipperKey AND bip>0 AND cAttractMode=0 AND TeamSelection=0 AND FK=0 AND GKMM=0 AND VMOn=0 AND Tilted=0 Then DisplayInfoTimer.Enabled=1
'****SHOW GAME RULES *********************************************************
If keycode = LeftFlipperKey OR keycode = RightFlipperKey Then
If cAttractMode=1 OR (cAttractMode=0 AND ballinplunger AND Tilted=0) Then DisplayRulesTimer.Enabled=1
End If
'****BONUS LIGHTS************************************************************
If keycode = LeftFlipperKey AND cAttractMode=0 AND TeamSelection=0 AND Tilted=0 Then SwapBonusLights
If keycode = RightFlipperKey AND cAttractMode=0 AND TeamSelection=0 AND Tilted=0 Then SwapBonusLights
'****GKMOVEMODE************************************************************
If keycode = LeftFlipperKey AND GKMM=1 AND Tilted=0 Then
PlaySoundAt SoundFXDOF("fx_DropTargetUp",101,DOFOn,DOFFlippers),headGK
HEADGK.X=387:bootsGK.X=387:bodyGK.X=387:kitGK.X=387:GKPOST.X=387
GKWalls(0).IsDropped=0
For ii=1 to 9:GKWalls(ii).IsDropped=1:Next
End If
If keycode = RightFlipperKey AND GKMM=1 AND Tilted=0 Then
PlaySoundAt SoundFXDOF("fx_DropTargetUp",102,DOFOn,DOFFlippers),headGK
HEADGK.X=487:bootsGK.X=487:bodyGK.X=487:kitGK.X=487:GKPOST.X=487
GKWalls(9).IsDropped=0
For ii=0 to 8:GKWalls(ii).IsDropped=1:Next
End If
'*****HEAD MOVE**************************************************************
If keycode = LeftFlipperKey AND Tilted=0 AND VMOn=1 Then HEADL.ENABLED=1
If keycode = RightFlipperKey AND Tilted=0 AND VMOn=1 Then HEADR.ENABLED=1
'*****PLUNGER**************************************************************
If keycode = PlungerKey Then
If TeamSelection=1 Then
StartSkillShot:Schedule.Enabled=1:exit sub
End If
If cAttractMode=0 AND TeamSelection=0 Then
Plunger.Fire
If ballInPlunger Then
PlaySoundAt SoundFXDOF("fx_AutoPlunger", 125, DOFPulse, DOFContactors),Plunger
End If
End If
End If
'*****TILT**************************************************************
If KeyCode=LeftTiltKey Then
RndNudge=Rnd(1)/2 ' random number between .0 AND .49
RndNudge=RndNudge+2.25 ' make it between 2.25 AND 2.749
Nudge 90,RndNudge
PlaySoundAt SoundFX("fx_nudge",0),Card1
If GKMM=0 AND VMOn=0 AND tilted=0 AND BIP>0 Then AddToTilt(RndNudge)
End If
If KeyCode=RightTiltKey Then
RndNudge=Rnd(1)/2
RndNudge=RndNudge+2.25
Nudge 270,RndNudge
PlaySoundAt SoundFX("fx_nudge",0),Card2
If GKMM=0 AND VMOn=0 AND tilted=0 AND BIP>0 Then AddToTilt(RndNudge)
End If
If KeyCode=CenterTiltKey Then
RndNudge=Rnd(1)/2
RndNudge=RndNudge+2.25
Nudge 0,RndNudge
PlaySoundAt SoundFX("fx_nudge",0),Apron
If GKMM=0 AND VMOn=0 AND tilted=0 AND BIP>0 Then AddToTilt(RndNudge)
End If
If KeyCode=20 Then 'T key
RndNudge=Rnd(1)/2
RndNudge=RndNudge+4.5
Nudge 0,RndNudge
PlaySoundAt SoundFX("fx_nudge",0),Apron
If GKMM=0 AND VMOn=0 AND tilted=0 AND BIP>0 Then AddToTilt(RndNudge)
End If
'*****SLAM TILT**************************************************************
If KeyCode=199 Then ' HOME (slam tilt)
PlaySound "V.red card"
StopMusic
DisableTable 1:Tilted=1:bonusP=0:bonus=0
LightSeqTilt.Play SeqAllOff
If subwall.Z > 140 Then TabletDown
subwall.image = "sub_text"
UDMD_Display "redcard.gif", " SLAM TILT ", 15,0,"",15,0,UltraDMD_Animation_None, 2000, UltraDMD_Animation_None,10
' start the slam tilt timer which waits for all balls to return
' before restarting the attract sequence
SlamTilt.Interval=2000
SlamTilt.Enabled=1
End If
'*****NAME ENTERING **********************************************************
If keycode = LeftFlipperKey AND NOT cursorPos=40 Then
inChar=inChar-1:Playsound "fx_Next"
if inChar<65 AND inChar>57 Then inChar=57
if inChar<46 Then inChar=91
End If
If keycode = RightFlipperKey AND NOT cursorPos=40 Then
inChar=inChar+1:Playsound "fx_Previous"
if inChar>91 Then inChar=46
if inChar>57 AND inChar<65 Then inChar=65
End If
If keycode = StartGameKey AND NOT cursorPos=40 Then
if (inChar = 91 and cursorPos > 0) Then 'Set the backspace character
cursorPos = cursorPos - 1 'Send cursor back
initials(cursorPos) = 32 'Set that initial back to an empty SPACE
Playsound "fx_Esc"
End If
if (inChar <> 91) Then 'Set a character, as long as it's not a backspace
initials(cursorPos) = inChar 'Set the character
If inChar = 47 Then initials(cursorPos) = 32 'Set the space character
cursorPos = cursorPos + 1
Playsound "fx_Enter"
End If
if (cursorPos < 4) Then 'write the 3 characters
If cursorPos=3 Then nameEntryStart.Enabled=0:cursorPos=40:ExitHS.Interval=100:ExitHS.Enabled=1
End If
End If
'*****MUSIC VOLUME ***********************************************************
If keycode = 9 AND NOT OptMenuEnabled Then 'key 8
If optMusicVolume>0 Then optMusicVolume=optMusicVolume-0.1 Else optMusicVolume=0 End If
MusicVolume=optMusicVolume
If Not OptMusicEnabled AND cAttractMode=0 AND NOT UltraDMD.IsRendering Then
UltraDMD.DisplayScene00ExWithID "MusVol",false, "black.bmp", " ", 15, 0, "", 15, 0, UltraDMD_Animation_None, 2000, UltraDMD_Animation_None
OptMusicEnabled=True
End If
If OptMusicEnabled Then UltraDMD.Modifyscene00 "MusVol", " VOLUME: " & optMusicVolume*10 & " ", "":SCReset.Enabled=1
End If
If keycode = 10 AND NOT OptMenuEnabled Then 'key 9
If optMusicVolume<1 Then optMusicVolume=optMusicVolume+0.1 Else optMusicVolume=1 End If
MusicVolume=optMusicVolume
If Not OptMusicEnabled AND cAttractMode=0 AND NOT UltraDMD.IsRendering Then
UltraDMD.DisplayScene00ExWithID "MusVol",false, "black.bmp", " ", 15, 0, "", 15, 0, UltraDMD_Animation_None, 2000, UltraDMD_Animation_None
OptMusicEnabled=True
End If
If OptMusicEnabled Then UltraDMD.Modifyscene00 "MusVol", " VOLUME: " & optMusicVolume*10 & " ", "":SCReset.Enabled=1
End If
'*****OPTIONS MENU ***********************************************************
ManageTableOptions(keycode)
End Sub
'***************************************************************************************************************************************
'***************************************************************************************************************************************
Sub Table1_KeyUp(ByVal keycode)
If keycode = LeftFlipperKey AND GKMM=0 AND cAttractMode=0 AND VMOn=0 AND Tilted=0 Then
LeftFlipper.RotateToStart
LeftFlipper1.RotateToStart
PlaySoundAt SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), LeftFlipper
End If
If keycode = RightFlipperKey AND GKMM=0 AND cAttractMode=0 AND VMOn=0 AND Tilted=0 Then
RightFlipper.RotateToStart
RightFlipper1.RotateToStart
PlaySoundAt SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), RightFlipper
End If
'****DISPLAY INFO ************************************************************
If keycode = LeftFlipperKey Then
DisplayInfoTimer.Enabled=0
DisplayRulesTimer.Enabled=0
If cInstantInfo Then
CheckGameInfo.Enabled=0
If UltraDMD.IsRendering Then UltraDMD.CancelRendering
OnScoreboardChanged
cInstantInfo=False
End If
If cGameRules Then cGameRules=False:RulesDT.visible=0:RulesFS.visible=0
End If
If keycode = RightFlipperKey Then
DisplayInfoTimer.Enabled=0
DisplayRulesTimer.Enabled=0
If cInstantInfo Then
CheckGameInfo.Enabled=0
If UltraDMD.IsRendering Then UltraDMD.CancelRendering
OnScoreboardChanged
cInstantInfo=False
End If
If cGameRules Then cGameRules=False:RulesDT.visible=0:RulesFS.visible=0
End If
'****GKMOVEMODE************************************************************
If keycode = LeftFlipperKey AND GKMM=1 AND Tilted=0 Then
PlaySoundAt SoundFXDOF("fx_DropTargetDOWN",101,DOFOff,DOFFlippers),headGK
headGK.X=437:bootsGK.X=437:bodyGK.X=437:kitGK.X=437:GKPOST.X=437
For each ii in GkWalls:ii.IsDropped=1:Next
GKwalls(4).isdropped=0:GKwalls(5).isdropped=0
End If
If keycode = RightFlipperKey AND GKMM=1 AND Tilted=0 Then
PlaySoundAt SoundFXDOF("fx_DropTargetDOWN",102,DOFOff,DOFFlippers),headGK
headGK.X=437:bootsGK.X=437:bodyGK.X=437:kitGK.X=437:GKPOST.X=437
For each ii in GkWalls:ii.IsDropped=1:Next
GKwalls(4).isdropped=0:GKwalls(5).isdropped=0
End If
'*HEAD MOVE**************************************************************
If keycode = LeftFlipperKey AND Tilted=0 AND VMOn=1 Then HEADL.ENABLED=0
If keycode = RightFlipperKey AND Tilted=0 AND VMOn=1 Then HEADR.ENABLED=0
End Sub
'************************************************************************
'***RELEASE NEW BALLS****************************************************
'************************************************************************
Dim SkillShotMode
Sub ReleaseNewBall
BIP=BIP+1:maxballs(CurrentPlayer)=maxballs(CurrentPlayer)+1
BallRelease.CreateSizedBallWithMass Ballsize/2,BallMass:UpdateBall:BallRelease.Kick 90, 7:PlaySoundAt SoundFXDOF("fx_ballrel",121,DOFPulse,DOFContactors),Ballrelease
If shootagain=1 Then
If UltraDMD.IsRendering Then UltraDMD.CancelRendering
UDMD_Display "black.bmp", "SHOOT",14,-1,"AGAIN!",14,-1, UltraDMD_Animation_ScrollOnUp, 2000, UltraDMD_Animation_FadeOut,10
PlaySound "V.shootagain":kickagain=1
End If
Music
End Sub
Sub KGoalExit
kickergoal.CreateSizedBallWithMass Ballsize/2,BallMass:UpdateBall:PlaySoundAt SoundFXDOF("fx_saucer_exit",122,DOFPulse,DOFContactors),kickergoal:kickergoal.Kick 0,10,1.56
FlashForMs fl3,300,1000,0:FlashForMs fl3a,600,300,0:FlashForMs dome3,600,300,0:DOF 124,DOFPulse:MisterToyMove 3, 100
End Sub
Sub StartSkillshot
SkillShotMode=1:kickagain=1:kicked=0
'let's do some random eleasticity so the skillshot is not so simple
Gate1.Elasticity=(RndNum(25,40))/10 ' random number between 2.5 and 4
Lx1.state=0:Lx2.state=2
End Sub
'*********************************************************************
'*****KICK AGAIN******************************************************
'*********************************************************************
Dim ballInPlunger,kickcount,kickagain,kicked,BSaverAward:BSaverAward=0
Sub Dokickagain
If kicked=0 AND kickagain=1 Then kickagain=0:kickagainT.enabled=0:kickcount=0:Lkag.state=1:TriggerKickAgain.enabled=1
End Sub
Sub TriggerKickAgain_Hit:Triggerkickagain.Enabled=0:kickagainT.enabled=1:End Sub 'used at bumpers exit
Sub kickagainT_timer()
kickcount=kickcount+1
If Lmultilock.state=1 OR BSaverAward=1 Then '30 seconds ballsaver
If Kickcount=250 Then Lkag.BlinkInterval=300:Lkag.state=2 'after 25 seconds
If Kickcount=280 Then Lkag.BlinkInterval=100 'after 3 seconds
If kickcount=300 Then Lkag.state=0:kickagaint.enabled=0:kicked=1:BSaverAward=0 'after 2 seconds
ElseIf Lmultiticket.state=1 OR Lmultiskill.state=1 Then '20 seconds ballsaver
If Kickcount=150 Then Lkag.BlinkInterval=300:Lkag.state=2 'after 15 seconds
If Kickcount=180 Then Lkag.BlinkInterval=100 'after 3 seconds
If kickcount=200 Then Lkag.state=0:kickagaint.enabled=0:kicked=1 'after 2 seconds
Else '10 seconds ballsaver
If Kickcount=50 Then Lkag.BlinkInterval=300:Lkag.state=2 'after 5 seconds
If Kickcount=80 Then Lkag.BlinkInterval=100 'after 3 seconds
If kickcount=100 Then Lkag.state=0:kickagaint.enabled=0:kicked=1 'after 2 seconds
End If
End Sub
Sub Drainkick
BallRelease.CreateSizedBallWithMass Ballsize/2,BallMass:UpdateBall:BallRelease.Kick 90, 7:PlaySoundAt SoundFXDOF("fx_ballrel",121,DOFPulse,DOFContactors),Ballrelease
'after 1 second fire the autoplunger
Plunger.TimerInterval=1000:Plunger.TimerEnabled=1
If Lx1.state=1 AND Lx2.state=1 Then Lx1.state=0:Lx2.state=0
If Lmultilock.state=1 OR Lmultiticket.state=1 OR Lmultiskill.state=1 Then
kickagain=0
Else
UDMD_Display "ballsaver.gif","",0,0,"",0,0,UltraDMD_Animation_None,3000,UltraDMD_Animation_FadeOut,10
kickagainT.enabled=0:Lkag.state=0:kicked=1:kickagain=1:BSaverAward=0
End If
End Sub
Sub Plunger_timer()
Plunger.TimerEnabled=0
Plunger.Fire:PlaySoundAt SoundFXDOF("fx_AutoPlunger", 125, DOFPulse, DOFContactors),Plunger
End Sub
Sub swPlunger_Hit:ballInPlunger = True:DOF 159, DOFOn:End Sub
Sub swPlunger_Unhit:ballInPlunger = False:DOF 159, DOFOff:End Sub
'************************************************************************
'* GAME INFO & RULES ****************************************************
'************************************************************************
Dim cInstantInfo, cGameRules
Dim Matches:Matches=Array("","qualify match"," group stage "," round of 16 "," qua. finals "," semifinals "," final ")
Sub DisplayInfoTimer_timer
'after 7 seconds
Me.Enabled=0
cInstantInfo=True
CheckGameInfo.Enabled=0
If UltraDMD.IsRendering Then UltraDMD.CancelRendering
UltraDMD.DisplayScene00Ex ""," STATUS REPORT ",14,-1,"",14,1,UltraDMD_Animation_None,2000,UltraDMD_Animation_None
CheckGameInfo.Enabled=1
End Sub
Sub CheckGameInfo_Timer
If cInstantInfo Then
ShowGameInfo
ElseIf NOT UltraDMD.IsRendering Then
Me.Enabled=0
UltraDMD.CancelRendering
OnScoreboardChanged
End If
End Sub
Sub ShowGameInfo
UltraDMD.DisplayScene00Ex ""," REPLAY AT ",14,-1,bestscores(0),14,1,UltraDMD_Animation_None,2000,UltraDMD_Animation_None
UltraDMD.DisplayScene00Ex ""," EXTRABALLS ",14,-1,extraball(CurrentPlayer),14,1,UltraDMD_Animation_None,2000,UltraDMD_Animation_None
UltraDMD.DisplayScene00Ex ""," PLAYING THE ",14,-1,Matches(defencestate(CurrentPlayer)),14,1,UltraDMD_Animation_None,2000,UltraDMD_Animation_None
UltraDMD.DisplayScene00Ex ""," EXTRABALL AT ",14,-1," THE SEMIFINAL ",14,1,UltraDMD_Animation_None,2000,UltraDMD_Animation_None
UltraDMD.DisplayScene00Ex ""," FK SCORED " & FKGoal(CurrentPlayer) &" " ,14,-1," EX.BALL AT 3 ",14,1,UltraDMD_Animation_None,2000,UltraDMD_Animation_None
UltraDMD.DisplayScene00Ex ""," FK AWARD AT ",14,-1," 5 FK SCORES ",14,1,UltraDMD_Animation_None,2000,UltraDMD_Animation_None
UltraDMD.DisplayScene00Ex ""," BUMPERS LVL " & JetLevel(CurrentPlayer),14,-1," EX.BALL AT 6 ",14,1,UltraDMD_Animation_None,2000,UltraDMD_Animation_None
UltraDMD.DisplayScene00Ex ""," BALLON DOR: ",14,-1," " & (5-completed(CurrentPlayer)) & " MODES TO GO ",14,1,UltraDMD_Animation_None,2000,UltraDMD_Animation_None
End Sub
Sub DisplayRulesTimer_Timer
'after 5 seconds shows the game rules
Me.Enabled=0
cGameRules=True
If Table1.ShowDT Then RulesDT.visible=1 Else RulesFS.visible=1 End If
End Sub
'************************************************************************
'***ADD NEW PLAYERS******************************************************
'************************************************************************
Sub AddNewPlayers
If creditgame=0 AND FreePlay=0 Then
DisplayIntro.Enabled=0:DisplayIntroHS.Enabled=0:DisplayStartScreen.Enabled=0:displaystart=0:StopMusic:UltraDMD.CancelRendering:DOF 150, DOFOff
UltraDMD.DisplayScene00Ex "coin.gif", "", 10, -1,"", -1, 10, UltraDMD_Animation_ScrollOnUp, 6000, UltraDMD_Animation_ScrollOffDown
If cAttractMode=1 then DisplayIntro.enabled=1
End If
If creditgame>0 or FreePlay=1 Then
If NewPlayer<4 Then
CheckTeamSelect.Enabled=0:Stopsound "0_highscore":Playsound "0_highscore"
If cAttractMode=1 Then DisplayIntroHS.Enabled=0:DisplayIntro.Enabled=0:DisplayStartScreen.Enabled=0:displaystart=0:StopMusic
If UltraDMD.IsRendering Then UltraDMD.CancelRendering
If FreePlay=0 Then creditgame=creditgame-1
NewPlayer=NewPlayer+1
UltraDMD.DisplayScene00Ex "","WELCOME", 14, -1, "PLAYER " & (NewPlayer), 14, -1, UltraDMD_Animation_None, 1500, UltraDMD_Animation_None
CheckTeamSelect.Enabled=1
End If
End If
End Sub
Sub CheckTeamSelect_Timer
If NOT UltraDMD.IsRendering AND cAttractMode=0 Then
Me.Enabled=0
If TeamSelection=1 Then SelectTheTeam:exit sub
If TeamSelection=0 Then OnScoreboardChanged:exit sub
End If
If NOT UltraDMD.IsRendering AND cAttractMode=1 Then Me.Enabled=0:StopAttractMode:TeamSelection=1:SelectTheTeam:exit sub
End Sub
Sub SelectTheTeam
For Each ii in TeamLogos:StopFlash ii,0:Next
screenprim1.visible=1:screenprim.image="logo" & choiceteam(CurrentPlayer):TeamLogos(3).imageA="logo" & choiceteam(CurrentPlayer):Flash TeamLogos(3),250:StopSound "CLAPPING2":PlaySound "CLAPPING2"
UltraDMD.DisplayScene00Ex "logo" & choiceteam(CurrentPlayer) &".png","SELECT YOUR TEAM", 14, 3, TeamList(choiceteam(CurrentPlayer)-1), 1, 14, UltraDMD_Animation_None, 999999, UltraDMD_Animation_None
End Sub
Sub PlayerCheck
If shootagain=0 Then