-
Notifications
You must be signed in to change notification settings - Fork 30
/
KISS (Stern 2015)_Bigus(MOD)1.1.vbs
executable file
·5659 lines (5127 loc) · 183 KB
/
KISS (Stern 2015)_Bigus(MOD)1.1.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
' ****************************************************************
' VISUAL PINBALL X
' Author: Allknowing2012 2105/2016
'
' Credits to
' JPSalas - refactored my code/table with his Pokemon table
' VANLION on vpinball.com for his Gene Head 3D model
' UltraPeepi for Ultradmd
' Dark for the Speaker Model
' Aldiode for the PF artwork
' ****************************************************************
' 20161025 - bonus animation, dmd background border, no credit audio, bsp vid
' 20161030 - apron mod (RustyCardores) and code version check added
' - reset lockballs after gameover and store for each player
' - code for super bumpers, super targets, combo shot on super ramps
' 20161031 - track shots made by player by song as some songs require more/less shots to complete
' - save demon lock state
' 20161101 - dont stop/reset music on a ball save
' 20161102 - New Match Gifs - be sure to download them and put in ultradmd directory.
' 20161113 - New UDMD Location code from Seraph74, strengthen demon kicker, ballsaver on for start of multiball, random first song
' 20161119 - frontrow ball save, turn off super ramps between games, extend pause for DMB
' 20161120 - updated the ultradmd code from Seraph74
' 20161122 - pf/light update from Aldiode
' 20161122 - Bugs: Reset BumperLights, Front Row Save loops endlessly + KISSRules.vbs
' 20220301 - First release POST Vpinball.org
Option Explicit
Randomize
If Table1.ShowDT then
PaulStanleyDesktop.visible=True
PaulStanleyFS.visible=False
Light001.intensity = 30
Else
PaulStanleyDesktop.visible=False
PaulStanleyFS.visible=True
End if
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
On Error Goto 0
'ExecuteGlobal GetTextFile("KISSCore.vbs")
' *************************************
' KISS Core Functions
'
Const KissCoreV = 1.02
' *************************************
' 20161031 - changes to reduce UltraDMD DMD flicker
' 20161101 - audio additions
Dim DesktopMode:DesktopMode = Table1.ShowDT
Dim MusicVol:MusicVol = 0.2 'Music Volume 0-1
Dim MusicVolMB:MusicVolMB = 0.7 'Multiball Music Volume 0-1
'*************
' Pause Table
'*************
Sub table1_Paused
End Sub
Sub table1_unPaused
End Sub
Sub table1_Exit
Savehs
' If B2SOn Then Controller.stop
if UseUDMD then
UltraDMD.clear
UltraDMD.uninit
end if
End Sub
Sub SolLFlipper(Enabled)
If Enabled Then
PlaySound SoundFXDOF("fx_flipperup",101,DOFOn,DOFFlippers), 0, 1, -0.05, 0.15
LeftFlipper.RotateToEnd
Else
PlaySound SoundFXDOF("fx_flipperdown",101,DOFOff,DOFFlippers), 0, 1, -0.05, 0.15
LeftFlipper.RotateToStart
End If
End Sub
Sub SolRFlipper(Enabled)
If Enabled Then
PlaySound SoundFXDOF("fx_flipperup",102,DOFOn,DOFFlippers), 0, 1, 0.05, 0.15
RightFlipper.RotateToEnd
Else
PlaySound SoundFXDOF("fx_flipperdown",102,DOFOff,DOFFlippers), 0, 1, 0.05, 0.15
RightFlipper.RotateToStart
End If
End Sub
' flippers hit Sound
Sub LeftFlipper_Collide(parm)
PlaySound "fx_rubber_flipper", 0, parm / 10, -0.05, 0.25
End Sub
Sub RightFlipper_Collide(parm)
PlaySound "fx_rubber_flipper", 0, parm / 10, 0.05, 0.25
End Sub
'**********************
' GI effects
' independent routine
' it turns on the gi
' when there is a ball
' in play
'**********************
Dim OldGiState
OldGiState = -1 'start witht the Gi off
Sub ChangeGi(col) 'changes the gi color
Dim bulb
For each bulb in aGILights
SetLightColor bulb, col, -1
Next
End Sub
Sub GIUpdateTimer_Timer
Dim tmp, obj
tmp = Getballs
If UBound(tmp) <> OldGiState Then
OldGiState = Ubound(tmp)
If UBound(tmp) = -1 Then
GiOff
Else
Gion
End If
End If
End Sub
Sub GiOn
Dim bulb
DOF 150, DOFOn
For each bulb in aGiLights
bulb.State = 1
Next
Table1.colorgradeimage = "ColorGradeLUT256x16_extraConSat"
End Sub
Sub GiOff
Dim bulb
DOF 150, DOFOff
For each bulb in aGiLights
bulb.State = 0
Next
Table1.colorgradeimage = "ColorGrade_3"
End Sub
' GI light sequence effects
Sub GiEffect(n)
Select Case n
Case 0 'all blink
LightSeqGi.UpdateInterval = 8
LightSeqGi.Play SeqBlinking, , 5, 50
Case 1 'random
LightSeqGi.UpdateInterval = 10
LightSeqGi.Play SeqRandom, 5, , 1000
Case 2 'upon
LightSeqGi.UpdateInterval = 4
LightSeqGi.Play SeqUpOn, 5, 1
End Select
End Sub
Sub LightEffect(n)
Select Case n
Case 0 'all blink
LightSeqInserts.UpdateInterval = 8
LightSeqInserts.Play SeqBlinking, , 5, 50
Case 1 'random
LightSeqInserts.UpdateInterval = 10
LightSeqInserts.Play SeqRandom, 5, , 1000
Case 2 'upon
LightSeqInserts.UpdateInterval = 4
LightSeqInserts.Play SeqUpOn, 10, 1
Case 3 ' left-right-left
LightSeqInserts.UpdateInterval = 5
LightSeqInserts.Play SeqLeftOn, 10, 1
LightSeqInserts.UpdateInterval = 5
LightSeqInserts.Play SeqRightOn, 10, 1
End Select
End Sub
'*********************************************************************
' Positional Sound Playback Functions
'*********************************************************************
' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
End Sub
' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
Sub PlaySoundAt(soundname, tableobj)
PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
End Sub
Sub PlaySoundAtBall(soundname)
PlaySoundAt soundname, ActiveBall
End Sub
'*********************************************************************
' Supporting Ball & Sound Functions
'*********************************************************************
Function AudioFade(tableobj) ' Fades between front and back of the table (for surround systems or 2x2 speakers, etc), depending on the Y position on the table. "table1" is the name of the table
Dim tmp
tmp = tableobj.y * 2 / table1.height-1
If tmp > 0 Then
AudioFade = Csng(tmp ^10)
Else
AudioFade = Csng(-((- tmp) ^10) )
End If
End Function
Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
Dim tmp
tmp = tableobj.x * 2 / table1.width-1
If tmp > 0 Then
AudioPan = Csng(tmp ^10)
Else
AudioPan = Csng(-((- tmp) ^10) )
End If
End Function
Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
Vol = Csng(BallVel(ball) ^2 / 2000)
End Function
Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
Pitch = BallVel(ball) * 20
End Function
Function BallVel(ball) 'Calculates the ball speed
BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
End Function
'*****************************************
' JP's VP10 Rolling Sounds
'*****************************************
Const tnob = 8 ' total number of balls
ReDim rolling(tnob)
InitRolling
Sub InitRolling
Dim i
For i = 0 to tnob
rolling(i) = False
Next
End Sub
Sub RollingTimer_Timer()
Dim BOT, b
BOT = GetBalls
' stop the sound of deleted balls
For b = UBound(BOT) + 1 to tnob
rolling(b) = False
StopSound("fx_ballrolling" & b)
Next
' exit the sub if no balls on the table
If UBound(BOT) = -1 Then Exit Sub
' play the rolling sound for each ball
For b = 0 to UBound(BOT)
If BallVel(BOT(b) ) > 1 Then
rolling(b) = True
if BOT(b).z < 30 Then ' Ball on playfield
PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), AudioPan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0, AudioFade(BOT(b) )
Else ' Ball on raised ramp
PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) )*.5, AudioPan(BOT(b) ), 0, Pitch(BOT(b) )+50000, 1, 0, AudioFade(BOT(b) )
End If
Else
If rolling(b) = True Then
StopSound("fx_ballrolling" & b)
rolling(b) = False
End If
End If
' play ball drop sounds
If BOT(b).VelZ < -1 and BOT(b).z < 55 and BOT(b).z > 27 Then 'height adjust for ball drop sounds
PlaySound "fx_ball_drop" & b, 0, ABS(BOT(b).velz)/17, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
End If
Next
End Sub
'**********************
' Ball Collision Sound
'**********************
Sub OnBallBallCollision(ball1, ball2, velocity)
PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
End Sub
'**********************
'Flipper Shadows
'***********************
Sub RealTime_Timer
' lfs.RotZ = LeftFlipper.CurrentAngle
' rfs.RotZ = RightFlipper.CurrentAngle
BallShadowUpdate
End Sub
Sub BallShadowUpdate()
Dim BallShadow
BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5,BallShadow6,BallShadow7,BallShadow8)
Dim BOT, b
BOT = GetBalls
' hide shadow of deleted balls
If UBound(BOT)<(tnob-1) Then
For b = (UBound(BOT) + 1) to (tnob-1)
BallShadow(b).visible = 0
Next
End If
' exit the Sub if no balls on the table
If UBound(BOT) = -1 Then Exit Sub
' render the shadow for each ball
For b = 0 to UBound(BOT)
BallShadow(b).X = BOT(b).X
ballShadow(b).Y = BOT(b).Y + 10
If BOT(b).Z > 20 and BOT(b).Z < 200 Then
BallShadow(b).visible = 1
Else
BallShadow(b).visible = 0
End If
if BOT(b).z > 30 Then
ballShadow(b).height = BOT(b).Z - 20
ballShadow(b).opacity = 80
Else
ballShadow(b).height = BOT(b).Z - 24
ballShadow(b).opacity = 90
End If
Next
End Sub
'******************************
' Diverse Collection Hit Sounds
'******************************
Sub aMetals_Hit(idx):PlaySound "fx_MetalHit", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aRubber_Bands_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aRubber_Posts_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aRubber_Pins_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aYellowPins_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aPlastics_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
'*****************************
' Load / Save / Highscore
'*****************************
Sub Loadhs
Dim x
debug.print "Loadhs"
x = LoadValue(cGameName, "HighScore1")
If(x <> "") Then HighScore(0) = CDbl(x) Else HighScore(0) = 100000 End If
x = LoadValue(cGameName, "HighScore1Name")
If(x <> "") Then HighScoreName(0) = x Else HighScoreName(0) = "AAA" End If
x = LoadValue(cGameName, "HighScore2")
If(x <> "") then HighScore(1) = CDbl(x) Else HighScore(1) = 100000 End If
x = LoadValue(cGameName, "HighScore2Name")
If(x <> "") then HighScoreName(1) = x Else HighScoreName(1) = "BBB" End If
x = LoadValue(cGameName, "HighScore3")
If(x <> "") then HighScore(2) = CDbl(x) Else HighScore(2) = 100000 End If
x = LoadValue(cGameName, "HighScore3Name")
If(x <> "") then HighScoreName(2) = x Else HighScoreName(2) = "CCC" End If
x = LoadValue(cGameName, "HighScore4")
If(x <> "") then HighScore(3) = CDbl(x) Else HighScore(3) = 100000 End If
x = LoadValue(cGameName, "HighScore4Name")
If(x <> "") then HighScoreName(3) = x Else HighScoreName(3) = "DDD" End If
x = LoadValue(cGameName, "Credits")
If(x <> "") then Credits = CInt(x) Else Credits = 0 End If
x = LoadValue(cGameName, "TotalGamesPlayed")
If(x <> "") then TotalGamesPlayed = CInt(x) Else TotalGamesPlayed = 0 End If
x = LoadValue(cGameName, "HighCombo")
If(x <> "") then HighCombo = CInt(x) Else HighCombo = 5 End If
x = LoadValue(cGameName, "HighComboName")
If(x <> "") then HighComboName = x Else HighComboName = "AAA" End If
x = LoadValue(cGameName, "LastScoreP1")
If(x <> "") then LastScoreP1 = CDbl(x) Else LastScoreP1 = 0 End If
x = LoadValue(cGameName, "LastScoreP2")
If(x <> "") then LastScoreP2 = CDbl(x) Else LastScoreP2 = 0 End If
x = LoadValue(cGameName, "LastScoreP3")
If(x <> "") then LastScoreP3 = CDbl(x) Else LastScoreP3 = 0 End If
x = LoadValue(cGameName, "LastScoreP4")
If(x <> "") then LastScoreP4 = CDbl(x) Else LastScoreP4 = 0 End If
'HighScore(0)=100
'HighScore(1)=100
'HighScore(2)=100
'HighScore(3)=100
'HighCombo=3
End Sub
Sub Savehs
debug.print "Savehs"
SaveValue cGameName, "HighScore1", HighScore(0)
SaveValue cGameName, "HighScore1Name", HighScoreName(0)
SaveValue cGameName, "HighScore2", HighScore(1)
SaveValue cGameName, "HighScore2Name", HighScoreName(1)
SaveValue cGameName, "HighScore3", HighScore(2)
SaveValue cGameName, "HighScore3Name", HighScoreName(2)
SaveValue cGameName, "HighScore4", HighScore(3)
SaveValue cGameName, "HighScore4Name", HighScoreName(3)
SaveValue cGameName, "Credits", Credits
SaveValue cGameName, "TotalGamesPlayed", TotalGamesPlayed
SaveValue cGameName, "HighCombo", HighCombo
SaveValue cGameName, "HighComboName", HighComboName
SaveValue cGameName, "LastScoreP1", LastScoreP1
SaveValue cGameName, "LastScoreP2", LastScoreP2
SaveValue cGameName, "LastScoreP3", LastScoreP3
SaveValue cGameName, "LastScoreP4", LastScoreP4
End Sub
' ***********************************************************
' High Score Initals Entry Functions - based on Black's code
' ***********************************************************
Dim hsbModeActive
Dim hsEnteredName
Dim hsEnteredDigits(3)
Dim hsCurrentDigit
Dim hsValidLetters
Dim hsCurrentLetter
Dim hsLetterFlash
Sub CheckHighscore()
Dim tmp
tmp = Score(1):hsPlayer=1
If Score(2) > tmp Then tmp = Score(2):hsPlayer=2
If Score(3) > tmp Then tmp = Score(3):hsPlayer=3
If Score(4) > tmp Then tmp = Score(4):hsPlayer=4
If tmp > HighScore(1) Then 'add 1 credit for beating the highscore
Credits = Credits + 1
DOF 125, DOFOn
PlaySound "audio581"
else
if tmp > HighScore(3) then
PlaySound "audio582"
end if
End If
If tmp > HighScore(3) Then
PlaySound SoundFXDOF("fx_Knocker",122,DOFPulse,DOFKnocker)
DOF 121, DOFPulse
HighScore(3) = tmp
'enter player's name
HSMode=1:HighScoreEntryInit()
Else
CheckHighComboCnt()
End If
End Sub
Dim hsPlayer
Sub CheckHighComboCnt()
Dim tmp
tmp = ComboCnt(1):hsPlayer=1
If ComboCnt(2) > tmp Then tmp = ComboCnt(2):hsPlayer=2
If ComboCnt(3) > tmp Then tmp = ComboCnt(3):hsPlayer=3
If ComboCnt(4) > tmp Then tmp = ComboCnt(4):hsPlayer=4
If tmp > HighCombo Then 'add 1 credit for beating the high combo count
Credits = Credits + 1
DOF 125, DOFOn
End If
If tmp > HighCombo Then
PlaySound SoundFXDOF("fx_Knocker",122,DOFPulse,DOFKnocker)
DOF 121, DOFPulse
HighCombo = tmp
'enter player's name
HSMode=2:HighScoreEntryInit()
Else
EndOfBallComplete()
End If
End Sub
Sub HighScoreEntryInit()
hsbModeActive = True
hsLetterFlash = 0
hsEnteredDigits(0) = " "
hsEnteredDigits(1) = " "
hsEnteredDigits(2) = " "
hsCurrentDigit = 0
hsValidLetters = " ABCDEFGHIJKLMNOPQRSTUVWXYZ<>+=0123456789" ' ` is back arrow
hsCurrentLetter = 1
UDMDTimer.enabled=False
DMDFlush()
HighScoreDisplayNameNow()
if UseUDMD Then UltraDMD.Clear
HighScoreFlashTimer.Interval = 200
HighScoreFlashTimer.Enabled = True
End Sub
Sub EnterHighScoreKey(keycode)
If keycode = LeftFlipperKey Then
playsound "fx_Previous"
hsCurrentLetter = hsCurrentLetter - 1
if(hsCurrentLetter = 0) then
hsCurrentLetter = len(hsValidLetters)
end if
HighScoreDisplayNameNow()
End If
If keycode = RightFlipperKey Then
playsound "fx_Next"
hsCurrentLetter = hsCurrentLetter + 1
if(hsCurrentLetter > len(hsValidLetters) ) then
hsCurrentLetter = 1
end if
HighScoreDisplayNameNow()
End If
If keycode = PlungerKey or keycode=StartGameKey Then
if(mid(hsValidLetters, hsCurrentLetter, 1) <> "`") then
playsound "fx_Enter"
hsEnteredDigits(hsCurrentDigit) = mid(hsValidLetters, hsCurrentLetter, 1)
hsCurrentDigit = hsCurrentDigit + 1
if(hsCurrentDigit = 3) then
HighScoreCommitName()
else
HighScoreDisplayNameNow()
end if
else
playsound "fx_Esc"
hsEnteredDigits(hsCurrentDigit) = " "
if(hsCurrentDigit > 0) then
hsCurrentDigit = hsCurrentDigit - 1
end if
HighScoreDisplayNameNow()
end if
end if
End Sub
Sub HighScoreDisplayNameNow()
HighScoreFlashTimer.Enabled = False
hsLetterFlash = 0
HighScoreDisplayName()
HighScoreFlashTimer.Enabled = True
End Sub
Sub HighScoreDisplayName()
Dim i
Dim TempTopStr
Dim TempBotStr
debug.print "HighScoreDisplayName"
if hsMode = 1 then
TempTopStr = "P#" & hsPlayer & " Great Score!"
else
TempTopStr = "P#" & hsPlayer & " Great Combo!"
end if
TempBotStr = "> "
if(hsCurrentDigit > 0) then TempBotStr = TempBotStr & hsEnteredDigits(0)
if(hsCurrentDigit > 1) then TempBotStr = TempBotStr & hsEnteredDigits(1)
if(hsCurrentDigit > 2) then TempBotStr = TempBotStr & hsEnteredDigits(2)
if(hsCurrentDigit <> 3) then
if(hsLetterFlash <> 0) then
TempBotStr = TempBotStr & "-"
else
TempBotStr = TempBotStr & mid(hsValidLetters, hsCurrentLetter, 1)
end if
end if
if(hsCurrentDigit < 1) then TempBotStr = TempBotStr & hsEnteredDigits(1)
if(hsCurrentDigit < 2) then TempBotStr = TempBotStr & hsEnteredDigits(2)
TempBotStr = TempBotStr & " <"
debug.print "HighScoreDisplayName :" & TempTopStr & ":" & TempBotStr & ":"
if UseUDMD then
if CurScene="HS" then
UltraDMD.ModifyScene00 "HS", TempTopStr, TempBotStr
debug.print "modify call to hs"
else
CurScene="HS"
UltraDMD.DisplayScene00ExWithID "HS", FALSE, "scene09.gif", TempTopStr, 15, 2, TempBotStr, 15, 2, UltraDMD_Animation_None, 50000, UltraDMD_Animation_None
debug.print "new call to hs"
end if
end if
End Sub
Sub HighScoreFlashTimer_Timer()
HighScoreFlashTimer.Enabled = False
hsLetterFlash = hsLetterFlash + 1
if(hsLetterFlash = 2) then hsLetterFlash = 0
HighScoreDisplayName()
HighScoreFlashTimer.Enabled = True
End Sub
Sub HighScoreCommitName()
debug.print "HighScoreCommitName"
CurScene=""
HighScoreFlashTimer.Enabled = False
hsbModeActive = False
hsEnteredName = hsEnteredDigits(0) & hsEnteredDigits(1) & hsEnteredDigits(2)
if(hsEnteredName = " ") then
hsEnteredName = "YOU"
end if
if UseDMD then UltraDMD.CancelRenderingWithID("HS")
if HSMode=1 Then
HighScoreName(3) = hsEnteredName
SortHighscore
CheckHighComboCnt()
else
HighComboName=hsEnteredName
EndOfBallComplete()
end if
End Sub
Sub SortHighscore
Dim tmp, tmp2, i, j
For i = 0 to 3
For j = 0 to 2
If HighScore(j) < HighScore(j + 1) Then
tmp = HighScore(j + 1)
tmp2 = HighScoreName(j + 1)
HighScore(j + 1) = HighScore(j)
HighScoreName(j + 1) = HighScoreName(j)
HighScore(j) = tmp
HighScoreName(j) = tmp2
End If
Next
Next
End Sub
Sub DMDFlush()
If UseUDMD Then debug.print "DMDFlush":UltraDMD.CancelRendering
End Sub
'********************************************************************************************
' Only for VPX 10.2 and higher.
' FlashForMs will blink light or a flasher for TotalPeriod(ms) at rate of BlinkPeriod(ms)
' When TotalPeriod done, light or flasher will be set to FinalState value where
' Final State values are: 0=Off, 1=On, 2=Return to previous State
'********************************************************************************************
Sub FlashForMs(MyLight, TotalPeriod, BlinkPeriod, FinalState) 'thanks gtxjoe for the first version
If TypeName(MyLight) = "Light" Then
If FinalState = 2 Then
FinalState = MyLight.State 'Keep the current light state
End If
MyLight.BlinkInterval = BlinkPeriod
MyLight.Duration 2, TotalPeriod, FinalState
ElseIf TypeName(MyLight) = "Flasher" Then
Dim steps
Dim flasherNumber
flasherNumber = Split(MyLight.Name,"r")
DOF CInt(flasherNumber(1))+200, DOFPulse
' Store all blink information
steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform
If FinalState = 2 Then 'Keep the current flasher state
FinalState = ABS(MyLight.Visible)
End If
MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state
' Start blink timer and create timer subroutine
MyLight.TimerInterval = BlinkPeriod
MyLight.TimerEnabled = 0
MyLight.TimerEnabled = 1
ExecuteGlobal "Sub " & MyLight.Name & "_Timer:" & "Dim tmp, steps, fstate:tmp=me.UserValue:fstate = tmp MOD 10:steps= tmp\10 -1:Me.Visible = steps MOD 2:me.UserValue = steps *10 + fstate:If Steps = 0 then Me.Visible = fstate:Me.TimerEnabled=0:End if:End Sub"
End If
End Sub
'******************************************
' Change light color - simulate color leds
' changes the light color and state
' colors: red, orange, yellow, green, blue, white
'******************************************
DIM RGBColors(5)
RGBColors(1)="red"
RGBColors(2)="orange"
RGBColors(3)="yellow"
RGBColors(4)="green"
RGBColors(5)="blue"
Sub SetLightColor(n, col, stat)
Select Case col
Case "red"
n.color = RGB(18, 0, 0)
n.colorfull = RGB(255, 0, 0)
Case "orange"
n.color = RGB(18, 3, 0)
n.colorfull = RGB(255, 64, 0)
Case "yellow"
n.color = RGB(18, 18, 0)
n.colorfull = RGB(255, 255, 0)
Case "green"
n.color = RGB(0, 18, 0)
n.colorfull = RGB(0, 255, 0)
Case "blue"
n.color = RGB(0, 18, 18)
n.colorfull = RGB(0, 255, 255)
Case "white"
n.color = RGB(255, 234, 215)
n.colorfull = RGB(255, 255, 255)
Case "purple"
n.color = RGB(174, 35, 250)
n.colorfull = RGB(255, 255, 255)
End Select
If stat <> -1 Then
n.State = 0
n.State = stat
End If
End Sub
Sub StartAttractMode(dummy)
StartLightSeq
DMDFlush:debug.print "Flush 12"
am=0
AttractMode.Interval=1500
AttractMode.enabled=TRUE
End Sub
Sub StopAttractMode
Dim bulb
AttractMode.enabled=False
DMDFlush
If UseUDMD then UltraDMD.CancelRendering
If useUDMD then UltraDMD.clear
LightSeqAttract.StopPlay
'StopSong
End Sub
Sub StartLightSeq()
'lights sequences
LightSeqAttract.UpdateInterval = 25
LightSeqAttract.Play SeqBlinking, , 5, 150
LightSeqAttract.Play SeqRandom, 40, , 4000
LightSeqAttract.Play SeqAllOff
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqUpOn, 50, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqDownOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqCircleOutOn, 15, 2
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqUpOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqDownOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqUpOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqDownOn, 25, 1
LightSeqAttract.UpdateInterval = 10
LightSeqAttract.Play SeqCircleOutOn, 15, 3
LightSeqAttract.UpdateInterval = 5
LightSeqAttract.Play SeqRightOn, 50, 1
LightSeqAttract.UpdateInterval = 5
LightSeqAttract.Play SeqLeftOn, 50, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqRightOn, 50, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqLeftOn, 50, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqRightOn, 40, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqLeftOn, 40, 1
LightSeqAttract.UpdateInterval = 10
LightSeqAttract.Play SeqRightOn, 30, 1
LightSeqAttract.UpdateInterval = 10
LightSeqAttract.Play SeqLeftOn, 30, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqRightOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqLeftOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqRightOn, 15, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqLeftOn, 15, 1
LightSeqAttract.UpdateInterval = 10
LightSeqAttract.Play SeqCircleOutOn, 15, 3
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqLeftOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqRightOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqLeftOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqUpOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqDownOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqUpOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqDownOn, 25, 1
LightSeqAttract.UpdateInterval = 5
LightSeqAttract.Play SeqStripe1VertOn, 50, 2
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqCircleOutOn, 15, 2
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqStripe1VertOn, 50, 3
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqLeftOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqRightOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqLeftOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqUpOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqDownOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqCircleOutOn, 15, 2
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqStripe2VertOn, 50, 3
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqLeftOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqRightOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqLeftOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqUpOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqDownOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqUpOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqDownOn, 25, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqStripe1VertOn, 25, 3
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqStripe2VertOn, 25, 3
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqUpOn, 15, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqDownOn, 15, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqUpOn, 15, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqDownOn, 15, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqUpOn, 15, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqDownOn, 15, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqRightOn, 15, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqLeftOn, 15, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqRightOn, 15, 1
LightSeqAttract.UpdateInterval = 8
LightSeqAttract.Play SeqLeftOn, 15, 1
End Sub
Sub LightSeqAttract_PlayDone()
StartLightSeq()
End Sub
Sub LightSeqTilt_PlayDone()
LightSeqTilt.Play SeqAllOff
End Sub
'ExecuteGlobal GetTextFile("KISSMusic.vbs")
' *************************************
' KISS Music V1.02
'
Const KissMusicV=1.02
' *************************************
Dim Track(10)
Track(1) = "bgout_song-0x1E"
Track(2) = "bgout_song-0x20"
Track(3) = "bgout_song-0x1A"
Track(4) = "bgout_song-0x22"
Track(5) = "bgout_song-0x24"
Track(6) = "bgout_song-0x28"
Track(7) = "bgout_song-0x2A"
Track(8) = "bgout_song-0x2D"
Track(9) = "bgout_song-0x1C"
Track(10)= "bgout_song-0x26"
Dim Title(10)
Title(1) = "Detroit Rock City"
Title(2) = "Deuce"
Title(3) = "Black Diamond"
Title(4) = "Hotter Than Hell"
Title(5) = "Lick It Up"
Title(6) = "Love It Loud"
Title(7) = "Rock + Roll"
Title(8) = "Shout It Out"
Title(9) = "Calling Dr. Love"
Title(10) = "Love Gun"
Dim City(16)
City(1) = "Detroit" ' 0x288
City(2) = "Chicago"
City(3) = "Pittsburgh"
City(4) = "Seattle"
City(5) = "Portland"
City(6) = "Los Angeles"
City(7) = "Houston"
City(8) = "New Orleans"
City(9) = "Atlanta"
City(10) = "Orlando"
City(11) = "Tokyo"
City(12) = "London"
City(13) = "New York"
City(14) = "San Francisco"
City(15) = "Mexico City"
Dim slen(100) ' Song Length
slen(01)=1120
slen(02)=4750
slen(03)=680
slen(04)=1360
slen(05)=1120
slen(06)=8575 ' Match Vid
slen(07)=9480
slen(08)=1360 'missing
slen(09)=76960 ' high score entry
slen(10)=560
slen(11)=1160
slen(12)=10880
slen(13)=4300
slen(14)=3080
slen(15)=4280
slen(16)=1400 ' missing
slen(17)=2950 'missing
slen(18)=440
slen(19)=920
slen(20)=1400
slen(21)=3780
slen(22)=6360
slen(23)=3000
slen(24)=1560
slen(25)=1600
slen(26)=2760
slen(27)=920
slen(28)=520
slen(29)=1640
slen(30)=2360
slen(31)=2800
slen(32)=1520
slen(33)=1560
slen(34)=3700
slen(35)=1320
slen(36)=18600
slen(37)=900
slen(38)=500
slen(39)=920
slen(40)=2460
slen(41)=2480
slen(42)=2600
slen(43)=2500
slen(44)=470
slen(45)=4280
slen(46)=2360
slen(47)=3480
slen(48)=3480
slen(49)=3480
slen(50)=3480
slen(51)=1000 ' 10120
slen(52)=130
slen(53)=5160
slen(54)=240
slen(55)=3360
slen(56)=3320
slen(57)=240
slen(58)=2080
slen(59)=240
slen(60)=9880
slen(61)=1400
slen(62)=2800