Arngrim

ngg 1.01 dof

Nov 6th, 2016
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.32 KB | None | 0 0
  1. 'No Good Gofers by Bodydump
  2. 'Models by Dark
  3. Option Explicit
  4. Randomize
  5.  
  6. On Error Resume Next
  7. ExecuteGlobal GetTextFile("controller.vbs")
  8. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  9. On Error Goto 0
  10.  
  11.  
  12. Const BallSize = 50
  13.  
  14. Dim hideDMD
  15.  
  16. '***Apron Style***
  17. ' 0 = Standard apron
  18. ' 1 = Custom apron
  19. apronstyle = 1
  20.  
  21. '**************************
  22. 'Desktop/Fullscreen Changes
  23. '**************************
  24.  
  25. If Table.ShowDT = true then
  26. Ramp15.visible = True
  27. Ramp16.visible = True
  28. Ramp17.visible = True
  29. Light47.Intensity = 0
  30. hideDMD = 0
  31. else
  32. Ramp15.visible = False
  33. Ramp16.visible = False
  34. Ramp17.visible = False
  35. hideDMD = 1
  36. end if
  37.  
  38. Const UseVPMModSol = 1
  39.  
  40. LoadVPM"01520000","WPC.VBS",3.1
  41.  
  42. '********************
  43. 'Standard definitions
  44. '********************
  45.  
  46. Dim xx, apronstyle
  47. Dim Bump1, Bump2, Bump3, RGoferIsUp, RightRampUp, LGoferIsUp, LeftRampUp
  48. Dim bsTrough, bsLeftEject, bsPuttOutPopper, bsJetPopper, bsUpperRightEject, mTT, cbCaptive
  49. LGoferIsUp = 0
  50. LeftRampUp = 0
  51. RGoferIsUp = 0
  52. RightRampUp = 0
  53. Const cGameName = "ngg_13"
  54. Const UseSolenoids = 1
  55. Const UseLamps = 0
  56. Const UseGI = 0
  57. Const UseSync = 0
  58. Const HandleMechs = 1
  59.  
  60. Set GICallback = GetRef("UpdateGIon")
  61. Set GICallback2 = GetRef("UpdateGI")
  62.  
  63. Const SSolenoidOn="fx_Solenoid"
  64. Const SSolenoidOff="fx_solenoidoff"
  65. Const sCoin="fx_Coin"
  66.  
  67. '***********
  68. ' Solenoids
  69. ' the commented solenoids are not in used in this script
  70. '***********
  71.  
  72. SolCallback(1)="vpmSolAutoPlunger Plunger1,3," 'Autofire
  73. SolCallback(2)="vpmSolAutoPlunger KickBack,3," 'KickBack
  74. SolCallback(3)="SolPuttOut" 'Clubhouse Kicker
  75. SolCallback(4)="SolLeftGoferUP" 'Left Gofer Up
  76. SolCallback(5)="SolRightGoferUP" 'Right Gofer Up
  77. SolCallback(6)="bsJetPopper.SolOut" 'Jet Popper
  78. SolCallback(7)="bsLeftEject.SolOut" 'Left Eject (Sand Trap)
  79. SolCallback(8)="bsUpperRightEject.SolOut" 'Upper Right Eject
  80. SolCallback(9)="SolBallRelease" 'Trough Eject
  81. ' 'SolCallback(10)="vpmSolSound ""Sling""," 'Left Slingshot
  82. ' 'SolCallback(11)="vpmSolSound ""Sling""," 'Right Slingshot
  83. ' 'SolCallback(12)="vpmSolSound ""Jet3""," 'Top Jet Bumper
  84. ' 'SolCallback(13)="vpmSolSound ""Jet3""," 'Middle Jet Bumper
  85. ' 'SolCallback(14)="vpmSolSound ""Jet3""," 'Bottom Jet Bumper
  86. SolCallback(15)="SolLeftGoferDown" 'Left Gofer Down
  87. SolCallback(16)="SolRightGoferDown" 'Right Gofer Down
  88. SolModCallback(17)="SetModLamp 170," 'Jet Flasher
  89. SolModCallback(18)="SetModLamp 178," 'Lower Left Flasher
  90. SolModCallback(19)="SetModLamp 180," 'Left Spinner Flasher
  91. SolModCallback(20)="SetModLamp 122," 'Right Spinner Flasher
  92. SolModCallback(21)="SetModLamp 179," 'Lower Right Flasher
  93. SolCallback(24)="SolSubway" 'Underground Pass
  94. SolModCallback(25)="SetModLamp 131," 'Sand Trap Flasher
  95. SolModCallback(26)="SetModLamp 190," 'Wheel Flasher
  96. SolCallback(27)="SolLeftRampDown" 'Left Ramp Down
  97. SolCallback(28)="SolRightRampDown" 'Right Ramp Down
  98. SolCallback(35)="SolSlamRamp" 'Ball Launch Ramp
  99. SolModCallback(51)="SetModLamp 177," 'Upper Right Flasher 1
  100. SolModCallback(52)="SetModLamp 175," 'Upper Right Flasher 2
  101. SolModCallback(53)="SetModLamp 173," 'Upper Right Flasher 3
  102. SolModCallback(58)="SetModLamp 176," 'Upper Left Flasher 1
  103. SolModCallback(57)="SetModLamp 174," 'Upper Left Flasher 2
  104. SolModCallback(56)="SetModLamp 172," 'Upper Left Flasher 3
  105. ' SolCallback(sLRFlipper)="vpmSolFlipper RightFlipper,Nothing,"
  106. ' SolCallback(sLLFlipper)="vpmSolFlipper LeftFlipper,Nothing,"
  107. ' SolCallback(sURFlipper)="vpmSolFlipper UpperFlipper,Nothing,"
  108. SolModCallback(54)="SetModLamp 145,"
  109. SolModCallback(55)="SetModLamp 146,"
  110. '
  111. Sub SolBallRelease(Enabled)
  112. If Enabled Then
  113. If bsTrough.Balls Then
  114. vpmTimer.PulseSw 31
  115. End If
  116. bsTrough.ExitSol_On
  117. End If
  118. End Sub
  119.  
  120. Sub SolPuttOut(Enabled)
  121. If Enabled Then
  122. If bsPuttOutPopper.Balls Then
  123. bsPuttOutPopper.InitKick sw44a,170,12
  124. PlaySound SoundFX("scoopexit",DOFContactors)
  125. End If
  126. bsPuttOutPopper.ExitSol_On
  127. End If
  128. End Sub
  129. Sub SolSubway(Enabled)
  130. If Enabled Then
  131. If bsPuttOutPopper.Balls Then
  132. bsPuttOutPopper.InitKick subwaystart,180,3
  133. bsPuttOutPopper.ExitSol_On
  134. End If
  135. End If
  136. End Sub
  137.  
  138. Sub SolLeftGoferUP(Enabled)
  139. If Enabled Then
  140. LrampTimer.Enabled = 0
  141. If LGoferIsUp = 0 Then
  142. DOF 101, DOFPulse
  143. Controller.Switch(41)=0
  144. Controller.Switch(47)=0
  145. LGofer.IsDropped=0
  146. LGoferUp.Enabled = 1
  147. LGoferDown.Enabled = 0
  148. Lramp.collidable=0
  149. Lramp1.collidable=1
  150. LeftRampUp = 1
  151. PlaySound SoundFX("goofer_up",DOFContactors)
  152. Else
  153. DOF 102, DOFPulse
  154. Controller.Switch(41)=0
  155. Controller.Switch(47)=0
  156. LGoferUp.Enabled = 1
  157. LeftGoferBlock.collidable = 1
  158. LGPos = 6
  159. End If
  160. End If
  161. End Sub
  162.  
  163. Sub SolRightGoferUP(Enabled)
  164. If Enabled Then
  165. RrampTimer.Enabled = 0
  166. If RGoferIsUp = 0 Then
  167. DOF 101, DOFPulse
  168. Controller.Switch(42)=0
  169. Controller.Switch(48)=0
  170. RGofer.IsDropped=0
  171. RGoferUp.Enabled = 1
  172. RGoferDown.Enabled = 0
  173. Rramp.collidable=0
  174. Rramp1.collidable=1
  175. RightRampUp = 1
  176. PlaySound SoundFX("goofer_up",DOFContactors)
  177. Else
  178. DOF 102, DOFPulse
  179. Controller.Switch(42)=0
  180. Controller.Switch(48)=0
  181. RGoferUp.Enabled = 1
  182. RGPos = 6
  183. End If
  184. End If
  185. End Sub
  186.  
  187. Sub SolLeftGoferDown(Enabled)
  188. If Enabled Then
  189. DOF 101, DOFPulse
  190. Controller.Switch(41)=1
  191. LGoferDown.Enabled = 1
  192. LGoferUp.Enabled = 0
  193. LGofer.IsDropped=1
  194. PlaySound SoundFX("goofer_down",DOFContactors)
  195. End If
  196. End Sub
  197.  
  198. Sub SolRightGoferDown(Enabled)
  199. If Enabled Then
  200. DOF 101, DOFPulse
  201. Controller.Switch(42)=1
  202. RGoferDown.Enabled = 1
  203. RGoferUp.Enabled = 0
  204. RGofer.IsDropped = 1
  205. PlaySound SoundFX("goofer_down",DOFContactors)
  206. End If
  207. End Sub
  208.  
  209. Sub SolLeftRampDown(Enabled)
  210. If Enabled Then
  211. RightRampUp = 0
  212. LrampDir = 1
  213. Lramp.collidable=1
  214. Lramp1.collidable=0
  215. PlaySound "gate"
  216. LrampTimer.Enabled = 1
  217.  
  218. Else
  219.  
  220. End If
  221. End Sub
  222.  
  223. Sub SolRightRampDown(Enabled)
  224. If Enabled Then
  225. RightRampUp = 0
  226. RrampDir = 1
  227. Rramp.collidable=1
  228. Rramp1.collidable=0
  229. PlaySound "gate"
  230. RrampTimer.Enabled = 1
  231.  
  232. Else
  233.  
  234. End If
  235. End Sub
  236.  
  237. Sub SolSlamRamp(Enabled)
  238. If Enabled Then
  239. For each xx in aslamramp:xx.IsDropped=0:Next
  240. For each xx in aslamrampup:xx.IsDropped=1:Next
  241. jumpramptrigger.enabled = 1
  242. jumpramp.Collidable=1
  243. slamrampup.Collidable = 0
  244. Flipper1.RotateToEnd
  245. rampshadow.visible = 0
  246. SlamRampDownTimer.Enabled = 1
  247. Else
  248.  
  249. End If
  250. End Sub
  251.  
  252. Sub SlamRampDownTimer_Timer()
  253. SlamRampUpTimer.Enabled = 1
  254. SlamRampDownTimer.Enabled = 0
  255. End Sub
  256. Sub SlamRampUpTimer_Timer()
  257. For each xx in aslamramp:xx.IsDropped=1:Next
  258. For each xx in aslamrampup:xx.IsDropped=9:Next
  259. jumpramp.Collidable=0
  260. slamrampup.Collidable = 1
  261. jumpramptrigger.enabled = 0
  262. Flipper1.RotateToStart
  263. rampshadow.visible = 1
  264. SlamRampUpTimer.Enabled = 0
  265. End Sub
  266.  
  267. '************
  268. ' Table init.
  269. '************
  270.  
  271. Sub Table_Init
  272. vpmInit me
  273. With Controller
  274. .GameName = cGameName
  275. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description:Exit Sub
  276. .SplashInfoLine="No Good Gofers" & vbNewLine & "VP Table by Bodydump"
  277. .HandleKeyboard=0
  278. .ShowTitle=0
  279. .ShowDMDOnly=1
  280. .ShowFrame=0
  281. .HandleMechanics=1
  282. .Hidden=0
  283. On Error Resume Next
  284. .Run GetPlayerHWnd
  285. If Err Then MsgBox Err.Description
  286. On Error Goto 0
  287. End With
  288. 'Nudging
  289. vpmNudge.TiltSwitch=14
  290. vpmNudge.Sensitivity=1
  291. vpmNudge.TiltObj=Array(Bumper1,Bumper2,Bumper3,LeftSlingshot,RightSlingshot)
  292.  
  293. 'Trough
  294. Set bsTrough=New cvpmTrough
  295. With bsTrough
  296. .size = 6
  297. .initSwitches Array(32, 33, 34, 35,36,37)
  298. .Initexit BallRelease, 105,5
  299. .InitEntrySounds "fx_drain", "fx_Solenoid", "fx_Solenoid"
  300. .InitExitSounds SoundFX("fx_Solenoid",DOFContactors), SoundFX("fx_ballrel",DOFContactors)
  301. .Balls = 6
  302. End With
  303.  
  304. 'Sand Trap Eject
  305. Set bsLeftEject = New cvpmSaucer
  306. With bsLeftEject
  307. .InitKicker LeftEject, 78, 78, 30, 0
  308. .InitSounds "fx_kicker_enter", SoundFX("fx_Solenoid",DOFContactors), SoundFX("fx_Popper",DOFContactors)
  309. End With
  310.  
  311. 'Putt Out Popper
  312. Set bsPuttOutPopper=New cvpmBallStack
  313. With bsPuttOutPopper
  314. .InitSw 0,44,0,0,0,0,0,0
  315. .InitKick sw44a,170,12
  316. End With
  317.  
  318. 'Jet Popper
  319. Set bsJetPopper=New cvpmBallStack
  320. With bsJetPopper
  321. .InitSw 0,38,25,0,0,0,0,0
  322. .InitKick JetPopper,180,10
  323. .InitExitSnd SoundFX("fx_Popper",DOFContactors), SoundFX("fx_Solenoid",DOFContactors)
  324. End With
  325.  
  326. 'Upper Right Eject
  327. Set bsUpperRightEject=New cvpmBallStack
  328. With bsUpperRightEject
  329. .InitSw 0,46,0,0,0,0,0,0
  330. .InitKick upperrightkicker,120,5
  331. .InitExitSnd SoundFX("fx_Popper",DOFContactors), SoundFX("fx_Solenoid",DOFContactors)
  332. End With
  333.  
  334. 'Turntable
  335. Set mTT=New cvpmTurnTable
  336. With mTT
  337. .InitTurnTable TurnTable,40
  338. .SpinUp=40
  339. .SpinDown=40
  340. .CreateEvents "mTT"
  341. End With
  342. Blur.Enabled = 0
  343.  
  344. 'Captive Ball
  345. Set cbCaptive=New cvpmCaptiveBall
  346. With cbCaptive
  347. .InitCaptive Captive,CWALL,Array(Captive1,Captive2),350
  348. .NailedBalls=1
  349. .Start
  350. .ForceTrans=0.9
  351. .MinForce=4
  352. .CreateEvents "cbCaptive"
  353. End With
  354. Captive1.CreateBall
  355. If apronstyle = 0 Then
  356. apron.IsDropped = 1
  357. apron1.IsDropped = 0
  358. Else
  359. apron.IsDropped = 0
  360. apron1.IsDropped = 1
  361. End If
  362.  
  363. If nightday<5 then
  364. For each xx in extraambient:xx.intensityscale = 1:Next
  365. End If
  366. If nightday>5 then
  367. For each xx in extraambient:xx.intensity = xx.intensity*.9:Next
  368. End If
  369. If nightday>10 then
  370. For each xx in extraambient:xx.intensity = xx.intensity*.7:Next
  371. For each xx in GIleft:xx.intensity = xx.intensity*.9:Next
  372. For each xx in GIright:xx.intensity = xx.intensity*.9:Next
  373. End If
  374. If nightday>20 then
  375. For each xx in extraambient:xx.intensity = xx.intensity*.6:Next
  376. For each xx in GIleft:xx.intensity = xx.intensity*.8:Next
  377. For each xx in GIright:xx.intensity = xx.intensity*.8:Next
  378. End If
  379. If nightday>30 then
  380. For each xx in extraambient:xx.intensity = xx.intensity*.4:Next
  381. For each xx in GIleft:xx.intensity = xx.intensity*.7:Next
  382. For each xx in GIright:xx.intensity = xx.intensity*.7:Next
  383. End If
  384.  
  385.  
  386.  
  387. ' '**Main Timer init
  388. PinMAMETimer.Enabled = 1
  389.  
  390. Plunger1.PullBack
  391. Kickback.PullBack
  392. Controller.Switch(22)=1 'close coin door
  393. Controller.Switch(24)=0 'always closed
  394. Controller.Switch(41)=1 'drop left gofer
  395. Controller.Switch(42)=1 'drop right gofer
  396. Controller.Switch(47)=1 'left ramp down
  397. Controller.Switch(48)=1 'right ramp down
  398. LGofer.IsDropped = 1
  399. RGofer.IsDropped = 1
  400. Rramp1.collidable=0
  401. Lramp1.collidable=0
  402.  
  403. End Sub
  404.  
  405. Sub Table_Paused:Controller.Pause = 1:End Sub
  406. Sub Table_unPaused:Controller.Pause = 0:End Sub
  407.  
  408. '**********
  409. ' Keys
  410. '**********
  411.  
  412. Sub table_KeyDown(ByVal Keycode)
  413. If keycode = PlungerKey Then Plunger.Pullback:PlaySound SoundFX("fx_plungerpull",DOFContactors)
  414. If keycode = LeftTiltKey Then vpmNudge.DoNudge 90, 3:PlaySound SoundFX("fx_nudge",0), 0, 1, -0.1, 0.25
  415. If keycode = RightTiltKey Then vpmNudge.DoNudge 270, 3:PlaySound SoundFX("fx_nudge",0), 0, 1, 0.1, 0.25
  416. If keycode = CenterTiltKey Then vpmNudge.DoNudge 0, 4:PlaySound SoundFX("fx_nudge",0), 0, 1, 0, 0.25
  417. If vpmKeyDown(keycode) Then Exit Sub
  418. End Sub
  419.  
  420. Sub table_KeyUp(ByVal Keycode)
  421. If keycode = PlungerKey Then Plunger.Fire:PlaySound SoundFX("fx_plunger",DOFContactors)
  422. If vpmKeyUp(keycode) Then Exit Sub
  423. End Sub
  424.  
  425.  
  426. '********************
  427. ' Flippers
  428. '********************
  429.  
  430. SolCallback(sLRFlipper) = "SolRFlipper"
  431. SolCallback(sLLFlipper) = "SolLFlipper"
  432.  
  433. Sub SolLFlipper(Enabled)
  434. If Enabled Then
  435. PlaySound SoundFX("FlipperUpLeft",DOFFlippers), 0, 1, -0.1, 0.05
  436. LeftFlipper.RotateToEnd
  437. Else
  438. PlaySound SoundFX("fx_flipperdown",DOFFlippers), 0, 1, -0.1, 0.05
  439. LeftFlipper.RotateToStart
  440. End If
  441. End Sub
  442.  
  443. Sub SolRFlipper(Enabled)
  444. If Enabled Then
  445. PlaySound SoundFX("FlipperUpRightBoth",DOFFlippers), 0, 1, 0.1, 0.05
  446. RightFlipper.RotateToEnd
  447. UpperFlipper.RotateToEnd
  448. Else
  449. PlaySound SoundFX("fx_flipperdown",DOFFlippers), 0, 1, 0.1, 0.05
  450. RightFlipper.RotateToStart
  451. UpperFlipper.RotateToStart
  452. End If
  453. End Sub
  454.  
  455. '****************************
  456. ' Drain holes, vuks & saucers
  457. '****************************
  458. Sub Drain_Hit:PlaySound "fx_drain":bsTrough.AddBall Me:End Sub
  459. Sub LeftEject_Hit:PlaySound "fx_kicker_enter", 0, 1, -0.05, 0.05:bsLeftEject.AddBall 0:End Sub 'Sand Trap Eject
  460. ' Sub sw44a_Hit:PlaySound "Trough1", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  461. ' Sub sw44b_Hit:PlaySound "Trough1", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  462. ' Sub sw44c_Hit:PlaySound "Trough1", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  463. ' Sub sw44d_Hit:PlaySound "Trough1", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  464. ' Sub sw44e_Hit:PlaySound "Trough1", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  465. ' Sub sw44f_Hit:PlaySound "Trough1", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  466. ' Sub sw44g_Hit:PlaySound "Trough1", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  467. ' Sub sw44h_Hit:PlaySound "Trough2", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  468. ' Sub sw44i_Hit:PlaySound "Trough2", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  469. ' Sub behindleftgofer_Hit:PlaySound "BehindLeftGofer", 0, 1, -0.05, 0.05:Me.DestroyBall:vpmTimer.PulseSwitch(67),100,"HandlePuttOut":End Sub
  470. ' Sub rightpopperjam_Hit:PlaySound "Right_Hit", 0, 1, 0.05, 0.05:Me.DestroyBall:vpmTimer.PulseSwitch(45),160,"HandleRightGofer":End Sub
  471.  
  472. Dim xball,yball
  473. Sub behindleftgofer_Hit
  474. PlaySound "BehindLeftGofer", 0, 1, -0.05, 0.05
  475. Set xball = ActiveBall
  476. Me.TimerEnabled = 1
  477. Me.TimerInterval = 10
  478. Me.Enabled = 0
  479. End Sub
  480.  
  481. Sub behindleftgofer_Timer()
  482. Do While xball.Z > 0
  483. xball.Z = xball.Z -5
  484. Exit Sub
  485. Loop
  486. Me.DestroyBall
  487. Me.TimerEnabled = 0
  488. Me.Enabled = 1
  489. vpmTimer.PulseSwitch(67),100,"HandlePuttOut"
  490. End Sub
  491.  
  492. Sub rightpopperjam_Hit
  493. PlaySound "Right_Hit", 0, 1, 0.05, 0.05
  494. Set yball = ActiveBall
  495. Me.TimerEnabled = 1
  496. Me.TimerInterval = 10
  497. Me.Enabled = 0
  498. End Sub
  499.  
  500. Sub rightpopperjam_Timer()
  501. Do While yball.Z > 0
  502. yball.Z = yball.Z -5
  503. Exit Sub
  504. Loop
  505. Me.DestroyBall
  506. Me.TimerEnabled = 0
  507. Me.Enabled = 1
  508. vpmTimer.PulseSwitch(45),160,"HandleRightGofer"
  509. End Sub
  510.  
  511. Sub subwayend_Hit:bsJetPopper.AddBall Me:End Sub 'Underground Pass
  512. Sub holeinone_Hit:PlaySound "holeinone", 0, 1, 0.05, 0.05:Me.DestroyBall:vpmTimer.PulseSwitch(68),160,"HandleTopHole":End Sub
  513. Sub HandleTopHole(swNo):vpmTimer.PulseSwitch(67),100,"HandlePuttOut":End Sub
  514. Sub HandlePuttOut(swNo):bsPuttOutPopper.AddBall 0:End Sub
  515. Sub HandleRightGofer(swNo):bsUpperRightEject.AddBall 0:End Sub
  516.  
  517. ' Puttout Holes Animation
  518. Dim hole1, hole2, hole3, hole4, hole5, hole6, hole7, hole8, hole9
  519. Dim aBall, bBall, cBall, dBall, eBall, fBall, gBall, hBall, iBall
  520. ' sw44a
  521. set hole1 = (New CHole)(sw44a, aBall)
  522. Sub sw44a_Hit : hole1.Hit : End Sub
  523. Sub sw44a_Timer : hole1.Timer : End Sub
  524. ' sw44b
  525. set hole2 = (New CHole)(sw44b, bBall)
  526. Sub sw44b_Hit : hole2.Hit : End Sub
  527. Sub sw44b_Timer : hole2.Timer : End Sub
  528. ' sw44c
  529. set hole3 = (New CHole)(sw44c, cBall)
  530. Sub sw44c_Hit : hole3.Hit : End Sub
  531. Sub sw44c_Timer : hole3.Timer : End Sub
  532. ' sw44d
  533. set hole4 = (New CHole)(sw44d, dBall)
  534. Sub sw44d_Hit : hole4.Hit : End Sub
  535. Sub sw44d_Timer : hole4.Timer : End Sub
  536. ' sw44e
  537. set hole5 = (New CHole)(sw44e, eBall)
  538. Sub sw44e_Hit : hole5.Hit : End Sub
  539. Sub sw44e_Timer : hole5.Timer : End Sub
  540. ' sw44f
  541. set hole6 = (New CHole)(sw44f, fBall)
  542. Sub sw44f_Hit : hole6.Hit : End Sub
  543. Sub sw44f_Timer : hole6.Timer : End Sub
  544. ' sw44g
  545. set hole7 = (New CHole)(sw44g, gBall)
  546. Sub sw44g_Hit : hole7.Hit : End Sub
  547. Sub sw44g_Timer : hole7.Timer : End Sub
  548. ' sw44h
  549. set hole8 = (New CHole)(sw44h, hBall)
  550. Sub sw44h_Hit : hole8.Hit : End Sub
  551. Sub sw44h_Timer : hole8.Timer : End Sub
  552. ' sw441
  553. set hole9 = (New CHole)(sw44i, iBall)
  554. Sub sw44i_Hit : hole9.Hit : End Sub
  555. Sub sw44i_Timer : hole9.Timer : End Sub
  556.  
  557. Class CHole
  558. Private m_hole ' kicker object that handles the physics
  559. Private m_ball ' variabile used for animation
  560.  
  561. Public Default Function Init(kickerObj, m_ball)
  562. set m_hole = kickerObj
  563. set Init = Me
  564. End Function
  565.  
  566. Public Sub Hit()
  567. PlaySound "Trough1", 0, 1, pan(ActiveBall)
  568. Set m_ball = ActiveBall
  569. m_hole.TimerEnabled = 1
  570. m_hole.TimerInterval = 10
  571. vpmTimer.AddTimer 200, "bsPuttOutPopper.AddBall"
  572. m_hole.Enabled = 0
  573. End Sub
  574.  
  575. Public Sub Timer()
  576. Do While m_ball.Z > 0
  577. m_ball.Z = m_ball.Z -5
  578. Exit Sub
  579. Loop
  580. m_hole.DestroyBall
  581. m_hole.TimerEnabled = 0
  582. m_hole.Enabled = 1
  583. End Sub
  584. End Class
  585.  
  586. '***************
  587. ' Slingshots
  588. '***************
  589. '**********Sling Shot Animations
  590. ' Rstep and Lstep are the variables that increment the animation
  591. '****************
  592. Dim RStep, Lstep
  593.  
  594. Sub RightSlingShot_Slingshot
  595. PlaySound SoundFX("right_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  596. vpmTimer.PulseSw 52
  597. RSling.Visible = 0
  598. RSling1.Visible = 1
  599. sling1.TransZ = -20
  600. RStep = 0
  601. RightSlingShot.TimerEnabled = 1
  602. End Sub
  603.  
  604. Sub RightSlingShot_Timer
  605. Select Case RStep
  606. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  607. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0
  608. End Select
  609. RStep = RStep + 1
  610. End Sub
  611.  
  612. Sub LeftSlingShot_Slingshot
  613. PlaySound SoundFX("left_slingshot",DOFContactors), 0, 1, -0.05, 0.05
  614. vpmTimer.PulseSw 51
  615. LSling.Visible = 0
  616. LSling1.Visible = 1
  617. sling2.TransZ = -20
  618. LStep = 0
  619. LeftSlingShot.TimerEnabled = 1
  620. End Sub
  621.  
  622. Sub LeftSlingShot_Timer
  623. Select Case LStep
  624. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  625. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0
  626. End Select
  627. LStep = LStep + 1
  628. End Sub
  629.  
  630. '***************
  631. ' Bumpers
  632. '***************
  633. Sub Bumper1_Hit:vpmTimer.PulseSw 54:PlaySound SoundFX("RightBumper_Hit",DOFContactors), 0, 1, -0.03, 0.05:End Sub
  634. Sub Bumper2_Hit:vpmTimer.PulseSw 53:PlaySound SoundFX("TopBumper_Hit",DOFContactors), 0, 1, -0.05, 0.05:End Sub
  635. Sub Bumper3_Hit:vpmTimer.PulseSw 55:PlaySound SoundFX("LeftBumper_Hit",DOFContactors), 0, 1, -0.05, 0.05:End Sub
  636.  
  637.  
  638. '************
  639. ' Spinners
  640. '************
  641. Sub Spinner1_Spin():vpmTimer.PulseSwitch(61),0,"":PlaySound "fx_spinner", 0, 1, -0.05, 0.05: End Sub
  642. Sub Spinner2_Spin():vpmTimer.PulseSwitch(62),0,"":PlaySound "fx_spinner", 0, 1, 0.05, 0.05: End Sub
  643.  
  644. '*********************
  645. ' Switches & Rollovers
  646. '*********************
  647. Sub sw18_Hit:Controller.Switch(18)=1:PlaySound "fx_sensor":End Sub
  648. Sub sw18_UnHit:Controller.Switch(18)=0:End Sub
  649. Sub sw16_Hit:Controller.Switch(16)=1:PlaySound "fx_sensor":End Sub
  650. Sub sw16_UnHit:Controller.Switch(16)=0:End Sub
  651. Sub sw17_Hit:Controller.Switch(17)=1:PlaySound "fx_sensor":End Sub
  652. Sub sw17_UnHit:Controller.Switch(17)=0:End Sub
  653. Sub sw26_Hit:Controller.Switch(26)=1:PlaySound "fx_sensor":End Sub
  654. Sub sw26_UnHit:Controller.Switch(26)=0:End Sub
  655. Sub sw27_Hit:Controller.Switch(27)=1:PlaySound "fx_sensor":End Sub
  656. Sub sw27_UnHit:Controller.Switch(27)=0:End Sub
  657. Sub sw28_Hit:Controller.Switch(28)=1:PlaySound "fx_sensor":End Sub
  658. Sub sw28_UnHit:Controller.Switch(28)=0:End Sub
  659. Sub sw71_Hit:Controller.Switch(71)=1:PlaySound "fx_sensor":End Sub
  660. Sub sw71_UnHit:Controller.Switch(71)=0:End Sub
  661. Sub sw72_Hit:Controller.Switch(72)=1:PlaySound "fx_sensor":End Sub
  662. Sub sw72_UnHit:Controller.Switch(72)=0:End Sub
  663. Sub sw86_Hit:Controller.Switch(86)=1:PlaySound "fx_sensor":End Sub
  664. Sub sw86_UnHit:Controller.Switch(86)=0:End Sub
  665.  
  666. '***************
  667. ' Targets
  668. '***************
  669.  
  670. Sub sw23_Hit
  671. vpmTimer.PulseSw 23
  672. PlaySound SoundFX("fx_target",DOFTargets), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  673. End Sub
  674.  
  675. Sub sw56_Hit
  676. vpmTimer.PulseSw 56
  677. PlaySound SoundFX("fx_target",DOFTargets), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  678. End Sub
  679.  
  680. Sub sw57_Hit
  681. vpmTimer.PulseSw 57
  682. PlaySound SoundFX("fx_target",DOFTargets), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  683. End Sub
  684.  
  685. Sub sw58_Hit
  686. vpmTimer.PulseSw 58
  687. PlaySound SoundFX("fx_target",DOFTargets), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  688. End Sub
  689.  
  690. Sub sw77_Hit
  691. vpmTimer.PulseSw 77
  692. PlaySound SoundFX("fx_target",DOFTargets), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  693. End Sub
  694.  
  695. Sub sw81_Hit
  696. vpmTimer.PulseSw 81
  697. PlaySound SoundFX("fx_target",DOFTargets), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  698. End Sub
  699.  
  700. Sub sw82_Hit
  701. vpmTimer.PulseSw 82
  702. PlaySound SoundFX("fx_target",DOFTargets), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  703. End Sub
  704.  
  705. Sub sw83_Hit
  706. vpmTimer.PulseSw 83
  707. PlaySound SoundFX("fx_target",DOFTargets), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  708. End Sub
  709.  
  710. Sub sw84_Hit
  711. vpmTimer.PulseSw 84
  712. PlaySound SoundFX("fx_target",DOFTargets), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  713. End Sub
  714.  
  715. Sub sw85_Hit
  716. vpmTimer.PulseSw 85
  717. PlaySound SoundFX("fx_target",DOFTargets), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  718. End Sub
  719.  
  720. '*********************
  721. ' Random Switches
  722. '*********************
  723. Sub Gate4_Hit():vpmTimer.PulseSw 12:End Sub
  724. Sub sw15_Hit():vpmTimer.PulseSw 15:End Sub
  725. Sub cart_Hit():PlaySound "plastichit":vpmTimer.PulseSw 74:GolfCart.Y = 218:WheelTargetPosition.Y = 217:Me.TimerEnabled = 1:End Sub 'Golf Cart
  726. Sub cart_Timer:GolfCart.Y = 215:WheelTargetPosition.Y = 211:Me.TimerEnabled = 0:End Sub
  727. Sub sw73_Hit():vpmTimer.PulseSw 73:End Sub
  728. Sub LGofer_Hit():PlaySound "plastichit":vpmTimer.PulseSw 65:LeftGoferBlock.Y = 441:Me.TimerEnabled = 1:End Sub
  729. Sub LGofer_Timer:LeftGoferBlock.Y = 449:Me.TimerEnabled = 0:End Sub
  730. Sub RGofer_Hit():PlaySound "plastichit":vpmTimer.PulseSw 75:RightGoferBlock.Y = 516.625:Me.TimerEnabled = 1:End Sub
  731. Sub RGofer_Timer:RightGoferBlock.Y = 524.625:Me.TimerEnabled = 0:End Sub
  732.  
  733. '****************
  734. 'Gofer Animations
  735. '****************
  736.  
  737. Dim LGPos, LGDir, RGPos, RGPos2, RGDir, LrampPos, LrampDir, RrampPos, RrampDir
  738. LGPos=22:RGPos=22:LrampPos=22:RrampPos=22
  739. LGDir=0:RGDir=0:LrampDir=1:RrampDir=1
  740. LGofer.TimerEnabled=1:RGofer.TimerEnabled=1:LrampTimer.Enabled=1
  741.  
  742. Sub LGoferUp_Timer()
  743. Select Case LGPos
  744. Case 0: LeftGoferBlock.z=-20
  745. LGoferIsUp = 1
  746. LGoferUp.Enabled = 0
  747. Lramp.HeightBottom=110
  748. Case 1: LeftGoferBlock.z=-25:Lramp.HeightBottom=104
  749. Case 2: LeftGoferBlock.z=-31:Lramp.HeightBottom=102
  750. Case 3: LeftGoferBlock.z=-37:Lramp.HeightBottom=100:PlaySound SoundFX("goofer_up",DOFcontactors)
  751. Case 4: LeftGoferBlock.z=-31:Lramp.HeightBottom=102
  752. Case 5: LeftGoferBlock.z=-25:Lramp.HeightBottom=104
  753. Case 6: LeftGoferBlock.z=-20:Lramp.HeightBottom=110
  754. Case 7: LeftGoferBlock.z=-25:Lramp.HeightBottom=104
  755. Case 8: LeftGoferBlock.z=-31:Lramp.HeightBottom=98
  756. Case 9: LeftGoferBlock.z=-37:Lramp.HeightBottom=91
  757. Case 10: LeftGoferBlock.z=-43:Lramp.HeightBottom=84
  758. Case 11: LeftGoferBlock.z=-49:Lramp.HeightBottom=77
  759. Case 12: LeftGoferBlock.z=-55:Lramp.HeightBottom=70
  760. Case 13: LeftGoferBlock.z=-61:Lramp.HeightBottom=63
  761. Case 14: LeftGoferBlock.z=-67:Lramp.HeightBottom=56
  762. Case 15: LeftGoferBlock.z=-73:Lramp.HeightBottom=49
  763. Case 16: LeftGoferBlock.z=-79:Lramp.HeightBottom=42
  764. Case 17: LeftGoferBlock.z=-85:Lramp.HeightBottom=35
  765. Case 18: LeftGoferBlock.z=-91:Lramp.HeightBottom=28
  766. Case 19: LeftGoferBlock.z=-97:Lramp.HeightBottom=21
  767. Case 20: LeftGoferBlock.z=-103:Lramp.HeightBottom=14
  768. Case 21: LeftGoferBlock.z=-109:Lramp.HeightBottom=7
  769. Case 22: LeftGoferBlock.z=-115:Lramp.HeightBottom=0
  770. End Select
  771. If LGpos>0 then LGpos=LGpos-1
  772. End Sub
  773.  
  774. Sub LGoferDown_Timer()
  775. Select Case LGPos
  776. Case 0: LeftGoferBlock.z=-19
  777. Case 1: LeftGoferBlock.z=-25
  778. Case 2: LeftGoferBlock.z=-31
  779. Case 3: LeftGoferBlock.z=-37
  780. Case 4: LeftGoferBlock.z=-43
  781. Case 5: LeftGoferBlock.z=-49
  782. Case 6: LeftGoferBlock.z=-55
  783. Case 7: LeftGoferBlock.z=-61
  784. Case 8: LeftGoferBlock.z=-67
  785. Case 9: LeftGoferBlock.z=-73
  786. Case 10: LeftGoferBlock.z=-79
  787. Case 11: LeftGoferBlock.z=-85
  788. Case 12: LeftGoferBlock.z=-91
  789. Case 13: LeftGoferBlock.z=-97
  790. Case 14: LeftGoferBlock.z=-103
  791. Case 15: LeftGoferBlock.z=-109
  792. Case 16: LeftGoferBlock.z=-115
  793. LGoferDown.Enabled = 0
  794. LGoferIsUp = 0
  795. End Select
  796. If LGpos<16 then LGpos=LGpos+1
  797. End Sub
  798.  
  799. Sub RGoferUp_Timer()
  800. Select Case RGPos
  801. Case 0: RightGoferBlock.z=-20
  802. RGoferIsUp = 1
  803. RGoferUp.Enabled = 0
  804. Rramp.HeightBottom=110
  805. Case 1: RightGoferBlock.z=-25:Rramp.HeightBottom=104
  806. Case 2: RightGoferBlock.z=-31:Rramp.HeightBottom=102
  807. Case 3: RightGoferBlock.z=-37:Rramp.HeightBottom=100:PlaySound SoundFX("goofer_up",DOFContactors)
  808. Case 4: RightGoferBlock.z=-31:Rramp.HeightBottom=102
  809. Case 5: RightGoferBlock.z=-25:Rramp.HeightBottom=104
  810. Case 6: RightGoferBlock.z=-20:Rramp.HeightBottom=110
  811. Case 7: RightGoferBlock.z=-25:Rramp.HeightBottom=104
  812. Case 8: RightGoferBlock.z=-31:Rramp.HeightBottom=98
  813. Case 9: RightGoferBlock.z=-37:Rramp.HeightBottom=91
  814. Case 10: RightGoferBlock.z=-43:Rramp.HeightBottom=84
  815. Case 11: RightGoferBlock.z=-49:Rramp.HeightBottom=77
  816. Case 12: RightGoferBlock.z=-55:Rramp.HeightBottom=70
  817. Case 13: RightGoferBlock.z=-61:Rramp.HeightBottom=63
  818. Case 14: RightGoferBlock.z=-67:Rramp.HeightBottom=56
  819. Case 15: RightGoferBlock.z=-73:Rramp.HeightBottom=49
  820. Case 16: RightGoferBlock.z=-79:Rramp.HeightBottom=42
  821. Case 17: RightGoferBlock.z=-85:Rramp.HeightBottom=35
  822. Case 18: RightGoferBlock.z=-91:Rramp.HeightBottom=28
  823. Case 19: RightGoferBlock.z=-97:Rramp.HeightBottom=21
  824. Case 20: RightGoferBlock.z=-103:Rramp.HeightBottom=14
  825. Case 21: RightGoferBlock.z=-109:Rramp.HeightBottom=7
  826. Case 22: RightGoferBlock.z=-115:Rramp.HeightBottom=0
  827. End Select
  828. If RGpos>0 then RGpos=RGpos-1
  829. End Sub
  830.  
  831. Sub RGoferDown_Timer()
  832. Select Case RGPos
  833. Case 0: RightGoferBlock.z=-19
  834. Case 1: RightGoferBlock.z=-25
  835. Case 2: RightGoferBlock.z=-31
  836. Case 3: RightGoferBlock.z=-37
  837. Case 4: RightGoferBlock.z=-43
  838. Case 5: RightGoferBlock.z=-49
  839. Case 6: RightGoferBlock.z=-55
  840. Case 7: RightGoferBlock.z=-61
  841. Case 8: RightGoferBlock.z=-67
  842. Case 9: RightGoferBlock.z=-73
  843. Case 10: RightGoferBlock.z=-79
  844. Case 11: RightGoferBlock.z=-85
  845. Case 12: RightGoferBlock.z=-91
  846. Case 13: RightGoferBlock.z=-97
  847. Case 14: RightGoferBlock.z=-103
  848. Case 15: RightGoferBlock.z=-109
  849. Case 16: RightGoferBlock.z=-115
  850. RGoferDown.Enabled = 0
  851. RGoferIsUp = 0
  852. End Select
  853. If RGpos<16 then RGpos=RGpos+1
  854. End Sub
  855.  
  856. Sub LrampTimer_Timer()
  857. If LGoferIsUp = 0 Then
  858. Select Case LrampPos
  859. Case 0: Lramp.HeightBottom=110
  860. Case 1: Lramp.HeightBottom=104
  861. Case 2: Lramp.HeightBottom=102
  862. Case 3: Lramp.HeightBottom=100
  863. Case 4: Lramp.HeightBottom=102
  864. Case 5: Lramp.HeightBottom=104
  865. Case 6: Lramp.HeightBottom=110
  866. Case 7: Lramp.HeightBottom=104
  867. Case 8: Lramp.HeightBottom=98
  868. Case 9: Lramp.HeightBottom=91
  869. Case 10: Lramp.HeightBottom=84
  870. Case 11: Lramp.HeightBottom=77
  871. Case 12: Lramp.HeightBottom=70
  872. Case 13: Lramp.HeightBottom=63
  873. Case 14: Lramp.HeightBottom=56
  874. Case 15: Lramp.HeightBottom=49
  875. Case 16: Lramp.HeightBottom=42
  876. Case 17: Lramp.HeightBottom=35
  877. Case 18: Lramp.HeightBottom=28
  878. Case 19: Lramp.HeightBottom=21
  879. Case 20: Lramp.HeightBottom=14
  880. Case 21: Lramp.HeightBottom=7
  881. Case 22: Lramp.HeightBottom=0:Controller.Switch(47)=1:LeftRampUp = 0:LrampTimer.Enabled = 0
  882. If Lramppos<22 then Lramppos=Lramppos+1
  883. End Select
  884. End If
  885. End Sub
  886.  
  887.  
  888. Sub RrampTimer_Timer()
  889. If RGoferIsUp = 0 Then
  890. Select Case RrampPos
  891. Case 0: Rramp.HeightBottom=110
  892. Case 1: Rramp.HeightBottom=104
  893. Case 2: Rramp.HeightBottom=102
  894. Case 3: Rramp.HeightBottom=100
  895. Case 4: Rramp.HeightBottom=102
  896. Case 5: Rramp.HeightBottom=104
  897. Case 6: Rramp.HeightBottom=110
  898. Case 7: Rramp.HeightBottom=104
  899. Case 8: Rramp.HeightBottom=98
  900. Case 9: Rramp.HeightBottom=91
  901. Case 10: Rramp.HeightBottom=84
  902. Case 11: Rramp.HeightBottom=77
  903. Case 12: Rramp.HeightBottom=70
  904. Case 13: Rramp.HeightBottom=63
  905. Case 14: Rramp.HeightBottom=56
  906. Case 15: Rramp.HeightBottom=49
  907. Case 16: Rramp.HeightBottom=42
  908. Case 17: Rramp.HeightBottom=35
  909. Case 18: Rramp.HeightBottom=28
  910. Case 19: Rramp.HeightBottom=21
  911. Case 20: Rramp.HeightBottom=14
  912. Case 21: Rramp.HeightBottom=7
  913. Case 22: Rramp.HeightBottom=0:Controller.Switch(48)=1:RightRampUp = 0:RrampTimer.Enabled = 0
  914. If Rramppos<22 then Rramppos=Rramppos+1
  915. End Select
  916. End If
  917. End Sub
  918.  
  919. '**************
  920. 'Turntable Subs
  921. '**************
  922.  
  923. Set MotorCallback=GetRef("SRPRoutine")
  924. Dim WheelSpeed, WheelCW, WheelPosPrev
  925.  
  926. Sub SRPRoutine
  927. FlipperLP.RotY = LeftFlipper.CurrentAngle
  928. FlipperRP.RotY = RightFlipper.CurrentAngle
  929. FlipperRUP.RotY = UpperFlipper.CurrentAngle
  930. Dim WheelPos
  931.  
  932. WheelPos = Controller.GetMech(4)
  933. If WheelPos = WheelPosPrev Then Exit Sub
  934. WheelPosPrev = WheelPos
  935. DOF 102, DOFPulse
  936. WheelSpeed = INT(Controller.GetMech(5))
  937. If WheelSpeed < 0 Then
  938. WheelCW = True
  939. BlurDir = 1
  940. WheelSpeed = ABS(WheelSpeed)
  941. Else
  942. BlurDir = 0
  943. WheelCW = False
  944. End If
  945.  
  946. if WheelSpeed > 50 Then
  947. mTT.SolMotorState WheelCW,True
  948. mTT.Speed = WheelSpeed
  949. Else
  950. mTT.SolMotorState WheelCW,False
  951. end if
  952. if WheelSpeed > 95 Then
  953. Blur.Enabled = 1
  954. Else
  955. if Blur.Enabled Then
  956. Blur.Enabled = 0
  957. disc.image = "NGG_Map"
  958. End If
  959. end if
  960. disc.roty = 360 - WheelPos + 32
  961. End Sub
  962.  
  963. Dim DiskArray, BlurDir, Blurlevel
  964. DiskArray=Array("12","350","335","305","282","258","235","215","190","168","146","125","100","80","55","32")
  965. Blurlevel = 1
  966. Sub Blur_Timer()
  967. Select Case Blurlevel
  968. Case 1: disc.image = "NGG_Map_Mblur1"
  969. Case 2: disc.image = "NGG_Map_Mblur2"
  970. Case 3: disc.image = "NGG_Map_Mblur3"
  971. Case 4: disc.image = "NGG_Map_Mblur4"
  972. Case 5: disc.image = "NGG_Map_Mblur5"
  973. Case 6: disc.image = "NGG_Map_Mblur6"
  974. If BlurDir = 0 Then
  975. Blurlevel = 1
  976. End If
  977. End Select
  978. If BlurDir = 1 Then
  979. If Blurlevel>0 then Blurlevel = Blurlevel - 1 else BlurLevel = 6
  980. Else
  981. If Blurlevel<6 Then Blurlevel = Blurlevel + 1 else BlurLevel = 1
  982. End If
  983. End Sub
  984.  
  985.  
  986. '***************************************************
  987. ' JP's VP10 Fading Lamps & Flashers
  988. ' Based on PD's Fading Light System
  989. ' SetLamp 0 is Off
  990. ' SetLamp 1 is On
  991. ' fading for non opacity objects is 4 steps
  992. '***************************************************
  993.  
  994. Dim LampState(200), FadingLevel(200)
  995. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  996.  
  997. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  998. LampTimer.Interval = 10 'lamp fading speed
  999. LampTimer.Enabled = 1
  1000.  
  1001. ' Lamp & Flasher Timers
  1002.  
  1003. Sub LampTimer_Timer()
  1004. Dim chgLamp, num, chg, ii
  1005. chgLamp = Controller.ChangedLamps
  1006. If Not IsEmpty(chgLamp) Then
  1007. For ii = 0 To UBound(chgLamp)
  1008. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  1009. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  1010. Next
  1011. End If
  1012. UpdateLamps
  1013. End Sub
  1014.  
  1015.  
  1016. Sub UpdateLamps
  1017. NFadeL 11, L11
  1018. NFadeL 12, L12
  1019. NFadeL 13, L13
  1020. NFadeL 14, L14
  1021. NFadeL 15, L15
  1022. NFadeL 16, L16
  1023. NFadeL 17, L17
  1024. NFadeL 18, L18
  1025. NFadeL 21, L21
  1026. NFadeL 22, L22
  1027. NFadeL 23, L23
  1028. NFadeL 24, L24
  1029. NFadeL 25, L25
  1030. NFadeL 26, L26
  1031. NFadeL 27, L27
  1032. NFadeL 28, L28
  1033. NFadeL 31, L31
  1034. NFadeL 32, L32
  1035. NFadeL 33, L33
  1036. NFadeL 34, L34
  1037. NFadeL 35, L35
  1038. NFadeL 36, L36
  1039. NFadeL 37, L37
  1040. NFadeL 38, L38
  1041. NFadeL 41, L41
  1042. NFadeL 42, L42
  1043. NFadeL 43, L43
  1044. NFadeL 44, L44
  1045. NFadeL 45, L45
  1046. NFadeL 46, L46
  1047. NFadeL 47, L47
  1048. NFadeL 48, L48
  1049. NFadeL 51, L51
  1050. NFadeL 52, L52
  1051. NFadeL 53, L53
  1052. NFadeL 54, L54
  1053. NFadeLm 55, L55b
  1054. NFadeL 55, L55
  1055. NFadeL 56, L56
  1056. NFadeL 57, L57
  1057. NFadeL 58, L58
  1058. NFadeL 61, L61
  1059. NFadeL 62, L62
  1060. NFadeL 63, L63
  1061. NFadeL 64, L64
  1062. NFadeL 65, L65
  1063. NFadeL 66, L66
  1064. NFadeL 67, L67
  1065. NFadeL 68, L68
  1066. NFadeLm 71, L71b
  1067. NFadeL 71, L71
  1068. NFadeL 72, L72
  1069. NFadeL 73, L73
  1070. NFadeL 74, L74
  1071. NFadeL 75, L75
  1072. NFadeL 76, L76
  1073. NFadeL 77, L77
  1074. NFadeLm 78, bump3light1
  1075. NFadeL 78, bump3light
  1076. NFadeL 81, L81
  1077. NFadeL 82, L82
  1078. NFadeL 83, L83
  1079. NFadeL 84, L84
  1080. NFadeL 85, L85
  1081. NFadeLm 86, bump2light1
  1082. NFadeL 86, bump2light
  1083. NFadeLm 87, bump1light1
  1084. NFadeL 87, bump1light
  1085. ' FadeL 88, L88, L88a 'start button
  1086. NFadeLMod 122, L122
  1087. NFadeLMod 131, L131b
  1088. NFadeLMod 131, L131a
  1089. NFadeLMod 131, L131
  1090. NFadeLMod 145, L145
  1091. NFadeLMod 146, L146
  1092. NFadeARmCombi 145, 146, upperplayfield, "upperplayfield", "upperplayfieldright", "upperplayfieldleft", "upperplayfieldboth", Combifor145and146
  1093. NFadeLMod 170, L170b
  1094. NFadeLMod 170, L170a
  1095. NFadeLModm 170, L170, 100
  1096. NFadeLModm 172, L172a, 4
  1097. NFadeLModm 172, L172b, 2
  1098. NFadeLModm 172, L172, 50
  1099. NFadeLModm 173, L173a, 4
  1100. NFadeLModm 173, L173b, 2
  1101. NFadeLModm 173, L173, 50
  1102. NFadeLModm 174, L174a, 4
  1103. NFadeLModm 174, L174b, 2
  1104. NFadeLModm 174, L174, 50
  1105. NFadeLModm 175, L175a, 4
  1106. NFadeLModm 175, L175b, 2
  1107. NFadeLModm 175, L175, 50
  1108. NFadeLModm 176, L176a, 4
  1109. NFadeLModm 176, L176b, 2
  1110. NFadeLModm 176, L176, 50
  1111. NFadeLModm 177, L177a, 4
  1112. NFadeLModm 177, L177b, 2
  1113. NFadeLModm 177, L177, 50
  1114. NFadeLModm 178, L178a,4
  1115. NFadeLModm 178, L178b,2
  1116. NFadeLModm 178, L178,50
  1117. NFadeLModm 179, L179a, 4
  1118. NFadeLModm 179, L179b, 2
  1119. NFadeLModm 179, L179, 50
  1120. NFadeLModm 180, L180a, 4
  1121. NFadeLModm 180, L180b, 2
  1122. NFadeLMod 180, L180c
  1123. NFadeLModm 180, L180, 50
  1124. NFadeLMod 190, L190b
  1125. NFadeLMod 190, L190a
  1126. NFadeLModm 190, L190, 5
  1127. End Sub
  1128. '
  1129. 'Sub FlasherTimer_Timer()
  1130. ' Flash 11, h11
  1131. ' Flash 12, h12
  1132. ' Flash 13, h13
  1133. ' Flash 14, h14
  1134. ' Flash 15, h15
  1135. ' Flash 16, h16
  1136. ' Flash 17, h17
  1137. ' Flash 18, h18
  1138. ' Flash 21, h21
  1139. ' Flash 22, h22
  1140. ' Flash 23, h23
  1141. ' Flash 24, h24
  1142. ' Flash 25, h25
  1143. ' Flash 26, h26
  1144. ' Flash 27, h27
  1145. ' Flash 28, h28
  1146. ' Flash 31, h31
  1147. ' Flash 32, h32
  1148. ' Flash 33, h33
  1149. ' Flash 34, h34
  1150. ' Flash 35, h35
  1151. ' Flash 36, h36
  1152. ' Flash 37, h37
  1153. ' Flash 38, h38
  1154. ' Flash 41, h41
  1155. ' Flash 42, h42
  1156. ' Flash 43, h43
  1157. ' Flash 44, h44
  1158. ' Flash 45, h45
  1159. ' Flash 46, h46
  1160. ' Flash 47, h47
  1161. ' Flash 48, h48
  1162. ' Flash 51, h51
  1163. ' Flash 52, h52
  1164. ' Flash 53, h53
  1165. ' Flash 54, h54
  1166. ' Flashm 55, h55a
  1167. ' Flash 55, h55
  1168. ' Flash 56, h56
  1169. ' Flash 57, h57
  1170. ' Flash 58, h58
  1171. ' Flash 61, h61
  1172. ' Flash 62, h62
  1173. ' Flash 63, h63
  1174. ' Flash 64, h64
  1175. ' Flash 65, h65
  1176. ' Flash 66, h66
  1177. ' Flash 68, h68
  1178. ' Flashm 71, h71a
  1179. ' Flash 71, h71
  1180. ' Flash 72, h72
  1181. ' Flash 73, h73
  1182. ' Flash 74, h74
  1183. ' Flash 75, h75
  1184. ' Flash 77, h77
  1185. ' Flash 78, h78
  1186. ' Flash 81, h81
  1187. ' Flash 82, h82
  1188. ' Flash 83, h83
  1189. ' Flash 84, h84
  1190. ' Flash 85, h85
  1191. ' Flash 86, h86
  1192. ' Flash 87, h87
  1193. ' Flashm 120, Flasher19
  1194. ' Flash 120, Flasher1
  1195. ' Flashm 121, Flasher20
  1196. ' Flash 121, Flasher2
  1197. ' Flashm 122, Flasher21
  1198. ' Flashm 122, Flasher4
  1199. ' Flash 122, Flasher3
  1200. ' Flash 123, Flasher5
  1201. ' Flashm 124, Flasher15
  1202. ' Flash 124, Flasher6
  1203. ' Flashm 125, Flasher18
  1204. ' Flash 125, Flasher7
  1205. ' Flash 126, Flasher8
  1206. ' Flash 127, Flasher9
  1207. ' Flashm 128, Flasher17
  1208. ' Flash 128, Flasher10
  1209. ' Flashm 129, Flasher16
  1210. ' Flash 129, Flasher11
  1211. ' Flash 130, Flasher12
  1212. ' Flashm 131, Flasher14
  1213. ' Flash 131, Flasher13
  1214. ' End Sub
  1215. '
  1216.  
  1217. ' div lamp subs
  1218.  
  1219. Sub InitLamps()
  1220. Dim x
  1221. For x = 0 to 200
  1222. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  1223. FadingLevel(x) = 4 ' used to track the fading state
  1224. FlashSpeedUp(x) = 0.4 ' faster speed when turning on the flasher
  1225. FlashSpeedDown(x) = 0.2 ' slower speed when turning off the flasher
  1226. FlashMax(x) = 1 ' the maximum value when on, usually 1
  1227. FlashMin(x) = 0 ' the minimum value when off, usually 0
  1228. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  1229. Next
  1230. End Sub
  1231.  
  1232. Sub AllLampsOff
  1233. Dim x
  1234. For x = 0 to 200
  1235. SetLamp x, 0
  1236. Next
  1237. End Sub
  1238.  
  1239. Sub SetLamp(nr, value)
  1240. If value <> LampState(nr) Then
  1241. LampState(nr) = abs(value)
  1242. FadingLevel(nr) = abs(value) + 4
  1243. End If
  1244. End Sub
  1245.  
  1246. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  1247.  
  1248. Sub NFadeL(nr, object)
  1249. Select Case FadingLevel(nr)
  1250. Case 4:object.state = 0:FadingLevel(nr) = 0
  1251. Case 5:object.state = 1:FadingLevel(nr) = 1
  1252. End Select
  1253. End Sub
  1254.  
  1255. Sub NFadeLm(nr, object) ' used for multiple lights
  1256. Select Case FadingLevel(nr)
  1257. Case 4:object.state = 0
  1258. Case 5:object.state = 1
  1259. End Select
  1260. End Sub
  1261.  
  1262. Sub SetModLamp(nr, level)
  1263. FadingLevel(nr) = level
  1264. End Sub
  1265.  
  1266.  
  1267. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  1268.  
  1269. Sub NFadeLMod(nr, object) '3 lights
  1270. object.Intensity = FadingLevel(nr)*10 / 25
  1271. object.state = 1
  1272. object.visible = 1
  1273. End Sub
  1274.  
  1275. Sub NFadeLModm(nr, object, maxlev) ' used for multiple lights
  1276. object.Intensity = FadingLevel(nr) * maxlev / 255
  1277. object.state = 1
  1278. object.visible = 1
  1279. End Sub
  1280.  
  1281. 'Lights, Ramps & Primitives used as 4 step fading lights
  1282. 'a,b,c,d are the images used from on to off
  1283.  
  1284. Sub FadeObj(nr, object, a, b, c, d)
  1285. Select Case FadingLevel(nr)
  1286. Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
  1287. Case 5:object.image = a:FadingLevel(nr) = 1 'ON
  1288. Case 6, 7.8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1289. Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1290. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1291. Case 13:object.image = d:FadingLevel(nr) = 0 'Off
  1292. End Select
  1293. End Sub
  1294.  
  1295. Sub FadeObjm(nr, object, a, b, c, d)
  1296. Select Case FadingLevel(nr)
  1297. Case 4:object.image = b
  1298. Case 5:object.image = a
  1299. Case 9:object.image = c
  1300. Case 13:object.image = d
  1301. End Select
  1302. End Sub
  1303.  
  1304. Sub NFadeObj(nr, object, a, b)
  1305. Select Case FadingLevel(nr)
  1306. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  1307. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  1308. End Select
  1309. End Sub
  1310.  
  1311. Sub NFadeObjm(nr, object, a, b)
  1312. Select Case FadingLevel(nr)
  1313. Case 4:object.image = b
  1314. Case 5:object.image = a
  1315. End Select
  1316. End Sub
  1317.  
  1318. ' Flasher objects
  1319.  
  1320. Sub Flash(nr, object)
  1321. Select Case FadingLevel(nr)
  1322. Case 4 'off
  1323. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  1324. If FlashLevel(nr) < FlashMin(nr) Then
  1325. FlashLevel(nr) = FlashMin(nr)
  1326. FadingLevel(nr) = 0 'completely off
  1327. End if
  1328. Object.IntensityScale = FlashLevel(nr)
  1329. Case 5 ' on
  1330. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  1331. If FlashLevel(nr) > FlashMax(nr) Then
  1332. FlashLevel(nr) = FlashMax(nr)
  1333. FadingLevel(nr) = 1 'completely on
  1334. End if
  1335. Object.IntensityScale = FlashLevel(nr)
  1336. End Select
  1337. End Sub
  1338.  
  1339. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  1340. Object.IntensityScale = FlashLevel(nr)
  1341. End Sub
  1342.  
  1343. ' Desktop Objects: Reels & texts (you may also use lights on the desktop)
  1344.  
  1345. ' Reels
  1346. Dim NewCombiResult, Combifor145and146
  1347. Sub NFadeARmCombi(nr1, nr2, ramp, aOff, a1, a2, aBoth, OldCombiResult)
  1348. NewCombiResult=LampState(nr1)+(2*LampState(nr2))
  1349. If OldCombiResult=NewCombiResult Then Exit Sub
  1350. Select Case NewCombiResult
  1351. Case 0:ramp.image=aOff
  1352. Case 1:ramp.image=a1
  1353. Case 2:ramp.image=a2
  1354. Case 3:ramp.image=aBoth
  1355. End Select
  1356. OldCombiResult=NewCombiResult
  1357. End Sub
  1358.  
  1359. Sub FadeR(nr, object)
  1360. Select Case FadingLevel(nr)
  1361. Case 4:object.SetValue 1:FadingLevel(nr) = 6 'fading to off...
  1362. Case 5:object.SetValue 0:FadingLevel(nr) = 1 'ON
  1363. Case 6, 7.8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1364. Case 9:object.SetValue 2:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1365. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1366. Case 13:object.SetValue 3:FadingLevel(nr) = 0 'Off
  1367. End Select
  1368. End Sub
  1369.  
  1370. Sub FadeRm(nr, object)
  1371. Select Case FadingLevel(nr)
  1372. Case 4:object.SetValue 1
  1373. Case 5:object.SetValue 0
  1374. Case 9:object.SetValue 2
  1375. Case 3:object.SetValue 3
  1376. End Select
  1377. End Sub
  1378.  
  1379. 'Texts
  1380.  
  1381. Sub NFadeT(nr, object, message)
  1382. Select Case FadingLevel(nr)
  1383. Case 4:object.Text = "":FadingLevel(nr) = 0
  1384. Case 5:object.Text = message:FadingLevel(nr) = 1
  1385. End Select
  1386. End Sub
  1387.  
  1388. Sub NFadeTm(nr, object, b)
  1389. Select Case FadingLevel(nr)
  1390. Case 4:object.Text = ""
  1391. Case 5:object.Text = message
  1392. End Select
  1393. End Sub
  1394.  
  1395. '***********
  1396. ' Update GI
  1397. '***********
  1398. Dim gistep, Giswitch
  1399. Giswitch = 0
  1400.  
  1401. Sub UpdateGIOn(no, Enabled)
  1402. Select Case no
  1403. Case 0 'GIright
  1404. If Enabled Then
  1405. DOF 103, DOFOn
  1406. For each xx in GIright:xx.State = 1: Next
  1407. Else
  1408. DOF 103, DOFOff
  1409. For each xx in GIright:xx.state = 0: Next
  1410. End If
  1411. Case 1
  1412. If Enabled Then
  1413. For Each xx in GIleft:xx.state = 1: Next
  1414. else
  1415. For Each xx in GIleft:xx.state = 0: Next
  1416. End If
  1417. Case 2
  1418. If Enabled Then
  1419. For Each xx in GIother:xx.state = 1: Next
  1420. Else
  1421. For Each xx in GIother:xx.state = 0: Next
  1422. End If
  1423. End Select
  1424. End Sub
  1425.  
  1426.  
  1427. Sub UpdateGI(no, step)
  1428. Dim ii
  1429. 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...
  1430. gistep = (step-1) / 7
  1431. Select Case no
  1432. Case 0
  1433. For each ii in GIleft
  1434. ii.IntensityScale = gistep
  1435. Next
  1436. Case 1
  1437. For each ii in GIright
  1438. ii.IntensityScale = gistep
  1439. Next
  1440. Case 2 ' also the bumpers er GI
  1441. For each ii in GIother
  1442. ii.IntensityScale = gistep
  1443. Next
  1444. Select case gistep
  1445. Case 0
  1446. GolfCart.image = "GolfCartMap"
  1447. Case 1
  1448. GolfCart.image = "GolfCartMap_ON1"
  1449. Case 2
  1450. GolfCart.image = "GolfCartMap_ON1"
  1451. Case 3
  1452. GolfCart.image = "GolfCartMap_ON2"
  1453. Case 4
  1454. GolfCart.image = "GolfCartMap_ON3"
  1455. Case 5
  1456. GolfCart.image = "GolfCartMap_ON4"
  1457. Case 6
  1458. GolfCart.image = "GolfCartMap_ON4"
  1459. Case 7
  1460. GolfCart.image = "GolfCartMap_ON5"
  1461. End Select
  1462. End Select
  1463. ' ' change the intensity of the flasher depending on the gi to compensate for the gi lights being off
  1464. ' For ii = 0 to 200
  1465. ' FlashMax(ii) = 6 - gistep * 3 ' the maximum value of the flashers
  1466. ' Next
  1467. End Sub
  1468.  
  1469.  
  1470. '''Ramp Helpers
  1471.  
  1472. 'Sub centerramphelper_Hit():ActiveBall.Vely=ActiveBall.Vely*1.3:End Sub
  1473. 'Sub centerramphelper2_Hit():Activeball.Velx=ActiveBall.Velx-20:End Sub
  1474. 'Sub upperhelper_Hit():ActiveBall.Velx=ActiveBall.Velx*1.2:End Sub
  1475. 'Sub upperhelper2_Hit():ActiveBall.Vely=ActiveBall.Vely*1.3:End Sub
  1476. 'Sub jumpramptrigger_Hit():ActiveBall.Vely=ActiveBall.Vely*1.3:End Sub
  1477. 'Sub upperjump_Hit():ActiveBall.Vely=ActiveBall.Vely*1.5:End Sub
  1478. 'Sub upperjump_UnHit():ActiveBall.Velz=ActiveBall.Velz=0:End Sub
  1479.  
  1480.  
  1481. Sub Game_timer()
  1482. slamrampP.z = Flipper1.CurrentAngle
  1483. If RightRampUp = 0 Then RrampTimer.Enabled = 1
  1484. If LeftRampUp = 0 Then LRampTimer.Enabled = 1
  1485. End Sub
  1486.  
  1487.  
  1488.  
  1489. ' *********************************************************************
  1490. ' Supporting Ball & Sound Functions
  1491. ' *********************************************************************
  1492.  
  1493. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1494. Vol = Csng(BallVel(ball) ^2 / 800)
  1495. End Function
  1496.  
  1497. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table" is the name of the table
  1498. Dim tmp
  1499. tmp = ball.x * 2 / table.width-1
  1500. If tmp > 0 Then
  1501. Pan = Csng(tmp ^10)
  1502. Else
  1503. Pan = Csng(-((- tmp) ^10) )
  1504. End If
  1505. End Function
  1506.  
  1507. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1508. Pitch = BallVel(ball) * 20
  1509. End Function
  1510.  
  1511. Function BallVel(ball) 'Calculates the ball speed
  1512. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1513. End Function
  1514.  
  1515. '*****************************************
  1516. ' JP's VP10 Rolling Sounds
  1517. '*****************************************
  1518.  
  1519. Const tnob = 8 ' total number of balls in this table is 4, but always use a higher number here bacuse of the timing
  1520. ReDim rolling(tnob)
  1521. InitRolling
  1522.  
  1523. Sub InitRolling
  1524. Dim i
  1525. For i = 0 to tnob
  1526. rolling(i) = False
  1527. Next
  1528. End Sub
  1529.  
  1530. Sub RollingTimer_Timer()
  1531. Dim BOT, b
  1532. BOT = GetBalls
  1533.  
  1534. ' stop the sound of deleted balls
  1535. For b = UBound(BOT) + 1 to tnob
  1536. rolling(b) = False
  1537. StopSound("fx_ballrolling" & b)
  1538. Next
  1539.  
  1540. ' exit the sub if no balls on the table
  1541. If UBound(BOT) = -1 Then Exit Sub
  1542.  
  1543. ' play the rolling sound for each ball
  1544. For b = 0 to UBound(BOT)
  1545. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1546. rolling(b) = True
  1547. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1548. Else
  1549. If rolling(b) = True Then
  1550. StopSound("fx_ballrolling" & b)
  1551. rolling(b) = False
  1552. End If
  1553. End If
  1554. Next
  1555. End Sub
  1556.  
  1557. '**********************
  1558. ' Ball Collision Sound
  1559. '**********************
  1560.  
  1561. Sub OnBallBallCollision(ball1, ball2, velocity)
  1562. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1563. End Sub
  1564.  
  1565. Sub platformdrop_Unhit()
  1566. If ActiveBall.Vely>0 then PlaySound "ball_bounce"
  1567. End Sub
  1568.  
  1569. Sub rightrampdrop_UnHit():PlaySound "ball_bounce":End Sub
  1570. Sub leftrampdrop_UnHit():PlaySound "ball_bounce":End Sub
  1571.  
  1572. Sub jumpramptrigger_Hit():PlaySound "metalhit_medium":End Sub
  1573.  
  1574. Sub Pins_Hit (idx)
  1575. PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1576. End Sub
  1577.  
  1578. Sub Targets_Hit (idx)
  1579. PlaySound "target", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1580. End Sub
  1581.  
  1582. Sub Metals_Thin_Hit (idx)
  1583. PlaySound "metalhit_thin", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1584. End Sub
  1585.  
  1586. Sub Metals_Medium_Hit (idx)
  1587. PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1588. End Sub
  1589.  
  1590. Sub Metals2_Hit (idx)
  1591. PlaySound "metalhit2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1592. End Sub
  1593.  
  1594. Sub Gates_Hit (idx)
  1595. PlaySound "gate4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1596. End Sub
  1597.  
  1598. Sub Rubbers_Hit(idx)
  1599. dim finalspeed
  1600. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1601. If finalspeed > 20 then
  1602. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1603. End if
  1604. If finalspeed >= 6 AND finalspeed <= 20 then
  1605. RandomSoundRubber()
  1606. End If
  1607. End Sub
  1608.  
  1609. Sub Posts_Hit(idx)
  1610. dim finalspeed
  1611. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1612. If finalspeed > 16 then
  1613. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1614. End if
  1615. If finalspeed >= 6 AND finalspeed <= 16 then
  1616. RandomSoundRubber()
  1617. End If
  1618. End Sub
  1619.  
  1620. Sub RandomSoundRubber()
  1621. Select Case Int(Rnd*3)+1
  1622. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1623. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1624. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1625. End Select
  1626. End Sub
  1627.  
  1628. Sub LeftFlipper_Collide(parm)
  1629. RandomSoundFlipper()
  1630. End Sub
  1631.  
  1632. Sub RightFlipper_Collide(parm)
  1633. RandomSoundFlipper()
  1634. End Sub
  1635.  
  1636. Sub UpperFlipper_Collide(parm)
  1637. RandomSoundFlipper()
  1638. End Sub
  1639.  
  1640. Sub RandomSoundFlipper()
  1641. Select Case Int(Rnd*3)+1
  1642. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1643. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1644. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1645. End Select
  1646. End Sub
  1647.  
  1648. Sub upperjump_UnHit():ActiveBall.Velz=ActiveBall.Velz=0:End Sub
  1649.  
  1650. Sub LHelp_Hit
  1651. dim finalspeed
  1652. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1653. If finalspeed < 3 then activeball.vely=-15
  1654. End Sub
  1655.  
  1656. Sub RHelp_Hit
  1657. dim finalspeed
  1658. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1659. If finalspeed < 3 then activeball.vely=-12
  1660. End Sub
  1661.  
  1662. Dim SoundBall
  1663.  
  1664. Sub MRampSStart_Hit()
  1665. Set SoundBall = ActiveBall
  1666. PlaySound "plasticrolling", 1, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1667. End Sub
  1668.  
  1669. Sub MRampSStart1_Hit()
  1670. Set SoundBall = ActiveBall
  1671. PlaySound "ball_bounce"
  1672. PlaySound "plasticrolling", 1, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1673. End Sub
  1674.  
  1675. Sub LRampSStart_Hit()
  1676. Set SoundBall = ActiveBall
  1677. PlaySound "plasticrolling", 1, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1678. End Sub
  1679.  
  1680. Sub RRampSStart_Hit()
  1681. Set SoundBall = ActiveBall
  1682. PlaySound "plasticrolling", 1, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1683. End Sub
  1684.  
  1685. Sub RRampSStop_Hit()
  1686. StopSound "plasticrolling"
  1687. End Sub
  1688.  
  1689. Sub LRampSStop_Hit()
  1690. StopSound "plasticrolling"
  1691. End Sub
  1692.  
  1693. Sub LRampSStop1_Hit
  1694. StopSound "plasticrolling"
  1695. End Sub
Advertisement
Add Comment
Please, Sign In to add comment