Advertisement
Arngrim

Pinball Magic 1.3.2

Jan 18th, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.08 KB | None | 0 0
  1. '************ Pinball Magic
  2. '************
  3. '************ unclewilly
  4. Option Explicit
  5. Randomize
  6.  
  7. On Error Resume Next
  8. ExecuteGlobal GetTextFile("controller.vbs")
  9. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  10. On Error Goto 0
  11.  
  12. Const cGameName = "pmv112"
  13.  
  14. Dim VarHidden, UseVPMDMD
  15. Dim DNSlider
  16.  
  17. If Table1.ShowDT = true then
  18. UseVPMDMD = true
  19. VarHidden = 1
  20. else
  21. UseVPMDMD = False
  22. VarHidden = 0
  23. end if
  24.  
  25. Dim xx, DNS
  26. Dns = table1.NightDay
  27.  
  28. If DNS <= 5 or DNS >= 75 then
  29. For each xx in aGiLights:xx.intensity = xx.intensity *(1-(DNS/100)):Next
  30. For each xx in aAllFlashers:xx.opacity = xx.opacity *(1-(DNS/100)):Next
  31. For each xx in AllLamps:xx.intensity = xx.intensity *(1-(DNS/100)):Next
  32.  
  33. else
  34. If DNS <= 40 or DNS >= 80 Then
  35. For each xx in aGiLights:xx.intensity = xx.intensity *(.5-(DNS/100)):Next
  36. For each xx in aAllFlashers:xx.opacity = xx.opacity *(.5-(DNS/100)):Next
  37. For each xx in AllLamps:xx.intensity = xx.intensity *(.5-(DNS/100)):Next
  38.  
  39. else
  40. For each xx in aGiLights:xx.intensity = xx.intensity *(.7-(DNS/100)):Next
  41. For each xx in aAllFlashers:xx.opacity = xx.opacity *(.7-(DNS/100)):Next
  42. For each xx in AllLamps:xx.intensity = xx.intensity *(.7-(DNS/100)):Next
  43.  
  44. end if
  45. end if
  46.  
  47.  
  48. Sub LightAdjust
  49.  
  50. End Sub
  51.  
  52. '****************************
  53. '''''Captive Ball Init
  54. Kicker3.createball:kicker3.kick 0, 0
  55. Kicker4.createsizedball 30
  56.  
  57. kicker4.kick 350, 10
  58. Sub Kicker4_Hit
  59. ActiveBall.image = "whiteballtrans"
  60. Kicker4.enabled = 0
  61. kicker4.kick 350, 10
  62. End Sub
  63. Dim MBall
  64.  
  65. '****************************
  66.  
  67. LoadVPM "01560000", "capcom.VBS", 3.26
  68.  
  69. Const UseSolenoids = 1
  70. Const UseLamps = 0
  71. Const UseSync = 1
  72. Const HandleMech = 0
  73.  
  74. 'Standard Sounds
  75. Const SSolenoidOn = "Solenoid"
  76. Const SSolenoidOff = ""
  77. Const SCoin = "coin"
  78.  
  79. 'Table Init
  80.  
  81. Sub Table1_Init
  82. vpmInit Me
  83. With Controller
  84. .GameName = cGameName
  85. If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
  86. .SplashInfoLine = "Pinball Magic" & vbNewLine & "by unclewilly vp9"
  87. .HandleKeyboard = 0
  88. .ShowTitle = 0
  89. .ShowDMDOnly = 1
  90. .ShowFrame = 0
  91. .HandleMechanics = 0
  92. .Hidden = VarHidden
  93. On Error Resume Next
  94. .Run GetPlayerHWnd
  95. If Err Then MsgBox Err.Description
  96. On Error Goto 0
  97. End With
  98.  
  99. 'Nudging
  100. vpmNudge.TiltSwitch=14
  101. vpmNudge.Sensitivity=1
  102. vpmNudge.TiltObj=Array(Bumper1b,LeftSlingshot,RightSlingshot)
  103.  
  104. WandDiv.IsDropped=1:WandDiv1.IsDropped=0
  105. Kickback.PullBack
  106. '**Main Timer init
  107. PinMAMETimer.Enabled = 1
  108. LightAdjust
  109.  
  110. End Sub
  111.  
  112. Sub Table1_Paused:Controller.Pause = 1:End Sub
  113. Sub Table1_unPaused:Controller.Pause = 0:End Sub
  114. Sub Table1_Exit:Controller.Stop:End Sub
  115.  
  116.  
  117. '*****Keys
  118. Sub Table1_KeyDown(ByVal keycode)
  119. If keycode = plungerkey then plunger.PullBack:PlaySound "plungerpull",0,1,0.25,0.25
  120. If keycode = LeftTiltKey Then Nudge 90, 4
  121. If keycode = RightTiltKey Then Nudge 270, 4
  122. If keycode = CenterTiltKey Then Nudge 0, 5
  123. If KeyCode = KeyFront then Controller.Switch(11)=1
  124. If vpmKeyDown(keycode) Then Exit Sub
  125. End Sub
  126.  
  127. Sub Table1_KeyUp(ByVal keycode)
  128. If keycode = plungerkey then plunger.Fire:PlaySound "plunger",0,1,0.25,0.25
  129. If KeyCode = KeyFront then Controller.Switch(11)=0
  130. If vpmKeyUp(keycode) Then Exit Sub
  131. End Sub
  132.  
  133. 'Solenoids
  134. SolCallback(1)="SolTrunk"
  135. SolCallback(2)="SolGenie"
  136. SolCallback(5)="SolKB"
  137. SolCallback(6)="SolTroughOut"
  138. SolCallback(7)="SolTroughIn"
  139.  
  140. SolCallback(11)="SolStageDoors"
  141. SolCallback(12)="SolStageKicker"
  142. SolCallback(13)="SolStageDiverter"
  143. SolCallback(14)="SolWandDiverter"
  144. SolCallback(17)="SolWand"
  145. SolCallback(18)="SolElevator"
  146. SolCallback(19)="DropReset"
  147. SolCallback(20)="SolMag"
  148.  
  149. SolCallback(26)="SetLamp 176,"
  150. SolCallback(27)="SetLamp 177,"
  151. SolCallback(28)="SetLamp 178,"
  152. SolCallback(29)="SetLamp 179,"
  153. SolCallback(30)="SetLamp 180,"
  154. SolCallback(31)="SetLamp 181,"
  155. SolCallback(32)="SetLamp 182,"
  156. '**************
  157. ' Solenoid Subs
  158. '**************
  159. Sub SolKB(enabled)
  160. If enabled Then
  161. Kickback.Fire
  162. PlaySound SoundFX("popper_ball",DOFContactors)
  163. Else
  164. Kickback.Pullback
  165. end If
  166. End Sub
  167. '*****Trunk Lock
  168. TrunkWall1.IsDropped = 1:TrunkWall2.IsDropped = 1
  169. Sub SolTrunk(enabled)
  170. If enabled Then
  171. TrunkDoorP.TransY = -100
  172. TrunkDoor.IsDropped = 1
  173. TrunkDoor.TimerEnabled = 1
  174. Else
  175.  
  176. End If
  177. End Sub
  178.  
  179. Sub TrunkDoor_Timer
  180. TrunkDoorP.TransY = 0
  181. TrunkDoor.IsDropped = 0
  182. TrunkDoor.TimerEnabled = 0
  183. End Sub
  184.  
  185. Sub Sw25_hit()
  186. Controller.Switch(25) = 1
  187. End Sub
  188.  
  189. Sub Sw25_Unhit()
  190. Controller.Switch(25) = 0
  191. End Sub
  192.  
  193. Sub Sw26_hit()
  194. TrunkWall2.IsDropped = 0
  195. Controller.Switch(26) = 1
  196. End Sub
  197.  
  198. Sub Sw26_Unhit()
  199. TrunkWall2.IsDropped = 1
  200. Controller.Switch(26) = 0
  201. End Sub
  202.  
  203. Sub Sw27_hit()
  204. Playsound "scoopenter"
  205. TrunkWall1.IsDropped = 0
  206. Controller.Switch(27) = 1
  207. End Sub
  208.  
  209. Sub Sw27_Unhit()
  210. TrunkWall1.IsDropped = 1
  211. Playsound "gate"
  212. Playsound "fx_ball_bounce2"
  213. Controller.Switch(27) = 0
  214. End Sub
  215.  
  216.  
  217. '***********Wand
  218. Dim WandPos,WandDir
  219. WandPos = 42:WandDir = -1
  220. HandP.ObjRotZ = WandPos
  221. WandP.ObjRotZ = WandPos
  222. WandR.ObjRotZ = WandPos
  223. Controller.Switch(67)=1:Controller.Switch(68)=0
  224. CriticDiv.IsDropped = 1
  225. TrunkDiv.IsDropped = 0
  226. Sub SolWand(enabled)
  227. If Enabled Then
  228. DOF 101, DOFOn
  229. WandT.Enabled = 1
  230. Else
  231. WandT.enabled = 0
  232. end if
  233. End Sub
  234.  
  235. Sub WandT_Timer
  236. WandPos = WandPos + WandDir
  237. If WandPos > 42 then WandPos = 42:WandDir = -1
  238. If WandPos < -22 then WandPos = -22:WandDir = 1
  239. If WandPos >38 then
  240. Controller.Switch(67)=1
  241. CriticDiv.IsDropped = 1
  242. TrunkDiv.IsDropped = 0
  243. Else
  244. DOF 101, DOFOff
  245. Controller.Switch(67)=0
  246. end If
  247. If WandPos < -18 then
  248. Controller.Switch(68)=1
  249. CriticDiv.IsDropped = 0
  250. TrunkDiv.IsDropped = 1
  251. Else
  252. DOF 101, DOFOff
  253. Controller.Switch(68)=0
  254. end If
  255. If WandPos > -18 and wandPos < 38 Then
  256. CriticDiv.IsDropped = 0
  257. TrunkDiv.IsDropped = 0
  258. end If
  259. HandP.ObjRotZ = WandPos
  260. WandP.ObjRotZ = WandPos
  261. WandR.ObjRotZ = WandPos
  262. End Sub
  263.  
  264. Sub SolMag(enabled)
  265. If enabled Then
  266. 'Ramp19.Collidable = False
  267. Wall71.TimerEnabled = 1
  268. Else
  269.  
  270. End If
  271. End Sub
  272. Sub Wall71_Timer()
  273. Wall71.TimerEnabled = 0
  274. 'Ramp19.Collidable = True
  275. End Sub
  276. '*******End Wand
  277.  
  278. Sub SolTroughOut(enabled)
  279. If enabled then BallRelease.Kick 45, 25
  280. End Sub
  281.  
  282. Sub SolTroughIn(enabled)
  283. If enabled then Drain.Kick 135, 2
  284. End Sub
  285.  
  286. Sub SolStageDiverter(enabled)
  287. If enabled then
  288. StageDiverter.IsDropped = 1
  289. Else
  290. StageDiverter.IsDropped = 0
  291. end if
  292. End Sub
  293.  
  294. Sub SolWandDiverter(enabled)
  295. If enabled then
  296. WandDiv.IsDropped=0:WandDiv1.IsDropped=1
  297. WandDiv.TimerEnabled = 0
  298. WandDiv.TimerEnabled = 1
  299. End If
  300. End Sub
  301.  
  302. Sub WandDiv_Timer()
  303. WandDiv.IsDropped=1:WandDiv1.IsDropped=0
  304. WandDiv.TimerEnabled = 0
  305. End Sub
  306.  
  307. Sub sw60_hit()
  308.  
  309. End Sub
  310. Sub Stagein_Hit()
  311. vpmTimer.PulseSw 60
  312. DoorOpen
  313. vpmTimer.AddTimer 1000,"SKick'"
  314. End Sub
  315. Dim MyBall, ELActive
  316. ElActive = 0
  317. Sub Elevator_Hit()
  318. Set MyBall=ActiveBall
  319. Elevator.DestroyBall
  320. Set MyBall=Elevator.CreateBall
  321. vpmTimer.PulseSw 57
  322. DoorOpen
  323. ElActive = 1
  324. End Sub
  325.  
  326. Dim LBall, EDown
  327. Edown = 0
  328. CreateLBall
  329. Sub CreateLBall()
  330. Set LBall=LevBall.CreateBall
  331. End Sub
  332.  
  333. Sub solElevator(enabled)
  334. If Enabled Then
  335. DOF 102, DOFOn
  336. EMotor.Enabled = 1
  337. end If
  338. end Sub
  339. Dim EPos
  340. EPos = 170
  341. Sub Emotor_Timer()
  342. If EDown = 0 Then
  343. Epos = Epos + 1
  344. LBall.Z = EPos
  345. el.z = EPos/2
  346. If EPos <= 300 and elactive = 1then MyBall.Z = EPos
  347. If EPos = 300 then :elevator.kick 90, 10: elactive = 0: DoorClose: DOF 104, DOFPulse : PlaySound SoundFX("popper_ball",DOFContactors) : end if
  348. If Epos = 300 Then
  349. DOF 102, DOFOff
  350. EMotor.Enabled = 0
  351. EDown = 1
  352. Controller.Switch(58)=1
  353. End If
  354. Controller.Switch(59)=0
  355. else
  356. Epos = Epos - 1
  357. LBall.Z = EPos
  358. If Epos = 170 Then
  359. DOF 102, DOFOff
  360. EMotor.Enabled = 0
  361. EDown = 0
  362. Controller.Switch(59)=1
  363. End If
  364. Controller.Switch(58)=0
  365. end if
  366. End Sub
  367.  
  368. Sub SolStageKicker(enabled)
  369. If Enabled then stagein.Kick 180, 25, 90
  370. End Sub
  371.  
  372. Sub SKick()
  373. stagein.Kick 180, 50, 80
  374. PlaySound SoundFX("popper_ball",DOFContactors)
  375. DOF 105, DOFPulse
  376. vpmTimer.AddTimer 1000,"DoorClose'"
  377. End Sub
  378.  
  379. Controller.Switch(62)=1:Controller.Switch(59)=1:Controller.Switch(58)= 0
  380. Dim DoorDir
  381. DoorDir = 0
  382. Sub SolStageDoors(enabled)
  383. If enabled then
  384. 'DoorOpen
  385. Else
  386. 'DoorClose'
  387. end if
  388. End Sub
  389. Dim DoorPos, DrOpn
  390. DoorPos = 0:DrOpn = 0
  391. Sub DoorOpen()
  392. 'If DrOpn = 0
  393. DOF 103, DOFOn
  394. DoorDir = 1:DoorT.Timerenabled = 1
  395. Controller.Switch(62)=0:Controller.Switch(61)=0
  396. End Sub
  397.  
  398. Sub DoorT_Timer()
  399. DoorPos = DoorPos + DoorDir
  400. If DoorPos > 40 or doorPos < 0 Then DoorT.TimerEnabled = 0:DOF 103, DOFOff'Exit Sub
  401. If DoorPos > 40 then DoorPos = 40
  402. If DoorPos < 0 then DoorPos = 0
  403. DoorPos = DoorPos + DoorDir
  404. DoorL.TransX = -DoorPos:DoorR.TransX = DoorPos
  405. End Sub
  406. Sub DoorClose()
  407. DOF 103, DOFOn
  408. DoorDir = -1:DoorT.Timerenabled = 1
  409. Controller.Switch(62)=1:Controller.Switch(61)=1
  410. End Sub
  411. '***********************************************
  412. '**************
  413. ' Flipper Subs
  414. '**************
  415.  
  416. SolCallback(sLRFlipper) = "SolRFlipper"
  417. SolCallback(sLLFlipper) = "SolLFlipper"
  418.  
  419. Sub SolLFlipper(Enabled)
  420. If Enabled Then
  421. PlaySound SoundFX("fx_Flipperup",DOFFlippers), 0, .67, -0.05, 0.05
  422. LeftFlipper.RotateToEnd
  423. Else
  424. PlaySound SoundFX("fx_Flipperdown",DOFFlippers), 0, 1, -0.05, 0.05
  425. LeftFlipper.RotateToStart
  426. End If
  427. End Sub
  428.  
  429. Sub SolRFlipper(Enabled)
  430. If Enabled Then
  431. PlaySound SoundFX("fx_Flipperup",DOFFlippers), 0, .67, 0.05, 0.05
  432. RightFlipper.RotateToEnd
  433. Ramp19.Collidable = False
  434. Else
  435. PlaySound SoundFX("fx_Flipperdown",DOFFlippers), 0, 1, 0.05, 0.05
  436. RightFlipper.RotateToStart
  437. Ramp19.Collidable = True
  438. End If
  439. End Sub
  440.  
  441. 'Kickers, drains, poppers
  442. '********Ball Trough
  443. 'Init
  444. sw1a.IsDropped = 1:sw2a.IsDropped = 1:sw3a.IsDropped = 1:sw4a.IsDropped = 1
  445. Dim DrainCount
  446. DrainCount = 0
  447. Drain.TimerEnabled = 1
  448. Sub Drain_Timer()
  449. Drain.createball:Drain.Kick 135, 2
  450. DrainCount = DrainCount + 1
  451. If DrainCount = 4 then
  452. Drain.TimerEnabled = 0 'Drain.Enabled = 0:
  453. end if
  454. End Sub
  455. Sub BallRelease_Hit()
  456. sw1a.IsDropped = 0
  457. Controller.Switch(74) = 1
  458. End Sub
  459. Sub BallRelease_UnHit()
  460. sw1a.IsDropped = 1
  461. Controller.Switch(74) = 0
  462. PlaySound SoundFX("BallRelease",DOFContactors)
  463. End Sub
  464.  
  465. Sub sw1_Hit()
  466. sw2a.IsDropped = 0
  467. Controller.Switch(74) = 1
  468. End Sub
  469. Sub sw1_UnHit()
  470. sw2a.IsDropped = 1
  471. Controller.Switch(74) = 0
  472. End Sub
  473.  
  474. Sub sw2_Hit()
  475. sw3a.IsDropped = 0
  476. Controller.Switch(75) = 1
  477. End Sub
  478. Sub sw2_UnHit()
  479. sw3a.IsDropped = 1
  480. Controller.Switch(75) = 0
  481. End Sub
  482.  
  483. Sub sw3_Hit()
  484. sw4a.IsDropped = 0
  485. Controller.Switch(76) = 1
  486. End Sub
  487. Sub sw3_UnHit()
  488. sw4a.IsDropped = 1
  489. Controller.Switch(76) = 0
  490. End Sub
  491.  
  492. Sub sw4_Hit()
  493. Playsound "drain"
  494. Controller.Switch(73) = 1
  495. End Sub
  496. Sub sw4_UnHit()
  497.  
  498. Controller.Switch(73) = 0
  499. End Sub
  500.  
  501. Sub sw52_Hit()
  502. Activeball.vely = 35
  503. Controller.Switch(52) = 1
  504.  
  505. End Sub
  506. Sub sw52_UnHit()
  507.  
  508. Controller.Switch(52) = 0
  509. End Sub
  510.  
  511. Sub swHelp_Hit()
  512. Activeball.vely = 25
  513. End Sub
  514.  
  515. Sub TroughHelp_Hit()
  516. TroughHelp.Kick 90, 10
  517. End Sub
  518.  
  519. Sub SolGenie(enabled) 'GenieTrough
  520. sw28.kick 321, 50
  521. PlaySound SoundFX("popper_ball",DOFContactors)
  522. End Sub
  523.  
  524.  
  525. '**********Sling Shot Animations
  526. ' Rstep and Lstep are the variables that increment the animation
  527. '****************
  528. Dim RStep, Lstep, RStep1
  529.  
  530. Sub RightSlingShot_Slingshot
  531. vpmTimer.PulseSw 22
  532. PlaySound SoundFX("left_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  533. RS.Visible = 0
  534. RS1.Visible = 1
  535. sling1.TransZ = -20
  536. RStep = 0
  537. RightSlingShot.TimerEnabled = 1
  538.  
  539. End Sub
  540.  
  541. Sub RightSlingShot_Timer
  542. Select Case RStep
  543. Case 3:RS1.Visible = 0:RS2.Visible = 1:sling1.TransZ = -10
  544. Case 4:RS2.Visible = 0:RS.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0
  545. End Select
  546. RStep = RStep + 1
  547. End Sub
  548.  
  549. Sub RightSlingShot1_Slingshot
  550. vpmTimer.PulseSw 46
  551. PlaySound SoundFX("left_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  552. RtS.Visible = 0
  553. RtS1.Visible = 1
  554. sling3.TransZ = -20
  555. RStep1 = 0
  556. RightSlingShot1.TimerEnabled = 1
  557.  
  558. End Sub
  559.  
  560. Sub RightSlingShot1_Timer
  561. Select Case RStep1
  562. Case 3:RtS1.Visible = 0:RtS2.Visible = 1:sling3.TransZ = -10
  563. Case 4:RtS2.Visible = 0:RtS.Visible = 1:sling3.TransZ = 0:RightSlingShot1.TimerEnabled = 0
  564. End Select
  565. RStep1 = RStep1 + 1
  566. End Sub
  567.  
  568. Sub LeftSlingShot_Slingshot
  569. vpmTimer.PulseSw 19
  570. PlaySound SoundFX("left_slingshot",DOFContactors),0,1,-0.05,0.05
  571. LS.Visible = 0
  572. LS1.Visible = 1
  573. sling2.TransZ = -20
  574. LStep = 0
  575. LeftSlingShot.TimerEnabled = 1
  576.  
  577. End Sub
  578.  
  579. Sub LeftSlingShot_Timer
  580. Select Case LStep
  581. Case 3:LS1.Visible = 0:LS2.Visible = 1:sling2.TransZ = -10
  582. Case 4:LS2.Visible = 0:LS.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0
  583. End Select
  584. LStep = LStep + 1
  585. End Sub
  586.  
  587. 'AutomaticUpdates
  588. Sub UpdatesTimer_Timer()
  589. RollingUpdate
  590.  
  591. End Sub
  592.  
  593. '************Bumper1
  594.  
  595. Sub Bumper1b_Hit()
  596. vpmTimer.PulseSw 69
  597. PlaySound SoundFX("fx_bumper1",DOFContactors), 0, 0.5, 0.05, 0.05
  598. End Sub
  599.  
  600. '**********Drop Targets
  601. Sub sw41_Hit()
  602. Controller.Switch(41) = 1
  603. PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets), 0, 2, 0.05, 0.05
  604. End Sub
  605.  
  606. Sub sw42_Hit()
  607. Controller.Switch(42) = 1
  608. PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets), 0, 2, 0.05, 0.05
  609. End Sub
  610.  
  611. Sub sw43_Hit()
  612. Controller.Switch(43) = 1
  613. PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets), 0, 2, 0.05, 0.05
  614. End Sub
  615.  
  616. Sub sw44_Hit()
  617. Controller.Switch(44) = 1
  618. PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets), 0, 2, 0.05, 0.05
  619. End Sub
  620.  
  621. Sub sw45_Hit()
  622. Controller.Switch(45) = 1
  623. PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets), 0, 2, 0.05, 0.05
  624. End Sub
  625.  
  626. Sub DropReset(enabled)
  627. If enabled then
  628. Controller.Switch(41) = 0
  629. Controller.Switch(42) = 0
  630. Controller.Switch(43) = 0
  631. Controller.Switch(44) = 0
  632. Controller.Switch(45) = 0
  633. sw41.IsDropped = 0:sw42.IsDropped = 0:sw43.IsDropped = 0
  634. sw44.IsDropped = 0:sw45.IsDropped = 0
  635. PlaySound SoundFx("fx_DropTargetUp",DOFContactors), 0, 2, 0.05, 0.05
  636. end if
  637. End Sub
  638. '****Gates
  639. Sub sw49_Hit()
  640. vpmTimer.PulseSw 49
  641. End Sub
  642. '********Standup Targets
  643. Sub sw34_Hit()
  644. vpmTimer.PulseSw 34
  645. PlaySound SoundFX("target",DOFTargets), 0, 1, 0.05, 0.05
  646. End Sub
  647.  
  648. Sub sw31_Hit()
  649. vpmTimer.PulseSw 31
  650. PlaySound SoundFX("target",DOFTargets),0,1,-0.05,0.05
  651. End Sub
  652.  
  653. Sub sw65_Hit()
  654. vpmTimer.PulseSw 65
  655. PlaySound SoundFX("target",DOFTargets),0,1,-0.05,0.05
  656. End Sub
  657.  
  658. Sub sw70_Hit()
  659. vpmTimer.PulseSw 70
  660. PlaySound SoundFX("target",DOFTargets),0,1,-0.05,0.05
  661. End Sub
  662.  
  663. Sub sw71_Hit()
  664. vpmTimer.PulseSw 71
  665. PlaySound SoundFX("target",DOFTargets),0,1,-0.05,0.05
  666. End Sub
  667.  
  668. Sub sw72_Hit()
  669. vpmTimer.PulseSw 72
  670. PlaySound SoundFX("target",DOFTargets),0,1,-0.05,0.05
  671. End Sub
  672.  
  673. '********Rollovers
  674. Sub Sw17_hit()
  675. Controller.Switch(17) = 1
  676. End Sub
  677.  
  678. Sub Sw17_Unhit()
  679. Controller.Switch(17) = 0
  680. End Sub
  681.  
  682. Sub Sw18_hit()
  683. Controller.Switch(18) = 1
  684. End Sub
  685.  
  686. Sub Sw18_Unhit()
  687. Controller.Switch(18) = 0
  688. End Sub
  689.  
  690. Sub Sw23_hit()
  691. Controller.Switch(23) = 1
  692. End Sub
  693.  
  694. Sub Sw23_Unhit()
  695. Controller.Switch(23) = 0
  696. End Sub
  697.  
  698. Sub Sw24_hit()
  699. Controller.Switch(24) = 1
  700. End Sub
  701.  
  702. Sub Sw24_Unhit()
  703. Controller.Switch(24) = 0
  704. End Sub
  705.  
  706. Sub Sw33_hit()
  707. Controller.Switch(33) = 1
  708.  
  709. End Sub
  710.  
  711. Sub Sw33_Unhit()
  712. Controller.Switch(33) = 0
  713. End Sub
  714.  
  715. Sub Sw36_hit()
  716. Controller.Switch(36) = 1
  717. End Sub
  718.  
  719. Sub Sw36_Unhit()
  720. Controller.Switch(36) = 0
  721. End Sub
  722.  
  723. Sub Sw35_hit()
  724. Controller.Switch(35) = 1
  725. End Sub
  726.  
  727. Sub Sw35_Unhit()
  728. Controller.Switch(35) = 0
  729. End Sub
  730.  
  731. Sub Sw37_hit()
  732. Controller.Switch(37) = 1
  733. End Sub
  734.  
  735. Sub Sw37_Unhit()
  736. Controller.Switch(37) = 0
  737. End Sub
  738. Sub Sw38_hit()
  739. Controller.Switch(38) = 1
  740. End Sub
  741.  
  742. Sub Sw38_Unhit()
  743. Controller.Switch(38) = 0
  744. End Sub
  745.  
  746. Sub Sw40_hit()
  747. Controller.Switch(40) = 1
  748. End Sub
  749.  
  750. Sub Sw40_Unhit()
  751. Controller.Switch(40) = 0
  752. End Sub
  753.  
  754. Sub Hathole_hit: PlaySound "fx_subway3": Hathole.Kick -90, 10 : End Sub
  755.  
  756.  
  757. '*******Genie Trough
  758.  
  759.  
  760. Sub Sw30_hit()
  761. Controller.Switch(30) = 1
  762. End Sub
  763.  
  764. Sub Sw30_Unhit()
  765. Controller.Switch(30) = 0
  766. End Sub
  767.  
  768. Sub Sw29_hit()
  769. Controller.Switch(29) = 1
  770. End Sub
  771.  
  772. Sub Sw29_Unhit()
  773. Controller.Switch(29) = 0
  774. End Sub
  775.  
  776. Sub Sw28_hit()
  777. Controller.Switch(28) = 1
  778. PlaySound "kicker_enter_center"
  779. End Sub
  780.  
  781. Sub Sw28_Unhit()
  782. Controller.Switch(28) = 0
  783. End Sub
  784. '*****Spinner
  785. Sub Spinner_Spin()
  786. vpmTimer.PulseSw 66
  787. PlaySound "fx_spinner",0,1,-0.05,0.05
  788. End Sub
  789.  
  790. '***************************************************
  791. ' JP's VP10 Fading Lamps & Flashers
  792. ' Based on PD's Fading Light System
  793. ' SetLamp 0 is Off
  794. ' SetLamp 1 is On
  795. ' fading for non opacity objects is 4 steps
  796. '***************************************************
  797.  
  798. Dim LampState(200), FadingLevel(200)
  799. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  800.  
  801. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  802. LampTimer.Interval = 10 'lamp fading speed
  803. LampTimer.Enabled = 1
  804.  
  805. ' Lamp & Flasher Timers
  806.  
  807. Sub LampTimer_Timer()
  808. Dim chgLamp, num, chg, ii
  809. chgLamp = Controller.ChangedLamps
  810. If Not IsEmpty(chgLamp) Then
  811. For ii = 0 To UBound(chgLamp)
  812. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  813. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  814. Next
  815. End If
  816. UpdateLamps
  817. End Sub
  818.  
  819. Sub UpdateLamps
  820. NFadeL 5, l5
  821. NFadeL 6, l6
  822. NFadeL 7, l7
  823. NFadeL 8, l8
  824. NFadeL 9, l9
  825. NFadeLm 10, l10a
  826. NFadeLm 10, l10b
  827. NFadeLm 10, l10c
  828. NFadeLm 10, l10d
  829. NFadeL 10, l10
  830. NFadeLm 11, l11a
  831. NFadeLm 11, l11b
  832. NFadeLm 11, l11c
  833. NFadeLm 11, l11d
  834. NFadeLm 11, l11e
  835. NFadeL 11, l11
  836. NFadeL 12, l12
  837. NFadeL 13, l13
  838. NFadeL 14, l14
  839. NFadeL 15, l15
  840. NFadeL 16, l16
  841. NFadeObjm 17, l17, "cbL1On", "cbL1" ', "cbL1A", "cbL1B"
  842. Flashm 17, l17F1
  843. Flashm 17, l17F2
  844. Flash 17, l17F
  845. NFadeObjm 18, l18, "LLOn", "LL" ', "LLA", "LLB"
  846. Flash 18, l18F
  847. NFadeLm 19, l19e
  848. NFadeLm 19, l19d
  849. NFadeLm 19, l19c
  850. NFadeLm 19, l19b
  851. NFadeLm 19, l19a
  852. NFadeL 19, l19
  853. NFadeObjm 20, L20P, "LRampPlOn", "LRampPl"
  854. NFadeLm 20, L20
  855. NFadeLm 20, L20b
  856. NFadeLm 20, l20c
  857. Flash 20, L20f
  858. NFadeObjm 21, l21, "LsOn", "Ls" ', "LsA", "LsB"
  859. Flash 21, l21F
  860. NFadeObjm 22, l22, "LshOn", "Lsh" ', "LshA", "LshB"
  861. Flash 22, l22F
  862. NFadeObjm 23, l23, "TAOn", "TA" ', "TAA", "TAB
  863. Flash 23, l23F
  864. NFadeObjm 24, l24, "LEOn", "LE" ', "LEA", "LEB"
  865. Flash 24, l24F
  866. Flashm 25, l25a
  867. Flash 25, l25
  868. Flashm 26, l26a
  869. Flash 26, l26
  870. Flashm 27, l27a
  871. Flash 27, l27
  872.  
  873. Flashm 30, l30a
  874. Flash 30, l30
  875. Flashm 31, l31a
  876. Flash 31, l31
  877. Flashm 32, l32a
  878. Flash 32, l32
  879. NFadeLm 33, l33
  880. Flash 33, l33F
  881. NFadeLm 34, l34
  882. Flash 34, l34F
  883. NFadeLm 35, l35
  884. Flash 35, l35F
  885. NFadeL 36, l36
  886. NFadeL 37, l37
  887. ' NFadeL 38, l38
  888. NFadeLm 39, l39a
  889. NFadeLm 39, l39
  890. Flash 39, l39F
  891. NFadeL 40, l40
  892. NFadeLm 41, l41
  893. Flash 41, l41F
  894. NFadeLm 42, l42
  895. Flash 42, l42F
  896. NFadeLm 43, l43
  897. Flash 43, l43F
  898. NFadeL 44, l44
  899. NFadeL 45, l45
  900. ' NFadeL 46, l46
  901. NFadeLm 47, l47
  902. NFadeLm 47, l47a
  903. Flash 47, l47F
  904. NFadeLm 48, l48a
  905. NFadeLm 48, l48b
  906. NFadeLm 48, l48
  907. Flash 48, l48F
  908. NFadeLm 49, l49
  909. Flash 49, l49F
  910. NFadeLm 50, l50
  911. Flash 50, l50F
  912. NFadeLm 51, l51
  913. Flash 51, l51F
  914. NFadeL 52, l52
  915. NFadeLm 53, l53
  916. Flash 53, l53F
  917. NFadeL 54, l54
  918. NFadeLm 55, l55b
  919. NFadeLm 55, l55A
  920. NFadeLm 55, l182a
  921. NFadeLm 55, l182b
  922. NFadeLm 55, l182c
  923. NFadeLm 55, l182d
  924. NFadeL 55, l55
  925. NFadeLm 56, l56
  926. NFadeLm 56, l56a
  927. NFadeLm 56, l56b
  928. NFadeLm 56, l56c
  929. NFadeL 56, l56d
  930. NFadeLm 57, l57
  931. NFadeLm 57, l57a
  932. NFadeLm 57, l57b
  933. Flash 57, l57F
  934. NFadeLm 58, l58
  935. Flash 58, l58F
  936. NFadeLm 59, l59
  937. NFadeLm 59, l59a
  938. NFadeLm 59, l59b
  939. NFadeLm 59, l59c
  940. Flash 59, l59F
  941. NFadeL 60, l60
  942. NFadeLm 61, l61
  943. Flash 61, l61F
  944. NFadeLm 62, l62
  945. NFadeLm 62, l62a
  946. Flash 62, l62F
  947. NFadeL 63, l63
  948. NFadeLm 64, l64
  949. NFadeLm 64, l64a
  950. NFadeLm 64, l64b
  951. NFadeLm 64, l64c
  952. NFadeLm 64, l64e
  953. NFadeL 64, l64d
  954. ' NFadeL 65, l65
  955. ' NFadeL 66, l66
  956. ' NFadeL 67, l67
  957. ' NFadeL 68, l68
  958. ' NFadeL 71, l71
  959. ' NFadeL 72, l72
  960. ' NFadeL 73, l73
  961. ' NFadeL 74, l74
  962. ' NFadeL 75, l75
  963. NFadeL 76, l76
  964. NFadeL 77, l77
  965. NFadeL 78, l78
  966. NFadeL 79, l79
  967. NFadeLm 80, l80
  968. NFadeLm 81, l81
  969. Flash 81, l81F
  970. NFadeL 82, l82
  971. ' NFadeL 83, l83
  972. ' NFadeL 84, l84
  973. NFadeL 85, l85
  974. NFadeL 86, l86
  975. NFadeObjm 87, L87P, "bulbcover1_redOn", "bulbcover1_red"
  976. NFadeL 87, l87l
  977. NFadeObjm 88, L88P, "bulbcover1_redOn", "bulbcover1_red"
  978. NFadeL 88, l88L
  979. NFadeL 89, l89
  980. NFadeL 90, l90
  981. NFadeL 91, l91
  982. NFadeL 94, l94
  983. NFadeL 95, l95
  984. NFadeL 96, l96
  985. NFadeObjm 97, L97P, "bulbcover1_greenOn", "bulbcover1_green"
  986. Flash 97, L97f
  987. NFadeObjm 98, L98P, "bulbcover1_whiteOn", "bulbcover1_white"
  988. Flash 98, L98f
  989. NFadeObjm 99, L99P, "bulbcover1_greenOn", "bulbcover1_green"
  990. Flash 99, L99f
  991. Flash 100, l100F
  992. NFadeL 103, l103
  993. NFadeL 104, l104
  994. NFadeL 109, l109
  995. NFadeL 112, l112
  996. NFadeL 121, l121
  997. NFadeObjm 113, L113P, "bulbcover1_greenOn", "bulbcover1_green"
  998. Flash 113, L113f
  999. NFadeObjm 114, L114P, "TopFlasherWhiteA", "TopFlasherWhite"
  1000. Flash 114, L114
  1001. NFadeObjm 115, L115P, "bulbcover1_blueOn", "bulbcover1_blue"
  1002. Flash 115, L115f
  1003. NFadeObjm 116, L116P, "bulbcover1_yellowOn", "bulbcover1_yellow"
  1004. Flash 116, L116f
  1005. NFadeObjm 117, L117P, "bulbcover1_redOn", "bulbcover1_red"
  1006. Flash 117, L117f
  1007. FadeObj 118, HandP, "hanwithringOn", "hanwithringA", "hanwithringB", "hanwithring"
  1008. ' NFadeLm 116, f16b
  1009. ' NFadeLm 116, f16
  1010. ' Flashm 116, f16a
  1011. ' Flash 116, f16c
  1012. ' NFadeLm 117, f17a
  1013. ' NFadeLm 117, f17b
  1014. ' Flashm 117, f17c
  1015. ' Flashm 117, f17e
  1016. ' Flashm 117, f17f
  1017. ' Flash 117, f17d
  1018. ' NFadeL 118, f18
  1019. ' NFadeLm 119, f19
  1020. ' Flashm 119, f19a
  1021. ' Flash 119, f19b
  1022. ' Flash 120, f20
  1023. ' NFadeLm 122, f22
  1024. ' NFadeL 123, f23
  1025. ' NFadeL 124, f24
  1026. ' NFadeL 125, f25
  1027. ' NFadeLm 126, f26
  1028. ' Flashm 126, f26a
  1029. ' Flash 126, f26b
  1030. ' NFadeLm 127, f27
  1031. ' Flashm 127, f27b
  1032. ' Flashm 127, f27d
  1033. ' Flash 127, f27a
  1034. ' NFadeL 128, f28
  1035. ' NFadeL 130, sw27l
  1036. NFadeLm 176, L176
  1037. Flash 176, L176f
  1038. NFadeLm 177, L13
  1039. Flash 177, L177f
  1040. NFadeObjm 178, L178P, "octadome_greenOn", "octadome_green"
  1041. NFadeLm 178, L178L
  1042. Flashm 178, L178f1
  1043. Flashm 178, L178f2
  1044. Flash 178, L178f
  1045. NFadeObjm 179, L179P, "octadome_redOn", "octadome_red"
  1046. NFadeLm 179, L179L
  1047. Flashm 179, L179fa
  1048. Flashm 179, L179fb
  1049. Flash 179, L179f
  1050. ' NFadeL 180, l180
  1051. NFadeLm 181, l181
  1052. NFadeLm 181, F181a
  1053. FadeObj 181, F181, "FlasherTestOn", "FlasherTestA", "FlasherTestB", "FlasherTest"
  1054. NFadeLm 182, L182
  1055.  
  1056. Flashm 182, L182fa
  1057. Flash 182, L182f
  1058.  
  1059. End Sub
  1060.  
  1061. Sub InitLamps()
  1062. Dim x
  1063. For x = 0 to 200
  1064. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  1065. FadingLevel(x) = 4 ' used to track the fading state
  1066. FlashSpeedUp(x) = 0.5 ' faster speed when turning on the flasher
  1067. FlashSpeedDown(x) = 0.35 ' slower speed when turning off the flasher
  1068. FlashMax(x) = 1 ' the maximum value when on, usually 1
  1069. FlashMin(x) = 0 ' the minimum value when off, usually 0
  1070. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  1071. Next
  1072. End Sub
  1073.  
  1074. Sub AllLampsOff
  1075. Dim x
  1076. For x = 0 to 200
  1077. SetLamp x, 0
  1078. Next
  1079. End Sub
  1080.  
  1081. Sub SetLamp(nr, value)
  1082. If value <> LampState(nr) Then
  1083. LampState(nr) = abs(value)
  1084. FadingLevel(nr) = abs(value) + 4
  1085. End If
  1086. End Sub
  1087.  
  1088. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  1089.  
  1090. Sub NFadeL(nr, object)
  1091. Select Case FadingLevel(nr)
  1092. Case 4:object.state = 0:FadingLevel(nr) = 0
  1093. Case 5:object.state = 1:FadingLevel(nr) = 1
  1094. End Select
  1095. End Sub
  1096.  
  1097. Sub NFadeLm(nr, object) ' used for multiple lights
  1098. Select Case FadingLevel(nr)
  1099. Case 4:object.state = 0
  1100. Case 5:object.state = 1
  1101. End Select
  1102. End Sub
  1103.  
  1104. 'Lights, Ramps & Primitives used as 4 step fading lights
  1105. 'a,b,c,d are the images used from on to off
  1106.  
  1107. Sub FadeObj(nr, object, a, b, c, d)
  1108. Select Case FadingLevel(nr)
  1109. Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
  1110. Case 5:object.image = a:FadingLevel(nr) = 1 'ON
  1111. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1112. Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1113. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1114. Case 13:object.image = d:FadingLevel(nr) = 0 'Off
  1115. End Select
  1116. End Sub
  1117.  
  1118. Sub FadeObjm(nr, object, a, b, c, d)
  1119. Select Case FadingLevel(nr)
  1120. Case 4:object.image = b
  1121. Case 5:object.image = a
  1122. Case 9:object.image = c
  1123. Case 13:object.image = d
  1124. End Select
  1125. End Sub
  1126.  
  1127. Sub NFadeObj(nr, object, a, b)
  1128. Select Case FadingLevel(nr)
  1129. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  1130. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  1131. End Select
  1132. End Sub
  1133.  
  1134. Sub NFadeObjm(nr, object, a, b)
  1135. Select Case FadingLevel(nr)
  1136. Case 4:object.image = b
  1137. Case 5:object.image = a
  1138. End Select
  1139. End Sub
  1140.  
  1141. ' Flasher objects
  1142.  
  1143. Sub Flash(nr, object)
  1144. Select Case FadingLevel(nr)
  1145. Case 4 'off
  1146. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  1147. If FlashLevel(nr) < FlashMin(nr) Then
  1148. FlashLevel(nr) = FlashMin(nr)
  1149. FadingLevel(nr) = 0 'completely off
  1150. End if
  1151. Object.IntensityScale = FlashLevel(nr)
  1152. Case 5 ' on
  1153. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  1154. If FlashLevel(nr) > FlashMax(nr) Then
  1155. FlashLevel(nr) = FlashMax(nr)
  1156. FadingLevel(nr) = 1 'completely on
  1157. End if
  1158. Object.IntensityScale = FlashLevel(nr)
  1159. End Select
  1160. End Sub
  1161.  
  1162. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  1163. Object.IntensityScale = FlashLevel(nr)
  1164. End Sub
  1165.  
  1166. ' Desktop Objects: Reels & texts (you may also use lights on the desktop)
  1167.  
  1168. ' Reels
  1169.  
  1170. Sub FadeR(nr, object)
  1171. Select Case FadingLevel(nr)
  1172. Case 4:object.SetValue 1:FadingLevel(nr) = 6 'fading to off...
  1173. Case 5:object.SetValue 0:FadingLevel(nr) = 1 'ON
  1174. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1175. Case 9:object.SetValue 2:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1176. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1177. Case 13:object.SetValue 3:FadingLevel(nr) = 0 'Off
  1178. End Select
  1179. End Sub
  1180.  
  1181. Sub FadeRm(nr, object)
  1182. Select Case FadingLevel(nr)
  1183. Case 4:object.SetValue 1
  1184. Case 5:object.SetValue 0
  1185. Case 9:object.SetValue 2
  1186. Case 3:object.SetValue 3
  1187. End Select
  1188. End Sub
  1189.  
  1190. 'Texts
  1191.  
  1192. Sub NFadeT(nr, object, message)
  1193. Select Case FadingLevel(nr)
  1194. Case 4:object.Text = "":FadingLevel(nr) = 0
  1195. Case 5:object.Text = message:FadingLevel(nr) = 1
  1196. End Select
  1197. End Sub
  1198.  
  1199. Sub NFadeTm(nr, object, b)
  1200. Select Case FadingLevel(nr)
  1201. Case 4:object.Text = ""
  1202. Case 5:object.Text = message
  1203. End Select
  1204. End Sub
  1205. ' *********************************************************************
  1206. ' Supporting Ball & Sound Functions
  1207. ' *********************************************************************
  1208.  
  1209. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1210. Vol = Csng(BallVel(ball) ^2 / 800)
  1211. End Function
  1212.  
  1213. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1214. Dim tmp
  1215. tmp = ball.x * 2 / table1.width-1
  1216. If tmp > 0 Then
  1217. Pan = Csng(tmp ^10)
  1218. Else
  1219. Pan = Csng(-((- tmp) ^10) )
  1220. End If
  1221. End Function
  1222.  
  1223. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1224. Pitch = BallVel(ball) * 20
  1225. End Function
  1226.  
  1227. Function BallVel(ball) 'Calculates the ball speed
  1228. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1229. End Function
  1230.  
  1231. '**********************
  1232. ' Ball Collision Sound
  1233. '**********************
  1234.  
  1235. Sub OnBallBallCollision(ball1, ball2, velocity)
  1236. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1237. End Sub
  1238.  
  1239. '*****************************************
  1240. ' JP's VP10 Rolling Sounds
  1241. '*****************************************
  1242.  
  1243. Const tnob = 10 ' total number of balls
  1244. ReDim rolling(tnob)
  1245. InitRolling
  1246.  
  1247. Sub InitRolling
  1248. Dim i
  1249. For i = 0 to tnob
  1250. rolling(i) = False
  1251. Next
  1252. End Sub
  1253.  
  1254. Sub RollingUpdate()
  1255. Dim BOT, b
  1256. BOT = GetBalls
  1257.  
  1258. ' stop the sound of deleted balls
  1259. For b = UBound(BOT) + 1 to tnob
  1260. rolling(b) = False
  1261. StopSound("fx_ballrolling" & b)
  1262. Next
  1263.  
  1264. ' exit the sub if no balls on the table
  1265. If UBound(BOT) = -1 Then Exit Sub
  1266.  
  1267. ' play the rolling sound for each ball
  1268. For b = 0 to UBound(BOT)
  1269. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 130 Then
  1270. rolling(b) = True
  1271. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1272. Else
  1273. If rolling(b) = True Then
  1274. StopSound("fx_ballrolling" & b)
  1275. rolling(b) = False
  1276. End If
  1277. End If
  1278. Next
  1279. End Sub
  1280.  
  1281.  
  1282.  
  1283. Sub Pins_Hit (idx)
  1284. PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1285. End Sub
  1286.  
  1287. Sub Targets_Hit (idx)
  1288. PlaySound "target", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1289. End Sub
  1290.  
  1291. Sub Metals_Thin_Hit (idx)
  1292. PlaySound "metalhit_thin", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1293. End Sub
  1294.  
  1295. Sub Metals_Medium_Hit (idx)
  1296. PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1297. End Sub
  1298.  
  1299. Sub Metals2_Hit (idx)
  1300. PlaySound "metalhit2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1301. End Sub
  1302.  
  1303. Sub Gates_Hit (idx)
  1304. PlaySound "gate4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1305. End Sub
  1306.  
  1307.  
  1308. Sub Rubbers_Hit(idx)
  1309. dim finalspeed
  1310. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1311. If finalspeed > 20 then
  1312. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1313. End if
  1314. If finalspeed >= 6 AND finalspeed <= 20 then
  1315. RandomSoundRubber()
  1316. End If
  1317. End Sub
  1318.  
  1319. Sub Posts_Hit(idx)
  1320. dim finalspeed
  1321. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1322. If finalspeed > 16 then
  1323. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1324. End if
  1325. If finalspeed >= 6 AND finalspeed <= 16 then
  1326. RandomSoundRubber()
  1327. End If
  1328. End Sub
  1329.  
  1330. Sub RandomSoundRubber()
  1331. Select Case Int(Rnd*3)+1
  1332. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1333. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1334. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1335. End Select
  1336. End Sub
  1337.  
  1338. Sub LeftFlipper_Collide(parm)
  1339. RandomSoundFlipper()
  1340. End Sub
  1341.  
  1342. Sub RightFlipper_Collide(parm)
  1343. RandomSoundFlipper()
  1344. End Sub
  1345.  
  1346. Sub RandomSoundFlipper()
  1347. Select Case Int(Rnd*3)+1
  1348. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1349. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1350. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1351. End Select
  1352. End Sub
  1353.  
  1354. Sub Balldrop1_Hit()
  1355. PlaySound "Balldrop"
  1356. End Sub
  1357.  
  1358. Sub Balldrop2_Hit()
  1359. PlaySound "Balldrop"
  1360. End Sub
  1361.  
  1362. Sub Scoop_Hit()
  1363. PlaySound "Scoop_Enter"
  1364. End Sub
  1365.  
  1366. Sub RampDrop1_Hit()
  1367. PlaySound "Balldrop"
  1368. End Sub
  1369.  
  1370. Sub RampDrop2_Hit()
  1371. PlaySound "Balldrop"
  1372. End Sub
  1373.  
  1374. Sub RampRoll1_Hit()
  1375. PlaySound "PlasticRolling"
  1376. End Sub
  1377.  
  1378. Sub RampRoll2_Hit()
  1379. PlaySound "PlasticRolling"
  1380. End Sub
  1381.  
  1382. Sub RampRoll3_Hit()
  1383. PlaySound "WireRamp"
  1384. End Sub
  1385.  
  1386. Sub RampRollStop_Hit()
  1387. StopSound "PlasticRolling"
  1388. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement