Outhere

Cheech & Chong - Road-Trip'pin_1.0

Aug 3rd, 2021 (edited)
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 62.98 KB | None | 0 0
  1. '
  2. '
  3. '111 - Drop Target Reset for Road Closed
  4. '112 - Car Solenoid and some MX Lights
  5. '113 - Circle at top of ramp Solenoid plus MX lighting
  6. '114 - Circle at top of ramp Solenoid plus MX lighting
  7. '115 - Circle at top of ramp Solenoid plus MX lighting
  8. '116 - Circle at top of ramp Solenoid plus MX lighting
  9. '117 - MX Lights + Shaker
  10. '118 - MX Lights + Shaker
  11. '119 - MX Lighting and Beacon + Shaker
  12. '120 - MX Lighting
  13.  
  14.  
  15. Option Explicit
  16. Randomize
  17.  
  18. Const BallSize = 50
  19. Const BallMass = 1.1
  20.  
  21. On Error Resume Next
  22. ExecuteGlobal GetTextFile("controller.vbs")
  23. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  24. On Error Goto 0
  25.  
  26. Dim x, bsTrough, dtL, dtM, bsLE, bsRI, bsBO
  27.  
  28. Const cGameName = "che_cho"
  29.  
  30. Const UseSolenoids = 2 'Fastflips enabled
  31. Const UseLamps = 0
  32. Const UseGI = 0
  33. Const UseSync = 0 'set it to 1 if the table runs too fast
  34. Const HandleMech = 0
  35.  
  36. Dim VarHidden, UseVPMDMD
  37. If Table1.ShowDT = true then
  38. UseVPMDMD = True
  39. VarHidden = 1
  40. For each x in aReels
  41. x.Visible = 1
  42. Next
  43. else
  44. UseVPMDMD = False
  45. VarHidden = 0
  46. For each x in aReels
  47. x.Visible = 0
  48. Next
  49. lrail.Visible = 0
  50. rrail.Visible = 0
  51. end if
  52.  
  53. if B2SOn = true then VarHidden = 1
  54.  
  55. LoadVPM "01550000", "wpc.vbs", 3.26
  56.  
  57. ' Standard Sounds
  58. Const SSolenoidOn = "fx_solenoidon"
  59. Const SSolenoidOff = "fx_solenoidoff"
  60. Const SCoin = "fx_Coin"
  61.  
  62. '************
  63. ' Table init.
  64. '************
  65.  
  66. Dim startgamesound
  67.  
  68. Sub table1_Init
  69. vpmInit me
  70. With Controller
  71. .GameName = cGameName
  72. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description:Exit Sub
  73. .SplashInfoLine = "Cheech & Chong: Road-Trip'pin (Bally 2021)" & vbNewLine & ""
  74. .HandleKeyboard = 0
  75. .ShowTitle = 0
  76. .ShowDMDOnly = 1
  77. .ShowFrame = 0
  78. .HandleMechanics = 0
  79. .Hidden = VarHidden
  80. .Games(cGameName).Settings.Value("sound") = 1
  81. .Games(cGameName).Settings.Value("rol") = 0 '1= rotated display, 0= normal
  82. '.SetDisplayPosition 0,0, GetPlayerHWnd 'restore dmd window position
  83. On Error Resume Next
  84. Controller.SolMask(0) = 0
  85. vpmTimer.AddTimer 1000, "Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the Timer to renable all the solenoids after 2 seconds
  86. Controller.Run GetPlayerHWnd
  87. On Error Goto 0
  88. End With
  89.  
  90. ' Nudging
  91. vpmNudge.TiltSwitch = 14
  92. vpmNudge.Sensitivity = 3
  93. vpmNudge.TiltObj = Array(Bumper1, Bumper2, Bumper3, LeftSlingshot, RightSlingshot, RightSlingShotTop)
  94.  
  95. ' Trough
  96. set bsTrough = new cvpmBallStack
  97. bsTrough.InitSw 15, 16, 17, 18, 0, 0, 0, 0
  98. bsTrough.InitKick BallRelease, 45, 7
  99. bsTrough.InitExitSnd SoundFX("fx_ballrel", DOFContactors), SoundFX("fx_Solenoid", DOFContactors)
  100. bsTrough.Balls = 3
  101.  
  102. ' Top droptargets
  103. Set dtL = New cvpmDropTarget
  104. dtL.InitDrop Array(sw51, sw52, sw53), Array(51, 52, 53)
  105. dtL.InitSnd SoundFX("", DOFDropTargets), SoundFX("fx_resetdrop", DOFContactors)
  106. dtL.CreateEvents "dtL"
  107.  
  108. ' Mid droptargets
  109. Set dtM = New cvpmDropTarget
  110. dtM.InitDrop Array(sw54, sw55, sw56), Array(54, 55, 56)
  111. dtM.InitSnd SoundFX("", DOFDropTargets), SoundFX("fx_resetdrop", DOFContactors)
  112. dtM.CreateEvents "dtM"
  113.  
  114. ' Left Eject
  115. Set bsLE = New cvpmBallStack
  116. bsLE.InitSaucer sw36, 36, 90, 20
  117. bsLE.InitExitSnd SoundFX("fx_kicker", DOFContactors), SoundFX("fx_Solenoid", DOFContactors)
  118. bsLE.KickAngleVar = 3
  119. bsLE.KickForceVar = 3
  120.  
  121. ' Right Eject
  122. Set bsRI = New cvpmBallStack
  123. bsRI.InitSaucer sw35, 35, 0, 27
  124. bsRI.InitExitSnd SoundFX("fx_kicker", DOFContactors), SoundFX("fx_Solenoid", DOFContactors)
  125. bsRI.KickAngleVar = 3
  126. bsRI.KickForceVar = 3
  127.  
  128. ' Bottom Eject
  129. Set bsBO = New cvpmBallStack
  130. bsBO.InitSaucer sw28, 28, 243, 24
  131. bsBO.InitExitSnd SoundFX("fx_kicker", DOFContactors), SoundFX("fx_Solenoid", DOFContactors)
  132. bsBO.KickZ = 1.5
  133. bsBO.KickAngleVar = 3
  134. bsBO.KickForceVar = 3
  135.  
  136. ' Main Timer init
  137. PinMAMETimer.Interval = PinMAMEInterval
  138. PinMAMETimer.Enabled = 1
  139.  
  140. startgamesound = 1
  141.  
  142. PlaySound "", -1, .05 'adjust the volume using the second parameter.
  143. End Sub
  144.  
  145. 'Road Closed Drop Target
  146.  
  147. Sub RoadClosed_Hit
  148. RoadClosed.TimerEnabled = 1
  149. ' vpmTimer.PulseSw 37
  150. ' vpmTimer.PulseSw 38
  151. PlaySound SoundFX("fx_droptarget", DOFDropTargets), 0, 1, pan(ActiveBall)
  152. PlaySound "fx_horn"
  153. End Sub
  154.  
  155. Sub RoadClosed_Timer
  156. RoadClosed.IsDropped = 0
  157. RoadClosed.TimerEnabled = 0
  158. PlaySound SoundFXDOF("fx_resetdrop", 111,2, DOFContactors)
  159. End Sub
  160.  
  161. Sub table1_Paused:Controller.Pause = 1:End Sub
  162. Sub table1_unPaused:Controller.Pause = 0:End Sub
  163. Sub table1_exit:Controller.stop:End Sub
  164.  
  165. Sub table1_KeyDown(ByVal Keycode)
  166. If keycode = LeftTiltKey Then Nudge 90, 5:PlaySound SoundFX("fx_nudge", 0), 0, 1, -0.1, 0.25
  167. If keycode = RightTiltKey Then Nudge 270, 5:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0.1, 0.25
  168. If keycode = CenterTiltKey Then Nudge 0, 6:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0, 0.25
  169. If keycode = PlungerKey Then PlaySound "fx_PlungerPull", 0, 1, 0.1, 0.25:Plunger.Pullback:PlaySound "fx_idlerev"
  170.  
  171. If KeyCode = startgamekey and startgametimer.enabled = 0 and startgamesound = 1 then
  172. startgamesound = 0
  173. startgametimer.enabled = 1
  174. end if
  175.  
  176. If vpmKeyDown(keycode)Then Exit Sub
  177. End Sub
  178.  
  179. Sub table1_KeyUp(ByVal Keycode)
  180. If vpmKeyUp(keycode)Then Exit Sub
  181. If keycode = PlungerKey Then PlaySound "fx_plunger", 0, 1, 0.1, 0.25:Plunger.Fire
  182. End Sub
  183.  
  184. '***************
  185. ' Clown Shake
  186. '***************
  187. Dim cBall
  188. Set cBall = ckicker.createball
  189. ckicker.Kick 0, 0
  190.  
  191. Sub ClownShake
  192. cball.velx = - 0.65 + RND(1)
  193. cball.vely = - 0.65 + RND(1)
  194. End Sub
  195.  
  196. Sub ClownUpdate
  197. Dim a, b
  198. a = (ckicker.y - cball.y) / 2
  199. b = (cball.x - ckicker.x) / 2
  200. clown1.rotx = a
  201. clown1.rotz = b
  202. clownspring.rotx = a
  203. clownspring.rotz = b
  204. clownshadow.rotx = a
  205. clownshadow.rotz = b
  206. clownwires.rotx = a
  207. clownwires.rotz = b
  208. clownjointlit1.rotx = a
  209. clownjointlit1.rotz = b
  210. End Sub
  211.  
  212. '*********
  213. ' Switches
  214. '*********
  215.  
  216. ' Slings
  217. Dim LStep, RStep
  218.  
  219. Sub LeftSlingShot_Slingshot
  220. PFlmheadlightLeft.duration 0, 200, 1
  221. PFlmheadlightRight.duration 0, 200, 1
  222. lightf25.duration 1, 200, 0
  223. PlaySound SoundFX("fx_slingshot", DOFContactors), 0, 1, -0.05, 0.05
  224. LeftSling4.Visible = 1
  225. Lemk.RotX = 26
  226. LStep = 0
  227. vpmTimer.PulseSw 37
  228. LeftSlingShot.TimerEnabled = 1
  229. End Sub
  230.  
  231. Sub LeftSlingShot_Timer
  232. Select Case LStep
  233. Case 1:LeftSling4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14
  234. Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2
  235. Case 3:LeftSLing2.Visible = 0:Lemk.RotX = -20:LeftSlingShot.TimerEnabled = 0
  236. End Select
  237. LStep = LStep + 1
  238. End Sub
  239.  
  240. Sub RightSlingShot_Slingshot
  241. PFlmheadlightLeft.duration 0, 200, 1
  242. PFlmheadlightRight.duration 0, 200, 1
  243. lightf26.duration 1, 200, 0
  244. PlaySound SoundFX("fx_slingshot", DOFContactors), 0, 1, 0.05, 0.05
  245. RightSling4.Visible = 1
  246. Remk.RotX = 26
  247. RStep = 0
  248. vpmTimer.PulseSw 38
  249. RightSlingShot.TimerEnabled = 1
  250. End Sub
  251.  
  252. Sub RightSlingShot_Timer
  253. Select Case RStep
  254. Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14
  255. Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2
  256. Case 3:RightSLing2.Visible = 0:Remk.RotX = -20:RightSlingShot.TimerEnabled = 0
  257. End Select
  258. RStep = RStep + 1
  259. End Sub
  260.  
  261. Sub RightSlingShotTop_Slingshot
  262. if LoveMachine.rotz = 0 then
  263. RightSlingShotTop.uservalue = -1
  264. LoveMachineTimer.Interval = 10
  265. LoveMachineTimer.Enabled = 1
  266. end if
  267. lightf25.duration 1, 200, 0
  268. lightf26.duration 1, 200, 0
  269. PlaySound SoundFXDOF("fx_lowrider", 112,2,DOFContactors), 0, 1, 0.05, 0.05
  270. RightSling8.Visible = 1
  271. RemkTop.RotX = 26
  272. RStep = 0
  273. ' vpmTimer.PulseSw 37
  274. ' vpmTimer.PulseSw 38
  275. RightSlingShotTop.TimerEnabled = 1
  276. ClownShake
  277. End Sub
  278.  
  279. Sub RightSlingShotTop_Timer
  280. Select Case RStep
  281. Case 1:RightSLing8.Visible = 0:RightSLing7.Visible = 1:RemkTop.RotX = 14
  282. Case 2:RightSLing7.Visible = 0:RightSLing6.Visible = 1:RemkTop.RotX = 2
  283. Case 3:RightSLing6.Visible = 0:RemkTop.RotX = -20:RightSlingShotTop.TimerEnabled = 0
  284. End Select
  285. RStep = RStep + 1
  286. End Sub
  287.  
  288. Sub swtroughlighton_hit
  289. troughlight.state = 1
  290. End Sub
  291.  
  292. Sub swtroughlightoff_hit
  293. troughlight.state = 0
  294. Dim bulb
  295. For each bulb in aGIlights
  296. bulb.state = 1
  297. Next
  298. End Sub
  299.  
  300. Sub factorylightsw_hit
  301. factorylight.duration 1, 5500, 0
  302. End Sub
  303.  
  304. Sub swstrawhouselightsoff_hit
  305. strawhouselightA.duration 0, 100, 0
  306. strawhouselightB.duration 0, 100, 0
  307. PlaySound "fx_balldrophard"
  308. End Sub
  309.  
  310. Sub swstrawhouselightsoff2_hit
  311. strawhouselightA.duration 0, 100, 0
  312. strawhouselightB.duration 0, 100, 0
  313. End Sub
  314.  
  315. Sub billboardlightson_hit
  316. billboardlight1.state = 1
  317. billboardlight2.state = 1
  318. billboardlight3.state = 1
  319. End Sub
  320.  
  321. Sub swpeterrooter_hit
  322. me.uservalue=1
  323. me.timerenabled= 1
  324. Dim w
  325. w = INT(3 * RND(1) )
  326. Select Case w
  327. Case 0:PlaySound"fx_peterrooter"
  328. Case 1:PlaySound"fx_peterrooter"
  329. Case 2:PlaySound""
  330. End Select
  331. End Sub
  332.  
  333. Sub swvanwindowson_hit
  334. vanwindowslight.duration 1, 5200, 0
  335. End Sub
  336.  
  337. Sub culdesacexit_hit
  338. PlaySound "fx_culdesacspinshort"
  339. StopSound "fx_culdesacspin":StopSound "fx_cheechdonuts":StopSound "fx_chongdonuts"
  340. PlaySound "fx_culdesacballdrop"
  341. If Table1.ShowDT then
  342. loopleftlightDT.duration 2, 950, 0
  343. else
  344. loopleftlightCAB.duration 2, 950, 0
  345. end If
  346. end Sub
  347.  
  348. Sub swscooplightRIGHTon_hit
  349. scooplightright.state = 1
  350. boxlight.duration 1, 800, 0
  351. ClownShake
  352. End Sub
  353.  
  354. Sub slyman_hit
  355. me.uservalue=1
  356. me.timerenabled= 1
  357. Dim w
  358. w = INT(2 * RND(1) )
  359. Select Case w
  360. Case 0:PlaySound""
  361. Case 1:PlaySound"fx_ihavehairpiece":gi6.duration 2, 1000, 1:gi42.duration 2, 1000, 1:gi001.duration 2, 1000, 1
  362. End Select
  363. End Sub
  364.  
  365. Sub habib_hit
  366. me.uservalue=1
  367. me.timerenabled= 1
  368. Dim w
  369. w = INT(2 * RND(1) )
  370. Select Case w
  371. Case 0:PlaySound""
  372. Case 1:PlaySound"fx_keeltheball":gi7.duration 2, 1000, 1:gi61.duration 2, 1000, 1:gi002.duration 2, 1000, 1
  373. End Select
  374. End Sub
  375.  
  376. Sub swSisterMaryElephant_hit
  377. if Activeball.vely > 0 then
  378. Dim x
  379. x = INT(8 * RND(1) )
  380. Select Case x
  381. Case 0:PlaySound"fx_Class":SisterMaryLight.duration 2, 1300, 0
  382. Case 1:PlaySound"fx_Shutup":SisterMaryLight.duration 2, 1800, 0
  383. Case 2:PlaySound""
  384. Case 3:PlaySound""
  385. Case 4:PlaySound""
  386. Case 5:PlaySound""
  387. Case 6:PlaySound""
  388. Case 7:PlaySound"fx_Class":SisterMaryLight.duration 2, 1300, 0
  389. End Select
  390. End If
  391. End Sub
  392.  
  393. Sub swBlindMelon_hit
  394. if Activeball.vely > 0 then
  395. Dim y
  396. y = INT(8 * RND(1) )
  397. Select Case y
  398. Case 0:PlaySound"fx_ahyeaow":BlindMelonLight.duration 2, 1150, 0
  399. Case 1:PlaySound"fx_goindowntown":BlindMelonLight.duration 2, 2850, 0
  400. Case 2:PlaySound""
  401. Case 3:PlaySound""
  402. Case 4:PlaySound""
  403. Case 5:PlaySound""
  404. Case 6:PlaySound""
  405. Case 7:PlaySound"fx_ahyeaow":BlindMelonLight.duration 2, 1150, 0
  406. End Select
  407. End If
  408. End Sub
  409.  
  410. Sub swstrawberryshouselit_Hit
  411. strawhouselightA.duration 1, 600, 0
  412. strawhouselightB.duration 1, 600, 0
  413. end sub
  414.  
  415. Sub swfactorylightlit_Hit
  416. factorylight.duration 1, 600, 0
  417. end sub
  418.  
  419. Sub swCuldesacSpinStart_Hit
  420. Playsound "fx_culdesacspin"
  421. end Sub
  422.  
  423. Sub swCuldesacSpinStop_Hit
  424. if Activeball.vely > 0 then
  425. Stopsound "fx_culdesacspin":StopSound "fx_cheechdonuts":StopSound "fx_chongdonuts"
  426. End If
  427. end Sub
  428.  
  429. Sub swCheckpointExitBallDrop_Hit
  430. Playsound "fx_CheckpointExitBallDrop"
  431. end Sub
  432.  
  433. Sub swburnout_hit
  434. if Activeball.vely < 0 then
  435. Dim x
  436. x = INT(6 * RND(1) )
  437. Select Case x
  438. Case 0:PlaySound"fx_burnout"
  439. Case 1:PlaySound"fx_burnout"
  440. Case 2:PlaySound"fx_burnout"
  441. Case 3:PlaySound"fx_burnout"
  442. Case 4:PlaySound"fx_burnout2"
  443. Case 5:PlaySound"fx_burnoutC&C"
  444. End Select
  445. End If
  446. End Sub
  447.  
  448. Sub swCuldesacSpinCorC_hit
  449. if Activeball.vely < 0 then
  450. Dim z
  451. z = INT(4 * RND(1) )
  452. Select Case z
  453. Case 0:PlaySound"fx_cheechdonuts"
  454. Case 1:PlaySound""
  455. Case 2:PlaySound"fx_chongdonuts"
  456. Case 3:PlaySound""
  457. End Select
  458. End If
  459. End Sub
  460.  
  461. Sub drainpostrubber_Hit
  462. DrainpostLEDglow.duration 1, 200, 0
  463. drainpostapronreflection.duration 1, 200, 0
  464. end sub
  465.  
  466. Sub swimpalaleft_Hit
  467. if Activeball.vely < 0 then
  468. Playsound "fx_impalaleft"
  469. End If
  470. end Sub
  471.  
  472. Sub swimpalaright_Hit
  473. if Activeball.vely < 0 then
  474. Playsound "fx_impalaright"
  475. End If
  476. end Sub
  477.  
  478. Sub swbottomleftrubber_Hit
  479. Playsound "fx_ricochet"
  480. end Sub
  481.  
  482. Sub swbottomrightrubber_Hit
  483. Playsound "fx_ricochet"
  484. end Sub
  485.  
  486. '**********************
  487. ' Animations
  488. '**********************
  489.  
  490. ' Love Machine
  491. Sub LoveMachineTimer_timer
  492. LoveMachine.rotz = LoveMachine.rotz + (RightSlingShotTop.uservalue * 0.9)
  493. if LoveMachine.rotz <- 15 Then
  494. RightSlingShotTop.uservalue = 1
  495. end If
  496. if LoveMachine.rotz> 0 Then
  497. LoveMachine.rotz = 0
  498. LoveMachineTimer.Enabled = 0
  499. end if
  500. LoveMachineHeadlights.rotz = LoveMachine.rotz
  501. LoveMachinePlate.rotz = LoveMachine.rotz
  502. LoveMachineShadow.rotx = LoveMachine.rotz
  503. end sub
  504.  
  505. 'Van
  506. Sub swVan_hit
  507. PlaySound "fx_vanservo"
  508. If Van.transx = 0 then
  509. me.uservalue = 1
  510. me.timerenabled = 1
  511. me.timerinterval = 12
  512. End If
  513. end sub
  514.  
  515. Sub swVan_timer
  516. if me.uservalue <12 then
  517. Van.transx = Van.transx - 5.94
  518. elseif me.uservalue <40 then
  519. Van.transx = Van.transx - 5.94
  520. elseif me.uservalue <50 then
  521. Van.transx = Van.transx - 5.94
  522. elseif me.uservalue <150 then
  523. if me.uservalue = 160 then PlaySound ""
  524. if me.uservalue = 170 then gi53.Duration 1, 3300, 0
  525. if me.uservalue = 180 then gi53.Duration 1, 2000, 0
  526. elseif me.uservalue <190 then
  527. Van.transx = Van.transx + 1.3
  528. elseif me.uservalue <200 then
  529. Van.transx = Van.transx + 1.5
  530. else
  531. Van.transx = Van.transx + 1
  532. if Van.transx> 0 Then
  533. Van.transx = 0
  534. me.timerenabled = 0
  535. End If
  536. End If
  537. vanbackshadow.transx = Van.transx
  538. vanbottomshadow.transx = Van.transx
  539. vanwindows.transx = Van.transx
  540. vanventlight.transx = Van.transx
  541. vanheadandtaillights.transx = Van.transx
  542. me.uservalue = me.uservalue + 1
  543. end sub
  544.  
  545. 'Van Kickers
  546. Sub VanKickerEnter_Hit
  547. VanKickerEnter.destroyball
  548. VanKickerEnter.TimerEnabled = 1
  549. DOF 118, 1
  550. End Sub
  551.  
  552. Sub VanKickerEnter_Timer
  553. VanKickerExit.createball
  554. VanKickerEnter.TimerEnabled = 0
  555. DOF 118, 0
  556. PlaySound "fx_balldrop"
  557. DOF 117, 2
  558. End Sub
  559.  
  560. 'Motorcycle Cop
  561. Dim Mpos, MDir
  562. Mpos = 0
  563.  
  564. Sub swMotorcycleCop_hit
  565. If Mpos = 0 then
  566. MDir = 5
  567. Me.timerinterval = 10
  568. vpmtimer.addtimer 2000, "swMotorcycleCop.timerenabled= 1 '"
  569. End If
  570. end sub
  571.  
  572. Sub StartRightAnimations
  573. SaySomething = False
  574. StartHeadAnimations2
  575. End Sub
  576.  
  577. Sub swMotorcycleCop_timer
  578. if Mpos = 600 then gi53.Duration 1, 3300, 0:PlaySound ""
  579. If Mpos = 10 AND Mdir = 5 Then StartRightAnimations:PlaySound "fx_itsacop":DOF 119, 2
  580. Mpos = Mpos + MDir
  581. If MPos> 725 Then MPos = 725:Me.TimerEnabled = 0
  582. RunnerRedLED.State = 2:RunnerRedLEDa.State = 2:RunnerRedLEDb.State = 2:RunnerRedLEDc.State = 2:RunnerRedLEDd.State = 2:RunnerRedLEDe.State = 2:RunnerBlueLED.State = 2:RunnerBlueLEDa.State = 2:RunnerBlueLEDb.State = 2:RunnerBlueLEDc.State = 2:RunnerBlueLEDd.State = 2:RunnerBlueLEDe.State = 2
  583. If Mpos <= 0 Then Mpos = 0:RunnerRedLED.State = 0:RunnerRedLEDa.State = 0:RunnerRedLEDb.State = 0:RunnerRedLEDc.State = 0:RunnerRedLEDd.State = 0:RunnerRedLEDe.State = 0:RunnerBlueLED.State = 0:RunnerBlueLEDa.State = 0:RunnerBlueLEDb.State = 0:RunnerBlueLEDc.State = 0:RunnerBlueLEDd.State = 0:RunnerBlueLEDe.State = 0:Me.TimerEnabled = 0
  584. PlaySound "fx_motorcycleservo"
  585. MotorcycleCop.transx = Mpos
  586. MotorcycleCopScrewA.transx = Mpos
  587. MotorcycleCopScrewB.transx = Mpos
  588. MotorcycleCopBracket.transx = Mpos
  589. end sub
  590.  
  591. Sub sw28_Unhit:MDir = -2.5:RunnerRedLED.State = 0:RunnerRedLEDa.State = 0:RunnerRedLEDb.State = 0:RunnerRedLEDc.State = 0:RunnerRedLEDd.State = 0:RunnerRedLEDe.State = 0:RunnerBlueLED.State = 0:RunnerBlueLEDa.State = 0:RunnerBlueLEDb.State = 0:RunnerBlueLEDc.State = 0:RunnerBlueLEDd.State = 0:RunnerBlueLEDe.State = 0:swMotorcycleCop.timerenabled = 1:End Sub 'restart the animation after the ball is kicked from sw28
  592.  
  593. ' Bumpers
  594. Sub Bumper1_Hit:Playsound "fx_disc1spin":vpmTimer.PulseSw 26:PlaySound "fx_bumper", 0, 1, -0.05:gi1.duration 0, 150, 1:RotDisc1Step = 7:Disc1Timer.Enabled = 1:ClownShake:End Sub
  595. Sub Bumper2_Hit:Playsound "fx_disc2spin":vpmTimer.PulseSw 25:PlaySound "fx_bumper", 0, 1, -0.02:gi17.duration 0, 150, 1:RotDisc2Step = 7:Disc2Timer.Enabled = 1:ClownShake:End Sub
  596. Sub Bumper3_Hit:Playsound "fx_disc3spin":vpmTimer.PulseSw 27:PlaySound "fx_bumper", 0, 1, -0.05:gi3.duration 0, 150, 1:RotDisc3Step = 7:Disc3Timer.Enabled = 1:ClownShake:End Sub
  597.  
  598. ' Bumper Discs
  599. Dim RotDisc1, RotDisc1Step
  600. RotDisc1 = 0
  601. Sub Disc1Timer_Timer
  602. RotDisc1 = (RotDisc1 + RotDisc1Step)MOD 360
  603. disc1.RotY = RotDisc1
  604. disc1screw.RotZ = RotDisc1
  605. RotDisc1Step = RotDisc1Step - 0.05
  606. If RotDisc1Step <1 Then Disc1Timer.Enabled = 0
  607. End Sub
  608.  
  609. Dim RotDisc2, RotDisc2Step
  610. RotDisc2 = 0
  611. Sub Disc2Timer_Timer
  612. RotDisc2 = (RotDisc2 - RotDisc2Step)MOD 360
  613. disc2.RotY = RotDisc2
  614. disc2screw.RotZ = RotDisc2
  615. RotDisc2Step = RotDisc2Step - 0.05
  616. If RotDisc2Step <1 Then Disc2Timer.Enabled = 0
  617. End Sub
  618.  
  619. Dim RotDisc3, RotDisc3Step
  620. RotDisc3 = 0
  621. Sub Disc3Timer_Timer
  622. RotDisc3 = (RotDisc3 - RotDisc3Step)MOD 360
  623. disc3.RotY = RotDisc3
  624. disc3screw.RotZ = RotDisc3
  625. RotDisc3Step = RotDisc3Step - 0.05
  626. If RotDisc3Step <1 Then Disc3Timer.Enabled = 0
  627. End Sub
  628.  
  629. ' CulDeSac
  630. Sub CulDeSac1_Hit:DOF 113,2:culdesac1light.duration 1, 100, 0:End Sub
  631. Sub CulDeSac2_Hit:DOF 114,2:culdesac2light.duration 1, 100, 0:End Sub
  632. Sub CulDeSac3_Hit:DOF 115,2:culdesac3light.duration 1, 100, 0:End Sub
  633. Sub CulDeSac4_Hit:DOF 116,2:culdesac4light.duration 1, 100, 0:End Sub
  634.  
  635. ' Drain & Saucers
  636. Sub Drain_Hit:Playsound "fx_drain":bsTrough.AddBall Me:
  637. gi66.duration 0, 3675, 1
  638. startgamesound = 1
  639. ReturnHeads
  640. End Sub
  641.  
  642. Sub sw28_Hit:PlaySound "fx_kicker_enter":bsBO.AddBall 0:End Sub
  643. Sub sw36_Hit:PlaySound "fx_kicker_enter":bsLE.AddBall 0:End Sub
  644. Sub sw35_Hit:PlaySound "fx_kicker_enter":bsRI.AddBall 0:billboardlight1.state = 0:billboardlight2.state = 0:billboardlight3.state = 0:End Sub
  645.  
  646. Sub CandCprimsReset_Hit
  647. ReturnHeads
  648. End Sub
  649.  
  650. ' Added Kickers
  651. Sub kicker1_Hit
  652. DOF 120,2
  653. PlaySound "fx_hole_enter"
  654. If bsLE.Balls Then
  655. vpmtimer.AddTimer 1000, "PlaySound""fx_popper"": kicker1.kick 165, 35, 1.5: '"
  656. Else
  657. kicker1.Destroyball
  658. sw36.CreateBall
  659. strawhouselightA.state = 1
  660. strawhouselightB.state = 1
  661. scooplightleft.duration 0, 2300, 1
  662. bsLE.AddBall 0
  663. SaySomething = False
  664. StartHeadAnimations
  665. End If
  666. End Sub
  667.  
  668. Sub sw36_UnHit:RotateLeftHead.Enabled = 0:RotateRightHead.Enabled = 0:End Sub
  669.  
  670. ' rotations of heads at sw36 and sw28
  671. Dim LeftDir, LeftStep
  672. Dim RightDir, RightStep
  673. Dim SaySomething
  674. Dim WhatToSay
  675.  
  676. Sub StartHeadAnimations
  677. LeftDir = -1
  678. LeftStep = 0
  679. RightDir = 1.5
  680. RightStep = 0
  681. RotateLeftHead.Interval = 2500
  682. RotateLeftHead.Enabled = 1
  683. End Sub
  684.  
  685. Sub StartHeadAnimations2
  686. LeftDir = -1
  687. LeftStep = 0
  688. RightDir = 1.5
  689. RightStep = 0
  690. RotateLeftHead.Interval = 10
  691. RotateLeftHead.Enabled = 1
  692. End Sub
  693.  
  694. Sub RotateLeftHead_Timer
  695. cheechspotlight.state = 1
  696. cheechspotlightglow.state = 1
  697. LeftStep = LeftStep + LeftDir
  698. RotateLeftHead.Interval = 10
  699. If LeftStep <-40 Then
  700. LeftStep = -40
  701. LeftDir = 1
  702. If SaySomething Then
  703. WhatToSay = INT(RND(1) * 6)
  704. Select Case WhatToSay
  705. Case 0:PlaySound "":RotateLeftHead.Interval = 4000:RotateRightHead.Interval = 2000
  706. Case 1:PlaySound "":RotateLeftHead.Interval = 4000:RotateRightHead.Interval = 2000
  707. Case 2:PlaySound "":RotateLeftHead.Interval = 4000:RotateRightHead.Interval = 2000
  708. Case 3:PlaySound "":RotateLeftHead.Interval = 4000:RotateRightHead.Interval = 2000
  709. Case 4:PlaySound "":RotateLeftHead.Interval = 4000:RotateRightHead.Interval = 2000
  710. Case 5:PlaySound "":RotateLeftHead.Interval = 4000:RotateRightHead.Interval = 2000
  711. End Select
  712. Else
  713. RotateLeftHead.Interval = 4000
  714. RotateRightHead.Interval = 2000
  715. End If
  716. RotateRightHead.Enabled = 1
  717. End If
  718. If LeftStep> 0 Then
  719. LeftStep = 0
  720. RotateLeftHead.Enabled = 0
  721. cheechspotlight.state = 0
  722. cheechspotlightglow.state = 0
  723. End If
  724. CheechHead.RotY = LeftStep
  725. End Sub
  726.  
  727. Sub RotateRightHead_Timer
  728. chongspotlight.state = 1
  729. chongspotlightglowA.state = 1
  730. chongspotlightglowB.state = 1
  731. flasherbirdcage.visible = 1
  732. RightStep = RightStep + RightDir
  733. RotateRightHead.Interval = 10
  734. If RightStep> 40 Then
  735. RightStep = 40
  736. RightDir = -1
  737. If SaySomething Then
  738. Select Case WhatToSay
  739. Case 0:PlaySound "sound1chong":RotateRightHead.Interval = 2000
  740. Case 1:PlaySound "sound2chong":RotateRightHead.Interval = 2000
  741. Case 2:PlaySound "sound3chong":RotateRightHead.Interval = 2000
  742. Case 3:PlaySound "sound4chong":RotateRightHead.Interval = 2000
  743. Case 4:PlaySound "sound5chong":RotateRightHead.Interval = 2000
  744. Case 5:PlaySound "sound6chong":RotateRightHead.Interval = 2000
  745. End Select
  746. Else
  747. RotateRightHead.Interval = 2000
  748. End If
  749. End If
  750. If RightStep <0 Then
  751. RightStep = 0
  752. RotateRightHead.Enabled = 0
  753. chongspotlight.state = 0
  754. chongspotlightglowA.state = 0
  755. chongspotlightglowB.state = 0
  756. flasherbirdcage.visible = 0
  757. End If
  758. ChongHead.RotY = RightStep
  759. End Sub
  760.  
  761. Sub kicker2_Hit
  762. PlaySound "fx_hole_enter"
  763. scooplightright.state = 0
  764. If bsBO.Balls Then
  765. kicker2.kick 0, 16
  766. Else
  767. kicker2.Destroyball
  768. sw28.CreateBall
  769. bsBO.AddBall 0
  770. End If
  771. End Sub
  772.  
  773. 'Lower gates sound and head rotations
  774.  
  775. Dim GateSoundActivated
  776. GateSoundActivated = False
  777.  
  778. Sub Gate1a_Hit:GateSoundActivated = True:End Sub
  779.  
  780. Sub Gate1b_Hit
  781. If GateSoundActivated Then
  782. Dim w
  783. w = INT(4 * RND(1) )
  784. Select Case w
  785. Case 0:PlaySound "fx_saveyourballs", 0, 1, 0.1, 0.05
  786. GateSoundActivated = False
  787. ' rotate Chong
  788. SaySomething = True
  789. RightDir = -.75
  790. RightStep = 0
  791. RotateChong.Interval = 10
  792. RotateChong.Enabled = 1
  793. Case 1:PlaySound "fx_saveyourballs", 0, 1, 0.1, 0.05
  794. GateSoundActivated = False
  795. ' rotate Chong
  796. SaySomething = True
  797. RightDir = -.75
  798. RightStep = 0
  799. RotateChong.Interval = 10
  800. RotateChong.Enabled = 1
  801. Case 2:PlaySound"fx_bottomgate"
  802. Case 3:PlaySound"fx_bottomgate"
  803. End Select
  804. End If
  805. End Sub
  806.  
  807. Sub RotateChong_Timer
  808. chongspotlight.state = 1
  809. chongspotlightglowA.state = 1
  810. chongspotlightglowB.state = 1
  811. flasherbirdcage.visible = 1
  812. RightStep = RightStep + RightDir
  813. RotateChong.Interval = 10
  814. If RightStep <-15 Then
  815. RightStep = -15
  816. RightDir = 1
  817. If SaySomething Then
  818. WhatToSay = INT(RND(1) * 4)
  819. Select Case WhatToSay
  820. Case 0:PlaySound "sound5chong":RotateChong.Interval = 2000
  821. Case 1:PlaySound "sound6chong":RotateChong.Interval = 2000
  822. Case 2:PlaySound "sound7chong":RotateChong.Interval = 2000
  823. Case 3:PlaySound "sound8chong":RotateChong.Interval = 2000
  824. End Select
  825. End If
  826. End If
  827. If RightStep> 0 Then
  828. RightStep = 0
  829. RotateChong.Enabled = 0
  830. chongspotlight.state = 0
  831. chongspotlightglowA.state = 0
  832. chongspotlightglowB.state = 0
  833. flasherbirdcage.visible = 0
  834. End If
  835. ChongHead.RotY = RightStep
  836. End Sub
  837.  
  838. Sub Gate3a_Hit:GateSoundActivated = True:End Sub
  839.  
  840. Sub Gate3b_Hit
  841. If GateSoundActivated Then
  842. Dim w
  843. w = INT(4 * RND(1) )
  844. Select Case w
  845. Case 0:PlaySound "fx_nicebankchot", 0, 1, -0.1, 0.05
  846. GateSoundActivated = False
  847. ' rotate Cheech
  848. SaySomething = True
  849. LeftDir = .75
  850. LeftStep = 0
  851. RotateCheech.Interval = 10
  852. RotateCheech.Enabled = 1
  853. Case 1:PlaySound "fx_nicebankchot", 0, 1, -0.1, 0.05
  854. GateSoundActivated = False
  855. ' rotate Cheech
  856. SaySomething = True
  857. LeftDir = .75
  858. LeftStep = 0
  859. RotateCheech.Interval = 10
  860. RotateCheech.Enabled = 1
  861. Case 2:PlaySound"fx_bottomgate"
  862. Case 3:PlaySound"fx_bottomgate"
  863. End Select
  864. End If
  865. End Sub
  866.  
  867. Sub RotateCheech_Timer
  868. cheechspotlight.state = 1
  869. cheechspotlightglow.state = 1
  870. LeftStep = LeftStep + LeftDir
  871. RotateCheech.Interval = 10
  872. If LeftStep> 15 Then
  873. LeftStep = 15
  874. LeftDir = -1
  875. If SaySomething Then
  876. WhatToSay = INT(RND(1) * 4)
  877. Select Case WhatToSay
  878. Case 0:PlaySound "sound5cheech":RotateCheech.Interval = 2500
  879. Case 1:PlaySound "sound6cheech":RotateCheech.Interval = 2500
  880. Case 2:PlaySound "sound7cheech":RotateCheech.Interval = 2500
  881. Case 3:PlaySound "sound8cheech":RotateCheech.Interval = 2500
  882. End Select
  883. End If
  884. End If
  885. If LeftStep <0 Then
  886. LeftStep = 0
  887. RotateCheech.Enabled = 0
  888. cheechspotlight.state = 0
  889. cheechspotlightglow.state = 0
  890. End If
  891. CheechHead.RotY = LeftStep
  892. End Sub
  893.  
  894. ' After a drain, ensure the heads are all in the rest position
  895. Sub ReturnHeads
  896. LeftDir = 0
  897. RightDir = 0
  898. If CheechHead.RotY > 0 Then LeftDir = -1
  899. If CheechHead.RotY < 0 Then LeftDir = 1
  900. If ChongHead.RotY > 0 Then RightDir = -1
  901. If ChongHead.RotY < 0 Then RightDir = 1
  902. Resetheads.Interval = 10
  903. Resetheads.Enabled = 1
  904. cheechspotlight.state = 0
  905. cheechspotlightglow.state = 0
  906. chongspotlight.state = 0
  907. chongspotlightglowA.state = 0
  908. chongspotlightglowB.state = 0
  909. flasherbirdcage.visible = 0
  910. End Sub
  911.  
  912. Sub ResetHeads_Timer
  913. If CheechHead.RotY = 0 AND ChongHead.RotY = 0 Then
  914. ResetHeads.Enabled = 0
  915. End If
  916. If CheechHead.RotY <> 0 Then CheechHead.RotY = CheechHead.RotY + LeftDir
  917. If ChongHead.RotY <> 0 Then ChongHead.RotY = ChongHead.RotY + RightDir
  918. End Sub
  919.  
  920. Sub startgametimer_timer '****make random sound for starting game
  921. Dim v
  922. if l0.state = 1 then
  923. v = INT(6 * RND(1))
  924. Select Case v
  925. Case 0:PlaySound "fx_davesnothere"
  926. Case 1:PlaySound ""
  927. Case 2:PlaySound ""
  928. Case 3:PlaySound "fx_letspartyman"
  929. Case 4:PlaySound ""
  930. Case 5:PlaySound ""
  931. End Select
  932. End If
  933. me.enabled = 0
  934. End Sub
  935.  
  936. ' Rollovers
  937. Sub sw31_Hit:Controller.Switch(31) = 1:PlaySound "fx_sensor", 0, 1, pan(ActiveBall):End Sub
  938. Sub sw31_UnHit:Controller.Switch(31) = 0:End Sub
  939.  
  940. Sub sw32_Hit:Controller.Switch(32) = 1:PlaySound "fx_sensor", 0, 1, pan(ActiveBall):End Sub
  941. Sub sw32_UnHit:Controller.Switch(32) = 0:End Sub
  942.  
  943. Sub sw33_Hit:Controller.Switch(33) = 1:PlaySound "fx_sensor", 0, 1, pan(ActiveBall):End Sub
  944. Sub sw33_UnHit:Controller.Switch(33) = 0:End Sub
  945.  
  946. Sub sw34_Hit:Controller.Switch(34) = 1:PlaySound "fx_sensor", 0, 1, pan(ActiveBall):End Sub
  947. Sub sw34_UnHit:Controller.Switch(34) = 0:End Sub
  948.  
  949. Sub sw74_Hit:Controller.Switch(74) = 1:PlaySound "fx_sensor", 0, 1, pan(ActiveBall):End Sub
  950. Sub sw74_UnHit:Controller.Switch(74) = 0:End Sub
  951.  
  952. Sub sw73_Hit:Controller.Switch(73) = 1:PlaySound "fx_sensor", 0, 1, pan(ActiveBall):End Sub
  953. Sub sw73_UnHit:Controller.Switch(73) = 0:End Sub
  954.  
  955. Sub sw41_Hit:Controller.Switch(41) = 1:PlaySound "fx_sensor", 0, 1, pan(ActiveBall):End Sub
  956. Sub sw41_UnHit:Controller.Switch(41) = 0:End Sub
  957.  
  958. Sub sw42_Hit:Controller.Switch(42) = 1:PlaySound "fx_sensor", 0, 1, pan(ActiveBall):End Sub
  959. Sub sw42_UnHit:Controller.Switch(42) = 0:End Sub
  960.  
  961. Sub sw43_Hit:Controller.Switch(43) = 1:PlaySound "fx_sensor", 0, 1, pan(ActiveBall):End Sub
  962. Sub sw43_UnHit:Controller.Switch(43) = 0:End Sub
  963.  
  964. Sub sw72_Hit:Controller.Switch(72) = 1:PlaySound "fx_sensor", 0, 1, pan(ActiveBall):End Sub
  965. Sub sw72_UnHit:Controller.Switch(72) = 0:End Sub
  966.  
  967. Sub sw71_Hit:Controller.Switch(71) = 1:PlaySound "fx_sensor", 0, 1, pan(ActiveBall):End Sub
  968. Sub sw71_UnHit:Controller.Switch(71) = 0:End Sub
  969.  
  970. Sub sw75_Hit:Controller.Switch(75) = 1:PlaySound "fx_sensor", 0, 1, pan(ActiveBall):
  971. Dim bulb
  972. For each bulb in aGIlights
  973. bulb.state = 0
  974. Next
  975. End Sub
  976. Sub sw75_UnHit:Controller.Switch(75) = 0:End Sub
  977.  
  978. Sub swLocationAdvanceLeft
  979. if Activeball.vely > 0 then
  980. vpmTimer.PulseSw 68
  981. PlaySound ""
  982. End if
  983. End Sub
  984.  
  985. Sub swLocationAdvanceRight
  986. if Activeball.vely > 0 then
  987. vpmTimer.PulseSw 67
  988. PlaySound ""
  989. End if
  990. End Sub
  991.  
  992. ' Spinners
  993. Sub Spinner1_Spin
  994. PlaySound "fx_spinner", 0, 1, -0.05
  995. End Sub
  996.  
  997. Sub Spinner2_Spin
  998. PlaySound "fx_spinner", 0, 1, 0.05
  999. End Sub
  1000.  
  1001. 'Targets
  1002. Sub sw57_Hit:vpmTimer.PulseSw 57:PlaySound SoundFX("fx_target", DOFDropTargets), 0, 1, pan(ActiveBall):End Sub
  1003. Sub sw58_Hit:vpmTimer.PulseSw 58:PlaySound SoundFX("fx_target", DOFDropTargets), 0, 1, pan(ActiveBall):End Sub
  1004. Dim sw61Hits:sw61Hits = 0
  1005. Sub sw61_Hit:vpmTimer.PulseSw 61:PlaySound SoundFX("fx_target", DOFDropTargets), 0, 1, pan(ActiveBall):
  1006. sw61Hits = sw61Hits + 1
  1007. If sw61Hits = 1 Then
  1008. me.uservalue=1
  1009. me.timerenabled= 1
  1010. Dim w
  1011. w = INT(7 * RND(1) )
  1012. Select Case w
  1013. Case 0:PlaySound"fx_thatsheavy":CheechSpotlight.duration 1, 1500, 0:CheechSpotlightglow.duration 1, 1500, 0
  1014. Case 1:PlaySound"fx_wowman":CheechSpotlight.duration 1, 1350, 0:CheechSpotlightglow.duration 1, 1350, 0
  1015. Case 2:PlaySound"fx_cheechlaugh":CheechSpotlight.duration 1, 1400, 0:CheechSpotlightglow.duration 1, 1400, 0
  1016. Case 3:PlaySound""
  1017. Case 4:PlaySound""
  1018. Case 5:PlaySound""
  1019. Case 6:PlaySound""
  1020. End Select
  1021. sw61Hits = 0
  1022. End If
  1023. End Sub
  1024. Sub sw62_Hit:vpmTimer.PulseSw 62:PlaySound SoundFX("fx_target", DOFDropTargets), 0, 1, pan(ActiveBall):End Sub
  1025. Sub sw63_Hit:vpmTimer.PulseSw 63:PlaySound SoundFX("fx_target", DOFDropTargets), 0, 1, pan(ActiveBall):End Sub
  1026.  
  1027. 'Sounds of Characters
  1028. Dim sw64Hits:sw64Hits = 0
  1029. Dim sw65Hits:sw65Hits = 0
  1030. Dim swCousinRedHits:swCousinRedHits = 0
  1031. Dim swSargeantStedankoHits:swSargeantStedankoHits = 0
  1032.  
  1033. Sub sw64_Hit
  1034. vpmTimer.PulseSw 64
  1035. PlaySound SoundFX("fx_target", DOFDropTargets), 0, 1, pan(ActiveBall)
  1036. sw64Hits = sw64Hits + 1
  1037. If sw64Hits = 6 Then
  1038. me.uservalue=1
  1039. me.timerenabled= 1
  1040. Dim w
  1041. w = INT(2 * RND(1) )
  1042. Select Case w
  1043. Case 0:PlaySound"fx_wherehaveyoubeen":AjaxGirlLight.duration 2, 1900, 0
  1044. Case 1:PlaySound"fx_girlduck":AjaxGirlLight.duration 2, 2500, 0
  1045. End Select
  1046. sw64Hits = 0
  1047. End If
  1048. End Sub
  1049.  
  1050. Sub sw65_Hit
  1051. vpmTimer.PulseSw 65
  1052. PlaySound SoundFX("fx_target", DOFDropTargets), 0, 1, pan(ActiveBall)
  1053. sw65Hits = sw65Hits + 1
  1054. If sw65Hits = 6 Then
  1055. me.uservalue=1
  1056. me.timerenabled= 1
  1057. Dim w
  1058. w = INT(2 * RND(1) )
  1059. Select Case w
  1060. Case 0:PlaySound"fx_whatyoulookinat":StrawberryLight.duration 2, 1200, 0
  1061. Case 1:PlaySound"fx_greatoutdoors":StrawberryLight.duration 2, 2900, 0
  1062. End Select
  1063. sw65Hits = 0
  1064. End If
  1065. End Sub
  1066.  
  1067. Sub sw66_Hit
  1068. vpmTimer.PulseSw 66
  1069. PlaySound SoundFX("fx_target", DOFDropTargets), 0, 1, pan(ActiveBall)
  1070. sw66Hits = sw66Hits + 1
  1071. If sw66Hits = 10 Then
  1072. StartBirdAnimations
  1073. sw66Hits = 0
  1074. Playsound "fx_itsabirdman"
  1075. End If
  1076. End Sub
  1077.  
  1078. Sub swCousinRed_Hit
  1079. swCousinRedHits = swCousinRedHits + 1
  1080. If swCousinRedHits = 6 Then
  1081. me.uservalue=1
  1082. me.timerenabled= 1
  1083. Dim w
  1084. w = INT(2 * RND(1) )
  1085. Select Case w
  1086. Case 0:PlaySound"fx_callmered":CousinRedLight.duration 2, 1550, 0
  1087. Case 1:PlaySound"fx_holysheepshit":CousinRedLight.duration 2, 3000, 0
  1088. End Select
  1089. swCousinRedHits = 0
  1090. End If
  1091. End Sub
  1092.  
  1093. Sub swSargeantStedanko_Hit
  1094. swSargeantStedankoHits = swSargeantStedankoHits + 1
  1095. If swSargeantStedankoHits = 3 Then
  1096. me.uservalue=1
  1097. me.timerenabled= 1
  1098. Dim w
  1099. w = INT(2 * RND(1) )
  1100. Select Case w
  1101. Case 0:PlaySound"fx_shootthemoon":SargeantStedankoLight.duration 2, 1400, 0
  1102. Case 1:PlaySound"fx_sargeantstedanko":SargeantStedankoLight.duration 2, 1500, 0
  1103. End Select
  1104. swSargeantStedankoHits = 0
  1105. End If
  1106. End Sub
  1107.  
  1108. ' rotations of Chong and the bird at sw66
  1109. Dim sw66Hits:sw66Hits = 0
  1110. Dim ChongDir2, ChongStep2
  1111. Dim BirdDir, BirdStep
  1112.  
  1113. Sub StartBirdAnimations
  1114. ChongDir2 = -1
  1115. ChongStep2 = 0
  1116. BirdDir = 2
  1117. BirdStep = 0
  1118. RotateChong2.Interval = 10
  1119. RotateChong2.Enabled = 1
  1120. End Sub
  1121.  
  1122. Sub RotateChong2_Timer
  1123. chongspotlight.state = 1
  1124. chongspotlightglowA.state = 1
  1125. chongspotlightglowB.state = 1
  1126. flasherbirdcage.visible = 1
  1127. ChongStep2 = ChongStep2 + ChongDir2
  1128. RotateChong2.Interval = 10
  1129. If ChongStep2 <-40 Then
  1130. ChongStep2 = -40
  1131. ChongDir2 = 1
  1132. PlaySound "ChongSaysSomething"
  1133. RotateChong2.Interval = 6000
  1134. RotateBird.Interval = 3000
  1135. RotateBird.Enabled = 1
  1136. End If
  1137. If ChongStep2> 0 Then
  1138. ChongStep2 = 0
  1139. RotateChong2.Enabled = 0
  1140. chongspotlight.state = 0
  1141. chongspotlightglowA.state = 0
  1142. chongspotlightglowB.state = 0
  1143. flasherbirdcage.visible = 0
  1144. End If
  1145. ChongHead.RotY = ChongStep2
  1146. End Sub
  1147.  
  1148. Sub RotateBird_Timer
  1149. birdlight.State = 1
  1150. BirdStep = BirdStep + BirdDir
  1151. RotateBird.Interval = 10
  1152. If BirdStep> 118 Then
  1153. BirdStep = 118
  1154. BirdDir = -2
  1155. PlaySound "BirdSaysSomething"
  1156. RotateBird.Interval = 2500
  1157. End If
  1158. If BirdStep <0 Then
  1159. BirdStep = 0
  1160. RotateBird.Enabled = 0
  1161. birdlight.State = 0
  1162. End If
  1163. Bird.RotY = BirdStep
  1164. End Sub
  1165.  
  1166. 'Droptargets (only sound effect)
  1167.  
  1168. Sub sw51_Hit:PlaySound SoundFX("fx_droptarget", DOFDropTargets), 0, 1, pan(ActiveBall):End Sub
  1169.  
  1170. Dim sw52Hits:sw52Hits = 0
  1171. Sub sw52_Hit:PlaySound SoundFX("fx_droptarget", DOFDropTargets), 0, 1, pan(ActiveBall):
  1172. sw52Hits = sw52Hits + 1
  1173. If sw52Hits = 1 Then
  1174. me.uservalue=1
  1175. me.timerenabled= 1
  1176. Dim w
  1177. w = INT(7 * RND(1) )
  1178. Select Case w
  1179. Case 0:PlaySound"fx_imtrippin":ChongSpotlight.duration 1, 1650, 0:ChongSpotlightglowA.duration 1, 1650, 0:ChongSpotlightglowB.duration 1, 1650, 0
  1180. Case 1:PlaySound"fx_chonglaughA":ChongSpotlight.duration 1, 1000, 0:ChongSpotlightglowA.duration 1, 1000, 0:ChongSpotlightglowB.duration 1, 1000, 0
  1181. Case 2:PlaySound"fx_chonglaughB":ChongSpotlight.duration 1, 1200, 0:ChongSpotlightglowA.duration 1, 1200, 0:ChongSpotlightglowB.duration 1, 1200, 0
  1182. Case 3:PlaySound""
  1183. Case 4:PlaySound""
  1184. Case 5:PlaySound""
  1185. Case 6:PlaySound""
  1186. End Select
  1187. sw52Hits = 0
  1188. End If
  1189. End Sub
  1190.  
  1191. Sub sw53_Hit:PlaySound SoundFX("fx_droptarget", DOFDropTargets), 0, 1, pan(ActiveBall):End Sub
  1192.  
  1193. Sub sw54_Hit:
  1194. PlaySound SoundFX("fx_droptarget", DOFDropTargets), 0, 1, pan(ActiveBall)
  1195. :Playsound "fx_popcorn":projector1a.duration 1, 5000, 0:projector1b.duration 1, 5000, 0
  1196. :projector2int.duration 1, 5000, 0:gi59.duration 1, 5000, 0:
  1197. me.uservalue=1
  1198. me.timerenabled= 1
  1199. Dim w
  1200. w = INT(6 * RND(1) )
  1201. Select Case w
  1202. Case 0:PlaySound"fx_snackbarclosed"
  1203. Case 1:PlaySound""
  1204. Case 2:PlaySound""
  1205. Case 3:PlaySound""
  1206. Case 4:PlaySound""
  1207. Case 5:PlaySound""
  1208. End Select
  1209. End Sub
  1210.  
  1211. Sub sw55_Hit:
  1212. PlaySound SoundFX("fx_droptarget", DOFDropTargets), 0, 1, pan(ActiveBall)
  1213. :Playsound "fx_slurp":projector1a.duration 1, 5000, 0:projector1b.duration 1, 5000, 0
  1214. :projector2bug.duration 1, 5000, 0:gi59.duration 1, 5000, 0:
  1215. me.uservalue=1
  1216. me.timerenabled= 1
  1217. Dim w
  1218. w = INT(6 * RND(1) )
  1219. Select Case w
  1220. Case 0:PlaySound"fx_buggery"
  1221. Case 1:PlaySound""
  1222. Case 2:PlaySound""
  1223. Case 3:PlaySound""
  1224. Case 4:PlaySound""
  1225. Case 5:PlaySound""
  1226. End Select
  1227. End Sub
  1228.  
  1229. Sub sw56_Hit:
  1230. PlaySound SoundFX("fx_droptarget", DOFDropTargets), 0, 1, pan(ActiveBall)
  1231. :Playsound "fx_bite":projector1a.duration 1, 5000, 0:projector1b.duration 1, 5000, 0
  1232. :projector2cha.duration 1, 5000, 0:gi59.duration 1, 5000, 0:
  1233. me.uservalue=1
  1234. me.timerenabled= 1
  1235. Dim w
  1236. w = INT(7 * RND(1) )
  1237. Select Case w
  1238. Case 0:PlaySound"fx_mrtaylor"
  1239. Case 1:PlaySound""
  1240. Case 2:PlaySound""
  1241. Case 3:PlaySound""
  1242. Case 4:PlaySound""
  1243. Case 5:PlaySound""
  1244. Case 6:PlaySound""
  1245. End Select
  1246. End Sub
  1247.  
  1248. '*********
  1249. 'Solenoids
  1250. '*********
  1251.  
  1252. SolCallback(1) = "bsTrough.SolIn"
  1253. SolCallback(2) = "bsTrough.SolOut"
  1254. SolCallback(3) = "dtL.SolDropUp"
  1255. SolCallback(4) = "dtM.SolDropUp"
  1256. SolCallback(7) = "vpmSolSound""fx_knocker"","
  1257. SolCallback(9) = "bsBO.SolOut"
  1258. SolCallback(10) = "bsRI.SolOut"
  1259. SolCallback(11) = "bsLE.SolOut"
  1260. SolCallback(12) = "RGate.Open ="
  1261. SolCallback(13) = "LGate.Open ="
  1262.  
  1263. 'Flashers
  1264. SolCallback(17) = "SetLamp 117,"
  1265. SolCallback(18) = "SetLamp 118,"
  1266. SolCallback(19) = "SetLamp 119,"
  1267. SolCallback(20) = "SetLamp 120,"
  1268. SolCallback(21) = "SetLamp 121,"
  1269. SolCallback(22) = "SetLamp 122,"
  1270. SolCallback(23) = "SetLamp 123,"
  1271. SolCallback(24) = "SetLamp 124,"
  1272. SolCallback(25) = "SetLamp 125,"
  1273. SolCallback(26) = "SetLamp 126,"
  1274. SolCallback(28) = "SetLamp 128,"
  1275.  
  1276.  
  1277. '****************************
  1278. ' FLASHERS
  1279. '****************************
  1280.  
  1281. Sub FlasherTimer_Timer
  1282. if f20.state = 1 then
  1283. GreenLightlitLEFT.visible = 1
  1284. else
  1285. GreenLightlitLEFT.visible = 0
  1286. end If
  1287.  
  1288. if f19.state = 1 then
  1289. GreenLightlitRIGHT.visible = 1
  1290. else
  1291. GreenLightlitRIGHT.visible = 0
  1292. end If
  1293.  
  1294. if li85.state = 1 then
  1295. PedroSpotlight.visible = 1
  1296. ManSpotlight.visible = 1
  1297. RightSpotlight.visible = 1
  1298. PedroSpotlightLight.state = 1
  1299. ManSpotlightLight.state = 1
  1300. RightSpotlightLight.state = 1
  1301. else
  1302. PedroSpotlight.visible = 0
  1303. ManSpotlight.visible = 0
  1304. RightSpotlight.visible = 0
  1305. PedroSpotlightLight.state = 0
  1306. ManSpotlightLight.state = 0
  1307. RightSpotlightLight.state = 0
  1308. end If
  1309.  
  1310. if projector2int.state = 1 then
  1311. intermission.visible = 1
  1312. snackbardoorsint.visible = 1
  1313. else
  1314. intermission.visible = 0
  1315. snackbardoorsint.visible = 0
  1316. end If
  1317.  
  1318. if projector2bug.state = 1 then
  1319. buggery.visible = 1
  1320. snackbardoorsbug.visible = 1
  1321. else
  1322. buggery.visible = 0
  1323. snackbardoorsbug.visible = 0
  1324. end If
  1325.  
  1326. if projector2cha.state = 1 then
  1327. charliechan.visible = 1
  1328. snackbardoorscha.visible = 1
  1329. else
  1330. charliechan.visible = 0
  1331. snackbardoorscha.visible = 0
  1332. end If
  1333.  
  1334. if roadclosed.isdropped then
  1335. roadclosedflash.visible = 0
  1336. roadclosedlight.state = 0
  1337. else
  1338. roadclosedflash.visible = 1
  1339. roadclosedlight.state = 1
  1340. end If
  1341.  
  1342. if troughlight.state = 1 then
  1343. apronplungerglow.state = 1
  1344. plungerglow.state = 1
  1345. ballguardglow.visible = 1
  1346. else
  1347. apronplungerglow.state = 0
  1348. plungerglow.state = 0
  1349. ballguardglow.visible = 0
  1350. end If
  1351.  
  1352. if factorylight.state = 1 then
  1353. factorywindows.visible = 1
  1354. gi24.state = 1
  1355. factorywindowslight.state = 1
  1356. factorywindowslightglow.state = 1
  1357. factorybackwallglow.visible = 1
  1358. factorywallglow.visible = 1
  1359. watertowerglow.visible = 1
  1360. else
  1361. factorywindows.visible = 0
  1362. gi24.state = 0
  1363. factorywindowslight.state = 0
  1364. factorywindowslightglow.state = 0
  1365. factorybackwallglow.visible = 0
  1366. factorywallglow.visible = 0
  1367. watertowerglow.visible = 0
  1368. end If
  1369.  
  1370. if li33.state = 1 then
  1371. CuldesacLight.state = 1
  1372. else
  1373. CuldesacLight.state = 0
  1374. end If
  1375.  
  1376. if culdesac1light.state = 1 then
  1377. culdesac1glow.state = 1
  1378. culdesac1flash.visible = 1
  1379. else
  1380. culdesac1glow.state = 0
  1381. culdesac1flash.visible = 0
  1382. end If
  1383.  
  1384. if culdesac2light.state = 1 then
  1385. culdesac2glow.state = 1
  1386. else
  1387. culdesac2glow.state = 0
  1388. end If
  1389.  
  1390. if culdesac3light.state = 1 then
  1391. culdesac3glow.state = 1
  1392. else
  1393. culdesac3glow.state = 0
  1394. end If
  1395.  
  1396. if culdesac4light.state = 1 then
  1397. culdesac4glow.state = 1
  1398. culdesac4flash.visible = 1
  1399. else
  1400. culdesac4glow.state = 0
  1401. culdesac4flash.visible = 0
  1402. end If
  1403.  
  1404. if li63.state = 1 then
  1405. checkpointlight2.state = 1
  1406. else
  1407. checkpointlight2.state = 0
  1408. end If
  1409.  
  1410. if cheechspotlight.state = 1 then
  1411. cheechbody.image = "Cheech Body Lit"
  1412. cheechhead.image = "Cheech Head Lit"
  1413. else
  1414. cheechbody.image = "Cheech Body"
  1415. cheechhead.image = "Cheech Head"
  1416. end If
  1417.  
  1418. if chongspotlight.state = 1 then
  1419. chongbody.image = "Chongbodylit"
  1420. chonghead.image = "Chongheadlit"
  1421. flasherbirdcage.visible = 1
  1422. else
  1423. chongbody.image = "Chong Body"
  1424. chonghead.image = "Chong Head"
  1425. flasherbirdcage.visible = 0
  1426. end If
  1427.  
  1428. if strawhouselightB.state = 1 then
  1429. strawhousechimlight.state = 1
  1430. strawhousechimlightflasher.visible = 1
  1431. strawhouseflasher.visible = 1
  1432. strawberryhousewindows.visible = 1
  1433. else
  1434. strawhousechimlight.state = 0
  1435. strawhousechimlightflasher.visible = 0
  1436. strawhouseflasher.visible = 0
  1437. strawberryhousewindows.visible = 0
  1438. end If
  1439.  
  1440. if billboardlight1.state = 1 then
  1441. flasherbillboard1A.visible = 1
  1442. flasherbillboard1B.visible = 1
  1443. flasherbillboard1bottom.visible = 1
  1444. else
  1445. flasherbillboard1A.visible = 0
  1446. flasherbillboard1B.visible = 0
  1447. flasherbillboard1bottom.visible = 0
  1448. end If
  1449.  
  1450. if billboardlight2.state = 1 then
  1451. flasherbillboard2A.visible = 1
  1452. flasherbillboard2B.visible = 1
  1453. flasherbillboard2bottom.visible = 1
  1454. else
  1455. flasherbillboard2A.visible = 0
  1456. flasherbillboard2B.visible = 0
  1457. flasherbillboard2bottom.visible = 0
  1458. end If
  1459.  
  1460. if billboardlight3.state = 1 then
  1461. flasherbillboard3A.visible = 1
  1462. flasherbillboard3B.visible = 1
  1463. flasherbillboard3bottom.visible = 1
  1464. else
  1465. flasherbillboard3A.visible = 0
  1466. flasherbillboard3B.visible = 0
  1467. flasherbillboard3bottom.visible = 0
  1468. end If
  1469.  
  1470. if birdlight.state = 1 then
  1471. bird.Image = "birdlit"
  1472. flasherinsidebirdcageglowRIGHT.visible = 1
  1473. flasherinsidebirdcageglowLEFT.visible = 1
  1474. else
  1475. bird.Image = "bird"
  1476. flasherinsidebirdcageglowRIGHT.visible = 0
  1477. flasherinsidebirdcageglowLEFT.visible = 0
  1478. end If
  1479.  
  1480. if vanwindowslight.state = 1 then
  1481. vanwindows.visible = 1
  1482. vanventlight.visible = 1
  1483. vanheadandtaillights.visible = 1
  1484. else
  1485. vanwindows.visible = 0
  1486. vanventlight.visible = 0
  1487. vanheadandtaillights.visible = 0
  1488. end If
  1489.  
  1490. if gi57.state = 1 then
  1491. LoveMachineHeadlights.visible = 1
  1492. else
  1493. LoveMachineHeadlights.visible = 0
  1494. end If
  1495.  
  1496. if lightf21.state = 1 then
  1497. f21bulblit.visible = 1
  1498. else
  1499. f21bulblit.visible = 0
  1500. end If
  1501.  
  1502. if scooplightleft.state = 1 then
  1503. ScooplightLEFTlit.visible = 1
  1504. else
  1505. ScooplightLEFTlit.visible = 0
  1506. end If
  1507.  
  1508. if scooplightright.state = 1 then
  1509. ScooplightRIGHTlit.visible = 1
  1510. else
  1511. ScooplightRIGHTlit.visible = 0
  1512. end If
  1513.  
  1514. if gi18.state = 1 then
  1515. targetshadow.visible = 1
  1516. else
  1517. targetshadow.visible = 0
  1518. end If
  1519.  
  1520. if sw56.isdropped then
  1521. sw56DTshadow.visible = 0
  1522. else
  1523. sw56DTshadow.visible = 1
  1524. end If
  1525.  
  1526. if sw55.isdropped then
  1527. sw55DTshadow.visible = 0
  1528. else
  1529. sw55DTshadow.visible = 1
  1530. end If
  1531.  
  1532. if sw54.isdropped then
  1533. sw54DTshadow.visible = 0
  1534. else
  1535. sw54DTshadow.visible = 1
  1536. end If
  1537.  
  1538. if sw53.isdropped then
  1539. sw53DTshadow.visible = 0
  1540. else
  1541. sw53DTshadow.visible = 1
  1542. end If
  1543.  
  1544. if sw52.isdropped then
  1545. sw52DTshadow.visible = 0
  1546. else
  1547. sw52DTshadow.visible = 1
  1548. end If
  1549.  
  1550. if sw51.isdropped then
  1551. sw51DTshadow.visible = 0
  1552. else
  1553. sw51DTshadow.visible = 1
  1554. end If
  1555.  
  1556. if gi12.state = 0 then
  1557. sw54DTshadow.visible = 0
  1558. sw55DTshadow.visible = 0
  1559. sw56DTshadow.visible = 0
  1560. end If
  1561.  
  1562. if gi15.state = 0 then
  1563. sw51DTshadow.visible = 0
  1564. sw52DTshadow.visible = 0
  1565. sw53DTshadow.visible = 0
  1566. end If
  1567.  
  1568. if gi69.state = 0 then
  1569. roadclosedflash.visible = 0
  1570. roadclosedlight.state = 0
  1571. end If
  1572.  
  1573. if gi50.state = 0 then
  1574. scooplightLEFT.state = 0
  1575. strawhousechimlight.state = 0
  1576. strawhouselightA.state = 0
  1577. strawhouselightB.state = 0
  1578. strawhousechimlightflasher.visible = 0
  1579. strawhouseflasher.visible = 0
  1580. end If
  1581.  
  1582. If Table1.ShowDT = true then
  1583. if li41.state = 1 then
  1584. breflectDT.visible = 1
  1585. else
  1586. breflectDT.visible = 0
  1587. end If
  1588.  
  1589. if li44.state = 1 then
  1590. sreflectDT.visible = 1
  1591. else
  1592. sreflectDT.visible = 0
  1593. end If
  1594.  
  1595. Else 'if in FS mode
  1596.  
  1597.  
  1598. if li41.state = 1 then
  1599. breflectCAB.visible = 1
  1600. else
  1601. breflectCAB.visible = 0
  1602. end If
  1603.  
  1604. if li44.state = 1 then
  1605. sreflectCAB.visible = 1
  1606. else
  1607. sreflectCAB.visible = 0
  1608. end If
  1609. End If
  1610.  
  1611.  
  1612. if gi57.state = 0 then
  1613. RunnerRedLED.state = 0
  1614. RunnerRedLEDa.state = 0
  1615. RunnerRedLEDb.state = 0
  1616. RunnerRedLEDc.state = 0
  1617. RunnerRedLEDd.state = 0
  1618. RunnerRedLEDe.state = 0
  1619. RunnerBlueLED.state = 0
  1620. RunnerBlueLEDa.state = 0
  1621. RunnerBlueLEDb.state = 0
  1622. RunnerBlueLEDc.state = 0
  1623. RunnerBlueLEDd.state = 0
  1624. RunnerBlueLEDe.state = 0
  1625. end If
  1626.  
  1627. if gi41.state = 1 then
  1628. gi41flash.visible = 1
  1629. else
  1630. gi41flash.visible = 0
  1631. end If
  1632.  
  1633. if gi64.state = 1 then
  1634. gi64flash.visible = 1
  1635. else
  1636. gi64flash.visible = 0
  1637. end If
  1638.  
  1639. if gi5.state = 1 then
  1640. outlaneleftshadow.visible = 0
  1641. else
  1642. outlaneleftshadow.visible = 1
  1643. end If
  1644.  
  1645. if gi10.state = 1 then
  1646. outlanerightshadow.visible = 0
  1647. else
  1648. outlanerightshadow.visible = 1
  1649. end If
  1650.  
  1651. if boxlight.state = 1 then
  1652. boxlightflasher.visible = 1
  1653. clownjointlit1.visible = 1
  1654. else
  1655. boxlightflasher.visible = 0
  1656. clownjointlit1.visible = 0
  1657. end If
  1658.  
  1659. if gi55.state = 0 then
  1660. boxlight.state = 0
  1661. end If
  1662.  
  1663. if DrainpostLEDglow.state = 1 then
  1664. DrainpostLEDlit.visible = 1
  1665. else
  1666. DrainpostLEDlit.visible = 0
  1667. end If
  1668.  
  1669. End Sub
  1670.  
  1671. '**************
  1672. ' Flipper Subs
  1673. '**************
  1674.  
  1675. SolCallback(sLRFlipper) = "SolRFlipper"
  1676. SolCallback(sLLFlipper) = "SolLFlipper"
  1677.  
  1678. Sub SolLFlipper(Enabled)
  1679. If Enabled Then
  1680. PlaySound SoundFX("fx_flipperup", DOFFlippers), 0, 1, -0.1, 0.05
  1681. LeftFlipper.RotateToEnd
  1682. PlaySound SoundFX("fx_flipperup", DOFFlippers), 0, 1, -0.1, 0.05
  1683. UpperFlipper.RotateToEnd
  1684. Else
  1685. PlaySound SoundFX("fx_flipperdown", DOFFlippers), 0, 1, -0.1, 0.05
  1686. LeftFlipper.RotateToStart
  1687. PlaySound SoundFX("fx_flipperdown", DOFFlippers), 0, 1, -0.1, 0.05
  1688. UpperFlipper.RotateToStart
  1689. End If
  1690. End Sub
  1691.  
  1692. Sub SolRFlipper(Enabled)
  1693. If Enabled Then
  1694. PlaySound SoundFX("fx_flipperup", DOFFlippers), 0, 1, 0.1, 0.05
  1695. RightFlipper.RotateToEnd
  1696. Else
  1697. PlaySound SoundFX("fx_flipperdown", DOFFlippers), 0, 1, 0.1, 0.05
  1698. RightFlipper.RotateToStart
  1699. End If
  1700. End Sub
  1701.  
  1702. Sub LeftFlipper_Collide(parm)
  1703. PlaySound "fx_rubber_flipper", 0, parm / 10, -0.1, 0.25
  1704. End Sub
  1705.  
  1706. Sub UpperFlipper_Collide(parm)
  1707. PlaySound "fx_rubber_flipper", 0, parm / 10, -0.1, 0.25
  1708. End Sub
  1709.  
  1710. Sub RightFlipper_Collide(parm)
  1711. PlaySound "fx_rubber_flipper", 0, parm / 10, 0.1, 0.25
  1712. End Sub
  1713.  
  1714.  
  1715. '**********************************************************
  1716. ' JP's Flasher Fading for VPX and Vpinmame v 1.0
  1717. ' (Based on Pacdude's Fading Light System)
  1718. ' This is a fast fading for the Flashers in vpinmame tables
  1719. '**********************************************************
  1720.  
  1721. Dim FadingState(200)
  1722.  
  1723. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  1724.  
  1725. ' vpinmame Lamp & Flasher Timers
  1726.  
  1727. Sub LampTimer_Timer()
  1728. Dim chgLamp, num, chg, ii
  1729. chgLamp = Controller.ChangedLamps
  1730. If Not IsEmpty(chgLamp)Then
  1731. For ii = 0 To UBound(chgLamp)
  1732. FadingState(chgLamp(ii, 0)) = chgLamp(ii, 1) + 3 'fading step
  1733. Next
  1734. End If
  1735. UpdateLamps
  1736. UpdateLeds
  1737. End Sub
  1738.  
  1739. Sub UpdateLamps
  1740. ' playfield lights
  1741. Lampm 11, li11
  1742. Flash 11, li11a
  1743. Lampm 12, li12
  1744. Flash 12, li12a
  1745. Lamp 13, li13
  1746. Lamp 14, li14
  1747. Lamp 15, li15
  1748. Lamp 16, li16
  1749. Flash 17, li17
  1750. Flash 18, li18
  1751. Flash 21, li21
  1752. Flash 22, li22
  1753. Lamp 23, li23
  1754. Lamp 24, li24
  1755. Lamp 25, li25
  1756. Lamp 26, li26
  1757. Lamp 27, li27
  1758. Lamp 28, li28
  1759. Lamp 31, li31
  1760. Lamp 32, li32
  1761. Lamp 33, li33
  1762. Lamp 34, li34
  1763. Lamp 35, li35
  1764. Lamp 36, li36
  1765. Lamp 37, li37
  1766. Lamp 38, li38
  1767. Lamp 41, li41
  1768. Lamp 42, li42
  1769. Lamp 43, li43
  1770. Lamp 44, li44
  1771. Lamp 45, li45
  1772. Lamp 46, li46
  1773. Lamp 47, li47
  1774. Lamp 48, li48
  1775. Lamp 51, li51
  1776. Lamp 52, li52
  1777. Lamp 53, li53
  1778. Lamp 54, li54
  1779. Lamp 55, li55
  1780. Lamp 56, li56
  1781. Lamp 57, li57
  1782. Lamp 58, li58
  1783. Lamp 61, li61
  1784. Lamp 62, li62
  1785. Lamp 63, li63
  1786. Lamp 64, li64
  1787. Lamp 65, li65
  1788. Lamp 66, li66
  1789. Lamp 67, li67
  1790. Lamp 68, li68
  1791. Lamp 71, li71
  1792. Lamp 72, li72
  1793. Lamp 73, li73
  1794. Lamp 74, li74
  1795. Lamp 75, li75
  1796. Lamp 76, li76
  1797. Lamp 77, li77
  1798. Lamp 78, li78
  1799. Lamp 81, li81
  1800. Lamp 82, li82
  1801. Flash 83, li83
  1802. Flash 84, li84
  1803. Lampm 85, li85
  1804. Flash 85, li85a
  1805. Lamp 86, li86
  1806. Lamp 87, li87
  1807. Lampm 88, li88
  1808. Flash 88, li88a
  1809. 'Flashers
  1810. Flashm 117, f17a
  1811. Flash 117, f17
  1812. Flashm 118, f18a
  1813. Flash 118, f18
  1814. Lamp 119, f19
  1815. Lamp 120, f20
  1816. Lampm 121, JadeLight
  1817. Lampm 121, DebbieLight
  1818. Lampm 121, lightf21
  1819. Flashm 121, f21a
  1820. Flash 121, f21
  1821. Lampm 122, f22a
  1822. Lampm 122, f22b
  1823. Flashm 122, flasherJackpotChong
  1824. Flashm 122, flasherJackpotbirdcage
  1825. Flash 122, f22
  1826. Flashm 123, flasherplasticCheech
  1827. Flashm 123, flasherplasticChong
  1828. Lampm 123, Checkpointlight
  1829. Flashm 123, f23a
  1830. Flash 123, f23
  1831. Lampm 124, CheechSpotlight
  1832. Lampm 124, CheechSpotlightglow
  1833. Lampm 124, ChongSpotlight
  1834. Lampm 124, ChongSpotlightglowA
  1835. Lampm 124, ChongSpotlightglowB
  1836. Flashm 124, f24a
  1837. Flash 124, f24
  1838. Lampm 125, lightf25
  1839. Flashm 125, f25a
  1840. Flash 125, f25
  1841. Lampm 126, lightf26
  1842. Flashm 126, f26a
  1843. Flash 126, f26
  1844. ' Lamp 128, f28
  1845. End Sub
  1846.  
  1847. ' div lamp subs
  1848.  
  1849. Sub InitLamps()
  1850. Dim x
  1851. LampTimer.Interval = 25 ' flasher fading speed
  1852. LampTimer.Enabled = 1
  1853. For x = 0 to 200
  1854. FadingState(x) = 3 ' used to track the fading state
  1855. Next
  1856. End Sub
  1857.  
  1858. Sub SetLamp(nr, value) ' 0 is off, 1 is on
  1859. FadingState(nr) = abs(value) + 3
  1860. End Sub
  1861.  
  1862. ' Lights: used for VPX standard lights, the fading is handled by VPX itself, they are here to be able to make them work together with the flashers
  1863.  
  1864. Sub Lamp(nr, object)
  1865. Select Case FadingState(nr)
  1866. Case 4:object.state = 1:FadingState(nr) = 0
  1867. Case 3:object.state = 0:FadingState(nr) = 0
  1868. End Select
  1869. End Sub
  1870.  
  1871. Sub Lampm(nr, object) ' used for multiple lights, it doesn't change the fading state
  1872. Select Case FadingState(nr)
  1873. Case 4:object.state = 1
  1874. Case 3:object.state = 0
  1875. End Select
  1876. End Sub
  1877.  
  1878. ' Flashers: 4 is on,3,2,1 fade steps. 0 is off
  1879.  
  1880. Sub Flash(nr, object)
  1881. Select Case FadingState(nr)
  1882. Case 4:Object.IntensityScale = 1:FadingState(nr) = 0
  1883. Case 3:Object.IntensityScale = 0.66:FadingState(nr) = 2
  1884. Case 2:Object.IntensityScale = 0.33:FadingState(nr) = 1
  1885. Case 1:Object.IntensityScale = 0:FadingState(nr) = 0
  1886. End Select
  1887. End Sub
  1888.  
  1889. Sub Flashm(nr, object) 'multiple flashers, it doesn't change the fading state
  1890. Select Case FadingState(nr)
  1891. Case 4:Object.IntensityScale = 1
  1892. Case 3:Object.IntensityScale = 0.66
  1893. Case 2:Object.IntensityScale = 0.33
  1894. Case 1:Object.IntensityScale = 0
  1895. End Select
  1896. End Sub
  1897.  
  1898. '**********************************************************************************************************
  1899. 'Digital Display
  1900. '**********************************************************************************************************
  1901. Dim Digits(32)
  1902. Digits(0) = Array(a00, a05, a0c, a0d, a08, a01, a06, a0f, a02, a03, a04, a07, a0b, a0a, a09, a0e)
  1903. Digits(1) = Array(a10, a15, a1c, a1d, a18, a11, a16, a1f, a12, a13, a14, a17, a1b, a1a, a19, a1e)
  1904. Digits(2) = Array(a20, a25, a2c, a2d, a28, a21, a26, a2f, a22, a23, a24, a27, a2b, a2a, a29, a2e)
  1905. Digits(3) = Array(a30, a35, a3c, a3d, a38, a31, a36, a3f, a32, a33, a34, a37, a3b, a3a, a39, a3e)
  1906. Digits(4) = Array(a40, a45, a4c, a4d, a48, a41, a46, a4f, a42, a43, a44, a47, a4b, a4a, a49, a4e)
  1907. Digits(5) = Array(a50, a55, a5c, a5d, a58, a51, a56, a5f, a52, a53, a54, a57, a5b, a5a, a59, a5e)
  1908. Digits(6) = Array(a60, a65, a6c, a6d, a68, a61, a66, a6f, a62, a63, a64, a67, a6b, a6a, a69, a6e)
  1909. Digits(7) = Array(a70, a75, a7c, a7d, a78, a71, a76, a7f, a72, a73, a74, a77, a7b, a7a, a79, a7e)
  1910. Digits(8) = Array(a80, a85, a8c, a8d, a88, a81, a86, a8f, a82, a83, a84, a87, a8b, a8a, a89, a8e)
  1911. Digits(9) = Array(a90, a95, a9c, a9d, a98, a91, a96, a9f, a92, a93, a94, a97, a9b, a9a, a99, a9e)
  1912. Digits(10) = Array(aa0, aa5, aac, aad, aa8, aa1, aa6, aaf, aa2, aa3, aa4, aa7, aab, aaa, aa9, aae)
  1913. Digits(11) = Array(ab0, ab5, abc, abd, ab8, ab1, ab6, abf, ab2, ab3, ab4, ab7, abb, aba, ab9, abe)
  1914. Digits(12) = Array(ac0, ac5, acc, acd, ac8, ac1, ac6, acf, ac2, ac3, ac4, ac7, acb, aca, ac9, ace)
  1915. Digits(13) = Array(ad0, ad5, adc, add, ad8, ad1, ad6, adf, ad2, ad3, ad4, ad7, adb, ada, ad9, ade)
  1916. Digits(14) = Array(ae0, ae5, aec, aed, ae8, ae1, ae6, aef, ae2, ae3, ae4, ae7, aeb, aea, ae9, aee)
  1917. Digits(15) = Array(af0, af5, afc, afd, af8, af1, af6, aff, af2, af3, af4, af7, afb, afa, af9, afe)
  1918.  
  1919. Digits(16) = Array(b00, b05, b0c, b0d, b08, b01, b06, b0f, b02, b03, b04, b07, b0b, b0a, b09, b0e)
  1920. Digits(17) = Array(b10, b15, b1c, b1d, b18, b11, b16, b1f, b12, b13, b14, b17, b1b, b1a, b19, b1e)
  1921. Digits(18) = Array(b20, b25, b2c, b2d, b28, b21, b26, b2f, b22, b23, b24, b27, b2b, b2a, b29, b2e)
  1922. Digits(19) = Array(b30, b35, b3c, b3d, b38, b31, b36, b3f, b32, b33, b34, b37, b3b, b3a, b39, b3e)
  1923. Digits(20) = Array(b40, b45, b4c, b4d, b48, b41, b46, b4f, b42, b43, b44, b47, b4b, b4a, b49, b4e)
  1924. Digits(21) = Array(b50, b55, b5c, b5d, b58, b51, b56, b5f, b52, b53, b54, b57, b5b, b5a, b59, b5e)
  1925. Digits(22) = Array(b60, b65, b6c, b6d, b68, b61, b66, b6f, b62, b63, b64, b67, b6b, b6a, b69, b6e)
  1926. Digits(23) = Array(b70, b75, b7c, b7d, b78, b71, b76, b7f, b72, b73, b74, b77, b7b, b7a, b79, b7e)
  1927. Digits(24) = Array(b80, b85, b8c, b8d, b88, b81, b86, b8f, b82, b83, b84, b87, b8b, b8a, b89, b8e)
  1928. Digits(25) = Array(b90, b95, b9c, b9d, b98, b91, b96, b9f, b92, b93, b94, b97, b9b, b9a, b99, b9e)
  1929. Digits(26) = Array(ba0, ba5, bac, bad, ba8, ba1, ba6, baf, ba2, ba3, ba4, ba7, bab, baa, ba9, bae)
  1930. Digits(27) = Array(bb0, bb5, bbc, bbd, bb8, bb1, bb6, bbf, bb2, bb3, bb4, bb7, bbb, bba, bb9, bbe)
  1931. Digits(28) = Array(bc0, bc5, bcc, bcd, bc8, bc1, bc6, bcf, bc2, bc3, bc4, bc7, bcb, bca, bc9, bce)
  1932. Digits(29) = Array(bd0, bd5, bdc, bdd, bd8, bd1, bd6, bdf, bd2, bd3, bd4, bd7, bdb, bda, bd9, bde)
  1933. Digits(30) = Array(be0, be5, bec, bed, be8, be1, be6, bef, be2, be3, be4, be7, beb, bea, be9, bee)
  1934. Digits(31) = Array(bf0, bf5, bfc, bfd, bf8, bf1, bf6, bff, bf2, bf3, bf4, bf7, bfb, bfa, bf9, bfe)
  1935.  
  1936. Sub UpdateLeds
  1937. Dim ChgLED, ii, jj, num, chg, stat, obj, b, x
  1938. ChgLED = Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
  1939. If Not IsEmpty(ChgLED)Then
  1940. For ii = 0 To UBound(chgLED)
  1941. num = chgLED(ii, 0):chg = chgLED(ii, 1):stat = chgLED(ii, 2)
  1942. if(num <32)then
  1943. For Each obj In Digits(num)
  1944. If chg And 1 Then obj.State = stat And 1
  1945. chg = chg \ 2:stat = stat \ 2
  1946. Next
  1947. Else
  1948. end if
  1949. Next
  1950. End If
  1951. End Sub
  1952.  
  1953. '******************************
  1954. ' Diverse Collection Hit Sounds
  1955. '******************************
  1956.  
  1957. Sub aMetals_Hit(idx):PlaySound "fx_MetalHit2", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1958. Sub aRubber_Bands_Hit(idx):PlaySound "fx_rubber_band", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1959. Sub aRubber_Posts_Hit(idx):PlaySound "fx_rubber_post", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1960. Sub aRubber_Pins_Hit(idx):PlaySound "fx_rubber_pin", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1961. Sub aPlastics_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1962. Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1963. Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1964.  
  1965. Sub REnd1_Hit:PlaySound "", 0, 1, 0.05, 0.05:End Sub
  1966.  
  1967. ' *********************************************************************
  1968. ' Supporting Ball & Sound Functions
  1969. ' *********************************************************************
  1970.  
  1971. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1972. Vol = Csng(BallVel(ball) ^2 / 2000)
  1973. End Function
  1974.  
  1975. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1976. Dim tmp
  1977. tmp = ball.x * 2 / table1.width-1
  1978. If tmp> 0 Then
  1979. Pan = Csng(tmp ^10)
  1980. Else
  1981. Pan = Csng(-((- tmp) ^10))
  1982. End If
  1983. End Function
  1984.  
  1985. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1986. Pitch = BallVel(ball) * 20
  1987. End Function
  1988.  
  1989. Function BallVel(ball) 'Calculates the ball speed
  1990. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2)))
  1991. End Function
  1992.  
  1993. Function AudioFade(ball) 'only on VPX 10.4 and newer
  1994. Dim tmp
  1995. tmp = ball.y * 2 / Table1.height-1
  1996. If tmp> 0 Then
  1997. AudioFade = Csng(tmp ^10)
  1998. Else
  1999. AudioFade = Csng(-((- tmp) ^10))
  2000. End If
  2001. End Function
  2002.  
  2003. '*****************************************
  2004. ' JP's VP10 Rolling Sounds
  2005. '*****************************************
  2006.  
  2007. Const tnob = 5 ' total number of balls
  2008. Const lob = 0 'number of locked balls
  2009. ReDim rolling(tnob)
  2010. InitRolling
  2011.  
  2012. Sub InitRolling
  2013. Dim i
  2014. For i = 0 to tnob
  2015. rolling(i) = False
  2016. Next
  2017. End Sub
  2018.  
  2019. Sub RollingUpdate()
  2020. Dim BOT, b, ballpitch
  2021. BOT = GetBalls
  2022.  
  2023. ' stop the sound of deleted balls
  2024. For b = UBound(BOT) + 1 to tnob
  2025. rolling(b) = False
  2026. StopSound("fx_ballrolling" & b)
  2027. Next
  2028.  
  2029. ' exit the sub if no balls on the table
  2030. If UBound(BOT) = lob - 1 Then Exit Sub 'there no extra balls on this table
  2031.  
  2032. ' play the rolling sound for each ball
  2033. For b = lob to UBound(BOT)
  2034. If BallVel(BOT(b))> 1 Then
  2035. If BOT(b).z <30 Then
  2036. ballpitch = Pitch(BOT(b))
  2037. Else
  2038. ballpitch = Pitch(BOT(b)) + 15000 'increase the pitch on a ramp or elevated surface
  2039. End If
  2040. rolling(b) = True
  2041. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b)), Pan(BOT(b)), 0, ballpitch, 1, 0
  2042. Else
  2043. If rolling(b) = True Then
  2044. StopSound("fx_ballrolling" & b)
  2045. rolling(b) = False
  2046. End If
  2047. End If
  2048. Next
  2049. End Sub
  2050.  
  2051. '**********************
  2052. ' Ball Collision Sound
  2053. '**********************
  2054.  
  2055. Sub OnBallBallCollision(ball1, ball2, velocity)
  2056. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  2057. End Sub
  2058.  
  2059. '******************
  2060. ' RealTime Updates
  2061. '******************
  2062.  
  2063. Set MotorCallback = GetRef("RealTimeUpdates")
  2064.  
  2065. Sub RealTimeUpdates
  2066. RollingUpdate
  2067. ClownUpdate
  2068. End Sub
  2069.  
  2070. '*************************
  2071. ' GI - needs new vpinmame
  2072. '*************************
  2073.  
  2074. Set GICallback = GetRef("GIUpdate")
  2075.  
  2076. Sub GIUpdate(no, Enabled)
  2077. For each x in aGiLights
  2078. x.State = ABS(Enabled)
  2079. Next
  2080. End Sub
  2081.  
  2082. '*****************************************
  2083. ' FLIPPER SHADOWS
  2084. '*****************************************
  2085. 'Primitive Flipper Code
  2086.  
  2087. Sub FlipperTimer_Timer
  2088. FlipperLSh.RotZ = LeftFlipper.currentangle
  2089. LFLogo.RotZ = LeftFlipper.currentangle
  2090. UpperFlipperSh.RotZ = UpperFlipper.currentangle
  2091. UFLogo.RotZ = UpperFlipper.currentangle
  2092. FlipperRSh.RotZ = RightFlipper.currentangle
  2093. RFLogo.RotZ = RightFlipper.currentangle
  2094. End Sub
  2095.  
  2096. '*****************************************
  2097. ' ninuzzu's BALL SHADOW
  2098. '*****************************************
  2099. Dim BallShadow
  2100. BallShadow = Array(BallShadow1, BallShadow2, BallShadow3, BallShadow4, BallShadow5)
  2101.  
  2102. Sub BallShadowUpdate_timer()
  2103. Dim BOT, b
  2104. BOT = GetBalls
  2105. ' hide shadow of deleted balls
  2106. If UBound(BOT) <(tnob-1)Then
  2107. For b = (UBound(BOT) + 1)to(tnob-1)
  2108. BallShadow(b).visible = 0
  2109. Next
  2110. End If
  2111. ' exit the Sub if no balls on the table
  2112. If UBound(BOT) = -1 Then Exit Sub
  2113. ' render the shadow for each ball
  2114. For b = 0 to UBound(BOT)
  2115. If BOT(b).X <Table1.Width / 2 Then
  2116. BallShadow(b).X = ((BOT(b).X)-(Ballsize / 6) + ((BOT(b).X -(Table1.Width / 2)) / 7)) + 13
  2117. Else
  2118. BallShadow(b).X = ((BOT(b).X) + (Ballsize / 6) + ((BOT(b).X -(Table1.Width / 2)) / 7))- 13
  2119. End If
  2120. ballShadow(b).Y = BOT(b).Y + 10
  2121. If BOT(b).Z> 20 Then
  2122. BallShadow(b).visible = 1
  2123. Else
  2124. BallShadow(b).visible = 0
  2125. End If
  2126. Next
  2127. End Sub
Add Comment
Please, Sign In to add comment