Advertisement
Guest User

Untitled

a guest
Oct 30th, 2016
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VBScript 60.09 KB | None | 0 0
  1. '  +              `s                                                                                
  2. ' yNhssyyyydddhhyhhNo                                                                                
  3. '+/`      oMN      `+:                    ....`                  ```  ::  .//+/:                    
  4. '         hMm        : `:/++.    ```.`    :mMd`    :ddo-    `/yyooooyhmm   +MM`  -sNNh/ `          `
  5. '         hMN `/odmh:`   :NMy   .Nm:..     hMd`     yM/   `oNd.       -s+  /MM`    NM: `NhhyyhhssshN.
  6. '         dMd    oMm`     hMM-  .N:`:hmh`  hMh      sM+  `dMm.          .  /MM`    NM. ss`  oMh    :+
  7. '         NMd     dMh`   -MMMo `d+   mMs   hMs      sMo  yMM-           ```:MM+//++MM. `    yMy      
  8. '         mMd     `mMh   ds+MN`sy    mMy   hMs      oMo `NMm      -.:yNMN:`/MM/-.`.MM.      yMy      
  9. '         NMm      `hMy oh  NMdd     hMo   dMo      yM: `MMd         `NMd  /MM.   `MM`      hMs      
  10. '         MMd       `hMdN.  +Mm`     dMs   dMo     .ss+` dMN.         NMd  -Mm`   .MM`      mMo      
  11. '        `MMo        `dM:    d-      mMs   NMs   `.:/    .dMN/      `+Ns.  :MM`   -MM.      NM+      
  12. '        .MMy         `:            :MMs  :yyssyyhdm.      /ymmsooooo-    -dNd:` .+oo+/    `MM+`.    
  13. '        oMMy                       ..``                                                  ./+/:--    
  14. '      -+oo+/:-     ``                                                                              
  15. '                  -o.                  -                                                            
  16. '                 /Nmdddddysysoooo+yNNNy.   `-+s+:-  .-//+/     -+sss:           +`                  
  17. '                +s/:-.`         :dMMs.  `+ho:-:/yMNo`  /MMy      mM.   +hdysossyms                  
  18. '               `              /dMm+`   oMy`      .dMm. `MMMm`    oN    .NM:      .:                
  19. '                           `oNMd/     yMh         `MMy `N+hMN:   +N    .MM-       `                
  20. '                         `oNMh:      `NM:          mMy  N+ oMMo  :M    `NMdhhhhdmmy                
  21. '                       .smMh-        -MM/         `NN.  m+  :NMh`-M`   `NM+``   `:                  
  22. '                     :hMMy.           yMd-       `hy.   N+   .hMm:M.   `NM.                        
  23. '                   :dMMs.          .+/ +dMdo:-:/oo-    `M/     oMMM-   `NM:       -                
  24. '                 :hMMd///++osyhhdddMy    .:++/-`       oNy+:.   -mM:   `MM- .-/+ym.                
  25. '                /o+/::--.`````     o                  -/-.`       s/  -ohysoo+/:/-                  
  26.  
  27. ' Twilight Zone - IPDB No. 2684
  28. ' © Bally/Midway 1993
  29. ' VPX recreation by ninuzzu
  30. ' This table started as a FP conversion by coindropper. Clark Kent continued improving it at graphics and physics level
  31. ' Then he asked me an help with lighting and other things and it evolved into something different.
  32. ' We have completely rebuild the table, so I would call it a "from scratch" build, rather than a conversion.
  33. ' Flupper and Tom Tower joined the team later and enhanced the visuals with some stunning models. You guys rock!
  34. ' This table is maybe the most modded ever, lots of options in the script. Lots of fun!
  35.  
  36. ' Credits/Thanks
  37. ' coindropper early development
  38. ' nFozzy for scripting the trough, the lock, the magnets and a lot of other things
  39. ' JPSalas for the help with the inserts and the script (you know who is THE MAN!)
  40. ' Tom Tower for the mini clock, pyramid, piano, camera, gumballmachine models, wich I retextured.
  41. ' Hauntfreaks for the Mystic Seer Toy, wich I retextured
  42. ' Flupper for retexturing and remeshing the plastic ramp
  43. ' Zany for the domes, flippers and bumpers models
  44. ' rom for "Robbie the Robot" model, wich I edited and retextured
  45. ' knorr and pacdude for some sound effects I borrowed from their tables
  46. '
  47.  
  48. Option Explicit
  49. Randomize
  50.  
  51. Dim Romset, PowerballStart, CabinetSide, FlipperType, RampShadow, ScoopLight, GumballRGB, SlotMachineMod, PyramidMod, PyramidTopLight, MiniClockMod
  52. Dim InvaderMod, MysticSeerMod, TargetMod, TVMod, LampMod, LampLightColor, TownSquarePostMod, SpiralMod, ExtraMagnet, BumperPostsMod
  53.  
  54. '******************************************************************************************
  55. '* TABLE OPTIONS **************************************************************************
  56. '******************************************************************************************
  57.  
  58. '***********    Choose the ROM    *********************************************************
  59.  
  60. Romset = 0          'arcade rom with credits,  1 = home rom (free play)
  61.  
  62. '***********    Set the Powerball Starting Location     ************************************
  63.  
  64. PowerBallStart = 7      '1-3 = gumball machine, 4-6 = trough, 0 = random, 7 = random gumball
  65.  
  66. '***********    Show cabinet sidewalls custom artwork   ************************************
  67.  
  68. CabinetSide = 1         '0 = no , 1 = yes
  69.  
  70. '***********    Set the Flippers Type   ***************************************************
  71.  
  72. FlipperType = 2         '0 = yellow , 1 = spiral , 2 = random
  73.  
  74. '***********    Render the Wireramp shadow on the playfield *******************************
  75.  
  76. RampShadow = 0          '0 = no , 1 = yes
  77.  
  78. '***********    Red Light under the scoop       *******************************************
  79.  
  80. ScoopLight = 1          '0 = no , 1 = yes
  81.  
  82. '***********    Enable RGB LEDS inside the Gumball Machine ********************************
  83.  
  84. GumballRGB = 1          '0 = no , 1 = yes
  85.  
  86. '***********    Render the Slot Machine Toy     *******************************************
  87.  
  88. SlotMachineMod = 1      '0 = no , 1 = yes
  89.  
  90. '***********    Render the Pyramid Toy with customizable light  ***************************
  91.  
  92. PyramidMod = 1
  93. PyramidTopLight = 4     '0 = red, 1 = green, 2 = blue, 3 = yellow, 4 = purple, 5= cyan
  94.  
  95. '***********    Render the Mini Clock at ramps entrance  **********************************
  96.  
  97. MiniClockMod = 1            '0 = no , 1 = yes
  98.  
  99. '***********    Render the Invader Toy  ***************************************************
  100.  
  101. InvaderMod = 1          '0 = no , 1 = yes
  102.  
  103. '***********    Render the Mystic Seer  Toy     *******************************************
  104.  
  105. MysticSeerMod = 1           '0 = no , 1 = yes
  106.  
  107. '***********    Enable TargetMod (Targets with themed decals)   ***************************
  108.  
  109. TargetMod = 0           '0 = disabled , 1 = enabled
  110.  
  111. '***********    Enable TV Mod   ***********************************************************
  112.  
  113. TVMod = 1               '0 = disabled , 1 = enabled
  114.  
  115. '***********    Enable Lamp Mod (new lamp model with customizable color     ***************
  116.  
  117. LampMod = 1             '1 = no, 1 = silver metal, 2 = gold metal
  118. LampLightColor = 1      '0 = yellow , 1= blue
  119.  
  120. '***********    Enable Town Square Mod  ***************************************************
  121.  
  122. TownSquarePostMod = 1   '0 = disabled , 1 = enabled
  123.  
  124. '***********    Enable the Spiral Animated Cover Mod    ***********************************
  125.  
  126. SpiralMod = 0           '0 = disabled , 1 = enabled
  127.  
  128. '***********    Enable Bumper Posts Mod ***************************************************
  129.  
  130. 'the game will be harder if you enable this
  131.  
  132. BumperPostsMod = 0      '0 = disabled , 1 = enabled
  133.  
  134. '***********    Enable 3rd magnet   *******************************************************
  135.  
  136. ExtraMagnet = 1         '0 = disabled , 1 = enabled
  137.  
  138.  
  139. '******************************************************************************************
  140. '* END OF TABLE OPTIONS *******************************************************************
  141. '******************************************************************************************
  142.  
  143. Dim Ballsize,BallMass
  144. BallSize = 51
  145. BallMass = (Ballsize^3)/125000
  146.  
  147. Dim DesktopMode:DesktopMode = Table1.ShowDT
  148. Dim UseVPMDMD:UseVPMDMD = DesktopMode
  149. Const UseVPMModSol = 1
  150.  
  151. On Error Resume Next
  152. ExecuteGlobal GetTextFile("controller.vbs")
  153. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  154. On Error Goto 0
  155.  
  156. LoadVPM "02000000", "WPC.VBS", 3.49
  157.  
  158. '******************************
  159. '******************************
  160.  
  161. Const UseSolenoids = 1
  162. Const UseLamps = 0
  163. Const UseGI = 0
  164. Const UseSync = 1
  165. Const HandleMech = 0
  166.  
  167. Const SSolenoidOn = "fx_solon"
  168. Const SSolenoidOff = ""
  169. Const SFlipperOn = ""
  170. Const SFlipperOff = ""
  171. Const SCoin = "fx_coin"
  172.  
  173. Set MotorCallback = GetRef("GameTimer")
  174. Set GiCallback2 = GetRef("UpdateGI")
  175.  
  176. '********************************************
  177. '**********   Keys   ************************
  178. '********************************************
  179.  
  180. Dim BIPL                'balls in plunger
  181.  
  182. Sub Table1_KeyDown(ByVal keycode)
  183.     If keycode = LeftTiltKey Then Nudge 90, 5:PlaySound SoundFX("fx_nudge", 0), 0, 1, -0.1, 0.25
  184.     If keycode = RightTiltKey Then Nudge 270, 5:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0.1, 0.25
  185.     If keycode = CenterTiltKey Then Nudge 0, 3:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0, 0.25
  186.     If Keycode = KeyFront Then Controller.Switch(23) = 1
  187.     If KeyCode = PlungerKey Then Plunger.Pullback:Playsound "fx_plungerpull"
  188.     If vpmKeyDown(KeyCode) Then Exit Sub
  189. End Sub
  190.  
  191. Sub Table1_KeyUp(ByVal KeyCode)
  192.     If KeyCode = KeyFront Then Controller.Switch(23) = 0
  193.     If KeyCode = PlungerKey Then
  194.         Plunger.Fire
  195.         If BIPL = 1 Then
  196.             Playsound "fx_launch"
  197.         Else
  198.             Playsound "fx_plunger"
  199.         End If
  200.     End If
  201.     If vpmKeyUp(KeyCode) Then Exit Sub
  202. End Sub
  203.  
  204. '************************************************
  205. '*********   BallInit ***************************
  206. '************************************************
  207.  
  208. Dim PowerBall, powerballnf, PowerballLocation
  209.  
  210. If PowerballStart = 0 then PowerballStart = RndNum(1, 6) end if
  211. If PowerballStart = 7 then PowerballStart = RndNum(1, 3) end if
  212.  
  213. Sub Scramble
  214.     If powerballstart = 1 Then Set PowerBallLocation = Gumball1
  215.     If powerballstart = 2 Then Set PowerBallLocation = Gumball2
  216.     If powerballstart = 3 Then Set PowerBallLocation = Gumball3
  217.     If powerballstart = 4 Then Set PowerBallLocation = sw17
  218.     If powerballstart = 5 Then Set PowerBallLocation = sw16
  219.     If powerballstart = 6 Then Set PowerBallLocation = sw15
  220.     PowerBallLocation.Destroyball
  221.     Set PowerBall = PowerBallLocation.CreateSizedBall(Ballsize/2)
  222.     With PowerBall
  223.         .image = "powerball"
  224.         .color = RGB(255,255,255)
  225.         .id = 666
  226.         .Mass = 0.8*Ballmass
  227.     End With
  228. End sub
  229.  
  230. '**************************************************************
  231. '************   Table Init   **********************************
  232. '**************************************************************
  233.  
  234. Dim bsSlot, bsAutoPlunger, bsRocket, mLeftMini, mRightMini, mslot, mLeftMagnet, mLowerRightMagnet, mUpperRightMagnet
  235.  
  236. Sub Table1_Init
  237.     With Controller
  238.         .GameName = cGameName
  239.         .SplashInfoLine = "Twilight Zone (Bally 1992)"
  240.         .HandleKeyboard = 0
  241.         .ShowTitle = 0
  242.         .ShowDMDOnly = 1
  243.         .ShowFrame = 0
  244.         .Hidden = DesktopMode
  245.         .HandleMechanics = 1 + 2 'Gumball + Clock
  246.        On Error Resume Next
  247.         .Run GetPlayerHWnd
  248.         If Err Then MsgBox Err.Description
  249.         On Error Goto 0
  250.     End With
  251.  
  252.     vpmInit Me
  253.     '************  Main Timer init  ********************
  254.  
  255.     PinMAMETimer.Interval = PinMAMEInterval
  256.     PinMAMETimer.Enabled = 1
  257.  
  258.     '************   Nudging   **************************
  259.  
  260.     vpmNudge.TiltSwitch = 14
  261.     vpmNudge.Sensitivity = 4
  262.     vpmNudge.TiltObj = Array(Bumper1, Bumper2, Bumper3, Leftslingshot, Rightslingshot)
  263.  
  264.     '************   AutoPlunger   ******************
  265.  
  266.     Set bsAutoPlunger = new cvpmSaucer
  267.     With bsAutoPlunger
  268.         .InitKicker AutoPlungerKicker, 72, 0, 40, 0
  269.         .InitExitVariance 0, 8
  270.         .InitSounds "", SoundFX("fx_AutoPlunger",DOFContactors), SoundFX("fx_launch",DOFContactors)
  271.     End With
  272.  
  273.     '************   SlotMachine   ******************
  274.  
  275.     Set bsSlot = new cvpmSaucer
  276.     With bsSlot
  277.         .InitKicker sw58, 58, 4.8, 45, 0
  278.         .InitSounds "fx_kicker_catch", SoundFX(SSolenoidOn,DOFContactors), SoundFX("fx_SlotM_exit",DOFContactors)
  279.         .createevents "bsSlot", sw58
  280.     End With
  281.  
  282.     Set mSlot = New cvpmMagnet          'Helps two balls get out, see sub slotmachinekickout
  283.    With mSlot
  284.         .InitMagnet Slothelper, -75
  285.         .CreateEvents "mSlot"
  286.         .GrabCenter = false
  287.     End With
  288.  
  289.     '*******************   Rocket   ****************
  290.  
  291.   Set bsRocket = new cvpmSaucer
  292.     With bsRocket
  293.         .InitKicker RocketKicker, 28, 280, 55, 0
  294.         .InitExitVariance 3, 10
  295.         .InitSounds "fx_rocket_enter",  SoundFX(SSolenoidOn,DOFContactors), SoundFX("fx_rocket_exit",DOFContactors)
  296.     End With
  297.  
  298.     '****************   Magnets   ******************
  299.  
  300.     Set mLeftMini = New cvpmMagnet
  301.     With mLeftMini
  302.         .InitMagnet TLMiniFlip, 70      ' Left Powerfield Real Magnet Strength (adjust to taste)
  303.        .GrabCenter = False: .Size = 195
  304.         .CreateEvents "mLeftMini"
  305.     End With
  306.  
  307.     Set mRightMini = New cvpmMagnet
  308.     With mRightMini
  309.         .InitMagnet TRMiniFlip, 70      ' Right Powerfield Real Magnet Strength (adjust to taste)
  310.        .GrabCenter = False: .Size = 195
  311.         .CreateEvents "mRightMini"
  312.     End With
  313.  
  314.     Set mLeftMagnet = New cvpmMagnet
  315.     With mLeftMagnet
  316.         .InitMagnet LeftMagnet, 67
  317.         .CreateEvents "mLeftMagnet"
  318.         .GrabCenter = True
  319.     End With
  320.  
  321.     Set mUpperRightMagnet = New cvpmMagnet
  322.     With mUpperRightMagnet
  323.         .InitMagnet UpperRightMagnet, 63
  324.         .CreateEvents "mUpperRightMagnet"
  325.         .GrabCenter = True
  326.     End With
  327.  
  328.     Set mLowerRightMagnet = New cvpmMagnet
  329.     With mLowerRightMagnet
  330.         .InitMagnet LowerRightMagnet, 63
  331.         .CreateEvents "mLowerRightMagnet"
  332.         .GrabCenter = True
  333.     End With
  334.  
  335.     '****************   Trough   ******************
  336.  
  337.     sw17.CreateSizedBallWithMass Ballsize/2, BallMass
  338.     sw16.CreateSizedBallWithMass Ballsize/2, BallMass
  339.     sw15.CreateSizedBallWithMass Ballsize/2, BallMass
  340.  
  341.     '****************   Gumball   ******************
  342.  
  343.     gumball1.CreateSizedBallWithMass Ballsize/2, BallMass
  344.     gumball2.CreateSizedBallWithMass Ballsize/2, BallMass
  345.     gumball3.CreateSizedBallWithMass Ballsize/2, BallMass
  346.     Controller.Switch(55) = 0
  347.  
  348.     '****************   Init GI   ******************
  349.  
  350.     UpdateGI 0, 1:UpdateGI 1, 1:UpdateGI 2, 1:UpdateGI 3, 1:UpdateGI 4, 1
  351. End Sub
  352.  
  353. '**************************************************************
  354. ' SOLENOIDS
  355. '**************************************************************
  356.  
  357. '     (*) - only in prototype, supported by rom 9.4
  358. '    (**) - the additional GUM and BALL flashers were removed ro reduce cost
  359. '   (***) - Gumball and Clock Mechanics are handled by vpm classes
  360.  
  361. 'standard coils
  362. SolCallback(1) = "SlotMachineKickout"                                   '(01) Slot Kickout
  363. SolCallback(2) = "bsRocket.SolOut"                                      '(02) Rocket Kicker
  364. SolCallback(3) = "bsAutoPlunger.SolOut"                                 '(03) Auto-Fire Kicker
  365. SolCallback(4) = "SolGumballPopper"                                     '(04) Gumball Popper
  366. SolCallback(5) = "SolRightRampDiverter"                                 '(05) Right Ramp Diverter
  367. SolCallback(6) = "SolGumballDiverter"                                   '(06) Gumball Diverter
  368. SolCallback(7) = "vpmSolSound SoundFX(""fx_knocker"",DOFKnocker),"      '(07) Knocker
  369. SolCallback(8) = "SolOuthole"                                           '(08) Outhole
  370. SolCallback(9) = "SolBallRelease"                                       '(09) Ball Release
  371. 'SolCallback(10) = "SolRightSling"                                      '(10) Right Slingshot
  372. 'SolCallback(11) = "SolLeftSling"                                       '(11) Left Slingshot
  373. 'SolCallback(12) = "SolLowerBumper"                                     '(12) Lower Jet Bumper
  374. 'SolCallback(13) = "SolLeftBumper"                                      '(13) Left Jet Bumper
  375. 'SolCallback(14) = "SolRightBumper"                                     '(14) Right Jet Bumper
  376. SolCallback(15) = "LockKickout"                                         '(15) Lock Release nf
  377. SolCallback(16) = "SolShootDiverter"                                    '(16) Shooter Diverter
  378. SolModCallback(17) = "SetModLamp 117,"                                      '(17) Flasher bumpers x2   
  379. SolModCallback(18) = "SetModLamp 118,"                                      '(18) Flasher Power Payoff x2
  380. SolModCallback(19) = "SetModLamp 119,"                                      '(19) Flasher Mini-Playfield x2
  381. SolModCallback(20) = "SetModLamp 120,"                                      '(20) Flasher Upper Left Ramp x2 (**)
  382. SolCallback(21) = "SolLeftMagnet"                                       '(21) Left Magnet
  383. SolCallback(22) = "SolUpperRightMagnet"                                 '(22) Upper Right Magnet (*)
  384. SolCallback(23) = "SolLowerRightMagnet"                                 '(23) Lower Right Magnet
  385. SolCallback(24) = "SolGumballMotor"                                     '(24) Gumball Motor
  386. SolCallback(25) = "SolMiniMagnet mLeftMini,"                            '(25) Left Mini-Playfield Magnet
  387. SolCallback(26) = "SolMiniMagnet mRightMini,"                           '(26) Right Mini-Playfield Magnet
  388. SolCallback(27) = "SolLeftRampDiverter"                                 '(27) Left Ramp Diverter
  389. SolCallback(28) = "setlamp 128,"                                        '(28) Flasher Inside Ramp
  390. 'aux board coils
  391. SolModCallback(51) = "SetModLamp 137,"                                      '(37) Flasher Upper Right Flipper
  392. SolModCallback(52) = "SetModLamp 138,"                                      '(38) Flasher Gumball Machine Higher
  393. SolModCallback(53) = "SetModLamp 139,"                                      '(39) Flasher Gumball Machine Middle
  394. SolModCallback(54) = "SetModLamp 140,"                                      '(40) Flasher Gumball Machine Lower
  395. SolModCallback(55) = "SetModLamp 141,"                                      '(41) Flasher Upper Right Ramp x2 (**)
  396. 'SolCallback(56) = ""                                                   '(42) Clock Reverse (***)
  397. 'SolCallback(57) = ""                                                   '(43) Clock Forward (***)
  398. 'SolCallback(58) = ""                                                   '(44) Clock Switch Strobe (***)
  399. SolCallback(59) = "SolGumRelease"                                       '(??) Gumball Release (***)
  400. 'fliptronic board
  401. SolCallback(sLRFlipper) = "SolRFlipper"
  402. SolCallback(sLLFlipper) = "SolLFlipper"
  403. SolCallback(sURFlipper) = "SolURFlipper"
  404. SolCallback(sULFlipper) = "SolULFlipper"
  405.  
  406.  
  407. '***********   Rocket   ********************************
  408.  
  409. Sub RocketKicker_Hit
  410.     bsRocket.AddBall 0
  411.     Light10.State = 1
  412. End Sub
  413.  
  414. Sub RocketKicker_UnHit
  415.     Light10.state = 0
  416. End Sub
  417.  
  418. '***********   Autoplunger   ********************************
  419.  
  420. Sub AutoPlungerKicker_Hit
  421.     bsAutoPlunger.AddBall 0
  422. End Sub
  423.  
  424. '***********   Gumball Popper   ******************************
  425.  
  426. Dim BIK:BIK=0       'ball in kicker
  427.  
  428. sub GumballPopper_Hit()
  429.     Controller.Switch(74) = 1
  430.     BIK=BIK+1
  431.     Playsound "fx_kicker_catch"
  432. end sub
  433.  
  434. sub GumballPopper_UnHit()
  435.     Controller.Switch(74) = 0
  436.     BIK=BIK-1
  437. end sub
  438.  
  439. Sub GumballPopperHole_Hit
  440.     Playsound "fx_Hole"
  441.     vpmTimer.PulseSw 51
  442. End Sub
  443.  
  444. Sub SolGumballPopper(enabled)   'VUK
  445.    If enabled Then
  446.         GumballPopper.Kick 0, 65, 1.5
  447.         If BIK = 0 Then
  448.             PlaySound SoundFX(SSolenoidOn,DOFContactors)
  449.         Else
  450.             PlaySound SoundFX("fx_GumPop",DOFContactors)
  451.         End If
  452.     End If
  453. End Sub
  454.  
  455. '**************   Drain  and Release  ************************************
  456.  
  457. Dim BIP:BIP = 0             'Balls In Play
  458.  
  459. sub sw18_hit()
  460.     Controller.Switch(18) = 1:Playsound "fx_drain":BIP = BIP - 1
  461.     If TVMod = 1 then TVTimer.enabled = 0:Frame.imageA = "tv_gameover"
  462. end sub
  463.  
  464. sub sw18_unhit():controller.Switch(18) = 0:end sub
  465.  
  466. Sub SolOuthole(enabled)
  467.     If Enabled Then
  468.         sw18.kick 85, 11
  469.         Updatetrough
  470.         Playsound SoundFX(SSolenoidOn,DOFContactors)
  471.     End If
  472. end sub
  473.  
  474. Sub SolBallrelease(enabled)
  475.     If Enabled Then
  476.         sw15.kick 58, 10
  477.         Updatetrough                    'this is important to reset trough intervals
  478.         BIP = BIP + 1
  479.     End If
  480. End sub
  481.  
  482. '******************************************************************
  483. '** NFOZZY'S BALLTROUGH AND LOCK    *******************************
  484. '******************************************************************
  485.  
  486. sub boottrough_timer()              'starts up the trough
  487.     controller.Switch(17) = 1
  488.     controller.Switch(16) = 1
  489.     controller.Switch(15) = 1
  490.     if powerballstart <> 6 then
  491.         controller.Switch(26) = 1   'Trough sensor, needs to start on unless the powerball spawns in the forward trough position
  492.     end if
  493.     me.enabled = 0
  494.     updatetrough
  495.     Scramble    'Powerball insertion
  496. end sub
  497.  
  498. sub sw25_hit():controller.Switch(25) = 1:end sub
  499. sub sw25_unhit():controller.Switch(25) = 0:updatetrough:end sub
  500.  
  501. sub sw17_hit():controller.Switch(17) = 1:end sub
  502. sub sw17_unhit():controller.Switch(17) = 0:updatetrough:end sub
  503.  
  504. sub sw16_hit():controller.Switch(16) = 1:end sub
  505. sub sw16_unhit():controller.Switch(16) = 0:updatetrough:end sub
  506.  
  507. sub sw15_hit()
  508. if activeball.id = 666 then     'opto handler
  509.     controller.Switch(26) = 0   'if powerball
  510. Else   
  511.     controller.Switch(26) = 1   'if regular ball
  512. end if
  513. controller.Switch(15) = 1
  514. end sub
  515. sub sw15_unhit():controller.Switch(15) = 0:controller.switch(26) = 0:playsound SoundFX("fx_ballrel",DOFContactors):updatetrough:end sub 'if empty
  516.  
  517. sub sw26_hit
  518.     if activeball.id = 666 then
  519.         set powerballnf = activeball
  520.     end if
  521. end Sub
  522.  
  523. 'order-
  524. '25, 17, 16, 15
  525.  
  526. sub Updatetrough()
  527.     updatetroughTimer.interval = 300
  528.     updatetroughTimer.enabled = 1
  529. end sub
  530.  
  531. sub updatetroughTimer_timer()
  532.     if sw15.BallCntOver = 0 then sw16.kick 58, 8 end If
  533.     if sw16.BallCntOver = 0 then sw17.kick 58, 8 end If
  534.     if sw17.BallCntOver = 0 then sw25.Kick 58, 8 end If
  535.     me.enabled = 0
  536. end sub
  537.  
  538. '*******************   Lock   ******************
  539.  
  540. sub sw85_hit():controller.Switch(85) = 1:Playsound "fx_Lock_enter":updatelock:end sub
  541. sub sw85_unhit():controller.Switch(85) = 0:end sub
  542. sub sw84_hit():controller.Switch(84) = 1:updatelock:end sub
  543. sub sw84_unhit():controller.Switch(84) = 0:end sub
  544. sub sw88_hit():controller.Switch(88) = 1:updatelock:end sub
  545. sub sw88_unhit():controller.Switch(88) = 0:end sub
  546.  
  547. sub updatelock
  548.     updatelocktimer.interval = 32
  549.     updatelocktimer.enabled = 1
  550. end sub
  551.  
  552. sub updatelocktimer_timer()
  553.     if sw88.BallCntOver = 0 then sw84.kick 180, 2 end If
  554.     if sw84.BallCntOver = 0 then sw85.kick 180, 2 end if
  555.     me.enabled = 0
  556. end sub
  557.  
  558. sub LockKickout(enabled)
  559.     If enabled then
  560.     sw88.kick 88, 10
  561.     Playsound SoundFX("fx_Lock_exit",DOFContactors)
  562.     updatelock
  563.     End If
  564. end sub
  565.  
  566. '******************************************************************
  567. '** SUBWAY, SHOOTER LANE, SLOTMACHINE; CAMERA, PIANO, DEAD END  ***
  568. '******************************************************************
  569.  
  570. Sub SubwaySound(dummy)
  571.     PlaySound "fx_subway"
  572. End sub
  573.  
  574. '********   Slot Machine    ****************************************
  575.  
  576. Sub SlotMachine_Hit()
  577.     PlaySound "fx_SlotM_enter"
  578. End Sub
  579.  
  580. Sub sw57_Hit()                                          'submarine switch, Tslot proximity
  581. if activeball.id = 666 then
  582.     set powerballnf = activeball
  583. else
  584. controller.Switch(57) = 1
  585. end if
  586. end Sub
  587.  
  588. Sub sw57_UnHit():controller.Switch(57) = 0:end Sub
  589.  
  590. sub slotmachinekickout(enabled)
  591.     if enabled Then
  592.         bsSlot.SolOut enabled
  593.         slotMachine.enabled = 0                         'let's disable and reanable it again so the ball can pass
  594.         vpmtimer.addtimer 250, "slotmachine.enabled = 1'"
  595.         if SlotBall2.BallCntOver > 0 then
  596.             mslot.MagnetOn=1
  597.         end if
  598.     Else
  599.         mslot.MagnetOn=0
  600.     end if
  601. end sub
  602.  
  603. '********   Shooter Lane    ***************************************
  604.  
  605. Sub ShooterLaneKicker_Hit
  606.     PlaySound "fx_hole"
  607.     vpmtimer.addtimer 100, "SubwaySound"
  608. End Sub
  609.  
  610. '********   Dead End   ********************************************
  611.  
  612. Sub DeadEnd_Hit
  613.     vpmTimer.PulseSw 41
  614.     PlaySound "fx_DeadEnd"
  615.     vpmtimer.addtimer 100, "SubwaySound"
  616. End Sub
  617.  
  618. '********   Camera   ***********************************************
  619.  
  620. Sub CameraKicker_Hit
  621.     PlaySound "fx_hole"
  622.     vpmtimer.addtimer 100, "SubwaySound"
  623. End Sub
  624.  
  625. Sub sw42_Hit():controller.Switch(42) = 1:end Sub        'submarine switch, camera / upper playfield
  626. Sub sw42_UnHit():controller.Switch(42) = 0:end Sub
  627.  
  628. '********  Piano   *************************************************
  629.  
  630. Sub Piano_Hit()
  631.     PlaySound "fx_Piano"
  632. End Sub
  633.  
  634. Sub sw43_Hit():controller.Switch(43) = 1:end Sub        'submarine switch, piano
  635. Sub sw43_UnHit():controller.Switch(43) = 0:end Sub
  636.  
  637. ''************************************************************************************
  638. ''*****************       SLINGSHOTS                      ****************************
  639. ''************************************************************************************
  640.  
  641. Dim RStep, LStep
  642.  
  643. Sub LeftSlingShot_Slingshot
  644.     PlaySound SoundFX("fx_slingshotL",DOFContactors)
  645.     LSling.Visible = 0
  646.     LSling1.Visible = 1
  647.     sling2.TransZ = -20
  648.     LStep = 0
  649.     Me.TimerEnabled = 1
  650.     vpmTimer.PulseSw 34
  651. End Sub
  652.  
  653. Sub LeftSlingShot_Timer
  654.     Select Case LStep
  655.         Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  656.         Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:Me.TimerEnabled = 0
  657.     End Select
  658.     LStep = LStep + 1
  659. End Sub
  660.  
  661. Sub RightSlingShot_Slingshot
  662.     PlaySound SoundFX("fx_slingshotR",DOFContactors)
  663.     RSling.Visible = 0
  664.     RSling1.Visible = 1
  665.     sling1.TransZ = -20
  666.     RStep = 0
  667.     Me.TimerEnabled = 1
  668.     vpmTimer.PulseSw 35
  669. End Sub
  670.  
  671. Sub RightSlingShot_Timer
  672.     Select Case RStep
  673.         Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  674.         Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:Me.TimerEnabled = 0
  675.     End Select
  676.     RStep = RStep + 1
  677. End Sub
  678.  
  679. ''************************************************************************************
  680. ''*****************               Bumpers                 ****************************
  681. ''************************************************************************************
  682.  
  683. Dim bump1, bump2, bump3
  684.  
  685. Sub Bumper1_Hit
  686.     vpmTimer.PulseSw 31
  687.     PlaySound SoundFX("fx_BumperLeft", DOFContactors)
  688.     bump1 = 1:Me.TimerEnabled = 1
  689. End Sub
  690.  
  691. Sub Bumper1_Timer()
  692.     Select Case bump1
  693.         Case 1:BR1.Z = 15:bump1 = 2
  694.         Case 2:BR1.Z = 25:bump1 = 3
  695.         Case 3:BR1.Z = 35:bump1 = 4
  696.         Case 4:BR1.Z = 45:Me.TimerEnabled = 0
  697.     End Select
  698. End Sub
  699.  
  700. Sub Bumper2_Hit
  701.     vpmTimer.PulseSw 32
  702.     PlaySound SoundFX("fx_BumperRight", DOFContactors)
  703.     bump2 = 1:Me.TimerEnabled = 1
  704. End Sub
  705.  
  706. Sub Bumper2_Timer()
  707.     Select Case bump2
  708.         Case 1:BR2.Z = 15:bump2 = 2
  709.         Case 2:BR2.Z = 25:bump2 = 3
  710.         Case 3:BR2.Z = 35:bump2 = 4
  711.         Case 4:BR2.Z = 45:Me.TimerEnabled = 0
  712.     End Select
  713. End Sub
  714.  
  715. Sub Bumper3_Hit
  716.     vpmTimer.PulseSw 33
  717.     PlaySound SoundFX("fx_BumperMiddle", DOFContactors)
  718.     bump3 = 1:Me.TimerEnabled = 1
  719. End Sub
  720.  
  721. Sub Bumper3_Timer()
  722.     Select Case bump3
  723.         Case 1:BR3.Z = 15:bump3 = 2
  724.         Case 2:BR3.Z = 25:bump3 = 3
  725.         Case 3:BR3.Z = 35:bump3 = 4
  726.         Case 4:BR3.Z = 45:Me.TimerEnabled = 0
  727.     End Select
  728. End Sub
  729.  
  730. '*******************************************************************
  731. '****************   Diverters   ************************************
  732. '*******************************************************************
  733.  
  734. Sub solShootDiverter(Enabled)
  735.     If Enabled Then
  736.         shooterdiverter.rotatetoend : Playsound SoundFX("fx_DivSS",DOFContactors)
  737.     Else
  738.         shooterdiverter.rotatetostart
  739.     End If
  740. End Sub
  741.  
  742. Sub SolGumballDiverter (enabled)
  743.     If Enabled Then
  744.         GumballDiverter.rotatetoend : Playsound SoundFX("fx_DivGM",DOFContactors)
  745.     Else
  746.         GumballDiverter.rotatetostart
  747.     End If
  748. End Sub
  749.  
  750. '********  Left Ramp Diverter   **********************
  751.  
  752. Sub SolLeftRampDiverter(enabled)
  753.     If Enabled Then
  754.         Playsound SoundFX("fx_DivLR",DOFContactors)
  755.         RampDivWall.IsDropped=1
  756.         RampDiverter.RotatetoEnd
  757.         Plunger1.pullback
  758.     Else
  759.         RampDivWall.IsDropped=0
  760.         RampDiverter.Rotatetostart
  761.         Plunger1.fire
  762.     End If
  763. End Sub
  764.  
  765. '********  Right Ramp Diverter   **********************
  766.  
  767. Dim divDir, divPos
  768. divPos = 0
  769.  
  770. Sub divKicker_Hit()
  771.     StopSound "fx_metalrolling"
  772.     PlaySound "fx_metalHit"
  773. End Sub
  774.  
  775. Sub SolRightRampDiverter(enabled)
  776.     If enabled Then
  777.         Playsound SoundFX("fx_DivRR",DOFContactors)
  778.         DivKicker.Kick 0, 10, 34
  779.         divDir = 9
  780.     Else
  781.         divDir = -9
  782.     End If
  783.     DiverterTimer.Enabled = 1
  784.     DivKicker.Enabled = Not enabled
  785. End Sub
  786.  
  787. Sub diverterTimer_Timer()
  788.     divPos = divPos + divDir
  789.     If divPos > 90 Then
  790.         divPos = 90
  791.         DiverterTimer.Enabled = 0
  792.     End If
  793.     If divPos < 0 Then
  794.         divPos = 0
  795.         diverterTimer.Enabled = 0
  796.     End If
  797.     RDiv.RotX = divPos
  798.     SpiralToy.RotX = divPos
  799. End Sub
  800.  
  801. '*******************************************************************
  802. '*************************       Targets        ********************
  803. '*******************************************************************
  804.  
  805. Sub sw47_Hit:vpmTimer.PulseSw 47:PlaySound SoundFX("fx_target",DOFContactors):End Sub
  806. Sub sw48_Hit:vpmTimer.PulseSw 48:PlaySound SoundFX("fx_target",DOFContactors):End Sub
  807. Sub sw64_Hit:vpmTimer.PulseSw 64:PlaySound SoundFX("fx_target",DOFContactors):End Sub
  808. Sub sw65_Hit:vpmTimer.PulseSw 65:PlaySound SoundFX("fx_target",DOFContactors):End Sub
  809. Sub sw65a_Hit:vpmTimer.PulseSw 65:PlaySound SoundFX("fx_target",DOFContactors):End Sub
  810. Sub sw66_Hit:vpmTimer.PulseSw 66:PlaySound SoundFX("fx_target",DOFContactors):End Sub
  811. Sub sw67_Hit:vpmTimer.PulseSw 67:PlaySound SoundFX("fx_target",DOFContactors):End Sub
  812. Sub sw68_Hit:vpmTimer.PulseSw 68:PlaySound SoundFX("fx_target",DOFContactors):End Sub
  813. Sub sw77_Hit:vpmTimer.PulseSw 77:PlaySound SoundFX("fx_target",DOFContactors):End Sub
  814. Sub sw78_Hit:vpmTimer.PulseSw 78:PlaySound SoundFX("fx_target",DOFContactors):End Sub
  815.  
  816. '******************************************************
  817. '***************   Mini PF Switches *******************
  818. '******************************************************
  819.  
  820. Sub sw44_Hit:Controller.Switch(44) = 1 : End Sub
  821. Sub sw44_Unhit:Controller.Switch(44) = 0 : End Sub
  822. Sub sw45_Hit:vpmTimer.PulseSw 45 : End Sub
  823. Sub sw45a_Hit:vpmTimer.PulseSw 45 : End Sub
  824. Sub sw46_Hit:vpmTimer.PulseSw 46 : End Sub
  825. Sub sw46a_Hit:vpmTimer.PulseSw 46 : End Sub
  826. Sub sw75_Hit:Controller.Switch(75) = 1 : End Sub
  827. Sub sw75_UnHit:Controller.Switch(75) = 0 : End Sub
  828. Sub sw76_Hit:Controller.Switch(76) = 1: vpmtimer.addtimer 300, "BallDropSound": End Sub
  829. Sub sw76_Unhit:Controller.Switch(76) = 0 : End Sub
  830.  
  831. '******************************************************
  832. '***************  Ramps Switches **********************
  833. '******************************************************
  834.  
  835. Sub sw53_Hit:vpmTimer.PulseSw 53:PlaySound "fx_Gate" : End Sub
  836. Sub sw54_Hit:Controller.Switch(54) = 1 : PlaySound "fx_Gate" : LRampSw.rotatetoend : End Sub
  837. Sub sw54_UnHit:Controller.Switch(54) = 0 : LRampSw.rotatetostart : End Sub
  838. Sub sw73_Hit:vpmTimer.PulseSw 73: Playsound "fx_metalrolling" : End Sub
  839.  
  840. '**************************************************************
  841. '***************  Rollover Switches   *************************
  842. '**************************************************************
  843.  
  844. Sub sw11_Hit:Controller.Switch(11)= 1:PlaySound "fx_sensor" : End Sub
  845. Sub sw11_Unhit:Controller.Switch(11) = 0:End Sub
  846. Sub sw12_Hit:Controller.Switch(12)= 1:PlaySound "fx_sensor" : End Sub
  847. Sub sw12_Unhit:Controller.Switch(12) = 0:End Sub
  848. Sub sw36_Hit:Controller.Switch(36)= 1:PlaySound "fx_sensor" : End Sub
  849. Sub sw36_Unhit:Controller.Switch(36)= 0:End Sub
  850. Sub sw37_Hit:Controller.Switch(37)= 1:PlaySound "fx_sensor" : End Sub
  851. Sub sw37_Unhit:Controller.Switch(37)= 0:End Sub
  852. Sub sw38_Hit:Controller.Switch(38)= 1:PlaySound "fx_sensor" : End Sub
  853. Sub sw38_Unhit:Controller.Switch(38)= 0:End Sub
  854. Sub sw52_Hit: Controller.Switch(52) = 1:PlaySound "fx_sensor" : End Sub
  855. Sub sw52_Unhit:Controller.Switch(52)= 0:End Sub
  856. Sub sw56_Hit: Controller.Switch(56) = 1:PlaySound "fx_sensor" : End Sub
  857. Sub sw56_Unhit:Controller.Switch(56)= 0:End Sub
  858. Sub sw61_Hit: Controller.Switch(61) = 1:PlaySound "fx_sensor" : End Sub
  859. Sub sw61_Unhit:Controller.Switch(61)= 0:End Sub
  860. Sub sw62_Hit: Controller.Switch(62) = 1:PlaySound "fx_sensor" : End Sub
  861. Sub sw62_Unhit:Controller.Switch(62)= 0:End Sub
  862. Sub sw63_Hit: Controller.Switch(63) = 1:PlaySound "fx_sensor" : End Sub
  863. Sub sw63_Unhit:Controller.Switch(63)= 0:End Sub
  864.  
  865. '**************************************************************
  866. '***************  Opto Switches   *********************
  867. '**************************************************************
  868.  
  869. Sub sw81_Hit:Controller.Switch(81) = 1:End Sub
  870. Sub sw81_UnHit:Controller.Switch(81) = 0:End Sub
  871. Sub sw82_Hit:Controller.Switch(82) = 1:End Sub
  872. Sub sw82_UnHit:Controller.Switch(82) = 0:End Sub
  873. Sub sw83_Hit:Controller.Switch(83) = 1:End Sub
  874. Sub sw83_UnHit:Controller.Switch(83) = 0:End Sub
  875.  
  876. 'Clock Pass Opto (only in prototypes,supported by rom version 9.4)
  877. Sub sw86_Hit:Controller.Switch(86) = 1:End Sub
  878. Sub sw86_UnHit:Controller.Switch(86) = 0:End Sub
  879. 'Gumball entry opto
  880. sub sw87_hit():controller.switch(87) = 1:end Sub
  881. sub sw87_unhit():controller.switch(87) = 0:end Sub
  882. ''Autoplunger 2nd Opto (only in prototypes,supported by rom version 9.4)
  883. 'Sub sw71_Hit:Controller.Switch(71) = 1:End Sub
  884. 'Sub sw71_UnHit:Controller.Switch(71) = 0:End Sub
  885.  
  886. '*************************************************************
  887. '***************   Shooting lane   ***************************
  888. '*************************************************************
  889.  
  890. Sub sw27_Hit():controller.switch(27) = 1:BIPL = 1
  891. If TVMod = 1 then TVTimer.enabled = 1:Frame.imageA = "tv_1"
  892. End Sub
  893.  
  894. Sub sw27_UnHit():controller.switch(27) = 0:BIPL = 0:End Sub
  895.  
  896. ''************************************************************
  897. ''*****************   Flippers    ****************************
  898. ''************************************************************
  899.  
  900. Sub SolLFlipper(Enabled)
  901.     If Enabled Then
  902.         PlaySound SoundFX("fx_flipperUp",DOFContactors)
  903.         LeftFlipper.RotateToEnd
  904.     Else
  905.         PlaySound SoundFX("fx_flipperdown",DOFContactors)
  906.         LeftFlipper.RotateToStart
  907.     End If
  908. End Sub
  909.  
  910. Sub SolRFlipper(Enabled)
  911.     If Enabled Then
  912.         PlaySound SoundFX("fx_flipperUp",DOFContactors)
  913.         RightFlipper.RotateToEnd
  914.     Else
  915.         PlaySound SoundFX("fx_flipperdown",DOFContactors)
  916.         RightFlipper.RotateToStart
  917.     End If
  918. End Sub
  919.  
  920. Sub SolULFlipper(Enabled)
  921.     If Enabled Then
  922.         LeftMiniFlipper.RotateToEnd
  923.     Else
  924.         LeftMiniFlipper.RotateToStart
  925.     End If
  926. End Sub
  927.  
  928. Sub SolURFlipper(Enabled)
  929.     If Enabled Then
  930.         RightminiFlipper.RotateToEnd
  931.     Else
  932.         RightMiniFlipper.RotateToStart
  933.     End If
  934. End Sub
  935.  
  936. '********************************************************************************
  937. '*******************        REATIME UPDATES     *********************************
  938. '********************************************************************************
  939.  
  940. Sub GameTimer
  941.     UpdateClock
  942.     RollingSoundUpdate
  943.     UpdateMechs
  944. End Sub
  945.  
  946. Sub UpdateMechs
  947.     FlipperL.RotZ = LeftFlipper.CurrentAngle
  948.     FlipperR.RotZ = RightFlipper.CurrentAngle
  949.     FlipperL1.RotY = LeftMiniFlipper.CurrentAngle
  950.     FlipperR1.RotZ = RightMiniFlipper.CurrentAngle
  951.     ShooterDiv.RotY = ShooterDiverter.CurrentAngle
  952.     DiverterP.RotZ = RampDiverter.CurrentAngle
  953.     DiverterP1.RotZ = GumballDiverter.CurrentAngle
  954.     sw53p.RotX = LRampG.CurrentAngle
  955.     sw54p.RotX = LRampSw.CurrentAngle
  956. End Sub
  957.  
  958. '********************************************************************************
  959. '******************  NFOZZY'S GUMBALL MACHINE   *********************************
  960. '********************************************************************************
  961.  
  962. sub Gumball0_hit():updategumballs:end Sub
  963. sub Gumball1_hit():updategumballs:end Sub
  964. sub Gumball2_hit():updategumballs:end Sub
  965. sub Gumball3_hit():updategumballs:end Sub
  966. sub Gumball3_Unhit():updategumballs:end Sub
  967.  
  968. sub updategumballs
  969.     gumballupdate.interval = 50
  970.     gumballupdate.enabled = 1
  971. End sub
  972.  
  973. sub Gumballupdate_timer()
  974.     if gumball3.BallCntOver = 0 then gumball2.kick 170, 1 end If
  975.     if gumball2.BallCntOver = 0 then gumball1.kick 170, 1 end If
  976.     if gumball1.BallCntOver = 0 then gumball0.kick 170, 1 end If
  977.     me.enabled = 0      'Might cause problems
  978. end sub
  979.  
  980. Sub SolGumRelease(enabled)
  981.     If enabled Then
  982.         gumball3.kick 170, 1
  983.         updategumballs
  984.         vpmTimer.AddTimer 100, "GumKnobTimer.enabled = 1'"
  985.         vpmtimer.PulseSw 55
  986.     End If
  987. End Sub
  988.  
  989. Sub SolGumballMotor(enabled)
  990.     If enabled Then
  991.         PlaySound SoundFX("fx_GumMachine",DOFGear)
  992.     End If
  993. End Sub
  994.  
  995. Sub GumKnobTimer_Timer()
  996.     GumballMachineKnob.RotY= GumballMachineKnob.RotY + 20
  997.     If GumballMachineKnob.RotY >  360 then GumKnobTimer.enabled = 0 : GumballMachineKnob.RotY = 0
  998. End Sub
  999.  
  1000. '********************************************************************
  1001. '*************************   CLOCK   ********************************
  1002. '********************************************************************
  1003. Dim LastTime
  1004. LastTime = 0
  1005.  
  1006. Sub UpdateClock
  1007.     Dim Time, Min, Hour, temp
  1008.     Time = CInt(Controller.GetMech(0) )
  1009.     If Time <> LastTime Then
  1010.         Min = (Time Mod 60)
  1011.         Hour = Int(Time / 2)
  1012.         ClockShort.RotY = Hour - 45
  1013.         ClockLarge.RotY = min * 6
  1014.         Clock_mech.RotY = min * 6
  1015.         LastTime = Time
  1016.         PlaySound SoundFXDOF("fx_motor",101,DOFPulse,DOFGear), -1, 1, 0.05, 0, 0, 1, 0
  1017.     Else Stopsound "fx_motor"
  1018.     End If
  1019. End Sub
  1020.  
  1021. '**********************************************************************
  1022. '**************   POWER FIELD MAGNETS *********************************
  1023. '**********************************************************************
  1024.  
  1025. Sub SolMiniMagnet(aMag, enabled)
  1026.     If enabled Then
  1027.         PlaySound SoundFX("fx_magnet",DOFShaker)
  1028.         With aMag
  1029.             .removeball powerballnf
  1030.             .MagnetOn = True
  1031.             .Update
  1032.             .MagnetOn = False
  1033.         End With
  1034.     End If
  1035. End Sub
  1036.  
  1037. '**********************************************************************
  1038. ' SPECIAL CODE BY NFOZZY TO HANDLE MAGNET TRIGGERS
  1039. ' based on the code by KIEFERSKUNK/DORSOLA
  1040. ' Method: on extra triggers unhit, kill the velocity of the
  1041. ' ball if the magnet is on, helping the magnet catch the ball.
  1042. '**********************************************************************
  1043.  
  1044. Sub sw81_help_unhit
  1045.     If activeball.vely > 28 then  activeball.vely = RndNum (26,27)          '-ninuzzu- Let's slow down the ball a bit so the magnets can
  1046.     If activeball.vely < - 28 then  activeball.vely = - RndNum (26,27)      'catch the ball
  1047.     If mLowerRightMagnet.MagnetOn = 1 and activeball.id <> 666 then
  1048.         activeball.vely = activeball.vely * -0.2
  1049.         activeball.velx = activeball.velx * -0.2
  1050.     End If
  1051. End Sub
  1052.  
  1053. Sub sw82_help_unhit
  1054.     If mUpperRightMagnet.MagnetOn = 1 and activeball.id <> 666 then
  1055.         activeball.vely = activeball.vely * -0.2
  1056.         activeball.velx = activeball.velx * -0.2
  1057.     End If
  1058. End Sub
  1059.  
  1060. Sub sw83_help_unhit
  1061.     If mLeftMagnet.MagnetOn = 1 and activeball.id <> 666 then
  1062.         activeball.vely = activeball.vely * -0.2
  1063.         activeball.velx = activeball.velx * -0.2
  1064.     End If
  1065. End Sub
  1066.  
  1067. Sub SolLeftMagnet(enabled)
  1068.     If enabled Then
  1069.         mLeftMagnet.MagnetOn = 1
  1070.         mleftmagnet.removeball powerballnf
  1071.         PlaySound SoundFX("fx_magnet_catch",DOFShaker)
  1072.     Else
  1073.         mLeftMagnet.MagnetOn = 0
  1074.     End If
  1075. End Sub
  1076.  
  1077. Sub SolUpperRightMagnet(enabled)
  1078.     If enabled Then
  1079.         mUpperRightMagnet.MagnetOn = 1
  1080.         mUpperRightMagnet.removeball powerballnf
  1081.         PlaySound SoundFX("fx_magnet_catch",DOFShaker)
  1082.     Else
  1083.         mUpperRightMagnet.MagnetOn = 0
  1084.     End If
  1085. End Sub
  1086.  
  1087. Sub SolLowerRightMagnet(enabled)
  1088.     If enabled Then
  1089.         mLowerRightMagnet.MagnetOn = 1
  1090.         mLowerRightMagnet.removeball powerballnf
  1091.         PlaySound SoundFX("fx_magnet_catch",DOFShaker)
  1092.     Else
  1093.         mLowerRightMagnet.MagnetOn = 0
  1094.     End If
  1095. End Sub
  1096.  
  1097. '***************************************************
  1098. '       JP's VP10 Fading Lamps & Flashers
  1099. '       Based on PD's Fading Light System
  1100. ' SetLamp 0 is Off
  1101. ' SetLamp 1 is On
  1102. ' fading for non opacity objects is 4 steps
  1103. '***************************************************
  1104.  
  1105. Dim LampState(200), FadingLevel(200)
  1106. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  1107.  
  1108. InitLamps()             ' turn off the lights and flashers and reset them to the default parameters
  1109. LampTimer.Interval = 20 'lamp fading speed
  1110. LampTimer.Enabled = 1
  1111.  
  1112. ' Lamp & Flasher Timers
  1113.  
  1114. Sub LampTimer_Timer()
  1115.     Dim chgLamp, num, chg, ii
  1116.     chgLamp = Controller.ChangedLamps
  1117.     If Not IsEmpty(chgLamp) Then
  1118.         For ii = 0 To UBound(chgLamp)
  1119.             LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1)       'keep the real state in an array
  1120.            FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  1121.        Next
  1122.     End If
  1123.     UpdateLamps
  1124. End Sub
  1125.  
  1126. Sub InitLamps()
  1127.     Dim x
  1128.     For x = 0 to 200
  1129.         LampState(x) = 0         ' current light state, independent of the fading level. 0 is off and 1 is on
  1130.        FadingLevel(x) = 4       ' used to track the fading state
  1131.        FlashSpeedUp(x) = 0.5    ' faster speed when turning on the flasher
  1132.        FlashSpeedDown(x) = 0.35 ' slower speed when turning off the flasher
  1133.        FlashMax(x) = 1          ' the maximum value when on, usually 1
  1134.        FlashMin(x) = 0          ' the minimum value when off, usually 0
  1135.        FlashLevel(x) = 0        ' the intensity of the flashers, usually from 0 to 1
  1136.    Next
  1137. End Sub
  1138.  
  1139. Sub UpdateLamps
  1140.     NFadeL 11, l11
  1141.     NFadeL 12, l12
  1142.     NFadeLm 13, l13
  1143.     NFadeLm 13, l13a    'Robbie lights
  1144.     NFadeL 13, l13b     'Robbie lights
  1145.    NFadeL 14, l14
  1146.     NFadeL 15, l15
  1147.     NFadeL 16, l16
  1148.     NFadeLm 17, l17
  1149.     NFadeLm 17, l17a    'TownSquarePost lights
  1150.     NFadeLm 17, l17a1   'TownSquarePost lights
  1151.     NFadeLm 17, l17a2   'TownSquarePost lights
  1152.     Flash 17, l17r      'TownSquarePost lights
  1153.    NFadeL 18, l18
  1154.  
  1155.     NFadeL 21, l21
  1156.     NFadeL 22, l22
  1157.     NFadeL 23, l23
  1158.     NFadeL 24, l24
  1159.     NFadeL 25, l25
  1160.     NFadeL 26, l26
  1161.     NFadeLm 27, l27
  1162.     NFadeLm 27, l27a    'SlotMachine Lights
  1163.     Flash 27, l27b      'SlotMachine Lights
  1164.    NFadeLm 28, l28
  1165.     NFadeLm 28, l28a    'Robbie lights
  1166.     NFadeL 28, l28b     'Robbie lights
  1167.  
  1168.     NFadeL 31, l31
  1169.     NFadeL 32, l32
  1170.     NFadeL 33, l33
  1171.     NFadeL 34, l34
  1172.     NFadeL 35, l35
  1173.     NFadeLm 36, l36
  1174.     NFadeLm 36, l36a    'Robbie lights
  1175.     NFadeL 36, l36b     'Robbie lights
  1176.    NFadeL 37, l37
  1177.     NFadeL 38, l38
  1178.  
  1179.     NFadeL 41, l41
  1180.     NFadeL 42, l42
  1181.     NFadeL 43, l43
  1182.     NFadeL 44, l44
  1183.     NFadeL 45, l45
  1184.     NFadeL 46, l46
  1185.     NFadeL 47, l47
  1186.     NFadeL 48, l48
  1187.  
  1188.     NFadeL 51, l51
  1189.     NFadeL 52, l52
  1190.     NFadeL 53, l53
  1191.     NFadeL 54, l54
  1192.     NFadeLm 55, l55
  1193.     NFadeLm 55, l55a    'Camera lights
  1194.     NFadeLm 55, l55b    'Camera lights
  1195.     Flash 55, l55c      'Camera lights
  1196.     NFadeLm 56, l56
  1197.     Flashm 56, l56a     'Pyramid lights
  1198.     Flash 56, l56b      'Pyramid lights
  1199.     NFadeLm 57, l57     'Robbie lights
  1200.     Flashm 57, l57a     'Robbie lights
  1201.    Flash 57, l57b
  1202.     NFadeL 58, l58
  1203.  
  1204.     NFadeLm 61, l61
  1205.     NFadeLm 61, l61a
  1206.     NFadeL 61, l61b
  1207.     NFadeLm 62, l62
  1208.     NFadeLm 62, l62a
  1209.     NFadeL 62, l62b
  1210.     NFadeLm 63, l63
  1211.     NFadeLm 63, l63a
  1212.     NFadeL 63, l63b
  1213.     NFadeL 64, l64
  1214.     NFadeL 65, l65
  1215.     NFadeL 66, l66
  1216.     NFadeL 67, l67
  1217.     NFadeL 68, l68
  1218.  
  1219.     NFadeL 71, l71
  1220.     NFadeL 72, l72
  1221.     NFadeL 73, l73
  1222.     NFadeL 74, l74
  1223.     NFadeL 75, l75
  1224.     NFadeL 76, l76
  1225.     NFadeL 77, l77
  1226.     NFadeL 78, l78
  1227.  
  1228.     NFadeLm 81, l81
  1229.     Flash 81, l81a
  1230.     NFadeLm 82, l82
  1231.     NFadeLm 82, l82a    'Clock Toy Mod lights
  1232.     Flash 82, l82r      'Clock Toy Mod lights
  1233.    NFadeLm 83, l83
  1234.     NFadeL 83, l83a
  1235.     NFadeLm 84, l84
  1236.     NFadeL 84, l84a
  1237.     NFadeLm 85, l85
  1238.     Flashm 85, l85a     'SlotMachine Lights
  1239.     Flash 85, l85b      'SlotMachine Lights
  1240.    NFadeLm 86, l86
  1241.     Flash 86, l86r
  1242.  
  1243.     'Flashers
  1244.     NFadeLModm 117, f17
  1245.     NFadeLMod 117, f17a
  1246.     NFadeLModm 118, f18
  1247.     NFadeLModm 118, f18a
  1248.     NFadeLModm 118, f18b
  1249.     NFadeLModm 118, f18c
  1250.     NFadeLModm 118, f18d
  1251.     Flash 118, f18e
  1252.     NFadeLModm 119, f19
  1253.     NFadeLModm 119, f19a
  1254.     Flash 119, f19b         'Pyramid lights
  1255.     NFadeLModm 120, f20
  1256.     NFadeLModm 120, f20a
  1257.     NFadeLModm 120, f20b
  1258.     NFadeLModm 120, f20c
  1259.     NFadeLModm 120, f20d
  1260.     Flashm 120, f20e
  1261.     Flash 120, f20r
  1262.     NFadeLModm 128, f28
  1263.     NFadeLModm 128, f28a
  1264.     NFadeLModm 128, f28b
  1265.     Flashm 128, f28c
  1266.     Flash 128, f28r
  1267.     NFadeLModm 137, f37
  1268.     NFadeLModm 137, f37a        'Rocket lights
  1269.     NFadeLMod 137, f37b     'Rocket lights
  1270.     NFadeLModm 138, f38
  1271.     NFadeLModm 138, f38a
  1272.     Flashm 138, f38b
  1273.     Flash 138, f38r
  1274.     NFadeLModm 139, f39
  1275.     NFadeLModm 139, f39a
  1276.     Flashm 139, f39b
  1277.     Flash 139, f39r
  1278.     NFadeLModm 140, f40
  1279.     NFadeLModm 140, f40a
  1280.     Flashm 140, f40b
  1281.     Flash 140, f40r
  1282.     NFadeLModm 141, f41
  1283.     NFadeLModm 141, f41a
  1284.     NFadeLModm 141, f41b
  1285.     NFadeLModm 141, f41c
  1286.     NFadeLModm 141, f41d
  1287.     Flashm 141, f41e
  1288.     Flash 141, f41r
  1289.  
  1290.     If BIP > 0 AND SpiralMod = 1 Then SpiralMove.enabled = LampState(68)
  1291. End Sub
  1292.  
  1293.  
  1294. Sub SetModLamp(nr, level)
  1295.     debug.print nr & ": " & level
  1296.     FadingLevel(nr) = level
  1297. End Sub
  1298.  
  1299. Sub SetLamp(nr, value)
  1300.     If value <> LampState(nr) Then
  1301.         LampState(nr) = abs(value)
  1302.         FadingLevel(nr) = abs(value) + 4
  1303.     End If
  1304. End Sub
  1305.  
  1306. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  1307.  
  1308. Sub NFadeLMod(nr, object)   '3 lights
  1309.    object.Intensity = FadingLevel(nr) / 10
  1310.     object.state = 1
  1311.     object.visible = 1
  1312. End Sub
  1313.  
  1314. Sub NFadeLModm(nr, object) ' used for multiple lights
  1315.     NFadeLMod nr, Object
  1316. End Sub
  1317.  
  1318. Sub NFadeL(nr, object)
  1319.     Select Case FadingLevel(nr)
  1320.         Case 4:object.state = 0:FadingLevel(nr) = 0
  1321.         Case 5:object.state = 1:FadingLevel(nr) = 1
  1322.     End Select
  1323. End Sub
  1324.  
  1325. Sub NFadeLm(nr, object) ' used for multiple lights
  1326.    Select Case FadingLevel(nr)
  1327.         Case 4:object.state = 0
  1328.         Case 5:object.state = 1
  1329.     End Select
  1330. End Sub
  1331.  
  1332. 'Lights, Ramps & Primitives used as 4 step fading lights
  1333. 'a,b,c,d are the images used from on to off
  1334.  
  1335. Sub FadeObj(nr, object, a, b, c, d)
  1336.     Select Case FadingLevel(nr)
  1337.         Case 4:object.image = b:FadingLevel(nr) = 6                   'fading to off...
  1338.        Case 5:object.image = a:FadingLevel(nr) = 1                   'ON
  1339.        Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1            'wait
  1340.        Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1341.        Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1         'wait
  1342.        Case 13:object.image = d:FadingLevel(nr) = 0                  'Off
  1343.    End Select
  1344. End Sub
  1345.  
  1346. Sub FadeObjm(nr, object, a, b, c, d)
  1347.     Select Case FadingLevel(nr)
  1348.         Case 4:object.image = b
  1349.         Case 5:object.image = a
  1350.         Case 9:object.image = c
  1351.         Case 13:object.image = d
  1352.     End Select
  1353. End Sub
  1354.  
  1355. Sub NFadeObj(nr, object, a, b)
  1356.     Select Case FadingLevel(nr)
  1357.         Case 4:object.image = b:FadingLevel(nr) = 0 'off
  1358.        Case 5:object.image = a:FadingLevel(nr) = 1 'on
  1359.    End Select
  1360. End Sub
  1361.  
  1362. Sub NFadeObjm(nr, object, a, b)
  1363.     Select Case FadingLevel(nr)
  1364.         Case 4:object.image = b
  1365.         Case 5:object.image = a
  1366.     End Select
  1367. End Sub
  1368.  
  1369. ' Flasher objects
  1370.  
  1371. Sub Flash(nr, object)
  1372.     Select Case FadingLevel(nr)
  1373.         Case 4 'off
  1374.            FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  1375.             If FlashLevel(nr) < FlashMin(nr) Then
  1376.                 FlashLevel(nr) = FlashMin(nr)
  1377.                 FadingLevel(nr) = 0 'completely off
  1378.            End if
  1379.             Object.IntensityScale = FlashLevel(nr)
  1380.         Case 5 ' on
  1381.            FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  1382.             If FlashLevel(nr) > FlashMax(nr) Then
  1383.                 FlashLevel(nr) = FlashMax(nr)
  1384.                 FadingLevel(nr) = 1 'completely on
  1385.            End if
  1386.             Object.IntensityScale = FlashLevel(nr)
  1387.     End Select
  1388. End Sub
  1389.  
  1390. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  1391.    Object.IntensityScale = FlashLevel(nr)
  1392. End Sub
  1393.  
  1394. '*********
  1395. 'Update GI
  1396. '*********
  1397.  
  1398. Dim gistep
  1399.  
  1400. Sub UpdateGI(no, step)
  1401.     Dim xx
  1402.     If step = 0 then exit sub 'only values from 1 to 8 are visible and reliable. 0 is not reliable and 7 & 8 are the same so...
  1403.    gistep = (step-1) / 7
  1404.     Select Case no
  1405.         Case 0
  1406.             For each xx in GILeft:xx.IntensityScale = gistep:next   'Playfield Left
  1407.        Case 1
  1408.             For each xx in GIMinipf:xx.IntensityScale = gistep:next 'Mini Playfield + Insert
  1409.        Case 2
  1410.             For each xx in GIClock:xx.IntensityScale = gistep:next  'Clock + Insert
  1411.        Case 3
  1412.             For each xx in GImain:xx.IntensityScale = gistep:next   'Insert Main
  1413.        Case 4
  1414.             For each xx in GIRight:xx.IntensityScale = gistep:next  'Playfield Right
  1415.    End Select
  1416.  
  1417.     ' change the intensity of the flasher depending on the gi to compensate for the gi lights being off
  1418.    For xx = 0 to 200
  1419.         FlashMax(xx) = 6 - gistep * 3 ' the maximum value of the flashers
  1420.    Next
  1421. End Sub
  1422.  
  1423. ' *********************************************************************
  1424. '                      Supporting Ball & Sound Functions
  1425. ' *********************************************************************
  1426.  
  1427. Function RndNum(min, max)
  1428.     RndNum = Int(Rnd() * (max-min + 1) ) + min ' Sets a random number between min and max
  1429. End Function
  1430.  
  1431. Function Vol(ball)                             ' Calculates the Volume of the sound based on the ball speed
  1432.    Vol = Csng(BallVel(ball) ^2 / 1000)
  1433. End Function
  1434.  
  1435. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1436.    Dim tmp
  1437.     tmp = ball.x * 2 / table1.width-1
  1438.     If tmp > 0 Then
  1439.         Pan = Csng(tmp ^10)
  1440.     Else
  1441.         Pan = Csng(-((- tmp) ^10) )
  1442.     End If
  1443. End Function
  1444.  
  1445. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1446.    Pitch = BallVel(ball) * 20
  1447. End Function
  1448.  
  1449. Function BallVel(ball) 'Calculates the ball speed
  1450.    BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1451. End Function
  1452.  
  1453. '*****************************************
  1454. '    JP's VP10 Rolling Sounds
  1455. '*****************************************
  1456.  
  1457. Const tnob = 9 ' total number of balls
  1458. ReDim rolling(tnob)
  1459. InitRolling
  1460.  
  1461. Sub InitRolling
  1462.     Dim i
  1463.     For i = 0 to tnob
  1464.         rolling(i) = FALSE
  1465.     Next
  1466. End Sub
  1467.  
  1468. Sub RollingSoundUpdate()
  1469.     Dim BOT, b
  1470.     BOT = GetBalls
  1471.  
  1472.     ' stop the sound of deleted balls
  1473.    For b = UBound(BOT) + 1 to tnob
  1474.         rolling(b) = FALSE
  1475.         StopSound("fx_ballrolling" & b)
  1476.     Next
  1477.  
  1478.     ' exit the sub if no balls on the table
  1479.    If UBound(BOT) = -1 Then Exit Sub
  1480.  
  1481.     ' play the rolling sound for each ball
  1482.    For b = 0 to UBound(BOT)
  1483.         If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1484.             rolling(b) = TRUE
  1485.             PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1486.         Else
  1487.             If rolling(b) = TRUE Then
  1488.                 StopSound("fx_ballrolling" & b)
  1489.                 rolling(b) = FALSE
  1490.             End If
  1491.         End If
  1492.     Next
  1493. End Sub
  1494.  
  1495. '*****************************************
  1496. ' JP's VP10 Ball Collision Sound
  1497. '*****************************************
  1498.  
  1499. Sub OnBallBallCollision(ball1, ball2, velocity)
  1500.     PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 500, Pan(ball1), 0, Pitch(ball1), 0, 0
  1501. End Sub
  1502.  
  1503.  
  1504. '*****************************************
  1505. ' JF's Sound Routines
  1506. '*****************************************
  1507.  
  1508. Sub Rubbers_Hit(idx)
  1509.     dim finalspeed
  1510.     finalspeed = SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1511.     If finalspeed > 20 then
  1512.         PlaySound "fx_rubber", 0, 2*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1513.     End if
  1514.     If finalspeed >= 6 AND finalspeed <= 20 then
  1515.         RandomSoundRubber()
  1516.     End If
  1517. End Sub
  1518.  
  1519. Sub Posts_Hit(idx)
  1520.     dim finalspeed
  1521.     finalspeed = SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1522.     If finalspeed > 16 then
  1523.         PlaySound "fx_rubber", 0, 2*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1524.     End if
  1525.     If finalspeed >= 6 AND finalspeed <= 16 then
  1526.         RandomSoundRubber()
  1527.     End If
  1528. End Sub
  1529.  
  1530. Sub RandomSoundRubber()
  1531.     Select Case Int(Rnd * 3) + 1
  1532.         Case 1:PlaySound "rubber_hit_1", 0, 2*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1533.         Case 2:PlaySound "rubber_hit_2", 0, 2*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1534.         Case 3:PlaySound "rubber_hit_3", 0, 2*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1535.     End Select
  1536. End Sub
  1537.  
  1538. Sub LeftFlipper_Collide(parm)
  1539.     RandomSoundFlipper()
  1540. End Sub
  1541.  
  1542. Sub RightFlipper_Collide(parm)
  1543.     RandomSoundFlipper()
  1544. End Sub
  1545.  
  1546. Sub LeftMiniFlipper_Collide(parm)
  1547.     RandomSoundFlipper()
  1548. End Sub
  1549.  
  1550. Sub RightMiniFlipper_Collide(parm)
  1551.     RandomSoundFlipper()
  1552. End Sub
  1553.  
  1554. Sub RandomSoundFlipper()
  1555.     Select Case Int(Rnd * 3) + 1
  1556.         Case 1:PlaySound "flip_hit_1", 0, 2*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1557.         Case 2:PlaySound "flip_hit_2", 0, 2*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1558.         Case 3:PlaySound "flip_hit_3", 0, 2*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1559.     End Select
  1560. End Sub
  1561.  
  1562. '**********************
  1563. ' Balldrop & Ramp Sound
  1564. '**********************
  1565.  
  1566. Sub BallDropSound(dummy)
  1567.     PlaySound "fx_ball_drop"
  1568. End Sub
  1569.  
  1570. Sub Balldrop1_Hit()
  1571.     vpmtimer.addtimer 300, "BallDropSound"
  1572.     StopSound "fx_metalrolling"
  1573. End Sub
  1574.  
  1575. Sub Balldrop2_Hit()
  1576.     vpmtimer.addtimer 100, "BallDropSound"
  1577. End Sub
  1578.  
  1579. Sub Balldrop3_Hit()
  1580.     vpmtimer.addtimer 300, "BallDropSound"
  1581.     StopSound "fx_metalrolling"
  1582. End Sub
  1583.  
  1584. Sub Balldrop4_Hit()
  1585.     PlaySound "fx_power"
  1586. End Sub
  1587.  
  1588. Sub WirerampSound1_Hit()
  1589.     PlaySound "fx_metalrolling"
  1590. End Sub
  1591.  
  1592. Sub WirerampSound2_Hit()
  1593.     PlaySound "fx_metalrolling"
  1594. End Sub
  1595.  
  1596. Sub WirerampSoundStop_Hit()
  1597.     StopSound "fx_metalrolling"
  1598. End Sub
  1599.  
  1600. Sub LREnter_Hit()
  1601.     If ActiveBall.VelY < 0 Then PlaySound "fx_rlenter"
  1602. End Sub
  1603.  
  1604. Sub RREnter_Hit()
  1605.     If ActiveBall.VelY < 0 Then PlaySound "fx_rrenter"
  1606. End Sub
  1607.  
  1608. '***********************************************************************
  1609. '* TABLE OPTIONS *******************************************************
  1610. '***********************************************************************
  1611.  
  1612. Dim TVPic, SlotPic, RGBStep, RGBFactor, Red, Green, Blue, cGameName
  1613.  
  1614. TVPic = 0
  1615. SlotPic = 0
  1616. RGBStep = 0
  1617. RGBFactor = 1
  1618. Red = 255
  1619. Green = 0
  1620. Blue = 0
  1621.  
  1622. LeftCab.visible = CabinetSide
  1623. RightCab.visible = CabinetSide
  1624. led6.visible = NOT DesktopMode
  1625. led7.visible = DesktopMode
  1626. RGBLed1.visible = DesktopMode
  1627. RailL.visible = DesktopMode
  1628. RailR.visible = DesktopMode
  1629. pfshadow.visible = RampShadow
  1630. Scoop1L.visible = ScoopLight
  1631. Scoop2L.visible = ScoopLight
  1632. RGBLed3.visible = GumballRGB
  1633. RGBLed4.visible = GumballRGB
  1634. RGBLed5.visible = GumballRGB
  1635. RGBLed6.visible = GumballRGB
  1636. RGBLed7.visible = GumballRGB
  1637. RGBLed8.visible = GumballRGB
  1638. RGBLed9.visible = GumballRGB
  1639. RGBLed10.visible = GumballRGB
  1640. SlotMachineToy.visible = SlotMachineMod
  1641. swSlotReel.enabled = SlotMachineMod
  1642. SlotReel.visible = SlotMachineMod
  1643. SlotReelLight1.visible = SlotMachineMod
  1644. SlotReelLight2.visible = SlotMachineMod
  1645. l27a.visible = SlotMachineMod
  1646. l27b.visible = SlotMachineMod
  1647. l85a.visible = SlotMachineMod
  1648. l85b.visible = SlotMachineMod
  1649. Pyramid.visible = PyramidMod
  1650. PyramidCap.visible = PyramidMod
  1651. GI_Pyr1.visible = PyramidMod
  1652. GI_Pyr2.visible = PyramidMod
  1653. GI_Pyr3.visible = PyramidMod
  1654. l56a.visible = PyramidMod
  1655. l56b.visible = PyramidMod
  1656. f19b.visible = PyramidMod
  1657. ClockToy.visible = MiniClockMod
  1658. MysticSeerToy.visible = MysticSeerMod
  1659. InvaderToy.visible = InvaderMod
  1660. l00.visible = InvaderMod
  1661. led3.visible = InvaderMod
  1662. led4.visible = InvaderMod
  1663. led5.visible = InvaderMod
  1664. l82a.visible = MiniClockMod
  1665. l82r.visible = MiniClockMod
  1666. TVToy.visible = TVMod
  1667. Frame.visible = TVMod
  1668. SpiralToy.visible = SpiralMod
  1669. URMagnetP.visible = ExtraMagnet
  1670. sw82.enabled = ExtraMagnet
  1671. sw82_help.enabled = ExtraMagnet
  1672.  
  1673. If FlipperType = 2 then FlipperType = RndNum(0, 1)
  1674.  
  1675. If TargetMod = 1 Then
  1676.     sw47.image = "target-clock"
  1677.     sw48.image = "target-greed"
  1678.     sw64.image = "target-greed"
  1679.     sw65.image = "target-power"
  1680.     sw65a.image = "target-power"
  1681.     sw66.image = "target-greed"
  1682.     sw67.image = "target-greed"
  1683.     sw68.image = "target-coins"
  1684.     sw77.image = "target-greed"
  1685.     sw78.image = "target-greed"
  1686. End If
  1687.  
  1688. If TownSquarePostMod = 1 Then
  1689.     Rubber12.visible = 0
  1690.     TownSquarePost.visible = 1
  1691.     TownSquarePostW.visible = 1
  1692.     TownSquarePostBulb.visible = 1
  1693.     l17a.visible = 1
  1694.     l17a1.visible = 1
  1695.     l17a2.visible = 1
  1696.     l17r.visible = 1
  1697. Else
  1698.     l17a.visible = 0
  1699.     l17a1.visible = 0
  1700.     l17a2.visible = 0
  1701.     l17r.visible = 0
  1702. End If
  1703.  
  1704. Select Case Romset
  1705.             Case 0: cGameName = "tz_94h"
  1706.             Case 1: cGameName = "tz_94h"
  1707. End Select
  1708.  
  1709. Select Case FlipperType
  1710.     Case 0:FlipperL.visible = 1
  1711.         FlipperR.visible = 1
  1712.         FlipperL1.visible = 1
  1713.         FlipperR1.visible = 1
  1714.     Case 1:LeftFlipper.visible = 1
  1715.         RightFlipper.visible = 1
  1716.         LeftMiniFlipper.visible = 1
  1717.         RightMiniFlipper.visible = 1
  1718.         LogoL.visible = 1
  1719.         LogoR.visible = 1
  1720.         LogoL1.visible = 1
  1721.         LogoR1.visible = 1
  1722. End Select
  1723.  
  1724. Select Case PyramidTopLight
  1725.     'Red
  1726.         Case 0 :    l56a.color = RGB (255,0,0):l56a.colorfull = RGB (255,170,170)
  1727.                     l56b.color = RGB (255,0,0):f19b.color = RGB (255,0,0)
  1728.     'Green
  1729.         Case 1 :    l56a.color = RGB (0,255,0):l56a.colorfull = RGB (170,255,170)
  1730.                     l56b.color = RGB (0,255,0):f19b.color = RGB (0,255,0)
  1731.     'Blue
  1732.         Case 2 :    l56a.color = RGB (0,0,255):l56a.colorfull = RGB (170,170,255)
  1733.                     l56b.color = RGB (0,0,255):f19b.color = RGB (0,0,255)
  1734.     'Yellow
  1735.         Case 3 :    l56a.color = RGB (255,255,0):l56a.colorfull = RGB (255,255,170)
  1736.                     l56b.color = RGB (255,255,0):f19b.color = RGB (255,255,0)
  1737.     'Magenta
  1738.         Case 4 :    l56a.color = RGB (255,0,255):l56a.colorfull = RGB (255,170,255)
  1739.                     l56b.color = RGB (255,0,255):f19b.color = RGB (255,0,255)
  1740.     'Cyan
  1741.         Case 5 :    l56a.color = RGB (0,255,255):l56a.colorfull = RGB (170,255,255)
  1742.                     l56b.color = RGB (0,255,255):f19b.color = RGB (0,255,255)      
  1743. End Select
  1744.  
  1745. Select Case LampMod
  1746.         Case 0 :    TopPFLamp.visible=1
  1747.                     TopPFLampMod.visible=0
  1748.                     light46.visible=0
  1749.                     light47.visible=0
  1750.         Case 1 :    TopPFLamp.visible=0
  1751.                     TopPFLampMod.visible=1
  1752.                     light46.visible=1
  1753.                     light47.visible=1
  1754.         Case 2 :    TopPFLamp.visible=0
  1755.                     TopPFLampMod.visible=1
  1756.                     TopPFLampMod.image="gold"
  1757.                     light46.visible=1
  1758.                     light47.visible=1
  1759. End Select
  1760.  
  1761. If LampLightColor = 1 then
  1762.                     light68.color = RGB (0,0,255):light68.colorfull = RGB (85,85,255)
  1763.                     light19.color = RGB (0,0,255):light19.colorfull = RGB (85,85,255)
  1764.                     light17.color = RGB (0,0,255):light17.colorfull = RGB (85,85,255)
  1765.                     light44.color = RGB (0,0,255):light44.colorfull = RGB (85,85,255)
  1766.                     light45.color = RGB (0,0,255):light45.colorfull = RGB (85,85,255)
  1767.                     light46.color = RGB (0,0,255)
  1768.                     light47.color = RGB (0,0,255)
  1769.                     light48.color = RGB (0,0,255):light45.colorfull = RGB (85,85,255)
  1770. End If
  1771.  
  1772. Sub swSlotReel_Hit:SlotReelTimer.enabled = 1:End Sub
  1773.  
  1774. Sub SlotReelTimer_Timer()
  1775.     SlotPic = SlotPic + 1
  1776.     if SlotPic > 10 Then SlotReelTimer.enabled = 0:ResetSlot.enabled = 1
  1777.     SlotReel.imageA = "slot_" & SlotPic
  1778. End Sub
  1779.  
  1780. Sub ResetSlot_Timer()
  1781.     SlotReel.imageA = "slot_10":vpmtimer.addtimer 150, "SlotReel.imageA = ""slot_0"" '":SlotPic = 0
  1782.     If SlotPic = 0 then ResetSlot.enabled = 0
  1783. End Sub
  1784.  
  1785. Sub TVTimer_Timer()
  1786.     TVPic = TVPic + 1
  1787.     if TVPic = 34 Then TVPic = 2
  1788.     Frame.imageA = "tv_" & TVPic
  1789. End Sub
  1790.  
  1791. Sub SpiralMove_Timer()
  1792.     SpiralToy.rotz = SpiralToy.rotz + 10
  1793. End Sub
  1794.  
  1795. Select Case BumperPostsMod
  1796.         Case 0:     PegPlastic7.visible = 1
  1797.                     PegPlastic8.visible = 1
  1798.                     Rubber9.visible = 1
  1799.                     Rubber29.visible = 1
  1800.                     Rubber9.collidable = 1
  1801.                     Rubber29.collidable = 1
  1802.         Case 1:     PegPlastic7.visible = 0
  1803.                     PegPlastic8.visible = 0
  1804.                     Rubber9.visible = 0
  1805.                     Rubber29.visible = 0
  1806.                     Rubber9.collidable = 0
  1807.                     Rubber29.collidable = 0
  1808. End Select
  1809.  
  1810.  
  1811. Sub RGBTimer_timer 'rainbow light color changing
  1812.    Select Case RGBStep
  1813.         Case 0 'Green
  1814.            Green = Green + RGBFactor
  1815.             If Green > 255 then
  1816.                 Green = 255
  1817.                 RGBStep = 1
  1818.                 led1.state=0
  1819.                 led2.state=0
  1820.             End If
  1821.         Case 1 'Red
  1822.            Red = Red - RGBFactor
  1823.             If Red < 0 then
  1824.                 Red = 0
  1825.                 RGBStep = 2
  1826.                 led1.state=1
  1827.                 led2.state=1
  1828.             End If
  1829.         Case 2 'Blue
  1830.            Blue = Blue + RGBFactor
  1831.             If Blue > 255 then
  1832.                 Blue = 255
  1833.                 RGBStep = 3
  1834.                 led1.state=0
  1835.                 led2.state=0
  1836.             End If
  1837.         Case 3 'Green
  1838.            Green = Green - RGBFactor
  1839.             If Green < 0 then
  1840.                 Green = 0
  1841.                 RGBStep = 4
  1842.                 led1.state=1
  1843.                 led2.state=1
  1844.             End If
  1845.         Case 4 'Red
  1846.            Red = Red + RGBFactor
  1847.             If Red > 255 then
  1848.                 Red = 255
  1849.                 RGBStep = 5
  1850.                 led1.state=0
  1851.                 led2.state=0
  1852.             End If
  1853.         Case 5 'Blue
  1854.            Blue = Blue - RGBFactor
  1855.             If Blue < 0 then
  1856.                 Blue = 0
  1857.                 RGBStep = 0
  1858.                 led1.state=1
  1859.                 led2.state=1
  1860.             End If
  1861.     End Select
  1862.     'RGBLed.color = RGB(Red\10, Green\10, Blue\10)
  1863.    RGBLed.colorfull = RGB(Red, Green, Blue)
  1864.     RGBLed1.colorfull = RGB(Red, Green, Blue)
  1865.     RGBLed2.colorfull = RGB(Red, Green, Blue)
  1866.     RGBLed3.colorfull = RGB(Red, Green, Blue)
  1867.     RGBLed4.colorfull = RGB(Red, Green, Blue)
  1868.     RGBLed5.colorfull = RGB(Red, Green, Blue)
  1869.     RGBLed6.colorfull = RGB(Red, Green, Blue)
  1870.     RGBLed7.colorfull = RGB(Red, Green, Blue)
  1871.     RGBLed8.colorfull = RGB(Red, Green, Blue)
  1872.     RGBLed9.colorfull = RGB(Red, Green, Blue)
  1873.     RGBLed10.colorfull = RGB(Red, Green, Blue)
  1874. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement