-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathDeadly Weapon (Gottlieb 1990) v1.0.1.vbs
1495 lines (1329 loc) · 56.7 KB
/
Deadly Weapon (Gottlieb 1990) v1.0.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
Option Explicit
Randomize
'
' DDDDDDDD EEEEEEEE AAAAA DDDDDDDD LL YY YY WW WW EEEEEEEE AAAAA PPPPPPPP OOOOOOO NN NN
' DD DD EE AA AA DD DD LL YY YY WW WW EE AA AA PP PP OO OO NNN NN
' DD DD EE AA AA DD DD LL YY YY WW WW EE AA AA PP PP OO OO NNNN NN
' DD DD EE AA AA DD DD LL YYYY WW WW EE AA AA PP PP OO OO NN NN NN
' DD DD EEEEEEEE AAAAAAAAA DD DD LL YY WW WW EEEEEEEE AAAAAAAAA PPPPPPPP OO OO NN NN NN
' DD DD EE AA AA DD DD LL YY WW WW EE AA AA PP OO OO NN NN NN
' DD DD EE AA AA DD DD LL YY WW W WW EE AA AA PP OO OO NN NNNN
' DD DD EE AA AA DD DD LL YY WW W WW EE AA AA PP OO OO NN NNN
' DDDDDDDD EEEEEEEE AA AA DDDDDDDD LLLLLLLL YY WWWWWWW EEEEEEEE AA AA PP OOOOOOO NN NN
'
' by Gottlieb (Premier Technology), 1990
'
' for VPX by Schreibi34, 2019
'
' Special thanks to
'
' - Herweh for scripting everything on this table, including kickers, animations, airball, additional GI and SSF sounds. He also fixed stuff like the trough and the tilt script!
' Without him this table wouldn't be half as good!!! One of the best and a great guy!! This is also your table!! Thanks!!!
'
' - 32assassin and BodyDump for bringing this Table to VPX. I used their table as a base.
'
' - Kiwi and Destruk for a great hint when 'Tilt' didn't want to work the way it should
'
' - RothbauerW for some code of his manuel trough in 'No Good Gofers'
'
' - Bord and BorgDog for images, testing and all kinds of help!
'
' - BorgDog for moving spinner rod
'
' - Flupper - cycles insert material
'
' - Thalamus for playtesting and screenshots
'
' - Ninuzzu - BallShadow
'
' - Whoever made the flipper shadow
'
' - Last, and definetly not least the VPX devs!! Thanks guys!
'
' Release Notes:
' 1.0.1: Some bugfixes
' - improved the usage of 'ActiveBall'
'
' 1.0: Initial release
'
' ****************************************************
' OPTIONS
' ****************************************************
Dim EnableAdditionalGI, ShowBallShadow, EnableGI
' ENABLE/DISABLE additional GI (like dark playfield during "Mystery" or "Drain", flashing "Attract Mode" and "Multiball", etc.)
' 0 = additional GI is off (default)
' 1 = additional GI is on
EnableAdditionalGI = 1
' ENABLE/DISABLE GI (general illumination)
' 0 = GI is off
' 1 = GI is on (default)
EnableGI = 1
' SHOW/HIDE the ball shadow
' 0 = ball shadow are hidden
' 1 = ball shadow are visible (default)
ShowBallShadow = 1
' ***************************************************************************************************************************************************************
' ****************************************************
' dynamic flipper friction mod and settings
' ****************************************************
Const DynamicFlipperFriction = True
Const DynamicFlipperFrictionResting = 0.4
Const DynamicFlipperFrictionActive = 1.0
' ****************************************************
' standard definitions
' ****************************************************
Const cGameName = "deadweap"
Const UseSolenoids = 2
Const UseLamps = 1
Const UseGI = 0
Const UseSync = 0
Const SSolenoidOn = "SolOn"
Const SSolenoidOff = "SolOff"
Const SCoin = "coin"
Const BallSize = 50
Const BallMass = 1.3
If Version < 10600 Then
MsgBox "This table requires Visual Pinball 10.6 Revision 3696 or newer!" & vbNewLine & "Your version: " & Replace(Version/1000,",","."), , "Deadly Weapon VPX"
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
LoadVPM "01210000","GTS3.VBS",3.10
Dim DesktopMode: DesktopMode = Table1.ShowDT
' Used to enable/disable flippers based on tilt and ball status
Dim FlippersEnabled : FlippersEnabled = False
' ENABLE/DISABLE manual ball control for debugging
Dim EnableManualBallControl : EnableManualBallControl = 0
' ENABLE/DISABLE air ball mode
Dim AirBall : AirBall = 1
' ****************************************************
' table init
' ****************************************************
Sub Table1_Init
With Controller
On Error Resume Next
.GameName = cGameName
If Err Then MsgBox "Can't start game " & cGameName & vbNewLine & Err.Description : Exit Sub
On Error Goto 0
.SplashInfoLine = "Deadly Weapon (Gottlieb)"
.HandleMechanics= 0
.HandleKeyboard = 0
.ShowDMDOnly = 1
.ShowFrame = 0
.ShowTitle = 0
.Hidden = 1
On Error Resume Next
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
On Error Goto 0
End With
InitLights InsertLights
InitTable
End Sub
Sub Table1_Paused() : Controller.Pause = True : End Sub
Sub Table1_UnPaused() : Controller.Pause = False : End Sub
Sub Table1_Exit() : Controller.Stop : End Sub
Sub InitTable()
' some timer inits
PinMAMETimer.Interval = PinMAMEInterval
PinMAMETimer.Enabled = True
' nudging
vpmNudge.TiltSwitch = 151
vpmNudge.Sensitivity= 5
vpmNudge.TiltObj = Array(Bumper10, Bumper11, Bumper12, Bumper13, RightSlingShot, sw14)
' trough (do not use the standard trough as it does not work with this Gottlieb table)
RightSlot.CreateSizedballWithMass Ballsize/2,Ballmass
MiddleSlot.CreateSizedballWithMass Ballsize/2,Ballmass
LeftSlot.CreateSizedballWithMass Ballsize/2,Ballmass
Controller.Switch(26) = True
' no ball in drain (Drain.CreateSizedballWithMass Ballsize/2,Ballmass)
Controller.Switch(16) = False
' kickback
LeftPlunger.Pullback
' side rails
Ramp15.Visible = DesktopMode
Ramp16.Visible = DesktopMode
' maybe no GI
If EnableGI = 0 Then SetGI False, False
End Sub
' ****************************************************
' solenoids - increase by 1 because first solenoid is 0
' ****************************************************
SolCallback(5) = "SolKickingTarget"
SolCallback(7) = "SolKickback"
SolCallBack(8) = "SolResetDropTargets"
SolCallback(9) = "SolLeftKicker"
SolCallback(10) = "SolRightKicker"
SolCallback(26) = "SolGI"
SolCallback(28) = "SolBallRelease"
SolCallback(29) = "SolDrain"
SolCallback(30) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
SolCallback(31) = "SolTilt"
'SolCallback(32) = "" ' do not add the callback to these solenoid as the Tilt mechanism gets crazy
' playfield flashers (11 to 18)
SolCallback(11) = "SolFlasherMultiball"
SolCallback(12) = "SolFlasherSpecial"
SolCallback(13) = "SolFlasherGas"
SolCallback(14) = "SolFlasherAlley"
SolCallback(15) = "SolFlasherGrill"
SolCallback(16) = "SolFlasherBank"
SolCallback(17) = "SolFlasherMall"
SolCallback(18) = "SolFlasherSchool"
' backboard flashers (19 - 25)
' right now nothing to do
Sub SolTilt(Enabled)
FlippersEnabled = Not Enabled
SetGI FlippersEnabled, False
SolLFlipper False
SolRFlipper False
End Sub
' ******************************************************
' manual trough, based on code from nfozzy and rothbauerw
' ******************************************************
Sub LeftSlot_Hit() : Controller.Switch(26) = True : UpdateTrough : End Sub
Sub LeftSlot_UnHit() : Controller.Switch(26) = False : UpdateTrough : End Sub
Sub MiddleSlot_UnHit() : UpdateTrough : End Sub
Sub RightSlot_UnHit() : UpdateTrough : End Sub
Sub UpdateTrough()
UpdateTroughTimer.Interval = 300
UpdateTroughTimer.Enabled = True
End Sub
Sub UpdateTroughTimer_Timer()
If RightSlot.BallCntOver = 0 Then MiddleSlot.Kick 60, 9
If MiddleSlot.BallCntOver = 0 Then LeftSlot.Kick 60, 9
UpdateTroughTimer.Enabled = False
End Sub
' ******************************************************
' drain and ball release
' ******************************************************
Sub Drain_Hit()
PlaySoundAt "drain", Drain
UpdateTrough
Controller.Switch(16) = True
End Sub
Sub Drain_UnHit()
Controller.Switch(16) = False
End Sub
Sub SolDrain(Enabled)
If Enabled Then Drain.Kick 60,20
End Sub
Sub SolBallRelease(Enabled)
If Enabled Then
PlaySoundAt SoundFX("Ballrelease",DOFContactors), RightSlot
RightSlot.Kick 60, 7
UpdateTrough
End If
End Sub
' ****************************************************
' additional GI
' ****************************************************
Dim DrainGIOffSteps : DrainGIOffSteps = 0
Sub DrainGIOffTimer_Timer()
If EnableAdditionalGI <> 1 Then DrainGIOffTimer.Enabled = False
If isGIOn And DrainGIOffSteps > 1 And IsGameOver Then SetGI False, False
DrainGIOffSteps = DrainGIOffSteps + 1
If Not isGIOn And (DrainGIOffSteps >= 8 Or Not IsGameOver) Then
SetGI True, False
DrainGIOffTimer.Enabled = False
End If
End Sub
' additional GI for attract mode
Dim AttractTimerStep : AttractTimerStep = 30 + Int((Rnd()*3+1) * 20)
Sub AttractTimer_Timer()
If EnableAdditionalGI <> 1 Then AttractTimer.Enabled = False
If AttractTimer.Interval = 999 Then
If AttractTimerStep > 0 Then
AttractTimerStep = AttractTimerStep - 1
Else
AttractTimerStep = 0
AttractTimer.Interval = 100
End If
Else
If AttractTimer.Interval = 100 Then
AttractTimer.Interval = IIF((AttractTimerStep>=10), 50, 1000 - AttractTimerStep * 100)
SetGI False, False
Else
AttractTimer.Interval = 100
SetGI True, False
End If
AttractTimerStep = AttractTimerStep + 1
If AttractTimerStep >= 25-Int(Rnd()*10+1) Then
AttractTimer.Interval = 999
AttractTimerStep = 30 + Int((Rnd()*5+1) * 20)
SetGI True, False
End If
End If
End Sub
' additional GI for multiball mode
Dim MultiballTimerStep : MultiballTimerStep = 0
Sub MultiballTimer_Timer()
If EnableAdditionalGI <> 1 Then MultiballTimer.Enabled = False
If MultiballTimer.Interval = 1000 Then
If MultiballTimerStep >= 3 Then
MultiballTimerStep = 0
MultiballTimer.Interval = 100
End If
Else
If MultiballTimerStep >= 8 Then
MultiballTimerStep = 0
MultiballTimer.Interval = 1000
SetGI True, False
Else
SetGI (Not isGIOn), False
End If
End If
MultiballTimerStep = MultiballTimerStep + 1
End Sub
' ****************************************************
' keycodes
' ****************************************************
Sub Table1_KeyDown(ByVal keycode)
If keycode = PlungerKey Then Plunger.Pullback : PlaySoundAt "plungerpull", Plunger
If keycode = LeftFlipperKey Then SolLFlipper True
If keycode = RightFlipperkey Then SolRFlipper True
If keycode = StartGameKey Then Controller.Switch(3) = True
If keycode = AddCreditKey Then Controller.Switch(1) = True
If keycode = AddCreditKey2 Then Controller.Switch(2) = True
If keycode = KeySlamDoorHit Then Controller.Switch(152) = True
If keycode = LeftMagnaSave Then Controller.Switch(4) = True
If keycode = RightMagnaSave Then Controller.Switch(5) = True
If IsGameOver Then
If keycode = LeftFlipperKey Then Controller.Switch(4) = True
If keycode = RightFlipperkey Then Controller.Switch(5) = True
End If
If KeyDownHandler(keycode) Then Exit Sub
' manual ball control
If EnableManualBallControl = 1 Then
If keycode = 46 Then If contball = 1 Then contball = 0 : BallControlTimer.Enabled = False Else contball = 1 : BallControlTimer.Enabled = True: End If : End If ' C Key
If keycode = 48 Then If bcboost = 1 Then bcboost = bcboostmulti Else bcboost = 1 : End If : End If 'B Key
If keycode = 203 Then bcleft = 1 ' Left Arrow
If keycode = 200 Then bcup = 1 ' Up Arrow
If keycode = 208 Then bcdown = 1 ' Down Arrow
If keycode = 205 Then bcright = 1 ' Right Arrow
End If
End Sub
Sub Table1_KeyUp(ByVal keycode)
If keycode = PlungerKey Then Plunger.Fire : PlaySoundAt "plunger", Plunger
If keycode = LeftFlipperKey Then SolLFlipper False
If keycode = RightFlipperkey Then SolRFlipper False
If keycode = StartGameKey Then Controller.Switch(3) = False
If keycode = AddCreditKey Then Controller.Switch(1) = False
If keycode = AddCreditKey2 Then Controller.Switch(2) = False
If keycode = KeySlamDoorHit Then Controller.Switch(152) = False
If keycode = LeftMagnaSave Then Controller.Switch(4) = False
If keycode = RightMagnaSave Then Controller.Switch(5) = False
If IsGameOver Then
If keycode = LeftFlipperKey Then Controller.Switch(4) = False
If keycode = RightFlipperkey Then Controller.Switch(5) = False
End If
If KeyUpHandler(keycode) Then Exit Sub
' manual ball control
If EnableManualBallControl = 1 Then
If keycode = 203 Then bcleft = 0 ' Left Arrow
If keycode = 200 Then bcup = 0 ' Up Arrow
If keycode = 208 Then bcdown = 0 ' Down Arrow
If keycode = 205 Then bcright = 0 ' Right Arrow
End If
End Sub
' ****************************************************
' manual ball control
' ****************************************************
Sub StartControl_Hit() : Set ControlBall = ActiveBall : contballinplay = True : End Sub
Sub StopControl_Hit() : contballinplay = false : End Sub
Dim bcup, bcdown, bcleft, bcright, contball, contballinplay, ControlBall, bcboost
Dim bcvel, bcyveloffset, bcboostmulti
bcboost = 1 'Do Not Change - default setting
bcvel = 4 'Controls the speed of the ball movement
bcyveloffset = -0.01 'Offsets the force of gravity to keep the ball from drifting vertically on the table, should be negative
bcboostmulti = 3 'Boost multiplier to ball veloctiy (toggled with the B key)
Sub BallControlTimer_Timer()
If Contball and ContBallInPlay then
If bcright = 1 Then ControlBall.velx = bcvel*bcboost Else If bcleft = 1 Then ControlBall.velx = - bcvel*bcboost Else ControlBall.velx=0 : End If : End If
If bcup = 1 Then ControlBall.vely = -bcvel*bcboost Else If bcdown = 1 Then ControlBall.vely = bcvel*bcboost Else ControlBall.vely= bcyveloffset : End If : End If
End If
End Sub
' ****************************************************
' flippers
' ****************************************************
Sub SolLFlipper(Enabled)
If Enabled Then
If FlippersEnabled Then
PlaySoundAt SoundFX("fx_Flipperup", DOFContactors), LeftFlipper
If DynamicFlipperFriction Then LeftFlipper.Friction = DynamicFlipperFrictionActive : UpperLeftFlipper.Friction = DynamicFlipperFrictionActive : End If
LeftFlipper.RotateToEnd
UpperLeftFlipper.RotateToEnd
End If
Else
If FlippersEnabled Then PlaySoundAt SoundFX("fx_Flipperdown", DOFContactors), LeftFlipper
If DynamicFlipperFriction Then LeftFlipper.Friction = DynamicFlipperFrictionResting : UpperLeftFlipper.Friction = DynamicFlipperFrictionResting : End If
LeftFlipper.RotateToStart
UpperLeftFlipper.RotateToStart
End If
End Sub
Sub SolRFlipper(Enabled)
If Enabled Then
If FlippersEnabled Then
PlaySoundAt SoundFX("fx_Flipperup", DOFContactors), RightFlipper
If DynamicFlipperFriction Then RightFlipper.Friction = DynamicFlipperFrictionActive
RightFlipper.RotateToEnd
End If
Else
If FlippersEnabled Then PlaySoundAt SoundFX("fx_Flipperdown", DOFContactors), RightFlipper
If DynamicFlipperFriction Then RightFlipper.Friction = DynamicFlipperFrictionResting
RightFlipper.RotateToStart
End If
End Sub
Sub FlipperTimer_Timer()
PLeftFlipper.RotZ = LeftFlipper.CurrentAngle - 180
PLeftFlipperOff.RotZ = LeftFlipper.CurrentAngle - 180
PULeftFlipper.RotZ = UpperLeftFlipper.CurrentAngle - 180
PULeftFlipperOff.RotZ = UpperLeftFlipper.CurrentAngle - 180
PRightFlipper.RotZ = RightFlipper.CurrentAngle - 180
PRightFlipperOff.RotZ = RightFlipper.CurrentAngle - 180
FlipperLSh.RotZ = LeftFlipper.CurrentAngle
FlipperLMSh.RotZ = UpperLeftFlipper.CurrentAngle
FlipperRSh.RotZ = RightFlipper.CurrentAngle
End Sub
' flipper hit sounds
Sub LeftFlipper_Collide(parm)
RandomSoundFlipper()
End Sub
Sub UpperLeftFlipper_Collide(parm)
RandomSoundFlipper()
End Sub
Sub RightFlipper_Collide(parm)
RandomSoundFlipper()
End Sub
Sub RandomSoundFlipper()
Select Case Int(Rnd() * 3) + 1
Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
End Select
End Sub
' ****************************************************
' left kick back
' ****************************************************
Sub SolKickBack(Enabled)
If Enabled Then
LeftPlunger.Fire
PlaySoundAt SoundFX("Popper", DOFContactors), LeftPlunger
Else
LeftPlunger.PullBack
End If
End Sub
' ****************************************************
' sling shots and animations
' ****************************************************
Dim RightStep
Sub RightSlingShot_Slingshot()
vpmTimer.PulseSwitch 15,0,0
PlaySoundAt SoundFX("right_slingshot",DOFContactors), sling1
PSlingR1a.Visible = 0
PSlingR1c.Visible = 1
sling1.TransZ = -20
RightStep = 0
RightSlingShot.TimerEnabled = 1
End Sub
Sub RightSlingShot_Timer()
Select Case RightStep
Case 3:PSlingR1c.Visible = 0:PSlingR1b.Visible = 1:sling1.TransZ = -10
Case 4:PSlingR1b.Visible = 0:PSlingR1a.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0:
End Select
RightStep = RightStep + 1
End Sub
' ****************************************************
' bumper
' ****************************************************
Sub Bumper10_Hit : MoveSkirt 10, 1, Bumper10, BumperSkirt10, ActiveBall : End Sub
Sub Bumper11_Hit : MoveSkirt 11, 2, Bumper11, BumperSkirt11, ActiveBall : End Sub
Sub Bumper12_Hit : MoveSkirt 12, 3, Bumper12, BumperSkirt12, ActiveBall : End Sub
Sub Bumper13_Hit : MoveSkirt 13, 4, Bumper13, BumperSkirt13, ActiveBall : End Sub
Sub Bumper10_Timer() : MoveSkirt 10, 1, Bumper10, BumperSkirt10, Nothing : End Sub
Sub Bumper11_Timer() : MoveSkirt 11, 2, Bumper11, BumperSkirt11, Nothing : End Sub
Sub Bumper12_Timer() : MoveSkirt 12, 3, Bumper12, BumperSkirt12, Nothing : End Sub
Sub Bumper13_Timer() : MoveSkirt 13, 4, Bumper13, BumperSkirt13, Nothing : End Sub
ReDim skirtX(3), skirtY(3)
Sub MoveSkirt(id, soundid, bumper, skirt, ball)
If Not ball Is Nothing Then
bumper.TimerEnabled = False
PlaySoundAt SoundFX("fx_bumper" & soundid, DOFContactors), bumper
skirtX(id-10) = IIF((Abs(skirt.Y-ball.Y)<20),0,IIF((skirt.Y < ball.Y), -1, 1))
skirtY(id-10) = IIF((Abs(skirt.X-ball.X)<20),0,IIF((skirt.X < ball.X), 1, -1))
skirt.RotX = skirtX(id-10)
skirt.RotY = skirtY(id-10)
vpmTimer.PulseSwitch id,0,0
bumper.TimerInterval = 8
bumper.TimerEnabled = True
Else
' turn the moving direction
If Abs(skirt.RotX) >= 4 Or Abs(skirt.RotY) >= 4 Then
skirtX(id-10) = skirtX(id-10) * -0.5
skirtY(id-10) = skirtY(id-10) * -0.5
End If
' move the skirt
skirt.RotX = skirt.RotX + skirtX(id-10) ' vertical, positive moves back down
skirt.RotY = skirt.RotY + skirtY(id-10) ' horizontal, positive moves right down
skirt.TransZ = Abs(skirt.RotX) + IIF(DesktopMode,1,0)
' maybe stop as all action is done
If Abs(skirt.RotX) = 0 And Abs(skirt.RotY) = 0 Then
skirt.TransZ = 0
bumper.TimerEnabled = False
End If
End If
End Sub
' ****************************************************
' slingshot target
' ****************************************************
Sub sw14_Slingshot(): vpmTimer.PulseSwitch 14,0,0 : SlingTarget sw14, sw14P, True : End Sub
Sub sw14_Timer() : SlingTarget sw14, sw14P, False : End Sub
Dim SlingSteps : SlingSteps = 0
Sub SlingTarget(sw, prim, init)
If init Then
sw.TimerEnabled = False
SlingSteps = 0
prim.RotX = 0
sw.TimerInterval = 10
sw.TimerEnabled = True
Else
Select Case SlingSteps
Case 0,1,2,3 : prim.RotX = prim.RotX - 6
Case 4,5 : prim.RotX = prim.RotX * 2 / 3
Case 50 : prim.RotX = 0 : sw.TimerEnabled = False
Case Else : prim.RotX = prim.RotX + 0.25
End Select
SlingSteps = SlingSteps + 1
End If
End Sub
' ****************************************************
' switches
' ****************************************************
' wire triggers
Sub sw22_Hit : Controller.Switch(22) = True : RollOverSound ActiveBall : End Sub
Sub sw22_UnHit : Controller.Switch(22) = False : End Sub
Sub sw23_Hit : Controller.Switch(23) = True : RollOverSound ActiveBall : End Sub
Sub sw23_UnHit : Controller.Switch(23) = False : End Sub
Sub sw25_Hit : Controller.Switch(25) = True : RollOverSound ActiveBall : End Sub
Sub sw25_UnHit : Controller.Switch(25) = False : End Sub
Sub sw32_Hit : Controller.Switch(32) = True : RollOverSound ActiveBall : End Sub
Sub sw32_UnHit : Controller.Switch(32) = False : End Sub
Sub sw33_Hit : Controller.Switch(33) = True : RollOverSound ActiveBall : End Sub
Sub sw33_UnHit : Controller.Switch(33) = False : End Sub
Sub sw35_Hit : Controller.Switch(35) = True : RollOverSound ActiveBall : FlippersEnabled = True : End Sub
Sub sw35_UnHit : Controller.Switch(35) = False : End Sub
Sub sw40_Hit : Controller.Switch(40) = True : RollOverSound ActiveBall : End Sub
Sub sw40_UnHit : Controller.Switch(40) = False : End Sub
Sub sw41_Hit : Controller.Switch(41) = True : RollOverSound ActiveBall : End Sub
Sub sw41_UnHit : Controller.Switch(41) = False : End Sub
Sub sw42_Hit : Controller.Switch(42) = True : RollOverSound ActiveBall : End Sub
Sub sw42_UnHit : Controller.Switch(42) = False : End Sub
Sub sw43_Hit : Controller.Switch(43) = True : RollOverSound ActiveBall : End Sub
Sub sw43_UnHit : Controller.Switch(43) = False : End Sub
Sub sw45_Hit : Controller.Switch(45) = True : RollOverSound ActiveBall : End Sub
Sub sw45_UnHit : Controller.Switch(45) = False : End Sub
' spinners
Sub Spinner1_Spin() : vpmTimer.PulseSwitch 30,0,0 : PlaySoundAt "fx_spinner", Spinner1 : End Sub
Sub Spinner2_Spin() : vpmTimer.PulseSwitch 31,0,0 : PlaySoundAt "fx_spinner", Spinner2 : End Sub
' drop targets
Sub sw24_Hit() : DropTarget 24, sw24, sw24P, sw24POff, True, ActiveBall : DoubleDrop1.Collidable = False : End Sub
Sub sw24_Timer() : DropTarget 24, sw24, sw24P, sw24POff, False, Nothing : End Sub
Sub DoubleDrop1_Hit : DropTarget 24, sw24, sw24P, sw24POff, True, ActiveBall : DropTarget 34, sw34, sw34P, sw34POff, False, Nothing : AvoidTripleHit 44 : DoubleDrop1.Collidable = False : DoubleDrop2.Collidable = False : End Sub
Sub sw34_Hit() : DropTarget 34, sw34, sw34P, sw34POff, True, ActiveBall : DoubleDrop1.Collidable = False : DoubleDrop2.Collidable = False : End Sub
Sub sw34_Timer() : DropTarget 34, sw34, sw34P, sw34POff, False, Nothing : End Sub
Sub DoubleDrop2_Hit : DropTarget 34, sw34, sw34P, sw34POff, True, ActiveBall : DropTarget 44, sw44, sw44P, sw44POff, False, Nothing : AvoidTripleHit 24 : DoubleDrop1.Collidable = False : DoubleDrop2.Collidable = False : End Sub
Sub sw44_Hit() : DropTarget 44, sw44, sw44P, sw44POff, True, ActiveBall : DoubleDrop2.Collidable = False : End Sub
Sub sw44_Timer() : DropTarget 44, sw44, sw44P, sw44POff, False, Nothing : End Sub
Sub SolResetDropTargets(Enabled)
If Enabled Then
DropTargetTimer.Enabled = True
End if
End Sub
Sub DropTargetTimer_Timer()
DropTargetTimer.Enabled = False
PlaySoundAt SoundFX("DTReset",DOFContactors), sw42
ResetDropTarget 24, sw24, sw24P, sw24POff
ResetDropTarget 34, sw34, sw34P, sw34POff
ResetDropTarget 44, sw44, sw44P, sw44POff
DoubleDrop1.Collidable = True : DoubleDrop2.Collidable = True
End Sub
Sub AvoidTripleHit(id)
DoubleDrop1.TimerInterval = 500 + id
DoubleDrop1.TimerEnabled = True
End Sub
Sub DoubleDrop1_Timer()
DoubleDrop1.TimerEnabled = False
End Sub
' standup targets
Sub sw17_Hit() : StandUpTarget 17, sw17, sw17P, True, ActiveBall : End Sub
Sub sw17_Timer() : StandUpTarget 17, sw17, sw17P, False, Nothing : End Sub
Sub sw27_Hit() : StandUpTarget 27, sw27, sw27P, True, ActiveBall : End Sub
Sub sw27_Timer() : StandUpTarget 27, sw27, sw27P, False, Nothing : End Sub
Sub sw37_Hit() : StandUpTarget 37, sw37, sw37P, True, ActiveBall : End Sub
Sub sw37_Timer() : StandUpTarget 37, sw37, sw37P, False, Nothing : End Sub
Sub sw47_Hit() : StandUpTarget 47, sw47, sw47P, True, ActiveBall : End Sub
Sub sw47_Timer() : StandUpTarget 47, sw47, sw47P, False, Nothing : End Sub
Sub sw57_Hit() : StandUpTarget 57, sw57, sw57P, True, ActiveBall : End Sub
Sub sw57_Timer() : StandUpTarget 57, sw57, sw57P, False, Nothing : End Sub
Sub SolKickingTarget(Enabled)
PlaySound SoundFX("slingshot",DOFContactors), 0, 1, 0.05, 0.05
End Sub
Sub DropTarget(id, sw, prim, primOff, playsnd, actBall)
If DoubleDrop1.TimerEnabled And id = DoubleDrop1.TimerInterval-500 Then
sw.TimerEnabled = False
Exit Sub
End If
If Not sw.TimerEnabled Then
If Not actBall Is Nothing Then DropTargetHit playsnd, actBall
Controller.Switch(id) = True
sw.Collidable = False
sw.TimerInterval = 5
sw.TimerEnabled = True
prim.TransX = prim.TransX - 1
prim.TransY = prim.TransY - 1
primOff.TransX = primOff.TransX - 1
primOff.TransY = primOff.TransY - 1
End If
prim.Z = prim.Z - 14
primOff.Z = primOff.Z - 14
If prim.Z < -45 Then
sw.TimerEnabled = False
prim.Z = -50
primOff.Z = -50
End If
End Sub
Sub ResetDropTarget(id, sw, prim, primOff)
sw.TimerEnabled = False
prim.Z = 0 : prim.TransX = 0 : prim.TransY = 0
primOff.Z = 0 : primOff.TransX = 0 : primOff.TransY = 0
Controller.Switch(id) = False
sw.Collidable = True
End Sub
Sub StandUpTarget(id, sw, prim, isHit, actBall)
If isHit And sw.TimerEnabled Then Exit Sub
If Not sw.TimerEnabled Then
If Not actBall Is Nothing Then StandupTargetHit actBall
vpmTimer.PulseSwitch id,0,0
sw.TimerInterval = 5
sw.TimerEnabled = True
Else
prim.TransX = prim.TransX + 0.5
If prim.TransX >= 2.2 Then
prim.TransX = 0
sw.TimerEnabled = False
End If
End If
End Sub
' ****************************************************
' saucer
' ****************************************************
Dim sw20Step : sw20Step = 0
Dim sw21Step : sw21Step = 0
Dim sw20Ball : Set sw20Ball = Nothing
Dim sw21Ball : Set sw21Ball = Nothing
Sub sw20_Hit() : PlaySoundAt "fx_saucer_enter", sw20 : End Sub
Sub sw21_Hit() : PlaySoundAt "fx_saucer_enter", sw21 : End Sub
Sub sw20_Unhit() : Controller.Switch(20) = False : End Sub
Sub sw21_Unhit() : Controller.Switch(21) = False : End Sub
Sub SolLeftKicker(Enabled)
If Enabled Then
sw20Step = 0
MoveHammer sw20Hammer, 0
sw20.TimerInterval = 11
sw20.TimerEnabled = True
End If
End Sub
Sub sw20_Timer()
Select Case sw20Step
Case 0 : MoveHammer sw20Hammer, -1 : PlaySoundAt SoundFX("fx_vuk_exit", DOFContactors), sw20 : NoGlassHitTimer.Enabled = True
Case 1 : MoveHammer sw20Hammer, 16 : If Controller.Switch(20) Then sw20Ball.VelX = 2.5+(Rnd()*0.5-0.25) : sw20Ball.VelY = 7+(Rnd()-0.5) : sw20Ball.VelZ = 12+(Rnd()*2-1) : End If
Case 7 : Controller.Switch(20) = False
Case 25,26,27,28,29 : MoveHammer sw20Hammer, -2
Case 30 : MoveHammer sw20Hammer, 0 : sw20.TimerEnabled = False
Case Else : ' nothing to do
End Select
sw20Step = sw20Step + 1
End Sub
Dim Saucer20MysteryStep : Saucer20MysteryStep = 0
Sub Saucer20MysteryTimer_Timer()
If isGIOn And Controller.Switch(20) And Saucer20MysteryStep > 1 Then SetGI False, False
Saucer20MysteryStep = Saucer20MysteryStep + 1
If Not Controller.Switch(20) Then
If Not isGIOn Then SetGI True, False
Saucer20MysteryStep = 0
Saucer20MysteryTimer.Enabled = False
End If
End Sub
Sub SolRightKicker(Enabled)
If Enabled Then
sw21Step = 0
MoveHammer sw21Hammer, 0
sw21.TimerInterval = 13
sw21.TimerEnabled = True
End If
End Sub
Sub sw21_Timer()
Select Case sw21Step
Case 0 : MoveHammer sw21Hammer, -1 : PlaySoundAt SoundFX("fx_vuk_exit", DOFContactors), sw21 : NoGlassHitTimer.Enabled = True
Case 1 : MoveHammer sw21Hammer, 16 : If Controller.Switch(21) Then sw21Ball.VelX = -2+(Rnd()*0.5-0.25) : sw21Ball.VelY = 7+(Rnd()*0.5-0.25) : sw21Ball.VelZ = 13+(Rnd()*2-1) : End If
Case 7 : Controller.Switch(21) = False
Case 25,26,27,28,29 : MoveHammer sw21Hammer, -2
Case 30 : MoveHammer sw21Hammer, 0 : sw21.TimerEnabled = False
Case Else : ' nothing to do
End Select
sw21Step = sw21Step + 1
End Sub
Dim Saucer21MysteryStep : Saucer21MysteryStep = 0
Sub Saucer21MysteryTimer_Timer()
If isGIOn And Controller.Switch(21) And Saucer21MysteryStep > 1 Then SetGI False, False
Saucer21MysteryStep = Saucer21MysteryStep + 1
If Not Controller.Switch(21) Then
If Not isGIOn Then SetGI True, False
Saucer21MysteryStep = 0
Saucer21MysteryTimer.Enabled = False
End If
End Sub
Sub MoveHammer(hammer, rotZ)
If rotZ = 0 Then
hammer.RotZ = 0
Else
hammer.RotZ = hammer.RotZ + rotZ
End If
End Sub
' ****************************************************
' rotating spinner
' ****************************************************
Dim Angle1, Angle2
Sub SpinnerTimer1_Timer()
Angle1 = (sin (Spinner1.CurrentAngle))
TextBox1.text = Spinner1.CurrentAngle
TextBox2.text = Angle1
PSpinner1.RotX = Spinner1.CurrentAngle
PSpinner1Off.RotX = Spinner1.CurrentAngle
SpinnerRod1.TransZ = -sin( (Spinner1.CurrentAngle) * (2*3.14/360)) * 5
SpinnerRod1.TransX = (sin( (Spinner1.CurrentAngle- 90) * (2*3.14/360)) * -5)
' SpinnerRod1.TransZ = cos ((Spinner1.CurrentAngle)) * -2
' SpinnerRod1.TransY = Angle1 * -2
End Sub
Sub SpinnerTimer2_Timer()
Angle2 = (sin (Spinner2.CurrentAngle))
TextBox3.text = Spinner2.CurrentAngle
TextBox4.text = Angle2
PSpinner2.RotX = Spinner2.CurrentAngle
PSpinner2Off.RotX = Spinner2.CurrentAngle
SpinnerRod2.TransZ = -sin( (Spinner2.CurrentAngle) * (2*3.14/360)) * 5
SpinnerRod2.TransX = (sin( (Spinner2.CurrentAngle- 90) * (2*3.14/360)) * -5)
' SpinnerRod2.TransZ = cos ((Spinner2.CurrentAngle)) * -2
' SpinnerRod2.TransY = Angle2 * -2
End Sub
' *********************************************************************
' playfield insert lights
' *********************************************************************
Dim PFLights(110,3), PFLightsCount(110), isGIOn
Sub InitLights(aColl)
' init inserts
Dim obj, idx
For Each obj In aColl
idx = obj.TimerInterval
Set PFLights(idx, PFLightsCount(idx)) = obj
PFLightsCount(idx) = PFLightsCount(idx) + 1
Next
' init flasher
InitFlasher
' init GI
InitGI
End Sub
Sub InitFlasher()
End Sub
Sub InitGI()
SetGI True, True
End Sub
' inserts and bumper lights
Sub LampTimer_Timer()
Dim chgLamp, num, chg, ii, nr, xxx
xxx = -1
chgLamp = Controller.ChangedLamps
If Not IsEmpty(chgLamp) Then
For ii = 0 To UBound(chgLamp)
Select Case chglamp(ii,0)
Case 1
If chgLamp(ii,1) = 1 Then aBumperValue(0) = -99 Else aBumperValue(0) = 3
Case 70
If chgLamp(ii,1) = 1 Then aBumperValue(1) = -99 Else aBumperValue(1) = 3
Case 75
If chgLamp(ii,1) = 1 Then aBumperValue(2) = -99 Else aBumperValue(2) = 3
Case Else
On Error Resume Next
For nr = 1 to PFLightsCount(chgLamp(ii,0)) : PFLights(chgLamp(ii,0),nr - 1).State = chgLamp(ii,1) : Next
On Error GoTo 0
End Select
Next
End If
End Sub
' *********************************************************************
' flasher
' *********************************************************************
Sub SolFlasherMultiball(Enabled)
FlasherMultiball.State = Abs(Enabled)
End Sub
Sub SolFlasherSpecial(Enabled)
FlasherSpecial.State = Abs(Enabled)
End Sub
Sub SolFlasherGas(Enabled)
FlasherGas.State = Abs(Enabled) : FlasherGasA.State = Abs(Enabled) : FlasherGasB.State = Abs(Enabled)
End Sub
Sub SolFlasherAlley(Enabled)
FlasherAlley.State = Abs(Enabled) : FlasherAlleyA.State = Abs(Enabled) : FlasherAlleyB.State = Abs(Enabled)
End Sub
Sub SolFlasherGrill(Enabled)
FlasherGrill.State = Abs(Enabled) : FlasherGrillA.State = Abs(Enabled)
End Sub
Sub SolFlasherBank(Enabled)
FlasherBank.State = Abs(Enabled) : FlasherBankA.State = Abs(Enabled) : FlasherBankB.State = Abs(Enabled)
End Sub
Sub SolFlasherMall(Enabled)
FlasherMall.State = Abs(Enabled) : FlasherMallA.State = Abs(Enabled) : FlasherMallB.State = Abs(Enabled)
End Sub
Sub SolFlasherSchool(Enabled)
FlasherSchool.State = Abs(Enabled) : FlasherSchoolA.State = Abs(Enabled) : FlasherSchoolB.State = Abs(Enabled)
End Sub
' *********************************************************************
' GI (seems to be initially on and the "Enabled" from the solenoid is vice versa)
' *********************************************************************
Dim GILevel : GILevel = 0
Dim HighInserts : HighInserts = False
Const HighInsertsFactor = 2.5
Sub SolGI(Enabled)
SetGI Not Enabled, False
End Sub
Sub SetGI(Enabled, FastMode)
If EnableGI = 0 And Not isGIOn Then Exit Sub
If isGIOn <> Enabled Then
Dim obj
If Enabled Then
' GI goes on
For Each obj In GIBumper : obj.Image = "Bumper Base GI-ON" : Next
For Each obj In GIBumperCaps : If obj.Image = "Bumper Caps GI-OFF" Then obj.Image = "Bumper Caps GI-ON" : End If : Next
GILevel = IIF(FastMode,4,1)
If HighInserts Then
For Each obj In InsertLightsHI : obj.IntensityScale = obj.IntensityScale / HighInsertsFactor : Next
HighInserts = False
End If
If Not isGIOn Then Playsound "fx_relay_on" : DOF 101, DOFOn : End If
Else
' GI goes off
For Each obj In GIBumper : obj.Image = "Bumper Base GI-OFF" : Next
For Each obj In GIBumperCaps : If obj.Image = "Bumper Caps GI-ON" Then obj.Image = "Bumper Caps GI-OFF" : End If : Next
GILevel = IIF(FastMode,-1,-4)
If Not HighInserts Then
For Each obj In InsertLightsHI : obj.IntensityScale = obj.IntensityScale * HighInsertsFactor : Next
HighInserts = True
End If
If isGIOn Then Playsound "fx_relay_off" : DOF 101, DOFOff : End If
End If
isGIOn = Enabled
If FastMode Then
LightsTimer.Enabled = False
LightsTimer_Timer
LightsTimer.Enabled = True
End If
End If
End Sub
Dim aBumper : aBumper = Array(BumperCap10, BumperCap11, BumperCap12, BumperCap13)
Dim aBumperLight : aBumperLight = Array(BumperLight10, BumperLight11, BumperLight12, Nothing)
Dim aBumperValue : aBumperValue = Array(-99, -99, -99, -99)
Dim aBumperBlend : aBumperBlend = Array(-1, -1, -1, -1)
Sub LightsTimer_Timer()
Dim idx, obj, coll
' bumper lights
For idx = 0 To 3
If aBumperBlend(idx) = -1 Then
aBumperBlend(idx) = aBumper(idx).BlendDisableLighting
End If
If aBumperValue(idx) > -1 Or aBumperValue(idx) = -99 Then
If aBumperValue(idx) = -99 Then
aBumper(idx).Image = "Bumper Caps Lamp ON"
aBumper(idx).BlendDisableLighting = aBumperBlend(idx)
If Not aBumperLight(idx) Is Nothing Then aBumperLight(idx).State = LightStateOn : aBumperLight(idx).IntensityScale = 1 : End If
ElseIf aBumperValue(idx) = 0 Then
aBumper(idx).Image = IIF(isGIOn, "Bumper Caps GI-ON", "Bumper Caps GI-OFF")
aBumper(idx).BlendDisableLighting = aBumperBlend(idx)
If Not aBumperLight(idx) Is Nothing Then aBumperLight(idx).State = LightStateOff : aBumperLight(idx).IntensityScale = 0 : End If
ElseIf aBumperValue(idx) <= 8 Then
aBumper(idx).BlendDisableLighting = aBumper(idx).BlendDisableLighting / 2
If Not aBumperLight(idx) Is Nothing Then aBumperLight(idx).IntensityScale = aBumperValue(idx) / 4 : End If
End If
aBumperValue(idx) = aBumperValue(idx) - 1
End If
Next
' GI
If Not PF_GI_OFF.Visible Then PF_GI_OFF.Visible = True
If Not PF_Overlay_GI_OFF.Visible Then PF_Overlay_GI_OFF.Visible = True
If GILevel > 0 And GILevel < 5 Then
' GI goes on, from 1 to 4
For Each obj In GI : obj.IntensityScale = GILevel / 4 : Next
' playfield and playfield overlay
PF_GI_OFF.TopMaterial = "Playfield" & GILevel
PF_Overlay_GI_OFF.TopMaterial = "Playfield" & GILevel
' playfield elements
For Each obj In GIOn : obj.Material = "Prims platt" & IIF(GILevel=4,""," " & 4-GILevel) : Next
For Each obj In GIOnTrans : obj.Material = "Prims platt trans" & IIF(GILevel=4,""," " & 4-GILevel) : Next
For Each obj In GIOnShiny : obj.Material = "Prims Shiny" & IIF(GILevel=4,""," " & 4-GILevel) : Next
If GILevel = 1 Or GILevel = 4 Then
For Each coll In Array(GIOn,GIOnTrans,GIOnShiny) : For Each obj In coll : obj.Visible = True : Next : Next
End If
If GILevel = 4 Then
For Each coll In Array(GIOff,GIOffTrans,GIOffShiny) : For Each obj In coll : obj.Visible = False : Next : Next
For Each obj In GIFlasher : obj.Visible = True : Next
aBumperValue(3) = -99
End If
GILevel = GILevel + 1
ElseIf GILevel < 0 And GILevel > -5 Then
' GI goes off, from -4 to -1
For Each obj In GI : obj.IntensityScale = (Abs(GILevel)-1) / 4 : Next
' playfield and playfield overlay
PF_GI_OFF.TopMaterial = "Playfield" & IIF(GILevel=-1,"",Abs(GILevel+1))
PF_Overlay_GI_OFF.TopMaterial = "Playfield" & IIF(GILevel=-1,"",Abs(GILevel+1))
' playfield elements
For Each obj In GIOn : obj.Material = "Prims platt " & (GILevel + 5) : Next
For Each obj In GIOnTrans : obj.Material = "Prims platt trans " & (GILevel + 5) : Next
For Each obj In GIOnShiny : obj.Material = "Prims Shiny " & (GILevel + 5) : Next
If GILevel = -4 Or GILevel = -1 Then
For Each coll In Array(GIOff,GIOffTrans,GIOffShiny) : For Each obj In coll : obj.Visible = True : Next : Next
For Each obj In GIFlasher : obj.Visible = False : Next
aBumperValue(3) = 3
End If
If GILevel = -1 Then
For Each coll In Array(GIOn,GIOnTrans,GIOnShiny) : For Each obj In coll : obj.Visible = False : Next : Next