-
Notifications
You must be signed in to change notification settings - Fork 37
/
Champion Pub_VPX_1_2.vbs
1701 lines (1479 loc) · 49.7 KB
/
Champion Pub_VPX_1_2.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
'############################################################################################
'############################################################################################
'####### ########
'####### The Champion Pub ########
'####### (Bally 1998) ########
'####### ########
'############################################################################################
'############################################################################################
' Version 1.2 mfuegemann 2017
'
' The original VP8 version was created by UncleReamus, Destruk, TomB and Scapino. This version is based on my
' VP9 conversion of that table.
'
' Thanks go to:
' Fuzzel for the awesome 3D models of the Boxer, Wire Ramps, Jump Ramps, Speedbag/Fists, Rope and Flippers.
' Dark for the Spot Light models, the ramp triggers, the catapult and the Flasher Sphere
' Zany for the regular Flasher model
'
' Version 1.1:
' - adjusted Flipper length and position (found by Thalamus)
' - addad B2S call for direct backglass support (activate only if You are using my B2S)
' - added Settings.Value("ddraw") = 0 in table_init, uncomment if need be (table crashes in FullScreen mode)
'
' Version 1.2:
' - adjusted some rubber hit heights (found by Thalamus)
' - added scoop returning ball recognition (found by hanzoverfist)
' - added some DOF calls (found by Arngrim)
' - reviewed material and GI settings (hauntfreaks)
Option Explicit
' Thalamus 2018-07-20
' Added/Updated "Positional Sound Playback Functions" and "Supporting Ball & Sound Functions"
' Changed UseSolenoids=1 to 2
' Thalamus 2018-08-09 : Improved directional sounds
' !! NOTE : Table not verified yet !!
' Options
' Volume devided by - lower gets higher sound
Const VolDiv = 2000 ' Lower number, louder ballrolling/collition sound
Const VolCol = 10 ' Ball collition divider ( voldiv/volcol )
' The rest of the values are multipliers
'
' .5 = lower volume
' 1.5 = higher volume
Const VolGates = 1 ' Gates volume.
Const VolMetal = 1 ' Metals volume.
Const VolRH = 1 ' Rubber hits volume.
Const VolPi = 1 ' Rubber pins volume.
Const VolTarg = 1 ' Targets volume.
Const VolFlip = 1 ' Flipper volume.
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
' Thal : Added because of useSolenoid=2
Const cSingleLFlip = 0
Const cSingleRFlip = 0
Const UseSolenoids=2,UseLamps=1,SSolenoidOn="SolOn",SSolenoidOff="SolOff"
Const SCoin="coin3"
Const UseVPMModSol=1
'-----------------------------------
' Configuration
'-----------------------------------
Const DimGI=-2 'set to dim or brighten GI lights (minus is darker, base value is 8)
Const LeftOutlanePost=0 '0=Easy, 1=Medium, 2=Hard
Const DangerZoneMod=1 '0=Mod disabled, 1=Mod installed (the Mod adds a Gate above BEER Targets instead of a Post)
Const RopeLevel=0 'Rope Jump Difficulty: 0=Easy, 1=Medium, 2=Hard
'Const BallSize = 50 'default 50, 51 plays ok, with 52 the ball will get stuck
Const UseB2SBG=1 'set to 1, if You are using my B2S Backglass for direct B2S communication
Dim cGameName
cGameName = "cp_16"
LoadVPM "01560000", "WPC.VBS", 3.26
'-----------------------------------
'Solenoid Routines
'-----------------------------------
'SolCallback --> SolModCallback for Flashers
SolCallback(1) = "SolCatapult"
SolCallback(2) = "SolTrough"
SolCallback(5) = "SolCornerKickout"
SolCallback(8) = "SolPostDiverter"
SolCallback(9) = "SolLeftScoop"
SolCallback(10) = "SolRightScoop"
SolCallback(12) = "SolPost"
SolCallback(14) = "SolPopper"
SolModCallback(17) = "sol17" 'Flasher
SolModCallback(18) = "sol18" 'Flasher
SolModCallback(19) = "UpperWhiteFlasher" 'Flasher
SolModCallback(20) = "UpperRedFlasher" 'Flasher
SolModCallback(21) = "LowerRedFlasher" 'Flasher
SolModCallback(22) = "sol22" 'Flasher
SolModCallback(23) = "SolRopeSpot" 'Flasher
SolModCallback(24) = "SolSpeedBagSpot" 'Flasher
SolCallback(28) = "SolLockPin"
SolCallback(33) = "SolMagnetPopper"
SolCallback(34) = "SolRampDiverter"
SolCallback(35) = "SolLeftSP"
SolCallback(36) = "SolRightSP"
SolCallback(sLLFlipper) = "SolLFlipper"
SolCallback(sLRFlipper) = "SolRFlipper"
Set GIcallback2 = GetRef("UpdateGI") 'GICallback2 is providing the GI intesity
Sub SolTrough(Enabled)
If Enabled then
bsTrough.ExitSol_On
vpmTimer.PulseSw 31
End If
End Sub
Sub SolPostDiverter(Enabled)
If Enabled Then
playsoundAtVol SoundFX("solon",DOFContactors), EnterLockup, 1
PostDiverter.IsDropped=0
Else
playsoundAtVol SoundFX("soloff",DOFContactors), EnterLockup, 1
PostDiverter.IsDropped=1
End If
End Sub
Sub SolLeftScoop(Enabled)
If Enabled then
playsoundAtVol SoundFX("solon",DOFContactors), P_LeftScoop, 1
P_LeftScoop.roty = 16
P_LScoopMech1.rotx = -60
P_LScoopMech2.rotx = -10
P_LScoopMech2.TransZ = -33
P_LScoopMech2.Transy = 10
LeftScoopGrab.Enabled=1
Controller.Switch(61)=1
LeftScoopBack.isdropped = False
Else
playsoundAtVol SoundFX("soloff",DOFContactors),P_LeftScoop, 1
P_LeftScoop.roty = 52
P_LScoopMech1.rotx = -80
P_LScoopMech2.rotx = 0
P_LScoopMech2.TransZ = 0
P_LScoopMech2.Transy = 0
LeftScoopGrab.Enabled=0
Controller.Switch(61)=0
LeftScoopBack.isdropped = True
End if
End Sub
Sub SolRightScoop(Enabled)
If Enabled Then
playsoundAtVol SoundFX("solon",DOFContactors), P_RightScoop, 1
P_RightScoop.roty = 16
P_RScoopMech1.rotx = -60
P_RScoopMech2.rotx = -10
P_RScoopMech2.TransZ = -33
P_RScoopMech2.Transy = 10
RightScoopGrab.Enabled=1
Controller.Switch(62)=1
RightScoopBack.isdropped = False
Else
playsoundAtVol SoundFX("soloff",DOFContactors), P_RightScoop, 1
P_RightScoop.roty = 52
P_RScoopMech1.rotx = -80
P_RScoopMech2.rotx = 0
P_RScoopMech2.TransZ = 0
P_RScoopMech2.Transy = 0
RightScoopGrab.Enabled=0
Controller.Switch(62)=0
RightScoopBack.isdropped = True
End if
End Sub
Sub SolPost(Enabled)
If Enabled Then
playsoundAtVol SoundFX("solon",DOFContactors), P_Post, 1
P_Post.Transy = 45
Controller.Switch(75)=1
ForceField.IsDropped=0
Else
playsoundAtVol SoundFX("soloff",DOFContactors), P_Post, 1
P_Post.Transy = 0
Controller.Switch(75)=0
ForceField.IsDropped=1
End If
End Sub
Sub SolLockPin(Enabled)
If Enabled then
playsoundAtVol SoundFX("solon",DOFContactors), Sw15, 1
LockPin.IsDropped=1
Else
LockPin.TimerEnabled=1
End If
End Sub
Sub LockPin_Timer
playsoundAtVol SoundFX("soloff",DOFContactors), Sw15, 1
LockPin.IsDropped=0
LockPin.TimerEnabled=0
End Sub
Sub SolRampDiverter(Enabled)
If Enabled Then
playsoundAtVol SoundFX("solon",DOFContactors), P_Diverter, 1
P_Diverter.Transz = 60
DiverterClosed.IsDropped = True
DivPost1a.Isdropped = False
DivPost2a.Isdropped = False
Else
playsoundAtVol SoundFX("soloff",DOFContactors), P_Diverter, 1
P_Diverter.Transz = 0
DiverterClosed.IsDropped = False
DivPost1a.Isdropped = True
DivPost2a.Isdropped = True
End If
End Sub
'Corner Kickout
Sub SolCornerKickout(enabled)
if enabled then
if Controller.Switch(37) then
bsCornerKickout.ExitSol_On
P_CornerKickout.Transy = -40
CornerKickout.Timerenabled = True
end If
end if
End Sub
Sub CornerKickout_Timer
CornerKickout.Timerenabled = False
P_CornerKickout.Transy = 0
End Sub
'Catapult
Sub SolCatapult(enabled)
if enabled then
FireCatapult
if Controller.Switch(18) then
bsCatapult.ExitSol_On
end If
end if
End Sub
Dim CatapultDir
Sub FireCatapult
playsoundAtVol SoundFX("solon",DOFContactors), catapultLaunchKicker, 1
catapultLaunchKicker.Timerenabled = False
CatapultDir = 1.5
catapultLaunchKicker.Timerenabled = True
End Sub
Sub catapultLaunchKicker_Timer
P_Catapult.rotx = P_Catapult.rotx + CatapultDir
if P_Catapult.rotx > 90 then
P_Catapult.rotx = 90
CatapultDir = -0.5
end if
if P_Catapult.rotx < 5 then
catapultLaunchKicker.Timerenabled = False
P_Catapult.rotx = 5
CatapultDir = 0
end if
end Sub
'---------------------------------------------------------------------------
' Flasher
'---------------------------------------------------------------------------
Const JabSpot1Intensity=16 'Spot Center
Const JabSpotIntensity=6
Dim Prev17Int,Prev18Int,Prev22Int,PrevUWInt,PrevLRInt,PrevURInt,PrevSpeedBagInt,PrevRopeSpotInt
Sub Sol17(Intensity) 'White Boxer light and spots - max 154
if Intensity <> Prev17Int Then
if Intensity > 0 then
flash17.state = Lightstateon
flash17.Intensity = 5*(Intensity/154)
RightJabSpot1.state = Lightstateon
LeftJabSpot1.state = Lightstateon
RightJabSpot1.Intensity = JabSpot1Intensity*(Intensity/154)
LeftJabSpot1.Intensity = JabSpot1Intensity*(Intensity/154)
If DesktopMode = True Then
RightJabSpot_DT.state = Lightstateon
LeftJabSpot_DT.state = Lightstateon
RightJabSpot_DT.Intensity = JabSpotIntensity*(Intensity/154)
LeftJabSpot_DT.Intensity = JabSpotIntensity*(Intensity/154)
Else
RightJabSpot.state = Lightstateon
LeftJabSpot.state = Lightstateon
RightJabSpot.Intensity = JabSpotIntensity*(Intensity/154)
LeftJabSpot.Intensity = JabSpotIntensity*(Intensity/154)
end If
else
flash17.state = Lightstateoff
RightJabSpot.state = Lightstateoff
RightJabSpot1.state = Lightstateoff
LeftJabSpot.state = Lightstateoff
LeftJabSpot1.state = Lightstateoff
RightJabSpot_DT.state = Lightstateoff
LeftJabSpot_DT.state = Lightstateoff
end If
end If
Prev17Int = Intensity
End Sub
Sub Sol18(Intensity) 'Danger Zone Bolts
if Intensity <> Prev18Int Then
if Intensity > 0 then
flasher18.state = Lightstateon
flasher18.Intensity = 18*(Intensity/154)
flasher18b.state = Lightstateon
flasher18b.Intensity = 18*(Intensity/154)
else
flasher18.state = Lightstateoff
flasher18b.state = Lightstateoff
end if
end If
Prev18Int = Intensity
End Sub
Sub Sol22(Intensity) 'Boxer Bolts
if Intensity <> Prev22Int Then
if Intensity > 0 then
bolt1.state = Lightstateon
bolt1.Intensity = 8*(Intensity/154)
bolt2.state = Lightstateon
bolt2.Intensity = 8*(Intensity/154)
else
bolt1.state = Lightstateoff
bolt2.state = Lightstateoff
end if
end If
if UseB2SBG then
if Intensity > 0 then
Controller.B2SSetData 222,1
Else
Controller.B2SSetData 222,0
End If
End If
Prev22Int = Intensity
End Sub
Sub SolSpeedBagSpot(Intensity)
if Intensity <> PrevSpeedBagInt Then
if Intensity > 0 then
If DesktopMode = True Then
SpeedBagFlasher_DT.state = Lightstateon
SpeedBagFlasher_DT.Intensity = 12*(Intensity/154)
SpeedBagFlasher1_DT.state = Lightstateon
SpeedBagFlasher1_DT.Intensity = 18*(Intensity/154)
Else
SpeedBagFlasher.state = Lightstateon
SpeedBagFlasher.Intensity = 15*(Intensity/154)
SpeedBagFlasher1.state = Lightstateon
SpeedBagFlasher1.Intensity = 18*(Intensity/154)
End If
else
SpeedBagFlasher.state = Lightstateoff
SpeedBagFlasher1.state = Lightstateoff
SpeedBagFlasher_DT.state = Lightstateoff
SpeedBagFlasher1_DT.state = Lightstateoff
end if
end If
PrevSpeedBagInt = Intensity
End Sub
Sub SolRopeSpot(Intensity)
if Intensity <> PrevRopeSpotInt Then
if Intensity > 0 then
If DesktopMode = True Then
RopeFlasher_DT.state = Lightstateon
RopeFlasher_DT.Intensity = 12*(Intensity/154)
RopeFlasher1_DT.state = Lightstateon
RopeFlasher1_DT.Intensity = 18*(Intensity/154)
Else
RopeFlasher.state = Lightstateon
RopeFlasher.Intensity = 15*(Intensity/154)
RopeFlasher1.state = Lightstateon
RopeFlasher1.Intensity = 18*(Intensity/154)
End If
else
RopeFlasher.state = Lightstateoff
RopeFlasher1.state = Lightstateoff
RopeFlasher_DT.state = Lightstateoff
RopeFlasher1_DT.state = Lightstateoff
end if
end If
PrevRopeSpotInt = Intensity
End Sub
Sub UpperWhiteFlasher(Intensity)
if Intensity <> PrevUWInt Then
if Intensity > 0 then
If DesktopMode = True Then
TopFlasher1_DT.state = Lightstateon
TopFlasher1_DT.Intensity = 15*(Intensity/154)
Else
TopFlasher1.state = Lightstateon
TopFlasher1.Intensity = 15*(Intensity/154)
TopFlasher2.state = Lightstateon
TopFlasher2.Intensity = 6*(Intensity/154)
end If
P_TopFlasher.image = "dome3_clear_lit"
else
TopFlasher1.state = Lightstateoff
TopFlasher2.state = Lightstateoff
TopFlasher1_DT.state = Lightstateoff
P_TopFlasher.image = "dome3_clear"
end if
end If
if UseB2SBG then
if Intensity > 0 then
Controller.B2SSetData 219,1
Else
Controller.B2SSetData 219,0
End If
End If
PrevUWInt = Intensity
End Sub
Sub UpperRedFlasher(Intensity)
if Intensity <> PrevURInt Then
if Intensity > 0then
RightFlasher1.state = Lightstateon
RightFlasher2.state = Lightstateon
RightFlasher3.state = Lightstateon
RightFlasher1.state = 12*(Intensity/154)
RightFlasher2.state = 12*(Intensity/154)
RightFlasher3.state = 12*(Intensity/154)
P_RightFlasher.image = "TOPFlasherRED_lit"
else
RightFlasher1.state = Lightstateoff
RightFlasher2.state = Lightstateoff
RightFlasher3.state = Lightstateoff
P_RightFlasher.image = "TOPFlasherRED_unlit"
end if
end If
if UseB2SBG then
if Intensity > 0 then
Controller.B2SSetData 220,1
Else
Controller.B2SSetData 220,0
End If
End If
PrevURInt = Intensity
End Sub
Sub LowerRedFlasher(Intensity)
if Intensity <> PrevLRInt Then
if Intensity > 0 then
If DesktopMode = True Then
LeftFlasher1_DT.state = Lightstateon
LeftFlasher2_DT.state = Lightstateon
LeftFlasher3_DT.state = Lightstateon
LeftFlasher1_DT.state = 12*(Intensity/154)
LeftFlasher2_DT.state = 12*(Intensity/154)
LeftFlasher3_DT.state = 12*(Intensity/154)
else
LeftFlasher1.state = Lightstateon
LeftFlasher2.state = Lightstateon
LeftFlasher3.state = Lightstateon
LeftFlasher1.state = 12*(Intensity/154)
LeftFlasher2.state = 12*(Intensity/154)
LeftFlasher3.state = 12*(Intensity/154)
end If
P_LeftFlasher.image = "dome3_red_lit"
else
LeftFlasher1.state = Lightstateoff
LeftFlasher2.state = Lightstateoff
LeftFlasher3.state = Lightstateoff
LeftFlasher1_DT.state = Lightstateoff
LeftFlasher2_DT.state = Lightstateoff
LeftFlasher3_DT.state = Lightstateoff
P_LeftFlasher.image = "dome3_red"
end if
end If
if UseB2SBG then
if Intensity > 0 then
Controller.B2SSetData 221,1
Else
Controller.B2SSetData 221,0
End If
End If
PrevLRInt = Intensity
End Sub
'-----------------------------
'------ VUK animation ------
'-----------------------------
Const PopTimerInterval=40
Sub Popper_Hit
Controller.Switch(28) = 1
End Sub
Sub SolPopper(Enabled)
If Enabled Then
If Controller.Switch(28) = True Then
PlaySoundAtVol SoundFX("Kicker",DOFContactors), Vuk1, 1
Controller.Switch(28) = 0
VUK1.CreateBall
Popper.destroyball
'vpmTimer.AddTimer PopTimerInterval,"VUKLevel1"
VUKLevel = 1
VUKTimer.enabled = True
end if
end if
end sub
Dim VUKLevel
Sub VUKTimer_Timer
select case VUKlevel
case 1: VUK2.CreateBall
VUK1.DestroyBall
case 2: VUK3.CreateBall
VUK2.DestroyBall
case 3: VUK4.CreateBall
VUK3.DestroyBall
case 4: VUK5.CreateBall
VUK4.DestroyBall
case 5: VUK6.CreateBall
VUK5.DestroyBall
case 6: VUK7.CreateBall
VUK6.DestroyBall
case 8: VUK8.CreateBall
VUK7.DestroyBall
case 9: VUKTop.CreateBall
VUK8.DestroyBall
VUKTop.Kick 340,8
VUKTimer.enabled = False
end Select
VUKLevel = VUKLevel + 1
End Sub
Sub VUKLevel1(swNo)
VUK2.CreateBall
VUK1.DestroyBall
vpmTimer.AddTimer PopTimerInterval,"VUKLevel2"
End Sub
Sub VUKLevel2(swNo)
VUK3.CreateBall
VUK2.DestroyBall
vpmTimer.AddTimer PopTimerInterval,"VUKLevel3"
End Sub
Sub VUKLevel3(swNo)
VUK4.CreateBall
VUK3.DestroyBall
vpmTimer.AddTimer PopTimerInterval,"VUKLevel4"
End Sub
Sub VUKLevel4(swNo)
VUK5.CreateBall
VUK4.DestroyBall
vpmTimer.AddTimer PopTimerInterval,"VUKLevel5"
End Sub
Sub VUKLevel5(swNo)
VUK6.CreateBall
VUK5.DestroyBall
vpmTimer.AddTimer PopTimerInterval,"VUKLevel6"
End Sub
Sub VUKLevel6(swNo)
VUK7.CreateBall
VUK6.DestroyBall
vpmTimer.AddTimer PopTimerInterval,"VUKLevel7"
End Sub
Sub VUKLevel7(swNo)
VUK8.CreateBall
VUK7.DestroyBall
vpmTimer.AddTimer PopTimerInterval,"VUKLevel8"
End Sub
Sub VUKLevel8(swNo)
VUKTop.CreateBall
VUK8.DestroyBall
VUKTop.Kick 320,6
End Sub
'---------------------------------------------------------------------------
' Table Init
'---------------------------------------------------------------------------
Dim bsTrough,bsCornerKickout,bsCatapult,mRope,magRopeMagnet
Dim DesktopMode: DesktopMode = CP.ShowDT
Sub CP_Init
vpmInit Me
With Controller
.GameName = cGameName
'If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
.SplashInfoLine = "Champion Pub"
.HandleKeyboard = 0
.ShowTitle = 0
.ShowDMDOnly = 1
.ShowFrame = 0
.HandleMechanics = 0
.Hidden = 0
.Dip(0) = &H00
'.Games(cGameName).Settings.Value("samples")=0
'DMD position for 3 Monitor Setup
' Controller.Games(cGameName).Settings.Value("dmd_pos_x")=500
' Controller.Games(cGameName).Settings.Value("dmd_pos_y")=0
' Controller.Games(cGameName).Settings.Value("dmd_width")=505
' Controller.Games(cGameName).Settings.Value("dmd_height")=155
' Controller.Games(cGameName).Settings.Value("rol")=0
' Controller.Games(cGameName).Settings.Value("ddraw") = 0 'set to 0 if You have problems with DMD showing or table stutter or FullScreen crashes
On Error Resume Next
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
On Error Goto 0
End With
On Error Goto 0
PinMAMETimer.Interval=PinMAMEInterval
vpmNudge.TiltSwitch=14
vpmNudge.Sensitivity=2
vpmNudge.TiltObj=Array(LeftSlingshot,RightSlingshot)
vpmMapLights AllLights
Set bsTrough=New cvpmBallStack
bsTrough.InitSw 0,32,33,34,35,0,0,0
bsTrough.InitKick BallRelease,40,8
bsTrough.InitExitSnd SoundFX("BallRel",DOFContactors),SoundFX("Solenoid",DOFContactors)
bsTrough.Balls=4
'Plunger lane
Set bsCatapult = New cvpmSaucer
bsCatapult.InitKicker CatapultLaunchKicker,18,0,42,0
bsCatapult.InitSounds SoundFX("kicker_enter_center",DOFContactors),SoundFX("solon",DOFContactors),SoundFX("popper_ball",DOFContactors)
'Left Kicker
Set bsCornerKickout=New cvpmBallStack
bsCornerKickout.InitSaucer CornerKickout,37,155,5
bsCornerKickout.InitExitSnd SoundFX("popper",DOFContactors),SoundFX("solon",DOFContactors)
Set mRope=New cvpmMech
mRope.MType=vpmMechOneSol+vpmMechCircle+vpmMechLinear+vpmMechFast
mRope.Sol1=25
mRope.Length=300 '280-300 duration of one turn in 1/60 seconds
mRope.Steps=720
mRope.Callback=GetRef("UpdateRope")
mRope.Start
Set magRopeMagnet=New cvpmMagnet
magRopeMagnet.InitMagnet TrigMagnet,39 '35
magRopeMagnet.Solenoid=7
magRopeMagnet.Size=60
magRopeMagnet.GrabCenter=False
magRopeMagnet.CreateEvents "magRopeMagnet"
Controller.Switch(61)=1 'Left Scoop Up
Controller.Switch(62)=1 'Right Scoop Up
Controller.Switch(22)=1 'close coin door
vpmTimer.PulseSw 45 'Rope
'Features
If DesktopMode = True Then 'Show Desktop components
SideWood.visible=1
LeftRail.visible=1
RightRail.visible=1
Else
SideWood.visible=0
LeftRail.visible=0
RightRail.visible=0
End if
PLeftOutlane_Easy.visible = (LeftOutlanePost <> 1) and (LeftOutlanePost <> 2)
RLeftOutlane_Easy.visible = (LeftOutlanePost <> 1) and (LeftOutlanePost <> 2)
RLeftOutlane_Easy.Collidable = (LeftOutlanePost <> 1) and (LeftOutlanePost <> 2)
PLeftOutlane_Med.visible = (LeftOutlanePost=1)
RLeftOutlane_Med.visible = (LeftOutlanePost=1)
RLeftOutlane_Med.Collidable = (LeftOutlanePost=1)
PLeftOutlane_Hard.visible = (LeftOutlanePost=2)
RLeftOutlane_Hard.visible = (LeftOutlanePost=2)
RLeftOutlane_Hard.Collidable = (LeftOutlanePost=2)
if DangerZoneMod then
DangerZoneGate.visible = 1
DangerZoneGate.collidable = 1
P_DangerZonePost.visible = 0
DangerZonePin.isdropped = 1
Else
DangerZoneGate.visible = 0
DangerZoneGate.collidable = 0
P_DangerZonePost.visible = 1
DangerZonePin.isdropped = 0
End If
'Table elements
boxer.objRotZ=0
leftArm.objRotZ=0
rightArm.objRotZ=0
BoxerSetPos
MDirc=1
LockWall1.isdropped = True
LockWall2.isdropped = True
DivPost1a.Isdropped = True
DivPost2a.Isdropped = True
RopePopperKicker.Isdropped = True
PL.PullBack
PR.PullBack
DiverterClosed.IsDropped=0
PostDiverter.IsDropped=1
ForceField.IsDropped=1
RightScoopBack.isdropped = True
LeftScoopBack.isdropped = True
End Sub
Sub CP_Exit()
Controller.Stop
End Sub
'---------------------------------------------------------------------------
' keyboard routines
'---------------------------------------------------------------------------
Const keyBuyInButton=3 ' (2)Specify Keycode for the Buy-In Button
ExtraKeyHelp=KeyName(keyBuyInButton) & vbTab & "Buy-in Button"
Sub CP_KeyDown(ByVal keycode)
If keycode=PlungerKey Then Controller.Switch(23)=1
If KeyDownHandler(keycode) Then Exit Sub
End Sub
Sub CP_KeyUp(ByVal keycode)
If keycode=PlungerKey Then Controller.Switch(23)=0
If KeyUpHandler(keycode) Then Exit Sub
End Sub
'-----------------------------------
' GI
'-----------------------------------
dim obj,GI0_status,GI1_status
Sub UpdateGI(GINo,Status)
select case GINo
case 0: if status <> GI0_status Then
if status > 0 then
DOF 101, DOFOn
GI_PF1.state = Lightstateon
for each obj in JumpRampBulbs
obj.intensity = 60 / 8 * Status
obj.state = lightstateon
next
for each obj in GIString1
obj.intensity = Status + DimGI
obj.state = lightstateon
next
else
DOF 101, DOFOff
GI_PF1.state = Lightstateoff
for each obj in JumpRampBulbs
obj.state = lightstateoff
next
for each obj in GIString1
obj.state = lightstateoff
next
end if
GI0_status = status
End If
case 1: if status <> GI1_status Then
if status > 0 then
GI_PF2.state = Lightstateon
for each obj in GIString2
obj.intensity = Status + DimGI
obj.state = lightstateon
next
else
GI_PF2.state = Lightstateoff
for each obj in GIString2
obj.state = lightstateoff
next
end if
GI1_status = status
End If
' Backglass
case 2: if UseB2SBG then
if status > 0 then
'BackGlass On
if Status > 4 then
Controller.B2SSetData 1,1 'High Intensity
Controller.B2SSetData 2,0 'Low Intensity
Else
Controller.B2SSetData 1,0
Controller.B2SSetData 2,1
end If
else
'BackGlass Off
Controller.B2SSetData 1,0
Controller.B2SSetData 2,0
end if
End If
' not used
' case 3: if status then
' end if
' case 4: if status then
' end if
end select
End Sub
Sub UpdateLightsTimer_Timer
If controller.Lamp(85) = LightstateOff Then
if PostFlasher.state <> Lightstateoff then
P_Post.image = "Post_red"
PostFlasher.state = Lightstateoff
end If
Else
if PostFlasher.state <> Lightstateon then
P_Post.image = "Post_red_lit"
PostFlasher.state = Lightstateon
End If
End If
End Sub
'---------------------------------------------------------------------------
' R o p e
'---------------------------------------------------------------------------
Dim SPos:SPos = 0
Dim TurnCount,Rope1,Rope2
'RopeLevel 0
Rope1 = 620
Rope2 = 660
if RopeLevel = 1 Then
Rope1 = 610
Rope2 = 665
End If
if RopeLevel = 2 Then
Rope1 = 600
Rope2 = 670
End If
Sub UpdateRope(aNewPos,aSpeed,aLastPos) 'animation for rope
playsoundAtVol SoundFX("motor1",DOFGear), PRope, 1
if aNewPos = 0 Then
if Turncount < 20 then
TurnCount = TurnCount + 1.5
end If
end if
PRope.RotY = aNewPos/2 + 40
If (aNewPos >= 700) or (aNewPos <= 20) Then 'zero position opto switch
controller.switch(64) = 1
else
controller.switch(64) = 0
end if
If (aNewPos>Rope1) and (aNewPos<Rope2) Then 'ball hit at 6 'o clock rope time (620-660)
if controller.Switch(45) Then
playsoundAtVol "fx_collide", PRope, 1
Ropepopper.kick int(rnd*70)+190,2+(TurnCount*0.2)
Controller.Switch(45) = 0
end If
End If
if controller.Switch(45) and ABS(BoxerZrot)<160 Then 'box fight is active - kick ball out
if aNewPos > 600 and anewpos < 640 then
playsoundAtVol "fx_collide", PRope, 1
Ropepopper.kick 240,7
Controller.Switch(45) = 0
END If
end if
End Sub
Sub Trigger6_Hit
magRopeMagnet.AddBall ActiveBall
magRopeMagnet.AttractBall ActiveBall
End Sub
Sub RopePopperKicker_Timer
RopePopper.Timerenabled = False
RopePopperKicker.isdropped = True
End Sub
'Magnet VUK animation
Dim VUKBall
Sub SolMagnetPopper(Enabled)
If Enabled Then
If Controller.Switch(45) = True Then
PlaySoundAtVol SoundFX("Kicker",DOFContactors), RopePopper, 1
Controller.Switch(45) = 0
MagVUKTimer.enabled = 1
end if
RopePopperKicker.Isdropped = False
RopePopperKicker.Timerenabled = True
end if
end sub
Sub MagVUKTimer_Timer
if VUKBall.z > 235 Then
VUKBall.z = Vukball.z + 2
Else
VUKBall.z = Vukball.z + 3
End If
if VUKBall.z > 260 Then
MagVUKTimer.enabled = 0
RopePopper.kick 0,1
TurnCount = 0
end If
End Sub
'---------------------------------------------------------------------------
' B o x e r
'---------------------------------------------------------------------------
Dim MDirc,boxerZRot
boxerZRot=0
Mdirc=-1
SolCallback(11)="SolRightArm"
SolCallback(13)="SolLeftArm"
SolCallback(26)="SolMotorDirc" ' motor direction
SolCallback(27)="SolMotor" ' boxer motor
Sub SolMotorDirc(Enabled)
If Enabled Then
MDirc=-1
Else
MDirc=1
End If
End Sub
Sub SolMotor(Enabled)
if Enabled then
BoxerTurnTimer.Enabled=False
BoxerTurnTimer.Interval=15 '20
BoxerTurnTimer.Enabled=True
else
BoxerTurnTimer.Enabled=False
end if
End Sub
Sub BoxerTurnTimer_Timer
' playsound SoundFX("motor1",DOFGear),0,0.15 ' TODO
playsoundAtVol SoundFX("motor1",DOFGear), Boxer, 1
boxerZRot = boxerZRot-MDirc
If boxerZRot<-180 then boxerZRot=179
If boxerZRot>180 then boxerZRot=-179
BoxerSetPos
End Sub
dim rightArmRotx:rightArmRotx=0
dim rArmDir:rArmDir=1.5
dim leftArmRotx:leftArmRotx=0
dim lArmDir:lArmDir=1.5
dim cRad:cRad=3.14159265358979/180
Sub SolRightArm(Enabled)
If Enabled Then
playsound SoundFX("solon",DOFContactors),0,0.5,-0.25
BRTimer.Enabled=1
End If
End Sub
Sub SolLeftArm(Enabled)
If Enabled Then
playsound SoundFX("solon",DOFContactors),0,0.5,0.25
BLTimer.Enabled=1
End If
End Sub
' Right arm animation
Sub BRTimer_Timer
rightArmRotx = rightArmRotx + rArmDir
if rightArmRotx>75 then
rightArmRotx=75
rArmDir = rArmDir * -1
end if
if rightArmRotx<0 then
BRTimer.Enabled=0
rightArmRotx=0
rArmDir = rArmDir * -1
end if
if rightArmRotx > 68 then