Arngrim

ccc 1.2

Nov 8th, 2016
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 51.98 KB | None | 0 0
  1. ' Cactus Canyon - IPDB No. 4445
  2. ' © Bally/Midway 1998
  3. ' © Eric Priepke 2012 (P-ROC Project)
  4. ' VPX recreation by ninuzzu/Tom Tower
  5.  
  6. ' Credits/Thanks
  7. ' Clark Kent for the pics
  8. ' Shoopity for scripting bart,train,mine,beer mug primitives
  9. ' Dozer for adapting the mine and train mechs to work with P-ROC and the lights code
  10. ' Flupper for retexturing the plastic ramps and the train
  11. ' Zany for the domes, flippers and bumpers
  12. ' VPDev Team for the freaking amazing VPX
  13. ' Arngrim for the DOF
  14.  
  15. ' The table is ready to play the Cactus Canyon Continued using P-ROC.
  16. ' If you don't know what it is, just look here:
  17. ' http://soldmy.org/pin/ccc/index.php?title=Main_Page
  18. ' You need to install PROC and enable the option in the script.
  19. ' Read the tutorial and download the necessary files here:
  20. ' https://mega.nz/#F!CMoxCL6I!m1-IeL8PfWakfU5dAKTrFA
  21.  
  22. Option Explicit
  23. Randomize
  24.  
  25. Dim RollingVol, FlipperType, ScoopLight, ColorMod, AttractModeRGB, BadGuysMod, PROC
  26.  
  27. '************************************************************************
  28. '* TABLE OPTIONS ********************************************************
  29. '************************************************************************
  30.  
  31. '*********** Ball Rolling Sound Volume *****************************
  32.  
  33. RollingVol = 2000 '(increase to lower the volume)
  34.  
  35. '*********** Set the Flippers Type *********************************
  36.  
  37. FlipperType = 2 '0 = white , 1 = yellow , 2 = random
  38.  
  39. '*********** Red Light under the scoop *****************************
  40.  
  41. ScoopLight = 1 '0 = no , 1 = yes
  42.  
  43. '*********** Enable RGB G.I Mod ********************************
  44.  
  45. ColorMod = 1 '0 = no , 1 = yes
  46.  
  47. '*********** Bad Guys Flashing lights *****************************
  48.  
  49. BadGuysMod = 1 '0 = no , 1 = yes
  50.  
  51. '*********** Enable Cactus Canyon Continued *************************
  52.  
  53. PROC = 0 '0 = no , 1 = yes
  54.  
  55. '*************************************************************************
  56. '* END OF TABLE OPTIONS **************************************************
  57. '*************************************************************************
  58.  
  59. Dim Ballsize,BallMass
  60. BallSize = 50
  61. BallMass = (Ballsize^3)/125000
  62.  
  63. On Error Resume Next
  64. ExecuteGlobal GetTextFile("controller.vbs")
  65. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  66. On Error Goto 0
  67.  
  68. Dim DesktopMode:DesktopMode = Table1.ShowDT
  69. Dim UseVPMDMD:UseVPMDMD = DesktopMode
  70.  
  71. Const cGameName = "cc_13"
  72. Const B2ScGameName = "Proc_CC"
  73. Const UseVPMModSol = 1
  74.  
  75. If PROC = 1 Then
  76. LoadProc "02000000", "WPC.VBS", 3.50
  77. Else
  78. LoadVPM "02000000", "WPC.VBS", 3.50
  79. End If
  80.  
  81. '********************
  82. 'Standard definitions
  83. '********************
  84.  
  85. Const UseSolenoids = 1
  86. Const UseLamps = 1
  87. Const UseSync = 0
  88. Const HandleMech = 0
  89. Const UseGI = 0
  90.  
  91. Const SSolenoidOn = "fx_solon"
  92. Const SSolenoidOff = ""
  93. Const SFlipperOn = ""
  94. Const SFlipperOff = ""
  95. Const SCoin = "fx_coin"
  96.  
  97. If PROC = 1 Then
  98. Set GiCallback = GetRef("UpdateGI")
  99. Else
  100. Set GiCallback2 = GetRef("UpdateGI2")
  101. End If
  102.  
  103. Set MotorCallback = GetRef("GameTimer")
  104.  
  105. Dim TrainMech, MineMech
  106.  
  107. '**************************************************************
  108. '************ Table Init **********************************
  109. '**************************************************************
  110.  
  111. Sub Table1_Init
  112. vpmInit Me
  113. KiHat.CreateBall.ID = 999
  114. BartOrigX = Bart.X
  115. BartOrigY = Bart.Y
  116. Mine.RotX = (MineSign.Z * 0.375) - 10
  117. On Error Resume Next
  118. With Controller
  119. .GameName = cGameName
  120. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
  121. .SplashInfoLine = "Cactus Canyon - Midway/Williams 1998"
  122. .HandleMechanics = 0
  123. .ShowDMDOnly = 1
  124. .ShowFrame = 0
  125. .ShowTitle = 0
  126. If PROC = 0 Then .Hidden = Desktopmode
  127. .Run
  128. If Err Then MsgBox Err.Description
  129. End With
  130. On Error Goto 0
  131.  
  132. '************ Main Timer init ********************
  133.  
  134. PinMAMETimer.Interval = PinMAMEInterval
  135. PinMAMETimer.Enabled = 1
  136.  
  137. '************ Nudging **************************
  138.  
  139. vpmNudge.TiltSwitch = 14
  140. vpmNudge.Sensitivity = 5
  141. vpmNudge.TiltObj = Array(Bumper1, Bumper2, sw51, sw52, sw55)
  142.  
  143. '************** Mine Mech ********************
  144.  
  145. If PROC = 0 Then
  146. Set MineMech = New cvpmMech
  147. With MineMech
  148. .Sol1 = 17
  149. .Length = 100
  150. .Steps = 49
  151. .MType = vpmMechOneSol + vpmMechReverse + vpmMechLinear
  152. .AddSw 77, 0, 1 'Home 'Shoopity - Changed the last variable from 48 to 0, it helps with moving the primitive
  153. .AddPulseSw 78, 8, 2
  154. .Start
  155. End With
  156. End If
  157.  
  158. '************** Train Mech ********************
  159.  
  160. If PROC = 0 Then
  161. Set TrainMech = New cvpmMech
  162. With TrainMech
  163. .Sol1 = 38 'Forward
  164. .Sol2 = 37 'Reverse
  165. .Length = 570
  166. .Steps = 613
  167. .MType = vpmMechTwoDirSol + vpmMechStopEnd + vpmMechLinear
  168. .AddSw 72, 0, 0 ' Home
  169. .AddPulseSw 71, 14, 3
  170. .Start
  171. End With
  172. End If
  173. ' '**************** Trough ******************
  174.  
  175. sw32.CreateSizedBallWithMass Ballsize/2, BallMass
  176. sw33.CreateSizedBallWithMass Ballsize/2, BallMass
  177. sw34.CreateSizedBallWithMass Ballsize/2, BallMass
  178. sw35.CreateSizedBallWithMass Ballsize/2, BallMass
  179.  
  180. '************ Misc Stuff init ********************
  181.  
  182. block.isdropped=1
  183. Sw61.IsDropped = 1: Sw62.IsDropped = 1 :Sw63.IsDropped = 1 :Sw64.IsDropped = 1
  184. Sw61a.IsDropped = 1: Sw62a.IsDropped = 1 :Sw63a.IsDropped = 1 :Sw64a.IsDropped = 1
  185. LPin.IsDropped = 1: RPin.IsDropped = 1
  186. Controller.Switch(22) = 1 ' Coin Door Closed
  187. Controller.Switch(24) = 1 ' Always Closed
  188. UpdateGI2 0,1: UpdateGI2 1,1: UpdateGI2 2,1
  189. HatInit.enabled = 1
  190. InitFlashers
  191.  
  192. '************ P-ROC Stuff init ********************
  193.  
  194. If PROC = 1 then
  195. Enc_Stop.enabled = 1
  196. GI_Left 1
  197. GI_Right 1
  198. GI_Top 1
  199. Card1.image = "card1_CCC"
  200. Card2.image = "card2_CCC"
  201. Guns.material = "Guns"
  202. End If
  203. End Sub
  204.  
  205. '********************************************
  206. '********** Keys ************************
  207. '********************************************
  208.  
  209. Sub Table1_KeyDown(ByVal keycode)
  210. If keycode = LeftTiltKey Then Nudge 90, 3:PlaySound SoundFX("fx_nudge", 0), 0, 1, -0.1, 0.25
  211. If keycode = RightTiltKey Then Nudge 270, 3:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0.1, 0.25
  212. If keycode = CenterTiltKey Then Nudge 0, 4:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0, 0.25
  213. If KeyCode = PlungerKey Then Plunger1.Pullback:Playsound "fx_plungerpull"
  214. If vpmKeyDown(KeyCode) Then Exit Sub
  215. End Sub
  216.  
  217. Sub Table1_KeyUp(ByVal KeyCode)
  218. If KeyCode = PlungerKey Then Plunger1.Fire : Playsound "fx_plunger"
  219. If vpmKeyUp(KeyCode) Then Exit Sub
  220. End Sub
  221.  
  222. Sub Table1_Paused:Controller.Pause = 1:End Sub
  223. Sub Table1_unPaused:Controller.Pause = 0:End Sub
  224. Sub Table1_exit()
  225. Controller.Stop
  226. If B2SOn = True and PROC = 1 Then B2SController.Stop
  227. End sub
  228.  
  229. '******************
  230. ' Solenoids
  231. '******************
  232.  
  233. SolCallback(1) = "AutoPlunger" ' Autoplunger
  234. SolCallback(2) = "Drop1" ' Left Drop Target
  235. SolCallback(3) = "Drop2" ' Left Center Drop Target
  236. SolCallback(4) = "Drop3" ' Right Center Drop Target
  237. SolCallback(5) = "Drop4" ' Right Drop Target
  238. SolCallback(6) = "SolMinePopper" ' Mine Popper
  239. SolCallback(7) = "Knocker" ' Knocker
  240. SolCallback(8) = "SolSaloonPopper" ' Saloon Popper
  241. SolCallback(9) = "ReleaseBall" ' Ball Release
  242. 'SolCallback(10) = "SolSlingL" ' Left Slingshot
  243. 'SolCallback(11) = "SolSlingR" ' Right Slingshot
  244. 'SolCallback(12) = "SolBumperL" ' Left Jet Bumper
  245. 'SolCallback(13) = "SolBumperR" ' Right Jet Bumper
  246. SolCallback(14) = "GunPostLeft" ' Left Gunfight Post
  247. SolCallback(15) = "GunPostRight" ' Right Gunfight Post
  248. 'SolCallback(16) = "SolBumperB" ' Bottom Jet Bumper
  249. SolCallback(21) = "LGate" ' Left Loop Gate
  250. SolCallback(22) = "RGate" ' Right Loop Gate
  251.  
  252. SolCallback(sLRFlipper) = "SolRFlipper" ' Left Flipper
  253. SolCallback(sLLFlipper) = "SolLFlipper" ' Right Flipper
  254. SolCallback(33) = "MoveBart" ' Move Bart Toy
  255. SolCallback(36) = "MoveHat" ' Bart Toy Hat
  256.  
  257. If PROC = 1 then
  258. SolCallBack(17) = "MoveMine_PROC" ' Mine Motor-PROC
  259. SolCallback(18) = "Sol18" ' Mine Flasher-PROC
  260. SolCallBack(19) = "Sol19" ' Front Left Flasher-PROC
  261. SolCallBack(20) = "Sol20" ' Front Right Flasher-PROC
  262. SolCallback(24) = "Sol24" ' Beacon Flasher-PROC
  263. SolCallBack(25) = "Sol25" ' Middle Right Flasher-PROC
  264. SolCallBack(26) = "Sol26" ' Saloon Flasher-PROC
  265. SolCallback(27) = "Sol27" ' Back Right Flasher-PROC
  266. SolCallback(28) = "Sol28" ' Back Left Flasher-PROC
  267. SolCallback(37) = "TrainB_PROC" ' Train Reverse-PROC
  268. SolCallback(38) = "TrainF_PROC" ' Train forward-PROC
  269. Else
  270. SolCallBack(17) = "MoveMine" ' Mine Motor-VPM
  271. SolModCallback(18) = "Sol18Mod" ' Mine Flasher-VPM
  272. SolModCallBack(19) = "Sol19Mod" ' Front Left Flasher-VPM
  273. SolModCallBack(20) = "Sol20Mod" ' Front Right Flasher-VPM
  274. SolModCallback(24) = "Sol24Mod" ' Beacon Flasher-VPM
  275. SolModCallBack(25) = "Sol25Mod" ' Middle Right Flasher-VPM
  276. SolModCallBack(26) = "Sol26Mod" ' Saloon Flasher-VPM
  277. SolModCallback(27) = "Sol27Mod" ' Back Right Flasher-VPM
  278. SolModCallback(28) = "Sol28Mod" ' Back Left Flasher-VPM
  279. SolCallback(37) = "TrainB" ' Train Reverse-VPM
  280. SolCallback(38) = "TrainF" ' Train forward-VPM
  281. End If
  282.  
  283. '**************************************************
  284. '*************** Autoplunger *********************
  285. '**************************************************
  286.  
  287. Dim plungerIM
  288. Const IMPowerSetting = 65
  289. Const IMTime = 0.25
  290. Set plungerIM = New cvpmImpulseP
  291. With plungerIM
  292. .InitImpulseP swPlunger, IMPowerSetting, IMTime
  293. .InitExitSnd SoundFX("fx_Autoplunger",DOFContactors), SoundFX("fx_solon",DOFContactors)
  294. .CreateEvents "plungerIM"
  295. End With
  296.  
  297. Sub AutoPlunger(Enabled)
  298. If Enabled Then
  299. PlungerIM.AutoFire
  300. DOFALT 120, DOFPulse
  301. End If
  302. End Sub
  303.  
  304. '**************************************************
  305. '*************** Targets Bad Guys ***********
  306. '**************************************************
  307.  
  308. Dim sw61Dir, sw62Dir, sw63Dir, sw64Dir
  309. ' Left Drop Target
  310. Sub Drop1(enabled)
  311. If enabled Then
  312. DOFALT 125, DOFPulse
  313. Sw61.IsDropped = 0 : Sw61a.IsDropped = 0 : Controller.Switch(61) = 0 : PlaySound SoundFX("fx_DropTargetUp",DOFDropTargets): sw61Dir = 1: sw61.TimerEnabled = 1 : light42.state=2 : light43.state = 2
  314. Else
  315. DOFALT 125, DOFPulse
  316. Sw61.IsDropped = 1 : Sw61a.IsDropped = 1 : Controller.Switch(61) = 1 : PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets): sw61Dir = -1: sw61.TimerEnabled = 1: light42.state=0 : light43.state = 0
  317. End If
  318. End Sub
  319. ' Left Center Drop Target
  320. Sub Drop2(enabled)
  321. If enabled Then
  322. DOFALT 126, DOFPulse
  323. Sw62.IsDropped = 0 : Sw62a.IsDropped = 0 : Controller.Switch(62) = 0 : PlaySound SoundFX("fx_DropTargetUp",DOFDropTargets): sw62Dir = 1: sw62.TimerEnabled = 1: light25.state=2 : light26.state = 2
  324. Else
  325. DOFALT 126, DOFPulse
  326. Sw62.IsDropped = 1 : Sw62a.IsDropped = 1 : Controller.Switch(62) = 1 : PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets): sw62Dir = -1: sw62.TimerEnabled = 1: light25.state=0 : light26.state = 0
  327. End If
  328. End Sub
  329. ' Right Center Drop Target
  330. Sub Drop3(enabled)
  331. If enabled Then
  332. DOFALT 127, DOFPulse
  333. Sw63.IsDropped = 0 : Sw63a.IsDropped = 0 : Controller.Switch(63) = 0 : PlaySound SoundFX("fx_DropTargetUp",DOFDropTargets): sw63Dir = 1: sw63.TimerEnabled = 1: light44.state=2 : light45.state = 2
  334. Else
  335. DOFALT 127, DOFPulse
  336. Sw63.IsDropped = 1 : Sw63a.IsDropped = 1 : Controller.Switch(63) = 1 : PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets): sw63Dir = -1: sw63.TimerEnabled = 1: light44.state=0 : light45.state = 0
  337. End If
  338. End Sub
  339. ' Right Drop Target
  340. Sub Drop4(enabled)
  341. If enabled Then
  342. DOFALT 128, DOFPulse
  343. Sw64.IsDropped = 0 : Sw64a.IsDropped = 0 : Controller.Switch(64) = 0 : PlaySound SoundFX("fx_DropTargetUp",DOFDropTargets): sw64Dir = 1: sw64.TimerEnabled = 1: light50.state=2 : light51.state = 2
  344. Else
  345. DOFALT 128, DOFPulse
  346. Sw64.IsDropped = 1 : Sw64a.IsDropped = 1 : Controller.Switch(64) = 1 : PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets): sw64Dir = -1: sw64.TimerEnabled = 1: light50.state=0 : light51.state = 0
  347. End If
  348. End Sub
  349.  
  350. Sub sw61_timer()
  351. sw61p.Z = sw61p.Z + (2 * sw61Dir)
  352. If sw61p.Z <= -39 Then Me.TimerEnabled = 0 : sw61p.Z = -39
  353. If sw61p.Z >= 39 Then Me.TimerEnabled = 0 : sw61p.Z = 39
  354. End Sub
  355.  
  356. Sub sw62_timer()
  357. sw62p.Z = sw62p.Z + (2 * sw62Dir)
  358. If sw62p.Z <= -39 Then Me.TimerEnabled = 0 : sw62p.Z = -39
  359. If sw62p.Z >= 39 Then Me.TimerEnabled = 0 : sw62p.Z = 39
  360. End Sub
  361.  
  362. Sub sw63_timer()
  363. sw63p.Z = sw63p.Z + (2 * sw63Dir)
  364. If sw63p.Z <= -39 Then Me.TimerEnabled = 0 : sw63p.Z = -39
  365. If sw63p.Z >= 39 Then Me.TimerEnabled = 0 : sw63p.Z = 39
  366. End Sub
  367.  
  368. Sub sw64_timer()
  369. sw64p.Z = sw64p.Z + (2 * sw64Dir)
  370. If sw64p.Z <= -39 Then Me.TimerEnabled = 0 : sw64p.Z = -39
  371. If sw64p.Z >= 39 Then Me.TimerEnabled = 0 : sw64p.Z = 39
  372. End Sub
  373.  
  374. '**************************************************
  375. '*************** Mine Popper ******************
  376. '**************************************************
  377.  
  378. Sub SolMinePopper(enabled)
  379. If enabled Then
  380. DOFALT 132, DOFPulse
  381. MinePopper.kick 0, 45, 1.56
  382. If BIK = 0 Then
  383. Playsound SoundFX(SSolenoidOn,DOFContactors)
  384. Else
  385. Playsound SoundFX("fx_mine_popper",DOFContactors)
  386. End If
  387. End If
  388. End Sub
  389.  
  390. '**************************************************
  391. '*************** Knocker ******************
  392. '**************************************************
  393.  
  394. Sub Knocker(enabled)
  395. If enabled Then
  396. PlaySound SoundFX("fx_knocker",DOFKnocker)
  397. DOFALT 151,DOFPulse
  398. End If
  399. End Sub
  400.  
  401. '************************************************
  402. '*************** Saloon Popper ****************
  403. '************************************************
  404.  
  405. Sub SolSaloonPopper(enabled)
  406. If enabled Then
  407. DOFALT 133, DOFPulse
  408. BartPopper.kick 0, 45, 1.56
  409. SecretEntrance.enabled = 0
  410. vpmtimer.addtimer 1000 ,"SecretEntrance.enabled = 1'"
  411. If BIK = 0 Then
  412. Playsound SoundFX(SSolenoidOn,DOFContactors)
  413. Else
  414. Playsound SoundFX("fx_saloon_popper",DOFContactors)
  415. End If
  416. End If
  417. End Sub
  418.  
  419. '******************************************************************
  420. '******* Trough based on nFozzy's ***************************
  421. '******************************************************************
  422.  
  423. 'Load The Trough on Game Launch (order 35, 34, 33, 32)
  424.  
  425. Sub BootTrough_Timer()
  426. If PROC = 0 then
  427. Controller.Switch(35) = 1
  428. Else
  429. Controller.Switch(35) = 0
  430. End If
  431. Controller.Switch(34) = 1
  432. Controller.Switch(33) = 1
  433. Controller.Switch(32) = 1
  434. Me.Enabled = 0
  435. UpdateTrough
  436. End Sub
  437.  
  438. Sub sw35_Hit():UpdateTrough: If PROC = 0 then Controller.Switch(35) = 1: End If: End Sub
  439. Sub sw35_UnHit():Controller.Switch(35) = 0:UpdateTrough:End Sub
  440.  
  441. Sub sw34_Hit():Controller.Switch(34) = 1:End Sub
  442. Sub sw34_UnHit():Controller.Switch(34) = 0:UpdateTrough:End Sub
  443.  
  444. Sub sw33_Hit():Controller.Switch(33) = 1:End Sub
  445. Sub sw33_UnHit():Controller.Switch(33) = 0:UpdateTrough:End Sub
  446.  
  447. Sub sw32_Hit():Controller.Switch(32) = 1:End Sub
  448. Sub sw32_UnHit():Controller.Switch(32) = 0:UpdateTrough:End Sub ':PlaySound SoundFX("fx_ballrel",DOFContactors)
  449.  
  450. Sub sw31_Hit():vpmTimer.PulseSw 31 : End Sub
  451.  
  452. Sub UpdateTrough()
  453. UpdateTroughTimer.Interval = 300
  454. UpdateTroughTimer.Enabled = 1
  455. End Sub
  456.  
  457. Sub UpdateTroughTimer_Timer()
  458. If sw32.BallCntOver = 0 Then sw33.kick 58, 8
  459. If sw33.BallCntOver = 0 Then sw34.kick 58, 8
  460. If sw34.BallCntOver = 0 Then sw35.Kick 58, 8
  461. If sw35.BallCntOver = 0 Then OutHole.kick 58,8
  462. Me.Enabled = 0
  463. End Sub
  464.  
  465. '************************************************
  466. '*************** Drain and Release *************
  467. '************************************************
  468.  
  469. Dim BIP : BIP = 0
  470.  
  471. Sub OutHole_Hit()
  472. PlaySound "fx_drain"
  473. UpdateTrough
  474. BIP = BIP - 1
  475. If PROC = 1 Then Controller.Switch(35) = 1 : block.isdropped=0 : sw35.TimerEnabled = 1 : sw35.TimerInterval = 2000
  476. End Sub
  477.  
  478. Sub sw35_Timer() 'let's enable trough switch 35 for 2 seconds and add a dropping wall to prevent bugs
  479. Controller.Switch(35)=0
  480. block.isdropped=1
  481. Me.TimerEnabled = 0
  482. End Sub
  483.  
  484. Sub ReleaseBall(enabled)
  485. DOFALT 121, DOFPulse
  486. If sw35.BallCntOver = 0 Then PlaySound SoundFX(SSolenoidOn,DOFContactors)
  487. If enabled Then
  488. PlaySound SoundFX("fx_ballrel",DOFContactors)
  489. sw32.kick 58, 10
  490. UpdateTrough
  491. BIP = BIP + 1
  492. End If
  493. End Sub
  494.  
  495. '************************************************
  496. '************** Slingshots *****************
  497. '************************************************
  498.  
  499. Dim LStep, RStep, TStep
  500.  
  501. Sub sw51_Slingshot
  502. PlaySound SoundFX("fx_slingshotL",DOFContactors)
  503. DOFALT 122, 2
  504. DOFALT 124, 2
  505. vpmTimer.PulseSw 51
  506. LSling.Visible = 0
  507. LSling1.Visible = 1
  508. sling2.TransZ = -20
  509. LStep = 0
  510. Me.TimerEnabled = 1
  511. End Sub
  512.  
  513. Sub sw51_Timer
  514. Select Case LStep
  515. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  516. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:Me.TimerEnabled = 0
  517. End Select
  518. LStep = LStep + 1
  519. End Sub
  520.  
  521.  
  522. Sub sw52_Slingshot
  523. PlaySound SoundFX("fx_slingshotR",DOFContactors)
  524. DOFALT 123, 2
  525. DOFALT 126, DOFPulse
  526. vpmTimer.PulseSw 52
  527. RSling.Visible = 0
  528. RSling1.Visible = 1
  529. sling1.TransZ = -20
  530. RStep = 0
  531. Me.TimerEnabled = 1
  532. End Sub
  533.  
  534. Sub sw52_Timer
  535. Select Case RStep
  536. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  537. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:Me.TimerEnabled = 0
  538. End Select
  539. RStep = RStep + 1
  540. End Sub
  541.  
  542.  
  543. Sub sw55_Slingshot
  544. PlaySound SoundFX("fx_slingshotT",DOFContactors)
  545. DOFALT 134, DOFPulse
  546. vpmTimer.PulseSw 55
  547. TSling.Visible = 0
  548. TSling1.Visible = 1
  549. sling3.TransZ = -20
  550. TStep = 0
  551. Me.TimerEnabled = 1
  552. End Sub
  553.  
  554. Sub sw55_Timer
  555. Select Case TStep
  556. Case 3:TSLing1.Visible = 0:TSLing2.Visible = 1:sling3.TransZ = -10
  557. Case 4:TSLing2.Visible = 0:TSLing.Visible = 1:sling3.TransZ = 0:Me.TimerEnabled = 0
  558. End Select
  559. TStep = TStep + 1
  560. End Sub
  561.  
  562. '************************************************
  563. '************** Bumpers *****************
  564. '************************************************
  565.  
  566. Dim dirRing1 : dirRing1 = -1
  567. Dim dirRing2 : dirRing2 = -1
  568.  
  569. Sub Bumper1_Hit
  570. vpmTimer.PulseSw 53
  571. PlaySound SoundFX("fx_BumperLeft",DOFContactors) : Me.TimerEnabled = 1
  572. DOFALT 130, DOFPulse
  573. DOFALT 135, DOFPulse
  574. End Sub
  575.  
  576. Sub Bumper2_Hit
  577. vpmTimer.PulseSw 54
  578. PlaySound SoundFX("fx_BumperRight",DOFContactors) : Me.TimerEnabled = 1
  579. DOFALT 131, DOFPulse
  580. DOFALT 136, DOFPulse
  581. End Sub
  582.  
  583. Sub Bumper1_timer()
  584. BR1.Z = BR1.Z + (5 * dirRing1)
  585. If BR1.Z <= 0 Then dirRing1 = 1
  586. If BR1.Z >= 30 Then
  587. dirRing1 = -1
  588. BR1.Z = 30
  589. Me.TimerEnabled = 0
  590. End If
  591. End Sub
  592.  
  593. Sub Bumper2_timer()
  594. BR2.Z = BR2.Z + (5 * dirRing2)
  595. If BR2.Z <= 0 Then dirRing2 = 1
  596. If BR2.Z >= 30 Then
  597. dirRing2 = -1
  598. BR2.Z = 30
  599. Me.TimerEnabled = 0
  600. End If
  601. End Sub
  602.  
  603. '************************************************
  604. '************** Gun Posts *****************
  605. '************************************************
  606.  
  607. Sub GunPostLeft(enabled)
  608. DOFALT 145, DOFPUlse
  609. If Enabled Then
  610. LPin.IsDropped = 0
  611. PlaySound SoundFX("fx_PostUp",DOFContactors)
  612. DOFALT 152, DOFOn
  613. Else
  614. LPin.IsDropped = 1
  615. PlaySound SoundFX("fx_PostDown",0)
  616. DOFALT 152, DOFOff
  617. End If
  618. End Sub
  619.  
  620. Sub GunPostRight(enabled)
  621. DOFALT 146, DOFPulse
  622. If Enabled Then
  623. RPin.IsDropped = 0
  624. PlaySound SoundFX("fx_PostUp",DOFContactors)
  625. DOFALT 152, DOFOn
  626. Else
  627. RPin.IsDropped = 1
  628. PlaySound SoundFX("fx_PostDown",0)
  629. DOFALT 152, DOFOff
  630. End If
  631. End Sub
  632.  
  633. '************************************************
  634. '*************** Loop Gates ****************
  635. '************************************************
  636.  
  637. Sub LGate(enabled)
  638. If enabled Then
  639. PlaySound "fx_gate"
  640. LLoopGate.Open = 1
  641. DOFALT 147,DOFPulse
  642. Else
  643. DOFALT 147,DOFPulse
  644. LLoopGate.Open = 0
  645. End If
  646. End Sub
  647.  
  648. Sub RGate(enabled)
  649. If enabled Then
  650. PlaySound "fx_gate"
  651. RLoopGate.Open = 1
  652. DOFALT 148,DOFPulse
  653. Else
  654. DOFALT 148,DOFPulse
  655. RLoopGate.Open = 0
  656. End If
  657. End Sub
  658.  
  659. '*************************************************
  660. '****** Shoopity's Train Animation ******
  661. '*************************************************
  662.  
  663. Dim TrainOn,TrainDir, TrainSpeed
  664. TrainSpeed = 1
  665.  
  666. Sub TrainF(enabled)
  667. Train.TransX = -TrainMech.Position
  668. Train1.TransX = -TrainMech.Position
  669. TrainTimer.Enabled = 1
  670. TrainOn = enabled
  671. End Sub
  672.  
  673. Sub TrainB(enabled)
  674. Train.TransX = -TrainMech.Position
  675. Train1.TransX = -TrainMech.Position
  676. TrainTimer.Enabled = 1
  677. TrainOn = enabled
  678. End Sub
  679.  
  680. Sub TrainTimer_Timer()
  681. 'PlaySound(string, int loopcount, float volume, float pan, float randompitch, int pitch, bool usesame, bool restart)
  682. PlaySound SoundFX("fx_train_motor", DOFGear), -1, 1, 0.05, 0, 0, 1, 0
  683. If Train.TransX >= -TrainMech.Position Then
  684. TrainDir = -1
  685. Pgear1.RotY = Pgear1.RotY + 1
  686. Pgear2.RotY = Pgear2.RotY - 1
  687. Pgear3.RotY = Pgear3.RotY - 1
  688. Else
  689. TrainDir = 1
  690. Pgear1.RotY = Pgear1.RotY - 1
  691. Pgear2.RotY = Pgear2.RotY + 1
  692. Pgear3.RotY = Pgear3.RotY + 1
  693. End If
  694. Train.TransX = Train.TransX + TrainSpeed * TrainDir
  695. Train1.TransX = Train.TransX
  696. If ((Train.TransX >= -TrainMech.Position AND TrainDir = 1) OR (Train.TransX <= -TrainMech.Position AND TrainDir = -1)) Then Train.TransX = -TrainMech.Position
  697. If ((Train.TransX >= -TrainMech.Position AND TrainDir = 1) OR (Train.TransX <= -TrainMech.Position AND TrainDir = -1)) AND TrainOn = 0 Then
  698. Me.Enabled = 0
  699. StopSound "fx_train_motor"
  700. End If
  701. If Train.TransX = -611 Then StopSound "fx_train_motor"
  702. End Sub
  703.  
  704. '***********************************************
  705. '** New Train Mech to work with P-ROC (Dozer) **
  706. '***********************************************
  707.  
  708. Dim TrainDirPROC
  709.  
  710. Sub TrainF_PROC(Enabled)
  711. If Enabled Then
  712. PlaySound SoundFX("fx_train_motor", DOFGear), -1, 1, 0.05, 0, 0, 1, 0
  713. DOFALT 140, DOFOn
  714. Polly.Enabled = 1
  715. sw71.enabled = 1
  716. TrainDirPROC = 1
  717. Else
  718. StopSound "fx_train_motor"
  719. DOFALT 140, DOFOff
  720. Polly.enabled = 0
  721. sw71.enabled = 0
  722. End If
  723. End Sub
  724.  
  725. Sub TrainB_PROC(Enabled)
  726. If Enabled Then
  727. PlaySound SoundFX("fx_train_motor", DOFGear), -1, 1, 0.05, 0, 0, 1, 0
  728. DOFALT 140, DOFOn
  729. Polly.Enabled = 1
  730. sw71.enabled = 1
  731. TrainDirPROC = 2
  732. Else
  733. StopSound "fx_train_motor"
  734. DOFALT 140, DOFOff
  735. Polly.enabled = 0
  736. sw71.enabled = 0
  737. End If
  738. End Sub
  739.  
  740. Sub Polly_Timer()
  741. Select Case TrainDirPROC
  742. Case 1: Train.TransX = Train.TransX - 2
  743. Train1.TransX = Train.TransX
  744. Pgear1.RotY = Pgear1.RotY + 1
  745. Pgear2.RotY = Pgear2.RotY - 1
  746. Pgear3.RotY = Pgear3.RotY - 1
  747. If Train.TransX <= -5 Then Controller.Switch(72) = 0
  748. If Train.TransX <= -611 Then Controller.Switch(71) = 1
  749.  
  750. Case 2: Train.TransX = Train.TransX + 4
  751. Train1.TransX = Train.TransX
  752. Pgear1.RotY = Pgear1.RotY - 1
  753. Pgear2.RotY = Pgear2.RotY + 1
  754. Pgear3.RotY = Pgear3.RotY + 1
  755. If Train.TransX => 0 Then Controller.Switch(72) = 1 : Controller.Switch(71) = 1
  756. End Select
  757. End Sub
  758.  
  759. Sub sw71_Timer() 'Dozer - Encoder Pulse which runs with Train Mech.
  760. vpmTimer.PulseSw 71
  761. End Sub
  762.  
  763. Sub Enc_Stop_Timer() 'Dozer - will disable the pulse the first 5 seconds the table is run
  764. sw71.enabled = 0
  765. me.enabled = 0
  766. End Sub
  767.  
  768. '*********************************************
  769. '****** Shoopity's Mine Animation ******
  770. '*********************************************
  771.  
  772. Dim MineOn, Minespeed, MineDir
  773. MineSpeed = 0.25
  774.  
  775. Sub MoveMine(enabled)
  776. MineTimer.enabled = 1
  777. MineOn = enabled
  778. End Sub
  779.  
  780. Sub MineTimer_Timer()
  781. If MineSign.Z > MineMech.Position Then
  782. MineDir = -1
  783. Else
  784. MineDir = 1
  785. End If
  786. PlaySound SoundFX("fx_mine_motor", DOFGear), -1, 1, -0.1, 0, 0, 1, 0
  787. MineSign.Z = MineSign.Z + Minespeed * MineDir
  788. If ((MineSign.Z >= MineMech.Position AND MineDir = 1) OR (MineSign.Z <= MineMech.Position AND MineDir = -1)) AND Not(MineOn) Then 'Shoopity- If the primitive catches the mech AND the solenoid is off, then turn off the timer
  789. Me.Enabled = 0
  790. StopSound "fx_mine_motor"
  791. End If
  792. Mine.RotX = (MineSign.Z * 0.375) - 10
  793. If MineSign.Z < 24 Then 'Shoopity- I will drop the wall in the function that moves the sign
  794. sw15.IsDropped = 0
  795. else
  796. sw15.IsDropped = 1
  797. End If
  798. End sub
  799.  
  800. '**********************************************
  801. '** New Mine Mech to work with P-ROC (Dozer) **
  802. '**********************************************
  803.  
  804. Dim MineDirPROC:MineDirPROC = 1
  805.  
  806. Sub MoveMine_PROC(Enabled)
  807. If Enabled then
  808. PlaySound SoundFX("fx_mine_motor", DOFGear), -1, 1, -0.1, 0, 0, 1, 0
  809. DOFALT 141, DOFOn
  810. MineDirPROC=MineDirPROC
  811. sw15.Timerenabled = 1
  812. sw15b.Timerenabled = 1
  813. Else
  814. sw15.Timerenabled = 0
  815. sw15b.Timerenabled = 0
  816. StopSound "fx_mine_motor"
  817. DOFALT 141, DOFOff
  818. End If
  819. End Sub
  820.  
  821. Sub Sw15_Timer()
  822. Select Case MineDirPROC
  823. Case 1: MineSign.Z = MineSign.Z + Minespeed
  824. Mine.RotX = (MineSign.Z * 0.375) - 10
  825. If MineSign.Z => 0 Then Controller.Switch(77) = 0
  826. If MineSign.Z => 24 Then sw15.IsDropped = 1
  827. If MineSign.Z => 45 Then MineDirPROC = 2
  828.  
  829. Case 2: MineSign.Z = MineSign.Z - Minespeed
  830. Mine.RotX = (MineSign.Z * 0.375) - 10
  831. If MineSign.Z <= 0 Then Controller.Switch(77) = 1
  832. If MineSign.Z <= 24 Then sw15.IsDropped = 0
  833. If MineSign.Z <= 0 Then MineDirPROC = 1
  834. End Select
  835. End sub
  836.  
  837. Sub sw15b_Timer() 'Dozer - Encoder Pulse which runs with Mine Mech.
  838. vpmTimer.PulseSw 78
  839. End Sub
  840.  
  841. '*********************************************
  842. '****** Shoopity 's Bart Animation ******
  843. '*********************************************
  844.  
  845. Dim bsmash : bsmash = 1
  846. Dim blrnh:blrnh = 1
  847. Dim blrnhud:blrnhud = 1
  848. Dim BartSpeed:Bartspeed = 6
  849. Dim BallHat
  850.  
  851. Sub HatInit_Timer()
  852. Dim X
  853. For Each X in GetBalls
  854. If X.ID = 999 Then Set BallHat = X
  855. Next
  856. KiHat.Kick 0, 0, 0
  857. Me.Enabled = 0
  858. End Sub
  859.  
  860. Sub MoveBart(Enabled)
  861. If Enabled Then
  862. DOFALT 149, DOFPulse
  863. blrnh = -1 'Start him moving left
  864. BartSwitched = 0 'Reset every time this kicks
  865. Bart1.Enabled = 1 'Shoopity- turn on the animation any time the bart toy is moving
  866. PlaySound SoundFX("fx_bart_hit", DOFContactors)
  867. BallHat.VelX = RndNum (-10,10)
  868. end If
  869. End Sub
  870.  
  871. Sub MoveHat(Enabled)
  872. If Enabled Then
  873. DOFALT 150, DOFPulse
  874. PlaySound SoundFX("fx_bart_move", DOFContactors)
  875. Bart2.Enabled = 1 'Shoopity- Here, the hat obviously returns to the head, and we'll turn it off in the timer, like it was done prior to me coming here
  876. End If
  877. End Sub
  878.  
  879. Sub BHit_Timer()
  880. Select Case bsmash
  881. Case 1:
  882. If Bart.TransY => 20 Then
  883. bsmash = 2
  884. End If
  885. Bart.TransY = Bart.TransY + 2
  886. Bart_Hat.TransY = Bart_Hat.TransY + 2
  887. Case 2:
  888. If Bart.TransY <= 0 Then
  889. me.enabled = 0
  890. Bart.TransZ= 0
  891. Bart_Hat.TransY = 70
  892. End If
  893. Bart.TransY = Bart.TransY - 2
  894. Bart_Hat.TransY = Bart_Hat.TransY - 2
  895. End Select
  896. End Sub
  897.  
  898. Dim BartOrigX, BartOrigY, BartSwitched
  899. Sub Bart1_Timer() ' - Left then right with no hat lift. 'Shoopity- I've changed it to just move back and forth as long as the solenoid is on
  900. Bart.X = Bart.X + BartSpeed * blrnh 'Shoopity- so we move it, but you can change the speed by changing BartSpeed if you want, and blrnh will be used as a direction
  901. Bart_Hat.X = Bart_Hat.X + BartSpeed * blrnh 'Shoopity- had to change it back since they're not longer in the same location
  902. Bart_Hat.RotZ = KiHat.X - BallHat.X
  903. If Bart.X <= 592 Then blrnh = 1:BartSwitched = BartSwitched + 1
  904. If Bart.X >= 660 Then blrnh = -1:BartSwitched = BartSwitched + 1
  905. If Bart.X <= BartOrigX AND BartSwitched >=2 Then
  906. Bart.X = BartOrigX
  907. Me.Enabled = 0
  908. End If
  909. End Sub
  910.  
  911. Dim HatHeight, HatHi, HatAdjuster
  912. HatAdjuster = 100
  913. HatHeight = Bart_Hat.Z 'Shoopity- So if you ever change the height of the hat, it'll get remembered here properly
  914. HatHi = HatHeight + 75 'Shoopity- The heighest point the hat will go, so if you want to change how hi the hat goes, change that here
  915. Sub Bart2_Timer() ' - Left then right with no hat lift. 'Shoopity- I'm pretty sure this is supposed to say "Hat hit" or something like that
  916. Bart_Hat.Z = (dSin(blrnhud) * HatAdjuster) + HatHeight 'Shoopity- This is how I use physics, although it's not going to be variable height like the beer mug is
  917. blrnhud = blrnhud + SlowMo + 5
  918. If blrnhud > 180 Then
  919. blrnhud =1
  920. Me.Enabled = 0
  921. End If
  922. End Sub
  923.  
  924. '********************************************************
  925. ' Shoopity's Beer Mug Animation
  926. '********************************************************
  927.  
  928. Dim MugHit 'Shoopity- Variable to capture the Y velocity of the ball to know how high to kick it
  929. Sub Sw46_Hit()
  930. DOFALT 153, DOFPulse
  931. RandomSoundMetal()
  932. vpmTimer.PulseSwitch 46,0,0
  933. MugHit = ActiveBall.VelY
  934. Beer.Enabled = 1
  935. End Sub
  936.  
  937. Dim mmmbeer, BeerMaxHeight, SlowMo, BeerAdjuster, mmmswitch
  938. SlowMo = 3 'Shoopity- Just a fun variable if you want to see stuff move in slow motion
  939. mmmbeer = 1
  940. BeerAdjuster = 10 'Shoopity- Adjuster to translate the ball velocity into how high the mug goes
  941. BeerMaxHeight = 150 'Shoopity- if you want to change how high the mug goes, just change this number
  942. Sub Beer_Timer()
  943. BeerMug.Z = (dSin(mmmBeer) * (ABS(MugHit)*BeerAdjuster)) + 52
  944. sw46p.RotX = -(dSin(mmmBeer) * MugHit/30)
  945. mmmBeer = mmmBeer + SlowMo
  946. If BeerMug.Z > BeerMaxHeight Then 'Shoopity- If you hight the max height then...
  947. BeerMug.Z = BeerMaxHeight ' Hold it there for a bit
  948. sw46p.RotX = -BeerMaxHeight/3 ' Hold it there for a bit
  949. End If
  950. If mmmBeer > 180 Then 'Shoopity- If it's traveled all the way up and down then...
  951. mmmBeer = 1 'Reset so next time it starts over
  952. Me.Enabled = 0 'Stop the animation
  953. End If
  954. End Sub
  955.  
  956. '*********************************************
  957. '************** Flippers ***************
  958. '*********************************************
  959.  
  960. Sub SolLFlipper(Enabled)
  961. If Enabled Then
  962. PlaySound SoundFX("fx_flipperup",DOFFlippers), 0, 1, -0.1, 0.25
  963. DOFALT 101, DOFOn
  964. LeftFlipper.RotateToEnd
  965. Else
  966. PlaySound SoundFX("fx_flipperdown",DOFFlippers), 0, 1, -0.1, 0.25
  967. DOFALT 101, DOFOff
  968. LeftFlipper.RotateToStart
  969. End If
  970. End Sub
  971.  
  972. Sub SolRFlipper(Enabled)
  973. If Enabled Then
  974. PlaySound SoundFX("fx_flipperup",DOFFlippers), 0, 1, 0.1, 0.25
  975. DOFALT 102, DOFOn
  976. RightFlipper.RotateToEnd
  977. Else
  978. PlaySound SoundFX("fx_flipperdown",DOFFlippers), 0, 1, 0.1, 0.25
  979. DOFALT 102, DOFOff
  980. RightFlipper.RotateToStart
  981. End If
  982. End Sub
  983.  
  984. '**************************************************************
  985. '*********************** Switches ************************
  986. '**************************************************************
  987.  
  988. '*************** Gold Mine & Sign *************
  989.  
  990. Sub sw15_Hit() : PlaySound "fx_mine_hit" : vpmTimer.PulseSwitch 15,0,0 : DOFALT 149, DOFPulse : End Sub
  991. Sub sw15b_Hit() : RandomSoundMetal() : vpmTimer.PulseSwitch 15,0,0 : End Sub
  992.  
  993. '*************** Bart Toy *********************
  994.  
  995. Sub sw75_Hit() : RandomSoundMetal() : vpmTimer.PulseSwitch 75,0,0 : bsmash = 1 : Bhit.enabled = 1 : End Sub
  996.  
  997. '*************** Saloon *********************
  998.  
  999. Sub sw73_Hit() : PlaySound "fx_gate4" : vpmTimer.PulseSwitch 73,0,0 : End Sub
  1000.  
  1001. '*************** Opto Switches *********************
  1002.  
  1003. Sub sw36_Hit() : vpmTimer.PulseSwitch 36,0,0 : End Sub
  1004. Sub sw37_Hit() : vpmTimer.PulseSwitch 37,0,0 : End Sub
  1005. Sub sw56_Hit() : vpmTimer.PulseSwitch 56,0,0 : End Sub
  1006. Sub sw66_Hit() : vpmTimer.PulseSwitch 66,0,0 : End Sub
  1007. Sub sw67_Hit() : vpmTimer.PulseSwitch 67,0,0 : End Sub
  1008.  
  1009. '*************** Rollover Switches *************************
  1010.  
  1011. Sub sw16_Hit : Controller.Switch(16) = 1 : PlaySound "fx_sensor" : End Sub
  1012. Sub sw16_UnHit : Controller.Switch(16) = 0 : End Sub
  1013. Sub sw17_Hit : Controller.Switch(17) = 1 : PlaySound "fx_sensor" : End Sub
  1014. Sub sw17_UnHit : Controller.Switch(17) = 0 : End Sub
  1015. Sub sw18_Hit : Controller.Switch(18) = 1 : PlaySound "fx_sensor" : End Sub
  1016. Sub sw18_UnHit : Controller.Switch(18) = 0 : End Sub
  1017. Sub sw26_Hit : Controller.Switch(26) = 1 : PlaySound "fx_sensor" : End Sub
  1018. Sub sw26_UnHit : Controller.Switch(26) = 0 : End Sub
  1019. Sub sw27_Hit : Controller.Switch(27) = 1 : PlaySound "fx_sensor" : End Sub
  1020. Sub sw27_UnHit : Controller.Switch(27) = 0 : End Sub
  1021. Sub sw47_Hit : Controller.Switch(47) = 1 : PlaySound "fx_sensor" : End Sub
  1022. Sub sw47_UnHit : Controller.Switch(47) = 0 : End Sub
  1023. Sub sw48_Hit : Controller.Switch(48) = 1 : PlaySound "fx_sensor" : End Sub
  1024. Sub sw48_UnHit : Controller.Switch(48) = 0 : End Sub
  1025. Sub sw57_Hit : Controller.Switch(57) = 1 : PlaySound "fx_sensor" : End Sub
  1026. Sub sw57_UnHit : Controller.Switch(57) = 0 : End Sub
  1027. Sub sw58_Hit : Controller.Switch(58) = 1 : PlaySound "fx_sensor" : End Sub
  1028. Sub sw58_UnHit : Controller.Switch(58) = 0 : End Sub
  1029.  
  1030. '*************** Ramps Switches **********************
  1031.  
  1032. Sub sw82_Hit() : vpmTimer.PulseSwitch 82,0,0 : If ActiveBall.VelY < 0 Then PlaySound "fx_center_ramp_enter": End If : End Sub
  1033. Sub sw82_UnHit(): If ActiveBall.VelY > 0 Then StopSound "fx_center_ramp_enter": End If : End Sub
  1034. Sub Sw65_Hit():Controller.Switch(65) = 1:sw65flip.rotatetoend: Playsound "fx_gate4": DOFALT 107, DOFPulse : End Sub
  1035. Sub Sw65_UnHit():Controller.Switch(65) = 0:sw65flip.rotatetostart: End Sub
  1036. Sub sw68_Hit():Controller.Switch(68) = 1:sw68flip.rotatetoend: Playsound "fx_gate4":End Sub
  1037. Sub Sw68_UnHit():Controller.Switch(68) = 0:sw68flip.rotatetostart: End Sub
  1038. Sub Sw83_Hit():Controller.Switch(83) = 1:sw83flip.rotatetoend: Playsound "fx_gate4": DOFALT 107, DOFPulse : End Sub
  1039. Sub Sw83_UnHit():controller.Switch(83) = 0:sw83flip.rotatetostart:End Sub
  1040. Sub sw84_Hit():Controller.Switch(84) = 1:sw84flip.rotatetoend: Playsound "fx_gate4": DOFALT 107, DOFPulse : End Sub
  1041. Sub Sw84_UnHit():controller.Switch(84) = 0:sw84flip.rotatetostart:End Sub
  1042. Sub sw85_Hit():Controller.Switch(85) = 1:sw85flip.rotatetoend: Playsound "fx_gate4":End Sub
  1043. Sub Sw85_UnHit():controller.Switch(85) = 0:sw85flip.rotatetostart:End Sub
  1044.  
  1045. '*************** Hit Targets **********************
  1046.  
  1047. Sub sw28_Hit() : PlaySound SoundFX("fx_target",DOFTargets) : vpmTimer.PulseSwitch 28,0,0 : DOFALT 104, DOFPulse : End Sub
  1048. Sub sw44_Hit() : PlaySound SoundFX("fx_target",DOFTargets) : vpmTimer.PulseSwitch 44,0,0 : DOFALT 104, DOFPulse : End Sub
  1049. Sub sw86_Hit() : PlaySound SoundFX("fx_target",DOFTargets) : vpmTimer.PulseSwitch 86,0,0 : DOFALT 103, DOFPulse : End Sub
  1050. Sub sw87_Hit() : PlaySound SoundFX("fx_target",DOFTargets) : vpmTimer.PulseSwitch 87,0,0 : DOFALT 103, DOFPulse : End Sub
  1051.  
  1052. '*************** Drop Targets **********************
  1053.  
  1054. Sub Sw61_Hit() : PlaySound SoundFX("fx_target_drop",DOFDropTargets) : Controller.Switch(61) = 1 : sw61p.transY = -5 : DOFALT 125, DOFPulse : End Sub
  1055. Sub Sw61_UnHit() : sw61p.transY = 0 :End Sub
  1056. Sub Sw62_Hit() : PlaySound SoundFX("fx_target_drop",DOFDropTargets) : Controller.Switch(62) = 1 : sw62p.transY = -5 : DOFALT 126, DOFPulse : End Sub
  1057. Sub Sw62_UnHit() : sw62p.transY = 0 :End Sub
  1058. Sub Sw63_Hit() : PlaySound SoundFX("fx_target_drop",DOFDropTargets) : Controller.Switch(63) = 1 : sw63p.transY = -5 : DOFALT 127, DOFPulse : End Sub
  1059. Sub Sw63_UnHit() : sw63p.transY = 0 :End Sub
  1060. Sub Sw64_Hit() : PlaySound SoundFX("fx_target_drop",DOFDropTargets) : Controller.Switch(64) = 1 : sw64p.transY = -5 : DOFALT 128, DOFPulse : End Sub
  1061. Sub Sw64_UnHit() : sw64p.transY = 0 :End Sub
  1062.  
  1063. '************************************************************
  1064. '************** Saloon & Gold Mine Subway *********
  1065. '************************************************************
  1066.  
  1067. Dim BIK:BIK=0
  1068.  
  1069. Sub BartPopper_Hit
  1070. PlaySound "fx_kicker_catch"
  1071. Controller.Switch (42) = 1
  1072. BIK = BIK + 1
  1073. End Sub
  1074.  
  1075. Sub BartPopper_UnHit()
  1076. Controller.Switch (42) = 0
  1077. BIK = BIK - 1
  1078. End Sub
  1079.  
  1080. Sub SecretEntrance_Hit() : PlaySound "fx_hole" : End Sub
  1081.  
  1082. Sub BartHole_Hit() : Playsound "fx_saloon_enter" : End Sub
  1083.  
  1084. Sub MineHole_Hit() : PlaySound "fx_mine_enter" : End Sub
  1085.  
  1086. Sub MinePopper_Hit
  1087. PlaySound "fx_kicker_catch"
  1088. Controller.Switch (41) = 1
  1089. BIK = BIK + 1
  1090. End Sub
  1091.  
  1092. Sub MinePopper_UnHit()
  1093. Controller.Switch (41) = 0
  1094. BIK = BIK - 1
  1095. End Sub
  1096.  
  1097. '************************************************
  1098. '************** Lights *****************
  1099. '************************************************
  1100.  
  1101. Sub InitFlashers()
  1102. L17R.IntensityScale = 0
  1103. L18R.IntensityScale = 0
  1104. F25R.IntensityScale = 0
  1105. F26R.IntensityScale = 0
  1106. F27R.IntensityScale = 0
  1107. F27R1.IntensityScale = 0
  1108. F27R2.IntensityScale = 0
  1109. F28R.IntensityScale = 0
  1110. F28R1.IntensityScale = 0
  1111. F28R2.IntensityScale = 0
  1112. End Sub
  1113.  
  1114. '************** Inserts *****************
  1115.  
  1116. On Error Resume Next
  1117. Dim i
  1118. For i=0 To 127
  1119. Execute "Set Lights(" & i & ") = L" & i
  1120. Next
  1121.  
  1122. '************** Flashers *****************
  1123.  
  1124. Dim ff18,ff19, ff20, ff24, ff25, ff26, ff27, ff28
  1125.  
  1126. Sub Sol18(enabled)
  1127. If enabled Then
  1128. DOFALT 18, DOFOn
  1129. for each ff18 in F18:ff18.State = 1
  1130. next
  1131. Mine.Image = "mine rock text on"
  1132. else
  1133. DOFALT 18, DOFOff
  1134. for each ff18 in F18:ff18.State = 0
  1135. Mine.Image = "mine rock text off"
  1136. next
  1137. End If
  1138. End Sub
  1139.  
  1140. Sub Sol19(enabled)
  1141. If enabled Then
  1142. DOFALT 19, DOFOn
  1143. for each ff19 in F19:ff19.State = 1
  1144. next
  1145. else
  1146. DOFALT 19, DOFOff
  1147. for each ff19 in F19:ff19.State = 0
  1148. next
  1149. End If
  1150. End Sub
  1151.  
  1152. Sub Sol20(enabled)
  1153. If enabled Then
  1154. DOFALT 20, DOFOn
  1155. for each ff20 in F20:ff20.State = 1
  1156. next
  1157. else
  1158. DOFALT 20, DOFOff
  1159. for each ff20 in F20:ff20.State = 0
  1160. next
  1161. End If
  1162. End Sub
  1163.  
  1164. Sub Sol24(enabled)
  1165. If enabled Then
  1166. DOFALT 24, DOFOn
  1167. for each ff24 in F24:ff24.State = 1
  1168. next
  1169. else
  1170. DOFALT 24, DOFOff
  1171. for each ff24 in F24:ff24.State = 0
  1172. next
  1173. End If
  1174. End Sub
  1175.  
  1176. Sub Sol25(enabled)
  1177. If enabled Then
  1178. DOFALT 25, DOFOn
  1179. for each ff25 in F25:ff25.State = 1
  1180. F25R.IntensityScale = 1
  1181. next
  1182. else
  1183. DOFALT 25, DOFOff
  1184. for each ff25 in F25:ff25.State = 0
  1185. F25R.IntensityScale = 0
  1186. next
  1187. End If
  1188. End Sub
  1189.  
  1190. Sub Sol26(enabled)
  1191. If enabled Then
  1192. DOFALT 26, DOFOn
  1193. for each ff26 in F26:ff26.State = 1
  1194. F26R.IntensityScale = 1
  1195. next
  1196. else
  1197. DOFALT 26, DOFOff
  1198. for each ff26 in F26:ff26.State = 0
  1199. F26R.IntensityScale = 0
  1200. next
  1201. End If
  1202. End Sub
  1203.  
  1204. Sub Sol27(enabled)
  1205. If enabled Then
  1206. DOFALT 27, DOFOn
  1207. for each ff27 in F27:ff27.State = 1
  1208. F27R.IntensityScale = 1
  1209. F27R1.IntensityScale = 1
  1210. F27R2.IntensityScale = 1
  1211. next
  1212. else
  1213. DOFALT 27, DOFOff
  1214. for each ff27 in F27:ff27.State = 0
  1215. F27R.IntensityScale = 0
  1216. F27R1.IntensityScale = 0
  1217. F27R2.IntensityScale = 0
  1218. next
  1219. End If
  1220. End Sub
  1221.  
  1222. Sub Sol28(enabled)
  1223. If enabled Then
  1224. DOFALT 28, DOFOn
  1225. for each ff28 in F28:ff28.State = 1
  1226. F28R.IntensityScale = 1
  1227. F28R1.IntensityScale = 1
  1228. F28R2.IntensityScale = 1
  1229. next
  1230. else
  1231. DOFALT 28, DOFOff
  1232. for each ff28 in F28:ff28.State = 0
  1233. F28R.IntensityScale = 0
  1234. F28R1.IntensityScale = 0
  1235. F28R2.IntensityScale = 0
  1236. next
  1237. End If
  1238. End Sub
  1239.  
  1240. '********* VPM MODULATED FLASHERS ****************
  1241. Sub Sol18Mod(value)
  1242. for each ff18 in F18:ff18.IntensityScale = value/128:next
  1243. If value > 0 Then
  1244. DOFALT 18, DOFOn
  1245. for each ff18 in F18:ff18.State = 1:next
  1246. End If
  1247. If value = 0 Then
  1248. DOFALT 18, DOFOff
  1249. for each ff18 in F18:ff18.State = 0:next
  1250. End If
  1251. If value > 110 Then
  1252. Mine.Image = "mine rock text on"
  1253. Else
  1254. Mine.Image = "mine rock text off"
  1255. End If
  1256. End Sub
  1257.  
  1258. Sub Sol19Mod(value)
  1259. for each ff19 in F19:ff19.IntensityScale = value/128:next
  1260. If value > 0 Then
  1261. DOFALT 19, DOFOn
  1262. for each ff19 in F19:ff19.State = 1:next
  1263. End If
  1264. If value = 0 Then
  1265. DOFALT 19, DOFOff
  1266. for each ff19 in F19:ff19.State = 0:next
  1267. End If
  1268. End Sub
  1269.  
  1270. Sub Sol20Mod(value)
  1271. for each ff20 in F20:ff20.IntensityScale = value/128:next
  1272. If value > 0 Then
  1273. DOFALT 20, DOFOn
  1274. for each ff20 in F20:ff20.State = 1:next
  1275. End If
  1276. If value = 0 Then
  1277. DOFALT 20, DOFOff
  1278. for each ff20 in F20:ff20.State = 0:next
  1279. End If
  1280. End Sub
  1281.  
  1282. Sub Sol24Mod(value)
  1283. for each ff24 in F24:ff24.IntensityScale = value/128:next
  1284. If value > 0 Then
  1285. DOFALT 24, DOFOn
  1286. for each ff24 in F24:ff24.State = 1:next
  1287. End If
  1288. If value = 0 Then
  1289. DOFALT 24, DOFOff
  1290. for each ff24 in F24:ff24.State = 0:next
  1291. End If
  1292. End Sub
  1293.  
  1294. Sub Sol25Mod(value)
  1295. for each ff25 in F25:ff25.IntensityScale = value/128:next
  1296. F25R.IntensityScale = value/128
  1297. If value > 0 Then
  1298. DOFALT 25, DOFOn
  1299. for each ff25 in F25:ff25.State = 1:next
  1300. End If
  1301. If value = 0 Then
  1302. DOFALT 25, DOFOff
  1303. for each ff25 in F25:ff25.State = 0:next
  1304. End If
  1305. End Sub
  1306.  
  1307. Sub Sol26Mod(value)
  1308. for each ff26 in F26:ff26.IntensityScale = value/128:next
  1309. F26R.IntensityScale = value/128
  1310. If value > 0 Then
  1311. DOFALT 26, DOFOn
  1312. for each ff26 in F26:ff26.State = 1:next
  1313. End If
  1314. If value = 0 Then
  1315. DOFALT 26, DOFOff
  1316. for each ff26 in F26:ff26.State = 0:next
  1317. End If
  1318. End Sub
  1319.  
  1320. Sub Sol27Mod(value)
  1321. for each ff27 in F27:ff27.IntensityScale = value/128:next
  1322. F27R.IntensityScale = value/128
  1323. F27R1.IntensityScale = value/128
  1324. F27R2.IntensityScale = value/128
  1325. If value > 0 Then
  1326. DOFALT 27, DOFOn
  1327. for each ff27 in F27:ff27.State = 1:next
  1328. End If
  1329. If value = 0 Then
  1330. DOFALT 27, DOFOff
  1331. for each ff27 in F27:ff27.State = 0:next
  1332. End If
  1333. End Sub
  1334.  
  1335. Sub Sol28Mod(value)
  1336. for each ff28 in F28:ff28.IntensityScale = value/128:next
  1337. F28R.IntensityScale = value/128
  1338. F28R1.IntensityScale = value/128
  1339. F28R2.IntensityScale = value/128
  1340. If value > 0 Then
  1341. DOFALT 28, DOFOn
  1342. for each ff28 in F28:ff28.State = 1:next
  1343. End If
  1344. If value = 0 Then
  1345. DOFALT 28, DOFOff
  1346. for each ff28 in F28:ff28.State = 0:next
  1347. End If
  1348. End Sub
  1349.  
  1350.  
  1351. '************** GI *****************
  1352.  
  1353. Dim gistep,xxx,iii,gil,gir
  1354.  
  1355. Sub UpdateGI2(no, step)
  1356. If PROC=0 Then
  1357. If step = 0 then exit sub
  1358. gistep = (step-1) / 7
  1359. Select Case no
  1360. Case 0
  1361. For each xxx in LeftGI:xxx.IntensityScale = gistep:next
  1362. Case 1
  1363. For each xxx in RightGI:xxx.IntensityScale = gistep:next
  1364. Case 2
  1365. For each xxx in TopGI:xxx.IntensityScale = gistep:next
  1366. For each xxx in BWGI:xxx.IntensityScale = gistep:next
  1367. End Select
  1368. Table1.ColorGradeImage = "ColorGrade_" & step
  1369. End If
  1370. End Sub
  1371.  
  1372. Sub UpdateGI(giNo, stat)
  1373. If PROC= 1 Then
  1374. Select Case giNo
  1375. Case 0 GI_Left(abs(stat))
  1376. Case 1 GI_Right(abs(stat))
  1377. Case 2 GI_Top(abs(stat))
  1378. End Select
  1379. If gil=0 AND gir=0 Then
  1380. Table1.ColorGradeImage="ColorGrade_1"
  1381. Else
  1382. Table1.ColorGradeImage="ColorGrade_8"
  1383. End If
  1384. End If
  1385. End Sub
  1386.  
  1387. Sub Gi_Left(enabled)
  1388. For each iii in LeftGI:iii.state= enabled:Next
  1389. gil=enabled
  1390. End Sub
  1391.  
  1392. Sub Gi_Right(enabled)
  1393. For each iii in RightGI:iii.state = enabled:Next
  1394. gir=enabled
  1395. End Sub
  1396.  
  1397. Sub Gi_Top(enabled)
  1398. For each iii in TopGI:iii.state = enabled:Next
  1399. For each iii in BWGI:iii.IntensityScale = enabled:next
  1400. End Sub
  1401.  
  1402. ' *********************************************************************
  1403. ' RealTime Updates
  1404. ' *********************************************************************
  1405.  
  1406. Sub GameTimer
  1407. L17R.IntensityScale = L17.state
  1408. L18R.IntensityScale = L18.state
  1409. sw65p.rotx = sw65flip.currentangle
  1410. sw68p.rotx = sw68flip.currentangle
  1411. sw83p.rotx = sw83flip.currentangle
  1412. sw84p.rotx = sw84flip.currentangle
  1413. sw85p.rotx = sw85flip.currentangle
  1414. FlipperL.rotz=LeftFlipper.currentangle
  1415. FlipperR.rotz=RightFlipper.currentangle
  1416. sw82p.rotx = BartRampG.currentangle
  1417. sw73p.rotx = SaloonG.currentangle
  1418. LLoopGateSw.roty = LLoopGate.currentangle
  1419. RLoopGateSw.roty = RLoopGate.currentangle
  1420. RollingSoundUpdate
  1421. BallShadowUpdate
  1422. End Sub
  1423.  
  1424. ' *********************************************************************
  1425. ' Supporting Ball & Sound Functions
  1426. ' *********************************************************************
  1427.  
  1428. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1429. Vol = Csng(BallVel(ball) ^2/RollingVol)
  1430. End Function
  1431.  
  1432. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1433. Dim tmp
  1434. tmp = ball.x * 2 / table1.width-1
  1435. If tmp > 0 Then
  1436. Pan = Csng(tmp ^10)
  1437. Else
  1438. Pan = Csng(-((- tmp) ^10) )
  1439. End If
  1440. End Function
  1441.  
  1442. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1443. Pitch = BallVel(ball) * 20
  1444. End Function
  1445.  
  1446. Function BallVel(ball) 'Calculates the ball speed
  1447. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1448. End Function
  1449.  
  1450. '*****************
  1451. '* Maths
  1452. '*****************
  1453. 'Shoopity- For the hat and beer mug, I'm gonna do some physical stuff, so we need some math functions
  1454. Dim Pi
  1455. Pi = Round(4 * Atn(1), 6)
  1456. Function dSin(degrees)
  1457. dsin = sin(degrees * Pi/180)
  1458. if ABS(dSin) < 0.000001 Then dSin = 0
  1459. if ABS(dSin) > 0.999999 Then dSin = 1' * sgn(dSin)
  1460. End Function
  1461.  
  1462. Function dCos(degrees)
  1463. dcos = cos(degrees * Pi/180)
  1464. if ABS(dCos) < 0.000001 Then dCos = 0
  1465. if ABS(dCos) > 0.999999 Then dCos = 1' * sgn(dCos)
  1466. End Function
  1467.  
  1468. Function RndNum(min, max)
  1469. RndNum = Int(Rnd() * (max-min + 1) ) + min ' Sets a random number between min and max
  1470. End Function
  1471.  
  1472. '*****************************************
  1473. ' JP's VP10 Rolling Sounds
  1474. '*****************************************
  1475.  
  1476. Const tnob = 5 ' total number of balls
  1477. ReDim rolling(tnob)
  1478. InitRolling
  1479.  
  1480. Sub InitRolling
  1481. Dim i
  1482. For i = 0 to tnob
  1483. rolling(i) = False
  1484. Next
  1485. End Sub
  1486.  
  1487. Sub RollingSoundUpdate()
  1488. Dim BOT, b
  1489. BOT = GetBalls
  1490.  
  1491. ' stop the sound of deleted balls
  1492. For b = UBound(BOT) + 1 to tnob
  1493. rolling(b) = False
  1494. StopSound("fx_ballrolling" & b)
  1495. Next
  1496.  
  1497. ' exit the sub if no balls on the table
  1498. If UBound(BOT) = -1 Then Exit Sub
  1499.  
  1500. ' play the rolling sound for each ball
  1501. For b = 0 to UBound(BOT)
  1502. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1503. rolling(b) = True
  1504. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1505. Else
  1506. If rolling(b) = True Then
  1507. StopSound("fx_ballrolling" & b)
  1508. rolling(b) = False
  1509. End If
  1510. End If
  1511. Next
  1512. End Sub
  1513.  
  1514. '*****************************************
  1515. ' Ball Shadow
  1516. '*****************************************
  1517.  
  1518. Dim BallShadow
  1519. BallShadow = Array (BallShadow1, BallShadow2, BallShadow3, BallShadow4, BallShadow5)
  1520.  
  1521. Sub BallShadowUpdate()
  1522. Dim BOT, b
  1523. BOT = GetBalls
  1524.  
  1525. ' render the shadow for each ball
  1526. For b = 0 to UBound(BOT)
  1527. If BOT(b).X < Table1.Width/2 Then
  1528. BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) + 10
  1529. Else
  1530. BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) - 10
  1531. End If
  1532.  
  1533. BallShadow(b).Y = BOT(b).Y + 20
  1534. BallShadow(b).Z = 1
  1535. If BOT(b).Z > 20 Then
  1536. BallShadow(b).visible = 1
  1537. Else
  1538. BallShadow(b).visible = 0
  1539. End If
  1540. Next
  1541. End Sub
  1542.  
  1543. '*****************************************
  1544. ' JP's VP10 Ball Collision Sound
  1545. '*****************************************
  1546.  
  1547. Sub OnBallBallCollision(ball1, ball2, velocity)
  1548. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 500, Pan(ball1), 0, Pitch(ball1), 0, 0
  1549. End Sub
  1550.  
  1551. '**********************
  1552. ' Balldrop & Ramp Sound
  1553. '**********************
  1554.  
  1555. Sub BallDropSound(dummy)
  1556. PlaySound "fx_balldrop"
  1557. End Sub
  1558.  
  1559. Sub BallDropSound1(dummy)
  1560. PlaySound "fx_balldrop_station"
  1561. End Sub
  1562.  
  1563. Sub Balldrop1_Hit()
  1564. vpmtimer.addtimer 200, "BallDropSound"
  1565. StopSound "fx_leftramp_exit"
  1566. End Sub
  1567.  
  1568. Sub Balldrop2_Hit()
  1569. vpmtimer.addtimer 150, "BallDropSound"
  1570. StopSound "fx_leftramp_exit"
  1571. End Sub
  1572.  
  1573. Sub LREnter_Hit()
  1574. If ActiveBall.VelY < 0 Then PlaySound "fx_leftramp_enter"
  1575. End Sub
  1576.  
  1577. Sub RREnter_Hit()
  1578. If ActiveBall.VelY < 0 Then PlaySound "fx_leftramp_enter"
  1579. End Sub
  1580.  
  1581. Sub LREnter_UnHit()
  1582. If ActiveBall.VelY > 0 Then StopSound "fx_leftramp_enter"
  1583. End Sub
  1584.  
  1585. Sub RREnter_UnHit()
  1586. If ActiveBall.VelY > 0 Then StopSound "fx_leftramp_enter"
  1587. End Sub
  1588.  
  1589. Sub LREnter1_Hit() : PlaySound "fx_leftramp_exit" : End Sub
  1590.  
  1591. Sub RPin_Hit() : RandomSoundMetal() : End Sub
  1592. Sub LPin_Hit() : RandomSoundMetal() : End Sub
  1593. Sub Trigger1_Hit() : StopSound "fx_launch" : PlaySound "fx_turn_SSRamp" :End Sub
  1594. Sub Trigger2_Hit() : StopSound "fx_launch" : PlaySound "fx_balldrop_SSRamp" : End Sub
  1595. Sub Trigger3_Hit() : PlaySound "fx_wireramp" : End Sub
  1596. Sub Trigger4_Hit() : StopSound "fx_wireramp" : End Sub
  1597. Sub Trigger5_Hit() : PlaySound "fx_wireramp" : End Sub
  1598. Sub Trigger6_Hit() : StopSound "fx_wireramp" : vpmtimer.addtimer 200, "BallDropSound1" : End Sub
  1599. Sub Trigger7_Hit() : If BIP > 0 And ActiveBall.VelY < 0 Then Playsound "fx_launch" : Else StopSound "fx_launch" : End If : End Sub
  1600.  
  1601. '*****************************************
  1602. ' JF's Sound Routines
  1603. '*****************************************
  1604.  
  1605. Sub Rubbers_Hit(idx)
  1606. dim finalspeed
  1607. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1608. If finalspeed > 20 then
  1609. PlaySound "fx_rubber", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1610. End if
  1611. If finalspeed >= 6 AND finalspeed <= 20 then
  1612. RandomSoundRubber()
  1613. End If
  1614. End Sub
  1615.  
  1616. Sub Posts_Hit(idx)
  1617. dim finalspeed
  1618. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1619. If finalspeed > 16 then
  1620. PlaySound "fx_rubber", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1621. End if
  1622. If finalspeed >= 6 AND finalspeed <= 16 then
  1623. RandomSoundRubber()
  1624. End If
  1625. End Sub
  1626.  
  1627. Sub RandomSoundRubber()
  1628. Select Case Int(Rnd*3)+1
  1629. Case 1 : PlaySound "fx_rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1630. Case 2 : PlaySound "fx_rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1631. Case 3 : PlaySound "fx_rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1632. End Select
  1633. End Sub
  1634.  
  1635. Sub LeftFlipper_Collide(parm)
  1636. RandomSoundFlipper()
  1637. End Sub
  1638.  
  1639. Sub RightFlipper_Collide(parm)
  1640. RandomSoundFlipper()
  1641. End Sub
  1642.  
  1643. Sub RandomSoundFlipper()
  1644. Select Case Int(Rnd*3)+1
  1645. Case 1 : PlaySound "fx_flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1646. Case 2 : PlaySound "fx_flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1647. Case 3 : PlaySound "fx_flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1648. End Select
  1649. End Sub
  1650.  
  1651. Sub LLoopGate_Hit() : RandomSoundMetal() : End Sub
  1652. Sub RLoopGate_Hit() : RandomSoundMetal() :End Sub
  1653.  
  1654. Sub RandomSoundMetal()
  1655. Select Case Int(Rnd*3)+1
  1656. Case 1 : PlaySound "fx_metal_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1657. Case 2 : PlaySound "fx_metal_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1658. Case 3 : PlaySound "fx_metal_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1659. End Select
  1660. End Sub
  1661.  
  1662. '******************************************************************************************
  1663. '* TABLE OPTIONS **************************************************************************
  1664. '******************************************************************************************
  1665.  
  1666. Dim xx,bulb
  1667.  
  1668. ScoopL.visible = ScoopLight
  1669. RailL.visible = DesktopMode
  1670. RailR.visible = DesktopMode
  1671. LeftCab.visible = DesktopMode
  1672. RightCab.visible = DesktopMode
  1673. light58.visible = DesktopMode
  1674. light59.visible = NOT DesktopMode
  1675.  
  1676. If FlipperType = 2 then FlipperType = RndNum(0, 1)
  1677.  
  1678. Select Case FlipperType
  1679. Case 0: FlipperL.image = "flippers white"
  1680. FlipperR.image = "flippers white"
  1681. Case 1: FlipperL.image = "flippers"
  1682. FlipperR.image = "flippers"
  1683. End Select
  1684.  
  1685. For Each xx in BadGuysLights : xx.visible = BadGuysMod : Next
  1686.  
  1687. If ColorMod Then
  1688. For Each bulb in RedGI : bulb.color = RGB (255, 0, 0) : bulb.intensity = 65 : Next
  1689. For Each bulb in GreenGI : bulb.color = RGB (0, 255, 0) : Next
  1690. For Each bulb in BlueGI : bulb.color = RGB (0, 0, 255) : bulb.intensity = 65: Next
  1691. End If
Advertisement
Add Comment
Please, Sign In to add comment