Arngrim

Vegas

Mar 2nd, 2021
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.78 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="vegas",UseSolenoids=2,UseLamps=0,UseGI=0,sCoin="coin"
  10.  
  11. LoadVPM "01120100", "gts3.vbs", 3.10
  12.  
  13. Dim DesktopMode: DesktopMode = Table1.ShowDT
  14. If DesktopMode = True Then 'Show Desktop components
  15. Ramp001.visible=1
  16. Ramp002.visible=1
  17. Primitive019.visible=1
  18. Else
  19. Ramp001.visible=0
  20. Ramp002.visible=0
  21. Primitive019.visible=0
  22. End if
  23.  
  24. '*************************************************************
  25. 'Playfiled Glass
  26.  
  27. Dim Glass:
  28. Glass = 0 'Choose: 0 Glass OFF\Invisible or 1 Glass ON\Visible
  29. If Glass = 1 Then
  30. WallGlass.visible = 1
  31. Else
  32. WallGlass.visible=0
  33. End if
  34.  
  35. '*************************************************************
  36. 'Solenoid Call backs
  37. '**********************************************************************************************************
  38.  
  39. 'SolCallback(1) = "vpmSolSound ""Jet1"","
  40. 'SolCallback(2) = "vpmSolSound ""Jet2"","
  41. 'SolCallback(3) = "vpmSolSound ""Jet2"","
  42. 'SolCallback(4) = "vpmSolSound ""Sensor""," 'Left Slingshot
  43. 'SolCallback(5) = "vpmSolSound ""Sensor""," 'Right Slingshot
  44. SolCallback(6) = "bsSaucer42.SolOut"
  45. SolCallback(7) = "dtLDrop.SolDropUp"
  46.  
  47. 'SolCallback(8) = "Sol8," 'V - Backglass
  48. 'SolCallback(9) = "Sol9," 'E - Backglass
  49. 'SolCallback(10) = "Sol10," 'G - Backglass
  50. 'SolCallback(11) = "Sol11," 'A - Backglass
  51. 'SolCallback(12) = "Sol12," 'S - Backglass
  52. 'SolCallback(13) = "Sol13" '1 - Backglass
  53. 'SolCallback(14) = "Sol14" '2 - Backglass
  54. 'SolCallback(15) = "Sol15," '3 - Backglass
  55. 'SolCallback(16) = "Sol16," '4 - Backglass
  56. 'SolCallback(17) = "Sol17," 'LED Display - Backglass
  57. SolCallback(18) = "FlashRed2" 'Top Left Flashers
  58. SolCallback(19) = "FlashRed6" 'Top Right Flasher
  59. SolCallback(20) = "SetLamp 142," 'Top Right White Target
  60. SolCallback(21) = "SetLamp 143," 'Drop Targets
  61. SolCallback(22) = "SetLamp 144," 'Yellow Targets
  62. SolCallback(23) = "SetLamp 145," 'Bottom Right Star Trigger
  63. SolCallback(24) = "SetLamp 146," 'Bottom Left Star Trigger
  64. SolCallback(25) = "FlashRed8" 'Red Dome above kicker
  65. 'SolCallback(35)="FlashRed8" 'Red Dome above kicker
  66.  
  67. SolCallback(26) = "PFGI" 'lightbox relay
  68. 'SolCallback(27) = "Sol27," 'ticketdispencer
  69. SolCallback(28) = "bsTrough.SolOut"
  70. SolCallback(29) = "bsTrough.SolIn"
  71. SolCallback(30) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
  72. 'SolCallback(31) = "vpmNudge.SolGameOn" 'SolCallback(31) = "vpmNudge.SolGameOn"
  73. 'SolCallback(32) = "vpmSolSound ""sensor""," 'SolCallback(32) = "Sol Game Over"
  74.  
  75. SolCallback(sLRFlipper) = "SolRFlipper"
  76. SolCallback(sLLFlipper) = "SolLFlipper"
  77.  
  78. Sub SolLFlipper(Enabled)
  79. If Enabled Then
  80. PlaySound SoundFx("fx_Flipperup",DOFFlippers):LeftFlipper.RotateToEnd
  81. Else
  82. PlaySound SoundFx("fx_FlipperDown",DOFFlippers):LeftFlipper.RotateToStart
  83. End If
  84. End Sub
  85.  
  86. Sub SolRFlipper(Enabled)
  87. If Enabled Then
  88. PlaySound SoundFx("fx_Flipperup",DOFFlippers):RightFlipper.RotateToEnd
  89. Else
  90. PlaySound SoundFx("fx_FlipperDown",DOFFlippers):RightFlipper.RotateToStart
  91. End If
  92. End Sub
  93.  
  94. '**********************************************************************************************************
  95. 'Solenoid Controlled toys
  96. '**********************************************************************************************************
  97.  
  98. 'Playfield GI
  99. Sub PFGI(Enabled)
  100. If Enabled Then
  101. dim xx
  102. For each xx in GI:xx.State = 0: Next
  103. PlaySound "fx_relay"
  104. Else
  105. For each xx in GI:xx.State = 1: Next
  106. PlaySound "fx_relay"
  107. End If
  108. End Sub
  109.  
  110. '**********************************************************************************************************
  111.  
  112. 'Initiate Table
  113. '**********************************************************************************************************
  114.  
  115. Dim bsTrough,bsSaucer42,dtLDrop
  116.  
  117. Sub Table1_Init
  118. vpminit me
  119. On Error Resume Next
  120. With Controller
  121. .GameName = cGameName
  122. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
  123. .SplashInfoLine = ""&chr(13)&"You Suck"
  124. .HandleMechanics=0
  125. .HandleKeyboard=0
  126. .ShowDMDOnly=1
  127. .ShowFrame=0
  128. .ShowTitle=0
  129. .hidden = 1 'enable to hide DMD if You use a B2S backglass
  130. .Games(cGameName).Settings.Value("sound")=1
  131. '.PuPHide = 1
  132. On Error Resume Next
  133. .Run GetPlayerHWnd
  134. If Err Then MsgBox Err.Description
  135. On Error Goto 0
  136. End With
  137. On Error Goto 0
  138.  
  139. PinMAMETimer.Interval=PinMAMEInterval
  140. PinMAMETimer.Enabled = true
  141.  
  142. vpmNudge.TiltSwitch=swTilt
  143. vpmNudge.Sensitivity=5
  144. vpmNudge.TiltObj=Array(Bumper1,Bumper2,Bumper3,RightSlingShot,LeftSlingShot)
  145.  
  146.  
  147. Set bsTrough=new cvpmBallStack
  148. bsTrough.InitSw 6,7,0,0,0,0,0,0
  149. bsTrough.InitKick BallRelease,110,3
  150. bsTrough.InitExitSnd SoundFX("BallRel",DOFContactors),SoundFX("Solenoid",DOFContactors)
  151. ' bsTrough.Balls=3
  152.  
  153. Set dtLDrop = new cvpmDropTarget
  154. dtLDrop.InitDrop Array(sw17,sw27,sw37,sw47,sw57), Array(17,27,37,47,57)
  155. dtLDrop.InitSnd SoundFX("Targetdrop1",DOFDropTargets),SoundFX("TargetBankreset1",DOFContactors)
  156.  
  157. Set bsSaucer42 = New cvpmBallStack
  158. bsSaucer42.InitSaucer sw42,42,120,14
  159. bsSaucer42.InitExitSnd SoundFX("Popper",DOFContactors),SoundFX("Solenoid",DOFContactors)
  160. bsSaucer42.KickAngleVar=30
  161. bsSaucer42.KickForceVar = 5
  162.  
  163. End Sub
  164.  
  165. Sub Timer1_Timer
  166. Me.Enabled=0
  167. bsTrough.Balls=3
  168. End Sub
  169.  
  170. '**********************************************************************************************************
  171. 'Plunger code
  172. '**********************************************************************************************************
  173.  
  174. Sub Table1_KeyDown(ByVal keycode)
  175. If keycode = LeftMagnaSave Then bLutActive = True
  176. If keycode = RightMagnaSave Then
  177. If bLutActive Then NextLUT: End If
  178. End If
  179. If LeftMagnaSave Then Controller.Switch(4)=1
  180. If RightMagnaSave Then Controller.Switch(5)=1
  181. iF KEYCODE = StartGameKey THEN CONTROLLER.SWITCH(3)=1
  182. If keycode = PlungerKey Then Plunger.Pullback:playsound"PlungerPull"
  183. ' If keycode = 21 Then Controller.Switch(152) = 1
  184. If KeyDownHandler(keycode) Then Exit Sub
  185.  
  186. End Sub
  187.  
  188. Sub Table1_KeyUp(ByVal keycode)
  189. If keycode = LeftMagnaSave Then bLutActive = False
  190. If LeftMagnaSave Then Controller.Switch(4)=0
  191. If RightMagnaSave Then Controller.Switch(5)=0
  192. iF KEYCODE = StartGameKey THEN CONTROLLER.SWITCH(3)=0
  193. If keycode = PlungerKey Then Plunger.Fire:PlaySound"plunger"
  194. ' If keycode = 21 Then Controller.Switch(152) = 0
  195. If KeyUpHandler(keycode) Then Exit Sub
  196.  
  197. End Sub
  198.  
  199.  
  200. '------------------------------
  201. '------ Trough Handler ------
  202. '------------------------------
  203.  
  204. ' Drain
  205. Sub Drain_Hit:bsTrough.addball me : playsound "Drain": End Sub
  206.  
  207. ' Kickers
  208. Sub sw42_Hit:bsSaucer42.AddBall 0 : playsound "Popper_Ball": End Sub
  209.  
  210. ' Drop Targets
  211.  
  212. Sub sw17_Hit() dtLDrop.Hit 1 : End Sub
  213. Sub sw27_Hit() dtLDrop.Hit 2 : End Sub
  214. Sub sw37_Hit() dtLDrop.Hit 3 : End Sub
  215. Sub sw47_Hit() dtLDrop.Hit 4 : End Sub
  216. Sub sw57_Hit() dtLDrop.Hit 5 : End Sub
  217.  
  218.  
  219. ' Star Triggers
  220.  
  221. sub sw21_hit:Controller.Switch(21)=1:PlaySound "trigger":End Sub
  222. sub sw21_unhit:Controller.Switch(21)=0:End Sub
  223. sub sw22_hit:Controller.Switch(22)=1:PlaySound "trigger":End Sub
  224. sub sw22_unhit:Controller.Switch(22)=0:End Sub
  225. sub sw31_hit:Controller.Switch(31)=1:PlaySound "trigger":End Sub
  226. sub sw31_unhit:Controller.Switch(31)=0:End Sub
  227. sub sw32_hit:Controller.Switch(32)=1:PlaySound "trigger":End Sub
  228. sub sw32_unhit:Controller.Switch(32)=0:End Sub
  229.  
  230. 'Wire Triggers
  231.  
  232. sub sw20_hit:Controller.Switch(20)=1:PlaySound "rollover":End Sub
  233. sub sw20_unhit:Controller.Switch(20)=0:End Sub
  234. sub sw23_hit:Controller.Switch(23)=1:PlaySound "rollover":End Sub
  235. sub sw23_unhit:Controller.Switch(23)=0:End Sub
  236. sub sw30_hit:Controller.Switch(30)=1:PlaySound "rollover":End Sub
  237. sub sw30_unhit:Controller.Switch(30)=0:End Sub
  238. sub sw33_hit:Controller.Switch(33)=1:PlaySound "rollover":End Sub
  239. sub sw33_unhit:Controller.Switch(33)=0:End Sub
  240. sub sw40_hit:Controller.Switch(40)=1:PlaySound "rollover":End Sub
  241. sub sw40_unhit:Controller.Switch(40)=0:End Sub
  242. sub sw41_hit:Controller.Switch(41)=1:PlaySound "rollover":End Sub
  243. sub sw41_unhit:Controller.Switch(41)=0:End Sub
  244. sub sw43_hit:Controller.Switch(43)=1:PlaySound "rollover":End Sub
  245. sub sw43_unhit:Controller.Switch(43)=0:End Sub
  246.  
  247. 'Stand Up Targets
  248.  
  249. Sub sw16_Hit:vpmTimer.PulseSw 16:PlaySound SoundFX("Target",DOFTargets):End Sub
  250. Sub sw24_Hit:vpmTimer.PulseSw 24:PlaySound SoundFX("Target",DOFTargets):End Sub
  251. Sub sw25_Hit:vpmTimer.PulseSw 25:PlaySound SoundFX("Target",DOFTargets):End Sub
  252. Sub sw26_Hit:vpmTimer.PulseSw 26:PlaySound SoundFX("Target",DOFTargets):End Sub
  253. Sub sw34_Hit:vpmTimer.PulseSw 34:PlaySound SoundFX("Target",DOFTargets):End Sub
  254. Sub sw35_Hit:vpmTimer.PulseSw 35:PlaySound SoundFX("Target",DOFTargets):End Sub
  255. Sub sw36_Hit:vpmTimer.PulseSw 36:PlaySound SoundFX("Target",DOFTargets):End Sub
  256. Sub sw45_Hit:vpmTimer.PulseSw 45:PlaySound SoundFX("Target",DOFTargets):End Sub
  257. Sub sw46_Hit:vpmTimer.PulseSw 46:PlaySound SoundFX("Target",DOFTargets):End Sub
  258.  
  259.  
  260. ' Rubber Wall
  261.  
  262. Sub sw15_hit:vpmTimer.PulseSw 15: PlaySound "wallhit":End Sub
  263.  
  264. ' Bumpers
  265.  
  266. Sub Bumper1_Hit:vpmTimer.PulseSw 10:Playsound SoundFX("jet1",DOFContactors): End Sub
  267. Sub Bumper2_Hit:vpmTimer.PulseSw 11:Playsound SoundFX("jet2",DOFContactors): End Sub
  268. Sub Bumper3_Hit:vpmTimer.PulseSw 12:Playsound SoundFX("jet2",DOFContactors): End Sub
  269.  
  270. 'Sons ambiente
  271.  
  272. Sub Wall297_hit():playsound "bhit":end sub
  273. Sub Wall323_hit():playsound "bhit":end sub
  274. Sub Wall318_hit():playsound "bhit":end sub
  275. Sub Wall333_hit():playsound "bhit":end sub
  276. Sub Wall296_hit():playsound "bhit":end sub
  277. Sub Wall290_hit():playsound "bhit":end sub
  278. Sub Wall314_hit():playsound "bhit":end sub
  279. Sub Wall315_hit():playsound "bhit":end sub
  280. Sub Wall332_hit():playsound "bhit":end sub
  281. Sub Wall272_hit():playsound "bhit":end sub
  282. Sub Wall270_hit():playsound "bhit":end sub
  283. Sub Wall268_hit():playsound "bhit":end sub
  284. Sub Wall293_hit():playsound "bhit":end sub
  285. Sub Wall397_hit():playsound "bhit":end sub
  286. Sub Wall263_hit():playsound "bhit":end sub
  287. Sub Wall252_hit():playsound "bhit":end sub
  288.  
  289.  
  290. Sub Gate_Hit:playsound "Gate5":End Sub
  291. Sub Gate1_Hit:playsound "Gate5":End Sub
  292. Sub Gate2_Hit:playsound "Gate5":End Sub
  293. Sub Fundo_hit:playsound "wallhit":end sub
  294.  
  295. '**********Sling Shot Animations
  296. ' Rstep and Lstep are the variables that increment the animation
  297. '****************
  298. Dim RStep, Lstep
  299.  
  300. Sub RightSlingShot_Slingshot
  301. vpmTimer.PulseSw 14
  302. PlaySound SoundFX("right_slingshot",DOFContactors), 0,1, 0.05,0.05 '0,1, AudioPan(RightSlingShot), 0.05,0,0,1,AudioFade(RightSlingShot)
  303. RSling.Visible = 0
  304. RSling1.Visible = 1
  305. sling1.rotx = 20
  306. RStep = 0
  307. RightSlingShot.TimerEnabled = 1
  308. End Sub
  309.  
  310. Sub RightSlingShot_Timer
  311. Select Case RStep
  312. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.rotx = 10
  313. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.rotx = 0:RightSlingShot.TimerEnabled = 0:
  314. End Select
  315. RStep = RStep + 1
  316. End Sub
  317.  
  318. Sub LeftSlingShot_Slingshot
  319. vpmTimer.PulseSw 13
  320. PlaySound SoundFX("left_slingshot",DOFContactors), 0,1, -0.05,0.05 '0,1, AudioPan(LeftSlingShot), 0.05,0,0,1,AudioFade(LeftSlingShot)
  321. LSling.Visible = 0
  322. LSling1.Visible = 1
  323. sling2.rotx = 20
  324. LStep = 0
  325. LeftSlingShot.TimerEnabled = 1
  326. End Sub
  327.  
  328. Sub LeftSlingShot_Timer
  329. Select Case LStep
  330. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.rotx = 10
  331. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.rotx = 0:LeftSlingShot.TimerEnabled = 0:
  332. End Select
  333. LStep = LStep + 1
  334. End Sub
  335.  
  336.  
  337. Dim Digits(3)
  338. Dim NumLED
  339. Dim QuantLED
  340.  
  341. NumLED=39
  342. QuantLED=3
  343. Digits(0)=Array(D1,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12,D13,D14,D15,D16)
  344. Digits(1)=Array(D17,D18,D19,D20,D21,D22,D23,D24,D25,D26,D27,D28,D29,D30,D31,D32)
  345. Digits(2)=Array(D33,D34,D35,D36,D37,D38,D39,D40,D41,D42,D43,D44,D45,D46,D47,D48)
  346.  
  347.  
  348. Set MotorCallback=GetRef("Display")
  349. Sub Display
  350. Dim ChgLED,II,Num,Chg,Stat,Obj
  351. ChgLED=Controller.ChangedLEDs(&Hffffffff,&Hffffffff)
  352. If Not IsEmpty(ChgLED) Then
  353. For II=0 To UBound(chgLED)
  354. Num=ChgLED(II,0)
  355. Chg=ChgLED(II,1)
  356. Stat=ChgLED(II,2)
  357. If (Num>NumLED) and (Num<=NumLED+QuantLED) then
  358. For Each Obj In Digits(Num-NumLED-1)
  359. If Chg And 1 Then
  360. Obj.State=Stat And 1
  361. End If
  362. Chg=int(Chg/2)
  363. Stat=int(Stat/2)
  364. Next
  365. End If
  366. Next
  367. End If
  368. End Sub
  369.  
  370. '***************************************************
  371. ' JP's VP10 Fading Lamps & Flashers
  372. ' Based on PD's Fading Light System
  373. ' SetLamp 0 is Off
  374. ' SetLamp 1 is On
  375. ' fading for non opacity objects is 4 steps
  376. '***************************************************
  377.  
  378. Dim LampState(200), FadingLevel(200)
  379. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  380.  
  381. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  382. LampTimer.Interval = 5 'lamp fading speed
  383. LampTimer.Enabled = 1
  384.  
  385. ' Lamp & Flasher Timers
  386.  
  387. Sub LampTimer_Timer()
  388. Dim chgLamp, num, chg, ii
  389. chgLamp = Controller.ChangedLamps
  390. If Not IsEmpty(chgLamp) Then
  391. For ii = 0 To UBound(chgLamp)
  392. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  393. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  394. Next
  395. End If
  396. UpdateLamps
  397. End Sub
  398.  
  399. Sub UpdateLamps()
  400.  
  401. NFadeL 0, Light0
  402. NFadeL 1, Light1
  403. NFadeL 2, Light2
  404. NFadeL 3, Light3
  405. NFadeL 4, Light4
  406. NFadeL 5, Light5
  407. NFadeL 6, Light6
  408. NFadeL 7, Light7
  409.  
  410. NFadeL 11, Light11
  411. NFadeL 12, Light12
  412. NFadeL 13, Light13
  413. NFadeL 14, Light14
  414. NFadeL 15, Light15
  415. NFadeL 16, Light16
  416. NFadeL 17, Light17
  417.  
  418. NFadeL 20, Light20
  419. NFadeL 21, Light21
  420. NFadeL 22, Light22
  421. NFadeL 23, Light23
  422. NFadeL 24, Light24
  423. NFadeL 25, Light25
  424. NFadeL 26, Light26
  425. NFadeL 27, Light27
  426.  
  427. NFadeL 30, Light30
  428. NFadeL 31, Light31
  429. NFadeL 33, Light33
  430. NFadeL 34, Light34
  431. NFadeL 35, Light35
  432. NFadeL 36, Light36
  433. NFadeL 37, Light37
  434.  
  435. NFadeL 40, Light40
  436. NFadeL 41, Light41
  437. NFadeL 42, Light42
  438. NFadeL 43, Light43
  439. NFadeL 44, Light44
  440. NFadeL 45, Light45
  441. NFadeL 46, Light46
  442. NFadeL 47, Light47
  443.  
  444. NFadeL 50, Light50
  445. NFadeL 51, Light51
  446. NFadeL 52, Light52
  447. NFadeL 53, Light53
  448. NFadeL 54, Light54
  449. NFadeL 55, Light55
  450. NFadeL 56, Light56
  451. NFadeL 57, Light57
  452.  
  453. NFadeL 60, Light60
  454. NFadeL 61, Light61
  455. NFadeL 62, Light62
  456. NFadeL 63, Light63
  457. NFadeL 64, Light64
  458. NFadeL 65, Light65
  459. NFadeL 66, Light66
  460. NFadeL 67, Light67
  461.  
  462. NFadeLm 70, Light70
  463. NFadeL 70, Light70a
  464. NFadeLm 71, Light71
  465. NFadeL 71, Light71a
  466. NFadeLm 72, Light72
  467. NFadeL 72, Light72a
  468. NFadeLm 73, Light73
  469. NFadeL 73, Light73a
  470. NFadeLm 74, Light74
  471. NFadeL 74, Light74a
  472. NFadeL 75, Light75
  473. NFadeL 76, Light76
  474. NFadeL 77, Light77
  475.  
  476. NFadeL 80, Light80
  477. ' NFadeL 81, Light81 'Right Outside Rollover
  478.  
  479. NFadeLm 82, Light82 'Bumper 1
  480. NFadeL 82, Light82a 'Bumper 1
  481. NFadeLm 83, Light83 'Bumper 2
  482. NFadeL 83, Light83a 'Bumper 2
  483. NFadeLm 84, Light84 'Bumper 3
  484. NFadeL 84, Light84a 'Bumper 3
  485.  
  486. NFadeL 90, Light90 ' #1 Lucky 7 Backglass & Apron
  487. NFadeL 91, Light91 ' #2 Lucky 7 Backglass & Apron
  488. NFadeL 92, Light92 ' #3 Lucky 7 Backglass & Apron
  489. NFadeL 93, Light93 ' #4 Lucky 7 Backglass & Apron
  490. NFadeL 94, Light94 ' #5 Lucky 7 Backglass & Apron
  491. NFadeL 95, Light95 ' #6 Lucky 7 Backglass & Apron
  492. NFadeL 96, Light96 ' #7 Lucky 7 Backglass & Apron
  493.  
  494. NFadeL 100, L100 '#1 Star Backglass & Apron LA0
  495. NFadeL 101, L101 '#2 Star Backglass & Apron LA1
  496. NFadeL 102, L102 '#3 Star Backglass & Apron LA2
  497. 'NfadeL 103, L103 'LA3
  498. 'NFadeL 104, L104 'LA4
  499. NFadeL 105, L105 ' Catch Up Apron Backglass & Apron LA5
  500.  
  501. NfadeL 110, LB0 'LB0
  502. NfadeL 111, LB1 'LB1
  503. NfadeL 112, LB2 'LB2
  504. NfadeL 113, LB3 'LB3
  505. NfadeL 114, LB4 'LB4
  506. NfadeL 115, LB5 'LB5
  507. NfadeL 116, LB6 'LB6
  508. NfadeL 117, LB7 'LB7
  509.  
  510. 'Solenid Controlled Lamps
  511.  
  512.  
  513. NFadeL 142, L142
  514. NFadeL 143, L143
  515. NFadeL 144, L144
  516. NFadeL 145, L145
  517. NFadeL 146, L146
  518.  
  519.  
  520.  
  521.  
  522.  
  523. End Sub
  524.  
  525. ' div lamp subs
  526.  
  527. Sub InitLamps()
  528. Dim x
  529. For x = 0 to 200
  530. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  531. FadingLevel(x) = 4 ' used to track the fading state
  532. FlashSpeedUp(x) = 0.4 ' faster speed when turning on the flasher
  533. FlashSpeedDown(x) = 0.2 ' slower speed when turning off the flasher
  534. FlashMax(x) = 1 ' the maximum value when on, usually 1
  535. FlashMin(x) = 0 ' the minimum value when off, usually 0
  536. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  537. Next
  538. End Sub
  539.  
  540. Sub AllLampsOff
  541. Dim x
  542. For x = 0 to 200
  543. SetLamp x, 0
  544. Next
  545. End Sub
  546.  
  547. Sub SetLamp(nr, value)
  548. If value <> LampState(nr) Then
  549. LampState(nr) = abs(value)
  550. FadingLevel(nr) = abs(value) + 4
  551. End If
  552. End Sub
  553.  
  554. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  555.  
  556. Sub NFadeL(nr, object)
  557. Select Case FadingLevel(nr)
  558. Case 4:object.state = 0:FadingLevel(nr) = 0
  559. Case 5:object.state = 1:FadingLevel(nr) = 1
  560. End Select
  561. End Sub
  562.  
  563. Sub NFadeLm(nr, object) ' used for multiple lights
  564. Select Case FadingLevel(nr)
  565. Case 4:object.state = 0
  566. Case 5:object.state = 1
  567. End Select
  568. End Sub
  569.  
  570. 'Lights, Ramps & Primitives used as 4 step fading lights
  571. 'a,b,c,d are the images used from on to off
  572.  
  573. Sub FadeObj(nr, object, a, b, c, d)
  574. Select Case FadingLevel(nr)
  575. Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
  576. Case 5:object.image = a:FadingLevel(nr) = 1 'ON
  577. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  578. Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  579. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  580. Case 13:object.image = d:FadingLevel(nr) = 0 'Off
  581. End Select
  582. End Sub
  583.  
  584. Sub FadeObjm(nr, object, a, b, c, d)
  585. Select Case FadingLevel(nr)
  586. Case 4:object.image = b
  587. Case 5:object.image = a
  588. Case 9:object.image = c
  589. Case 13:object.image = d
  590. End Select
  591. End Sub
  592.  
  593. Sub NFadeObj(nr, object, a, b)
  594. Select Case FadingLevel(nr)
  595. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  596. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  597. End Select
  598. End Sub
  599.  
  600. Sub NFadeObjm(nr, object, a, b)
  601. Select Case FadingLevel(nr)
  602. Case 4:object.image = b
  603. Case 5:object.image = a
  604. End Select
  605. End Sub
  606.  
  607. ' Flasher objects
  608.  
  609. Sub Flash(nr, object)
  610. Select Case FadingLevel(nr)
  611. Case 4 'off
  612. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  613. If FlashLevel(nr) < FlashMin(nr) Then
  614. FlashLevel(nr) = FlashMin(nr)
  615. FadingLevel(nr) = 0 'completely off
  616. End if
  617. Object.IntensityScale = FlashLevel(nr)
  618. Case 5 ' on
  619. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  620. If FlashLevel(nr) > FlashMax(nr) Then
  621. FlashLevel(nr) = FlashMax(nr)
  622. FadingLevel(nr) = 1 'completely on
  623. End if
  624. Object.IntensityScale = FlashLevel(nr)
  625. End Select
  626. End Sub
  627.  
  628. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  629. Object.IntensityScale = FlashLevel(nr)
  630. End Sub
  631.  
  632. ' *********************************************************************
  633. 'Fluppers Domes V2
  634. ' *********************************************************************
  635.  
  636. Sub FlashRed2(flstate) 'Red Domes
  637. If Flstate Then
  638. Objlevel(2) = 1 : FlasherFlash2_Timer
  639. Objlevel(4) = 1 : FlasherFlash4_Timer
  640. End If
  641. End Sub
  642.  
  643.  
  644. Sub FlashRed6(flstate) 'Red Domes
  645. If Flstate Then
  646. Objlevel(6) = 1 : FlasherFlash6_Timer
  647. End If
  648. End Sub
  649.  
  650.  
  651. Sub FlashRed8(flstate) 'Red Domes
  652. If Flstate Then
  653. Objlevel(8) = 1 : FlasherFlash8_Timer
  654. End If
  655. End Sub
  656.  
  657.  
  658. Dim TestFlashers, TableRef, FlasherLightIntensity, FlasherFlareIntensity, FlasherOffBrightness
  659.  
  660. ' *********************************************************************
  661. TestFlashers = 0 ' *** set this to 1 to check position of flasher object ***
  662. Set TableRef = Table1 ' *** change this, if your table has another name ***
  663. FlasherLightIntensity = 1 ' *** lower this, if the VPX lights are too bright (i.e. 0.1) ***
  664. FlasherFlareIntensity = 1 ' *** lower this, if the flares are too bright (i.e. 0.1) ***
  665. FlasherOffBrightness = 0.5 ' *** brightness of the flasher dome when switched off (range 0-2) ***
  666. ' *********************************************************************
  667.  
  668.  
  669. Dim ObjLevel(20), objbase(20), objlit(20), objflasher(20), objlight(20)
  670. Dim tablewidth, tableheight : tablewidth = TableRef.width : tableheight = TableRef.height
  671. 'initialise the flasher color, you can only choose from "green", "red", "purple", "blue", "white" and "yellow"
  672. InitFlasher 2, "red"
  673. InitFlasher 4, "red"
  674. InitFlasher 6, "red"
  675. InitFlasher 8, "red"
  676. 'InitFlasher 9, "white"
  677. 'InitFlasher 10, "red"
  678. 'InitFlasher 11, "red"
  679. 'InitFlasher 13, "red"
  680. 'InitFlasher 16, "yellow"
  681. 'InitFlasher 17, "yellow"
  682. 'InitFlasher 18, "yellow"
  683.  
  684. ' rotate the flasher with the command below (first argument = flasher nr, second argument = angle in degrees)
  685. 'RotateFlasher 11,90
  686.  
  687. Sub InitFlasher(nr, col)
  688. ' store all objects in an array for use in FlashFlasher subroutine
  689. Set objbase(nr) = Eval("Flasherbase" & nr) : Set objlit(nr) = Eval("Flasherlit" & nr)
  690. Set objflasher(nr) = Eval("Flasherflash" & nr) : Set objlight(nr) = Eval("Flasherlight" & nr)
  691. ' If the flasher is parallel to the playfield, rotate the VPX flasher object for POV and place it at the correct height
  692. If objbase(nr).RotY = 0 Then
  693. objbase(nr).ObjRotZ = atn( (tablewidth/2 - objbase(nr).x) / (objbase(nr).y - tableheight*1.1)) * 180 / 3.14159
  694. objflasher(nr).RotZ = objbase(nr).ObjRotZ : objflasher(nr).height = objbase(nr).z + 60
  695. End If
  696. ' set all effects to invisible and move the lit primitive at the same position and rotation as the base primitive
  697. objlight(nr).IntensityScale = 0 : objlit(nr).visible = 0 : objlit(nr).material = "Flashermaterial" & nr
  698. objlit(nr).RotX = objbase(nr).RotX : objlit(nr).RotY = objbase(nr).RotY : objlit(nr).RotZ = objbase(nr).RotZ
  699. objlit(nr).ObjRotX = objbase(nr).ObjRotX : objlit(nr).ObjRotY = objbase(nr).ObjRotY : objlit(nr).ObjRotZ = objbase(nr).ObjRotZ
  700. objlit(nr).x = objbase(nr).x : objlit(nr).y = objbase(nr).y : objlit(nr).z = objbase(nr).z
  701. objbase(nr).BlendDisableLighting = FlasherOffBrightness
  702. ' set the texture and color of all objects
  703. select case objbase(nr).image
  704. Case "dome2basewhite" : objbase(nr).image = "dome2base" & col : objlit(nr).image = "dome2lit" & col :
  705. Case "ronddomebasewhite" : objbase(nr).image = "ronddomebase" & col : objlit(nr).image = "ronddomelit" & col
  706. Case "domeearbasewhite" : objbase(nr).image = "domeearbase" & col : objlit(nr).image = "domeearlit" & col
  707. end select
  708. If TestFlashers = 0 Then objflasher(nr).imageA = "domeflashwhite" : objflasher(nr).visible = 0 : End If
  709. select case col
  710. Case "blue" : objlight(nr).color = RGB(4,120,255) : objflasher(nr).color = RGB(200,255,255) : objlight(nr).intensity = 5000
  711. Case "green" : objlight(nr).color = RGB(12,255,4) : objflasher(nr).color = RGB(12,255,4)
  712. Case "red" : objlight(nr).color = RGB(255,32,4) : objflasher(nr).color = RGB(255,32,4)
  713. Case "purple" : objlight(nr).color = RGB(230,49,255) : objflasher(nr).color = RGB(255,64,255)
  714. Case "yellow" : objlight(nr).color = RGB(200,173,25) : objflasher(nr).color = RGB(255,200,50)
  715. Case "white" : objlight(nr).color = RGB(255,240,150) : objflasher(nr).color = RGB(100,86,59)
  716. end select
  717. objlight(nr).colorfull = objlight(nr).color
  718. If TableRef.ShowDT and ObjFlasher(nr).RotX = -45 Then
  719. objflasher(nr).height = objflasher(nr).height - 20 * ObjFlasher(nr).y / tableheight
  720. ObjFlasher(nr).y = ObjFlasher(nr).y + 10
  721. End If
  722. End Sub
  723.  
  724. Sub RotateFlasher(nr, angle) : angle = ((angle + 360 - objbase(nr).ObjRotZ) mod 180)/30 : objbase(nr).showframe(angle) : objlit(nr).showframe(angle) : End Sub
  725.  
  726. Sub FlashFlasher(nr)
  727. If not objflasher(nr).TimerEnabled Then objflasher(nr).TimerEnabled = True : objflasher(nr).visible = 1 : objlit(nr).visible = 1 : End If
  728. objflasher(nr).opacity = 1000 * FlasherFlareIntensity * ObjLevel(nr)^2.5
  729. objlight(nr).IntensityScale = 0.5 * FlasherLightIntensity * ObjLevel(nr)^3
  730. objbase(nr).BlendDisableLighting = FlasherOffBrightness + 10 * ObjLevel(nr)^3
  731. objlit(nr).BlendDisableLighting = 10 * ObjLevel(nr)^2
  732. UpdateMaterial "Flashermaterial" & nr,0,0,0,0,0,0,ObjLevel(nr),RGB(255,255,255),0,0,False,True,0,0,0,0
  733. ObjLevel(nr) = ObjLevel(nr) * 0.9 - 0.01
  734. If ObjLevel(nr) < 0 Then objflasher(nr).TimerEnabled = False : objflasher(nr).visible = 0 : objlit(nr).visible = 0 : End If
  735. End Sub
  736.  
  737. Sub FlasherFlash2_Timer() : FlashFlasher(2) : End Sub
  738. Sub FlasherFlash4_Timer() : FlashFlasher(4) : End Sub
  739. Sub FlasherFlash6_Timer() : FlashFlasher(6) : End Sub
  740. Sub FlasherFlash8_Timer() : FlashFlasher(8) : End Sub
  741. 'Sub FlasherFlash9_Timer() : FlashFlasher(9) : End Sub
  742. 'Sub FlasherFlash10_Timer() : FlashFlasher(10) : End Sub
  743. 'Sub FlasherFlash11_Timer() : FlashFlasher(11) : End Sub
  744. 'Sub FlasherFlash13_Timer() : FlashFlasher(13) : End Sub
  745. 'Sub FlasherFlash16_Timer() : FlashFlasher(16) : End Sub
  746. 'Sub FlasherFlash17_Timer() : FlashFlasher(17) : End Sub
  747. 'Sub FlasherFlash18_Timer() : FlashFlasher(18) : End Sub
  748.  
  749.  
  750.  
  751. '*************
  752. ' JP'S LUT
  753. '*************
  754.  
  755. Dim bLutActive, LUTImage
  756. Sub LoadLUT
  757. Dim x
  758. x = LoadValue(cGameName, "LUTImage")
  759. If(x <> "") Then LUTImage = x Else LUTImage = 0
  760. UpdateLUT
  761. End Sub
  762.  
  763. Sub SaveLUT
  764. SaveValue cGameName, "LUTImage", LUTImage
  765. End Sub
  766.  
  767. Sub NextLUT: LUTImage = (LUTImage +1 ) MOD 10: UpdateLUT: SaveLUT: End Sub
  768.  
  769. Sub UpdateLUT
  770. Select Case LutImage
  771. Case 0: table1.ColorGradeImage = "LUT0"
  772. Case 1: table1.ColorGradeImage = "LUT1"
  773. Case 2: table1.ColorGradeImage = "LUT2"
  774. Case 3: table1.ColorGradeImage = "LUT3"
  775. Case 4: table1.ColorGradeImage = "LUT4"
  776. Case 5: table1.ColorGradeImage = "LUT5"
  777. Case 6: table1.ColorGradeImage = "LUT6"
  778. Case 7: table1.ColorGradeImage = "LUT7"
  779. Case 8: table1.ColorGradeImage = "LUT8"
  780. Case 9: table1.ColorGradeImage = "LUT9"
  781.  
  782. End Select
  783. End Sub
  784.  
  785.  
  786. '*********************************************************************
  787. ' Positional Sound Playback Functions
  788. '*********************************************************************
  789.  
  790. ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
  791. ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
  792. ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
  793. Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
  794. PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
  795. End Sub
  796.  
  797. ' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
  798. Sub PlaySoundAt(soundname, tableobj)
  799. PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  800. End Sub
  801.  
  802. Sub PlaySoundAtBall(soundname)
  803. PlaySoundAt soundname, ActiveBall
  804. End Sub
  805.  
  806.  
  807. '*********************************************************************
  808. ' Supporting Ball & Sound Functions
  809. '*********************************************************************
  810.  
  811. 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
  812. Dim tmp
  813. tmp = tableobj.y * 2 / table1.height-1
  814. If tmp > 0 Then
  815. AudioFade = Csng(tmp ^10)
  816. Else
  817. AudioFade = Csng(-((- tmp) ^10) )
  818. End If
  819. End Function
  820.  
  821. Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
  822. Dim tmp
  823. tmp = tableobj.x * 2 / table1.width-1
  824. If tmp > 0 Then
  825. AudioPan = Csng(tmp ^10)
  826. Else
  827. AudioPan = Csng(-((- tmp) ^10) )
  828. End If
  829. End Function
  830.  
  831. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  832. Vol = Csng(BallVel(ball) ^2 / 2000)
  833. End Function
  834.  
  835. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  836. Pitch = BallVel(ball) * 20
  837. End Function
  838.  
  839. Function BallVel(ball) 'Calculates the ball speed
  840. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  841. End Function
  842.  
  843.  
  844. '********************************************************************
  845. ' JP's VP10 Rolling Sounds (+rothbauerw's Dropping Sounds)
  846. '********************************************************************
  847.  
  848. Const tnob = 5 ' total number of balls
  849. ReDim rolling(tnob)
  850. InitRolling
  851.  
  852. Sub InitRolling
  853. Dim i
  854. For i = 0 to tnob
  855. rolling(i) = False
  856. Next
  857. End Sub
  858.  
  859. Sub RollingTimer_Timer()
  860. Dim BOT, b
  861. BOT = GetBalls
  862.  
  863. ' stop the sound of deleted balls
  864. For b = UBound(BOT) + 1 to tnob
  865. rolling(b) = False
  866. StopSound("fx_ballrolling" & b)
  867. Next
  868.  
  869. ' exit the sub if no balls on the table
  870. If UBound(BOT) = -1 Then Exit Sub
  871.  
  872. For b = 0 to UBound(BOT)
  873. ' play the rolling sound for each ball
  874. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  875. rolling(b) = True
  876. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b)), AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  877. Else
  878. If rolling(b) = True Then
  879. StopSound("fx_ballrolling" & b)
  880. rolling(b) = False
  881. End If
  882. End If
  883.  
  884. ' play ball drop sounds
  885. If BOT(b).VelZ < -1 and BOT(b).z < 55 and BOT(b).z > 27 Then 'height adjust for ball drop sounds
  886. PlaySound "fx_ball_drop" & b, 0, ABS(BOT(b).velz)/17, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  887. End If
  888. Next
  889. End Sub
  890.  
  891. '**********************
  892. ' Ball Collision Sound
  893. '**********************
  894.  
  895. Sub OnBallBallCollision(ball1, ball2, velocity)
  896. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  897. End Sub
  898.  
  899.  
  900. '*****************************************
  901. ' ninuzzu's FLIPPER SHADOWS
  902. '*****************************************
  903.  
  904. sub FlipperTimer_Timer()
  905. FlipperLSh.RotZ = LeftFlipper.currentangle
  906. FlipperRSh.RotZ = RightFlipper.currentangle
  907.  
  908. Prim_LeftFlipper.RotY=LeftFlipper.currentangle-90
  909. Prim_RightFlipper.RotY=RightFlipper.currentangle-90
  910.  
  911. End Sub
  912.  
  913.  
  914. '*****************************************
  915. ' ninuzzu's BALL SHADOW
  916. '*****************************************
  917. Dim BallShadow
  918. BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
  919.  
  920. Sub BallShadowUpdate_timer()
  921. Dim BOT, b
  922. BOT = GetBalls
  923. ' hide shadow of deleted balls
  924. If UBound(BOT)<(tnob-1) Then
  925. For b = (UBound(BOT) + 1) to (tnob-1)
  926. BallShadow(b).visible = 0
  927. Next
  928. End If
  929. ' exit the Sub if no balls on the table
  930. If UBound(BOT) = -1 Then Exit Sub
  931. ' render the shadow for each ball
  932. For b = 0 to UBound(BOT)
  933. If BOT(b).X < Table1.Width/2 Then
  934. BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) + 6
  935. Else
  936. BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) - 6
  937. End If
  938. ballShadow(b).Y = BOT(b).Y + 12
  939. If BOT(b).Z > 20 Then
  940. BallShadow(b).visible = 1
  941. Else
  942. BallShadow(b).visible = 0
  943. End If
  944. Next
  945. End Sub
  946.  
  947.  
  948.  
  949. '************************************
  950. ' What you need to add to your table
  951. '************************************
  952.  
  953. ' a timer called RollingTimer. With a fast interval, like 10
  954. ' one collision sound, in this script is called fx_collide
  955. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  956. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  957.  
  958.  
  959. '******************************************
  960. ' Explanation of the rolling sound routine
  961. '******************************************
  962.  
  963. ' sounds are played based on the ball speed and position
  964.  
  965. ' the routine checks first for deleted balls and stops the rolling sound.
  966.  
  967. ' The For loop goes through all the balls on the table and checks for the ball speed and
  968. ' if the ball is on the table (height lower than 30) then then it plays the sound
  969. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  970.  
  971. ' The sound is played using the VOL, AUDIOPAN, AUDIOFADE and PITCH functions, so the volume and pitch of the sound
  972. ' will change according to the ball speed, and the AUDIOPAN & AUDIOFADE functions will change the stereo position
  973. ' according to the position of the ball on the table.
  974.  
  975.  
  976. '**************************************
  977. ' Explanation of the collision routine
  978. '**************************************
  979.  
  980. ' The collision is built in VP.
  981. ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
  982. ' 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
  983. ' depending of the speed of the collision.
  984.  
  985.  
  986. Sub Pins_Hit (idx)
  987. PlaySound "pinhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  988. End Sub
  989.  
  990. Sub Targets_Hit (idx)
  991. PlaySound "target", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  992. End Sub
  993.  
  994. Sub Metals_Thin_Hit (idx)
  995. PlaySound "metalhit_thin", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  996. End Sub
  997.  
  998. Sub Metals_Medium_Hit (idx)
  999. PlaySound "metalhit_medium", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1000. End Sub
  1001.  
  1002. Sub Metals2_Hit (idx)
  1003. PlaySound "metalhit2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1004. End Sub
  1005.  
  1006. Sub Gates_Hit (idx)
  1007. PlaySound "gate4", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1008. End Sub
  1009.  
  1010. Sub Spinner_Spin
  1011. PlaySound "fx_spinner", 0, .25, AudioPan(Spinner), 0.25, 0, 0, 1, AudioFade(Spinner)
  1012. End Sub
  1013.  
  1014. Sub Rubbers_Hit(idx)
  1015. dim finalspeed
  1016. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1017. If finalspeed > 20 then
  1018. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1019. End if
  1020. If finalspeed >= 6 AND finalspeed <= 20 then
  1021. RandomSoundRubber()
  1022. End If
  1023. End Sub
  1024.  
  1025. Sub Posts_Hit(idx)
  1026. dim finalspeed
  1027. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1028. If finalspeed > 16 then
  1029. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1030. End if
  1031. If finalspeed >= 6 AND finalspeed <= 16 then
  1032. RandomSoundRubber()
  1033. End If
  1034. End Sub
  1035.  
  1036. Sub RandomSoundRubber()
  1037. Select Case Int(Rnd*3)+1
  1038. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1039. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1040. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1041. End Select
  1042. End Sub
  1043.  
  1044. Sub LeftFlipper_Collide(parm)
  1045. RandomSoundFlipper()
  1046. End Sub
  1047.  
  1048. Sub RightFlipper_Collide(parm)
  1049. RandomSoundFlipper()
  1050. End Sub
  1051.  
  1052. Sub RandomSoundFlipper()
  1053. Select Case Int(Rnd*3)+1
  1054. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1055. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1056. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1057. End Select
  1058. End Sub
  1059.  
  1060. Sub Table1_Exit()
  1061. If B2SOn Then
  1062. Controller.Pause = False
  1063. Controller.Stop
  1064. End If
  1065. End Sub
  1066.  
Advertisement
Add Comment
Please, Sign In to add comment