Arngrim

mustang le DOF

Nov 23rd, 2016
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.92 KB | None | 0 0
  1. Option Explicit
  2. Randomize
  3.  
  4. On Error Resume Next
  5. ExecuteGlobal GetTextFile("controller.vbs")
  6. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  7. On Error Goto 0
  8.  
  9. Const Inteceptor = 0 'Replace yellow Showroom Car with Mad Max Inteceptor
  10. Const Flasher_Halos = 1 'Rendber Halos around flashers.
  11. Const Tacho_Mod = 1 'Render spinner activated tacho on right ramp.
  12. Const Erratic_Scoop = 1 'Make the Mustang scoop / saucer behave more organically.
  13. Const Car_Color = 9 'Turntable car color (Select from list below)
  14.  
  15. '1 Light Blue
  16. '2 Dark Blue
  17. '3 White
  18. '4 Green
  19. '5 Orange
  20. '6 Randr
  21. '7 Red
  22. '8 Purple
  23. '9 Yellow
  24.  
  25. If Car_Color = 1 Then
  26. Primitive3.image = "blue1"
  27. End If
  28.  
  29. If Car_Color = 2 Then
  30. Primitive3.image = "blue2"
  31. End If
  32.  
  33. If Car_Color = 3 Then
  34. Primitive3.image = "diamond_white"
  35. End If
  36.  
  37. If Car_Color = 4 Then
  38. Primitive3.image = "green"
  39. End If
  40.  
  41. If Car_Color = 5 Then
  42. Primitive3.image = "orange"
  43. End If
  44.  
  45. If Car_Color = 6 Then
  46. Primitive3.image = "randrs_car"
  47. End If
  48.  
  49. If Car_Color = 7 Then
  50. Primitive3.image = "red"
  51. End If
  52.  
  53. If Car_Color = 8 Then
  54. Primitive3.image = "purple"
  55. End If
  56.  
  57. If Car_Color = 9 Then
  58. Primitive3.image = "yellow2"
  59. End If
  60.  
  61. Dim VarHidden, UseVPMDMD
  62.  
  63. If Table.ShowDT = true then
  64. L104.bulbhaloheight = 260
  65. L104a.bulbhaloheight = 260
  66. L103.bulbhaloheight = 186
  67. L103a.bulbhaloheight = 186
  68. L101.bulbhaloheight = 258
  69. L101a.bulbhaloheight = 258
  70. L102.bulbhaloheight = 280
  71. L102a.bulbhaloheight = 280
  72. L107.bulbhaloheight = 250
  73. L107a.bulbhaloheight = 250
  74. L106.bulbhaloheight = 270
  75. L106a.bulbhaloheight = 270
  76. L105.bulbhaloheight = 250
  77. L105a.bulbhaloheight = 250
  78. xm.bulbhaloheight = 250
  79. xu.bulbhaloheight = 250
  80. xs.bulbhaloheight = 250
  81. xt.bulbhaloheight = 250
  82. xa.bulbhaloheight = 250
  83. xn.bulbhaloheight = 250
  84. xg.bulbhaloheight = 250
  85. Ramp16.visible = 1
  86. Ramp15.visible = 1
  87. UseVPMDMD = True
  88. VarHidden = 1
  89. else
  90. UseVPMDMD = False
  91. VarHidden = 0
  92. Ramp16.visible = 0
  93. Ramp15.visible = 0
  94. End If
  95.  
  96. Const UseVPMModSol = 1
  97.  
  98. LoadVPM "01560000", "sam.VBS", 3.10
  99.  
  100. '********************
  101. 'Standard definitions
  102. '********************
  103. 'Const B2SOn = 1
  104.  
  105. Const cGameName = "mt_145h" 'change the romname here
  106.  
  107. Const UseSolenoids = 1
  108. Const UseLamps = 0
  109. Const UseSync = 0
  110. Const HandleMech = 0
  111.  
  112. 'Standard Sounds
  113. Const SSolenoidOn = "Solenoid"
  114. Const SSolenoidOff = ""
  115. Const SCoin = "CoinIn"
  116.  
  117. '************
  118. ' Table init.
  119. '************
  120. 'Variables
  121. Dim xx, x
  122. Dim Bump1, Bump2, Bump3, Bump4, Mech3bank,bsTrough,bsRHole,DTBank5,turntable, cbRight, XTurn, mspinmagnet
  123. Dim PlungerIM, B2SOn
  124.  
  125. Sub Table_Init
  126. With Controller
  127. vpmInit Me
  128. .GameName = cGameName
  129. If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
  130. .SplashInfoLine = "Mustang (Stern 2014)"
  131. .HandleKeyboard = 0
  132. .ShowTitle = 0
  133. .ShowDMDOnly = 1
  134. .ShowFrame = 0
  135. .HandleMechanics = 1
  136. .Hidden = VarHidden
  137. On Error Resume Next
  138. .Run GetPlayerHWnd
  139. If Err Then MsgBox Err.Description
  140. End With
  141.  
  142. On Error Goto 0
  143.  
  144.  
  145. '**Trough
  146. Set bsTrough = New cvpmBallStack
  147. bsTrough.InitSw 0, 23, 22, 21, 20, 19, 18, 0
  148. bsTrough.InitKick BallRelease, 90, 8
  149. bsTrough.InitExitSnd SoundFX("ballrelease",DOFContactors), SoundFX("Solenoid",DOFContactors)
  150. bsTrough.Balls = 6
  151.  
  152. '***Right Hole bsRHole
  153. 'Set bsRHole = New cvpmBallStack
  154. 'With bsRHole
  155. ' .InitSw 0, 43, 0, 0, 0, 0, 0, 0
  156. ' .InitKick sw43, 185, 20
  157. ' .KickZ = 0.4
  158. ' .InitExitSnd "scoopexit", "Solenoid"
  159. ' .KickForceVar = 2
  160. 'End With
  161.  
  162. Set bsRHole = New cvpmBallStack
  163. With bsRHole
  164. .InitSaucer sw43, 43, 185, 20
  165. .KickZ = 0.4
  166. .InitExitSnd SoundFX("fx_solenoid",DOFContactors), SoundFX("Solenoid",DOFContactors)
  167. .KickForceVar = 2
  168. End With
  169.  
  170. Set cbRight = New cvpmCaptiveBall
  171. With cbRight
  172. .InitCaptive RCaptTrigger, RCaptWall, Array(RCaptKicker1, RCaptKicker1a), 10
  173. .RestSwitch = 9
  174. .NailedBalls = 1
  175. .ForceTrans = 1
  176. .MinForce = 7
  177. .Start
  178. End With
  179. RCaptKicker1.CreateBall
  180.  
  181. Set mSpinMagnet = New cvpmMagnet
  182. With mSpinMagnet
  183. .InitMagnet SpinMagnet, 20
  184. '.Solenoid = 35 'own solenoid sub
  185. .GrabCenter = 0
  186. .Size = 100
  187. .CreateEvents "mSpinMagnet"
  188. End With
  189.  
  190.  
  191. '**Nudging
  192. vpmNudge.TiltSwitch=-7
  193. vpmNudge.Sensitivity=1
  194. vpmNudge.TiltObj=Array(Bumper1,Bumper2,Bumper3,Bumper4,LeftSlingshot,RightSlingshot)
  195.  
  196. 'DropTargets
  197.  
  198. '**Main Timer init
  199. PinMAMETimer.Interval = PinMAMEInterval
  200. PinMAMETimer.Enabled = 1
  201.  
  202. 'Slings
  203. For each xx in RhammerA:xx.IsDropped=1:Next
  204. For each xx in RhammerB:xx.IsDropped=1:Next
  205. For each xx in RhammerC:xx.IsDropped=1:Next
  206. For each xx in LhammerA:xx.IsDropped=1:Next
  207. For each xx in LhammerB:xx.IsDropped=1:Next
  208. For each xx in LhammerC:xx.IsDropped=1:Next
  209.  
  210. 'DropTargets
  211. Set DTBank5 = New cvpmDropTarget
  212. With DTBank5
  213. .InitDrop Array(sw34,sw35,sw36,sw37,sw38), Array(34,35,36,37,38)
  214. .InitSnd SoundFX("DTL",DOFDropTargets), SoundFX("DTResetL",DOFContactors)
  215. End With
  216.  
  217. 'Rollovers
  218.  
  219. 'StandUp Init
  220. sw1a.IsDropped=1
  221. sw2a.IsDropped=1
  222. sw3a.IsDropped=1
  223. sw4a.IsDropped=1
  224. sw5a.IsDropped=1
  225. sw41a.IsDropped=1
  226. sw42a.IsDropped=1
  227. sw54a.IsDropped=1
  228. sw55a.IsDropped=1
  229.  
  230. 'Gi_On
  231. Plunger1.Pullback
  232. 'mSpinMagnet.MagnetOn = True
  233.  
  234. If erratic_scoop = 1 Then
  235. sw43.enabled = 0
  236. Else
  237. sw43.enabled = 1
  238. End If
  239.  
  240. End Sub
  241.  
  242. Sub Table_Paused:Controller.Pause = 1:End Sub
  243. Sub Table_unPaused:Controller.Pause = 0:End Sub
  244.  
  245.  
  246. '*****Keys
  247. Sub Table_KeyDown(ByVal keycode)
  248. If KeyCode = MechanicalTilt Then
  249. vpmTimer.PulseSw vpmNudge.TiltSwitch
  250. Exit Sub
  251. End if
  252. If Keycode = StartGameKey Then Controller.Switch(16) = 1
  253. If Keycode = 3 Then Controller.Switch(15) = 1
  254. If Keycode = RightMagnasave Then Controller.Switch(71) = 1
  255. If Keycode = LeftFlipperKey then
  256. End If
  257. If Keycode = RightFlipperKey then
  258. End If
  259. If keycode = PlungerKey Then Plunger.Pullback
  260. 'If keycode = LeftTiltKey Then LeftNudge 80, 1, 20
  261. 'If keycode = RightTiltKey Then RightNudge 280, 1, 20
  262. 'If keycode = CenterTiltKey Then CenterNudge 0, 1, 25
  263. 'If keycode = 3 Then msgbox Disc2.ObjRotZ
  264. If vpmKeyDown(keycode) Then Exit Sub
  265.  
  266. End Sub
  267.  
  268. Sub Table_KeyUp(ByVal keycode)
  269. If Keycode = RightMagnasave Then Controller.Switch(71) = 0
  270. If Keycode = 3 Then Controller.Switch(15) = 0
  271. If Keycode = StartGameKey Then Controller.Switch(16) = 0':GridTargetReset 'Moved before vpmkey
  272. If vpmKeyUp(keycode) Then Exit Sub
  273. If Keycode = LeftFlipperKey then
  274. SolLFlipper false
  275. End If
  276. If Keycode = RightFlipperKey then
  277. SolRFlipper False
  278. End If
  279. If keycode = PlungerKey Then
  280. Plunger.Fire
  281. PlaySound "Plunger2"
  282. End If
  283. End Sub
  284.  
  285.  
  286. 'Solenoids
  287. SolCallback(1) = "solTrough"
  288. SolCallback(2) = "solAutofire"
  289. SolCallback(3) = "lower_ramp"
  290. SolCallback(4) = "lower_hold"
  291. SolCallback(5) = "upper_ramp"
  292. SolCallback(6) = "upper_hold"
  293. SolCallback(7) = "Reset_Drops"
  294. 'SolCallback(8) = shaker
  295. 'SolCallback(9) = l pop
  296. 'SolCallback(10) = r pop
  297. 'SolCallback(11) = B pop
  298. 'SolCallback(12) = T pop
  299. 'SolCallback(13) = l sling
  300. 'SolCallback(14) = r sling
  301. SolCallback(15) = "SolLFlipper"
  302. SolCallback(16) = "SolRFlipper"
  303. SolCallback(22) = "Ttable"
  304. SolModCallback(17) = "Flash17"
  305. SolModCallback(18) = "Flash18"
  306. SolModCallback(19) = "Flash19"
  307. SolModCallback(20) = "Flash20"
  308. SolModCallback(21) = "Flash21"
  309. SolModCallback(23) = "Flash23"
  310. SolModCallback(25) = "Flash25"
  311. SolModCallback(26) = "Flash26"
  312. SolModCallback(27) = "Flash27"
  313. SolCallback(28) = "Flash28"
  314. SolModCallback(29) = "Flash29"
  315. SolCallback(30) = "Flash30"
  316. SolCallback(51) = "Left_Orbit_Gate"
  317. SolCallback(52) = "Right_Orbit_Gate"
  318. SolCallback(56) = "LHDTD"
  319. SolCallback(55) = "LHDTU"
  320. SolCallback(54) = "RHDTD"
  321. SolCallback(53) = "RHDTU"
  322. SolCallback(59) = "Kicker_Out"
  323. SolCallback(60) = "Ramp_Div"
  324.  
  325. If Inteceptor = 1 Then
  326. Primitive3.visible = 0
  327. Primitive53.visible = 1
  328. else
  329. Primitive3.visible = 1
  330. Primitive53.visible = 0
  331. End If
  332.  
  333. Dim dtff
  334.  
  335. If Flasher_Halos = 1 Then
  336. For each dtff in Flashers:dtff.visible = 1:next
  337. else
  338. For each dtff in Flashers:dtff.visible = 0:next
  339. End If
  340.  
  341. If Tacho_Mod = 1 Then
  342. Disc4.visible = 1
  343. Disc2.visible = 1
  344. Disc3.visible = 1
  345. Tacho_Bod.visible = 1
  346. else
  347. Disc4.visible = 0
  348. Disc2.visible = 0
  349. Disc3.visible = 0
  350. Tacho_Bod.visible = 0
  351. End If
  352.  
  353. Sub Wall261_Hit()
  354. If erratic_scoop = 1 Then
  355. mSpinMagnet.MagnetOn = True
  356. shopstep = 1 : shoph.enabled = 1
  357. End If
  358. End Sub
  359.  
  360. 'Sub Wall19_Hit()
  361. 'mSpinMagnet.MagnetOn = True
  362. 'shopstep = 1 : shoph.enabled = 1
  363. 'End Sub
  364.  
  365. 'Sub Wall18_Hit()
  366. 'mSpinMagnet.MagnetOn = True
  367. 'shopstep = 1 : shoph.enabled = 1
  368. 'End Sub
  369.  
  370. Dim shopstep
  371.  
  372. Sub shoph_Timer()
  373. Select Case shopstep
  374. Case 1:
  375. mSpinMagnet.MagnetOn = False
  376. sw43.enabled = 1
  377. shopstep = 2
  378. Case 2:
  379. me.enabled = 0
  380. End Select
  381. End Sub
  382.  
  383. Sub Reset_Drops(Enabled)
  384. If enabled Then
  385. DTBank5.DropSol_On
  386. End If
  387. End Sub
  388.  
  389. Sub LHDTD(Enabled)
  390. If enabled Then
  391. LHDT.isdropped = 1
  392. LHDTW.isdropped = 1
  393. LHDTW1.isdropped = 1
  394. PlaySound SoundFX("dtresetl",DOFContactors)
  395. LHDBU.enabled = 1
  396. Controller.Switch(57) = 1
  397. End If
  398. End Sub
  399.  
  400. Sub LHDBU_Timer()
  401. If LHDT.isdropped = 0 Then
  402. LHDT.isdropped = 1
  403. End If
  404. me.enabled = 0
  405. End Sub
  406.  
  407. Sub LHDTU(Enabled)
  408. If enabled Then
  409. LHDT.isdropped = 0
  410. LHDTW.isdropped = 0
  411. LHDTW1.isdropped = 0
  412. PlaySound SoundFX("dtresetl",DOFContactors)
  413. Controller.Switch(57) = 0
  414. End If
  415. End Sub
  416.  
  417. Sub RHDTD(Enabled)
  418. If enabled Then
  419. XRHDT.isdropped = 1
  420. XRHDTW.isdropped = 1
  421. XRHDTW1.isdropped = 1
  422. PlaySound SoundFX("dtresetr",DOFContactors)
  423. RHDBU.enabled = 1
  424. Controller.Switch(56) = 1
  425. End If
  426. End Sub
  427.  
  428. Sub RHDBU_Timer()
  429. If XRHDT.isdropped = 0 Then
  430. XRHDT.isdropped = 1
  431. End If
  432. me.enabled = 0
  433. End Sub
  434.  
  435. Sub RHDTU(Enabled)
  436. If enabled Then
  437. XRHDT.isdropped = 0
  438. XRHDTW.isdropped = 0
  439. XRHDTW1.isdropped = 0
  440. PlaySound SoundFX("dtresetr",DOFContactors)
  441. Controller.Switch(56) = 0
  442. End If
  443. End Sub
  444.  
  445.  
  446. Sub Ramp_Div(Enabled)
  447. If enabled Then
  448. DivKick1.enabled = 1
  449. PlaySound SoundFX("diverter",DOFContactors)
  450. else
  451. DivKick1.enabled = 0
  452. PlaySound SoundFX("diverter",DOFContactors)
  453. End If
  454. End Sub
  455.  
  456. Sub Flash29(Enabled)
  457. F29.Intensity = Enabled / 20
  458. F29a.Intensity = Enabled / 20
  459. F29b.Intensity = Enabled / 20
  460. End Sub
  461.  
  462. Sub Flash19(Enabled)
  463. F19.Intensity = Enabled / 5
  464. F19a.Intensity = Enabled / 5
  465. F19b.Intensity = Enabled / 60
  466. F19c.Intensity = Enabled / 60
  467. F19F.Opacity = Enabled * 1.5
  468. F19F1.Opacity = Enabled * 1.5
  469. End Sub
  470.  
  471. Sub Flash20(Enabled)
  472. F20.Intensity = Enabled / 5
  473. F20a.Intensity = Enabled / 5
  474. F20b.Intensity = Enabled / 60
  475. F20c.Intensity = Enabled / 60
  476. F20F.Opacity = Enabled * 1.5
  477. F20F1.Opacity = Enabled * 1.5
  478. End Sub
  479.  
  480. Sub Flash28(Enabled)
  481. If enabled Then
  482. F28.State = 1
  483. F28a.State = 1
  484. F28b.State = 1
  485. F28c.State = 1
  486. else
  487. F28.State = 0
  488. F28a.State = 0
  489. F28b.State = 0
  490. F28c.State = 0
  491. End If
  492. End Sub
  493.  
  494. Sub Flash25(Enabled)
  495. F25.Intensity = Enabled / 10
  496. F25a.Intensity = Enabled / 10
  497. End Sub
  498.  
  499. Sub Flash26(Enabled)
  500. F26.Intensity = Enabled / 10
  501. F26a.Intensity = Enabled / 10
  502. End Sub
  503.  
  504. Sub Flash23(Enabled)
  505. F23Flash1.Opacity = Enabled * 1.5
  506. F23Flash2.Opacity = Enabled * 1.5
  507. F23.Intensity = Enabled / 30
  508. F23a.Intensity = Enabled / 10
  509. F23b.Intensity = Enabled / 10
  510. F23c.Intensity = Enabled / 50
  511. F23d.Intensity = Enabled / 10
  512. End Sub
  513.  
  514. Sub Flash21(Enabled)
  515. F21Flash2.Opacity = Enabled * 1.5
  516. F21F2.Opacity = Enabled * 1.5
  517. Fl21.Opacity = Enabled * 1.5
  518. F21.Intensity = Enabled / 30
  519. F21a.Intensity = Enabled / 10
  520. F21b.Intensity = Enabled / 10
  521. F21c.Intensity = Enabled / 50
  522. F21d.Intensity = Enabled / 10
  523. End Sub
  524.  
  525. Sub Flash17(Enabled)
  526. F17.Intensity = Enabled / 10
  527. F17a.Intensity = Enabled / 10
  528. End Sub
  529.  
  530. Sub Flash18(Enabled)
  531. F18.Intensity = Enabled / 10
  532. F18a.Intensity = Enabled / 10
  533. End Sub
  534.  
  535. Sub Flash27(Enabled)
  536. F27.Intensity = Enabled / 10
  537. F27a.Intensity = Enabled / 10
  538. End Sub
  539.  
  540. Sub Flash30(Enabled)
  541. If Enabled Then
  542. F30.State = 1
  543. F30a.State = 1
  544. else
  545. F30.State = 0
  546. F30a.State = 0
  547. End If
  548. End Sub
  549.  
  550. Sub Left_Orbit_Gate(Enabled)
  551. If enabled Then
  552. Lorbit.open = 1
  553. PlaySound SoundFX("dtl",DOFContactors)
  554. else
  555. Lorbit.open = 0
  556. End If
  557. End Sub
  558.  
  559. Sub Right_Orbit_Gate(Enabled)
  560. If enabled Then
  561. Rorbit.open = 1
  562. PlaySound SoundFX("dtr",DOFContactors)
  563. else
  564. Rorbit.open = 0
  565. End If
  566. End Sub
  567.  
  568. Sub Kicker_Out(Enabled)
  569. If enabled Then
  570. BsRHole.ExitSol_On
  571. If Erratic_Scoop = 1 Then
  572. sw43.enabled = 0
  573. End If
  574. End If
  575. End Sub
  576.  
  577. Sub upper_ramp(Enabled)
  578. If Enabled Then
  579. PlaySound SoundFX("dtl",DOFContactors)
  580. End If
  581. End Sub
  582.  
  583. Sub upper_hold(Enabled)
  584. If enabled Then
  585.  
  586. trpos = 2
  587. top_ramp.enabled = 1
  588. topramp5.collidable = 1
  589.  
  590.  
  591. else
  592. trpos = 1
  593. top_ramp.enabled = 1
  594. topramp5.collidable = 0
  595. PlaySound SoundFX("dtl",DOFContactors)
  596. End If
  597. End Sub
  598.  
  599. Sub lower_ramp(Enabled)
  600. If Enabled Then
  601. PlaySound SoundFX("dtl",DOFContactors)
  602. End If
  603. End Sub
  604.  
  605. Sub lower_hold(Enabled)
  606. If Enabled Then
  607.  
  608. brpos = 2
  609. bottom_ramp.enabled = 1
  610. BotRamp2.collidable = 1
  611. else
  612. brpos = 1
  613. bottom_ramp.enabled = 1
  614. BotRamp2.collidable = 0
  615. PlaySound SoundFX("dtl",DOFContactors)
  616. End If
  617. End Sub
  618.  
  619. Dim brpos
  620. brpos = 0
  621.  
  622. Sub Bottom_Ramp_Timer()
  623. Select Case brpos
  624. Case 1:
  625. If BotRamp.heightbottom => 60 Then
  626. BotRamp.heightbottom = 60
  627. me.enabled = 0
  628. End If
  629. BotRamp.heightbottom = BotRamp.heightbottom + 1
  630. BotRamp_Cover.heightbottom = BotRamp_Cover.heightbottom + 1.5
  631. BotRamp_Cover.heighttop = BotRamp_Cover.heighttop + 1
  632. Case 2:
  633. If BotRamp.heightbottom <= 0 Then
  634. BotRamp.heightbottom = 0
  635. me.enabled = 0
  636. End If
  637. BotRamp.heightbottom = BotRamp.heightbottom - 1
  638. BotRamp_Cover.heightbottom = BotRamp_Cover.heightbottom - 1.5
  639. BotRamp_Cover.heighttop = BotRamp_Cover.heighttop - 1
  640. Case 3:
  641. End Select
  642. End Sub
  643.  
  644. Dim trpos
  645. trpos = 0
  646.  
  647. Sub Top_Ramp_Timer()
  648. Select Case trpos
  649. Case 1:
  650. If topRamp.heightbottom => 120 Then
  651. topRamp.heightbottom = 120
  652. topRamp2.collidable = 1
  653. Controller.Switch(50) = 1
  654. me.enabled = 0
  655. End If
  656. topRamp.heightbottom = topRamp.heightbottom + 1
  657. topRamp_Cover.heightbottom = topRamp_Cover.heightbottom + 1
  658. topRamp_Cover.heighttop = topRamp_Cover.heighttop + 0.5
  659. Case 2:
  660. If topRamp.heightbottom <= 60 Then
  661. topRamp.heightbottom = 60
  662. topRamp2.collidable = 0
  663. Controller.Switch(50) = 0
  664. me.enabled = 0
  665. End If
  666. topRamp.heightbottom = topRamp.heightbottom - 1
  667. topRamp_Cover.heightbottom = topRamp_Cover.heightbottom - 1
  668. topRamp_Cover.heighttop = topRamp_Cover.heighttop - 0.5
  669. End Select
  670. End Sub
  671.  
  672. 'Flashers
  673.  
  674.  
  675. Sub solTrough(Enabled)
  676. If Enabled Then
  677. bsTrough.ExitSol_On
  678. vpmTimer.PulseSw 22
  679. End If
  680. End Sub
  681.  
  682. Sub solAutofire(Enabled)
  683. If Enabled Then
  684. 'PlungerIM.AutoFire
  685. Plunger1.Fire
  686. Else
  687. Plunger1.Pullback
  688. End If
  689. End Sub
  690.  
  691.  
  692. ' Captive Ball Right
  693. Sub RCaptTrigger_Hit:cbRight.TrigHit ActiveBall:End Sub
  694. Sub RCaptTrigger_UnHit:cbRight.TrigHit 0:End Sub
  695. Sub RCaptWall_Hit:PlaySound "collide0":cbRight.BallHit ActiveBall:End Sub
  696. Sub RCaptKicker1a_Hit:cbRight.BallReturn Me:End Sub
  697.  
  698. '***********************************************
  699.  
  700. '******************************************
  701. ' Use FlipperTimers to call div subs
  702. '******************************************
  703.  
  704. Dim LFTCount:LFTCount=1
  705.  
  706. Sub LeftFlipperTimer_Timer()
  707. If LFTCount < 6 Then
  708. LFTCount = LFTCount + 1
  709. LeftFlipper.Strength = StartLeftFlipperStrength*(LFTCount/6)
  710. Else
  711. Me.Enabled=0
  712. End If
  713. End Sub
  714.  
  715. Dim RFTCount:RFTCount=1
  716.  
  717. Sub RightFlipperTimer_Timer()
  718. If RFTCount < 6 Then
  719. RFTCount = RFTCount + 1
  720. RightFlipper.Strength = StartRightFlipperStrength*(RFTCount/6)
  721. Else
  722. Me.Enabled=0
  723. End If
  724. End Sub
  725.  
  726.  
  727. Sub SolLFlipper(Enabled)
  728. If Enabled Then
  729. PlaySound SoundFX("flipperup",DOFFlippers)
  730. LeftFlipper.RotateToEnd:
  731. Else
  732. LFTCount=1
  733. PlaySound SoundFX("flipperdown",DOFFlippers)
  734. LeftFlipper.RotateToStart
  735. End If
  736. End Sub
  737.  
  738. Sub SolRFlipper(Enabled)
  739. If Enabled Then
  740. PlaySound SoundFX("flipperup",DOFFlippers)
  741. RightFlipper.RotateToEnd
  742. Else
  743. RFTCount=1
  744. PlaySound SoundFX("flipperdown",DOFFlippers)
  745. RightFlipper.RotateToStart
  746. End If
  747. End Sub
  748.  
  749. 'Drains and Kickers
  750. Sub Drain_Hit():PlaySound "Drain":bsTrough.AddBall Me
  751. End Sub
  752.  
  753. Sub orbitpost(Enabled)
  754. If Enabled Then
  755. UpPost.Isdropped=false
  756. UpPost2.Isdropped=false
  757. Else
  758. UpPost.Isdropped=true
  759. UpPost2.Isdropped=true
  760. End If
  761. End Sub
  762.  
  763.  
  764. 'Switches
  765.  
  766. Sub sw1_Hit:sw1.IsDropped = 1:sw1a.IsDropped = 0:Me.TimerEnabled = 1:vpmTimer.PulseSw 1:PlaySound SoundFX("target",DOFTargets):End Sub
  767. Sub sw1_Timer:sw1.IsDropped = 0:sw1a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
  768. Sub sw2_Hit:sw2.IsDropped = 1:sw2a.IsDropped = 0:Me.TimerEnabled = 1:vpmTimer.PulseSw 2:PlaySound SoundFX("target",DOFTargets):End Sub
  769. Sub sw2_Timer:sw2.IsDropped = 0:sw2a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
  770. Sub sw3_Hit:sw3.IsDropped = 1:sw3a.IsDropped = 0:Me.TimerEnabled = 1:vpmTimer.PulseSw 3:PlaySound SoundFX("target",DOFTargets):End Sub
  771. Sub sw3_Timer:sw3.IsDropped = 0:sw3a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
  772. Sub sw4_Hit:sw4.IsDropped = 1:sw4a.IsDropped = 0:Me.TimerEnabled = 1:vpmTimer.PulseSw 4:PlaySound SoundFX("target",DOFTargets):End Sub
  773. Sub sw4_Timer:sw4.IsDropped = 0:sw4a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
  774. Sub sw5_Hit:sw5.IsDropped = 1:sw5a.IsDropped = 0:Me.TimerEnabled = 1:vpmTimer.PulseSw 5:PlaySound SoundFX("target",DOFTargets):End Sub
  775. Sub sw5_Timer:sw5.IsDropped = 0:sw5a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
  776. Sub sw8_Hit:Controller.Switch(8) = 1:PlaySound "rollover":End Sub
  777. Sub sw8_UnHit:Controller.Switch(8) = 0:End Sub
  778. 'sw9 captive ball front
  779. Sub sw10_Hit:Controller.Switch(10)=1:End Sub
  780. Sub sw10_unHit:Controller.Switch(10)=0:End Sub
  781. Sub sw11_Hit:la11.IsDropped = 1:Controller.Switch(11) = 1:PlaySound "rollover":End Sub
  782. Sub sw11_UnHit:la11.IsDropped = 0:Controller.Switch(11) = 0:End Sub
  783. Sub sw12_Hit:la12.IsDropped = 1:Controller.Switch(12) = 1:PlaySound "rollover":End Sub
  784. Sub sw12_UnHit:la12.IsDropped = 0:Controller.Switch(12) = 0:End Sub
  785. Sub sw13_Hit:la13.IsDropped = 1:Controller.Switch(13) = 1:PlaySound "rollover":End Sub
  786. Sub sw13_UnHit:la13.IsDropped = 0:Controller.Switch(13) = 0:End Sub
  787. Sub sw14_Hit:la14.IsDropped = 1:Controller.Switch(14) = 1:PlaySound "rollover":End Sub
  788. Sub sw14_UnHit:la14.IsDropped = 0:Controller.Switch(14) = 0:End Sub
  789. Sub sw24_Hit:la24.IsDropped = 1:Controller.Switch(24) = 1:PlaySound "rollover":End Sub
  790. Sub sw24_UnHit:la24.IsDropped = 0:Controller.Switch(24) = 0:End Sub
  791. Sub sw25_Hit:la25.IsDropped = 1:Controller.Switch(25) = 1:PlaySound "rollover":End Sub
  792. Sub sw25_UnHit:la25.IsDropped = 0:Controller.Switch(25) = 0:End Sub
  793. Sub sw28_Hit:la28.IsDropped = 1:Controller.Switch(28) = 1:PlaySound "rollover":End Sub
  794. Sub sw28_UnHit:la28.IsDropped = 0:Controller.Switch(28) = 0:End Sub
  795. Sub sw29_Hit:la29.IsDropped = 1:Controller.Switch(29) = 1:PlaySound "rollover":End Sub
  796. Sub sw29_UnHit:la29.IsDropped = 0:Controller.Switch(29) = 0:End Sub
  797. Sub sw34_Hit:DTBank5.Hit 1:End Sub'Light54.State = 1:End Sub
  798. Sub sw35_Hit:DTBank5.Hit 2:End Sub'Light53.State = 1:End Sub
  799. Sub sw36_Hit:DTBank5.Hit 3:End Sub'Light51.State = 1:End Sub
  800. Sub sw37_Hit:DTBank5.Hit 4:End Sub'Light50.State = 1:End Sub
  801. Sub sw38_Hit:DTBank5.Hit 5:End Sub'Light52.State = 1:End Sub
  802. Sub sw39_Hit:Controller.Switch(39) = 1:PlaySound "subway2":End Sub'Gi_Off:Gi_BO.enabled = 1:End Sub
  803. Sub sw39_UnHit:Controller.Switch(39) = 0:End Sub
  804. Sub sw40_Hit:Controller.Switch(40) = 1:PlaySound "subway2":End Sub'Gi_Off:Gi_BO.enabled = 1:End Sub
  805. Sub sw40_UnHit:Controller.Switch(40) = 0:End Sub
  806. Sub sw41_Hit:sw41.IsDropped = 1:sw41a.IsDropped = 0:Me.TimerEnabled = 1:vpmTimer.PulseSw 41:PlaySound SoundFX("target",DOFTargets):End Sub
  807. Sub sw41_Timer:sw41.IsDropped = 0:sw41a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
  808. Sub sw42_Hit:sw42.IsDropped = 1:sw42a.IsDropped = 0:Me.TimerEnabled = 1:vpmTimer.PulseSw 42:PlaySound SoundFX("target",DOFTargets):End Sub
  809. Sub sw42_Timer:sw42.IsDropped = 0:sw42a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
  810. Sub sw44_Hit:Controller.Switch(44)=1:PlaySound "rollover":End Sub
  811. Sub sw44_unHit:Controller.Switch(44)=0:End Sub
  812. Sub sw45_Hit:Controller.Switch(45)=1:PlaySound "rollover":End Sub
  813. Sub sw45_unHit:Controller.Switch(45)=0:End Sub
  814. Sub sw46_Hit:Controller.Switch(46) = 1:PlaySound "bowl":bowl_sw.rotatetoend:End Sub
  815. Sub sw46_UnHit:Controller.Switch(46) = 0:bowl_sw.rotatetostart:End Sub
  816. Sub sw47_Hit:Controller.Switch(47) = 1:PlaySound "rollover":End Sub
  817. Sub sw47_UnHit:Controller.Switch(47) = 0:End Sub'GI_On:End Sub
  818. Sub sw48_Spin:vpmTimer.PulseSw 48:playsound"spinner": tach.enabled = 1:End Sub
  819. Sub sw54_Hit:sw54.IsDropped = 1:sw54a.IsDropped = 0:Me.TimerEnabled = 1:vpmTimer.PulseSw 54:PlaySound SoundFX("target",DOFTargets):End Sub
  820. Sub sw54_Timer:sw54.IsDropped = 0:sw54a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
  821. Sub sw55_Hit:sw55.IsDropped = 1:sw55a.IsDropped = 0:Me.TimerEnabled = 1:vpmTimer.PulseSw 55:PlaySound SoundFX("target",DOFTargets):End Sub
  822. Sub sw55_Timer:sw55.IsDropped = 0:sw55a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
  823. Sub lhdtw_Hit:vpmTimer.PulseSw 57:Playsound SoundFX("target",DOFTargets):End Sub
  824. Sub xrhdtw_Hit:vpmTimer.PulseSw 56:Playsound SoundFX("target",DOFTargets):End Sub
  825.  
  826. Sub rub1_Hit():playsound"rubber":End Sub
  827. Sub rub2_Hit():playsound"rubber":End Sub
  828. Sub rub3_Hit():playsound"rubber":End Sub
  829. Sub rub4_Hit():playsound"rubber":End Sub
  830. Sub rub5_Hit():playsound"rubber":End Sub
  831. Sub rub6_Hit():playsound"rubber":End Sub
  832. Sub rub7_Hit():playsound"rubber":End Sub
  833. Sub rub8_Hit():playsound"rubber":End Sub
  834. Sub rub9_Hit():playsound"rubber":End Sub
  835. Sub rub10_Hit():playsound"rubber":End Sub
  836. Sub rub11_Hit():playsound"rubber":End Sub
  837. Sub rub12_Hit():playsound"rubber":End Sub
  838. Sub rub13_Hit():playsound"rubber":End Sub
  839. Sub rub14_Hit():playsound"rubber":End Sub
  840. Sub rub15_Hit():playsound"rubber":End Sub
  841. Sub rub16_Hit():playsound"rubber":End Sub
  842. Sub UpPost2_Hit():playsound"rubber":End Sub
  843.  
  844.  
  845. 'Scoop
  846. Dim aBall, aZpos
  847. Dim bBall, bZpos
  848.  
  849. Sub Wall17_Hit
  850. PlaySound "fx_collide"
  851. End Sub
  852.  
  853. Sub Wall16_Hit
  854. PlaySound "fx_collide"
  855. End Sub
  856.  
  857. Sub sw43_Hit
  858. PlaySound "ballhit"
  859. Me.TimerInterval = 2
  860. Me.TimerEnabled = 1
  861. End Sub
  862.  
  863. Sub sw43_Timer
  864. Me.TimerEnabled = 0
  865. bsRHole.AddBall Me
  866. End Sub
  867.  
  868. '***Slings and rubbers
  869. ' Slings
  870. Dim LStep, RStep
  871.  
  872. Sub LeftSlingShot_Slingshot
  873. For each xx in LHammerA:xx.IsDropped = 0:Next
  874. PlaySound SoundFX("Slingshot",DOFContactors):vpmTimer.PulseSw 26:LStep = 0:Me.TimerEnabled = 1
  875. End Sub
  876.  
  877. Sub LeftSlingShot_Timer
  878. Select Case LStep
  879. Case 0: 'pause
  880. Case 1: 'pause
  881. Case 2:For each xx in LHammerA:xx.IsDropped = 1:Next
  882. For each xx in LHammerB:xx.IsDropped = 0:Next
  883. Case 3:For each xx in LHammerB:xx.IsDropped = 1:Next
  884. For each xx in LHammerC:xx.IsDropped = 0:Next
  885. Case 4:For each xx in LHammerC:xx.IsDropped = 1:Next
  886. Me.TimerEnabled = 0
  887. End Select
  888. LStep = LStep + 1
  889. End Sub
  890.  
  891. Sub RightSlingShot_Slingshot
  892. For each xx in RHammerA:xx.IsDropped = 0:Next
  893. PlaySound SoundFX("Slingshot",DOFContactors):vpmTimer.PulseSw 27:RStep = 0:Me.TimerEnabled = 1
  894. End Sub
  895.  
  896. Sub RightSlingShot_Timer
  897. Select Case RStep
  898. Case 0: 'pause
  899. Case 1: 'pause
  900. Case 2:For each xx in RHammerA:xx.IsDropped = 1:Next
  901. For each xx in RHammerB:xx.IsDropped = 0:Next
  902. Case 3:For each xx in RHammerB:xx.IsDropped = 1:Next
  903. For each xx in RHammerC:xx.IsDropped = 0:Next
  904. Case 4:For each xx in RHammerC:xx.IsDropped = 1:Next
  905. Me.TimerEnabled = 0
  906. End Select
  907. RStep = RStep + 1
  908. End Sub
  909.  
  910. 'Bumpers
  911. Sub Bumper1_Hit:vpmTimer.PulseSw 30:PlaySound SoundFX("bumper",DOFContactors):End Sub
  912.  
  913.  
  914. Sub Bumper2_Hit:vpmTimer.PulseSw 32:PlaySound SoundFX("bumper",DOFContactors):End Sub
  915.  
  916.  
  917. Sub Bumper3_Hit:vpmTimer.PulseSw 33:PlaySound SoundFX("bumper",DOFContactors):End Sub
  918.  
  919.  
  920. Sub Bumper4_Hit:vpmTimer.PulseSw 31:PlaySound SoundFX("bumper",DOFContactors):End Sub
  921.  
  922.  
  923. 'Sounds
  924. dim speedx
  925. dim speedy
  926. dim finalspeed
  927. Sub Rubbers_Hit(IDX)
  928. finalspeed=SQR(ActiveBall.velx * ActiveBall.velx + ActiveBall.vely * ActiveBall.vely)
  929. if finalspeed > 11 then PlaySound "rubber" else PlaySound "rubberFlipper":end if
  930. End Sub
  931. Sub Gates_Hit(IDX):PlaySound"Gate":End Sub
  932. Sub LeftFlipper_Collide(parm)
  933. PlaySound "rubberFlipper"
  934. 'GridCancelGameOverTimer
  935. End Sub
  936. Sub RightFlipper_Collide(parm)
  937. PlaySound "rubberFlipper"
  938. 'GridCancelGameOverTimer
  939. End Sub
  940.  
  941. Dim LampState(400)
  942.  
  943. AllLampsOff()
  944. LampTimer.Interval = 35
  945. LampTimer.Enabled = 1
  946.  
  947. Sub LampTimer_Timer()
  948. Dim chgLamp, ii
  949. chgLamp = Controller.ChangedLamps
  950. If Not IsEmpty(chgLamp) Then
  951. For ii = 0 To UBound(chgLamp)
  952.  
  953. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1)
  954.  
  955. 'Print Light state changes
  956. debug.print "Lamp " & chgLamp(ii, 0) & ": " & chgLamp(ii, 1)
  957.  
  958.  
  959. Next
  960. End If
  961. UpdateLamps
  962. End Sub
  963.  
  964. Sub AllLampsOff()
  965. On Error Resume Next
  966.  
  967. Dim x
  968. For x = 0 to 360
  969. LampState(x) = 0
  970. Next
  971.  
  972. UpdateLamps:UpdateLamps:Updatelamps
  973. End Sub
  974.  
  975. Sub SetLamp(nr, value)
  976. If value <> LampState(nr) Then
  977. LampState(nr) = abs(value)
  978. End If
  979. End Sub
  980.  
  981.  
  982. 'Dim gon
  983. Dim xxtt
  984.  
  985. Sub UpdateLamps
  986. On Error Resume Next
  987.  
  988. For each xxtt in GI_ALL:xxtt.Intensity = LampState(98) / 20:next
  989.  
  990. If LampState(98) < 10 Then
  991. Table.ColorGradeImage = "ColorGrade_off"
  992. else
  993. Table.ColorGradeImage = "ColorGrade_on"
  994. End If
  995.  
  996. if sw34.isdropped AND LampState(98) > 10 Then
  997. Light54.State = 1
  998. else
  999. Light54.State = 0
  1000. End If
  1001.  
  1002. if sw35.isdropped AND LampState(98) > 10 Then
  1003. Light53.State = 1
  1004. else
  1005. Light53.State = 0
  1006. End If
  1007.  
  1008. if sw36.isdropped AND LampState(98) > 10 Then
  1009. Light51.State = 1
  1010. else
  1011. Light51.State = 0
  1012. End If
  1013.  
  1014. if sw37.isdropped AND LampState(98) > 10 Then
  1015. Light50.State = 1
  1016. else
  1017. Light50.State = 0
  1018. End If
  1019.  
  1020. if sw38.isdropped AND LampState(98) > 10 Then
  1021. Light52.State = 1
  1022. else
  1023. Light52.State = 0
  1024. End If
  1025.  
  1026. l3.State = Lampstate(3)
  1027. l4.State = Lampstate(4)
  1028. l5.State = Lampstate(5)
  1029. l6.State = Lampstate(6)
  1030. l7.State = Lampstate(7)
  1031. l8.State = Lampstate(8)
  1032.  
  1033. xg.State = Lampstate(9)
  1034. xn.State = Lampstate(10)
  1035. xa.State = Lampstate(11)
  1036. xt.State = Lampstate(12)
  1037. xs.State = Lampstate(13)
  1038. xu.State = Lampstate(14)
  1039. xm.State = Lampstate(15)
  1040.  
  1041. L33.State = Lampstate(33)
  1042. L34.State = Lampstate(34)
  1043. L35.State = Lampstate(35)
  1044.  
  1045. L16.State = Lampstate(16)
  1046. L17.State = Lampstate(17)
  1047. L18.State = Lampstate(18)
  1048. L19.State = Lampstate(19)
  1049.  
  1050. L20.State = Lampstate(20)
  1051. L21.State = Lampstate(21)
  1052. L22.State = Lampstate(22)
  1053. L23.State = Lampstate(23)
  1054.  
  1055. L20a.State = Lampstate(20)
  1056. L21a.State = Lampstate(21)
  1057. L22a.State = Lampstate(22)
  1058. L23a.State = Lampstate(23)
  1059.  
  1060. L24.State = Lampstate(24)
  1061. L26.State = Lampstate(26)
  1062. L27.State = Lampstate(27)
  1063. L28.State = Lampstate(28)
  1064. L29.State = Lampstate(29)
  1065. L30.State = Lampstate(30)
  1066. L31.State = Lampstate(31)
  1067. L32.State = Lampstate(32)
  1068. L25.State = Lampstate(25)
  1069.  
  1070. L36.State = Lampstate(36)
  1071. L37.State = Lampstate(37)
  1072. L38.State = Lampstate(38)
  1073.  
  1074. L39.State = Lampstate(39)
  1075. L40.State = Lampstate(40)
  1076. L41.State = Lampstate(41)
  1077.  
  1078. L44.State = Lampstate(44)
  1079. L45.State = Lampstate(45)
  1080. L46.State = Lampstate(46)
  1081.  
  1082. L47.State = Lampstate(47)
  1083. L48.State = Lampstate(48)
  1084. L42.State = Lampstate(42)
  1085. L43.State = Lampstate(43)
  1086. L49.State = Lampstate(49)
  1087. L50.State = Lampstate(50)
  1088. L51.State = Lampstate(51)
  1089.  
  1090. L52.State = Lampstate(52)
  1091. L53.State = Lampstate(53)
  1092. L54.State = Lampstate(54)
  1093.  
  1094. L55.State = Lampstate(55)
  1095. L56.State = Lampstate(56)
  1096. L57.State = Lampstate(57)
  1097.  
  1098. L58.State = Lampstate(58)
  1099. L59.State = Lampstate(59)
  1100. L60.State = Lampstate(60)
  1101. L61.State = Lampstate(61)
  1102. L62.State = Lampstate(62)
  1103. L63.State = Lampstate(63)
  1104. L64.State = Lampstate(64)
  1105.  
  1106. L65.State = Lampstate(65)
  1107. L66.State = Lampstate(66)
  1108. L67.State = Lampstate(67)
  1109. L68.State = Lampstate(68)
  1110. L69.State = Lampstate(69)
  1111. L70.State = Lampstate(70)
  1112.  
  1113. L73.State = Lampstate(73)
  1114.  
  1115. L77.State = Lampstate(77)
  1116. L78.State = Lampstate(78)
  1117. L79.State = Lampstate(79)
  1118. L79a.State = Lampstate(79)
  1119. L80.State = Lampstate(80)
  1120.  
  1121. L108.State = Lampstate(112)
  1122.  
  1123. 'L39.State = Lampstate(39)
  1124.  
  1125. L81.State = Lampstate(81)
  1126. L82.State = Lampstate(82)
  1127. L83.State = Lampstate(83)
  1128. L84.State = Lampstate(84)
  1129. L85.State = Lampstate(85)
  1130.  
  1131. L86.State = Lampstate(86)
  1132. L87.State = Lampstate(87)
  1133. L88.State = Lampstate(88)
  1134. L89.State = Lampstate(89)
  1135. L90.State = Lampstate(90)
  1136.  
  1137. L91.State = Lampstate(91)
  1138. L92.State = Lampstate(92)
  1139. L93.State = Lampstate(93)
  1140. L94.State = Lampstate(94)
  1141. L95.State = Lampstate(95)
  1142.  
  1143. L96.State = Lampstate(96)
  1144. L97.State = Lampstate(97)
  1145.  
  1146. L99.State = Lampstate(102)
  1147. L99a.State = Lampstate(102)
  1148. L99b.State = Lampstate(102)
  1149.  
  1150. L98.State = Lampstate(103)
  1151. L98a.State = Lampstate(103)
  1152. L98b.State = Lampstate(103)
  1153.  
  1154. L100.State = Lampstate(104)
  1155. L100a.State = Lampstate(104)
  1156. L100b.State = Lampstate(104)
  1157.  
  1158. L103.State = Lampstate(107)
  1159. L103a.State = Lampstate(107)
  1160. L103b.State = Lampstate(107)
  1161. L104.State = Lampstate(108)
  1162. L104a.State = Lampstate(108)
  1163. L104b.State = Lampstate(108)
  1164.  
  1165. L101.State = Lampstate(105)
  1166. L101a.State = Lampstate(105)
  1167. L101b.State = Lampstate(105)
  1168. L102.State = Lampstate(106)
  1169. L102a.State = Lampstate(106)
  1170. L102b.State = Lampstate(106)
  1171. L105.State = Lampstate(109)
  1172. L105a.State = Lampstate(109)
  1173. L105b.State = Lampstate(109)
  1174.  
  1175. L106.State = Lampstate(110)
  1176. L106a.State = Lampstate(110)
  1177. L106b.State = Lampstate(110)
  1178.  
  1179. L107.State = Lampstate(111)
  1180. L107a.State = Lampstate(111)
  1181. L107b.State = Lampstate(111)
  1182.  
  1183. rgb1.Color = RGB(0,0,0)
  1184. rgb1.ColorFull = RGB(Lampstate(125),Lampstate(123),Lampstate(124))
  1185.  
  1186. rgb2.Color = RGB(0,0,0)
  1187. rgb2.ColorFull = RGB(Lampstate(128),Lampstate(126),Lampstate(127))
  1188.  
  1189. rgb3.Color = RGB(0,0,0)
  1190. rgb3.ColorFull = RGB(Lampstate(122),Lampstate(120),Lampstate(121))
  1191.  
  1192. rgb8.Color = RGB(0,0,0)
  1193. rgb8.ColorFull = RGB(Lampstate(119),Lampstate(117),Lampstate(118))
  1194.  
  1195. rgb4.Color = RGB(0,0,0)
  1196. rgb4.ColorFull = RGB(Lampstate(141),Lampstate(139),Lampstate(140))
  1197.  
  1198. rgb5.Color = RGB(0,0,0)
  1199. rgb5.ColorFull = RGB(Lampstate(135),Lampstate(133),Lampstate(134))
  1200.  
  1201. rgb6.Color = RGB(0,0,0)
  1202. rgb6.ColorFull = RGB(Lampstate(132),Lampstate(130),Lampstate(131))
  1203.  
  1204. rgb7.Color = RGB(0,0,0)
  1205. rgb7.ColorFull = RGB(Lampstate(138),Lampstate(136),Lampstate(137))
  1206.  
  1207.  
  1208. N8.State = Lampstate(98)
  1209. N9.State = Lampstate(99)
  1210. OH.State = Lampstate(100)
  1211. OH1.State = Lampstate(101)
  1212.  
  1213. End Sub
  1214.  
  1215. '*************************
  1216. ' Plunger kicker animation
  1217. '*************************
  1218.  
  1219.  
  1220. Sub Trigger1_hit
  1221. PlaySound "DROP_LEFT"
  1222. End Sub
  1223.  
  1224. Sub Trigger2_hit
  1225. PlaySound "DROP_RIGHT"
  1226. End Sub
  1227.  
  1228. Sub RHD_hit
  1229. PlaySound "DROP_RIGHT"
  1230. End Sub
  1231.  
  1232. Sub Table_exit()
  1233. Controller.Pause = False
  1234. Controller.Stop
  1235. End Sub
  1236.  
  1237.  
  1238. Sub Ttable(Enabled)
  1239. If enabled Then
  1240. car_wheel.enabled = 1
  1241. else
  1242. car_wheel.enabled = 0
  1243. End If
  1244. End Sub
  1245.  
  1246. Sub car_wheel_Timer()
  1247.  
  1248. If Disc2.ObjRotz => 360 Then
  1249. Disc2.ObjRotz = 0
  1250. End If
  1251.  
  1252. If Disc2.ObjRotz > 3 AND Disc2.ObjRotz < 53 AND Controller.Switch (52) = False Then
  1253. Controller.Switch (52) = 1
  1254. else
  1255. if Disc2.ObjRotz => 57 AND Disc2.ObjRotz <=60 Then
  1256. Controller.Switch (52) = 0
  1257. End If
  1258. End If
  1259.  
  1260.  
  1261. If Disc2.ObjRotz > 60 AND Disc2.ObjRotz < 108 AND Controller.Switch (52) = False Then
  1262. Controller.Switch (52) = 1
  1263. else
  1264. if Disc2.ObjRotz => 112 AND Disc2.ObjRotz <=115 Then
  1265. Controller.Switch (52) = 0
  1266. End If
  1267. End If
  1268.  
  1269.  
  1270. If Disc2.ObjRotz > 115 AND Disc2.ObjRotz < 158 AND Controller.Switch (52) = False Then
  1271. Controller.Switch (52) = 1
  1272. else
  1273. if Disc2.ObjRotz => 162 AND Disc2.ObjRotz <=165 Then
  1274. Controller.Switch (52) = 0
  1275. End If
  1276. End If
  1277.  
  1278. If Disc2.ObjRotz > 165 AND Disc2.ObjRotz < 208 AND Controller.Switch (52) = False Then
  1279. Controller.Switch (52) = 1
  1280. else
  1281. if Disc2.ObjRotz => 212 AND Disc2.ObjRotz <=215 Then
  1282. Controller.Switch (52) = 0
  1283. End If
  1284. End If
  1285.  
  1286. If Disc2.ObjRotz > 215 AND Disc2.ObjRotz < 258 AND Controller.Switch (52) = False Then
  1287. Controller.Switch (52) = 1
  1288. else
  1289. if Disc2.ObjRotz => 264 AND Disc2.ObjRotz <=267 Then
  1290. Controller.Switch (52) = 0
  1291. End If
  1292. End If
  1293.  
  1294. If Disc2.ObjRotz > 267 AND Disc2.ObjRotz < 308 AND Controller.Switch (52) = False Then
  1295. Controller.Switch (52) = 1
  1296. else
  1297. if Disc2.ObjRotz => 312 AND Disc2.ObjRotz <=315 Then
  1298. Controller.Switch (52) = 0
  1299. End If
  1300. End If
  1301.  
  1302. If Disc2.ObjRotz > 315 AND Disc2.ObjRotz < 353 AND Controller.Switch (52) = False Then
  1303. Controller.Switch (52) = 1
  1304. else
  1305. if Disc2.ObjRotz => 358 Then
  1306. Controller.Switch (52) = 0
  1307. End If
  1308. End If
  1309.  
  1310. If Disc2.ObjRotz > 352 Then
  1311. Controller.Switch (53) = 1
  1312. else
  1313. if Disc2.ObjRotz => 3 AND Disc2.ObjRotz <= 5 Then
  1314. Controller.Switch (53) = 0
  1315. End If
  1316. End If
  1317.  
  1318. If Controller.Switch(52) = True Then
  1319. Light61.State = 1
  1320. else
  1321. Light61.State = 0
  1322. End If
  1323.  
  1324. If Controller.Switch(53) = True Then
  1325. Light62.State = 1
  1326. else
  1327. Light62.State = 0
  1328. End If
  1329.  
  1330. Primitive3.ObjRotZ = Primitive3.ObjRotZ + 0.1
  1331. Primitive53.ObjRotZ = Primitive3.ObjRotZ + 0.1
  1332. Disc2.ObjRotZ = Disc2.ObjRotZ + 0.1
  1333. Disc1.ObjRotZ = Disc1.ObjRotZ - 0.2
  1334. End Sub
  1335.  
  1336. Dim tachpos
  1337.  
  1338. Tachpos = 1
  1339.  
  1340. Sub tach_timer()'255
  1341. Select Case tachpos
  1342. Case 1:
  1343. If Disc4.Rotz => 200 Then
  1344. redline.state = 2
  1345. End If
  1346. If Disc4.Rotz => 255 Then
  1347. tachpos = 2
  1348. Disc4.Rotz = 255
  1349. End If
  1350. me.enabled = 0
  1351. Disc4.rotz = Disc4.rotz + 5
  1352.  
  1353. Case 2:
  1354. If Disc4.Rotz <= 200 Then
  1355. redline.state = 0
  1356. End If
  1357. If Disc4.Rotz <= 0 Then
  1358. tachpos = 1
  1359. Disc4.Rotz = 0
  1360. me.enabled = 0
  1361. End If
  1362. Disc4.rotz = Disc4.rotz - 5
  1363. End Select
  1364. End Sub
  1365.  
  1366. Sub DivKick1_Hit()
  1367. me.DestroyBall
  1368. DivKick2.CreateBall
  1369. DivKick2.Kick 110,2
  1370. PlaySound "metalrolling2"
  1371. End Sub
  1372.  
  1373. Sub XGameTimer_Timer
  1374. RightFlipperP.Rotz = RightFlipper.CurrentAngle
  1375. LeftFlipperP.Rotz = LeftFlipper.CurrentAngle
  1376. End Sub
  1377.  
  1378. Sub XGameTimer1_Timer
  1379. RollingSoundUpdate
  1380. End Sub
  1381.  
  1382. ' *********************************************************************
  1383. ' Supporting Ball & Sound Functions
  1384. ' *********************************************************************
  1385.  
  1386. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1387. Vol = Csng(BallVel(ball) ^2 / 1800)
  1388. End Function
  1389.  
  1390. Function Vol2(ball1, ball2) ' Calculates the Volume of the sound based on the speed of two balls
  1391. Vol2 = (Vol(ball1) + Vol(ball2) ) / 2
  1392. End Function
  1393.  
  1394. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1395. Dim tmp
  1396. tmp = ball.x * 2 / table.width-1
  1397. If tmp > 0 Then
  1398. Pan = Csng(tmp ^10)
  1399. Else
  1400. Pan = Csng(-((- tmp) ^10) )
  1401. End If
  1402. End Function
  1403.  
  1404. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1405. Pitch = BallVel(ball) * 20
  1406. End Function
  1407.  
  1408. Function BallVel(ball) 'Calculates the ball speed
  1409. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1410. End Function
  1411.  
  1412.  
  1413. '*****************************************
  1414. ' JP's VP10 Rolling Sounds
  1415. '*****************************************
  1416.  
  1417. Const tnob = 9 ' total number of balls
  1418. ReDim rolling(tnob)
  1419. InitRolling
  1420.  
  1421. Sub InitRolling
  1422. Dim i
  1423. For i = 0 to tnob
  1424. rolling(i) = FALSE
  1425. Next
  1426. End Sub
  1427.  
  1428. Sub RollingSoundUpdate()
  1429. Dim BOT, b
  1430. BOT = GetBalls
  1431.  
  1432. ' stop the sound of deleted balls
  1433. For b = UBound(BOT) + 1 to tnob
  1434. rolling(b) = FALSE
  1435. StopSound("fx_ballrolling" & b)
  1436. Next
  1437.  
  1438. ' exit the sub if no balls on the table
  1439. If UBound(BOT) = -1 Then Exit Sub
  1440.  
  1441. ' play the rolling sound for each ball
  1442. For b = 0 to UBound(BOT)
  1443. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1444. rolling(b) = TRUE
  1445. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1446. Else
  1447. If rolling(b) = TRUE Then
  1448. StopSound("fx_ballrolling" & b)
  1449. rolling(b) = FALSE
  1450. End If
  1451. End If
  1452. Next
  1453. End Sub
  1454.  
  1455. Sub LRampT_Hit()
  1456. If ActiveBall.Vely < -10 Then
  1457. PlaySound "metalrolling2"
  1458. End If
  1459. End Sub
  1460.  
  1461. '**********************
  1462. ' Ball Collision Sound
  1463. '**********************
  1464.  
  1465. Sub OnBallBallCollision(ball1, ball2, velocity)
  1466. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1467. End Sub
Advertisement
Add Comment
Please, Sign In to add comment