Advertisement
Guest User

Untitled

a guest
Sep 5th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.76 KB | None | 0 0
  1. Option Explicit
  2. Randomize
  3.  
  4. On Error Resume Next
  5. ExecuteGlobal GetTextFile("controller.vbs")
  6. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  7. On Error Goto 0
  8.  
  9. Const cGameName="bonebstr",UseSolenoids=1,UseLamps=0,UseGI=0,SSolenoidOn="SolOn",SSolenoidOff="SolOff", SCoin="coin"
  10.  
  11. LoadVPM"01520000","sys80.VBS",1.2
  12.  
  13. Dim DesktopMode: DesktopMode = Table1.ShowDT
  14. If DesktopMode = True Then 'Show Desktop components
  15. Ramp16.visible=1
  16. Ramp15.visible=1
  17. Primitive13.visible=1
  18. Else
  19. Ramp16.visible=0
  20. Ramp15.visible=0
  21. Primitive13.visible=0
  22. End if
  23.  
  24. '*************************************************************
  25. 'Solenoid Call backs
  26. '**********************************************************************************************************
  27. SolCallback(1)= "Solenoid1"
  28. SolCallback(2)= "Solenoid2"
  29. SolCallback(3)= "Solenoid3"
  30. SolCallback(5)= "Solenoid5"
  31. 'SolCallback(4)= "Solenoid4" 'Lightbox Insert Light Show
  32. SolCallback(6)= "Solenoid6"
  33. 'SolCallback(7)= "Solenoid7" 'Lightbox Insert Light Show
  34. SolCallback(8)= "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
  35. SolCallback(9)="bsTrough.SolIn"
  36.  
  37. SolCallback(sLRFlipper) = "SolRFlipper"
  38. SolCallback(sLLFlipper) = "SolLFlipper"
  39.  
  40. Sub SolLFlipper(Enabled)
  41. If Enabled Then
  42. PlaySound SoundFX("fx_Flipperup",DOFContactors):LeftFlipper.RotateToEnd:LeftFlipper1.RotateToEnd
  43. Else
  44. PlaySound SoundFX("fx_Flipperdown",DOFContactors):LeftFlipper.RotateToStart:LeftFlipper1.RotateToStart
  45. End If
  46. End Sub
  47.  
  48. Sub SolRFlipper(Enabled)
  49. If Enabled Then
  50. PlaySound SoundFX("fx_Flipperup",DOFContactors):RightFlipper.RotateToEnd:RightFlipper1.RotateToEnd
  51. Else
  52. PlaySound SoundFX("fx_Flipperdown",DOFContactors):RightFlipper.RotateToStart:RightFlipper1.RotateToStart
  53. End If
  54. End Sub
  55. '**********************************************************************************************************
  56.  
  57. 'Solenoid Controlled toys
  58. '**********************************************************************************************************
  59.  
  60. Sub solTrough(Enabled) 'controlled by light ID 2
  61. If Enabled Then
  62. bsTrough.ExitSol_On
  63. End If
  64. End Sub
  65.  
  66.  
  67. Sub Solenoid1(Enabled)
  68. If Controller.Lamp(13) Then 'S Relay enable
  69. SetLamp 101,Enabled 'X2 Red Domes
  70. Else
  71. bsRight.ExitSol_On
  72. End If
  73. End Sub
  74.  
  75. Sub Solenoid2(Enabled)
  76. If Controller.Lamp(13) Then 'S Relay enable
  77. SetLamp 102,Enabled 'X2 Right PF flashers
  78. Else
  79. bsCenter.ExitSol_On
  80. End If
  81. End Sub
  82.  
  83. Sub Solenoid3(Enabled)
  84. If Controller.Lamp(13) Then 'S Relay enable
  85. 'bsKickback.ExitSol_On 'NOT WORKING Manual is Wrong!!!!!!!!!!!!!!!!!!!!
  86. SetLamp 103,Enabled 'X2 Top Left Flipper
  87. Else
  88. SetLamp 133,Enabled 'X2 Skull Topper ????????
  89. End If
  90. End Sub
  91.  
  92. Sub Solenoid4(Enabled)
  93. If Controller.Lamp(13) Then 'S Relay enable
  94. 'Q2
  95. Else
  96. 'Q 55
  97. End If
  98. End Sub
  99.  
  100. Sub Solenoid5(Enabled)
  101. If Controller.Lamp(13) Then 'S Relay enable
  102. SetLamp 105,Enabled
  103. Else
  104. if Controller.switch (46) then 'UpKicker
  105. playsound SoundFX("Popper",DOFContactors)
  106. TopVUK.DestroyBall
  107. Set raiseball = TopVUK.CreateBall
  108. raiseballsw = True
  109. TopVukraiseballtimer.Enabled = True
  110. TopVUK.Enabled=TRUE
  111. Controller.switch (46) = False
  112. end if
  113. End If
  114. End Sub
  115.  
  116. Sub Solenoid6(Enabled)
  117. If Controller.Lamp(13) Then 'S Relay enable
  118. SetLamp 106,Enabled
  119. Else
  120. dtLow.DropSol_On '5 bank Reset
  121. End If
  122. End Sub
  123.  
  124.  
  125. Sub Solenoid7(Enabled)
  126. If Controller.Lamp(13) Then 'S Relay enable
  127. 'Q1
  128. Else
  129. 'Q56
  130. End If
  131. End Sub
  132.  
  133. Sub solkickback(Enabled) ' Lower Left kick back is Light ID 12 controlled
  134. If Enabled Then
  135. bsKickback.ExitSol_On
  136. Else
  137.  
  138. End If
  139. End Sub
  140.  
  141. Sub DivL(Enabled) 'Light ID 16 controlled
  142. If Enabled Then
  143. PlaySound SoundFX("fx_Flipperup",DOFContactors):LeftGate.RotateToEnd:
  144. ' bsKickback.ExitSol_On 'KickBack HACK when SOL 3 did not work
  145. Else
  146. LeftGate.RotateToStart
  147. End If
  148. End Sub
  149.  
  150.  
  151. Sub DivR(Enabled) 'Light ID 17 controlled
  152. If Enabled Then
  153. PlaySound SoundFX("fx_Flipperup",DOFContactors):RightGate.RotateToEnd:
  154. Else
  155. :RightGate.RotateToStart
  156. End If
  157. End Sub
  158.  
  159.  
  160. Sub RelT(Enabled) 'Playfield GI
  161. If Enabled Then
  162. dim xx
  163. For each xx in GI:xx.State = 0: Next
  164. PlaySound "fx_relay"
  165. Else
  166. For each xx in GI:xx.State = 1: Next
  167. PlaySound "fx_relay"
  168. End If
  169. End Sub
  170.  
  171. Sub RelA(Enabled)'Playfield Relay A
  172. If Enabled Then
  173. AuxLampTimer.Enabled = 0
  174. AuxLampTimer1.Enabled = 1
  175.  
  176. Else
  177. AuxLampTimer.Enabled = 1
  178. AuxLampTimer1.Enabled = 0
  179.  
  180. End If
  181. End Sub
  182.  
  183. Dim AuxRampLamps
  184. Dim AuxLampCount
  185. Sub AuxLampTimer_Timer
  186. AuxLampCount = (AuxLampCount + 1) Mod 6
  187.  
  188. Select Case AuxLampCount
  189. Case 0:
  190. SetLamp 115, 1 : SetLamp 116, 0 : SetLamp 117, 0 : SetLamp 118, 0 : SetLamp 119, 0 : SetLamp 120, 0
  191. Case 1:
  192. SetLamp 115, 0 : SetLamp 116, 1 : SetLamp 117, 0 : SetLamp 118, 0 : SetLamp 119, 0 : SetLamp 120, 0
  193. Case 2:
  194. SetLamp 115, 0 : SetLamp 116, 0 : SetLamp 117, 1 : SetLamp 118, 0 : SetLamp 119, 0 : SetLamp 120, 0
  195. Case 3:
  196. SetLamp 115, 0 : SetLamp 116, 0 : SetLamp 117, 0 : SetLamp 118, 1 : SetLamp 119, 0 : SetLamp 120, 0
  197. Case 4:
  198. SetLamp 115, 0 : SetLamp 116, 0 : SetLamp 117, 0 : SetLamp 118, 0 : SetLamp 119, 1 : SetLamp 120, 0
  199. Case 5:
  200. SetLamp 115, 0 : SetLamp 116, 0 : SetLamp 117, 0 : SetLamp 118, 0 : SetLamp 119, 0 : SetLamp 120, 1
  201. End Select
  202. End Sub
  203.  
  204. Dim AuxRamp1Lamps
  205. Dim AuxLamp1Count
  206. Sub AuxLampTimer1_Timer
  207. AuxLamp1Count = (AuxLamp1Count + 1) Mod 5
  208.  
  209. Select Case AuxLamp1Count
  210. Case 0:
  211. SetLamp 111, 1: SetLamp 112, 0: SetLamp 113, 0 : SetLamp 114, 0
  212. Case 1:
  213. SetLamp 111, 0: SetLamp 112, 1: SetLamp 113, 0 : SetLamp 114, 0
  214. Case 3:
  215. SetLamp 111, 0: SetLamp 112, 0: SetLamp 113, 1 : SetLamp 114, 0
  216. Case 4:
  217. SetLamp 111, 0: SetLamp 112, 0: SetLamp 113, 0 : SetLamp 114, 1
  218. End Select
  219. End Sub
  220.  
  221. Sub RelB(Enabled)'BackGlass Relay B
  222. If Enabled Then
  223.  
  224.  
  225. Else
  226.  
  227.  
  228. End If
  229. End Sub
  230.  
  231. '**********************************************************************************************************
  232.  
  233. 'Initiate Table
  234. '**********************************************************************************************************
  235.  
  236. Dim bsTrough, bsCenter, bsRight, bsKickback, dtLow
  237.  
  238. Sub Table1_Init
  239. vpmInit Me
  240. On Error Resume Next
  241. With Controller
  242. .GameName = cGameName
  243. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
  244. .SplashInfoLine = "BoneBusters - Gottlieb"&chr(13)&"You Suck"
  245. .HandleMechanics=0
  246. .HandleKeyboard=0
  247. .ShowDMDOnly=1
  248. .ShowFrame=0
  249. .ShowTitle=0
  250. .hidden = 1
  251. On Error Resume Next
  252. .Run GetPlayerHWnd
  253. If Err Then MsgBox Err.Description
  254. On Error Goto 0
  255. End With
  256. On Error Goto 0
  257.  
  258. PinMAMETimer.Interval=PinMAMEInterval:
  259. PinMAMETimer.Enabled=1
  260. vpmNudge.TiltSwitch=57
  261. vpmNudge.Sensitivity=2
  262. vpmNudge.TiltObj=Array(Bumper1)
  263.  
  264. Set bsTrough=New cvpmBallStack
  265. bsTrough.InitSw 56,0,0,55,0,0,0,0
  266. bsTrough.initkick ballrelease,75,5
  267. bsTrough.InitExitSnd SoundFX("ballrelease",DOFContactors), SoundFX("Solenoid",DOFContactors)
  268. bsTrough.Balls=3
  269.  
  270. Set bsCenter=New cvpmBallStack
  271. bsCenter.InitSaucer sw26,26,180,5
  272. bsCenter.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
  273.  
  274. Set bsRight=New cvpmBallStack
  275. bsRight.InitSaucer sw36,36,180,5
  276. bsRight.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
  277.  
  278. Set bsKickback=New cvpmBallStack
  279. bsKickback.InitSaucer sw42,42,0,30
  280. bsKickback.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
  281.  
  282. Set dtLow=New cvpmDropTarget
  283. dtLow.InitDrop Array(sw00,sw10,sw20,sw30,sw40),Array(0,10,20,30,40)
  284. dtLow.InitSnd SoundFX("DTDrop",DOFContactors),SoundFX("DTReset",DOFContactors)
  285.  
  286. bsTrough.addball 0
  287.  
  288. captiveball.CreateBall
  289. captiveball.Kick 0,1
  290.  
  291. End Sub
  292.  
  293. '**********************************************************************************************************
  294. 'Plunger code
  295. '**********************************************************************************************************
  296.  
  297. Sub Table1_KeyDown(ByVal KeyCode)
  298. If keycode = PlungerKey Then Plunger.Pullback:playsound"plungerpull"
  299.  
  300. If KeyCode=LeftMagnaSave Then Controller.Switch(6)=1
  301. If KeyCode=RightMagnaSave Then Controller.Switch(16)=1
  302. If KeyCode=LeftFlipperKey Then
  303. Controller.Switch(53)=1
  304. End If
  305. If KeyCode=RightFlipperKey Then
  306. Controller.Switch(35)=1
  307. Controller.Switch(45)=1
  308. End If
  309.  
  310. If KeyDownHandler(keycode) Then Exit Sub
  311. End Sub
  312.  
  313. Sub Table1_KeyUp(ByVal KeyCode)
  314. If keycode = PlungerKey Then Plunger.Fire:PlaySound"plunger"
  315.  
  316. If KeyCode=LeftMagnaSave Then Controller.Switch(6)=0
  317. If KeyCode=RightMagnaSave Then Controller.Switch(16)=0
  318. If KeyCode=LeftFlipperKey Then
  319. Controller.Switch(53)=0
  320. End If
  321. If KeyCode=RightFlipperKey Then
  322. Controller.Switch(35)=0
  323. Controller.Switch(45)=0
  324. End If
  325.  
  326. If KeyUpHandler(keycode) Then Exit Sub
  327. End Sub
  328.  
  329. '**********************************************************************************************************
  330.  
  331. ' Drain hole and kickers
  332. Sub Drain_Hit:bsTrough.addball me : playsound"drain" : End Sub
  333. Sub sw26_Hit:bsCenter.AddBall 0 : playsound "popper_ball": End Sub
  334. Sub sw36_Hit:bsRight.AddBall 0 : playsound "popper_ball": End Sub
  335. Sub sw42_Hit:bsKickback.AddBall 0 : playsound "popper_ball": End Sub
  336.  
  337. '***********************************
  338. 'Top right Raising VUK
  339. '***********************************
  340. Dim raiseballsw, raiseball
  341.  
  342. Sub TopVUK_Hit()
  343. TopVUK.Enabled=FALSE
  344. Controller.switch (46) = True
  345. playsound "popper_ball"
  346. End Sub
  347.  
  348. Sub TopVukraiseballtimer_Timer()
  349. If raiseballsw = True then
  350. raiseball.z = raiseball.z + 10
  351. If raiseball.z > 140 then
  352. TopVUK.Kick 180, 10
  353. Set raiseball = Nothing
  354. TopVukraiseballtimer.Enabled = False
  355. raiseballsw = False
  356. End If
  357. End If
  358. End Sub
  359.  
  360. 'Drop Targets
  361. Sub sw00_Hit:dtLow.Hit 1:End Sub
  362. Sub sw10_Hit:dtLow.Hit 2:End Sub
  363. Sub sw20_Hit:dtLow.Hit 3:End Sub
  364. Sub sw30_Hit:dtLow.Hit 4:End Sub
  365. Sub sw40_Hit:dtLow.Hit 5:End Sub
  366.  
  367. 'Stand Up Target
  368. Sub sw1_Hit:vpmTimer.PulseSw 1:End Sub
  369. Sub sw11_Hit:vpmTimer.PulseSw 11:End Sub
  370. Sub sw21_Hit:vpmTimer.PulseSw 21:End Sub
  371. Sub sw31_Hit:vpmTimer.PulseSw 31:End Sub
  372. Sub sw41_Hit:vpmTimer.PulseSw 41:End Sub
  373. Sub sw51_Hit:vpmTimer.PulseSw 51:End Sub
  374.  
  375. Sub sw22_Hit:vpmTimer.PulseSw 22:End Sub
  376. Sub sw23_Hit:vpmTimer.PulseSw 23:End Sub
  377.  
  378. 'Star Triggers
  379. Sub sw2_Hit:Controller.Switch(2)=1:End Sub
  380. Sub sw2_Unhit:Controller.Switch(2)=0:End Sub
  381. Sub sw3_Hit:Controller.Switch(3)=1:End Sub
  382. Sub sw3_Unhit:Controller.Switch(3)=0:End Sub
  383. Sub sw32_Hit:Controller.Switch(32)=1:End Sub
  384. Sub sw32_Unhit:Controller.Switch(32)=0:End Sub
  385. Sub sw33_Hit:Controller.Switch(33)=1:End Sub
  386. Sub sw33_unHit:Controller.Switch(33)=0:End Sub
  387.  
  388. 'Wire Triggers
  389. Sub sw12_Hit:Controller.Switch(12)=1:End Sub
  390. Sub sw12_Unhit:Controller.Switch(12)=0:End Sub
  391. Sub sw13_Hit:Controller.Switch(13)=1:End Sub
  392. Sub sw13_Unhit:Controller.Switch(13)=0:End Sub
  393. Sub sw15_Hit:Controller.Switch(15)=1:End Sub
  394. Sub sw15_Unhit:Controller.Switch(15)=0:End Sub
  395. Sub sw34_Hit:Controller.Switch(34)=1:End Sub
  396. Sub sw34_Unhit:Controller.Switch(34)=0:End Sub
  397. Sub sw43_Hit:Controller.Switch(43)=1:End Sub
  398. Sub sw43_Unhit:Controller.Switch(43)=0:End Sub
  399.  
  400. 'Spinners
  401. Sub sw14_Spin:vpmTimer.PulseSw 14 : playsound"fx_spinner" : End Sub
  402. Sub sw24_Spin:vpmTimer.PulseSw 24 : playsound"fx_spinner" : End Sub
  403.  
  404. 'Ramp Triggers
  405. Sub sw4_Hit:Controller.Switch(4)=1:PlaySound "Wire Ramp":End Sub
  406. Sub sw4_Unhit:Controller.Switch(4)=0:End Sub
  407. Sub sw5_Hit:Controller.Switch(5)=1:PlaySound "Wire Ramp":End Sub
  408. Sub sw5_Unhit:Controller.Switch(5)=0:End Sub
  409.  
  410. 'Upper PF wire Trigger
  411. Sub sw25_Hit:Controller.Switch(25)=1:End Sub
  412. Sub sw25_Unhit:Controller.Switch(25)=0:End Sub
  413.  
  414. 'Scoring Rubber
  415. Sub sw50_hit:vpmTimer.pulseSw 50 : playsound"flip_hit_3" : End Sub
  416.  
  417. 'Gate Trigger
  418. Sub sw44_Hit:vpmTimer.PulseSw 41:End Sub
  419.  
  420. 'Bumpers
  421. Sub Bumper1_Hit : vpmTimer.PulseSw(52) : playsound SoundFX("fx_bumper1",DOFContactors): End Sub
  422.  
  423.  
  424. 'Generic Sounds
  425. Sub Trigger1_Hit:PlaySound "fx_ballrampdrop":End Sub
  426. Sub Trigger2_Hit:PlaySound "fx_ballrampdrop":StopSound "Wire Ramp":End Sub
  427. Sub Trigger3_Hit:PlaySound "fx_ballrampdrop":StopSound "Wire Ramp":End Sub
  428. Sub Trigger4_Hit:PlaySound "fx_ballrampdrop":End Sub
  429.  
  430. Sub Trigger5_Hit:PlaySound "Wire Ramp":End Sub
  431.  
  432. Sub Trigger6_Hit:StopSound "Wire Ramp":PlaySound "flip_hit_3":End Sub
  433.  
  434. '***************************************************
  435. ' JP's VP10 Fading Lamps & Flashers
  436. ' Based on PD's Fading Light System
  437. ' SetLamp 0 is Off
  438. ' SetLamp 1 is On
  439. ' fading for non opacity objects is 4 steps
  440. '***************************************************
  441.  
  442. Dim LampState(200), FadingLevel(200)
  443. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  444.  
  445. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  446. LampTimer.Interval = 5 'lamp fading speed
  447. LampTimer.Enabled = 1
  448.  
  449. ' Lamp & Flasher Timers
  450.  
  451. Sub LampTimer_Timer()
  452. Dim chgLamp, num, chg, ii
  453. chgLamp = Controller.ChangedLamps
  454. If Not IsEmpty(chgLamp) Then
  455. For ii = 0 To UBound(chgLamp)
  456. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  457. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  458.  
  459. 'Special Handling
  460. 'If chgLamp(ii,0) = 0 Then RelQ chgLamp(ii,1) 'Game Overr Q Relay
  461. If chgLamp(ii,0) = 1 Then RelT chgLamp(ii,1) 'Tilt T Relay
  462. If chgLamp(ii,0) = 2 Then solTrough chgLamp(ii,1) 'Ballrelease
  463. If chgLamp(ii,0) = 12 Then solkickback chgLamp(ii,1) 'kickback
  464. 'If chgLamp(ii,0) = 13 Then RelS chgLamp(ii,1) 'Switching S Relay
  465. If chgLamp(ii,0) = 14 Then RelA chgLamp(ii,1) 'Playboard Aux Lamp A Relay
  466. 'If chgLamp(ii,0) = 15 Then RelB chgLamp(ii,1) 'Lightbox Aux Lamp B Relay
  467. If chgLamp(ii,0) = 16 Then DivL chgLamp(ii,1) 'Left Ball Gate
  468. If chgLamp(ii,0) = 17 Then DivR chgLamp(ii,1) 'Right Ball Gate
  469. 'If chgLamp(ii,0) = 18 Then RelC chgLamp(ii,1) 'Skull Motor C Relay
  470. 'If chgLamp(ii,0) = 19 Then Topper chgLamp(ii,1) ' Skull Jaw Relay
  471. Next
  472. End If
  473. UpdateLamps
  474. End Sub
  475.  
  476.  
  477.  
  478. Sub UpdateLamps()
  479. 'NFadeL 0, L0
  480. 'NFadeL 1, L1
  481.  
  482. NFadeL 3, L3
  483.  
  484. NFadeL 5, L5
  485. NFadeL 6, L6
  486. NFadeL 7, L7
  487. NFadeL 8, L8
  488. NFadeL 9, L9
  489. NFadeL 10, L10
  490. NFadeL 11, L11
  491.  
  492.  
  493. 'NFadeL 14, l14
  494.  
  495.  
  496. NFadeL 20, L20
  497. NFadeLm 21, L21
  498. NFadeL 21, L21a
  499. NFadeLm 22, L22
  500. NFadeL 22, L22a
  501. NFadeL 23, L23
  502. NFadeL 24, L24
  503. NFadeL 25, L25
  504. NFadeL 26, L26
  505. NFadeL 27, L27
  506. NFadeL 28, L28
  507. NFadeLm 29, L29
  508. NFadeLm 29, L29a
  509. NFadeLm 30, L30
  510. NFadeL 31, L31
  511. NFadeL 32, L32
  512. NFadeL 33, L33
  513. NFadeL 34, L34
  514. NFadeL 35, L35
  515. NFadeL 36, L36
  516. NFadeL 37, L37
  517. NFadeL 38, L38
  518. NFadeL 39, L39
  519. NFadeL 40, L40
  520. NFadeL 41, L41
  521. NFadeL 42, L42
  522. NFadeL 43, L43
  523. NFadeL 44, L44
  524. NFadeL 45, L45
  525. NFadeL 46, L46
  526. NFadeL 47, L47
  527. NFadeLm 49, L49
  528. NFadeL 49, L49a
  529. NFadeL 50, L50
  530. NFadeL 51, L51
  531.  
  532. 'Solenoid + S Relay Controlled Flasheers
  533.  
  534. NFadeObjm 101, P101a, "TopRedON", "TopRed" ' Right Dome
  535. NFadeObjm 101, P101b, "TopRedON", "TopRed" ' Right Dome
  536. NFadeLm 101, s101a
  537. NFadeLm 101, s101b
  538. NFadeLm 101, s101c
  539. NFadeL 101, s101d
  540.  
  541. NFadeLm 102, s102a
  542. NFadeLm 102, s102b
  543. NFadeLm 102, s102c
  544. NFadeL 102, s102d
  545.  
  546. NFadeLm 103, s103a
  547. NFadeL 103, s103b
  548.  
  549. NFadeLm 105, s105a
  550. NFadeLm 105, s105b
  551. NFadeLm 105, s105c
  552. NFadeL 105, s105d
  553.  
  554. NFadeLm 106, s106a
  555. NFadeLm 106, s106b
  556. NFadeLm 106, s106c
  557. NFadeL 106, s106d
  558.  
  559.  
  560. 'Aux Board
  561.  
  562. NFadeL 111, z1
  563. NFadeL 112, z2
  564. NFadeL 113, z3
  565. NFadeL 114, z4
  566.  
  567. NFadeL 115, z5
  568. NFadeL 116, z6
  569. NFadeL 117, z7
  570. NFadeL 118, z8
  571. NFadeL 119, z9
  572. NFadeL 120, z10
  573.  
  574. End Sub
  575.  
  576.  
  577. ' div lamp subs
  578.  
  579. Sub InitLamps()
  580. Dim x
  581. For x = 0 to 200
  582. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  583. FadingLevel(x) = 4 ' used to track the fading state
  584. FlashSpeedUp(x) = 0.4 ' faster speed when turning on the flasher
  585. FlashSpeedDown(x) = 0.2 ' slower speed when turning off the flasher
  586. FlashMax(x) = 1 ' the maximum value when on, usually 1
  587. FlashMin(x) = 0 ' the minimum value when off, usually 0
  588. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  589. Next
  590. End Sub
  591.  
  592. Sub AllLampsOff
  593. Dim x
  594. For x = 0 to 200
  595. SetLamp x, 0
  596. Next
  597. End Sub
  598.  
  599. Sub SetLamp(nr, value)
  600. If value <> LampState(nr) Then
  601. LampState(nr) = abs(value)
  602. FadingLevel(nr) = abs(value) + 4
  603. End If
  604. End Sub
  605.  
  606. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  607.  
  608. Sub NFadeL(nr, object)
  609. Select Case FadingLevel(nr)
  610. Case 4:object.state = 0:FadingLevel(nr) = 0
  611. Case 5:object.state = 1:FadingLevel(nr) = 1
  612. End Select
  613. End Sub
  614.  
  615. Sub NFadeLm(nr, object) ' used for multiple lights
  616. Select Case FadingLevel(nr)
  617. Case 4:object.state = 0
  618. Case 5:object.state = 1
  619. End Select
  620. End Sub
  621.  
  622. 'Lights, Ramps & Primitives used as 4 step fading lights
  623. 'a,b,c,d are the images used from on to off
  624.  
  625. Sub FadeObj(nr, object, a, b, c, d)
  626. Select Case FadingLevel(nr)
  627. Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
  628. Case 5:object.image = a:FadingLevel(nr) = 1 'ON
  629. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  630. Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  631. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  632. Case 13:object.image = d:FadingLevel(nr) = 0 'Off
  633. End Select
  634. End Sub
  635.  
  636. Sub FadeObjm(nr, object, a, b, c, d)
  637. Select Case FadingLevel(nr)
  638. Case 4:object.image = b
  639. Case 5:object.image = a
  640. Case 9:object.image = c
  641. Case 13:object.image = d
  642. End Select
  643. End Sub
  644.  
  645. Sub NFadeObj(nr, object, a, b)
  646. Select Case FadingLevel(nr)
  647. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  648. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  649. End Select
  650. End Sub
  651.  
  652. Sub NFadeObjm(nr, object, a, b)
  653. Select Case FadingLevel(nr)
  654. Case 4:object.image = b
  655. Case 5:object.image = a
  656. End Select
  657. End Sub
  658.  
  659. ' Flasher objects
  660.  
  661. Sub Flash(nr, object)
  662. Select Case FadingLevel(nr)
  663. Case 4 'off
  664. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  665. If FlashLevel(nr) < FlashMin(nr) Then
  666. FlashLevel(nr) = FlashMin(nr)
  667. FadingLevel(nr) = 0 'completely off
  668. End if
  669. Object.IntensityScale = FlashLevel(nr)
  670. Case 5 ' on
  671. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  672. If FlashLevel(nr) > FlashMax(nr) Then
  673. FlashLevel(nr) = FlashMax(nr)
  674. FadingLevel(nr) = 1 'completely on
  675. End if
  676. Object.IntensityScale = FlashLevel(nr)
  677. End Select
  678. End Sub
  679.  
  680. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  681. Object.IntensityScale = FlashLevel(nr)
  682. End Sub
  683.  
  684.  
  685. '**********************************************************************************************************
  686. 'Digital Display
  687. '**********************************************************************************************************
  688. Dim Digits(40)
  689. Digits(0)=Array(a00, a05, a0c, a0d, a08, a01, a06, a0f, a02, a03, a04, a07, a0b, a0a, a09, a0e)
  690. Digits(1)=Array(a10, a15, a1c, a1d, a18, a11, a16, a1f, a12, a13, a14, a17, a1b, a1a, a19, a1e)
  691. Digits(2)=Array(a20, a25, a2c, a2d, a28, a21, a26, a2f, a22, a23, a24, a27, a2b, a2a, a29, a2e)
  692. Digits(3)=Array(a30, a35, a3c, a3d, a38, a31, a36, a3f, a32, a33, a34, a37, a3b, a3a, a39, a3e)
  693. Digits(4)=Array(a40, a45, a4c, a4d, a48, a41, a46, a4f, a42, a43, a44, a47, a4b, a4a, a49, a4e)
  694. Digits(5)=Array(a50, a55, a5c, a5d, a58, a51, a56, a5f, a52, a53, a54, a57, a5b, a5a, a59, a5e)
  695. Digits(6)=Array(a60, a65, a6c, a6d, a68, a61, a66, a6f, a62, a63, a64, a67, a6b, a6a, a69, a6e)
  696. Digits(7)=Array(a70, a75, a7c, a7d, a78, a71, a76, a7f, a72, a73, a74, a77, a7b, a7a, a79, a7e)
  697. Digits(8)=Array(a80, a85, a8c, a8d, a88, a81, a86, a8f, a82, a83, a84, a87, a8b, a8a, a89, a8e)
  698. Digits(9)=Array(a90, a95, a9c, a9d, a98, a91, a96, a9f, a92, a93, a94, a97, a9b, a9a, a99, a9e)
  699. Digits(10)=Array(aa0, aa5, aac, aad, aa8, aa1, aa6, aaf, aa2, aa3, aa4, aa7, aab, aaa, aa9, aae)
  700. Digits(11)=Array(ab0, ab5, abc, abd, ab8, ab1, ab6, abf, ab2, ab3, ab4, ab7, abb, aba, ab9, abe)
  701. Digits(12)=Array(ac0, ac5, acc, acd, ac8, ac1, ac6, acf, ac2, ac3, ac4, ac7, acb, aca, ac9, ace)
  702. Digits(13)=Array(ad0, ad5, adc, add, ad8, ad1, ad6, adf, ad2, ad3, ad4, ad7, adb, ada, ad9, ade)
  703. Digits(14)=Array(ae0, ae5, aec, aed, ae8, ae1, ae6, aef, ae2, ae3, ae4, ae7, aeb, aea, ae9, aee)
  704. Digits(15)=Array(af0, af5, afc, afd, af8, af1, af6, aff, af2, af3, af4, af7, afb, afa, af9, afe)
  705. Digits(16)=Array(b00, b05, b0c, b0d, b08, b01, b06, b0f, b02, b03, b04, b07, b0b, b0a, b09, b0e)
  706. Digits(17)=Array(b10, b15, b1c, b1d, b18, b11, b16, b1f, b12, b13, b14, b17, b1b, b1a, b19, b1e)
  707. Digits(18)=Array(b20, b25, b2c, b2d, b28, b21, b26, b2f, b22, b23, b24, b27, b2b, b2a, b29, b2e)
  708. Digits(19)=Array(b30, b35, b3c, b3d, b38, b31, b36, b3f, b32, b33, b34, b37, b3b, b3a, b39, b3e)
  709.  
  710. Digits(20)=Array(b40, b45, b4c, b4d, b48, b41, b46, b4f, b42, b43, b44, b47, b4b, b4a, b49, b4e)
  711. Digits(21)=Array(b50, b55, b5c, b5d, b58, b51, b56, b5f, b52, b53, b54, b57, b5b, b5a, b59, b5e)
  712. Digits(22)=Array(b60, b65, b6c, b6d, b68, b61, b66, b6f, b62, b63, b64, b67, b6b, b6a, b69, b6e)
  713. Digits(23)=Array(b70, b75, b7c, b7d, b78, b71, b76, b7f, b72, b73, b74, b77, b7b, b7a, b79, b7e)
  714. Digits(24)=Array(b80, b85, b8c, b8d, b88, b81, b86, b8f, b82, b83, b84, b87, b8b, b8a, b89, b8e)
  715. Digits(25)=Array(b90, b95, b9c, b9d, b98, b91, b96, b9f, b92, b93, b94, b97, b9b, b9a, b99, b9e)
  716. Digits(26)=Array(ba0, ba5, bac, bad, ba8, ba1, ba6, baf, ba2, ba3, ba4, ba7, bab, baa, ba9, bae)
  717. Digits(27)=Array(bb0, bb5, bbc, bbd, bb8, bb1, bb6, bbf, bb2, bb3, bb4, bb7, bbb, bba, bb9, bbe)
  718. Digits(28)=Array(bc0, bc5, bcc, bcd, bc8, bc1, bc6, bcf, bc2, bc3, bc4, bc7, bcb, bca, bc9, bce)
  719. Digits(29)=Array(bd0, bd5, bdc, bdd, bd8, bd1, bd6, bdf, bd2, bd3, bd4, bd7, bdb, bda, bd9, bde)
  720. Digits(30)=Array(be0, be5, bec, bed, be8, be1, be6, bef, be2, be3, be4, be7, beb, bea, be9, bee)
  721. Digits(31)=Array(bf0, bf5, bfc, bfd, bf8, bf1, bf6, bff, bf2, bf3, bf4, bf7, bfb, bfa, bf9, bfe)
  722. Digits(32)=Array(ac18, ac16, acc1, acd1, ac19, ac17, ac15, acf1, ac11, ac13, ac12, ac14, acb1, aca1, ac10, ace1)
  723. Digits(33)=Array(ad18, ad16, adc1, add1, ad19, ad17, ad15, adf1, ad11, ad13, ad12, ad14, adb1, ada1, ad10, ade1)
  724. Digits(34)=Array(ae18, ae16, aec1, aed1, ae19, ae17, ae15, aef1, ae11, ae13, ae12, ae14, aeb1, aea1, ae10, aee1)
  725. Digits(35)=Array(af18, af16, afc1, afd1, af19, af17, af15, aff1, af11, af13, af12, af14, afb1, afa1, af10, afe1)
  726. Digits(36)=Array(b9, b7, b0c1, b0d1, b100, b8, b6, b0f1, b2, b4, b3, b5, b0b1, b0a1, b1,b0e1)
  727. Digits(37)=Array(b109, b107, b1c1, b1d1, b110, b108, b106, b1f1, b102, b104, b103, b105, b1b1, b1a1, b101,b1e1)
  728. Digits(38)=Array(b119, b117, b2c1, b2d1, b120, b118, b116, b2f1, b112, b114, b113, b115, b2b1, b2a1, b111, b2e1)
  729. Digits(39)=Array(b129, b127, b3c1, b3d1, b130, b128, b126, b3f1, b122, b3b1, b123, b125, b3b1, b3a1, b121, b3e1)
  730.  
  731.  
  732. Sub DisplayTimer_Timer
  733. Dim ChgLED, ii, jj, num, chg, stat, obj, b, x
  734. ChgLED=Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
  735. If Not IsEmpty(ChgLED)Then
  736. If DesktopMode = True Then
  737. For ii=0 To UBound(chgLED)
  738. num=chgLED(ii, 0) : chg=chgLED(ii, 1) : stat=chgLED(ii, 2)
  739. if (num < 40) then
  740. For Each obj In Digits(num)
  741. If chg And 1 Then obj.State=stat And 1
  742. chg=chg\2 : stat=stat\2
  743. Next
  744. Else
  745. end if
  746. Next
  747. end if
  748. End If
  749. End Sub
  750.  
  751. '**********************************************************************************************************
  752. '**********************************************************************************************************
  753.  
  754. 'Gottlieb Bone Busters
  755. 'added by Inkochnito
  756. Sub editDips
  757. Dim vpmDips:Set vpmDips=New cvpmDips
  758. With vpmDips
  759. .AddForm 700,400,"Bone Busters - DIP switches"
  760. .AddFrame 2,4,190,"Maximum credits",49152,Array("8 credits",0,"10 credits",32768,"15 credits",&H00004000,"20 credits",49152)'dip 15&16
  761. .AddFrame 2,80,190,"Coin chute 1 and 2 control",&H00002000,Array("seperate",0,"same",&H00002000)'dip 14
  762. .AddFrame 2,126,190,"Playfield special",&H00200000,Array("replay",0,"extra ball",&H00200000)'dip 22
  763. .AddFrame 2,172,190,"High games to date control",&H00000020,Array("no effect",0,"reset high games 2-5 on power off",&H00000020)'dip 6
  764. .AddFrame 2,218,190,"Auto-percentage control",&H00000080,Array("disabled (normal high score mode)",0,"enabled",&H00000080)'dip 8
  765. .AddFrame 2,264,190,"Extra ball && special timing",&H40000000,Array("shorter",0,"longer",&H40000000)'dip 31
  766. .AddChk 2,316,150,Array("Bonus ball feature",&H80000000)'dip 32
  767. .AddFrame 205,4,190,"High game to date awards",&H00C00000,Array("not displayed and no award",0,"displayed and no award",&H00800000,"displayed and 2 replays",&H00400000,"displayed and 3 replays",&H00C00000)'dip 23&24
  768. .AddFrame 205,80,190,"Balls per game",&H01000000,Array("5 balls",0,"3 balls",&H01000000)'dip 25
  769. .AddFrame 205,126,190,"Replay limit",&H04000000,Array("no limit",0,"one per game",&H04000000)'dip 27
  770. .AddFrame 205,172,190,"Novelty",&H08000000,Array("normal",0,"extra ball and replay scores 500K",&H08000000)'dip 28
  771. .AddFrame 205,218,190,"Game mode",&H10000000,Array("replay",0,"extra ball",&H10000000)'dip 29
  772. .AddFrame 205,264,190,"3rd coin chute credits control",&H20000000,Array("no effect",0,"add 9",&H20000000)'dip 30
  773. .AddChk 170,316,100,Array("Match feature",&H02000000)'dip 26
  774. .AddChk 290,316,100,Array("Attract sound",&H00000040)'dip 7
  775. .AddLabel 50,340,300,20,"After hitting OK, press F3 to reset game with new settings."
  776. .ViewDips
  777. End With
  778. End Sub
  779. Set vpmShowDips=GetRef("EditDips")
  780.  
  781.  
  782.  
  783.  
  784. '*********************************************************************
  785. ' Positional Sound Playback Functions
  786. '*********************************************************************
  787.  
  788. ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
  789. ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
  790. ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
  791. Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
  792. PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
  793. End Sub
  794.  
  795. ' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
  796. Sub PlaySoundAt(soundname, tableobj)
  797. PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  798. End Sub
  799.  
  800. Sub PlaySoundAtBall(soundname)
  801. PlaySoundAt soundname, ActiveBall
  802. End Sub
  803.  
  804.  
  805. '*********************************************************************
  806. ' Supporting Ball & Sound Functions
  807. '*********************************************************************
  808.  
  809. Function AudioFade(tableobj) ' Fades between front and back of the table (for surround systems or 2x2 speakers, etc), depending on the Y position on the table. "table1" is the name of the table
  810. Dim tmp
  811. tmp = tableobj.y * 2 / table1.height-1
  812. If tmp > 0 Then
  813. AudioFade = Csng(tmp ^10)
  814. Else
  815. AudioFade = Csng(-((- tmp) ^10) )
  816. End If
  817. End Function
  818.  
  819. Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
  820. Dim tmp
  821. tmp = tableobj.x * 2 / table1.width-1
  822. If tmp > 0 Then
  823. AudioPan = Csng(tmp ^10)
  824. Else
  825. AudioPan = Csng(-((- tmp) ^10) )
  826. End If
  827. End Function
  828.  
  829. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  830. Vol = Csng(BallVel(ball) ^2 / 2000)
  831. End Function
  832.  
  833. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  834. Pitch = BallVel(ball) * 20
  835. End Function
  836.  
  837. Function BallVel(ball) 'Calculates the ball speed
  838. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  839. End Function
  840.  
  841.  
  842. '*****************************************
  843. ' JP's VP10 Rolling Sounds
  844. '*****************************************
  845.  
  846. Const tnob = 5 ' total number of balls
  847. ReDim rolling(tnob)
  848. InitRolling
  849.  
  850. Sub InitRolling
  851. Dim i
  852. For i = 0 to tnob
  853. rolling(i) = False
  854. Next
  855. End Sub
  856.  
  857. Sub RollingTimer_Timer()
  858. Dim BOT, b
  859. BOT = GetBalls
  860.  
  861. ' stop the sound of deleted balls
  862. For b = UBound(BOT) + 1 to tnob
  863. rolling(b) = False
  864. StopSound("fx_ballrolling" & b)
  865. Next
  866.  
  867. ' exit the sub if no balls on the table
  868. If UBound(BOT) = -1 Then Exit Sub
  869.  
  870. ' play the rolling sound for each ball
  871. For b = 0 to UBound(BOT)
  872. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  873. rolling(b) = True
  874. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b)), AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  875. Else
  876. If rolling(b) = True Then
  877. StopSound("fx_ballrolling" & b)
  878. rolling(b) = False
  879. End If
  880. End If
  881. Next
  882. End Sub
  883.  
  884. '**********************
  885. ' Ball Collision Sound
  886. '**********************
  887.  
  888. Sub OnBallBallCollision(ball1, ball2, velocity)
  889. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  890. End Sub
  891.  
  892.  
  893. '*****************************************
  894. ' ninuzzu's FLIPPER SHADOWS
  895. '*****************************************
  896.  
  897. sub FlipperTimer_Timer()
  898. FlipperLSh.RotZ = LeftFlipper.currentangle
  899. FlipperRSh.RotZ = RightFlipper.currentangle
  900. FlipperLSh1.RotZ = LeftFlipper1.currentangle
  901.  
  902. GFL.Roty = LeftFlipper.currentangle + 240
  903. GFR.Roty = RightFlipper.currentangle + 120
  904. GFL1.Roty = LeftFlipper1.currentangle + 210
  905. GFR1.Roty = RightFlipper1.currentangle + 20
  906.  
  907. primdiv1.RotZ = LeftGate.currentangle
  908. primdiv2.RotZ = RightGate.currentangle
  909. End Sub
  910.  
  911. '*****************************************
  912. ' ninuzzu's BALL SHADOW
  913. '*****************************************
  914. Dim BallShadow
  915. BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
  916.  
  917. Sub BallShadowUpdate_timer()
  918. Dim BOT, b
  919. BOT = GetBalls
  920. ' hide shadow of deleted balls
  921. If UBound(BOT)<(tnob-1) Then
  922. For b = (UBound(BOT) + 1) to (tnob-1)
  923. BallShadow(b).visible = 0
  924. Next
  925. End If
  926. ' exit the Sub if no balls on the table
  927. If UBound(BOT) = -1 Then Exit Sub
  928. ' render the shadow for each ball
  929. For b = 0 to UBound(BOT)
  930. If BOT(b).X < Table1.Width/2 Then
  931. BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) + 6
  932. Else
  933. BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) - 6
  934. End If
  935. ballShadow(b).Y = BOT(b).Y + 12
  936. If BOT(b).Z > 20 Then
  937. BallShadow(b).visible = 1
  938. Else
  939. BallShadow(b).visible = 0
  940. End If
  941. Next
  942. End Sub
  943.  
  944.  
  945.  
  946. '************************************
  947. ' What you need to add to your table
  948. '************************************
  949.  
  950. ' a timer called RollingTimer. With a fast interval, like 10
  951. ' one collision sound, in this script is called fx_collide
  952. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  953. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  954.  
  955.  
  956. '******************************************
  957. ' Explanation of the rolling sound routine
  958. '******************************************
  959.  
  960. ' sounds are played based on the ball speed and position
  961.  
  962. ' the routine checks first for deleted balls and stops the rolling sound.
  963.  
  964. ' The For loop goes through all the balls on the table and checks for the ball speed and
  965. ' if the ball is on the table (height lower than 30) then then it plays the sound
  966. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  967.  
  968. ' The sound is played using the VOL, AUDIOPAN, AUDIOFADE and PITCH functions, so the volume and pitch of the sound
  969. ' will change according to the ball speed, and the AUDIOPAN & AUDIOFADE functions will change the stereo position
  970. ' according to the position of the ball on the table.
  971.  
  972.  
  973. '**************************************
  974. ' Explanation of the collision routine
  975. '**************************************
  976.  
  977. ' The collision is built in VP.
  978. ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
  979. ' will call this routine. What you add in the sub is up to you. As an example is a simple Playsound with volume and paning
  980. ' depending of the speed of the collision.
  981.  
  982.  
  983. Sub Pins_Hit (idx)
  984. PlaySound "pinhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  985. End Sub
  986.  
  987. Sub Targets_Hit (idx)
  988. PlaySound "target", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  989. End Sub
  990.  
  991. Sub Metals_Thin_Hit (idx)
  992. PlaySound "metalhit_thin", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  993. End Sub
  994.  
  995. Sub Metals_Medium_Hit (idx)
  996. PlaySound "metalhit_medium", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  997. End Sub
  998.  
  999. Sub Metals2_Hit (idx)
  1000. PlaySound "metalhit2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1001. End Sub
  1002.  
  1003. Sub Gates_Hit (idx)
  1004. PlaySound "gate4", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1005. End Sub
  1006.  
  1007. Sub Spinner_Spin
  1008. PlaySound "fx_spinner", 0, .25, AudioPan(Spinner), 0.25, 0, 0, 1, AudioFade(Spinner)
  1009. End Sub
  1010.  
  1011. Sub Rubbers_Hit(idx)
  1012. dim finalspeed
  1013. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1014. If finalspeed > 20 then
  1015. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1016. End if
  1017. If finalspeed >= 6 AND finalspeed <= 20 then
  1018. RandomSoundRubber()
  1019. End If
  1020. End Sub
  1021.  
  1022. Sub Posts_Hit(idx)
  1023. dim finalspeed
  1024. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1025. If finalspeed > 16 then
  1026. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1027. End if
  1028. If finalspeed >= 6 AND finalspeed <= 16 then
  1029. RandomSoundRubber()
  1030. End If
  1031. End Sub
  1032.  
  1033. Sub RandomSoundRubber()
  1034. Select Case Int(Rnd*3)+1
  1035. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1036. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1037. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1038. End Select
  1039. End Sub
  1040.  
  1041. Sub LeftFlipper_Collide(parm)
  1042. RandomSoundFlipper()
  1043. End Sub
  1044.  
  1045. Sub RightFlipper_Collide(parm)
  1046. RandomSoundFlipper()
  1047. End Sub
  1048.  
  1049. Sub RandomSoundFlipper()
  1050. Select Case Int(Rnd*3)+1
  1051. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1052. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1053. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1054. End Select
  1055. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement