Arngrim

Untitled

Oct 20th, 2019
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.89 KB | None | 0 0
  1. ' El Bueno, EL Feo y el Malo
  2. ' Based on the Gotlieb's tables:
  3. ' El Dorado and Sheriff and Dakota
  4. ' VPM version by JPSalas 2009
  5. ' Uses the ROM from El Dorado City of Gold
  6.  
  7. Option Explicit
  8. Randomize
  9.  
  10. On Error Resume Next
  11. ExecuteGlobal GetTextFile("controller.vbs")
  12. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  13. On Error Goto 0
  14.  
  15. Dim DesktopMode:DesktopMode = Table1.ShowDT
  16.  
  17. Dim bsTrough, dtRBank, dtTBank, x
  18.  
  19. Const cGameName = "eldorado"
  20.  
  21. Const UseSolenoids = 1
  22. Const UseLamps = 0
  23. Const UseGI = 0
  24. Const UseSync = 0
  25. Const HandleMech = 0
  26.  
  27. ' Standard Sounds
  28. Const SSolenoidOn = "Solenoid"
  29. Const SSolenoidOff = ""
  30. Const SFlipperOn = "FlipperUp"
  31. Const SFlipperOff = "FlipperDown"
  32. Const SCoin = "coin"
  33.  
  34. LoadVPM "01120100", "sys80.vbs", 3.02
  35.  
  36. '************
  37. ' Table init.
  38. '************
  39.  
  40. Sub Table1_Init
  41. Dim ii
  42. With Controller
  43. .GameName = cGameName
  44. .Games(cGameName).Settings.Value("sound") = 0 'turn off rom sound
  45. .SplashInfoLine = "El Bueno, el Feo y el Malo" & vbNewLine & "basado en varias tablas de Gottlieb"
  46. .HandleMechanics = 0
  47. .HandleKeyboard = 0
  48. .ShowDMDOnly = 1
  49. .ShowFrame = 0
  50. .ShowTitle = 0
  51. .Hidden = DesktopMode
  52. If Err Then MsgBox Err.Description
  53. End With
  54. On Error Goto 0
  55. Controller.SolMask(0) = 0
  56. vpmTimer.AddTimer 2000, "Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the timer to renable all the solenoids after 2 seconds
  57. Controller.Run
  58.  
  59. ' Nudging
  60. vpmNudge.TiltSwitch = 57
  61. vpmNudge.Sensitivity = 5
  62. vpmNudge.TiltObj = Array(Bumper1, Bumper2, LeftSlingshot, RightSlingshot)
  63.  
  64. Set bsTrough = New cvpmTrough
  65. With bsTrough
  66. .size = 1
  67. '.entrySw = 18
  68. .initSwitches Array(67)
  69. .Initexit BallRelease, 80, 6
  70. .InitExitSounds SoundFX("fx_ballrel",DOFContactors), SoundFX("fx_ballrel",DOFContactors)
  71. .Balls = 1
  72. End With
  73.  
  74. ' Top Drop targets
  75. set dtTBank = new cvpmdroptarget
  76. With dtTBank
  77. .InitDrop Array(sw0, sw10, sw20, sw30, sw40, sw1, sw11, sw21, sw31, sw41), Array(0, 10, 20, 30, 40, 1, 11, 21, 31, 41)
  78. .Initsnd SoundFX("fx_droptarget",DOFDropTargets), SoundFX("fx_resetdrop", DOFContactors)
  79. End With
  80.  
  81. ' Right Drop targets
  82. set dtRBank = new cvpmdroptarget
  83. With dtRBank
  84. .InitDrop Array(sw2, sw12, sw22, sw32, sw42), Array(2, 12, 22, 32, 42)
  85. .Initsnd SoundFX("fx_droptarget",DOFDropTargets), SoundFX("fx_resetdrop",DOFContactors)
  86. End With
  87.  
  88. ' Main Timer init
  89. PinMAMETimer.Interval = PinMAMEInterval
  90. PinMAMETimer.Enabled = 1
  91.  
  92. ' Start the music from Fast Draw table
  93. MusicOn
  94.  
  95. ' Remove the cabinet rails if in FS mode
  96. If Table1.ShowDT = False then
  97. lrail.Visible = False
  98. rrail.Visible = False
  99. ramp4.Visible = False
  100. ramp5.Visible = False
  101. For each ii in aReels
  102. ii.Visible = 0
  103. Next
  104. End If
  105. End Sub
  106.  
  107. Sub Table1_Paused:Controller.Pause = 1:End Sub
  108. Sub Table1_unPaused:Controller.Pause = 0:End Sub
  109.  
  110. Sub MusicOn
  111. Dim x
  112. x = INT(5 * RND(1) )
  113. Select Case x
  114. Case 0:PlayMusic "FD_1.mp3"
  115. Case 1:PlayMusic "FD_2.mp3"
  116. Case 2:PlayMusic "FD_3.mp3"
  117. Case 3:PlayMusic "FD_4.mp3"
  118. Case 4:PlayMusic "FD_5.mp3"
  119. End Select
  120. End Sub
  121.  
  122. Sub Table1_MusicDone()
  123. MusicOn
  124. End Sub
  125.  
  126. '**********
  127. ' Keys
  128. '**********
  129.  
  130. Sub table1_KeyDown(ByVal Keycode)
  131. If vpmKeyDown(keycode) Then Exit Sub
  132. If keyCode = LeftFlipperKey Then Controller.Switch(6) = 1
  133. If keyCode = RightFlipperKey Then Controller.Switch(16) = 1
  134. If keycode = PlungerKey Then Plunger.Pullback
  135. If keycode = LeftTiltKey Then Nudge 90, 4:PlaySound SoundFX("fx_nudge",0), 0, 1, -0.1, 0.25
  136. If keycode = RightTiltKey Then Nudge 270, 4:PlaySound SoundFX("fx_nudge",0), 0, 1, 0.1, 0.25
  137. If keycode = CenterTiltKey Then Nudge 0, 5:PlaySound SoundFX("fx_nudge",0), 0, 1, 0, 0.25
  138. End Sub
  139.  
  140. Sub table1_KeyUp(ByVal Keycode)
  141. If vpmKeyUp(keycode) Then Exit Sub
  142. If keyCode = LeftFlipperKey Then Controller.Switch(6) = 0
  143. If keyCode = RightFlipperKey Then Controller.Switch(16) = 0
  144. If keycode = PlungerKey Then Plunger.Fire
  145. End Sub
  146.  
  147. '*********
  148. ' Switches
  149. '*********
  150.  
  151. ' Slingsshots
  152. Dim LStep, RStep
  153.  
  154. Sub LeftSlingShot_Slingshot
  155. PlaySound SoundFX("fx_slingshot",DOFContactors), 0, 1, -0.05, 0.05
  156. DOF 101, DOFPulse
  157. LeftSling4.Visible = 1
  158. Lemk.RotX = 26
  159. LStep = 0
  160. vpmTimer.PulseSw 66
  161. LeftSlingShot.TimerEnabled = 1
  162. End Sub
  163.  
  164. Sub LeftSlingShot_Timer
  165. Select Case LStep
  166. Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14
  167. Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2
  168. Case 3:LeftSLing2.Visible = 0:Lemk.RotX = -10:LeftSlingShot.TimerEnabled = 0
  169. End Select
  170.  
  171. LStep = LStep + 1
  172. End Sub
  173.  
  174. Sub RightSlingShot_Slingshot
  175. PlaySound SoundFX("fx_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  176. DOF 102, DOFPulse
  177. RightSling4.Visible = 1
  178. Remk.RotX = 26
  179. RStep = 0
  180. vpmTimer.PulseSw 66
  181. RightSlingShot.TimerEnabled = 1
  182. End Sub
  183.  
  184. Sub RightSlingShot_Timer
  185. Select Case RStep
  186. Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14
  187. Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2
  188. Case 3:RightSLing2.Visible = 0:Remk.RotX = -10:RightSlingShot.TimerEnabled = 0
  189. End Select
  190.  
  191. RStep = RStep + 1
  192. End Sub
  193.  
  194. ' Bumpers
  195. Sub Bumper1_Hit:vpmTimer.PulseSw 55:PlaySound SoundFXDOF("fx_bumper",103,DOFPulse,DOFContactors), 0, 1, 0.01, 0.25:End Sub
  196.  
  197. Sub Bumper2_Hit:vpmTimer.PulseSw 55:PlaySound SoundFXDOF("fx_bumper",104,DOFPulse,DOFContactors), 0, 1, -0.01, 0.25:End Sub
  198.  
  199. ' Drain & holes
  200. Sub Drain_Hit:Playsound "drain":bsTrough.AddBall Me:Gate.RotateToStart:PlayBonus.Enabled = 1:End Sub
  201.  
  202. ' Rollovers
  203. Sub sw53_Hit:Controller.Switch(53) = 1:PlaySound "fx_sensor"
  204. If l33.State Then
  205. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  206. Else
  207. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  208. End If
  209. End Sub
  210.  
  211. Sub sw53_UnHit:Controller.Switch(53) = 0:End Sub
  212.  
  213. Sub sw63_Hit:Controller.Switch(63) = 1:PlaySound "fx_sensor"
  214. If l34.State Then
  215. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  216. Else
  217. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  218. End If
  219. End Sub
  220. Sub sw63_UnHit:Controller.Switch(63) = 0:End Sub
  221.  
  222. Sub sw54_Hit:Controller.Switch(54) = 1:PlaySound "fx_sensor"
  223. If l35.State Then
  224. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  225. Else
  226. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  227. End If
  228. End Sub
  229. Sub sw54_UnHit:Controller.Switch(54) = 0:End Sub
  230.  
  231. Sub sw64_Hit:Controller.Switch(64) = 1:PlaySound "fx_sensor"
  232. If l36.State Then
  233. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  234. Else
  235. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  236. End If
  237. End Sub
  238. Sub sw64_UnHit:Controller.Switch(64) = 0:End Sub
  239.  
  240. Sub sw52_Hit:Controller.Switch(52) = 1:PlaySound "fx_sensor"
  241. If l31.State Then
  242. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  243. Else
  244. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  245. End If
  246. End Sub
  247. Sub sw52_UnHit:Controller.Switch(52) = 0:End Sub
  248.  
  249. Sub sw62_Hit:Controller.Switch(62) = 1:PlaySound "fx_sensor"
  250. If l32.State Then
  251. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  252. Else
  253. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  254. End If
  255. End Sub
  256. Sub sw62_UnHit:Controller.Switch(62) = 0:End Sub
  257.  
  258. Sub sw61_Hit:Controller.Switch(61) = 1:PlaySound "fx_sensor"
  259. If l30.State Then
  260. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  261. Else
  262. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  263. End If
  264. End Sub
  265. Sub sw61_UnHit:Controller.Switch(61) = 0:End Sub
  266.  
  267. Sub sw61a_Hit:Controller.Switch(61) = 1:PlaySound "fx_sensor"
  268. If l30b.State Then
  269. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  270. Else
  271. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  272. End If
  273. End Sub
  274. Sub sw61a_UnHit:Controller.Switch(61) = 0:End Sub
  275.  
  276. Sub sw50_Hit:Controller.Switch(50) = 1:PlaySound "fx_sensor"
  277. If l27.State Then
  278. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  279. Else
  280. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  281. End If
  282. End Sub
  283. Sub sw50_UnHit:Controller.Switch(50) = 0:End Sub
  284.  
  285. Sub sw50a_Hit:Controller.Switch(50) = 1:PlaySound "fx_sensor"
  286. If l27b.State Then
  287. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  288. Else
  289. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  290. End If
  291. End Sub
  292. Sub sw50a_UnHit:Controller.Switch(50) = 0:End Sub
  293.  
  294. Sub sw60_Hit:Controller.Switch(60) = 1:PlaySound "fx_sensor"
  295. If l28.State Then
  296. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  297. Else
  298. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  299. End If
  300. End Sub
  301. Sub sw60_UnHit:Controller.Switch(60) = 0:End Sub
  302.  
  303. Sub sw60a_Hit:Controller.Switch(60) = 1:PlaySound "fx_sensor"
  304. If l28b.State Then
  305. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  306. Else
  307. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  308. End If
  309. End Sub
  310. Sub sw60a_UnHit:Controller.Switch(60) = 0:End Sub
  311.  
  312. Sub sw51_Hit:Controller.Switch(51) = 1:PlaySound "fx_sensor"
  313. If l29.State Then
  314. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  315. Else
  316. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  317. End If
  318. End Sub
  319. Sub sw51_UnHit:Controller.Switch(51) = 0:End Sub
  320.  
  321. Sub sw51a_Hit:Controller.Switch(51) = 1:PlaySound "fx_sensor"
  322. If l29b.State Then
  323. PlaySound SoundFXDOF("fx_5000",121,DOFPulse,DOFChimes)
  324. Else
  325. PlaySound SoundFXDOF("fx_500",120,DOFPulse,DOFChimes)
  326. End If
  327. End Sub
  328. Sub sw51a_UnHit:Controller.Switch(51) = 0:End Sub
  329.  
  330. ' Targets
  331. Sub sw65_Hit:vpmTimer.PulseSw 65:sw65p.X=sw65p.X+3:sw65p.Y=sw65p.Y-3:Me.TimerEnabled = 1:PlaySound "fx_target", 0, 1, 0.1, 0.25:Gate.RotateToStart:End Sub
  332. Sub sw65_Timer:sw65p.X=sw65p.X-3:sw65p.Y=sw65p.Y+3:PlaySound "Gun2":Me.TimerEnabled = 0:End Sub
  333. Sub sw65b_Hit:vpmTimer.PulseSw 65:sw65bp.X=sw65bp.X+3:sw65bp.Y=sw65bp.Y-3:Me.TimerEnabled = 1:PlaySound "fx_target", 0, 1, 0.1, 0.25:Gate.RotateToEnd:End Sub
  334. Sub sw65b_Timer:sw65bp.X=sw65bp.X-3:sw65bp.Y=sw65bp.Y+3:PlaySound "Gun1":Me.TimerEnabled = 0:End Sub
  335. Sub sw65d_Hit:vpmTimer.PulseSw 65:sw65dp.X=sw65dp.X+3:sw65dp.Y=sw65dp.Y-3:Me.TimerEnabled = 1:PlaySound "fx_target", 0, 1, 0.1, 0.25:Gate.RotateToStart:End Sub
  336. Sub sw65d_Timer:sw65dp.X=sw65dp.X-3:sw65dp.Y=sw65dp.Y+3:PlaySound "Gun2":Me.TimerEnabled = 0:End Sub
  337.  
  338. ' Droptargets
  339. Sub sw0_Hit:dtTBank.hit 1:PlaySound "fx_droptarget", 0, 1, -0.1, 0.25
  340. If l12.State Then
  341. PlaySound "fx_5000"
  342. Else
  343. PlaySound "fx_500"
  344. End If
  345. End Sub
  346. Sub sw10_Hit:dtTBank.hit 2:PlaySound "fx_droptarget", 0, 1, -0.1, 0.25
  347. If l13.State Then
  348. PlaySound "fx_5000"
  349. Else
  350. PlaySound "fx_500"
  351. End If
  352. End Sub
  353. Sub sw20_Hit:dtTBank.hit 3:PlaySound "fx_droptarget", 0, 1, -0.1, 0.25
  354. If l14.State Then
  355. PlaySound "fx_5000"
  356. Else
  357. PlaySound "fx_500"
  358. End If
  359. End Sub
  360. Sub sw30_Hit:dtTBank.hit 4:PlaySound "fx_droptarget", 0, 1, -0.1, 0.25
  361. If l15.State Then
  362. PlaySound "fx_5000"
  363. Else
  364. PlaySound "fx_500"
  365. End If
  366. End Sub
  367. Sub sw40_Hit:dtTBank.hit 5:PlaySound "fx_droptarget", 0, 1, -0.1, 0.25
  368. If l16.State Then
  369. PlaySound "fx_5000"
  370. Else
  371. PlaySound "fx_500"
  372. End If
  373. End Sub
  374. Sub sw1_Hit:dtTBank.hit 6:PlaySound "fx_droptarget", 0, 1, -0.1, 0.25
  375. If l17.State Then
  376. PlaySound "fx_5000"
  377. Else
  378. PlaySound "fx_500"
  379. End If
  380. End Sub
  381. Sub sw11_Hit:dtTBank.hit 7:PlaySound "fx_droptarget", 0, 1, -0.1, 0.25
  382. If l18.State Then
  383. PlaySound "fx_5000"
  384. Else
  385. PlaySound "fx_500"
  386. End If
  387. End Sub
  388. Sub sw21_Hit:dtTBank.hit 8:PlaySound "fx_droptarget", 0, 1, -0.1, 0.25
  389. If l19.State Then
  390. PlaySound "fx_5000"
  391. Else
  392. PlaySound "fx_500"
  393. End If
  394. End Sub
  395. Sub sw31_Hit:dtTBank.hit 9:PlaySound "fx_droptarget", 0, 1, -0.1, 0.25
  396. If l20.State Then
  397. PlaySound "fx_5000"
  398. Else
  399. PlaySound "fx_500"
  400. End If
  401. End Sub
  402. Sub sw41_Hit:dtTBank.hit 10:PlaySound "fx_droptarget", 0, 1, -0.1, 0.25
  403. If l21.State Then
  404. PlaySound "fx_5000"
  405. Else
  406. PlaySound "fx_500"
  407. End If
  408. End Sub
  409. Sub sw2_Hit:dtRBank.hit 1:PlaySound "fx_droptarget"
  410. If l22.State Then
  411. PlaySound "fx_5000"
  412. Else
  413. PlaySound "fx_500"
  414. End If
  415. End Sub
  416. Sub sw12_Hit:dtRBank.hit 2:PlaySound "fx_droptarget"
  417. If l23.State Then
  418. PlaySound "fx_5000"
  419. Else
  420. PlaySound "fx_500"
  421. End If
  422. End Sub
  423. Sub sw22_Hit:dtRBank.hit 3:PlaySound "fx_droptarget"
  424. If l24.State Then
  425. PlaySound "fx_5000"
  426. Else
  427. PlaySound "fx_500"
  428. End If
  429. End Sub
  430. Sub sw32_Hit:dtRBank.hit 4:PlaySound "fx_droptarget"
  431. If l25.State Then
  432. PlaySound "fx_5000"
  433. Else
  434. PlaySound "fx_500"
  435. End If
  436. End Sub
  437. Sub sw42_Hit:dtRBank.hit 5:PlaySound "fx_droptarget"
  438. If l26.State Then
  439. PlaySound "fx_5000"
  440. Else
  441. PlaySound "fx_500"
  442. End If
  443. End Sub
  444.  
  445.  
  446. '*********
  447. 'Solenoids
  448. '*********
  449. SolCallback(5) = "dtRBank.SolDropUp"
  450. SolCallback(6) = "dtTbank.SolDropUp"
  451. solcallback(8) = "vpmsolsound SoundFX(""fx_knocker"",DOFKnocker),"
  452. solcallback(9) = "bsTrough.SolOut"
  453.  
  454. '**************
  455. ' Flipper Subs
  456. '**************
  457.  
  458. SolCallback(sLRFlipper) = "SolRFlipper"
  459. SolCallback(sLLFlipper) = "SolLFlipper"
  460.  
  461. Sub SolLFlipper(Enabled)
  462. If Enabled Then
  463. PlaySound SoundFX("fx_flipperup",DOFFlippers), 0, 1, -0.1, 0.25
  464. LeftFlipper.RotateToEnd
  465. Else
  466. PlaySound SoundFX("fx_flipperdown",DOFFlippers), 0, 1, -0.1, 0.25
  467. LeftFlipper.RotateToStart
  468. End If
  469. End Sub
  470.  
  471. Sub SolRFlipper(Enabled)
  472. If Enabled Then
  473. PlaySound SoundFX("fx_flipperup",DOFFlippers), 0, 1, 0.1, 0.25
  474. RightFlipper.RotateToEnd
  475. Else
  476. PlaySound SoundFX("fx_flipperdown",DOFFlippers), 0, 1, 0.1, 0.25
  477. RightFlipper.RotateToStart
  478. End If
  479. End Sub
  480.  
  481. Sub LeftFlipper_Collide(parm)
  482. PlaySound "fx_rubber_flipper", 0, parm / 10, -0.1, 0.25
  483. End Sub
  484.  
  485. Sub RightFlipper_Collide(parm)
  486. PlaySound "fx_rubber_flipper", 0, parm / 10, 0.1, 0.25
  487. End Sub
  488.  
  489. '**************
  490. ' Extra sounds
  491. '**************
  492.  
  493. Sub aRubbers_Hit(idx):vpmTimer.PulseSw 66: PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  494. Sub aPostRubbers_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  495. Sub aMetals_Hit(idx):PlaySound "fx_MetalHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  496. Sub aPlastics_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  497. Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  498. Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  499.  
  500. '************************
  501. ' Check Bonus
  502. '************************
  503.  
  504. Dim BonusLamps, OldState
  505. BonusLamps = Array(37, 38, 39, 40, 41, 42, 43, 44, 45, 46) 'bonus lights
  506. PlayBonus.Enabled = 0
  507.  
  508. Sub PlayBonus_Timer()
  509. Dim lamp, ii, state
  510. ii = 0
  511. state = 0
  512. For each lamp in BonusLamps
  513. If LampState(lamp) Then state = state + 2 ^ii
  514.  
  515. ii = ii + 1
  516. Next
  517. If(OldState <> state) Then PlaySound "fx_Bonus"
  518. OldState = state
  519. If(state = 1 and LampState(47) = 0) Or LampState(11) = 1 Then PlayBonus.Enabled = 0
  520. End Sub
  521.  
  522. '************************************
  523. ' LEDs Display
  524. '************************************
  525.  
  526. Dim Digits(32)
  527.  
  528. Set Digits(0) = a0
  529. Set Digits(1) = a1
  530. Set Digits(2) = a2
  531. Set Digits(3) = a3
  532. Set Digits(4) = a4
  533. Set Digits(5) = a5
  534. Set Digits(6) = a6
  535.  
  536. Set Digits(7) = b0
  537. Set Digits(8) = b1
  538. Set Digits(9) = b2
  539. Set Digits(10) = b3
  540. Set Digits(11) = b4
  541. Set Digits(12) = b5
  542. Set Digits(13) = b6
  543.  
  544. Set Digits(14) = c0
  545. Set Digits(15) = c1
  546. Set Digits(16) = c2
  547. Set Digits(17) = c3
  548. Set Digits(18) = c4
  549. Set Digits(19) = c5
  550. Set Digits(20) = c6
  551.  
  552. Set Digits(21) = d0
  553. Set Digits(22) = d1
  554. Set Digits(23) = d2
  555. Set Digits(24) = d3
  556. Set Digits(25) = d4
  557. Set Digits(26) = d5
  558. Set Digits(27) = d6
  559.  
  560. Set Digits(28) = e0
  561. Set Digits(29) = e1
  562. Set Digits(30) = e2
  563. Set Digits(31) = e3
  564.  
  565. Sub LEDs_Timer
  566. On Error Resume Next
  567. Dim ChgLED, ii, jj, chg, stat
  568. ChgLED = Controller.ChangedLEDs(&H0000003f, &Hffffffff)
  569. If Not IsEmpty(ChgLED) Then
  570. For ii = 0 To UBound(ChgLED)
  571. chg = chgLED(ii, 1):stat = chgLED(ii, 2)
  572.  
  573. Select Case stat
  574. Case 0:Digits(chgLED(ii, 0) ).SetValue 0 'empty
  575. Case 63:Digits(chgLED(ii, 0) ).SetValue 1 '0
  576. Case 6:Digits(chgLED(ii, 0) ).SetValue 2 '1
  577. Case 91:Digits(chgLED(ii, 0) ).SetValue 3 '2
  578. Case 79:Digits(chgLED(ii, 0) ).SetValue 4 '3
  579. Case 102:Digits(chgLED(ii, 0) ).SetValue 5 '4
  580. Case 109:Digits(chgLED(ii, 0) ).SetValue 6 '5
  581. Case 124:Digits(chgLED(ii, 0) ).SetValue 7 '6
  582. Case 125:Digits(chgLED(ii, 0) ).SetValue 7 '6
  583. Case 252:Digits(chgLED(ii, 0) ).SetValue 7 '6
  584. Case 7:Digits(chgLED(ii, 0) ).SetValue 8 '7
  585. Case 127:Digits(chgLED(ii, 0) ).SetValue 9 '8
  586. Case 103:Digits(chgLED(ii, 0) ).SetValue 10 '9
  587. Case 111:Digits(chgLED(ii, 0) ).SetValue 10 '9
  588. Case 231:Digits(chgLED(ii, 0) ).SetValue 10 '9
  589. Case 128:Digits(chgLED(ii, 0) ).SetValue 0 'empty
  590. Case 191:Digits(chgLED(ii, 0) ).SetValue 1 '0
  591. Case 832:Digits(chgLED(ii, 0) ).SetValue 2 '1
  592. Case 896:Digits(chgLED(ii, 0) ).SetValue 2 '1
  593. Case 768:Digits(chgLED(ii, 0) ).SetValue 2 '1
  594. Case 134:Digits(chgLED(ii, 0) ).SetValue 2 '1
  595. Case 219:Digits(chgLED(ii, 0) ).SetValue 3 '2
  596. Case 207:Digits(chgLED(ii, 0) ).SetValue 4 '3
  597. Case 230:Digits(chgLED(ii, 0) ).SetValue 5 '4
  598. Case 237:Digits(chgLED(ii, 0) ).SetValue 6 '5
  599. Case 253:Digits(chgLED(ii, 0) ).SetValue 7 '6
  600. Case 135:Digits(chgLED(ii, 0) ).SetValue 8 '7
  601. Case 255:Digits(chgLED(ii, 0) ).SetValue 9 '8
  602. Case 239:Digits(chgLED(ii, 0) ).SetValue 10 '9
  603. End Select
  604. Next
  605. End IF
  606. End Sub
  607.  
  608. '***************************************************
  609. ' JP's VP10 Fading Lamps & Flashers
  610. ' Based on PD's Fading Light System
  611. ' SetLamp 0 is Off
  612. ' SetLamp 1 is On
  613. ' fading for non opacity objects is 4 steps
  614. '***************************************************
  615.  
  616. Dim LampState(200), FadingLevel(200)
  617. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  618.  
  619. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  620. LampTimer.Interval = 10 'lamp fading speed
  621. LampTimer.Enabled = 1
  622.  
  623. ' Lamp & Flasher Timers
  624.  
  625. Sub LampTimer_Timer()
  626. Dim chgLamp, num, chg, ii
  627. chgLamp = Controller.ChangedLamps
  628. If Not IsEmpty(chgLamp) Then
  629. For ii = 0 To UBound(chgLamp)
  630. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  631.  
  632. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  633. Next
  634. End If
  635.  
  636. UpdateLamps
  637. End Sub
  638.  
  639. Sub UpdateLamps()
  640.  
  641. NFadeL 3, l3
  642. NFadeL 4, l4
  643. NFadeL 5, l5
  644. NFadeL 6, l6
  645. NFadeL 7, l7
  646. FadeR 8, l8
  647. FadeR 10, l10
  648. FadeR 11, l11
  649. NFadeL 12, l12
  650. NFadeL 13, l13
  651. NFadeL 14, l14
  652. NFadeL 15, l15
  653. NFadeL 16, l16
  654. NFadeL 17, l17
  655. NFadeL 18, l18
  656. NFadeL 19, l19
  657. NFadeL 20, l20
  658. NFadeL 21, l21
  659. NFadeL 22, l22
  660. NFadeL 23, l23
  661. NFadeL 24, l24
  662. NFadeL 25, l25
  663. NFadeL 26, l26
  664. NFadeLm 27, l27b
  665. NFadeL 27, l27
  666. NFadeLm 28, l28b
  667. NFadeL 28, l28
  668. NFadeLm 29, l29b
  669. NFadeL 29, l29
  670. NFadeLm 30, l30b
  671. NFadeL 30, l30
  672. NFadeL 31, l31
  673. NFadeL 32, l32
  674. NFadeL 33, l33
  675. NFadeL 34, l34
  676. NFadeL 35, l35
  677. NFadeL 36, l36
  678. NFadeL 37, l37
  679. NFadeL 38, l38
  680. NFadeL 39, l39
  681. NFadeL 40, l40
  682. NFadeL 41, l41
  683. NFadeL 42, l42
  684. NFadeL 43, l43
  685. NFadeL 44, l44
  686. NFadeL 45, l45
  687. NFadeL 46, l46
  688. NFadeL 47, l47
  689. NFadeLm 90,bumper1light 'bumper 1
  690. NFadeL 90,bumper1light1 'bumper 1
  691. NFadeLm 91, bumper2light 'bumper 22
  692. NFadeL 91, bumper2light1 'bumper 22
  693. End Sub
  694.  
  695. Sub InitLamps()
  696. Dim x
  697. For x = 0 to 200
  698. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  699. FadingLevel(x) = 4 ' used to track the fading state
  700. FlashSpeedUp(x) = 0.2 ' faster speed when turning on the flasher
  701. FlashSpeedDown(x) = 0.1 ' slower speed when turning off the flasher
  702. FlashMax(x) = 1 ' the maximum value when on, usually 1
  703. FlashMin(x) = 0 ' the minimum value when off, usually 0
  704. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  705. Next
  706. End Sub
  707.  
  708. Sub AllLampsOff
  709. Dim x
  710. For x = 0 to 200
  711. SetLamp x, 0
  712. Next
  713. End Sub
  714.  
  715. Sub SetLamp(nr, value)
  716. If value <> LampState(nr) Then
  717. LampState(nr) = abs(value)
  718. FadingLevel(nr) = abs(value) + 4
  719. End If
  720. End Sub
  721.  
  722. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  723.  
  724. Sub NFadeL(nr, object)
  725. Select Case FadingLevel(nr)
  726. Case 4:object.state = 0:FadingLevel(nr) = 0
  727. Case 5:object.state = 1:FadingLevel(nr) = 1
  728. End Select
  729. End Sub
  730.  
  731. Sub NFadeLm(nr, object) ' used for multiple lights
  732. Select Case FadingLevel(nr)
  733. Case 4:object.state = 0
  734. Case 5:object.state = 1
  735. End Select
  736. End Sub
  737.  
  738. 'Lights, Ramps & Primitives used as 4 step fading lights
  739. 'a,b,c,d are the images used from on to off
  740.  
  741. Sub FadeObj(nr, object, a, b, c, d)
  742. Select Case FadingLevel(nr)
  743. Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
  744. Case 5:object.image = a:FadingLevel(nr) = 1 'ON
  745. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  746. Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  747. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  748. Case 13:object.image = d:FadingLevel(nr) = 0 'Off
  749. End Select
  750. End Sub
  751.  
  752. Sub FadeObjm(nr, object, a, b, c, d)
  753. Select Case FadingLevel(nr)
  754. Case 4:object.image = b
  755. Case 5:object.image = a
  756. Case 9:object.image = c
  757. Case 13:object.image = d
  758. End Select
  759. End Sub
  760.  
  761. Sub NFadeObj(nr, object, a, b)
  762. Select Case FadingLevel(nr)
  763. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  764. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  765. End Select
  766. End Sub
  767.  
  768. Sub NFadeObjm(nr, object, a, b)
  769. Select Case FadingLevel(nr)
  770. Case 4:object.image = b
  771. Case 5:object.image = a
  772. End Select
  773. End Sub
  774.  
  775. ' Flasher objects
  776.  
  777. Sub Flash(nr, object)
  778. Select Case FadingLevel(nr)
  779. Case 4 'off
  780. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  781. If FlashLevel(nr) < FlashMin(nr) Then
  782. FlashLevel(nr) = FlashMin(nr)
  783. FadingLevel(nr) = 0 'completely off
  784. End if
  785. Object.IntensityScale = FlashLevel(nr)
  786. Case 5 ' on
  787. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  788. If FlashLevel(nr) > FlashMax(nr) Then
  789. FlashLevel(nr) = FlashMax(nr)
  790. FadingLevel(nr) = 1 'completely on
  791. End if
  792. Object.IntensityScale = FlashLevel(nr)
  793. End Select
  794. End Sub
  795.  
  796. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  797. Object.IntensityScale = FlashLevel(nr)
  798. End Sub
  799.  
  800. ' Desktop Objects: Reels & texts (you may also use lights on the desktop)
  801.  
  802. ' Reels
  803.  
  804. Sub FadeR(nr, object)
  805. Select Case FadingLevel(nr)
  806. Case 4:object.SetValue 1:FadingLevel(nr) = 6 'fading to off...
  807. Case 5:object.SetValue 0:FadingLevel(nr) = 1 'ON
  808. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  809. Case 9:object.SetValue 2:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  810. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  811. Case 13:object.SetValue 3:FadingLevel(nr) = 0 'Off
  812. End Select
  813. End Sub
  814.  
  815. Sub FadeRm(nr, object)
  816. Select Case FadingLevel(nr)
  817. Case 4:object.SetValue 1
  818. Case 5:object.SetValue 0
  819. Case 9:object.SetValue 2
  820. Case 3:object.SetValue 3
  821. End Select
  822. End Sub
  823.  
  824. 'Texts
  825.  
  826. Sub NFadeT(nr, object, message)
  827. Select Case FadingLevel(nr)
  828. Case 4:object.Text = "":FadingLevel(nr) = 0
  829. Case 5:object.Text = message:FadingLevel(nr) = 1
  830. End Select
  831. End Sub
  832.  
  833. Sub NFadeTm(nr, object, b)
  834. Select Case FadingLevel(nr)
  835. Case 4:object.Text = ""
  836. Case 5:object.Text = message
  837. End Select
  838. End Sub
  839.  
  840.  
  841. ' *********************************************************************
  842. ' Supporting Ball & Sound Functions
  843. ' *********************************************************************
  844.  
  845. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  846. Vol = Csng(BallVel(ball) ^2 / 2000)
  847. End Function
  848.  
  849. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  850. Dim tmp
  851. tmp = ball.x * 2 / table1.width-1
  852. If tmp > 0 Then
  853. Pan = Csng(tmp ^10)
  854. Else
  855. Pan = Csng(-((- tmp) ^10) )
  856. End If
  857. End Function
  858.  
  859. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  860. Pitch = BallVel(ball) * 20
  861. End Function
  862.  
  863. Function BallVel(ball) 'Calculates the ball speed
  864. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  865. End Function
  866.  
  867. '*****************************************
  868. ' JP's VP10 Rolling Sounds
  869. '*****************************************
  870.  
  871. Const tnob = 5 ' total number of balls in this table is 4, but always use a higher number here bacuse of the timing
  872. ReDim rolling(tnob)
  873. InitRolling
  874.  
  875. Sub InitRolling
  876. Dim i
  877. For i = 0 to tnob
  878. rolling(i) = False
  879. Next
  880. End Sub
  881.  
  882. Sub RollingUpdate()
  883. Dim BOT, b
  884. BOT = GetBalls
  885.  
  886. ' stop the sound of deleted balls
  887. For b = UBound(BOT) + 1 to tnob
  888. rolling(b) = False
  889.  
  890. StopSound("fx_ballrolling" & b)
  891. Next
  892.  
  893. ' exit the sub if no balls on the table
  894. If UBound(BOT) = -1 Then Exit Sub
  895.  
  896. ' play the rolling sound for each ball
  897. For b = 0 to UBound(BOT)
  898. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  899. rolling(b) = True
  900. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  901. Else
  902. If rolling(b) = True Then
  903. StopSound("fx_ballrolling" & b)
  904. rolling(b) = False
  905. End If
  906. End If
  907. Next
  908. End Sub
  909.  
  910. '**********************
  911. ' Ball Collision Sound
  912. '**********************
  913.  
  914. Sub OnBallBallCollision(ball1, ball2, velocity)
  915. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  916. End Sub
  917.  
  918. '******************
  919. ' GI effects
  920. ' independent routine
  921. ' it turns on the gi
  922. ' when there is a ball
  923. ' in play
  924. '******************
  925.  
  926. Dim OldGiState, GiIsOn
  927. OldGiState = -1 'start witht the Gi off
  928. GiIsOn = False
  929.  
  930. Sub GIUpdate
  931. Dim tmp, obj
  932. tmp = Getballs
  933. If UBound(tmp) <> OldGiState Then
  934. OldGiState = Ubound(tmp)
  935. If UBound(tmp) = -1 Then '-1 is the value returned by Getballs when no balls are on the table, so turn off the gi
  936. GiOff
  937. Else
  938. Gion
  939. End If
  940. End If
  941. End Sub
  942.  
  943. Sub GiOn
  944. Dim bulb
  945. GiIsOn = True
  946. For each bulb in aGiLights
  947. bulb.State = 1
  948. Next
  949. End Sub
  950.  
  951. Sub GiOff
  952. Dim bulb
  953. GiIsOn = False
  954. For each bulb in aGiLights
  955. bulb.State = 0
  956. Next
  957. End Sub
  958.  
  959. '******************
  960. ' RealTime Updates
  961. '******************
  962.  
  963. Set MotorCallback = GetRef("RealTimeUpdates")
  964.  
  965. Sub RealTimeUpdates
  966. Gatep.RotZ = Gate.CurrentAngle
  967. RollingUpdate
  968. GIUpdate
  969. End Sub
  970.  
  971. 'Gottlieb El Dorado City of Gold
  972. 'by Inkochnito
  973. Sub editDips
  974. Dim vpmDips:Set vpmDips = New cvpmDips
  975. With vpmDips
  976. .AddForm 700, 400, "El Bueno el Feo y el Malo - DIP switches"
  977. .AddFrame 2, 2, 190, "Maximum credits", 49152, Array("8 credits", 0, "10 credits", 32768, "15 credits", &H00004000, "20 credits", 49152) 'dip 15&16
  978. .AddFrame 2, 80, 190, "Coin chute 1 and 2 control", &H00002000, Array("seperate", 0, "same", &H00002000) 'dip 14
  979. .AddFrame 2, 126, 190, "Playfield special", &H00200000, Array("replay", 0, "extra ball", &H00200000) 'dip 22
  980. .AddFrame 2, 172, 190, "Game mode", &H10000000, Array("replay", 0, "extra ball", &H10000000) 'dip 29
  981. .AddChk 2, 227, 190, Array("Match feature", &H02000000) 'dip 26
  982. .AddChk 2, 248, 190, Array("Background sound", &H40000000) 'dip 31
  983. .AddFrame 205, 2, 190, "High score to date awards", &H00C00000, Array("not displayed and no award", 0, "displayed and no award", &H00800000, "displayed and 2 replays", &H00400000, "displayed and 3 replays", &H00C00000) 'dip 23&24
  984. .AddFrame 205, 80, 190, "Balls per game", &H01000000, Array("5 balls", 0, "3 balls", &H01000000) 'dip 25
  985. .AddFrame 205, 126, 190, "Replay limit", &H04000000, Array("no limit", 0, "one per ball", &H04000000) 'dip 27
  986. .AddFrame 205, 172, 190, "Novelty", &H08000000, Array("normal", 0, "points", &H0800000) 'dip 28
  987. .AddFrame 205, 218, 190, "3rd coin chute credits control", &H20000000, Array("no effect", 0, "add 9", &H20000000) 'dip 30
  988. .AddLabel 50, 270, 300, 20, "After hitting OK, press F3 to reset game with new settings."
  989. .ViewDips
  990. End With
  991. End Sub
  992. Set vpmShowDips = GetRef("editDips")
Advertisement
Add Comment
Please, Sign In to add comment