forked from LegendsUnchained/vpx-standalone-alp4k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAvatar (Stern 2012) v1.12.vbs.dmd
3406 lines (2881 loc) · 118 KB
/
Avatar (Stern 2012) v1.12.vbs.dmd
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
' 85vell for PM5
' Converted to VPX by freneticamnesic.
' Mod by Thalamus, 32a and Hauntfreaks
' Thalamus 2018-07-24
' Added/Updated "Positional Sound Playback Functions" and "Supporting Ball & Sound Functions"
' Improved directional sounds.
' Added InitVpmFFlipsSAM
' Thalamus 2018-11-01 : Improved directional sounds
'v1 - May 2021
' oqqsan : Nfozzy physics, new inserts, extra play sounds
' oqqsan : scorecard
' Press 'R' button during play to magnify instructions !
'v2 - Nov 2023
' TastyWasps : VR, Fleep, Dynamic Ball Shadows - November 2023
' oqqsan : aditional very light 360 3d room , needed an option for the default minimal room
' many fixes and adjustments, cleanup, fixed mechmovment, better 3d inserts, physics adjustment on many pf objects
Option Explicit
Randomize
Const FlipSolNudge = 1 ' Make flipper solenoid to alter active ball behavior
'************************************************************************
' Table Options
'************************************************************************
'----- Bouncer Options -----
Const TargetBouncerEnabled = 1 ' 0 = normal standup targets, 1 = bouncy targets
Const TargetBouncerFactor = 0.7 ' Level of bounces. Recommmended value of 0.7
'----- Volume Options -----
Const VolumeDial = 1.0 ' Overall Mechanical sound effect volume. Recommended values should be no greater than 1.
Const BallRollVolume = 0.5 ' Level of ball rolling volume. Value between 0 and 1
Const RampRollVolume = 0.5 ' Level of ramp rolling volume. Value between 0 and 1
'----- Shadow Options ----- ' If performance is suffering, turn off Dynamic Shadow options below as they are subtle.
Const DynamicBallShadowsOn = 0 ' 0 = no dynamic ball shadow ("triangles" near slings and such), 1 = enable dynamic ball shadow
Const AmbientBallShadowOn = 0 ' 0 = Static shadow under ball ("flasher" image, like JP's)
' 1 = Moving ball shadow ("primitive" object, like ninuzzu's) - This is the only one that shows up on the pf when in ramps and fades when close to lights!
' 2 = flasher image shadow, but it moves like ninuzzu's
'----- Visual Options -----
Const AvatarColorFlashBall = 0 ' 0 = Regular Ball, 1 = Ball that interacts with lights dramatically
Const VRSetup = 0 ' 0 = minimal , 1 = sphere(default)
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
Const BallMass = 1
Const Ballsize = 50
Const tnob = 5
Const lob = 0
Const cGameName="avr_200",UseSolenoids=1,UseLamps=0,UseGI=0,SSolenoidOn="SolOn",SSolenoidOff="SolOff", SCoin="", UseVPMModSol=1
Dim DesktopMode: DesktopMode = Table1.ShowDT
Dim UseVPMColoredDMD
UseVPMColoredDMD=DesktopMode
Sub ImplicitDMD_Init
Me.x = 30
Me.y = 30
Me.width = 128 * 2
Me.height = 32 * 2
Me.intensityScale=2
Me.fontColor = RGB(0,255, 200)
Me.visible = true
End Sub
LoadVPM "01560000","sam.vbs",3.43
If DesktopMode = True Then 'Show Desktop components
Ramp16.visible=1
Ramp15.visible=1
Primitive13.visible=1
Else
Ramp16.visible=0
Ramp15.visible=0
Primitive13.visible=0
End If
' VR Room Auto-Detect
Dim VR_Obj, VRMode
If RenderingMode = 2 Then
Ramp16.visible=0
Ramp15.visible=0
Primitive13.visible=0
For Each VR_Obj in VRCabinet : VR_Obj.Visible = 1 : Next
If VRSetup = 1 Then
VR_Sphere.visible = True
Else
For Each VR_Obj in VRMinimalRoom : VR_Obj.Visible = 1 : Next
End If
Pincab_Backglass.BlendDisableLighting = 1.50
Pincab_Start_Button.BlendDisableLighting = 0.15
Pincab_Start_Button_2.BlendDisableLighting = 0.15
Else
For Each VR_Obj in VRCabinet : VR_Obj.Visible = 0 : Next
For Each VR_Obj in VRMinimalRoom : VR_Obj.Visible = 0 : Next
End If
'*************************************************************
' Solenoid Call backs
'**********************************************************************************************************
SolCallback(1) = "solTrough" ' Through up-kicker
SolCallback(2) = "solAutofire" ' Auto Launch
'SolCallback(3) = "solampmagnet" ' Amp Suit Magnet
'SolCallback(4) = "N/A" ' Not Used
SolCallback(5) = "sol3bankmotor" ' Up-Down 3-Bank relay
SolCallback(6) = "LinkLockupUp" ' Link Lockup Up
SolCallback(7) = "LinkLockUpLatch" ' Link Lockup Latch
'SolCallback(8) = "solShakerMotor" ' Shaker Motor (Optional)
SolModCallback(9) = "SetLampMod 109," ' Top Left Pop Bumber
SolModCallback(10) = "SetLampMod 110," ' Top Right Pop Bumber
SolModCallback(11) = "SetLampMod 111," ' Bottom Pop Bumper
'SolCallback(12) = "N/A" ' Not Used
SolCallback(13) = "ampsuitmotorRelay"
'SolCallback(14) = "N/A" ' Not Used
SolCallback(15) = "SolLFlipper" ' Left Flipper
SolCallback(16) = "SolRFlipper" ' Right Flipper
'SolCallback(17) = "SolLSlingShot" ' Left Slingshot
'SolCallback(18) = "SolRSlingShot" ' Right Slingshot
'SolCallback(19) = "SolampSuitMotor" ' Amp Suit Motor
SolModCallback(20) = "SetLampMod 120," ' Left ampsuit flasher | Doc as Link Flash
SolModCallback(21) = "SetLampMod 121," ' Link Flasher | Doc as Back Panel Flash (x2)
SolModCallback(22) = "SetLampMod 122," ' In front of Jake - fantacy placement | Doc as Link (L) Flash
SolModCallback(23) = "SetLampMod 123," ' Rigth ampsuit flasher | Doc as Link (R) Flash
SolModCallback(24) = "SetLampMod 124," ' Coin ? | Doc as Optional ( eg Coin Meter )
SolModCallback(25) = "SetLampMod 125," ' Bumper flasher
SolModCallback(26) = "SetLampMod 126," ' Ampsuit mb flasher
'SolCallback(27) = "N/A" ' Not Used
SolModCallback(28) = "SetLampMod 128," ' Amp Suit Flash | Doc as Amp Suit Flash (x2)
'SolModCallback(29) = "SetLampMod 129," ' upper left blue dome | Doc as Left Side Flash
'SolModCallback(30) = "SetLampMod 130," ' lower left blue dome | Doc as Left Side Blue (x2)
'SolModCallback(31) = "SetLampMod 131," ' upper right blue dome | Doc as Right Side Blue (x2)
'SolModCallback(32) = "SetLampMod 132," ' lower left blue dome | Doc as Right Side Flash
SolModCallback(29) = "Flash1" ' upper left blue dome | Doc as Left Side Flash
SolModCallback(30) = "Flash3" ' lower left blue dome | Doc as Left Side Blue (x2)
SolModCallback(31) = "Flash4" ' upper right blue dome | Doc as Right Side Blue (x2)
SolModCallback(32) = "Flash2" ' lower left blue dome | Doc as Right Side Flash
' Flippers
Const ReflipAngle = 20
Sub SolLFlipper(Enabled)
If Enabled Then
LF.Fire
If leftflipper.currentangle < leftflipper.endangle + ReflipAngle Then
RandomSoundReflipUpLeft LeftFlipper
Else
SoundFlipperUpAttackLeft LeftFlipper
RandomSoundFlipperUpLeft LeftFlipper
End If
Else
LeftFlipper.RotateToStart
If LeftFlipper.currentangle < LeftFlipper.startAngle - 5 Then
RandomSoundFlipperDownLeft LeftFlipper
End If
FlipperLeftHitParm = FlipperUpSoundLevel
End If
End Sub
Sub SolRFlipper(Enabled)
If Enabled Then
RF.Fire
If rightflipper.currentangle > rightflipper.endangle - ReflipAngle Then
RandomSoundReflipUpRight RightFlipper
Else
SoundFlipperUpAttackRight RightFlipper
RandomSoundFlipperUpRight RightFlipper
End If
Else
RightFlipper.RotateToStart
If RightFlipper.currentangle > RightFlipper.startAngle + 5 Then
RandomSoundFlipperDownRight RightFlipper
End If
FlipperRightHitParm = FlipperUpSoundLevel
End If
End Sub
Sub LeftFlipper_Collide(parm)
CheckLiveCatch Activeball, LeftFlipper, LFCount, parm
LeftFlipperCollide parm
End Sub
Sub RightFlipper_Collide(parm)
CheckLiveCatch Activeball, RightFlipper, RFCount, parm
RightFlipperCollide parm
End Sub
'**********************************************************************************************************
' Solenoid Controlled toys
'**********************************************************************************************************
' Stern-Sega GI
set GICallback = GetRef("UpdateGI")
Sub UpdateGI(no, Enabled)
If Enabled Then
dim xx, xxx
For each xx in GI:xx.State = 1: Next 'Light Objects
PlaySoundAt "fx_relay", sw35
Else
For each xx in GI:xx.State = 0: Next
PlaySoundAt "fx_relay", sw35
End If
End Sub
Dim AmpDir : AmpDir = 1
Dim AmpPos : AmpPos = 0
Sub ampsuitmotorRelay(Enabled)
If Enabled Then
AmpDir = 1
' Controller.Switch(57) = 1:Controller.Switch(58) = 0
' ampf.rotatetoend
' debug.print "ampsuitmotorrelay enabled"
PlaySoundAt "Diverter", ampprim
Else
AmpDir = 0
' Controller.Switch(57) = 0:Controller.Switch(58) = 1
' debug.print "ampsuitmotorrelay disabled"
' ampf.rotatetostart
PlaySoundAt "Diverter", ampprim
End If
End Sub
Sub LinkLockupUp(Enabled)
If Enabled Then
lockPin1.Isdropped=0:lockPin2.Isdropped=0
DropJake
PlaySoundAt "fx_Flipperup", sw17
End If
End Sub
Sub LinkLockUpLatch(Enabled)
If Enabled Then
lockPin1.Isdropped=1:lockPin2.Isdropped=1
RiseJake':JakeTop.RotX=160:
PlaySoundAt "fx_Flipperup", sw17
End If
End Sub
Sub solTrough(Enabled)
If Enabled Then
bsTrough.ExitSol_On
vpmTimer.PulseSw 22
End If
End Sub
Sub solAutofire(Enabled)
If Enabled Then
PlungerIM.AutoFire
PlaySoundAt "BallRelease1", Plunger
End If
End Sub
If AvatarColorFlashBall = 1 Then
Table1.BallImage = ""
Table1.BallDecalMode = True
Table1.BallFrontDecal = "Scratches"
End If
'**********************************************************************************************************
' Initiate Table
'**********************************************************************************************************
Dim bsTrough, Mag1
Sub Table1_Init
vpmInit Me
On Error Resume Next
With Controller
.GameName = cGameName
If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
.SplashInfoLine = "Avatar (Stern 2010)"
.HandleMechanics=0
.HandleKeyboard=0
.ShowDMDOnly=1
.ShowFrame=0
.ShowTitle=0
.hidden = 0
On Error Resume Next
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
On Error Goto 0
End With
On Error Goto 0
InitVpmFFlipsSAM
PinMAMETimer.Interval=PinMAMEInterval
PinMAMETimer.Enabled=1
vpmNudge.TiltSwitch=-7
vpmNudge.Sensitivity=2
vpmNudge.TiltObj=Array(Bumper1b,Bumper2b,Bumper3b,LeftSlingshot,RightSlingshot)
Set bsTrough = New cvpmBallStack
bsTrough.InitSw 0, 21, 20, 19, 18, 0, 0, 0
bsTrough.InitKick BallRelease, 70, 8
bsTrough.InitExitSnd SoundFX("BallRelease1",DOFContactors), SoundFX("Solenoid",DOFContactors)
bsTrough.Balls = 4
Set mag1= New cvpmMagnet
mag1.InitMagnet Magnet1, 25
mag1.GrabCenter = False
mag1.solenoid=3
mag1.CreateEvents "mag1"
' Create Captive Ball
RCaptKicker1.CreateBall
RCaptKicker1.Kick 180,10
lockPin1.Isdropped = 1
lockPin2.Isdropped = 1
InitJakeAni
DropJake
'Init3Bank
' dim BL
' For Each BL in Collection001 : BL.intensity = BL.intensity / 2 : Next
End Sub
'**********************************************************************************************************
' Key Down/Up Code
'**********************************************************************************************************
Sub Table1_KeyDown(ByVal KeyCode)
If keycode = LeftFlipperKey Then
FlipperActivate LeftFlipper, LFPress
PinCab_LeftFlipperButton.X = PinCab_LeftFlipperButton.X + 10
End If
If keycode = RightFlipperKey Then
FlipperActivate RightFlipper, RFPress
PinCab_RightFlipperButton.X = PinCab_RightFlipperButton.X - 10
End If
If keycode = 19 Then ScoreCard=1 : CardTimer.enabled=1
If keycode = PlungerKey Then
Plunger.Pullback
SoundPlungerPull()
TimerPlunger.Enabled = True
TimerPlunger2.Enabled = False
End If
If KeyCode = LeftTiltKey Then Nudge 90, 1:SoundNudgeLeft()
If KeyCode = RightTiltKey Then Nudge 270, 1:SoundNudgeRight()
If KeyCode = CenterTiltKey Then Nudge 0, 2:SoundNudgeCenter()
If keycode = keyInsertCoin1 or keycode = keyInsertCoin2 or keycode = keyInsertCoin3 or keycode = keyInsertCoin4 Then
Select Case Int(rnd*3)
Case 0: PlaySound ("Coin_In_1"), 0, CoinSoundLevel, 0, 0.25
Case 1: PlaySound ("Coin_In_2"), 0, CoinSoundLevel, 0, 0.25
Case 2: PlaySound ("Coin_In_3"), 0, CoinSoundLevel, 0, 0.25
End Select
End If
If keycode = StartGameKey Then soundStartButton()
If KeyDownHandler(keycode) Then Exit Sub
End Sub
Sub Table1_KeyUp(ByVal KeyCode)
If keycode = LeftFlipperKey Then
FlipperDeActivate LeftFlipper, LFPress
PinCab_LeftFlipperButton.X = PinCab_LeftFlipperButton.X - 10
End If
If keycode = RightFlipperKey Then
FlipperDeActivate RightFlipper, RFPress
PinCab_RightFlipperButton.X = PinCab_RightFlipperButton.X + 10
End If
If keycode = 19 Then ScoreCard=0
If keycode = PlungerKey Then
Plunger.Fire
SoundPlungerReleaseBall()
TimerPlunger.Enabled = False
TimerPlunger2.Enabled = True
PinCab_Plunger.Y = 2307.621
End If
If Keycode = StartGameKey Then Controller.Switch(16) = 0
If KeyUpHandler(keycode) Then Exit Sub
End Sub
Dim PlungerIM
Const IMPowerSetting = 60 '90
Const IMTime = 0.6
Set plungerIM = New cvpmImpulseP
With plungerIM
.InitImpulseP swplunger, IMPowerSetting, IMTime
'.Random 0.3
.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
.CreateEvents "plungerIM"
End With
Sub FrameTimer_Timer()
If DynamicBallShadowsOn Or AmbientBallShadowOn Then DynamicBSUpdate
' Primitive animation code
RampGate1.RotZ = -(sw52.currentangle)
' RampGate2.RotZ = -(Gate3.currentangle)
ampprim.objrotx = AmpPos
Bulb008.objrotx = AmpPos
ampprim001.objrotx = AmpPos
LFLogo.RotY = LeftFlipper.CurrentAngle
RFlogo.RotY = RightFlipper.CurrentAngle
FlipperLSh.RotZ = LeftFlipper.currentangle
FlipperRSh.RotZ = RightFlipper.currentangle
ampprim001.blenddisablelighting = l51.getinplayintensity * 0.1 + 0.29
Bulb008.blenddisablelighting = l51.getinplayintensity / 10
Dim x
x = 1.5
Primitive17.blenddisablelighting = (l22.getinplayintensity + l21.getinplayintensity ) * 0.001 + 0.1
sw2.blenddisablelighting = l13.getinplayintensity * 0.002 + 0.2
sw3.blenddisablelighting = l12.getinplayintensity * 0.002 + 0.2
sw4.blenddisablelighting = l11.getinplayintensity * 0.002 + 0.2
sw5.blenddisablelighting = l10.getinplayintensity * 0.002 + 0.2
sw36.blenddisablelighting = 0.02 + l53.getinplayintensity * 0.02
sw17.blenddisablelighting = 0.2 + l48.getinplayintensity * 0.002
Primitive1.blenddisablelighting =l53.getinplayintensity * 0.005 + 0.2
Primitive38.blenddisablelighting = l53.getinplayintensity * 0.005 + 0.2
ampprim.blenddisablelighting = l53.getinplayintensity * 0.005 + 0.3
F26.opacity = l53.getinplayintensity * 4
p23001.blenddisablelighting = f28a.getinplayintensity * 60
p20.blenddisablelighting = f28b.getinplayintensity * 60
f20.intensity = f28b.getinplayintensity * 13
f23.intensity = f28a.getinplayintensity * 13
p3.blenddisablelighting = l3.getinplayintensity *x
p4.blenddisablelighting = l4.getinplayintensity *x
p5.blenddisablelighting = l5.getinplayintensity *x
p6.blenddisablelighting = l6.getinplayintensity *x
p7.blenddisablelighting = l7.getinplayintensity *x
p8.blenddisablelighting = l8.getinplayintensity *x
p9.blenddisablelighting = l9.getinplayintensity *x
p19on.blenddisablelighting = l19.getinplayintensity *x
p18on.blenddisablelighting = l18.getinplayintensity *5
p17.blenddisablelighting = l17.getinplayintensity *5
p24on.blenddisablelighting = l24.getinplayintensity *3
p57on.blenddisablelighting = l57.getinplayintensity *x
p58on.blenddisablelighting = l58.getinplayintensity *x
p59on.blenddisablelighting = l59.getinplayintensity *3
p63on.blenddisablelighting = l63.getinplayintensity *x
p64on.blenddisablelighting = l64.getinplayintensity *x
p15on.blenddisablelighting = l15.getinplayintensity *5
p14on.blenddisablelighting = l14.getinplayintensity *x
p26on.blenddisablelighting = l26.getinplayintensity
p16.blenddisablelighting = l16.getinplayintensity
p10.blenddisablelighting = l10.getinplayintensity*3
p11.blenddisablelighting = l11.getinplayintensity*3
p12.blenddisablelighting = l12.getinplayintensity*3
p13.blenddisablelighting = l13.getinplayintensity*3
p39.blenddisablelighting = l39.getinplayintensity*x
p41.blenddisablelighting = l41.getinplayintensity
p40.blenddisablelighting = l40.getinplayintensity*x
p38.blenddisablelighting = l38.getinplayintensity
p29.blenddisablelighting = l29.getinplayintensity*x
p27.blenddisablelighting = l27.getinplayintensity*x
p30.blenddisablelighting = l30.getinplayintensity
p28.blenddisablelighting = l28.getinplayintensity*x
p31.blenddisablelighting = l31.getinplayintensity
p21.blenddisablelighting = l21.getinplayintensity*5
p22.blenddisablelighting = l22.getinplayintensity*5
p32.blenddisablelighting = l32.getinplayintensity*x
p42.blenddisablelighting = l42.getinplayintensity
p47.blenddisablelighting = l47.getinplayintensity*x
p43.blenddisablelighting = l43.getinplayintensity*x
p50.blenddisablelighting = l50.getinplayintensity*x
p37.blenddisablelighting = l37.getinplayintensity*x
p36.blenddisablelighting = l36.getinplayintensity*x
p35.blenddisablelighting = l35.getinplayintensity*x
p34.blenddisablelighting = l34.getinplayintensity*x
p33.blenddisablelighting = l33.getinplayintensity
p49.blenddisablelighting = l49.getinplayintensity
p48.blenddisablelighting = l48.getinplayintensity*x
p23.blenddisablelighting = l23.getinplayintensity*4
p52.blenddisablelighting = l52.getinplayintensity*4
p25.blenddisablelighting = l25.getinplayintensity*x
p53.blenddisablelighting = l53.getinplayintensity/2
p60.blenddisablelighting = l60.getinplayintensity*x
p61.blenddisablelighting = l61.getinplayintensity*x
p62.blenddisablelighting = l62.getinplayintensity*x
p51.blenddisablelighting = l51.getinplayintensity*x
l60a.intensity = l60.getinplayintensity
l61a.intensity = l61.getinplayintensity
l62a.intensity = l62.getinplayintensity
End Sub
Sub GameTimer_Timer()
RollingUpdate
If AmpDir = 1 Then
If AmpPos > -20 Then AmpPos = AmpPos - 2
Else
If AmpPos < 0 Then AmpPos = AmpPos + 2
End If
End Sub
'**********************************************************************************************************
' Switches
'**********************************************************************************************************
Sub Drain_Hit
bsTrough.addball me
RandomSoundDrain drain
End Sub
' Wire Triggers
Sub sw1_Hit:Controller.Switch(1) = 1: activeball.angmomz = 0 : activeball.vely = 0.7*activeball.vely : End Sub
Sub sw1_UnHit:Controller.Switch(1) = 0:End Sub
Sub sw10_Hit:Controller.Switch(10) = 1:End Sub
Sub sw10_UnHit:Controller.Switch(10) = 0:End Sub
Sub sw11_Hit:Controller.Switch(11) = 1:End Sub
Sub sw11_UnHit:Controller.Switch(11) = 0:End Sub
Sub sw12_Hit:Controller.Switch(12) = 1:End Sub
Sub sw12_UnHit:Controller.Switch(12) = 0:End Sub
Sub sw13_Hit:Controller.Switch(13) = 1:End Sub
Sub sw13_UnHit:Controller.Switch(13) = 0:End Sub
Sub sw14_Hit:Controller.Switch(14) = 1:PlaySoundAt "metalping", ActiveBall:End Sub
Sub sw14_UnHit:Controller.Switch(14) = 0: PlaySoundAt "fx2_popper", sw14:End Sub
Sub sw23_Hit:Controller.Switch(23) = 1:End Sub
Sub sw23_UnHit:Controller.Switch(23) = 0:End Sub
Sub sw24_Hit:Controller.Switch(24) = 1:End Sub
Sub sw24_UnHit:Controller.Switch(24) = 0:End Sub
Sub sw25_Hit:Controller.Switch(25) = 1: activeball.angmomz = 0 : activeball.vely = 0.7*activeball.vely : End Sub
Sub sw25_UnHit:Controller.Switch(25) = 0:End Sub
Sub sw28_Hit:Controller.Switch(28) = 1: activeball.angmomz = 0 : activeball.vely = 0.7*activeball.vely : End Sub
Sub sw28_UnHit:Controller.Switch(28) = 0:End Sub
Sub sw29_Hit:Controller.Switch(29) = 1:End Sub
Sub sw29_UnHit:Controller.Switch(29) = 0:End Sub
Sub sw35_Hit:Controller.Switch(35) = 1:End Sub
Sub sw35_UnHit:Controller.Switch(35) = 0:End Sub
' Captive Ball
Sub sw39_Hit:Controller.Switch(39) = 0:End Sub
Sub sw39_UnHit:Controller.Switch(39) = 1:PlaySoundAt "Ball_Collide_1", sw39:End Sub
'Stand Up Targets
Sub sw2_Hit:vpmTimer.PulseSw 2:End Sub
Sub sw3_Hit:vpmTimer.PulseSw 3:End Sub
Sub sw4_Hit:vpmTimer.PulseSw 4:End Sub
Sub sw5_Hit:vpmTimer.PulseSw 5:End Sub
Sub sw7_Hit:vpmTimer.PulseSw 7:End Sub
Sub sw8_Hit:vpmTimer.PulseSw 8:End Sub
Sub sw17_Hit:vpmTimer.PulseSw 17:End Sub
Sub sw36_Hit:vpmTimer.PulseSw 36:End Sub
Sub sw37_Hit:vpmTimer.PulseSw 37:End Sub
Sub sw38_Hit:vpmTimer.PulseSw 38:End Sub
' 3 Bank dropping targets
Sub sw42_Hit:vpmTimer.PulseSw 42:backbank.Y = 1:backbank.X = 1:Me.TimerEnabled = 1:End Sub
Sub sw42_Timer:backbank.Y = 0.8888889:backbank.X = -0.8888889:Me.TimerEnabled = 0:End Sub
Sub sw43_Hit:vpmTimer.PulseSw 43:backbank.Y = 1:backbank.X = 1:Me.TimerEnabled = 1:End Sub
Sub sw43_Timer:backbank.Y = 0.8888889:backbank.X = -0.8888889:Me.TimerEnabled = 0:End Sub
Sub sw44_Hit:vpmTimer.PulseSw 44:backbank.Y = 1:backbank.X = 1:Me.TimerEnabled = 1:End Sub
Sub sw44_Timer:backbank.Y = 0.8888889:backbank.X = -0.8888889:Me.TimerEnabled = 0:End Sub
' Spinners
Sub sw9_Spin:vpmTimer.PulseSw 9 : playsoundAt "Spinner", sw9 : End Sub
Sub sw40_Spin:vpmTimer.PulseSw 40 : playsoundAt "Spinner", sw40 : End Sub
' Gate Triggers
Sub sw52_Hit:vpmTimer.PulseSw 52:End Sub
' Bumpers
Sub Bumper1b_Hit : vpmTimer.PulseSw(31) :RandomSoundBumperTop Bumper1b : End Sub
Sub Bumper2b_Hit : vpmTimer.PulseSw(30) : RandomSoundBumperMiddle Bumper2b : End Sub
Sub Bumper3b_Hit : vpmTimer.PulseSw(32) : RandomSoundBumperBottom Bumper3b :: End Sub
' Ramp Sounds
Sub LeftRampStart_Hit
WireRampOn True
End Sub
'***********************************************
' Motor Bank
'***********************************************
Sub Sol3bankmotor(Enabled)
If Enabled then
If DropADir = 1 Then DropADir = -1 : Else : DropADir = 1
End if
End Sub
Dim DropADir, DropAPos : DropADir = -1 : DropAa.TimerEnabled = 1
'Animations
Sub DropAa_Timer()
Controller.Switch(45) = 0:Controller.Switch(46) = 0
If DropADir = 1 And DropApos>0 then DropApos=DropApos-1 : PlaySoundAt "motor2", sw37
If DropADir = -1 And DropApos<25 then DropApos=DropApos+1 : PlaySoundAt "motor2", sw37
backbank.z=25-(DropApos*2)
If DropAPos=0 Then Controller.Switch(46) = 1 : sw42.IsDropped = 0:sw43.IsDropped = 0:sw44.IsDropped = 0:banklsidehelp.IsDropped = 0
If DropApos=25 Then Controller.Switch(45) = 1 : sw42.IsDropped = 1:sw43.IsDropped = 1:sw44.IsDropped = 1:banklsidehelp.IsDropped = 1
'backbank.z=-24
End Sub
' RiseBank
' DropBank
'Sub Init3Bank()
' DropAPos = 0
' Controller.Switch(46) = 1
'End Sub
'Sub RiseBank
' If DropAPos <= 0 Then Exit Sub
' DropADir = 1
' DropAPos = 25
' DropAa.TimerEnabled = 1
' PlaySoundAtVol "motor2", sw37, VolMot
'End Sub
'Sub DropBank
' If DropAPos >= 25 Then Exit Sub
' DropADir = -1
' DropAPos = 0
' DropAa.TimerEnabled = 1
' PlaySoundAtVol "motor2", sw37, VolMot
'End Sub
' Select Case DropAPos
' Case 0: backbank.z=25:Controller.Switch(45) = 0:Controller.Switch(46) = 1:sw42.IsDropped = 0:sw43.IsDropped = 0:sw44.IsDropped = 0:banklsidehelp.IsDropped = 0
' If DropADir = 1 then
' DropAa.TimerEnabled = 0
' else
' end if
' Case 1: backbank.z=23:Controller.Switch(45) = 0:Controller.Switch(46) = 0
' Case 2: backbank.z=21
' Case 3: backbank.z=19
' Case 4: backbank.z=17
' Case 5: backbank.z=15
' Case 6: backbank.z=13
' Case 7: backbank.z=11
' Case 8: backbank.z=9
' Case 9: backbank.z=7
' Case 10: backbank.z=5
' Case 11: backbank.z=3
' Case 12: backbank.z=1
' Case 13: backbank.z=-1
' Case 14: backbank.z=-3
' Case 15: backbank.z=-5
' Case 16: backbank.z=-7
' Case 17: backbank.z=-9
' Case 18: backbank.z=-11
' Case 19: backbank.z=-13
' Case 20: backbank.z=-15
' Case 21: backbank.z=-17
' Case 22: backbank.z=-19
' Case 23: backbank.z=-21
' Case 24: backbank.z=-23:Controller.Switch(45) = 0:Controller.Switch(46) = 0
' Case 25: backbank.z=-24:Controller.Switch(45) = 1:Controller.Switch(46) = 0:sw42.IsDropped = 1:sw43.IsDropped = 1:sw44.IsDropped = 1:banklsidehelp.IsDropped = 1
' If DropADir = 1 then
' else
' DropAa.TimerEnabled = 0
' end if
' End Select
' If DropADir = 1 then
' If DropApos>0 then DropApos=DropApos-1
' else
' If DropApos<25 then DropApos=DropApos+1
' end if
'***********************************************
' Jake Animation
'***********************************************
Dim DAD, DAP
DAD = 1
Sub InitJakeAni()
DAP = 0
End Sub
Sub RiseJake
If DAP <= 0 Then Exit Sub
DAD = 1
DAP = 23
jakeopen2.TimerEnabled = 1
PlaySoundAt "motor2", sw17
End Sub
Sub DropJake
If DAP >= 18 Then Exit Sub
DAD = -1
DAP = 0
jakeopen2.TimerEnabled = 1
PlaySoundAt "motor2", sw17
End Sub
Sub jakeopen2_Timer()
Select Case DAP
Case 0: JakeTop.ObjRotY=0:JakeTop.RotX=160:If DAD = 1 Then jakeopen2.TimerEnabled = 0
Case 1: JakeTop.ObjRotY=3:JakeTop.ObjRotX=1:
Case 2: JakeTop.ObjRotY=6:JakeTop.ObjRotX=2:JakeTop.ObjRotZ=-105:
Case 3: JakeTop.ObjRotY=9:JakeTop.ObjRotX=3:
Case 4: JakeTop.ObjRotY=12:JakeTop.ObjRotX=4:JakeTop.ObjRotZ=-106:
Case 5: JakeTop.ObjRotY=15:JakeTop.ObjRotX=5:
Case 6: JakeTop.ObjRotY=18:JakeTop.ObjRotX=6:JakeTop.ObjRotZ=-107:
Case 7: JakeTop.ObjRotY=21:JakeTop.ObjRotX=7:
Case 8: JakeTop.ObjRotY=24:JakeTop.ObjRotX=8:JakeTop.ObjRotZ=-108:
Case 9: JakeTop.ObjRotY=27:JakeTop.ObjRotX=9:
Case 10: JakeTop.ObjRotY=30:JakeTop.ObjRotX=10:JakeTop.ObjRotZ=-109:
Case 11: JakeTop.ObjRotY=33:JakeTop.ObjRotX=11:
Case 12: JakeTop.ObjRotY=36:JakeTop.ObjRotX=12:JakeTop.ObjRotZ=-110:
Case 13: JakeTop.ObjRotY=39:JakeTop.ObjRotX=13:
Case 14: JakeTop.ObjRotY=42:JakeTop.ObjRotX=14:JakeTop.ObjRotZ=-112:
Case 15: JakeTop.ObjRotY=45:
Case 16: JakeTop.ObjRotY=48:
Case 17: JakeTop.ObjRotY=50:
Case 18: JakeTop.RotX=140:If DAD <> 1 Then jakeopen2.TimerEnabled = 0
End Select
If DAD = 1 Then
If DAP>0 Then DAP=DAP-1
Else
If DAP<18 then DAP=DAP+1
End If
End Sub
'***************************************************
' JP's VP10 Fading Lamps & Flashers
' Based on PD's Fading Light System
' SetLamp 0 is Off
' SetLamp 1 is On
' fading for non opacity objects is 4 steps
'***************************************************
Dim LampState(200), FadingLevel(200)
Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
InitLamps() ' turn off the lights and flashers and reset them to the default parameters
LampTimer.Interval = 5 'lamp fading speed
LampTimer.Enabled = 1
' Lamp & Flasher Timers
Sub LampTimer_Timer()
Dim chgLamp, num, chg, ii
chgLamp = Controller.ChangedLamps
If Not IsEmpty(chgLamp) Then
For ii = 0 To UBound(chgLamp)
LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
Next
End If
UpdateLamps
End Sub
Sub UpdateLamps
NFadeL 3, l3
NFadeL 4, l4
NFadeL 5, l5
NFadeL 6, l6
NFadeL 7, l7
NFadeL 8, l8
NFadeL 9, l9
NFadeL 10, l10
NFadeL 11, l11
NFadeL 12, l12
NFadeL 13, l13
NFadeL 14, l14
NFadeL 15, l15
NFadeL 16, l16
NFadeL 17, l17
NFadeL 18, l18
NFadeL 19, l19
NFadeL 21, l21
NFadeL 22, l22
NFadeL 23, l23
NFadeL 24, l24
NFadeL 26, l26
NFadeL 27, l27
NFadeL 28, l28
NFadeL 29, l29
NFadeL 30, l30
NFadeL 31, l31
NFadeL 32, l32
NFadeL 33, l33
NFadeL 34, l34
NFadeL 35, l35
NFadeL 36, l36
NFadeL 37, l37
NFadeL 38, l38
NFadeL 39, l39
NFadeL 40, l40
NFadeL 41, l41
NFadeL 42, l42
NFadeL 43, l43
NFadeL 47, l47
NFadeL 48, l48
NFadeL 49, l49
NFadeL 50, l50
NFadeL 51, l51
NFadeL 52, l52
NFadeL 53, l53
NFadeL 54, l54
NFadeL 55, l55
NFadeL 56, l56
NFadeL 57, l57
NFadeL 58, l58
NFadeL 59, l59
NFadeObjm 60, P60, "lampbulbON", "lampbulb"
NFadeL 60, l60 'top left bumper
NFadeObjm 61, P61, "lampbulbON", "lampbulb"
NFadeL 61, l61 'right bumper
NFadeObjm 62, P62, "lampbulbON", "lampbulb"
NFadeL 62, l62 'lower left bumper
' From 32assassins 10.4 template.
' NFadeObjm 60, P60, "lampbulbON", "lampbulb"
' NFadeL 60, l60 'top left bumper
' NFadeObjm 61, P61, "lampbulbON", "lampbulb"
' NFadeL 61, l61 'right bumper
' NFadeObjm 62, P62, "lampbulbON", "lampbulb"
' NFadeL 62, l62 'lower left bumper
' NFadeL 63, l63
' NFadeL 64, l64
' NFadeL 60, l60 'Bumper 2
' NFadeL 61, l61 'Bumper 1
' NFadeL 62, l62 'Bumper 3
NFadeL 63, l63
NFadeL 64, l64
'Solenoid Controlled Lamps/Flashers
LampMod 109, f9 ' Top Left Pop Bumber
LampMod 110, f10 ' Top Right Pop Bumber
LampMod 111, f11 ' Bottom Pop Bumper
LampMod 122, f22 ' In front of Jake - fantacy placement
LampMod 124, f24 ' Coin ? - lets just make a new fantacy one - I don't know where this would go
LampMod 122, f22a ' More flashing please
LampMod 122, f22c ' For ballreflection
LampMod 128, f28a ' Right side ampsuit flasher
LampMod 128, f28b ' Left side ampsuit flasher
LampMod 129, f29c ' Left Side Flash
LampMod 132, f32b ' Right Side Flash
End Sub
' div lamp subs
Sub InitLamps()
Dim x
For x = 0 to 200
LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
FadingLevel(x) = 4 ' used to track the fading state
FlashSpeedUp(x) = 0.4 ' faster speed when turning on the flasher
FlashSpeedDown(x) = 0.2 ' slower speed when turning off the flasher
FlashMax(x) = 1 ' the maximum value when on, usually 1
FlashMin(x) = 0 ' the minimum value when off, usually 0
FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
Next
End Sub
Sub AllLampsOff
Dim x
For x = 0 to 200
SetLamp x, 0
Next
End Sub
Sub SetLamp(nr, value)
If value <> LampState(nr) Then
LampState(nr) = abs(value)
FadingLevel(nr) = abs(value) + 4
End If
End Sub
' Lights: used for VP10 standard lights, the fading is handled by VP itself
Sub NFadeL(nr, object)
Select Case FadingLevel(nr)
Case 4:object.state = 0:FadingLevel(nr) = 0
Case 5:object.state = 1:FadingLevel(nr) = 1
End Select
End Sub
Sub NFadeLm(nr, object) ' used for multiple lights
Select Case FadingLevel(nr)
Case 4:object.state = 0
Case 5:object.state = 1
End Select
End Sub
'Lights, Ramps & Primitives used as 4 step fading lights
'a,b,c,d are the images used from on to off
Sub FadeObj(nr, object, a, b, c, d)
Select Case FadingLevel(nr)
Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
Case 5:object.image = a:FadingLevel(nr) = 1 'ON
Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
Case 13:object.image = d:FadingLevel(nr) = 0 'Off
End Select
End Sub
Sub FadeObjm(nr, object, a, b, c, d)
Select Case FadingLevel(nr)
Case 4:object.image = b
Case 5:object.image = a
Case 9:object.image = c
Case 13:object.image = d
End Select
End Sub
Sub NFadeObj(nr, object, a, b)
Select Case FadingLevel(nr)
Case 4:object.image = b:FadingLevel(nr) = 0 'off
Case 5:object.image = a:FadingLevel(nr) = 1 'on
End Select
End Sub
Sub NFadeObjm(nr, object, a, b)
Select Case FadingLevel(nr)
Case 4:object.image = b
Case 5:object.image = a
End Select
End Sub
' Flasher objects
Sub Flash(nr, object)
Select Case FadingLevel(nr)
Case 4 'off
FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
If FlashLevel(nr) < FlashMin(nr) Then
FlashLevel(nr) = FlashMin(nr)
FadingLevel(nr) = 0 'completely off
End if
Object.IntensityScale = FlashLevel(nr)
Case 5 ' on
FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
If FlashLevel(nr) > FlashMax(nr) Then
FlashLevel(nr) = FlashMax(nr)
FadingLevel(nr) = 1 'completely on
End if
Object.IntensityScale = FlashLevel(nr)
End Select
End Sub
Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
Object.IntensityScale = FlashLevel(nr)
End Sub
'Reels
Sub FadeReel(nr, reel)
Select Case FadingLevel(nr)
Case 2:FadingLevel(nr) = 0
Case 3:FadingLevel(nr) = 2
Case 4:reel.Visible = 0:FadingLevel(nr) = 3
Case 5:reel.Visible = 1:FadingLevel(nr) = 1
End Select
End Sub